:root {
    /* Deep Blue Ocean Theme */
    --bg-base: #0a0a1a;
    --bg-mantle: #121230;
    --bg-crust: #1a1a3a;
    --text: #e0e8ff;
    --subtext0: #a0a8d0;
    --subtext1: #c0c8f0;
    --surface0: #2a2a5a;
    --surface1: #3a3a6a;
    --surface2: #4a4a7a;
    --ocean-blue: #2962ff;
    --electric-blue: #00b0ff;
    --cyan: #00e5ff;
    --accent-teal: #1de9b6;
    --warning: #ff6d00;
    --success: #00c853;

    --shadow-glow: 0 0 20px rgba(41, 98, 255, 0.2);
    --gradient-bg: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0d1b2a 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Geist Mono', monospace;
    background: var(--gradient-bg);
    color: var(--text);
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terminal {
    background: var(--bg-base);
    border: 1px solid var(--surface0);
    border-radius: 0;
    box-shadow: var(--shadow-glow);
    max-width: 1000px;
    width: 100%;
    overflow: hidden;
}

.terminal-header {
    background: var(--bg-mantle);
    border-bottom: 1px solid var(--surface0);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 0;
    display: inline-block;
}

.control.close {
    background: #ff5252;
}

.control.minimize {
    background: var(--warning);
}

.control.maximize {
    background: var(--success);
}

.title-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.prompt {
    color: var(--electric-blue);
}

.title {
    color: var(--cyan);
    letter-spacing: 0.5px;
    font-weight: 700;
}

.cursor {
    color: var(--electric-blue);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.terminal-body {
    padding: 24px;
}

/* Game Canvas Container */
.game-container {
    background: var(--bg-mantle);
    border: 1px solid var(--surface0);
    border-radius: 0;
    margin-bottom: 20px;
    overflow: hidden;
    display: none;
}

.game-header {
    background: var(--bg-crust);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--surface0);
}

.game-title {
    color: var(--cyan);
    font-weight: 600;
}

.game-stats {
    color: var(--subtext0);
    font-size: 0.9em;
    display: flex;
    gap: 15px;
}

#canvas {
    display: block;
    background: var(--bg-base);
    width: 100%;
    height: 400px;
}

/* Control Panel */
.control-panel {
    background: var(--bg-mantle);
    border: 1px solid var(--surface0);
    border-radius: 0;
    padding: 20px;
    margin-bottom: 20px;
}

.btn-container {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.terminal-btn {
    background: var(--ocean-blue);
    border: 1px solid var(--electric-blue);
    border-radius: 0;
    padding: 12px 24px;
    color: var(--text);
    font-family: 'Geist Mono', monospace;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.terminal-btn:hover {
    background: var(--electric-blue);
    border-color: var(--cyan);
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(0, 176, 255, 0.4);
}

.terminal-btn.secondary {
    background: transparent;
    border-color: var(--surface1);
    color: var(--text);
}

.terminal-btn.secondary:hover {
    background: var(--surface0);
    border-color: var(--electric-blue);
}

/* Instructions Panel */
.instructions-panel {
    background: var(--bg-mantle);
    border: 1px solid var(--surface0);
    border-radius: 0;
    margin-bottom: 20px;
}

.instructions-header {
    background: var(--bg-crust);
    padding: 12px 16px;
    border-bottom: 1px solid var(--surface0);
}

.instructions-title {
    color: var(--cyan);
    font-weight: 600;
}

.instructions-content {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-base);
    border-radius: 0;
    border-left: 3px solid var(--electric-blue);
}

.key {
    background: var(--surface0);
    padding: 4px 8px;
    border-radius: 0;
    font-weight: 600;
    color: var(--accent-teal);
    min-width: 40px;
    text-align: center;
}

.action {
    color: var(--subtext1);
    font-size: 0.9em;
}

/* Screens */
.start-screen,
.checkpoint-screen {
    background: var(--bg-mantle);
    border: 1px solid var(--surface0);
    border-radius: 0;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

.main-title {
    color: var(--cyan);
    margin-bottom: 20px;
    font-size: 1.8em;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.instructions {
    color: var(--subtext1);
    margin-bottom: 15px;
    line-height: 1.6;
}

.checkpoint-screen {
    display: none;
    background: var(--success);
    color: var(--bg-base);
}

.checkpoint-screen h2 {
    color: var(--bg-base);
    margin-bottom: 15px;
}

/* Footer */
.terminal-footer {
    background: var(--bg-mantle);
    border-top: 1px solid var(--surface0);
    padding: 12px 16px;
}

.footer-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--subtext0);
}

.stat {
    font-family: 'Geist Mono', monospace;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .terminal-body {
        padding: 16px;
    }

    .btn-container {
        flex-direction: column;
    }

    .instructions-content {
        grid-template-columns: 1fr;
    }

    .footer-stats {
        flex-direction: column;
        gap: 8px;
    }

    .game-stats {
        flex-direction: column;
        gap: 5px;
    }

    #canvas {
        height: 300px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-mantle);
}

::-webkit-scrollbar-thumb {
    background: var(--surface1);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface2);
}