/* LetsDash design system — from docs/WEB_REBUILD_SPEC.md §1 (Claude Design handoff).
   Neon-glass chrome is CONSTANT; only --accent/--on-accent swap per theme. */

@font-face { font-family: 'Chakra Petch'; src: url('./fonts/ChakraPetch-Regular.ttf'); font-weight: 400; }
@font-face { font-family: 'Chakra Petch'; src: url('./fonts/ChakraPetch-Bold.ttf'); font-weight: 700; }
@font-face { font-family: 'Space Grotesk'; src: url('./fonts/SpaceGrotesk.ttf'); font-weight: 400 700; }
@font-face { font-family: 'JetBrains Mono'; src: url('./fonts/JetBrainsMono-Regular.ttf'); font-weight: 500; }
@font-face { font-family: 'JetBrains Mono'; src: url('./fonts/JetBrainsMono-Bold.ttf'); font-weight: 700; }

:root {
  --accent: #ff9e42;
  --on-accent: #1a1005;
  --bg-base: #0C0820;
  --bg-panel: #140D2A;
  --bg-panel2: #1C1240;
  --stroke: #2A1550;
  --text: #F2ECFF;
  --text-2: #9B8BC4;
  --text-3: #6B5F8C;
  --text-lav: #C9BEEA;
  --good: #7CFF6B;
  --warn: #FFD23F;
  --bad: #FF3B6B;
  --info: #00E5FF;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --disp: 'Chakra Petch', sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: #07050F; overflow: hidden; }
body { font-family: 'Space Grotesk', sans-serif; color: var(--text); -webkit-font-smoothing: antialiased; user-select: none; }
#game { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
#scrim { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(6,4,16,.35) 100%); }

/* ---------- keyframes (§1.10) ---------- */
@keyframes ld-breathe { 0%,100%{opacity:.85; filter:drop-shadow(0 0 24px color-mix(in srgb,var(--accent) 55%,transparent))}
                        50%{opacity:1; filter:drop-shadow(0 0 44px color-mix(in srgb,var(--accent) 90%,transparent))} }
@keyframes ld-pop   { 0%{transform:scale(.9);opacity:0} 70%{transform:scale(1.03)} 100%{transform:scale(1);opacity:1} }
@keyframes ld-blink { 0%,100%{opacity:1} 50%{opacity:.25} }
@keyframes ld-fadeout { to{opacity:0} }

/* ---------- layers ---------- */
.layer { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.layer > * { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------- MENU (§2.2) ---------- */
#menu .hero { position: absolute; top: 8.5%; width: 100%; text-align: center; pointer-events: none; }
#menu .wordmark { font-family: var(--disp); font-weight: 700; font-size: clamp(44px, 8vw, 76px);
  letter-spacing: -1px; animation: ld-breathe 3.6s ease-in-out infinite; }
#menu .wordmark b { color: var(--accent); }
#menu .tagline { font-size: 17px; color: var(--text-lav); margin-top: 8px; text-shadow: 0 1px 8px rgba(6,4,16,.7); }

#carousel { position: absolute; top: 33%; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 20px; }
#carousel .arrow { width: 52px; height: 52px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(20,13,42,.66); backdrop-filter: blur(8px); color: var(--text-2); font-size: 24px;
  cursor: pointer; transition: all .12s; }
#carousel .arrow:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent); }
#carframe { width: clamp(300px, 32vw, 380px); height: clamp(180px, 19vw, 230px); border-radius: 20px;
  background: rgba(12,8,32,.28); border: 2px solid var(--accent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 0 40px rgba(6,4,16,.4);
  position: relative; transition: border-color .2s, box-shadow .2s; }
#cardots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 7px; }
#cardots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.25); cursor: pointer; }
#cardots i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

#menuform { position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%); width: min(440px, 88vw); }
#menuform label { display: block; font-size: 12px; letter-spacing: 2px; color: var(--text-2); margin-bottom: 8px; }
#pname { width: 100%; height: 54px; border-radius: 12px; background: rgba(12,8,32,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.14); padding: 0 18px; font-size: 18px; color: var(--text);
  font-family: inherit; caret-color: var(--accent); outline: none; }
#pname:focus { border-color: var(--accent); }
.btnrow { display: flex; gap: 12px; height: 56px; margin: 14px 0; }
.btn { border: none; border-radius: 12px; font-family: inherit; font-weight: 700; font-size: 15px;
  cursor: pointer; color: var(--text); transition: box-shadow .12s, background .12s; }
.btn:active { transform: scale(.97); }
.btn-primary { flex: 1.4; background: var(--accent); color: var(--on-accent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-primary:hover { box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-outline { flex: 1; background: rgba(20,13,42,.66); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.btn-glass { flex: 1; background: rgba(20,13,42,.7); border: 1px solid rgba(255,255,255,.14); }
.btn-outline:hover, .btn-glass:hover { border-color: var(--accent); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); }

#joinrow { display: none; gap: 10px; margin-top: 10px; }
#joinrow.open { display: flex; }
#joincode { flex: 1; height: 52px; border-radius: 12px; background: rgba(12,8,32,.72); border: 1px solid rgba(255,255,255,.14);
  padding: 0 16px; font-family: var(--mono); font-size: 22px; letter-spacing: 6px; color: var(--text);
  text-transform: uppercase; outline: none; }
#joingo { width: 120px; }

#hints { position: absolute; bottom: 5.5%; left: 5.5%; display: flex; gap: 8px; }
.chip { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px;
  background: rgba(12,8,32,.6); border: 1px solid rgba(255,255,255,.10); font-size: 13px; color: var(--text-2); }
.chip b { font-family: var(--mono); color: var(--text); font-weight: 700; }

/* ---------- HUD (§2.4) ---------- */
#hud { z-index: 8; }
#hud .tl { position: absolute; top: 6%; left: 5.5%; display: flex; flex-direction: column; gap: 10px; }
#coins { height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 12px;
  background: rgba(6,4,16,.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12);
  font-family: var(--mono); font-weight: 700; font-size: 22px; width: max-content; }
#coins .ic { color: var(--warn); font-size: 20px; }
#gravchip { height: 34px; display: none; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px;
  background: rgba(6,4,16,.6); border: 1px solid rgba(255,255,255,.12); font-family: var(--mono);
  font-size: 14px; font-weight: 700; width: max-content; }
#gravchip.on { display: inline-flex; }

#hud .tr { position: absolute; top: 6%; right: 5.5%; text-align: right; }
#speedbox { display: inline-block; padding: 8px 16px; border-radius: 14px; background: rgba(6,4,16,.55);
  border: 1px solid rgba(255,255,255,.12); }
#speedbox .lab { font-size: 11px; letter-spacing: 2px; color: var(--text-2); }
#speed { font-family: var(--mono); font-weight: 700; font-size: 52px; line-height: 1; }
#speed.boost { color: var(--accent); text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 70%, transparent); }

#hud .tc { position: absolute; top: 6%; left: 50%; transform: translateX(-50%); width: min(460px, 80vw);
  display: flex; flex-direction: column; align-items: center; gap: 10px; }
#roompill { height: 40px; display: none; align-items: center; gap: 8px; padding: 0 8px 0 14px; border-radius: 20px;
  background: rgba(6,4,16,.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); }
#roompill.on { display: inline-flex; }
#roompill .lab { font-size: 11px; letter-spacing: 2px; color: var(--text-2); }
#roomcode { font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: 3px; }
#roomcopy { width: 28px; height: 28px; border-radius: 8px; border: none; background: rgba(255,255,255,.06);
  color: var(--text-2); cursor: pointer; }
#roomcopy:hover { color: var(--accent); }
#banners { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: center; }
.banner { border-radius: 10px; padding: 9px 16px; display: flex; align-items: center; gap: 10px; font-size: 15px;
  background: rgba(20,13,42,.9); border: 1px solid var(--warn); border-left: 4px solid var(--warn);
  color: var(--warn); font-weight: 700; box-shadow: 0 0 22px rgba(255,210,63,.28);
  animation: ld-pop .4s ease-out; }
.banner.sys { border-color: rgba(255,255,255,.14); border-left-width: 1px; color: var(--text-2);
  font-weight: 400; font-size: 14px; box-shadow: none; background: rgba(20,13,42,.82); }
.banner.fade { animation: ld-fadeout .5s forwards; }

#hud .bl { position: absolute; bottom: 6%; left: 5.5%; }
#dashchip { height: 40px; display: inline-flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px;
  background: rgba(6,4,16,.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12); }
#dashchip .lab { font-size: 12px; letter-spacing: 1.5px; color: var(--text-2); }
#dashtrack { width: 120px; height: 8px; border-radius: 4px; background: var(--stroke); overflow: hidden; }
#dashfill { height: 100%; width: 100%; background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }

#hud .br { position: absolute; bottom: 6%; right: 5.5%; display: flex; gap: 8px; }

.nametag { position: absolute; transform: translate(-50%, -100%); display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 8px; background: rgba(6,4,16,.55); backdrop-filter: blur(4px);
  font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 2; }
.nametag .dot { width: 9px; height: 9px; border-radius: 50%; }
.nametag .score { font-family: var(--mono); color: var(--text-lav); font-weight: 500; }

/* ---------- modal (game over / host left) ---------- */
#modal { z-index: 20; background: rgba(6,4,16,.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; }
#modal .card { width: min(640px, 90vw); text-align: center; }
#modal .eyebrow { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-2); }
#modal h1 { font-family: var(--disp); font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin: 10px 0; }
#modal .sub { font-size: 16px; color: var(--text-2); margin-bottom: 28px; }
#modal .stats { display: inline-flex; background: rgba(12,8,32,.7); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 18px 8px; margin-bottom: 28px; }
#modal .stats > div { padding: 0 26px; border-right: 1px solid rgba(255,255,255,.1); }
#modal .stats > div:last-child { border-right: none; }
#modal .stats .v { font-family: var(--mono); font-weight: 700; font-size: 34px; }
#modal .stats .k { font-size: 13px; color: var(--text-2); margin-top: 4px; }
#modal .btnrow { justify-content: center; }
#modal .btnrow .btn { min-width: 180px; }

/* ---------- touch (§2.10) ---------- */
#touch { z-index: 9; display: none; }
#touch.on { display: block; }
#steerpad { position: absolute; bottom: 24px; left: 40px; width: 130px; height: 130px; border-radius: 50%;
  background: rgba(6,4,16,.5); backdrop-filter: blur(6px); border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent); }
#steerring { position: absolute; inset: 21px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); }
#steerknob { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 70%, transparent); left: 50px; top: 50px; }
#dashbtn { position: absolute; bottom: 40px; right: 36px; width: 96px; height: 96px; border-radius: 50%;
  background: var(--accent); border: none; color: var(--on-accent); font-family: inherit; font-weight: 700;
  font-size: 13px; box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 60%, transparent); }
#dashbtn .z { display: block; font-size: 24px; }
#brakebtn { position: absolute; bottom: 150px; right: 52px; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(6,4,16,.5); backdrop-filter: blur(6px); border: 2px solid rgba(255,255,255,.25);
  color: var(--text-2); font-size: 22px; }
#firebtn { position: absolute; bottom: 150px; right: 130px; width: 76px; height: 76px; border-radius: 50%;
  background: #d8402e; border: none; color: #fff; font-family: inherit; font-weight: 700; font-size: 12px;
  box-shadow: 0 0 24px rgba(216,64,46,.55); }
#firebtn .z { display: block; font-size: 22px; }
/* aim crosshair while playing on foot */
body.playing #game { cursor: crosshair; }

/* ---------- chase chrome ---------- */
#wanted { height: 46px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 12px;
  background: rgba(6,4,16,.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12); width: max-content; }
#stars { font-size: 22px; letter-spacing: 4px; color: #2A1550; }
#stars b { color: #FF3B6B; text-shadow: 0 0 12px rgba(255,59,107,.8); font-weight: 400; }
#cash { height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 12px;
  background: rgba(6,4,16,.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12);
  font-family: var(--mono); font-weight: 700; font-size: 22px; width: max-content; }
#cash .ic { color: #7CFF6B; }
#bankedval { font-size: 13px; color: var(--text-3); font-weight: 500; }
#lives { display: flex; gap: 6px; font-size: 30px; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
#lives span { color: #ff4d63; }
#lives span.off { color: rgba(255,255,255,.16); }
#statline { margin-top: 6px; font-family: var(--mono); font-size: 13px; letter-spacing: .09em; color: var(--text-3);
  text-shadow: 0 2px 6px rgba(0,0,0,.6); }
#statline b { color: #fff; font-size: 15px; }
#statline .rec { display: block; margin-top: 3px; color: #ffd23f; font-size: 12px; }
#vignette { position: fixed; inset: 0; z-index: 7; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(255,20,60,.42) 100%); }
#objarrow { position: fixed; z-index: 8; display: none; flex-direction: column; align-items: center; gap: 2px;
  pointer-events: none; transform: translate(-50%, -50%); }
#objtri { font-size: 22px; line-height: 1; filter: drop-shadow(0 0 8px currentColor); }
#objlabel { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; font-weight: 700;
  text-shadow: 0 1px 6px rgba(6,4,16,.9); }
.wash-busted { animation: ld-washr .5s ease-out; }
@keyframes ld-washr { 0% { box-shadow: inset 0 0 0 100vmax rgba(255,30,60,.35); } 100% { box-shadow: inset 0 0 0 100vmax transparent; } }

/* ---------- night-run chrome ---------- */
#minimap { position: absolute; bottom: 6%; right: 5.5%; width: 196px; height: 150px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: #0b1220;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#lightschip { display: none; height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px;
  border-radius: 10px; background: rgba(6,4,16,.6); border: 1px solid rgba(255,255,255,.12);
  font-family: var(--mono); font-size: 13px; letter-spacing: .5px; color: var(--text-2); margin-top: 10px; width: max-content; }
#lightschip b { color: #ffd9a0; }
#lightschip.off { opacity: .55; }
#lightschip.off b { color: var(--text-3); }
#lightsdot { color: #ffd9a0; font-size: 15px; }
#lightschip.off #lightsdot { color: var(--text-3); }
#hiddenchip { display: none; height: 34px; align-items: center; padding: 0 13px; border-radius: 10px;
  background: rgba(58,208,122,.14); border: 1px solid rgba(58,208,122,.5); color: #3ad07a;
  font-family: var(--mono); font-size: 13px; font-weight: 700; margin-top: 10px; width: max-content; }
#hiddenchip.on { display: inline-flex; animation: ld-blink 1.4s infinite; }

#enterhint { display: none; position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%);
  height: 40px; align-items: center; gap: 8px; padding: 0 16px; border-radius: 10px;
  background: rgba(6,4,16,.72); border: 1px solid var(--accent); color: var(--text);
  font-size: 15px; font-weight: 600; box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 40%, transparent); }
#enterhint.on { display: inline-flex; }
#enterhint b { font-family: var(--mono); background: var(--accent); color: var(--on-accent);
  border-radius: 5px; padding: 2px 7px; font-size: 13px; }
