
  :root {
    --ink: #082B52;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='4.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15.5 12 8.5l7 7'/%3E%3C/svg%3E");
  }
  @font-face {font-family:'Poppins';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/poppins-400.ttf') format('truetype');}
  @font-face {font-family:'Poppins';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/poppins-500.ttf') format('truetype');}
  @font-face {font-family:'Poppins';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/poppins-600.ttf') format('truetype');}
  @font-face {font-family:'Poppins';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/poppins-700.ttf') format('truetype');}
  @font-face {font-family:'SlopeDisplay';font-style:normal;font-weight:400;font-display:swap;src:url('/deskslope/super-bouncer.woff2') format('woff2');}
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; overflow: hidden; background: #bfe0f5; font-family: 'Poppins', -apple-system, "SF Pro Rounded", "Segoe UI", sans-serif; color: var(--ink); }
  /* the canvas handles its own drags, so the browser must not scroll or zoom */
  #game { display: block; width: 100vw; height: 100vh; touch-action: none; }

  #hud {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    /* shown only while riding — start() switches it on */
    display: none; gap: 12px; align-items: center; pointer-events: none; z-index: 5;
  }
  .pill {
    /* same glass as everything else on the screen, and no shadow */
    background: rgba(255,255,255,0.55); backdrop-filter: blur(10px);
    border-radius: 12px; padding: 8px 18px; font-weight: 700; font-size: 20px;
    font-variant-numeric: tabular-nums;
    text-align: center; width: 118px;
  }
  .pill small { font-weight: 600; font-size: 12px; opacity: 0.55; display: block; letter-spacing: 0.08em; text-transform: uppercase; }

  #tabs {
    position: fixed; top: 16px; right: 16px; z-index: 30;
    display: flex; gap: 12px; align-items: center;
  }
  #credit {
    font-size: 13px; font-weight: 600; color: var(--ink);
    text-decoration: none; opacity: 0.65; transition: opacity 0.12s ease;
  }
  #credit:hover { opacity: 1; }
  /* PP Nikkei Line has no true small-cap glyphs, so font-variant only gets a
     synthesised result that barely differs from the caps beside it — set the
     size and tracking directly instead */
  #credit .by {
    text-transform: uppercase; font-size: 0.76em;
    letter-spacing: 0.07em; opacity: 0.75;
  }
  .emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
  .tuicon { height: 1.3em; width: auto; vertical-align: -0.3em; -webkit-user-drag: none; }
  #muteBtn {
    border-radius: 50%; width: 42px; height: 42px; padding: 0;
    /* same glass as the cards, and no shadow */
    background: rgba(255,255,255,0.55); backdrop-filter: blur(10px);
    color: var(--ink); box-shadow: none; font-size: 17px;
  }
  #muteBtn::before, #muteBtn::after { content: none; }
  #muteBtn:hover, #muteBtn:active { transform: none; box-shadow: none; background: rgba(255,255,255,0.7); }
  #cornerlogo {
    position: fixed; top: 18px; left: 18px; width: 96px; height: auto;
    z-index: 30; display: none; cursor: pointer;
    transition: transform 0.12s ease;
    -webkit-user-drag: none; user-select: none;
  }
  #herologo { -webkit-user-drag: none; user-select: none; }
  #overlogo { width: min(340px, 60vw); height: auto; margin-bottom: 6px; }
  .tab {
    font: inherit; font-weight: 700; font-size: 14px;
    padding: 8px 18px; border: none; border-radius: 999px; cursor: pointer;
    background: rgba(255,255,255,0.7); color: var(--ink);
    backdrop-filter: blur(8px); box-shadow: 0 2px 12px rgba(8,43,82,0.15);
  }
  .tab.active { background: var(--ink); color: #fff; }
  #customPanel {
    position: fixed; top: 72px; left: 16px; z-index: 25;
    display: flex; flex-direction: column; gap: 14px;
    background: rgba(255,255,255,0.8); backdrop-filter: blur(10px);
    border-radius: 20px; padding: 20px 22px; width: 240px;
    box-shadow: 0 4px 24px rgba(8,43,82,0.2);
  }
  #customPanel h2 { font-size: 20px; letter-spacing: -0.01em; }
  .optrow small { font-weight: 700; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.55; display: block; margin-bottom: 6px; }
  .swatches { display: flex; gap: 10px; }
  .swatch {
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 1px 6px rgba(8,43,82,0.3);
    transition: transform 0.1s ease;
  }
  .swatch:hover { transform: scale(1.12); }
  .swatch.sel { outline: 3px solid var(--ink); outline-offset: 2px; }

  #camwrap {
    position: fixed; bottom: 16px; right: 16px; z-index: 20;
    width: 260px; border-radius: 16px; overflow: hidden;
    background: #1a222b;
  }
  #camcanvas { display: block; width: 100%; }

  .overlay {
    position: fixed; inset: 0; z-index: 10;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 18px; padding: 24px;
    background: rgba(200,225,245,0.75); backdrop-filter: blur(10px);
  }
  .overlay.hidden { display: none; }
  #overscreen { background: rgba(200,225,245,0.45); backdrop-filter: blur(2px); }
  #startscreen {
    background: none;
    backdrop-filter: none;
    align-items: flex-start; text-align: left;
    padding-left: 7vw; padding-right: 45vw;
    cursor: grab; user-select: none;
  }
  #herologo { width: min(300px, 34vw); height: auto; margin-bottom: 4px; }
  /* one column width for everything on the left, the logo excepted */
  #startscreen { --col: 340px; }
  #startscreen p { max-width: var(--col); }
  #startscreen .moves { justify-content: flex-start; width: var(--col); }
  #startscreen #namerow { width: var(--col); }
  #startscreen #nameinput { flex: 1; width: auto; min-width: 0; }
  #startscreen .board { width: var(--col); }
  .overlay h1 { font-size: clamp(40px, 8vw, 72px); letter-spacing: -0.02em; text-shadow: 0 2px 0 #fff; }
  .overlay p { font-size: 18px; max-width: 500px; line-height: 1.5; opacity: 0.85; }
  .overlay .big { font-size: 64px; }
  .moves { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
  .move {
    background: rgba(255,255,255,0.55); backdrop-filter: blur(10px);
    border-radius: 16px; padding: 12px 18px;
    font-size: 14px; font-weight: 600;
  }
  .move span { display: block; font-size: 26px; margin-bottom: 4px; }
  button {
    font: inherit; font-weight: 700; font-size: 20px; letter-spacing: 0.05em;
    padding: 14px 44px; border: none; border-radius: 10px; cursor: pointer;
    background: var(--ink); color: #fff;
    box-shadow: 0 5px 0 #041a33; /* solid game-button shadow */
    transition: transform 0.08s ease, box-shadow 0.08s ease;
  }
  button:hover { transform: translateY(-1px); box-shadow: 0 6px 0 #041a33; }
  button:active { transform: translateY(4px); box-shadow: 0 1px 0 #041a33; }

  /* CTA hover: a blue glow blooms up from the bottom edge and sinks back down on
     the way out. The radial layer is pinned to the bottom of the button and has
     zero height at rest, so growing it is what makes the light rise — one
     background-size transition, no extra element. */
  /* CTA hover: a blue glow rises out of the bottom edge and keeps drifting while
     the pointer stays. The rise is a transform on its own layer and the drift is
     a background-position keyframe, so the two never fight over one property —
     an earlier single-layer version had the animation stomp the transition. */
  #startbtn, #againbtn { position: relative; overflow: hidden; background-color: var(--ink); }
  #startbtn > span, #againbtn > span { position: relative; z-index: 1; }
  /* Any layer that slides in has a leading edge, and on a rectangle that edge is
     a straight line however the gradient inside it is angled — three attempts at
     softening it all came back to the same artefact. So nothing moves: the whole
     face crossfades from ink to blue, and the drifting orbs above carry the life
     that the sweep was there to provide. */
  #startbtn::before, #againbtn::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(152deg, #3f97e4 0%, #2472c9 46%, #16478f 100%);
    opacity: 0;
    transition: opacity 0.42s ease;
  }
  #startbtn:hover::before, #againbtn:hover::before { opacity: 1; }

  /* The motion lives on its own layer as two soft circles that wander, rather
     than on the base glow. Sliding the base glow sideways moved its edge across
     the button and read as a line sweeping past; a circle that fades to nothing
     well before its bounding box has no edge to notice, so what you see is light
     drifting. Two of them, at different sizes and out of phase, so the pattern
     never resolves into a single moving shape. */
  #startbtn::after, #againbtn::after {
    /* overhangs the button so the blur has room to fall off past every edge —
       the parent's overflow:hidden crops it back to the corner radius */
    content: ''; position: absolute; inset: -30%; pointer-events: none;
    background-image:
      radial-gradient(circle, rgba(170,216,255,0.6) 0%, rgba(170,216,255,0.28) 34%, rgba(170,216,255,0) 70%),
      radial-gradient(circle, rgba(96,168,240,0.5) 0%, rgba(96,168,240,0.22) 38%, rgba(96,168,240,0) 74%);
    background-repeat: no-repeat;
    background-size: 62% 150%, 48% 130%;
    background-position: 25% 120%, 75% 130%;
    filter: blur(16px);
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  #startbtn:hover::after, #againbtn:hover::after {
    opacity: 1;
    animation: ctaOrbs 9s ease-in-out infinite;
  }
  /* fading the layer out means the animation stopping is never visible */
  @keyframes ctaOrbs {
    0%   { background-position: 22% 72%,  78% 122%; }
    25%  { background-position: 58% 116%, 38% 62%; }
    50%  { background-position: 82% 66%,  16% 118%; }
    75%  { background-position: 44% 122%, 68% 70%; }
    100% { background-position: 22% 72%,  78% 122%; }
  }
  @media (prefers-reduced-motion: reduce) {
    #startbtn:hover::after, #againbtn:hover::after { animation: none; }
  }
  .hint { font-size: 14px !important; opacity: 0.6 !important; }
  .hint .t { display: none; }
  @media (pointer: coarse) {
    .hint .k { display: none; }
    .hint .t { display: inline; }
  }
  #camstatus { font-size: 14px; font-weight: 600; max-width: 380px; }
  #camstatus.ok { color: #1e7e48; }
  /* the camera window already says what's wrong, in the place you're looking */
  #camstatus.bad { display: none; }
  /* Sits directly above the camera window it switches. A native <select> can't
     be told to open upward, and macOS ignores option styling, so this is a real
     listbox: the panel is anchored to the bottom of the trigger and grows up. */
  #camsel {
    position: fixed; bottom: 214px; right: 16px; z-index: 20;
    width: 260px; font-size: 13px; font-weight: 600;
  }
  #camselbtn {
    font: inherit; font-size: 13px; font-weight: 600; font-family: inherit;
    letter-spacing: 0; color: var(--ink); text-align: left;
    width: 100%; height: auto; padding: 8px 30px 8px 12px;
    border: none; border-radius: 10px; box-shadow: none;
    background: rgba(255,255,255,0.55); backdrop-filter: blur(10px);
    cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: none;
  }
  #camselbtn::before, #camselbtn::after { content: none; }
  #camselbtn:hover, #camselbtn:active { transform: none; box-shadow: none; }
  /* a chunky rounded chevron rather than a hairline triangle — CSS borders
     cannot round their corners, so this is two thick capped strokes */
  #camsel::after {
    content: ''; position: absolute; right: 12px; top: 13px;
    width: 13px; height: 13px; pointer-events: none;
    background: var(--ink);
    -webkit-mask: var(--chev) center / 13px 13px no-repeat;
    mask: var(--chev) center / 13px 13px no-repeat;
    /* points up because the menu opens up; flips over while it is open */
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.5, 1);
  }
  #camsel.open::after { transform: rotate(180deg); }
  #camsellist {
    position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
    list-style: none; margin: 0; padding: 5px;
    background: #fff; color: var(--ink);
    border-radius: 10px; box-shadow: 0 8px 28px rgba(8,43,82,0.22);
    max-height: 210px; overflow-y: auto; display: none;
  }
  #camsel.open #camsellist { display: block; }
  #camsellist li {
    padding: 8px 10px; border-radius: 7px; cursor: pointer;
    color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #camsellist li:hover { background: rgba(8,43,82,0.08); }
  #camsellist li[aria-selected="true"] { background: rgba(8,43,82,0.12); }
  /* no focus ring on either half */
  #camselbtn:focus, #camselbtn:focus-visible,
  #camsellist li:focus, #camsellist li:focus-visible { outline: none; box-shadow: none; }
  #overstats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
  #chasecard { display: none; }
  #chasecard.on { display: block; }
  #chasecard.lead span { color: #1e7e48; }
  #chasewho {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-transform: none !important; letter-spacing: 0 !important;
  }
  /* the moment you go past someone, then it gets out of the way */
  #passed {
    position: fixed; top: 74px; left: 50%; transform: translateX(-50%) translateY(-6px);
    z-index: 6; pointer-events: none; opacity: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 26px; color: var(--ink); text-shadow: 0 2px 0 #fff;
    transition: opacity 0.35s ease, transform 0.35s ease;
  }
  #passed.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .pill .rank { font-size: 16px; font-weight: 700; opacity: 0.55; margin-left: 6px; }
  /* the wipeout screen sits over a busy, only-lightly-blurred scene, so its cards
     need heavier frost than the lobby's to read as a surface */
  #overscreen .pill, #overscreen .board {
    background: rgba(255,255,255,0.72); backdrop-filter: blur(24px) saturate(1.15);
  }

  /* ---- leaderboard ---- */
  .board {
    /* same glass as the two cards above it, and no shadow */
    background: rgba(255,255,255,0.55); backdrop-filter: blur(10px);
    border-radius: 12px; padding: 14px 18px;
    width: 300px; max-width: 100%; text-align: left;
  }
  .board .bhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
  .board h2 {
    font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    opacity: 0.55;
  }
  .board .pager { display: flex; gap: 6px; flex: none; }
  .board .pager.hidden { display: none; }
  .pgb, .pgb:hover, .pgb:active {
    /* a plain round dot — the global game-button shadow reads as a squashed base here */
    box-shadow: none; transform: none;
  }
  .pgb {
    width: 22px; height: 22px; border-radius: 50%; border: none; padding: 0;
    background: var(--ink, #082b52); cursor: pointer; position: relative;
  }
  .pgb::before {
    content: ''; position: absolute; inset: 0; background: #fff;
    -webkit-mask: var(--chev) center / 11px 11px no-repeat;
    mask: var(--chev) center / 11px 11px no-repeat;
  }
  .pgb.prev::before { transform: rotate(-90deg); }
  .pgb.next::before { transform: rotate(90deg); }
  .pgb:disabled { opacity: 0.22; cursor: default; }
  /* "you" pinned below the page whenever your row isn't on it — the bar
     bleeds into the card padding so its columns still align with the list */
  .board li.pin { background: #d9eafc; border-radius: 9px; padding: 5px 9px; margin: 5px -9px 0; }
  .board ol { list-style: none; display: flex; flex-direction: column; gap: 5px; }
  .board li {
    display: flex; align-items: baseline; gap: 8px;
    font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  }
  .board li .r { width: 22px; opacity: 0.45; font-size: 13px; }
  .board li .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .board li .ago { font-size: 11px; font-weight: 600; opacity: 0.38; white-space: nowrap; flex: none; }
  .board li .sc { flex: none; min-width: 42px; text-align: right; }
  .board li.me { color: #1565c0; }
  .board .empty { font-size: 14px; opacity: 0.55; font-weight: 500; }

  /* name entry on the wipeout screen */
  #namerow { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
  /* BEGIN sits on the same line as the name field, so it matches its height */
  /* the display face on the two calls to action, matched to the placing line */
  #startbtn, #againbtn {
    font-family: 'Poppins', sans-serif;
    font-weight: 400; letter-spacing: 0.02em;
  }
  #startbtn { height: 43px; padding: 0 30px; font-size: 21px; } /* 43 + 5px shadow = the field's 48 */
  #againbtn { font-size: 24px; padding: 12px 40px; }
  #nameinput {
    font: inherit; font-weight: 700; font-size: 17px; color: var(--ink); text-align: center;
    box-sizing: border-box; height: 48px; padding: 0 16px; width: 190px; border-radius: 10px;
    /* glass, like the cards around it */
    border: 2px solid rgba(8,43,82,0.18); background: rgba(255,255,255,0.55);
    backdrop-filter: blur(10px);
  }
  #nameinput::placeholder { color: rgba(8,43,82,0.4); font-weight: 600; }
  #nameinput:focus { outline: none; border-color: var(--ink); }
  #savebtn { font-size: 16px; padding: 11px 24px; box-shadow: 0 4px 0 #041a33; }
  #savenote {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(40px, 8vw, 72px); font-weight: 400;
    /* the page's 1.5 line-height puts ~35px of dead box around a 72px display
       face; at this size the glyphs should set their own spacing */
    line-height: 1.06;
    letter-spacing: 0; text-shadow: 0 2px 0 #fff; min-height: 0;
  }
  /* an empty line still costs its height and a flex gap, so take it out of flow */
  #savenote:empty { display: none; }
  /* an error is not a placing, so it drops back to the body face */
  #savenote.bad {
    font-family: inherit;
    font-size: 15px; font-weight: 600; color: #c2374a;
    letter-spacing: 0; text-shadow: none;
  }
  /* Kept last: these override base rules of equal specificity, and a media
     query gives no extra weight — placed earlier it simply lost. */
  @media (max-width: 700px) {
    #cornerlogo { width: 74px; top: 12px; left: 12px; }
    /* three 118px cards plus their gaps need 378px, so on a 375px screen they
       ran off both edges — let them share the width inside a real margin */
    #hud {
      top: 68px; left: 12px; right: 12px; transform: none;
      justify-content: center; gap: 8px;
    }
    #hud .pill { flex: 1 1 0; width: auto; min-width: 0; padding: 6px 8px; font-size: 16px; }
    /* four cards in a wrapping flex row left "Slopes" stranded on its own line —
       a two-column grid pairs them off instead. An odd last card spans the row
       so it reads as deliberate rather than orphaned. */
    #overstats {
      display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
      width: 100%; max-width: 320px; margin: 0 auto;
    }
    #overstats .pill { width: auto; min-width: 0; padding: 6px 12px; font-size: 16px; }
    #overstats .pill:last-child:nth-child(odd) { grid-column: 1 / -1; }
    /* The 45vw right gutter keeps the desktop copy clear of the rider, but on a
       phone it left the column 180px wide — wide enough for the name field,
       which is sized in px, and not for the board, which is capped at 100% of
       it, so handles truncated to "r…" beside a full-width input. */
    #startscreen { padding-right: 7vw; --col: 100%; }
    #startscreen .board, #startscreen #namerow { max-width: 100%; }
    /* lobby: the rider was hiding behind the copy and the BEGIN button — the
       logo pins to the top left and everything below it drops to the lower
       half, opening a window onto the character; the content scrolls under
       the fixed logo */
    #startscreen { justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    #startscreen > * { flex: none; }
    #herologo { position: fixed; top: 16px; left: 6vw; width: min(190px, 42vw); margin: 0; z-index: 2; }
    #startscreen .hint { margin-top: calc(30vh + 110px); }
    /* the camera panel is wider than a phone's margins allow */
    #camwrap { width: min(200px, 46vw); right: 10px; bottom: 10px; }
    #camsel { width: min(200px, 46vw); right: 10px; bottom: calc(min(200px, 46vw) * 0.75 + 16px); }
    /* wipeout screen: RIDE AGAIN sits above the board, full width, so the
       floating camera panel in the corner never covers it — and the stats
       grid, button, and board all share one width */
    #overscreen #overboard { order: 1; }
    #overscreen #overstats, #overscreen #againbtn, #overscreen .board { width: 100%; max-width: 340px; }
    /* the wipeout stack is taller than a phone — a centered flex column both
       clips the headline off the top and squashes the button. Nothing may
       shrink, and the screen scrolls from the top instead of centering. */
    #overscreen > * { flex: none; }
    #overscreen {
      justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch;
      padding-top: 72px; padding-bottom: 28px;
    }
  }


/* Hand tracking is the main interaction. Camera controls remain outside the video. */
#camwrap {width:320px;background:#12212f;box-shadow:0 8px 32px #082b5217}
#camcanvas {aspect-ratio:4/3;width:100%;height:auto}
.camera-controls {display:flex;gap:8px;padding:10px 12px 0;flex-wrap:wrap}
.camera-controls button,.camera-controls select {font:inherit;font-size:12px;letter-spacing:0;color:#fff;background:#ffffff17;border:1px solid #ffffff33;border-radius:7px;box-shadow:none;min-height:32px;padding:6px 12px;cursor:pointer}
.camera-controls button::before,.camera-controls button::after {content:none}
.camera-controls button:hover {transform:none;box-shadow:none;background:#ffffff2d}
.camera-controls select {width:100%;text-overflow:ellipsis}
.camera-controls select option {background:#12212f}
.motion-feedback {padding:10px 14px 13px}
#motionStatus {font:12px/1.45 'Poppins',sans-serif;color:#fff;min-height:35px;margin-bottom:8px}
#steeringMeter {display:block;width:100%;height:10px;accent-color:#7cffe0}
#startscreen #namerow {flex-wrap:wrap}
#startscreen #startbtn {width:100%;min-width:0;font-size:19px;height:46px}
#startscreen #nameinput {flex-basis:100%;height:42px}
#startbtn:disabled {opacity:.65;cursor:wait}
#keyboardBtn {font:inherit;font-size:12px;letter-spacing:0;background:transparent;color:var(--ink);box-shadow:none;padding:0;height:auto;min-height:28px;text-decoration:underline;text-underline-offset:3px;opacity:.65}
#keyboardBtn::before,#keyboardBtn::after {content:none}
#keyboardBtn:hover {opacity:1;transform:none;box-shadow:none}
#motionPause {position:fixed;top:95px;left:50%;transform:translateX(-50%);z-index:31;background:#12212fe6;color:#fff;border-radius:12px;padding:12px 18px;max-width:85vw;text-align:center;font-size:14px}
[hidden] {display:none!important}
button:focus-visible,input:focus-visible,select:focus-visible,[role=button]:focus-visible {outline:3px solid #447dea;outline-offset:4px}
@media (min-width:701px) {#startscreen {justify-content:flex-start;padding-top:max(24px,calc((100vh - 710px)/2));overflow-y:auto}}
@media (max-width:700px) {
 #camwrap {width:min(220px,53vw);right:10px;bottom:10px}
 #camcanvas {aspect-ratio:4/3}
 .camera-controls {gap:5px;padding:7px 9px 0}
 .camera-controls button {font-size:10px;padding:5px 7px;min-height:28px}
 .motion-feedback {padding:7px 9px 9px}
 #motionStatus {font-size:11px;min-height:30px}
 #startscreen {padding-bottom:300px}
 #motionPause {top:130px}
}

/* Halloween night: keep the UI legible over both the sky and moonlit snow. */
:root { --ink: #f8eddf; color-scheme: dark; }
html, body { background: #080b21; }
#herologo, #cornerlogo { filter: none; }
#startscreen { background: linear-gradient(90deg, #090a21df 0%, #090a21b0 27%, #090a2125 53%, transparent 70%); gap: 15px; }
#startscreen .hint { font-size: 16px; line-height: 1.55; opacity: 1; color: #e1def1; }
.edition-label { display: flex; align-items: center; gap: 16px; color: #ffb568; font-size: 11px; letter-spacing: 0.2em; font-weight: 700; }
.edition-label span { color: #c2b0ee; font-size: 18px; }
#credit { opacity: 0.9; color: #f8eddf; text-shadow: 0 1px 5px #080b21; }
.pill, .board, #overscreen .pill, #overscreen .board { background: #17152cce; border: 1px solid #c7bbef35; backdrop-filter: blur(14px); color: #faf0e4; }
.pill small, .board h2, .board .empty { opacity: 0.8; }
.board li .r { opacity: 0.75; }
.board li .ago { opacity: 0.65; }
.board li.me { color: #ffba78; }
.board li.pin { background: #5a3159; }
#nameinput { color: #fff2df; background: #161529db; border-color: #c7bbef55; }
#nameinput::placeholder { color: #c6bbce; }
#nameinput:focus { border-color: #ffad66; }
#startbtn, #againbtn { background: #f38636; color: #1d1228; box-shadow: 0 5px 0 #8c3c18; }
#startbtn:hover, #againbtn:hover { box-shadow: 0 6px 0 #8c3c18; }
#startbtn::before, #againbtn::before { background-image: linear-gradient(145deg, #ffc47c, #f39745 50%, #e66a2b); }
#startbtn::after, #againbtn::after { background-image: radial-gradient(circle, #ffe9ac88, #ffc36600 70%), radial-gradient(circle, #ffb36a88, #ff943800 74%); }
#keyboardBtn { color: #e6dfef; opacity: 0.9; }
#muteBtn, #muteBtn:hover { background: #17152cdd; border: 1px solid #c7bbef35; }
#camwrap { background: #151327; border: 1px solid #a48abc55; box-shadow: 0 8px 32px #04041055; }
#steeringMeter { accent-color: #ffad66; }
#motionPause { background: #24182cef; border: 1px solid #ffa25999; color: #fff0df; }
#overscreen { background: #080b2177; }
#savenote, #passed { text-shadow: 0 2px 12px #080b21; color: #ffe1ab; }
#chasecard.lead span { color: #b5f3d6; }
button:focus-visible,input:focus-visible,select:focus-visible,[role=button]:focus-visible { outline-color: #ffc17e; }
@media (max-width:700px) {
  #startscreen { background: linear-gradient(0deg, #090a21f2 0%, #090a21d9 45%, #090a2115 78%); }
  .edition-label { margin-top: calc(30vh + 90px); }
  #startscreen .hint { margin-top: 0; }
}

/* Minimal home. Setup and the game rules appear only after choosing to play. */
button, input, select, meter { font-family: 'Poppins', sans-serif; }
#startscreen { justify-content: center; padding-top: 24px; padding-bottom: 24px; cursor: default; }
#startscreen #namerow { width: min(340px, 100%); gap: 12px; }
#startscreen #nameinput { font-size: 16px; font-weight: 500; height: 50px; }
#startscreen #startbtn { font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600; letter-spacing: 0; height: 50px; padding: 0 20px; }
body[data-screen="menu"]:not([data-setup]) #tabs { display: none; }
#menuBtn { position: fixed; top: 17px; left: 18px; z-index: 30; padding: 10px 16px; font-size: 13px; letter-spacing: 0; color: #f8eddf; background: #17152cdd; border: 1px solid #c7bbef35; box-shadow: none; }
#menuBtn:hover { transform: none; box-shadow: none; background: #29213f; }
.unit { font-size: 12px; opacity: 0.8; font-weight: 500; }
#runObjective { position: fixed; top: 90px; left: 50%; transform: translateX(-50%); z-index: 5; max-width: calc(100vw - 32px); width: max-content; text-align: center; color: #f8eddf; background: #17152cba; border: 1px solid #c7bbef2b; border-radius: 12px; padding: 9px 17px; pointer-events: none; backdrop-filter: blur(8px); }
#runObjective strong { display: block; font-size: 13px; font-weight: 600; }
#runObjective span { display: block; font-size: 10px; line-height: 1.6; color: #d9cde6; }
#motionPause { top: 156px; }
#passed { top: 160px; font-family: 'Poppins', sans-serif; font-size: 18px; }
.camera-help { padding: 10px 14px 0; color: #e5deef; font-size: 11px; line-height: 1.55; }
#keyboardBtn { color: #f8eddf; opacity: 1; font-size: 11px; padding: 6px 10px; border: 1px solid #ffffff33; min-height: 32px; height: auto; text-decoration: none; }
#savenote { font-family: 'Poppins', sans-serif; font-size: clamp(28px, 5vw, 46px); font-weight: 600; }
#againbtn { font-family: 'Poppins', sans-serif; font-size: 16px; letter-spacing: 0; font-weight: 600; }
#overscreen .result-rule { font-size: 12px; line-height: 1.6; color: #eee4f3; max-width: 440px; opacity: 1; }
.pill small { font-size: 10px; }
@media (max-width:700px) {
  #startscreen { justify-content: flex-end; align-items: center; padding: 24px 24px max(56px, 10vh); }
  body[data-setup] #startscreen { justify-content: flex-start; padding-top: 60px; }
  #startscreen #namerow { width: 100%; max-width: 340px; }
  #hud { top: 65px; gap: 5px; }
  #hud .pill { padding: 7px 4px; font-size: 15px; }
  #hud .pill small { font-size: 8px; letter-spacing: 0.03em; }
  #hud .unit { font-size: 9px; }
  #chasecard.on { display: none; }
  #runObjective { top: 125px; width: calc(100vw - 24px); padding: 8px 10px; }
  #runObjective strong { font-size: 11px; }
  #runObjective span { font-size: 9px; }
  #motionPause { top: 185px; }
  #passed { top: 188px; font-size: 15px; }
  .camera-help { padding: 8px 9px 0; font-size: 9px; }
  #overstats .pill:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Race launch: the track remains visible while the numbers carry the beat. */
#launchOverlay { position: fixed; inset: 0; z-index: 15; pointer-events: none; display: grid; place-items: center; color: #fff0cf; }
#launchOverlay::before, #launchOverlay::after { content: ''; position: absolute; left: 0; right: 0; height: min(9vh, 76px); background: #080b21e8; transition: height .35s ease, opacity .25s ease; }
#launchOverlay::before { top: 0; }
#launchOverlay::after { bottom: 0; }
#launchOverlay[data-phase="countdown"]::before, #launchOverlay[data-phase="countdown"]::after,
#launchOverlay[data-phase="go"]::before, #launchOverlay[data-phase="go"]::after { height: 0; opacity: 0; }
.launch-copy { text-align: center; max-width: calc(100vw - 32px); padding: 12px 20px; filter: drop-shadow(0 6px 18px #080b2166); }
#launchLabel { font-size: 12px; font-weight: 700; letter-spacing: .25em; text-shadow: 0 2px 8px #080b21; min-height: 20px; }
#launchCount { font-family: 'SlopeDisplay', 'Poppins', sans-serif; font-weight: 400; font-size: clamp(120px, 28vmin, 240px); line-height: 1.15; color: #ffbe64; transform: rotate(-5deg); -webkit-text-stroke: 3px #fff0ce; paint-order: stroke fill; text-shadow: 0 7px 0 #703a2e, 0 10px 0 #251d30, 4px 1px 0 #251d30, -4px -1px 0 #251d30; }
#launchCaption { margin-top: 16px; font-size: 12px; font-weight: 600; color: #fff4e4; text-shadow: 0 1px 5px #080b21, 0 2px 12px #080b21; }
#launchOverlay[data-phase="intro"] .launch-copy { position: absolute; bottom: 13vh; }
#launchOverlay[data-phase="intro"] #launchCount { font-size: clamp(30px, 7vmin, 55px); -webkit-text-stroke: 1px #fff0ce; text-shadow: 0 4px 0 #703a2e, 0 6px 0 #251d30; }
#launchOverlay[data-phase="go"] #launchCount { color: #baf2cf; font-size: clamp(80px, 20vmin, 160px); }
#launchOverlay[data-paused="true"] { background: #080b2140; }
#launchOverlay[data-paused="true"] .launch-copy { position: static; }
#launchOverlay[data-paused="true"] #launchCount { font-size: clamp(34px, 9vmin, 72px); }
body[data-screen="launch"] #camwrap { opacity: .9; }

/* Speed stays at the edges; the rider and the approaching line remain clear. */
#speedFx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 4; pointer-events: none; }
#boostNotice { position: fixed; top: 162px; left: 50%; transform: translateX(-50%) rotate(-3deg); z-index: 7; width: 218px; padding: 9px 15px 10px; pointer-events: none; color: #fff1cf; background: #281e36ed; border: 2px solid #ffb463; border-radius: 9px 19px 9px 19px; box-shadow: 0 4px 0 #080b2177, 0 0 25px #ff9f3620; text-align: center; }
#boostNotice strong { display: block; font-family: 'SlopeDisplay', 'Poppins', sans-serif; font-weight: 400; font-size: 28px; line-height: 1.2; text-shadow: 0 3px 0 #843f30; }
#boostNotice strong span { color: #baf2cf; }
#boostNotice small { display: block; font-size: 8px; font-weight: 700; letter-spacing: .13em; color: #ffd5a0; margin: 4px 0 7px; }
.boost-track { height: 4px; border-radius: 5px; background: #fff1cf22; overflow: hidden; }
#boostMeter { display: block; height: 100%; background: linear-gradient(90deg, #ff9c4c, #ffedb2); transform-origin: left; }
body:has(#boostNotice:not([hidden])) #passed { top: 254px; }
@media (max-width: 700px) {
  #boostNotice { top: 188px; width: 194px; padding: 7px 12px; }
  #boostNotice strong { font-size: 25px; }
  body:has(#boostNotice:not([hidden])) #passed { top: 273px; }
}
@media (max-width:700px) {
  #launchOverlay[data-phase="intro"] .launch-copy { top: 20vh; bottom: auto; }
  #launchCaption { font-size: 10px; }
  #launchLabel { font-size: 10px; }
  .launch-copy { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #launchOverlay::before, #launchOverlay::after { transition: none; }
  #launchCount { transform: none; }
}

/* Arcade scoreboards: warm paper, pumpkin orange and forest-green accents. */
:root { --arcade-cream: #fff0cf; --arcade-orange: #ffb363; --arcade-mint: #baf2cf; --arcade-night: #19172a; }
#hud { top: 18px; gap: 9px; align-items: center; filter: drop-shadow(0 5px 0 #09091d75); }
#hud .pill { position: relative; flex: none; width: 116px; min-height: 70px; padding: 9px 12px 7px; border: 2px solid #655a78; border-radius: 8px 17px 8px 17px; background: #19172aee; backdrop-filter: none; color: var(--arcade-cream); line-height: 1; white-space: nowrap; }
#hud .pill small { font-size: 9px; font-weight: 700; letter-spacing: .11em; opacity: 1; color: #d9cee3; margin-bottom: 6px; }
#hud .hud-number { display: inline-block; font-family: 'SlopeDisplay', 'Poppins', sans-serif; font-size: 32px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
#hud .unit { font-family: 'Poppins', sans-serif; font-size: 10px; color: #d9cee3; opacity: 1; }
#hud .hud-score { width: 154px; min-height: 82px; padding: 10px 16px 9px; transform: rotate(-3deg); background: #ffb363; border-color: #ffe2ab; color: #2d2031; box-shadow: inset 0 -5px 0 #dd7c35; }
#hud .hud-score small { color: #523040; font-size: 10px; margin-bottom: 4px; }
#hud #score { font-size: 44px; text-shadow: 0 2px 0 #ffdb91; }
#hud .hud-score.long-score #score { font-size: 30px; }
#hud #distance.long-distance { font-size: 24px; }
#hud .hud-speed { padding-right: 19px; border-color: #5e806d; transition: border-color .2s ease, background-color .2s ease; }
#hud .hud-speed.boosting { border-color: var(--arcade-orange); background: #423035; }
#hud .hud-speed.boosting .hud-number { color: #ffe3a5; }
.speed-chevron { position: absolute; right: 5px; top: 29px; font-family: 'SlopeDisplay', sans-serif; font-size: 24px; font-style: normal; color: var(--arcade-mint); opacity: 0; transition: opacity .2s ease; }
.boosting .speed-chevron { opacity: 1; }
#hud #chasecard { width: 106px; border-color: #6e6a4f; min-height: 64px; background: #23222aee; }
#hud #chasecard small { font-size: 8px; color: #e0d8ba; }
#hud #chasecard .hud-number { font-size: 27px; color: #ffdda0; }
#hud #chasecard.lead .hud-number { color: var(--arcade-mint); }
#scoreBonus { position: absolute; left: calc(100% - 10px); top: -6px; transform: translateX(-50%) rotate(-7deg); z-index: 1; font: 400 30px/1 'SlopeDisplay', sans-serif; color: var(--arcade-mint); text-shadow: 0 3px 0 #1d4537, 2px 0 0 #19172a, -2px 0 0 #19172a; }
#runObjective { top: 111px; padding: 7px 14px; border: 0; border-radius: 7px; background: #100f23a8; backdrop-filter: none; }
#runObjective strong { font-size: 11px; }
#runObjective span { font-size: 9px; color: #e0d6e5; }
#boostNotice { top: 173px; }
#passed { top: 173px; max-width: calc(100vw - 28px); padding: 12px 22px; width: max-content; border: 2px solid #baf2cf; border-radius: 8px 18px 8px 18px; background: #1a3029f2; color: var(--arcade-mint); box-shadow: 0 5px 0 #0b151b; transform: translateX(-50%) translateY(9px) rotate(-3deg); text-shadow: none; transition: opacity .2s ease, transform .25s ease; }
#passed.show { transform: translateX(-50%) translateY(0) rotate(-3deg); }
#passed strong { display: block; font: 400 clamp(23px, 4vw, 32px)/1.2 'SlopeDisplay', sans-serif; }
#passed span { display: block; margin-top: 3px; font-size: 10px; font-weight: 600; color: #e0f3df; overflow-wrap: anywhere; }
body:has(#boostNotice:not([hidden])) #passed { top: 267px; }
#motionPause { top: 173px; }
#startscreen #startbtn { font-family: 'SlopeDisplay', 'Poppins', sans-serif; font-size: 23px; font-weight: 400; border: 2px solid #ffd694; border-radius: 8px 16px 8px 16px; }
#menuBtn { border-radius: 7px 12px 7px 12px; border-color: #8e80944d; }

/* The finish card puts the score first and keeps the ranking in its own column. */
#overscreen { padding: 76px 24px 30px; overflow-y: auto; justify-content: flex-start; background: #070919b5; backdrop-filter: blur(7px); }
.results-panel { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 30px; width: min(790px, 100%); margin: auto; padding: 28px; text-align: left; color: var(--arcade-cream); background: #19172af5; border: 2px solid #6b596f; border-radius: 14px 32px 14px 32px; box-shadow: 0 9px 0 #080b1b88, 0 24px 70px #05061499; isolation: isolate; }
.results-panel::before { content: ''; position: absolute; width: 70px; height: 8px; top: -5px; left: 28px; background: repeating-conic-gradient(#ffcf89 0 25%, #382b3d 0 50%) 0 0 / 16px 16px; transform: rotate(-3deg); }
.result-summary { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
#overscreen .result-eyebrow { font-size: 9px; font-weight: 700; line-height: 1.4; letter-spacing: .2em; opacity: 1; color: #d9bf9d; }
#overscreen h1 { font: 400 clamp(28px, 3vw, 38px)/1.2 'SlopeDisplay', sans-serif; color: var(--arcade-cream); text-shadow: 0 3px 0 #694034; margin: 8px 0 14px; letter-spacing: 0; }
.result-total { width: 100%; position: relative; display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
#resultScore { display: inline-block; font: 400 clamp(58px, 6.5vw, 82px)/1 'SlopeDisplay', sans-serif; color: var(--arcade-orange); -webkit-text-stroke: 1px #ffdd99; paint-order: stroke fill; text-shadow: 0 5px 0 #783c2e; }
#resultScore.long-score { font-size: 52px; }
.result-total > span { font: 400 17px/1 'SlopeDisplay', sans-serif; color: #d5b8a3; }
#overscreen #recordStamp { font: 400 18px/1.15 'SlopeDisplay', sans-serif; margin: 0 0 15px; padding: 6px 10px; background: var(--arcade-mint); color: #234a36; border-radius: 4px; transform: rotate(-3deg); opacity: 1; }
#overstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: none; margin: 0 0 19px; }
#overscreen #overstats .pill { width: auto; min-width: 0; padding: 10px 12px; text-align: left; border: 1px solid #5e5064; border-radius: 6px 12px 6px 12px; background: #252135; backdrop-filter: none; font-weight: 400; }
#overstats .pill small { font-size: 9px; font-weight: 600; line-height: 1.2; letter-spacing: .05em; margin-bottom: 5px; color: #dacddd; opacity: 1; }
#overstats .pill > span { font: 400 25px/1 'SlopeDisplay', sans-serif; }
#overstats .pill .rank { font-family: 'Poppins', sans-serif; font-size: 10px; opacity: 1; margin-left: 5px; color: var(--arcade-mint); }
#overstats .pill:last-child:nth-child(odd) { grid-column: auto; }
#againbtn { display: flex; align-items: center; justify-content: center; gap: 15px; width: 100%; padding: 12px 14px; min-height: 54px; flex: none; font: 400 25px/1.1 'SlopeDisplay', sans-serif; background: #ffad59; border: 2px solid #ffe1a0; border-radius: 8px 17px 8px 17px; color: #2d2031; box-shadow: 0 5px 0 #965031; letter-spacing: 0; }
#againbtn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #965031; }
#againbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #965031; }
.retry-arrow { font-family: 'Poppins', sans-serif; font-size: 28px; line-height: 1; }
#overscreen #resultHandsHint { margin-top: 13px; font-size: 10px; line-height: 1.5; color: var(--arcade-mint); opacity: 1; text-align: center; width: 100%; }
#overscreen .result-rule { margin-top: 14px; font-size: 9px; line-height: 1.5; color: #c8b7cc; opacity: 1; text-align: center; width: 100%; }
.result-ranking { min-width: 0; display: flex; flex-direction: column; border-left: 1px solid #63506c; padding-left: 27px; }
#overscreen #overboard { width: 100%; max-width: none; padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; }
#overboard .bhead { margin-bottom: 18px; }
#overboard h2 { font: 400 24px/1.15 'SlopeDisplay', sans-serif; letter-spacing: 0; text-transform: none; opacity: 1; color: var(--arcade-cream); }
#overscreen .bhead p { margin-top: 4px; font-size: 9px; color: #c4b4cf; opacity: 1; line-height: 1.4; }
#overboard ol { gap: 0; }
#overboard li { gap: 8px; font-size: 11px; padding: 10px 0; border-bottom: 1px solid #68516b50; }
#overboard li .r { flex: none; width: 18px; font: 400 19px/1 'SlopeDisplay', sans-serif; color: #c2b3c9; opacity: 1; }
#overboard li:first-child .r { color: #ffce86; }
#overboard li .sc { font: 400 22px/1 'SlopeDisplay', sans-serif; min-width: 28px; color: #f7e9cf; }
#overboard li .ago { display: none; }
#overboard li.me { color: var(--arcade-mint); }
#overboard li.me .sc, #overboard li.me .r { color: var(--arcade-mint); }
#overboard li.pin { margin: 8px -8px 0; padding: 10px 8px; background: #244432; }
#overboard li.empty { line-height: 1.7; color: #d5c8dd; padding: 14px 0; opacity: 1; }
#overboard .pgb { width: 28px; height: 28px; background: #4a3d52; }
#overscreen #savenote { margin-top: 16px; font: 600 10px/1.6 'Poppins', sans-serif; color: var(--arcade-mint); text-shadow: none; padding: 7px 10px; border: 1px solid #55745d; background: #25392d; border-radius: 5px; max-width: 100%; }
body[data-screen="over"] #camwrap { visibility: hidden; pointer-events: none; }

@media (max-width: 700px) {
  #hud { top: 66px; gap: 6px; left: 12px; right: 12px; width: auto; transform: none; }
  #hud .pill { flex: 1 1 0; width: auto; min-height: 64px; padding: 9px 6px 7px; border-radius: 7px 13px 7px 13px; }
  #hud .pill small { font-size: 8px; letter-spacing: .06em; }
  #hud .hud-number { font-size: clamp(24px, 7vw, 32px); }
  #hud .hud-score { flex: 1.25 1 0; min-height: 74px; padding: 10px 6px; }
  #hud #score { font-size: 37px; }
  #hud .hud-score.long-score #score { font-size: 23px; }
  #hud .unit { font-size: 8px; }
  #hud .hud-speed { padding-right: 12px; }
  .speed-chevron { top: 30px; right: 3px; font-size: 18px; }
  #hud #chasecard.on { display: none; }
  #scoreBonus { font-size: 24px; }
  #runObjective { top: 157px; width: max-content; max-width: calc(100vw - 24px); padding: 6px 10px; }
  #runObjective strong { font-size: 10px; }
  #runObjective span { font-size: 8px; }
  #boostNotice, #passed, #motionPause { top: 210px; }
  body:has(#boostNotice:not([hidden])) #passed { top: 295px; }
  #passed { padding: 10px 15px; }
  #overscreen { padding: 71px 12px 24px; }
  .results-panel { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 22px 20px; border-radius: 12px 25px 12px 25px; width: min(400px, 100%); margin: 0 auto; }
  #overscreen h1 { font-size: 32px; margin: 7px 0 12px; }
  .result-total { margin-bottom: 14px; }
  #resultScore { font-size: 70px; }
  #resultScore.long-score { font-size: 44px; }
  #overstats { gap: 7px; }
  #overscreen #overstats { max-width: none; margin: 0 0 18px; }
  #overstats .pill > span { font-size: 25px; }
  #overscreen #againbtn { max-width: none; font-size: 24px; }
  .result-ranking { padding: 22px 0 0; border-left: 0; border-top: 1px solid #63506c; }
  #overscreen #overboard { order: 0; }
  #overboard li { padding: 11px 0; font-size: 12px; }
}
@media (max-height: 520px) and (min-width: 701px) {
  #overscreen { padding-top: 65px; }
  .results-panel { padding: 20px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  #passed, #hud .hud-speed, .speed-chevron { transition: none; }
  #againbtn, #againbtn:hover, #againbtn:active { transition: none; transform: none; }
}

/* In-run information lives in the scene's margins, without dashboard plates. */
#hud { top: auto; left: max(28px, env(safe-area-inset-left)); right: auto; bottom: max(28px, env(safe-area-inset-bottom)); width: 180px; transform: none; flex-direction: column; align-items: flex-start; gap: 5px; filter: none; text-align: left; }
#hud .pill, #hud .hud-score { width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; box-shadow: none; white-space: nowrap; text-align: left; color: #fff0cf; }
#hud .hud-score { position: relative; min-width: 160px; transform: rotate(-3deg); }
#hud .pill small { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#hud #score { font-size: 58px; color: #fff0cf; -webkit-text-stroke: 1.5px #211c30; paint-order: stroke fill; text-shadow: 0 4px 0 #211c30, 0 2px 13px #080b2166; }
#hud .hud-score.long-score #score { font-size: 39px; }
.score-unit { display: inline-block; margin-left: 6px; font: 700 10px/1 'Poppins', sans-serif; letter-spacing: .08em; color: #fff0cf; text-shadow: 0 2px 3px #080b21; }
#hud .hud-distance { padding-left: 3px; }
#hud .hud-distance .hud-number, #hud #distance.long-distance { font-size: 22px; color: #fff5e4; text-shadow: 0 2px 0 #211c30, 0 1px 8px #080b21; }
#hud .hud-distance .unit { color: #fff5e4; font-size: 11px; text-shadow: 0 1px 4px #080b21; }
#scoreBonus { left: calc(100% - 10px); top: -15px; font-size: 30px; color: #ffe494; text-shadow: 0 3px 0 #75442c, 2px 0 0 #19172a, -2px 0 0 #19172a; }
#boostNotice { top: auto; bottom: max(43px, env(safe-area-inset-bottom)); left: 236px; width: 132px; transform: rotate(-3deg); border: 0; border-radius: 0; background: none; padding: 0; box-shadow: none; text-align: left; }
#boostNotice strong { font-size: 25px; -webkit-text-stroke: 1px #211c30; paint-order: stroke fill; text-shadow: 0 3px 0 #211c30; }
#boostNotice .boost-track { height: 3px; margin-top: 7px; width: 106px; background: #211c3070; }
#passed, body:has(#boostNotice:not([hidden])) #passed { top: 90px; padding: 0; width: max-content; background: none; border: 0; box-shadow: none; color: var(--arcade-mint); text-shadow: 0 3px 0 #17262a, 0 2px 10px #080b21; }
#passed strong { -webkit-text-stroke: 1px #17262a; paint-order: stroke fill; }
#passed span { font-size: 11px; }
#motionPause { top: 85px; }
@media (max-width: 700px) {
  #hud { left: max(16px, env(safe-area-inset-left)); right: auto; bottom: max(24px, env(safe-area-inset-bottom)); top: auto; width: 150px; gap: 4px; }
  #hud .pill, #hud .hud-score { flex: none; width: auto; min-height: 0; padding: 0; }
  #hud .hud-score { min-width: 126px; }
  #hud #score { font-size: 46px; }
  #hud .hud-score.long-score #score { font-size: 30px; }
  #hud .hud-distance { padding-left: 3px; }
  #hud .hud-distance .hud-number, #hud #distance.long-distance { font-size: 19px; }
  .score-unit { margin-left: 4px; font-size: 8px; }
  #scoreBonus { left: calc(100% - 8px); font-size: 26px; top: -14px; }
  #boostNotice { left: max(16px, env(safe-area-inset-left)); bottom: max(126px, env(safe-area-inset-bottom)); width: 120px; }
  #boostNotice strong { font-size: 22px; }
  #boostNotice .boost-track { width: 96px; }
  #passed, body:has(#boostNotice:not([hidden])) #passed { top: 88px; }
}

/* Journey cues are lettering in the scene, leaving the rider's line clear. */
body:not([data-screen="playing"]) #rideStory { display: none; }
#rideStory { pointer-events: none; color: #fff0cf; text-shadow: 0 2px 3px #101326; }
#stageNotice { position: fixed; top: max(82px, calc(env(safe-area-inset-top) + 70px)); left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 36px)); text-align: center; z-index: 8; }
#stageNotice small { display: block; font: 600 9px/1.5 'Poppins', sans-serif; letter-spacing: .24em; color: #dac7e2; }
#stageNotice strong { display: block; margin: 5px 0 6px; font: 400 clamp(27px, 4vw, 37px)/1.1 'SlopeDisplay', sans-serif; -webkit-text-stroke: 1px #211c30; paint-order: stroke fill; text-shadow: 0 3px 0 #211c30; }
#stageNotice span { display: block; font: 500 10px/1.5 'Poppins', sans-serif; color: #f0e5ec; }
body:has(#stageNotice:not([hidden])) #passed { top: 184px; }
#rideMission { position: fixed; left: max(31px, env(safe-area-inset-left)); bottom: max(139px, calc(env(safe-area-inset-bottom) + 118px)); width: 228px; z-index: 8; }
#rideMission > div:first-child { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
#missionTitle { font: 600 10px/1.45 'Poppins', sans-serif; max-width: 174px; color: #f4e8d9; }
#missionCount { font: 600 9px/1 'Poppins', sans-serif; color: #d7c9df; white-space: nowrap; }
.mission-track { width: 100%; height: 2px; margin-top: 7px; background: #fff0cf25; }
#missionMeter { display: block; width: 100%; height: 100%; background: #ffd185; transform: scaleX(0); transform-origin: left; }
#rideMission[data-done="true"] #missionTitle, #rideMission[data-done="true"] #missionCount { color: #ffe095; }
#rideMission[data-done="true"] #missionCount { font-size: 7px; letter-spacing: .04em; }
#comboNotice { position: fixed; left: max(30px, env(safe-area-inset-left)); bottom: max(204px, calc(env(safe-area-inset-bottom) + 183px)); transform: rotate(-3deg); z-index: 9; max-width: min(350px, calc(100vw - 32px)); }
#comboNotice strong { display: block; font: 400 clamp(23px, 3vw, 29px)/1.15 'SlopeDisplay', sans-serif; color: #ffe095; -webkit-text-stroke: 1px #211c30; paint-order: stroke fill; text-shadow: 0 3px 0 #211c30; }
#comboNotice span { display: block; font: 600 9px/1.5 'Poppins', sans-serif; margin-top: 5px; color: #fff2db; }
#overscreen #runHighlights { margin: -5px 0 17px; font-size: 10px; color: #e6c997; line-height: 1.6; }
#runHighlights:empty { display: none; }
@media (max-width: 700px) {
  #stageNotice { top: 80px; }
  #stageNotice span { font-size: 9px; }
  #rideMission { left: max(19px, env(safe-area-inset-left)); bottom: max(187px, calc(env(safe-area-inset-bottom) + 170px)); width: 193px; }
  #missionTitle { font-size: 9px; max-width: 146px; }
  #missionCount { font-size: 8px; }
  #comboNotice { left: max(18px, env(safe-area-inset-left)); bottom: max(247px, calc(env(safe-area-inset-bottom) + 230px)); }
}
@media (max-height: 500px) {
  #stageNotice { top: 65px; }
  #stageNotice strong { font-size: 25px; }
  #rideMission { bottom: 126px; }
  #comboNotice { bottom: 182px; }
}
