:root { color-scheme: dark; font-family: 'Courier New', Courier, monospace; color: #eee; background: #050505; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { min-height: 44px; padding: 10px 18px; border: 1px solid #9faebc; border-radius: 5px; background: #111a22; color: #fff; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:hover:not(:disabled) { background: #243d4c; border-color: #3cf; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #3cf; outline-offset: 3px; }
a { color: #cadce6; text-decoration: none; }
a:hover { color: #3cf; }
#canvas-container, #radar-container, #effects-layer, #ui-layer { position: fixed; inset: 0; overflow: hidden; }
#canvas-container { touch-action: none; }
canvas { display: block; }
#radar-container, #effects-layer, #ui-layer { pointer-events: none; }
#radar-container { z-index: 2; }
#effects-layer { z-index: 3; }
#ui-layer { z-index: 4; }
nav { display: flex; align-items: center; gap: 8px; padding: max(4px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left)); background: #060a0fea; pointer-events: auto; }
nav a { display: flex; align-items: center; min-height: 44px; font-size: .8rem; }
nav button { padding: 8px; font-size: .75rem; }
.nav-spacer { flex: 1; }
.hud-top { text-align: center; padding: 6px 12px 14px; background: linear-gradient(#060a0fea, #060a0fc9 85%, transparent); }
h1 { color: white; margin: 0; font-size: 1rem; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 0 8px #fff8; }
.subtitle { color: #adb4c0; font-size: .65rem; margin: 4px 0 6px; }
#spectrum-container { position: relative; width: min(100%, 600px); height: 18px; margin: auto; border: 1px solid #63707c; background: #111; border-radius: 12px; overflow: hidden; }
#spectrum-bar { position: absolute; inset: 0; background: linear-gradient(90deg, #a40032, #444, #007c9b); }
#spectrum-marker { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; background: #fff; transform: translateX(-50%); box-shadow: 0 0 8px #fff; transition: left .15s; }
.spectrum-labels { display: flex; justify-content: space-between; gap: 12px; max-width: 600px; margin: 5px auto; font-size: .65rem; font-weight: bold; }
.label-chaos, .status-bad { color: #ff638a; }
.label-order, .status-good { color: #48d7ff; }
.status-neutral { color: #ccd3dd; }
#score-readout { font-size: 1.05rem; font-weight: bold; }
#timer-readout { color: #fff; font-size: .85rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.panel { position: fixed; z-index: 10; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 128px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; text-align: center; padding: 22px; border: 1px solid #63707c; border-radius: 10px; background: #070c12f5; box-shadow: 0 12px 70px #000a; scrollbar-width: thin; }
.panel h2 { font-size: 1.4rem; letter-spacing: 1px; margin: 0 0 16px; }
.panel p { color: #ced5df; line-height: 1.55; margin: 12px 0; }
.panel #input-hint, #best-readout, #save-status { font-size: .8rem; }
#start-btn, #resume-btn { margin-top: 6px; }
#pause-overlay { max-width: 420px; }
.controls-hint { position: absolute; bottom: 34px; left: 16px; padding: 8px; background: #060a0fe6; color: #b9c4cf; font-size: .7rem; line-height: 1.6; border-radius: 5px; }
#mobile-controls { position: absolute; inset: 0; }
#joystick-zone { position: absolute; bottom: max(40px, calc(env(safe-area-inset-bottom) + 32px)); left: max(20px, env(safe-area-inset-left)); width: 112px; height: 112px; border: 2px solid #8b9caa; border-radius: 50%; background: #14202cd9; pointer-events: auto; touch-action: none; user-select: none; }
#joystick-knob { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; border-radius: 50%; transform: translate(-50%, -50%); background: #13b8db; box-shadow: 0 0 12px #3cf5; }
#fire-btn-mobile { position: absolute; bottom: max(48px, calc(env(safe-area-inset-bottom) + 40px)); right: max(24px, env(safe-area-inset-right)); width: 88px; height: 88px; border: 2px solid #ff638a; border-radius: 50%; background: #571329db; pointer-events: auto; touch-action: none; user-select: none; font-weight: bold; }
#fire-btn-mobile:active { background: #a7284d; }
.radar-blip { position: absolute; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.floater { position: absolute; font-weight: bold; animation: floatUp 1s forwards; font-size: 1.2rem; text-shadow: 0 0 5px black; }
@keyframes floatUp { to { transform: translateY(-45px); opacity: 0; } }
#leaderboard { text-align: left; margin-top: 20px; }
.lb-header { font-size: .85rem; color: #c1ceda; padding-bottom: 10px; border-bottom: 1px solid #54616f; }
.lb-entry { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #283440; font-size: .8rem; }
.lb-entry span:first-child { overflow-wrap: anywhere; min-width: 0; }
.lb-entry span:last-child { white-space: nowrap; }
#lb-content { font-size: .8rem; line-height: 1.5; color: #c1ceda; }
#lb-form { margin-top: 14px; }
#lb-form label { display: block; font-size: .75rem; margin-bottom: 6px; }
.score-form-row { display: flex; gap: 8px; }
input { width: 100%; min-width: 0; min-height: 44px; background: #101b25; border: 1px solid #63707c; color: #fff; padding: 8px; border-radius: 4px; font-size: 16px; }
footer { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 24px; padding-bottom: env(safe-area-inset-bottom); background: #060a0fe6; font-size: .65rem; }
footer a { padding: 8px; }
body[data-mobile="true"] .controls-hint { display: none; }
@media (max-width: 360px) { nav { gap: 6px; padding-left: 8px; padding-right: 8px; } nav a, nav button { font-size: .68rem; } nav button { padding: 6px; } h1 { font-size: .88rem; letter-spacing: 1px; } .panel { padding: 16px; } .panel h2 { font-size: 1.2rem; } .spectrum-labels { font-size: .6rem; } }
@media (max-height: 550px) { .panel { max-height: calc(100dvh - 108px); padding: 14px 20px; } .subtitle { display: none; } .hud-top { padding: 4px 12px 8px; } h1 { font-size: .8rem; margin-bottom: 4px; } #spectrum-container { height: 12px; max-width: 420px; } .spectrum-labels { display: none; } #score-readout, #timer-readout { display: inline-block; margin: 4px 8px 0; font-size: .75rem; } #joystick-zone { width: 94px; height: 94px; bottom: 32px; } #fire-btn-mobile { width: 72px; height: 72px; bottom: 36px; } }
@media (prefers-reduced-motion: reduce) { .floater { animation: none; } #spectrum-marker { transition: none; } }
