/* Layout: full-bleed 3D canvas over a sky gradient; HUD floats in the safe area; title/results cards sit beside
   (desktop) or under (phone) the live scene. The sky colours follow the real clock (src/sky.js sets the vars). */
:root {
  --mint: #03E888;              /* naiss green-500 */
  --mint-deep: #00C171;         /* green-600 */
  --ink: #001F12;               /* pine-950: naissride.com text */
  --ink-soft: #2D7556;          /* pine-500 */
  --cream: #FFF8EC;
  --card: rgba(255, 252, 245, 0.94);
  --sun: #FFC23D;
  --sky-top: #8FD3F0;
  --sky-low: #FFE9CF;
  --stars: 0;                   /* 0 by day, 1 at night */
  --font-display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;   /* the naiss brand font */
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-low) 62%); color: var(--ink); font-family: var(--font-body); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
/* naiss rule: no capital letters anywhere */
body { text-transform: lowercase; }
button, input, textarea, select, kbd { text-transform: inherit; }
body::before { content: ""; position: fixed; inset: 0 0 40% 0; pointer-events: none; opacity: var(--stars); transition: opacity 2s;
  background: radial-gradient(1.5px 1.5px at 12% 18%, #fff 99%, transparent), radial-gradient(1px 1px at 27% 8%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 41% 26%, #fff 99%, transparent), radial-gradient(1px 1px at 55% 12%, #fff 99%, transparent),
    radial-gradient(2px 2px at 68% 22%, #fff 99%, transparent), radial-gradient(1px 1px at 79% 6%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 88% 30%, #fff 99%, transparent), radial-gradient(1px 1px at 6% 40%, #fff 99%, transparent),
    radial-gradient(1px 1px at 34% 44%, #fff 99%, transparent), radial-gradient(1.5px 1.5px at 62% 40%, #fff 99%, transparent),
    radial-gradient(1px 1px at 94% 48%, #fff 99%, transparent), radial-gradient(1px 1px at 19% 56%, #fff 99%, transparent); }
canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
button:disabled { opacity: 0.6; cursor: progress; }

.speedlines { position: fixed; inset: -25%; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0) 0deg 5deg, rgba(255,255,255,0.55) 5deg 5.5deg);
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 72%); mask: radial-gradient(circle, transparent 38%, #000 72%);
  animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(6deg); } }

/* ---------------------------------------------------------------- HUD (mobile first: joystick left, tray centre, action right) */
.hud { position: fixed; inset: 0; pointer-events: none; grid-template-columns: minmax(0, 1fr); padding: calc(env(safe-area-inset-top, 0px) + 12px) calc(env(safe-area-inset-right, 0px) + 14px) calc(env(safe-area-inset-bottom, 0px) + 14px) calc(env(safe-area-inset-left, 0px) + 14px); display: grid; grid-template-rows: auto 1fr auto; }
.hud button { pointer-events: auto; }
.hud-top { display: flex; gap: 8px; align-items: flex-start; }
.pill { background: var(--cream); border-radius: 999px; padding: 7px 14px 7px 10px; box-shadow: 0 4px 0 rgba(10, 63, 51, 0.12), 0 8px 18px rgba(10, 63, 51, 0.12); display: flex; align-items: center; gap: 7px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pill .big { font-family: var(--font-display); font-size: 22px; line-height: 1; letter-spacing: -0.02em; min-width: 2.2ch; }
.pill .ico { width: 22px; height: 22px; flex: none; }
.timer.low { background: #FFE1E4; animation: throb .5s ease-in-out infinite alternate; }
.timer.low .big { color: #C42D41; }
@keyframes throb { to { transform: scale(1.06); } }
.bolt { width: 16px; height: 20px; flex: none; }
.event { align-self: center; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; white-space: nowrap; box-shadow: 0 8px 18px rgba(10, 63, 51, 0.2); position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 62px); }
.event b { color: var(--mint); font-variant-numeric: tabular-nums; }
.event.hot { background: #3A1408; box-shadow: 0 0 0 3px #FF8A2A, 0 0 26px rgba(255, 110, 40, 0.65); }
.event.hot b { color: #FFC23D; }
.hud-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.touch .hud-right { display: grid; grid-template-columns: auto auto auto; justify-items: end; }
.touch #viewBtn { order: -1; }
.touch .hud-right #minimap { grid-column: 1 / -1; }
.touch #mapBtn { order: -1; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--cream); color: var(--ink); display: grid; place-items: center; box-shadow: 0 4px 0 rgba(10, 63, 51, 0.12), 0 8px 18px rgba(10, 63, 51, 0.12); }
.iconbtn svg { width: 20px; height: 20px; }
#minimap { width: 96px; height: 96px; border-radius: 22px; background: #0E5A45; border: 3px solid var(--cream); box-shadow: 0 8px 18px rgba(10, 63, 51, 0.2); }
.hud-bottom { display: flex; justify-content: center; align-items: flex-end; gap: 12px; }
.keychips { display: none; gap: 8px; margin-right: auto; }
.keychips span { background: var(--cream); border-radius: 999px; padding: 5px 12px 5px 5px; font-weight: 700; font-size: 13px; color: var(--ink-soft); box-shadow: 0 6px 14px rgba(10, 63, 51, 0.12); display: inline-flex; align-items: center; gap: 7px; }
.keychips kbd { background: #0E5A45; color: var(--cream); box-shadow: none; padding: 3px 9px; border-radius: 999px; }
.keychips em { font-style: normal; }
.tray-wrap { display: grid; justify-items: center; }
.tray { display: flex; gap: 4px; background: rgba(255, 250, 241, 0.94); border-radius: 999px; padding: 5px; box-shadow: 0 4px 0 rgba(10, 63, 51, 0.1), 0 10px 22px rgba(10, 63, 51, 0.16); }
.slot { --s: 40px; position: relative; display: grid; justify-items: center; gap: 3px; }
.seat { position: relative; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; }
.slot:not(.full) .seat { background: rgba(10, 63, 51, 0.06); box-shadow: inset 0 2px 3px rgba(10, 63, 51, 0.1); color: rgba(10, 63, 51, 0.2); }
.slot:not(.full) .seat svg { width: 46%; height: 46%; }
.slot.full .seat { background: #fff; box-shadow: 0 2px 0 rgba(10, 63, 51, 0.1); }
.slot .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.slot .ring circle { fill: none; stroke-width: 3.5; }
.slot .ring .track { stroke: color-mix(in srgb, var(--d) 22%, #fff); }
.slot .ring .tip { stroke: var(--d); stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--p, 1)); transition: stroke-dashoffset .25s linear; }
.slot.hurry .ring .tip { animation: hurry .45s ease-in-out infinite alternate; }
@keyframes hurry { to { stroke-width: 5; opacity: 0.55; } }
.slot.late .face { filter: saturate(0.6) brightness(0.95); }
.slot.full .seat { background: radial-gradient(circle at 50% 38%, #fff 30%, color-mix(in srgb, var(--c) 30%, #fff) 100%); }
.slot .face { position: relative; width: 92%; height: 92%; object-fit: contain; margin-top: 4%; pointer-events: none; }
.slot.in .seat { animation: seat-in .5s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes seat-in { from { transform: scale(0.3) translateY(-14px); opacity: 0; } }
.slot .dest { display: none; }
/* what the rider pays: fare and tip, ticking down with the tip; red for an urgent rider still on time, a gold "x2"
   sticker while the fare is doubled */
.slot .fare { position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 1px; padding: 1px 5px 1px 3px; border-radius: 999px; background: var(--cream); color: var(--ink); font-size: 10.5px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 0 0 1.5px var(--ink); }
.slot .fare svg { width: 8px; height: 10px; flex: none; }
.slot.late .fare { opacity: 0.75; }
.slot.rush .fare { background: #FF4B3E; color: #fff; animation: rush .5s ease-in-out infinite alternate; }
.slot .x2 { display: none; position: absolute; right: -6px; top: -6px; width: 19px; height: 19px; border-radius: 50%; background: #FFC23D; color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); font-size: 9.5px; font-weight: 800; place-items: center; line-height: 1; }
.slot.doubled .x2 { display: grid; }
@keyframes rush { to { transform: translateX(-50%) scale(1.12); } }
.event.surge { background: var(--mint); color: var(--ink); box-shadow: 0 0 0 3px var(--ink), 0 8px 18px rgba(10, 63, 51, 0.25); }
.event.surge b { color: var(--ink); }
.hint { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 82px); transform: translateX(-50%); background: var(--ink); color: var(--cream); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; transition: opacity .6s; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.hint:empty { display: none; }
.action { position: relative; display: none; width: 80px; height: 80px; border-radius: 50%; border: 0; background: #B8F5D6; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 18px; box-shadow: 0 5px 0 #6FD9A6, 0 10px 22px rgba(10, 63, 51, 0.2); flex: none; touch-action: none; -webkit-touch-callout: none; }
.action .fuel { display: none; }
.action::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--ring-c, #FFC23D) calc(var(--ring, 0) * 1turn), rgba(255, 255, 255, 0.45) 0); -webkit-mask: radial-gradient(circle, transparent 39px, #000 40px); mask: radial-gradient(circle, transparent 39px, #000 40px); }
.action span { position: relative; }
.action.ready { background: var(--mint); }
.action.boat { --ring-c: #55B8FF; background: #CDEBFF; box-shadow: 0 5px 0 #7CC0EE, 0 10px 22px rgba(10, 63, 51, 0.2); }
.action.boat.ready { background: #8DD2FF; }
.action.down { transform: translateY(4px) scale(0.97); box-shadow: 0 1px 0 #6FD9A6; }
.stick { position: fixed; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; background: rgba(214, 250, 232, 0.55); border: 2px solid rgba(255, 255, 255, 0.9); pointer-events: none; box-shadow: 0 8px 20px rgba(10, 63, 51, 0.15); }
.stick::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: conic-gradient(from 45deg, transparent 0 4deg, rgba(10, 63, 51, 0.12) 0 6deg, transparent 0 94deg, rgba(10, 63, 51, 0.12) 0 96deg, transparent 0 184deg, rgba(10, 63, 51, 0.12) 0 186deg, transparent 0 274deg, rgba(10, 63, 51, 0.12) 0 276deg, transparent 0); }
.stick i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: #0F7A55; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18), 0 4px 10px rgba(10, 63, 51, 0.3); }
.stick.rest { left: calc(env(safe-area-inset-left, 0px) + 66px); top: calc(100% - env(safe-area-inset-bottom, 0px) - 66px); opacity: 0.85; }
#mapBtn { display: none; }
.touch #mapBtn { display: grid; }
.touch #minimap { display: none; }
.touch .hud.map-on #minimap { display: block; animation: map-in .25s cubic-bezier(.2, 1.4, .4, 1); transform-origin: top right; }
.touch .hud.map-on #mapBtn { background: var(--ink); color: var(--cream); }
@keyframes map-in { from { opacity: 0; transform: scale(.6); } }
.touch #minimap { width: 112px; height: 112px; pointer-events: auto; }
.touch .action { display: block; width: 76px; height: 76px; }
.touch .action::before { -webkit-mask: radial-gradient(circle, transparent 37px, #000 38px); mask: radial-gradient(circle, transparent 37px, #000 38px); }
.touch .hud-bottom { justify-content: space-between; gap: 6px; padding-left: 108px; }
html:not(.touch) .keychips { display: flex; }
html:not(.touch) .hud-bottom { justify-content: space-between; }
html:not(.touch) .tray-wrap { margin-left: auto; }
html:not(.touch) .tray { padding: 8px 10px 6px; gap: 6px; border-radius: 26px; }
html:not(.touch) .slot { --s: 52px; width: 66px; }
html:not(.touch) .slot .fare { font-size: 12px; bottom: -8px; padding: 1px 6px 1px 4px; }
html:not(.touch) .slot .fare svg { width: 9px; height: 11px; }
html:not(.touch) .slot.full .dest { margin-top: 6px; }
html:not(.touch) .slot .dest { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 800; color: color-mix(in srgb, var(--d) 55%, var(--ink)); line-height: 1.2; }
html:not(.touch) .hint { bottom: calc(env(safe-area-inset-bottom, 0px) + 62px); }
html:not(.touch) #minimap { width: 150px; height: 150px; border-radius: 28px; pointer-events: auto; cursor: pointer; transition: transform .15s; }
html:not(.touch) #minimap:hover { transform: scale(1.04); }
html:not(.touch) .pill .big { font-size: 26px; }
html:not(.touch) .pill { padding: 9px 18px 9px 12px; }
html:not(.touch) .pill .ico { width: 26px; height: 26px; }
html:not(.touch) .event { position: static; transform: none; align-self: flex-start; margin: 4px 0 0 4px; font-size: 15px; padding: 9px 16px; }
.guide { position: fixed; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: none; display: grid; justify-items: center; gap: 4px; z-index: 2; }
.guide[data-side="r"] { transform: translate(calc(-100% + 25px), -50%); justify-items: end; }
.guide[data-side="l"] { transform: translate(-25px, -50%); justify-items: start; }
.guide .dot { width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(10, 63, 51, 0.25); }
.guide .dot svg { width: 26px; height: 26px; }
.guide .tag { background: var(--ink); color: var(--cream); font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }

.float { position: fixed; transform: translate(-50%, -50%); font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink); text-shadow: 0 2px 0 #fff, 0 0 12px #fff; pointer-events: none; white-space: nowrap; animation: rise 1.3s ease-out forwards; }
.float.gold { color: #B57900; }
.float.small { font-size: 16px; }
.float.clockhit { color: #FF4B3E; font-size: 18px; animation: drop 1.3s ease-in forwards; z-index: 6; }
@keyframes drop { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: 34px; } }
@keyframes rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -70px; } }
.banner { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%) rotate(-4deg); font-family: var(--font-display); font-weight: 800; font-size: clamp(48px, 13vw, 110px); color: var(--mint); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; letter-spacing: -0.03em; pointer-events: none; animation: pop 1.4s cubic-bezier(.2, 1.6, .4, 1) forwards; white-space: nowrap; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-4deg) scale(.3); } 18% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(1.08); } 75% { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) rotate(-4deg) scale(1); } }
.bubble { position: fixed; transform: translate(-50%, -100%); display: grid; justify-items: center; gap: 6px; pointer-events: none; z-index: 3; animation: bubble 1.9s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.bubble-card { position: relative; background: var(--cream); border-radius: 20px; padding: 10px 18px 11px; display: grid; justify-items: center; gap: 1px; box-shadow: 0 5px 0 rgba(10, 63, 51, 0.12), 0 12px 26px rgba(10, 63, 51, 0.2); }
.bubble-card::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; background: var(--cream); transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.bubble-card b { font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.bubble-card strong { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--mint-deep); letter-spacing: -0.03em; line-height: 1.05; }
.bubble-card small { font-weight: 800; font-size: 14px; color: #B57900; }
.bubble-chip { margin-top: 6px; background: var(--ink); color: var(--cream); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 3px 10px; }
@keyframes bubble { 0% { opacity: 0; margin-top: 20px; scale: .6; } 14% { opacity: 1; margin-top: 0; scale: 1.05; } 22% { scale: 1; } 80% { opacity: 1; margin-top: -10px; } 100% { opacity: 0; margin-top: -40px; } }
.powercard { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 112px); transform: translateX(-50%); width: min(380px, calc(100vw - 28px)); display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: var(--cream); border-radius: 20px; padding: 12px 16px; box-shadow: inset 0 0 0 3px var(--c), 0 14px 30px rgba(10, 63, 51, 0.22); pointer-events: none; z-index: 4; animation: card 4.2s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.powercard .face { width: 52px; height: 52px; object-fit: contain; flex: none; }
.powercard .say { display: grid; gap: 2px; }
.powercard .say b { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.powercard small { font-weight: 600; font-size: 13.5px; color: var(--ink-soft); line-height: 1.35; }
@keyframes card { 0% { opacity: 0; transform: translate(-50%, -14px) scale(.9); } 8% { opacity: 1; transform: translate(-50%, 0) scale(1); } 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -10px); } }
html:not(.touch) .powercard { top: calc(env(safe-area-inset-top, 0px) + 74px); }
.play.small { font-size: 17px; padding: 11px 14px; border-radius: 999px; box-shadow: 0 4px 0 var(--mint-deep); }
@keyframes rise-in { from { opacity: 0; transform: translate(-50%, 16px); } }
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 86px); transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; pointer-events: none; animation: toast 2s ease forwards; white-space: nowrap; z-index: 5; }
@keyframes toast { 0% { opacity: 0; margin-top: -10px; } 10%, 80% { opacity: 1; margin-top: 0; } 100% { opacity: 0; } }

.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px); overflow-y: auto; }
.card { background: var(--card); border-radius: 28px; padding: 26px 24px 22px; width: min(440px, 100%); box-shadow: 0 24px 60px rgba(10, 63, 51, 0.22); display: grid; gap: 16px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--ink-soft); }
h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 12vw, 64px); line-height: 0.92; letter-spacing: -0.055em; text-wrap: balance; }
h1 span { color: var(--mint-deep); }
h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: -0.045em; }
p { margin: 0; line-height: 1.45; color: var(--ink-soft); font-weight: 500; }
.crew { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.crew span { display: inline-flex; align-items: center; gap: 5px; }
.crew .face { width: 26px; height: 26px; object-fit: contain; margin: -4px 0; }
img.face:not([src]), img.face[src=""] { visibility: hidden; }
.crew em { font-style: normal; font-weight: 600; opacity: 0.75; }
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rule { background: #fff; border-radius: 16px; padding: 10px; display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.3; }
.rule b { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.play { border: 0; border-radius: 18px; background: var(--mint); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 22px; padding: 16px; box-shadow: 0 6px 0 var(--mint-deep); }
.play:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--mint-deep); }
.ghost { border: 2px solid var(--ink); border-radius: 18px; background: #fff; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 17px; padding: 12px 16px; }
.actions { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.brag { width: 100%; border-radius: 14px; border: 2px solid var(--line, #cfe3da); padding: 10px; font: 600 13px/1.4 var(--font-body); color: var(--ink); resize: none; user-select: text; -webkit-user-select: text; }
.keys { font-size: 12.5px; text-align: center; color: var(--ink-soft); font-weight: 600; line-height: 1.8; }
.best { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.modes { font-size: 12.5px; color: var(--ink-soft); text-align: center; line-height: 1.45; margin-top: -6px; }
.modes b { color: var(--ink); }
.crewlink { justify-self: center; font-weight: 800; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--mint); padding-bottom: 1px; font-size: 14px; }
.crewlink:hover { border-color: var(--ink); }
.linkbtn { justify-self: center; padding: 4px; border: 0; background: none; font: inherit; font-weight: 800; font-size: 14px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.float.chip { background: var(--ink); color: #FFE36E; text-shadow: none; font-size: 15px; padding: 4px 11px; border-radius: 999px; }
.title-links { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.pausecard { width: min(360px, 100%); text-align: center; }
.pause-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------------------------------------------------------------- results + rankings (concept 06) */
.card.result { gap: 12px; }
.res-head { display: grid; justify-items: center; gap: 2px; text-align: center; }
.res-badge { background: var(--cream); border-radius: 999px; padding: 6px 18px; font-family: var(--font-display); font-weight: 800; font-size: 19px; box-shadow: 0 4px 0 rgba(10, 63, 51, 0.1); margin-bottom: 4px; }
.res-score { display: flex; align-items: center; gap: 6px; }
.res-score .bolt { width: 34px; height: 42px; filter: drop-shadow(0 3px 0 rgba(10, 63, 51, 0.2)); }
.res-score b { font-family: var(--font-display); font-weight: 800; font-size: clamp(56px, 17vw, 76px); letter-spacing: 0.01em; line-height: 0.95; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; font-variant-numeric: tabular-nums; }
.res-unit { font-family: var(--font-display); font-weight: 800; font-size: 20px; margin-top: -2px; }
.res-meta { font-weight: 700; color: var(--ink-soft); font-size: 14px; }
.res-pb { margin-top: 6px; background: #C9F7DF; color: var(--ink); border-radius: 999px; padding: 5px 14px; font-weight: 800; font-size: 14px; }
.res-chips { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.res-chips:empty { display: none; }
.res-chips span { background: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 12.5px; color: var(--ink-soft); }
.join { background: #fff; border-radius: 20px; padding: 12px; display: grid; gap: 8px; }
.join-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; text-align: center; }
.join-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.join input, .join select { min-width: 0; font: 700 16px var(--font-body); color: var(--ink); background: var(--cream); border: 2px solid #D9E9E1; border-radius: 14px; padding: 10px 12px; user-select: text; -webkit-user-select: text; }
.join input:focus, .join select:focus { outline: none; border-color: var(--mint-deep); }
.join-err { color: #C42D41; font-weight: 700; font-size: 12.5px; text-align: center; min-height: 0; }
.join-err:empty { display: none; }
.board { background: var(--cream); border-radius: 22px; padding: 10px; display: grid; gap: 8px; box-shadow: inset 0 0 0 2px #EADFC9; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button { border: 0; border-radius: 14px; padding: 9px; background: #ECE5D6; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.seg button[aria-pressed="true"] { background: var(--mint-deep); color: #fff; }
.scopes { display: flex; gap: 6px; }
.scopes button { flex: 1; border: 0; border-radius: 999px; padding: 6px 8px; background: #ECE5D6; color: var(--ink); font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scopes button[aria-pressed="true"] { background: var(--mint-deep); color: #fff; }
.board-title { font-weight: 800; font-size: 13.5px; padding: 2px 4px 0; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; transition: opacity .2s; }
.rows.loading { opacity: 0.45; }
.row { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 6px 10px; font-weight: 700; font-size: 14.5px; }
.row .rk { font-family: var(--font-display); font-weight: 800; color: var(--ink-soft); text-align: center; }
.row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .un { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.row .sc { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.row .sc svg { width: 12px; height: 15px; }
.row .face { width: 30px; height: 30px; object-fit: contain; }
.row.me { background: #D8FBE9; box-shadow: inset 0 0 0 2px var(--mint-deep); }
.row.pending .nm { color: var(--ink-soft); font-size: 13px; }
.rows .gap, .rows .empty { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: 13px; padding: 4px; }
.board-foot { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.board-foot:empty { display: none; }
.play.big { font-size: 24px; padding: 16px; border-radius: 999px; }
.res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.res-actions .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; padding: 10px 14px; font-size: 15px; }
.res-actions svg { width: 18px; height: 18px; }
#boardScreen .card { width: min(440px, 100%); }
.loading { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); font-weight: 700; color: var(--ink-soft); font-size: 13px; background: var(--card); padding: 6px 12px; border-radius: 999px; }
@media (min-width: 900px) { #titleScreen, #overScreen, #boardScreen { place-items: center start; padding-left: max(5vw, 24px); } }
@media (max-aspect-ratio: 1/1) { #titleScreen { align-items: end; } }
@media (max-width: 420px) {
  .pill .big { font-size: 20px; } .pill { padding: 6px 12px 6px 8px; } .pill .ico { width: 20px; height: 20px; }
  .card { padding: 18px 16px 16px; gap: 12px; border-radius: 24px; }
  h1 { font-size: 44px; } p { font-size: 14px; }
  .rule { padding: 8px; font-size: 11.5px; } .rule b { font-size: 14px; }
  .play { padding: 13px; font-size: 20px; } .ghost { font-size: 15px; }
  .toast { top: calc(env(safe-area-inset-top, 0px) + 112px); max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
}
.touch .keys { display: none; }
@media (prefers-reduced-motion: reduce) { .float, .banner, .toast { animation-duration: .01s; } .speedlines { display: none; } }

/* ---------------------------------------------------------------- the big map (click the minimap or press m) */
.mapscreen { background: rgba(0, 31, 18, 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 20; }
.mapcard { background: var(--cream); border-radius: 32px; padding: 18px 18px 14px; width: min(92vw, calc(100dvh - 200px), 760px); display: grid; gap: 12px; box-shadow: 0 24px 60px rgba(0, 31, 18, 0.3); animation: map-pop .28s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes map-pop { from { transform: scale(0.9); opacity: 0; } }
.maphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.maphead h2 { margin: 2px 0 0; font-size: 26px; letter-spacing: -0.02em; }
#bigmap { width: 100%; aspect-ratio: 1; border-radius: 50%; background: #97D3E2; box-shadow: inset 0 0 0 4px #fff, 0 6px 18px rgba(0, 31, 18, 0.14); }
.maplegend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.maplegend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.lg.you { background: #03E888; border: 2px solid var(--ink); border-radius: 3px; transform: rotate(45deg); width: 10px; height: 10px; }
.lg.rider { background: #FFC23D; border: 3px solid #FF6B8A; }
.lg.drop { background: #FF6B8A; border: 2px solid var(--ink); }
.lg.gate { background: #03E888; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 31, 18, 0.25); }
.lg.gold { background: #FFC23D; border: 2px solid var(--ink); }
.lg.urgent { background: #FFC23D; border: 3px solid #FF4B3E; }
.lg.surge { background: transparent; border: 3px solid #03E888; width: 13px; height: 13px; }
.mapfoot { text-align: center; font-size: 12px; font-weight: 600; color: rgba(0, 31, 18, 0.55); }

/* ---------------------------------------------------------------- the title: a cinematic tour behind letterbox bars */
.cine { position: fixed; inset: 0; pointer-events: none; }
.cine .bar { position: absolute; left: 0; right: 0; height: 8.5vh; background: #000; transition: transform 1.1s cubic-bezier(.65, 0, .25, 1); }
.cine .bar.top { top: 0; }
.cine .bar.bottom { bottom: 0; }
body:not(.titling) .cine .bar.top { transform: translateY(-101%); }
body:not(.titling) .cine .bar.bottom { transform: translateY(101%); }
.cine .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 120% 95% at 62% 50%, transparent 52%, rgba(0, 18, 10, 0.5) 100%); transition: opacity 1s; }
.cine .fade { position: absolute; inset: 0; background: #000; opacity: 0; }
body:not(.titling) .cine .vignette, body:not(.titling) .cine .fade, body:not(.titling) .shotcap { opacity: 0 !important; }
.shotcap { position: absolute; right: max(5vw, 24px); bottom: calc(8.5vh + 28px); display: grid; justify-items: end; gap: 6px; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); opacity: 0; transform: translateY(10px); transition: opacity .7s, transform .9s cubic-bezier(.2, .8, .2, 1); }
.shotcap.on { opacity: 1; transform: none; }
.shotcap b { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4.6vw, 64px); letter-spacing: -0.045em; line-height: 0.95; }
.shotcap span { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; padding: 5px 10px; border-radius: 999px; background: rgba(0, 31, 18, 0.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); text-shadow: none; }
.shotcap span::before { content: ""; display: inline-block; width: 26px; height: 2px; background: var(--mint); vertical-align: middle; margin-right: 10px; }
#titleScreen { padding-top: calc(8.5vh + 16px); padding-bottom: calc(8.5vh + 16px); }
.titlecard { width: min(400px, 100%); gap: 14px; background: rgba(255, 250, 240, 0.8); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 30px 80px rgba(0, 18, 10, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.55); animation: card-in 1.1s cubic-bezier(.2, .9, .2, 1) .25s both; }
.titlecard h1 { font-size: clamp(54px, 13vw, 78px); }
.titlecard .lede { font-size: 15px; }
@keyframes card-in { from { opacity: 0; transform: translateY(28px) scale(.98); } }
.titlecard .best { display: flex; justify-content: center; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.linkbtn.inline { padding: 0 2px; font-size: 13px; color: var(--ink); }
.how { border-radius: 16px; background: rgba(255, 255, 255, 0.55); }
.how summary { cursor: pointer; list-style: none; padding: 9px 14px; font-weight: 800; font-size: 14px; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: "+"; font-size: 18px; font-weight: 700; color: var(--ink-soft); }
.how[open] summary::after { content: "−"; }
.how-body { display: grid; gap: 12px; padding: 0 12px 12px; }
@media (max-aspect-ratio: 1/1) {
  .cine .bar { height: 6vh; }
  #titleScreen { padding-top: calc(6vh + 12px); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); }
  .shotcap { left: 22px; right: auto; top: calc(6vh + env(safe-area-inset-top, 0px) + 18px); bottom: auto; justify-items: start; }
  .shotcap b { font-size: 34px; }
  .shotcap span { font-size: 10.5px; letter-spacing: 0.06em; }
  .titlecard h1 { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) { .titlecard { animation: none; } .cine .bar { transition: none; } }

/* ---------------------------------------------------------------- your name */
#nameScreen { background: rgba(0, 31, 18, 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 20; }
.namecard { width: min(420px, 100%); text-align: center; animation: map-pop .28s cubic-bezier(.2, 1.4, .4, 1); }
.namecard .join { background: none; padding: 0; }
.namecard .join-row { grid-template-columns: 1fr 1fr; }
.namenote { font-size: 12.5px; }
.asname { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: -4px; }
.iconbtn[aria-pressed="true"] { background: var(--mint); }
