:root {
  --cyan: #33e0ff;
  --magenta: #ff3fbf;
  --amber: #ffb02e;
  --ink: #070a16;
  --panel: rgba(7, 10, 22, 0.55);
  --text: #dbe6ff;
  --font: "Bahnschrift", "Eurostile", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", "DejaVu Sans Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; font-family: var(--font); color: var(--text); user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.panel { position: absolute; padding: 14px 18px; background: var(--panel); backdrop-filter: blur(6px); border: 1px solid rgba(51, 224, 255, 0.25); }
.panel::before, .panel::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--cyan); border-style: solid; }
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.top-left { top: 18px; left: 18px; min-width: 260px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); }
.top-right { top: 18px; right: 18px; text-align: right; min-width: 220px; clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.bottom-right { bottom: 18px; right: 18px; text-align: right; font-size: 13px; letter-spacing: 0.08em; }
.bottom-left { bottom: 18px; left: 18px; font-size: 12px; letter-spacing: 0.12em; color: rgba(219, 230, 255, 0.6); padding: 8px 12px; }
.label { font-size: 11px; letter-spacing: 0.35em; color: var(--cyan); opacity: 0.85; }
.speed { font-size: 56px; font-weight: 700; line-height: 1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(51, 224, 255, 0.55); }
.speed small { font-size: 13px; letter-spacing: 0.2em; margin-left: 8px; color: rgba(219, 230, 255, 0.7); font-weight: 400; }
.score { font-size: 38px; font-weight: 700; line-height: 1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(255, 63, 191, 0.5); }
.sub { font-size: 12px; letter-spacing: 0.18em; color: rgba(219, 230, 255, 0.75); }
.bars { display: grid; gap: 6px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 10px; letter-spacing: 0.25em; width: 54px; color: rgba(219, 230, 255, 0.7); }
.bar { flex: 1; height: 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(51, 224, 255, 0.25); transform: skewX(-18deg); overflow: hidden; }
.fill { height: 100%; width: 100%; transition: width 0.15s ease-out; }
.fill.shield { background: linear-gradient(90deg, #1ec8ff, #6df3ff); box-shadow: 0 0 10px rgba(51, 224, 255, 0.7); }
.fill.shield.low { background: linear-gradient(90deg, #ff3b3b, #ff8a5c); box-shadow: 0 0 10px rgba(255, 60, 60, 0.8); animation: pulse 0.6s infinite alternate; }
.fill.boost { background: linear-gradient(90deg, #ff3fbf, #ffb02e); box-shadow: 0 0 10px rgba(255, 176, 46, 0.6); }
.fill.boost.active { animation: pulse 0.25s infinite alternate; }
.hint { margin-top: 8px; font-size: 10px; letter-spacing: 0.3em; color: var(--amber); }
.combo { position: absolute; right: 18px; bottom: -34px; font-size: 26px; font-weight: 700; color: var(--amber); text-shadow: 0 0 14px rgba(255, 176, 46, 0.8); }
.music #music-state { color: var(--magenta); }
.music .keys { font-size: 10px; letter-spacing: 0.2em; opacity: 0.55; margin-top: 4px; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }

#toast { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(0.8); font-size: 34px; font-weight: 700; letter-spacing: 0.3em; opacity: 0; transition: opacity 0.12s, transform 0.12s; text-shadow: 0 0 22px currentColor; color: #fff; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#toast.near { color: var(--amber); }
#toast.pickup { color: var(--cyan); }
#toast.bad { color: #ff4d4d; }
#toast.boost { color: var(--magenta); }
#toast.go { color: #7dff9a; font-size: 64px; }
#music-toast { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); font-size: 16px; letter-spacing: 0.2em; color: var(--magenta); opacity: 0; transition: opacity 0.2s; text-shadow: 0 0 14px currentColor; white-space: nowrap; }
#music-toast.show { opacity: 1; }
#flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#flash.flashing { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------- screens ---------------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(ellipse at center, rgba(7, 10, 22, 0.35), rgba(7, 10, 22, 0.85)); cursor: pointer; }
.logo { font-size: clamp(56px, 11vw, 132px); font-weight: 800; letter-spacing: 0.08em; line-height: 0.9; font-style: italic; }
.logo .hy { color: #fff; text-shadow: 0 0 30px rgba(51, 224, 255, 0.9), 0 0 2px #fff; }
.logo .lane { color: var(--magenta); text-shadow: 0 0 30px rgba(255, 63, 191, 0.9), 0 0 2px #fff; }
.logo.small-logo { font-size: clamp(40px, 7vw, 84px); }
.tag { font-size: 14px; letter-spacing: 0.6em; color: var(--cyan); margin-top: -10px; }
.controls { display: grid; gap: 8px; font-size: 13px; letter-spacing: 0.15em; color: rgba(219, 230, 255, 0.85); margin-top: 10px; }
.controls div { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.controls span { margin-right: 14px; opacity: 0.8; }
kbd { display: inline-block; min-width: 28px; padding: 4px 8px; text-align: center; border: 1px solid rgba(51, 224, 255, 0.5); border-bottom-width: 3px; background: rgba(51, 224, 255, 0.08); font-family: var(--mono); font-size: 12px; color: #fff; border-radius: 3px; }
.prompt { font-size: 20px; letter-spacing: 0.45em; margin-top: 18px; color: #fff; text-shadow: 0 0 16px rgba(51, 224, 255, 0.9); }
.blink { animation: blink 1.4s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.small { font-size: 11px; letter-spacing: 0.3em; color: rgba(219, 230, 255, 0.5); }
.loadbar { width: min(420px, 70vw); height: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(51, 224, 255, 0.35); }
#load-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--magenta)); box-shadow: 0 0 12px var(--cyan); transition: width 0.2s; }
.final { text-align: center; }
.final-score { font-size: clamp(48px, 8vw, 96px); font-weight: 800; color: #fff; text-shadow: 0 0 30px rgba(255, 176, 46, 0.8); font-variant-numeric: tabular-nums; }
.final .sub { font-size: 16px; margin-top: 8px; }
.final .best { color: var(--amber); }

/* ---------------- options ---------------- */
#options { cursor: default; gap: 14px; background: rgba(7, 10, 22, 0.94); }
.opt-list { display: grid; gap: 4px; width: min(560px, 90vw); }
.opt-row { display: grid; grid-template-columns: 1fr 200px; align-items: center; padding: 8px 14px; border: 1px solid transparent; letter-spacing: 0.15em; font-size: 14px; }
.opt-row.active { border-color: rgba(51, 224, 255, 0.5); background: rgba(51, 224, 255, 0.08); }
.opt-label { color: rgba(219, 230, 255, 0.85); }
.opt-ctl { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 6px; }
.opt-btn { background: none; border: 1px solid rgba(51, 224, 255, 0.35); color: var(--cyan); font-size: 11px; padding: 4px 0; cursor: pointer; font-family: inherit; }
.opt-btn:hover { background: rgba(51, 224, 255, 0.15); }
.opt-val { text-align: center; color: #fff; font-weight: 700; cursor: pointer; text-shadow: 0 0 10px rgba(51, 224, 255, 0.6); }
.opt-val.off { color: rgba(219, 230, 255, 0.45); text-shadow: none; }
.opt-hint { font-size: 11px; letter-spacing: 0.3em; color: rgba(219, 230, 255, 0.5); }
.opt-actions { display: flex; gap: 12px; }
.opt-action { background: rgba(51, 224, 255, 0.08); border: 1px solid rgba(51, 224, 255, 0.5); color: #fff; letter-spacing: 0.3em; font-size: 12px; padding: 10px 18px; cursor: pointer; font-family: inherit; }
.opt-action:hover { background: rgba(51, 224, 255, 0.2); }
