/* Game Container */
.game-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    background: var(--terminal-bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(0, 255, 65, 0.2);
    border: 2px solid var(--primary-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-container.hidden {
    display: none;
}

/* Game Header */
.game-header {
    background: linear-gradient(180deg, #1c2128 0%, #161b22 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.game-title {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
    text-shadow: var(--strong-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.game-score {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    text-shadow: var(--text-glow);
}

.game-exit {
    background: rgba(255, 68, 68, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
    padding: 6px 12px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.game-exit:hover {
    background: rgba(255, 68, 68, 0.4);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    transform: scale(1.05);
}

/* Game Canvas */
#game-canvas {
    display: block;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--secondary-color);
    border-radius: 5px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 255, 65, 0.2);
}

/* Game Instructions */
.game-instructions {
    padding: 15px 20px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.game-instructions p {
    margin: 5px 0;
}

.game-instructions .key {
    display: inline-block;
    background: rgba(0, 255, 65, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid var(--primary-color);
    font-weight: 600;
    margin: 0 3px;
    text-shadow: var(--text-glow);
}

/* Game Over Screen */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(13, 17, 23, 0.95);
    padding: 40px;
    border-radius: 10px;
    border: 2px solid var(--error-color);
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.5);
}

.game-over h2 {
    color: var(--error-color);
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

.game-over p {
    color: var(--text-color);
    font-size: 18px;
    margin: 10px 0;
}

.game-over .final-score {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: var(--strong-glow);
}

.game-over button {
    background: rgba(0, 255, 65, 0.2);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 30px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    text-shadow: var(--text-glow);
}

.game-over button:hover {
    background: rgba(0, 255, 65, 0.4);
    box-shadow: var(--strong-glow);
    transform: scale(1.05);
}

/* High Score Display */
.high-score {
    color: var(--warning-color);
    font-size: 14px;
    margin-top: 10px;
    text-shadow: 0 0 5px rgba(255, 170, 0, 0.5);
}

/* Responsive Game Design */
@media (max-width: 768px) {
    .game-container {
        width: 95%;
    }

    .game-header {
        padding: 12px 15px;
    }

    .game-title {
        font-size: 16px;
    }

    .game-score {
        font-size: 14px;
    }

    .game-exit {
        font-size: 11px;
        padding: 5px 10px;
    }

    #game-canvas {
        margin: 15px auto;
        max-width: 100%;
    }

    .game-instructions {
        font-size: 12px;
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .game-controls {
        gap: 10px;
    }

    .game-score {
        font-size: 12px;
    }

    .game-exit {
        font-size: 10px;
        padding: 4px 8px;
    }

    .game-over {
        padding: 30px 20px;
    }

    .game-over h2 {
        font-size: 24px;
    }

    .game-over p {
        font-size: 14px;
    }

    .game-over .final-score {
        font-size: 20px;
    }
}

/* Pause Screen */
.pause-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(13, 17, 23, 0.95);
    padding: 30px 50px;
    border-radius: 10px;
    border: 2px solid var(--warning-color);
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 170, 0, 0.5);
}

.pause-screen h2 {
    color: var(--warning-color);
    font-size: 28px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.8);
}

.pause-screen p {
    color: var(--text-color);
    font-size: 16px;
}