* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #181c2a;
    color: #e0e6f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#starfieldCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.fx-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(0, 229, 255, 0.35), rgba(255, 0, 255, 0.0) 60%);
    opacity: 0;
    transition: opacity 250ms ease-out;
}

.bloom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(255, 0, 255, 0.08), rgba(0, 229, 255, 0.06) 40%, rgba(0, 0, 0, 0) 70%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 400ms ease-out;
}

.game-container {
    width: 1000px;
    max-width: 95vw;
    text-align: center;
    position: relative;
    z-index: 2;
}

.game-header {
    margin-bottom: 20px;
}

h1 {
    color: #e0e6f0;
    background: linear-gradient(90deg, #00e5ff 0%, #a100ff 50%, #ff00ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.6), 0 0 22px rgba(161, 0, 255, 0.35);
    margin-bottom: 10px;
}

.score {
    font-size: 1.2em;
    color: #00bfff;
}

.progress-container {
    margin: 20px 0;
    padding: 0 20px;
}

.progress-bar {
    background-color: #0e1220;
    height: 30px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 2px solid #00e5ff;
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.25), inset 0 0 12px rgba(255, 0, 255, 0.15);
}

.progress-ship {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    transition: left 0.5s ease-out;
    z-index: 2;
    pointer-events: none;
}

.progress-planet {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    z-index: 1;
    pointer-events: none;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    background-color: transparent;
    width: 100%;
    height: 420px;
    z-index: 0;
}

/* Dashboard Layout */
.dashboard {
    position: relative;
    margin-top: 20px;
    height: 420px;
}

.dash-cluster {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: stretch;
}

.dash-gauge {
    position: relative;
    background: linear-gradient(180deg, #0b0f1a, #060812);
    border: 2px solid rgba(0, 229, 255, 0.5);
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.15), 0 0 24px rgba(161, 0, 255, 0.25);
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 10px;
    padding: 10px;
}

.dash-gauge .gauge-stack canvas {
    display: block;
}

.gauge-labels {
    position: absolute;
    bottom: 8px;
    width: 100%;
    text-align: center;
}

.gauge-title {
    font-size: 12px;
    letter-spacing: 3px;
    color: #00e5ff;
}

.gauge-sub {
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(255, 0, 255, 0.8);
}

.dash-screen {
    position: relative;
    background: #070a12aa;
    border: 2px solid rgba(0, 229, 255, 0.5);
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.15), 0 0 24px rgba(161, 0, 255, 0.25);
    overflow: hidden;
}

/* Overdrive mini-gauge */
.dash-overdrive {
    position: relative;
    background: #070a12;
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 8px;
    padding: 8px 10px 12px;
    box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.1), 0 0 14px rgba(161, 0, 255, 0.2);
}

.overdrive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.overdrive-title {
    font-family: monospace;
    letter-spacing: 2px;
    color: rgba(0, 229, 255, 0.9);
    font-size: 12px;
}

.warning-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.5);
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.3);
}

.warning-light.active {
    background: rgba(255, 60, 60, 0.9);
    box-shadow: 0 0 12px rgba(255, 60, 60, 0.8), 0 0 24px rgba(255, 0, 0, 0.5);
}

.screen-glass.small {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.0));
    mix-blend-mode: screen;
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}

.screen-bezel {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.screen-glass {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02) 10%, rgba(255, 255, 255, 0) 40%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.screen-inner {
    position: relative;
    z-index: 1;
    padding: 16px 18px;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comfort-toggle {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 229, 255, 0.6);
    background: rgba(7, 10, 18, 0.6);
    color: #e0e6f0;
    cursor: pointer;
}
.comfort-toggle[aria-pressed="true"] {
    border-color: rgba(0, 229, 255, 0.9);
    background: rgba(0, 229, 255, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

.screen-title {
    font-family: monospace;
    letter-spacing: 3px;
    color: #00e5ff;
}

.screen-content #problem {
    font-size: 1.6em;
    margin: 8px 0 18px;
}

.screen-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.05) 0px,
        rgba(0, 0, 0, 0.05) 2px,
        rgba(0, 0, 0, 0.08) 3px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
}

/* Pulse for gauge */
.dash-gauge.pulse {
    animation: pulseGlow 900ms ease-out;
}

#problem {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #00e5ff;
}

input[type="number"] {
    padding: 10px;
    font-size: 1.2em;
    width: 150px;
    margin: 10px;
    border: 2px solid #00e5ff;
    border-radius: 5px;
    background-color: #181c2a;
    color: #e0e6f0;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.15);
}

button {
    padding: 10px 20px;
    font-size: 1.2em;
    background: linear-gradient(90deg, #00e5ff, #ff00ff);
    color: #181c2a;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.4), 0 0 24px rgba(255, 0, 255, 0.2);
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.6), 0 0 30px rgba(255, 0, 255, 0.35);
} 

/* FX Animations */
@keyframes shake {
    0% { transform: translate(0, 0) rotate(0); }
    25% { transform: translate(2px, -2px) rotate(-0.5deg); }
    50% { transform: translate(-2px, 2px) rotate(0.6deg); }
    75% { transform: translate(2px, 1px) rotate(-0.4deg); }
    100% { transform: translate(0, 0) rotate(0); }
}

.shake {
    animation: shake 350ms ease-in-out;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.5), inset 0 0 10px rgba(255, 0, 255, 0.25); }
    50% { box-shadow: 0 0 28px rgba(0, 229, 255, 0.9), inset 0 0 22px rgba(255, 0, 255, 0.5); }
    100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.5), inset 0 0 10px rgba(255, 0, 255, 0.25); }
}

.pulse {
    animation: pulseGlow 900ms ease-out;
}