:root {
    --bg-color: #202020;
    --modal-bg: rgba(20, 20, 30, 0.95);
    --text-color: #e0e0e0;
    --accent-color: #ffd700;
    --font-main: 'Press Start 2P', monospace; /* Pixel art font if available, or fallback */
}

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden; /* Prevent scrolling, game handles it */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1024px; /* maintain aspect ratio mostly */
    max-height: 768px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated; /* Crucial for pixel art */
}

/* UI Overlay */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass to canvas unless on a modal */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal */
.modal {
    position: relative;
    background: var(--modal-bg);
    border: 4px solid var(--text-color);
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    pointer-events: auto;
    display: none; /* Hidden by default */
    border-radius: 8px;
    box-shadow: 0 0 0 4px var(--bg-color), 0 0 30px rgba(0,0,0,0.8);
}

.modal.active {
    display: block;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal h2 {
    color: var(--accent-color);
    margin-top: 0;
    border-bottom: 2px dashed #555;
    padding-bottom: 10px;
}

.modal p {
    line-height: 1.6;
    font-family: 'Courier New', Courier, monospace; /* Easier to read for long text */
    font-weight: bold;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 24px;
    color: #ff5555;
}

.modal-close:hover {
    color: #ff0000;
}

.interaction-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 12px;
    display: none;
    border: 1px solid white;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Scanline effect */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
    opacity: 0.3;
}
