:root {
  --found: #38e8ff;
  --miss: #ff3060;
  --fa: #ffb020;
  --wrong: #c77dff;
  --ink: #e8f6ff;
  --dim: #7f97a8;
  --line: rgba(56, 232, 255, 0.35);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); font-family: var(--mono); overflow: hidden; }
button { font: inherit; color: inherit; }
.mode { position: fixed; inset: 0; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Mode switch */
.modes { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 2px;
  background: rgba(0, 10, 16, 0.6); border: 1px solid var(--line); border-radius: 999px; padding: 3px; backdrop-filter: blur(6px); }
.modes button, .modes a { background: none; border: 0; padding: 6px 14px; border-radius: 999px; cursor: pointer; letter-spacing: 0.12em;
  text-transform: uppercase; font-size: 11px; color: var(--dim); text-decoration: none; }
.modes [aria-pressed="true"] { background: var(--found); color: #001018; box-shadow: 0 0 18px rgba(56, 232, 255, 0.6); }
.modes a:hover, .modes button:hover { color: var(--ink); }
.modes [aria-pressed="true"]:hover { color: #001018; }

/* Scanlines + vignette over the HUD */
.fx { position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.75) 100%); }

.corner { position: absolute; z-index: 5; text-shadow: 0 0 10px rgba(0, 0, 0, 0.9); pointer-events: none; }
.tl { top: 18px; left: 22px; max-width: 520px; }
.tr { top: 18px; right: 22px; text-align: right; font-size: 12px; letter-spacing: 0.1em; }
.brand { font-size: 22px; font-weight: 700; letter-spacing: 0.22em; }
.brand span { color: var(--found); text-shadow: 0 0 12px var(--found); }
.cfg { margin-top: 6px; font-size: 13px; letter-spacing: 0.12em; color: var(--found); }
.dim { color: var(--dim); }
.small { font-size: 11px; line-height: 1.5; }
.rec { color: var(--miss); animation: blink 1.2s steps(2) infinite; text-shadow: 0 0 8px var(--miss); }
@keyframes blink { 50% { opacity: 0.15; } }
.miss { color: var(--miss); }
.fa { color: var(--fa); }

/* Latency gauge */
.gauge { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); z-index: 5; width: 170px; text-align: center;
  pointer-events: none; padding: 12px 10px; background: rgba(0, 8, 14, 0.72); border: 1px solid var(--line); border-radius: 8px;
  backdrop-filter: blur(4px); box-shadow: 0 0 24px rgba(56, 232, 255, 0.12); }
.gauge svg { width: 150px; height: 104px; overflow: visible; }
.gauge .big { font-size: 26px; font-weight: 700; }
.gauge .lbl { font-size: 10px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.gauge .row { margin-top: 10px; }

/* Scrims so the HUD text reads over bright road and sky */
#hud::before, #hud::after { content: ""; position: absolute; left: 0; right: 0; z-index: 4; pointer-events: none; }
#hud::before { top: 0; height: 110px; background: linear-gradient(rgba(0, 0, 0, 0.75), transparent); }
#hud::after { bottom: 0; height: 250px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85) 55%); }

/* Bottom HUD */
.bottom { position: absolute; left: 22px; right: 22px; bottom: 30px; z-index: 6; }
.bar { display: flex; gap: 3px; height: 10px; margin-bottom: 10px; }
.bar i { flex: 1; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 2px; transition: background 0.15s, box-shadow 0.15s; max-width: 46px; }
.bar i.m { background: var(--found); border-color: var(--found); box-shadow: 0 0 8px var(--found); }
.bar i.u { background: var(--miss); border-color: var(--miss); box-shadow: 0 0 8px var(--miss); }
.bar i.w { background: var(--wrong); border-color: var(--wrong); box-shadow: 0 0 8px var(--wrong); }
.stats { display: flex; gap: 34px; align-items: baseline; text-shadow: 0 0 12px #000; pointer-events: none; }
.stats b { font-size: 40px; font-weight: 700; display: block; line-height: 1; color: var(--found); }
.stats .miss b { color: var(--miss); }
.stats .fa b { color: var(--fa); }
.stats .wrong b { color: var(--wrong); }
.stats .dim b { color: var(--ink); }
.stats span { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; }
.controls .group { display: flex; gap: 2px; margin-right: 12px; }
.controls button { background: rgba(0, 12, 20, 0.65); border: 1px solid var(--line); padding: 5px 11px; cursor: pointer; font-size: 12px;
  letter-spacing: 0.08em; border-radius: 3px; color: var(--dim); }
.controls button:hover { color: var(--ink); border-color: var(--found); }
.controls button[aria-pressed="true"] { color: #001018; background: var(--found); border-color: var(--found); box-shadow: 0 0 12px rgba(56, 232, 255, 0.5); }
.controls button.lab[aria-pressed="true"] { background: #c77dff; border-color: #c77dff; box-shadow: 0 0 12px rgba(199, 125, 255, 0.6); }
.controls button.size1280[aria-pressed="true"] { background: #ff8a3d; border-color: #ff8a3d; box-shadow: 0 0 12px rgba(255, 138, 61, 0.6); }
.controls .tag { font-size: 10px; letter-spacing: 0.18em; color: var(--dim); margin-right: 4px; text-transform: uppercase; }
.keys { margin-top: 8px; font-size: 10px; color: var(--dim); letter-spacing: 0.08em; }
.credit { position: absolute; left: 22px; right: 22px; bottom: 6px; margin: 0; z-index: 6; font-size: 10px; color: var(--dim); }
.credit a { color: var(--ink); }

/* Galaxy */
#sky { background: radial-gradient(ellipse at 50% 60%, #071826 0%, #020509 70%); }
#sky-gl { cursor: grab; }
#sky-gl:active { cursor: grabbing; }
#sky-2d { pointer-events: none; }
.headline { margin-top: 14px; font-size: 15px; letter-spacing: 0.06em; }
.headline b { font-size: 24px; }
.families { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 8px; width: 250px; }
.families button { text-align: left; background: rgba(0, 12, 20, 0.6); border: 1px solid rgba(255, 48, 96, 0.35); border-radius: 4px; padding: 9px 12px;
  cursor: pointer; color: var(--ink); }
.families button .name { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.families button .lift { display: block; font-size: 11px; color: var(--dim); margin-top: 3px; }
.families button .lift b { color: var(--miss); font-size: 15px; }
.families button:hover { border-color: var(--miss); }
.families button[aria-pressed="true"] { border-color: var(--miss); box-shadow: 0 0 16px rgba(255, 48, 96, 0.45); background: rgba(40, 0, 10, 0.6); }
.families button.all { border-color: var(--line); }
.families button.all[aria-pressed="true"] { border-color: var(--found); box-shadow: 0 0 16px rgba(56, 232, 255, 0.35); background: rgba(0, 24, 34, 0.6); }
.card { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); z-index: 7; width: 250px; background: rgba(0, 10, 16, 0.85);
  border: 1px solid var(--line); border-radius: 6px; padding: 14px; box-shadow: 0 0 30px rgba(56, 232, 255, 0.15); }
.card .crop { width: 192px; height: 192px; margin: 0 auto 10px; image-rendering: pixelated; border: 1px solid var(--line); background-repeat: no-repeat; }
.card .crop.none { display: grid; place-items: center; color: var(--dim); font-size: 11px; }
.card h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; }
.card .chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: 10px 0; text-align: center; font-size: 10px; }
.card .chips span { padding: 4px 0; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.15); }
.card .chips .m { background: rgba(56, 232, 255, 0.18); border-color: var(--found); }
.card .chips .u { background: rgba(255, 48, 96, 0.22); border-color: var(--miss); }
.card .close { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 16px; }
.card a { color: var(--ink); }
.tip { position: fixed; z-index: 30; pointer-events: none; background: rgba(0, 10, 16, 0.9); border: 1px solid var(--line); padding: 6px 9px;
  font-size: 11px; border-radius: 4px; white-space: nowrap; }

/* Clean view (?clean or H): no HUD chrome, only the video and the image credit */
body.clean .modes, body.clean #hud .corner, body.clean #hud .gauge, body.clean #hud .bottom,
body.clean #hud::before, body.clean #hud::after { display: none; }
body.clean #hud { cursor: none; }
body.clean #hud .credit { text-align: center; }

@media (max-width: 900px) {
  .gauge, .families { display: none; }
  .stats { gap: 18px; }
  .stats b { font-size: 28px; }
}
