  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper-200); color: var(--ink);
    font-family: var(--font-body); font-size: var(--fs-16); line-height: var(--lh-body); user-select: none; }
  h1, h2, h3, p { margin: 0; }
  b, strong { font-weight: 700; }
  canvas#c { position: fixed; inset: 0; display: block; touch-action: none; }
  body.freecam canvas#c { cursor: grab; }
  .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: var(--lh-tight); }
  .mono, .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
  .ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .ic.fill { fill: currentColor; stroke: none; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* ------------------------------------------------------------
     SHARED PAGE CONTAINER (every non-game screen)
     ------------------------------------------------------------ */
  .page { position: fixed; inset: 0; overflow-y: auto; background: var(--paper-200); z-index: 8; scrollbar-width: thin; scrollbar-color: var(--paper-300) transparent; }
  .page.hidden { display: none; }
  .container { max-width: 720px; margin: 0 auto; padding: var(--sp-5) var(--sp-5) var(--sp-8); }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); min-height: var(--touch); }
  .wordmark { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-20); letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
  .pagetitle { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-28); letter-spacing: -0.02em; line-height: var(--lh-tight); }
  .eyebrow { font-size: var(--fs-12); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); }
  .muted { color: var(--ink-2); }
  .small { font-size: var(--fs-14); }
  .lead { color: var(--ink-2); max-width: 65ch; }

  /* ------------------------------------------------------------
     BUTTONS: default / hover / focus-visible / active / disabled / loading
     Hover tint is an opacity-only overlay so only transform + opacity animate.
     ------------------------------------------------------------ */
  button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--touch);
    padding: var(--sp-2) var(--sp-4); font: inherit; font-size: var(--fs-16); font-weight: 700; line-height: var(--lh-tight);
    background: var(--paper-100); color: var(--ink); border: 1px solid var(--paper-300); border-radius: var(--r-md); cursor: pointer;
    transition: transform var(--t-press) var(--ease); -webkit-tap-highlight-color: transparent; }
  button::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; background: var(--ink); opacity: 0; pointer-events: none;
    transition: opacity var(--t-fast) var(--ease); }
  @media (hover: hover) and (pointer: fine) { button:hover:not(:disabled):not([aria-busy="true"])::after { opacity: .07; } }
  button:active:not(:disabled):not([aria-busy="true"]) { transform: scale(.97); }
  button:active:not(:disabled):not([aria-busy="true"])::after { opacity: .12; }
  button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 2px var(--accent); }
  button:disabled { opacity: .5; cursor: not-allowed; }
  button[aria-busy="true"] { cursor: progress; pointer-events: none; }
  button[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent;
    animation: spin 700ms linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--ink); }
  button.primary.big { min-height: 56px; padding: var(--sp-3) var(--sp-5); font-size: var(--fs-20); }
  button.text { background: transparent; border-color: transparent; padding: var(--sp-2) var(--sp-3); }
  button.sm { font-size: var(--fs-14); padding: var(--sp-2) var(--sp-3); }
  a.link, button.link { background: none; border: 0; padding: var(--sp-2) 0; min-height: var(--touch); color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; }
  a.link::after, button.link::after { display: none; }
  .btns { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }

  /* ------------------------------------------------------------
     INPUTS / SELECT: default / hover / focus / active / disabled / loading / invalid
     ------------------------------------------------------------ */
  input.q, select.q { width: 100%; min-height: var(--touch); font: inherit; font-size: var(--fs-16); font-weight: 600; padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm); border: 1px solid var(--ink-3); background: var(--paper-100); color: var(--ink); user-select: text; }
  input.q::placeholder { color: var(--ink-3); font-weight: 400; }
  @media (hover: hover) and (pointer: fine) { input.q:hover:not(:disabled):not(:focus), select.q:hover:not(:disabled):not(:focus) { border-color: var(--ink); } }
  input.q:focus { border-color: var(--ink); }
  input.q:disabled, select.q:disabled { opacity: .5; cursor: not-allowed; }
  input.q[aria-busy="true"] { opacity: .6; cursor: progress; }
  input.q[aria-invalid="true"] { border-color: var(--wrong); }
  select.q { width: auto; padding-right: var(--sp-6); appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 12px) 50%; background-size: 8px 8px; background-repeat: no-repeat; }
  .fielderr { color: var(--wrong); font-size: var(--fs-14); font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); min-height: 20px; }
  .fielderr:empty { display: none; }

  kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 var(--sp-2); margin: 0 2px; border-radius: var(--r-sm);
    background: var(--paper-100); border: 1px solid var(--paper-300); font-family: var(--font-num); font-size: var(--fs-12); font-weight: 700; color: var(--ink); }

  /* panels (HUD, modals, banners, the daily hero) */
  .panel { background: var(--paper-100); border: 1px solid var(--paper-300); border-radius: var(--r-md); box-shadow: var(--elev); color: var(--ink); }
  .chip { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); font-family: var(--font-num); font-weight: 700; font-size: var(--fs-14); font-variant-numeric: tabular-nums;
    background: var(--accent); color: var(--on-accent); }
  .banner { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--paper-100); border: 1px solid var(--wrong); border-radius: var(--r-md); color: var(--ink); margin-bottom: var(--sp-5); }
  .banner .ic { color: var(--wrong); margin-top: 2px; }
  .banner p { flex: 1; font-size: var(--fs-14); }
  .banner button { min-height: 36px; }

  /* ------------------------------------------------------------
     HUD (game screens)
     ------------------------------------------------------------ */
  #hud { position: fixed; top: var(--sp-4); left: var(--sp-4); right: var(--sp-4); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; gap: var(--sp-3); z-index: 6; }
  #left { padding: var(--sp-2) var(--sp-3); display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-14); font-weight: 600; white-space: nowrap; }
  #left .chip { padding: 2px var(--sp-3); }
  #left .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
  #target { position: relative; text-align: center; padding: var(--sp-3) var(--sp-5); max-width: min(60vw, 480px); }
  #target small { display: block; font-size: var(--fs-12); letter-spacing: .08em; font-weight: 700; color: var(--ink-2); text-transform: uppercase; }
  #tname { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-28); line-height: var(--lh-tight); letter-spacing: -0.02em; margin-top: var(--sp-1); }
  #tflag { height: 80px; max-width: 100%; margin: var(--sp-2) auto 0; border-radius: var(--r-sm); display: block; border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); }
  #target.won { border-color: var(--correct); }
  #target.lost { border-color: var(--wrong); }
  #target .verdict { display: none; align-items: center; justify-content: center; gap: var(--sp-2); font-size: var(--fs-14); font-weight: 700; margin-top: var(--sp-1); }
  #target.won .verdict, #target.lost .verdict { display: flex; }
  #target.won .verdict { color: var(--correct); }
  #target.lost .verdict { color: var(--wrong); }
  #clues { display: flex; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-2); }
  .clue { width: 72px; height: 72px; border-radius: var(--r-sm); background: var(--paper-200); border: 1px dashed var(--ink-3); display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .clue > span { font-size: var(--fs-20); font-weight: 700; color: var(--ink-3); }
  .clue .cc { display: none; width: 100%; height: 100%; object-fit: contain; }
  .clue.on { border-style: solid; border-color: var(--ink); background: var(--paper-100); }
  .clue.on > span { display: none; }
  .clue.on .cc { display: block; }
  .clue.new { animation: reveal var(--t-med) var(--ease); }
  @keyframes reveal { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  b.cc#clLetter { font-family: var(--font-display); font-size: var(--fs-48); line-height: 72px; text-align: center; color: var(--ink); }
  #clueNote { font-size: var(--fs-12); color: var(--ink-2); margin-top: var(--sp-2); min-height: 1em; }
  #clueNote:empty { display: none; }
  #time { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); min-width: 112px; justify-content: center; }
  #time b { font-family: var(--font-num); font-size: var(--fs-28); font-variant-numeric: tabular-nums; line-height: 1; display: inline-block; }
  #time small { font-family: var(--font-num); font-size: var(--fs-14); color: var(--ink-2); }
  #time .ic { color: var(--ink-2); width: 16px; height: 16px; }
  #time.crit b, #time.crit small, #time.crit .ic { color: var(--wrong); }
  #time.crit b { animation: tick 1s var(--ease) infinite; }
  @keyframes tick { 0% { transform: scale(1); } 15% { transform: scale(1.08); } 100% { transform: scale(1); } }
  #tbarwrap { display: none; height: 8px; border-radius: var(--r-pill); background: var(--paper-300); margin-top: var(--sp-3); overflow: hidden; }
  body.limited #tbarwrap { display: block; }
  #tbar { height: 100%; width: 100%; background: var(--ink); border-radius: inherit; transform-origin: left center; }
  #hud:has(#time.crit) #tbar { background: var(--wrong); }

  /* round result toast */
  #toast { position: fixed; left: 50%; top: 26%; transform: translate(-50%, var(--sp-2)); opacity: 0; pointer-events: none; text-align: center;
    transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); z-index: 8; width: max-content; max-width: 92vw; }
  body.freecam #toast { top: 30%; }
  #toast.show { opacity: 1; transform: translate(-50%, 0); }
  #toast .box { padding: var(--sp-3) var(--sp-5); }
  #toast .big { display: inline-flex; align-items: center; gap: var(--sp-3); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-28); line-height: var(--lh-tight); letter-spacing: -0.02em; color: var(--correct); }
  #toast.miss .big { color: var(--wrong); }
  #toast .big .ic { width: 24px; height: 24px; stroke-width: 3; }
  #toast .pts { font-family: var(--font-num); font-weight: 700; font-size: var(--fs-20); margin-top: var(--sp-1); }
  #toast .pts:empty { display: none; }
  #toast .pts b { display: inline-block; background: var(--accent); color: var(--on-accent); padding: 0 var(--sp-3); border-radius: var(--r-pill); }
  #toast .sub { margin-top: var(--sp-2); font-size: var(--fs-14); color: var(--ink-2); max-width: 52ch; }
  .misslist { margin-top: var(--sp-3); max-height: 120px; overflow-y: auto; font-size: var(--fs-14); color: var(--ink-2); }
  #clickChip { position: fixed; z-index: 8; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; opacity: 0; transition: opacity var(--t-fast) var(--ease); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-14); font-weight: 700; white-space: nowrap; border-color: var(--wrong); }
  #clickChip.show { opacity: 1; }
  #clickChip .ic { color: var(--wrong); width: 16px; height: 16px; stroke-width: 3; vertical-align: -3px; margin-right: var(--sp-2); }
  #clickChip small { font-weight: 400; color: var(--ink-2); margin-left: var(--sp-2); }

  #coach { position: fixed; left: 50%; top: 144px; transform: translateX(-50%); z-index: 5; padding: var(--sp-2) var(--sp-4); font-size: var(--fs-14); font-weight: 600; text-align: center; max-width: min(92vw, 480px);
    opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease); }
  #coach.show { opacity: 1; }
  body.hasclues #coach { top: 240px; }
  #help { position: fixed; left: var(--sp-4); bottom: var(--sp-4); font-size: var(--fs-12); color: var(--ink-2); padding: var(--sp-2) var(--sp-3); line-height: 2; z-index: 5; max-width: calc(100vw - 280px);
    opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease); }
  #help.show { opacity: 1; }
  #mini { position: fixed; right: var(--sp-4); bottom: var(--sp-4); width: 224px; height: 112px; border-radius: var(--r-sm); border: 1px solid var(--ink); background: var(--ocean); z-index: 3; }
  #miniToggle { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 4; min-height: 36px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-12); display: none; }
  body.mini-collapsed #mini { display: none; }
  body.mini-toggle #miniToggle { display: inline-flex; }
  body.mini-toggle:not(.mini-collapsed) #miniToggle { bottom: calc(var(--sp-4) + 112px + var(--sp-2)); }
  #touchbar { position: fixed; right: var(--sp-4); bottom: calc(var(--sp-4) + 76px); z-index: 5; display: none; flex-direction: column; gap: var(--sp-2); }
  #touchbar button { min-width: 64px; min-height: 48px; }
  @media (pointer: coarse) { body.flying #touchbar { display: flex; } }

  /* ------------------------------------------------------------
     HOME
     ------------------------------------------------------------ */
  #menu { position: fixed; inset: 0; overflow-y: auto; z-index: 7; scrollbar-width: thin; scrollbar-color: var(--paper-300) transparent; }
  #menu.hidden { display: none; }
  .scene { height: 44vh; min-height: 260px; position: relative; display: flex; align-items: flex-start; }
  .scene .wordmark { margin: var(--sp-5); padding: var(--sp-2) var(--sp-4); background: var(--paper-100); border: 1px solid var(--paper-300); border-radius: var(--r-md); box-shadow: var(--elev); }
  .sheet { background: var(--paper-200); border-top: 1px solid var(--ink); min-height: 56vh; }
  .hero { padding-bottom: var(--sp-6); }
  .hero h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-48); letter-spacing: -0.03em; line-height: var(--lh-tight); max-width: 14ch; }
  .hero .lead { margin-top: var(--sp-3); }
  .herorow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-5); margin-top: var(--sp-5); }
  .stat { display: flex; align-items: center; gap: var(--sp-2); }
  .stat .ic { color: var(--ink); width: 24px; height: 24px; }
  .stat b { font-family: var(--font-num); font-size: var(--fs-28); line-height: 1; font-variant-numeric: tabular-nums; }
  .stat small { display: block; font-size: var(--fs-12); color: var(--ink-2); line-height: 1.2; }
  .stat .col { display: flex; flex-direction: column; }
  .stat.risk b { color: var(--wrong); }
  .practice h2 { font-family: var(--font-display); font-size: var(--fs-28); letter-spacing: -0.02em; line-height: var(--lh-tight); margin-bottom: var(--sp-2); }
  .grouphead { display: grid; grid-template-columns: 48px 1fr auto 64px; gap: var(--sp-4); align-items: end; padding: 0 var(--sp-2); margin: var(--sp-5) 0 var(--sp-1); }
  .grouphead .eyebrow { grid-column: 1 / 3; }
  .colhead { grid-column: 3; min-width: 56px; text-align: right; font-size: var(--fs-12); letter-spacing: .04em; color: var(--ink-2); }
  ul.modelist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--paper-300); }
  ul.modelist li { border-bottom: 1px solid var(--paper-300); }
  button.moderow { display: grid; grid-template-columns: 48px 1fr auto 64px; align-items: center; gap: var(--sp-4); width: 100%; text-align: left; padding: var(--sp-3) var(--sp-2);
    min-height: 72px; background: transparent; border: 0; border-radius: var(--r-sm); font-weight: 400; }
  button.moderow::after { inset: 0; }
  .modeglyph { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--paper-100); border: 1px solid var(--paper-300); display: flex; align-items: center; justify-content: center; }
  .modeglyph svg { width: 32px; height: 32px; }
  .modeglyph .g-ink { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .modeglyph .g-land { fill: var(--land); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
  .modeglyph .g-wrong { fill: var(--wrong-fill); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
  .modeglyph .g-correct { fill: var(--correct-fill); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
  .modeglyph .g-accent { fill: var(--accent); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
  .modeglyph .g-ocean { fill: var(--ocean); }
  .mtext .mt { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-20); font-weight: 700; line-height: var(--lh-tight); }
  .mtext .md { display: block; font-size: var(--fs-14); color: var(--ink-2); margin-top: var(--sp-1); max-width: 56ch; }
  .tag-default { font-size: var(--fs-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--paper-100); border: 1px solid var(--ink-3); border-radius: var(--r-sm); padding: 0 var(--sp-2); }
  .best { font-family: var(--font-num); font-size: var(--fs-14); font-weight: 700; color: var(--ink); text-align: right; min-width: 56px; }
  .best.none { font-family: var(--font-body); font-weight: 400; color: var(--ink-3); }
  .playcue { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); font-size: var(--fs-14); font-weight: 700; color: var(--ink); }
  @media (hover: hover) and (pointer: fine) { button.moderow:hover:not(:disabled)::after { opacity: .05; } }
  body.maploading #menu .best, body.maploading #menu .modeglyph svg { visibility: hidden; }
  body.maploading #menu .modeglyph, body.maploading #menu .best { background: var(--paper-300); border-color: var(--paper-300); border-radius: var(--r-sm); min-height: 16px; }
  body.maploading #menu button.moderow { cursor: progress; }
  .mapstatus { margin-top: var(--sp-3); font-size: var(--fs-14); color: var(--ink-2); }
  .mapstatus:empty { display: none; }
  #menu .rise { animation: rise var(--t-med) var(--ease) both; }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
  .sheet .keys { margin-top: var(--sp-6); font-size: var(--fs-14); color: var(--ink-2); line-height: 2.2; }

  /* ------------------------------------------------------------
     DAILY
     ------------------------------------------------------------ */
  .dailyhero { padding: var(--sp-5); }
  .dailyhero .streakline { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
  .bigstreak { display: flex; align-items: center; gap: var(--sp-2); }
  .bigstreak .ic { width: 32px; height: 32px; }
  .bigstreak b { font-family: var(--font-num); font-size: var(--fs-48); line-height: 1; }
  .bigstreak small { font-size: var(--fs-14); color: var(--ink-2); display: block; line-height: 1.2; }
  .weekstrip { display: flex; gap: var(--sp-2); margin-left: auto; }
  .weekstrip .day { width: 32px; text-align: center; font-size: var(--fs-12); font-weight: 700; color: var(--ink-2); }
  .weekstrip .day i { display: block; width: 32px; height: 32px; margin-top: var(--sp-1); border-radius: var(--r-pill); border: 1px solid var(--ink-3); background: var(--paper-100); }
  .weekstrip .day.on i { background: var(--accent); border-color: var(--ink); }
  .weekstrip .day.today { color: var(--ink); }
  .weekstrip .day.today i { border-width: 2px; border-color: var(--ink); }
  .countdown { margin-top: var(--sp-5); display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
  .countdown b { font-family: var(--font-num); font-size: var(--fs-48); line-height: 1; font-variant-numeric: tabular-nums; }
  .countdown span { color: var(--ink-2); font-size: var(--fs-14); }
  .dailyhero .btns { margin-top: var(--sp-5); }
  ul.lineup, ul.runlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--paper-300); }
  ul.lineup li, ul.runlist li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--paper-300); min-height: 56px; }
  ul.lineup .n { font-family: var(--font-num); font-weight: 700; width: 24px; color: var(--ink-2); }
  ul.lineup .nm { flex: 1; font-weight: 700; }
  ul.lineup .ds { color: var(--ink-2); font-size: var(--fs-14); }
  ul.runlist .ic.ok { color: var(--correct); stroke-width: 3; }
  ul.runlist .ic.no { color: var(--wrong); stroke-width: 3; }
  ul.runlist .nm { flex: 1; font-weight: 600; min-width: 0; }
  ul.runlist .nm small { display: block; font-weight: 400; font-size: var(--fs-14); color: var(--ink-2); }
  ul.runlist .tm { font-family: var(--font-num); font-size: var(--fs-14); color: var(--ink-2); }
  ul.runlist .pt { font-family: var(--font-num); font-weight: 700; min-width: 64px; text-align: right; }
  .sectionhead { margin: var(--sp-6) 0 var(--sp-2); }
  .bigscore { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-48); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .caughtup { display: flex; align-items: center; gap: var(--sp-2); color: var(--correct); font-weight: 700; margin-top: var(--sp-3); }

  /* ------------------------------------------------------------
     BEST RUNS (leaderboard)
     ------------------------------------------------------------ */
  .controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-3); }
  .seg { display: inline-flex; border: 1px solid var(--ink-3); border-radius: var(--r-md); overflow: hidden; }
  .seg button { border: 0; border-radius: 0; background: var(--paper-100); min-height: var(--touch); font-size: var(--fs-14); }
  .seg button + button { border-left: 1px solid var(--ink-3); }
  .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper-100); }
  .seg button[aria-pressed="true"]::after { display: none; }
  .whoami { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; font-size: var(--fs-14); color: var(--ink-2); }
  .whoami button.link { min-height: 36px; padding: 0; }
  .whoami input.q { width: 200px; min-height: 36px; padding: var(--sp-1) var(--sp-3); }
  #lbMeMsg { font-size: var(--fs-14); font-weight: 600; color: var(--correct); min-height: 20px; }
  #lbMeMsg.err { color: var(--wrong); }
  .lbwrap { border-top: 1px solid var(--paper-300); }
  #lbTable { width: 100%; border-collapse: collapse; }
  #lbTable th { padding: var(--sp-2); text-align: left; font-size: var(--fs-12); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--paper-300); }
  #lbTable td { padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--paper-300); }
  #lbTable .c-rank { width: 56px; font-family: var(--font-num); font-weight: 700; }
  #lbTable .c-score { text-align: right; font-family: var(--font-num); font-weight: 700; }
  #lbTable .c-score small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--ink-2); font-size: var(--fs-12); }
  #lbTable .c-date { text-align: right; color: var(--ink-2); font-size: var(--fs-14); white-space: nowrap; }
  #lbTable td.name { font-weight: 600; word-break: break-word; }
  #lbTable tr.me td { background: var(--paper-100); box-shadow: inset 4px 0 0 var(--accent); }
  #lbTable tr.me td + td { box-shadow: none; }
  #lbTable .medal { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: var(--r-pill); border: 1px solid var(--ink); font-size: var(--fs-12); }
  #lbTable .r1 .medal { background: var(--accent); }
  #lbTable tr.skel td { padding: var(--sp-4) var(--sp-2); }
  #lbTable tr.skel i { display: block; height: 16px; border-radius: var(--r-sm); background: var(--paper-300); }
  .state { padding: var(--sp-6) 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .state p { max-width: 52ch; color: var(--ink-2); }
  .state h3 { font-family: var(--font-display); font-size: var(--fs-20); line-height: var(--lh-tight); }
  .lbnote { margin-top: var(--sp-5); font-size: var(--fs-14); color: var(--ink-2); }

  /* ------------------------------------------------------------
     RESULTS
     ------------------------------------------------------------ */
  .results .kicker { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
  .results .pb { display: inline-flex; align-items: center; gap: var(--sp-1); }
  .results .bigscore { margin: var(--sp-2) 0 var(--sp-5); }
  .results .runwrap { margin-bottom: var(--sp-5); }
  .results .misslist { margin-top: var(--sp-3); }
  .savebox { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
  .savebox input.q { width: 220px; }
  .savemsg { min-height: 20px; font-size: var(--fs-14); font-weight: 600; color: var(--correct); margin-bottom: var(--sp-4); }
  .savemsg.err { color: var(--wrong); }
  .results .btns { margin-top: var(--sp-4); }

  /* ------------------------------------------------------------
     SHARE
     ------------------------------------------------------------ */
  #share { position: fixed; inset: 0; z-index: 9; background: var(--paper-200); overflow: hidden; }
  #share.hidden { display: none; }
  .shareframe { display: flex; align-items: center; justify-content: center; gap: var(--sp-6); width: 100%; height: 100%; padding: var(--sp-2); }
  .sharecard { container-type: inline-size; position: relative; overflow: hidden; flex: none; height: min(96vh, 1200px); aspect-ratio: 9 / 16; max-width: 96vw; border-radius: var(--r-md);
    border: 1px solid var(--ink); background: var(--paper-100); box-shadow: var(--elev); }
  /* the padding lives on an inner box: cqw on the container itself would resolve against the page, not the card.
     TikTok safe zone: --sc-safe-r (right button strip) and --sc-safe-b (caption area) are set from RUN_CONFIG.share. Nothing is laid out inside them. */
  .sc-inner { height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2.4cqw; padding: 7cqw var(--sc-safe-r) var(--sc-safe-b) 8cqw; }
  .sc-inner > * { position: relative; width: 100%; }
  .sharecard.dense .sc-inner { gap: 1.6cqw; }
  .sc-top { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
  .sc-logo { font-family: var(--font-display); font-size: 6.4cqw; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
  .sc-tag { font-size: 2.8cqw; font-weight: 700; letter-spacing: .08em; color: var(--ink-2); text-transform: uppercase; white-space: nowrap; }
  .sc-mode { font-family: var(--font-display); font-size: 8cqw; font-weight: 700; letter-spacing: -0.02em; line-height: var(--lh-tight); margin-top: 1cqw; }
  .sc-score { font-family: var(--font-display); font-size: calc(22cqw * var(--sc-fit, 1)); font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; width: fit-content; margin: 0 auto; }
  .sharecard.dense .sc-score { font-size: calc(18cqw * var(--sc-fit, 1)); }
  .sc-unit { font-size: 3.6cqw; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-top: 1cqw; }
  .sc-badges { display: flex; flex-wrap: wrap; gap: 2cqw; justify-content: center; min-height: 8cqw; }
  .sc-badges > span { display: inline-flex; align-items: center; gap: 1.6cqw; font-size: 3.8cqw; font-weight: 700; padding: 1cqw 3cqw; border-radius: var(--r-pill); white-space: nowrap; background: var(--accent); color: var(--on-accent); border: 1px solid var(--ink); }
  .sc-badges .ic { width: 1.1em; height: 1.1em; }
  /* the rows sit under the footer and shrink to fit above the bottom safe zone */
  .sc-rows { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 1.3cqw; }
  .sc-row { display: flex; align-items: center; gap: 3cqw; flex: 0 1 9cqw; min-height: 0; line-height: 1.2; padding: 0 3.6cqw; border-radius: var(--r-sm); background: var(--paper-200); border: 1px solid var(--paper-300); font-size: 4.2cqw; font-weight: 600; text-align: left; overflow: hidden; }
  .sc-rows.dense { gap: .7cqw; }
  .sc-rows.dense .sc-row { font-size: 3.2cqw; gap: 2.4cqw; }
  .sc-row img { height: 70%; width: auto; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); }
  .sc-row .mk { width: 4.4cqw; height: 4.4cqw; flex: none; }
  .sc-row .mk.ok { color: var(--correct); } .sc-row .mk.no { color: var(--wrong); }
  .sc-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sc-row .vl { font-family: var(--font-num); font-weight: 700; }
  .sc-cta { font-family: var(--font-display); font-size: 6.2cqw; font-weight: 700; letter-spacing: -0.02em; }
  .sc-url { font-size: 3.4cqw; color: var(--ink-2); margin-top: 1cqw; word-break: break-all; }
  .sc-pop { opacity: 0; transform: translateY(2cqw); }
  .sc-pop.in { animation: scIn var(--t-med) var(--ease) forwards; }
  @keyframes scIn { to { opacity: 1; transform: none; } }
  .sharectl { width: 280px; flex: none; display: flex; flex-direction: column; gap: var(--sp-2); text-align: left; }
  .sharectl h2 { font-family: var(--font-display); font-size: var(--fs-28); line-height: var(--lh-tight); }
  .sharectl p { font-size: var(--fs-14); color: var(--ink-2); margin-bottom: var(--sp-2); }
  .sharectl button { justify-content: flex-start; }
  #shareMsg { min-height: 20px; font-size: var(--fs-14); font-weight: 600; color: var(--correct); }
  #shareMsg.err { color: var(--wrong); }
  #share.rec .sharectl { opacity: 0; pointer-events: none; }
  #share.rec { cursor: pointer; }
  @media (max-width: 820px) {
    .shareframe { flex-direction: column; gap: var(--sp-2); }
    .sharecard { height: calc(100vh - 160px); height: calc(100dvh - 160px); }
    .sharectl { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .sharectl h2, .sharectl p { display: none; }
    .sharectl button { justify-content: center; min-height: var(--touch); }
    #shareMsg { width: 100%; text-align: center; }
  }

  /* ------------------------------------------------------------
     QUIZ PANELS
     ------------------------------------------------------------ */
  .qpanel { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-4); padding: 104px var(--sp-4) var(--sp-5); z-index: 4; overflow: auto; text-align: center; background: var(--paper-200); }
  .qpanel.hidden, .dock.hidden { display: none; }
  .qpanel > .eyebrow { margin-bottom: calc(var(--sp-2) * -1); }
  #shapeCv { width: min(560px, 92vw); aspect-ratio: 4 / 3; background: var(--paper-100); border-radius: var(--r-md); border: 1px solid var(--paper-300); box-shadow: var(--elev); flex: none; }
  #shapeWord { font-family: var(--font-num); font-size: var(--fs-20); letter-spacing: .2em; min-height: 28px; }
  .qrow { display: flex; gap: var(--sp-2); align-items: center; justify-content: center; width: min(560px, 92vw); }
  .acwrap { position: relative; flex: 1; text-align: left; }
  .ac { position: absolute; left: 0; right: 0; top: calc(100% + var(--sp-1)); background: var(--paper-100); border: 1px solid var(--ink-3); border-radius: var(--r-sm); overflow: hidden; z-index: 7; box-shadow: var(--elev); }
  .ac.up { top: auto; bottom: calc(100% + var(--sp-1)); }
  .ac:empty { display: none; }
  .ac div { padding: var(--sp-3) var(--sp-3); font-weight: 600; cursor: pointer; min-height: var(--touch); display: flex; align-items: center; }
  .ac div.sel { background: var(--paper-200); box-shadow: inset 3px 0 0 var(--ink); }
  @media (hover: hover) and (pointer: fine) { .ac div:hover { background: var(--paper-200); } }
  .qres { min-height: 4em; font-size: var(--fs-16); max-width: min(560px, 92vw); }
  .qres b { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-display); font-size: var(--fs-28); letter-spacing: -0.02em; line-height: var(--lh-tight); }
  .qres b .ic { width: 24px; height: 24px; stroke-width: 3; }
  .qres.ok b { color: var(--correct); }
  .qres.bad b { color: var(--wrong); }
  .qres.partial b { color: var(--ink); }
  .qres .gp { display: inline-block; margin-left: var(--sp-3); font-family: var(--font-num); font-weight: 700; font-size: var(--fs-28); background: var(--accent); color: var(--on-accent); padding: 0 var(--sp-3); border-radius: var(--r-pill); }
  .qres small { display: block; margin-top: var(--sp-2); color: var(--ink-2); font-size: var(--fs-14); }
  .dock { position: fixed; left: 50%; bottom: var(--sp-4); transform: translateX(-50%); width: min(600px, 94vw); z-index: 4; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); align-items: stretch; }
  .dock .qrow { width: 100%; }
  .dock .qline { font-size: var(--fs-14); min-height: 20px; color: var(--ink-2); display: flex; align-items: center; gap: var(--sp-2); }
  .dock .qline.err { color: var(--wrong); font-weight: 600; }
  .chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; min-height: 28px; }
  .chip.found { background: var(--paper-100); color: var(--ink); border: 1px solid var(--correct); font-family: var(--font-body); }
  .chip.found .ic { color: var(--correct); width: 16px; height: 16px; stroke-width: 3; }
  .shake { animation: shake 150ms var(--ease); }
  @keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
  #rankList { position: relative; width: min(460px, 92vw); }
  .rcard { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); background: var(--paper-100); min-height: 56px;
    border: 1px solid var(--paper-300); border-radius: var(--r-md); cursor: grab; touch-action: none; font-weight: 700; font-size: var(--fs-16); text-align: left; transition: transform var(--t-fast) var(--ease); }
  @media (hover: hover) and (pointer: fine) { .rcard:hover:not(.locked) { border-color: var(--ink-3); } }
  .rcard.drag { transition: none; z-index: 3; cursor: grabbing; border-color: var(--ink); box-shadow: var(--elev); position: relative; }
  .rcard img { height: 32px; width: 48px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); }
  .rcard .rn { flex: 1; }
  .rcard .rp { font-family: var(--font-num); font-size: var(--fs-14); color: var(--ink-2); display: none; }
  .rcard .fb { display: none; align-items: center; gap: var(--sp-1); }
  .rcard .fb .ic { stroke-width: 3; }
  .rcard.locked { cursor: default; opacity: 0; animation: fbin var(--t-med) var(--ease) forwards; animation-delay: calc(var(--i, 0) * 80ms); }
  .rcard.locked .rp, .rcard.locked .fb { display: inline-flex; }
  @keyframes fbin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  .rcard.ok { border-color: var(--correct); }
  .rcard.ok .fb { color: var(--correct); }
  .rcard.bad { border-color: var(--wrong); }
  .rcard.bad .fb { color: var(--wrong); }
  .grip { color: var(--ink-3); width: 20px; height: 20px; }

  .loader { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 9; background: var(--paper-200); }
  #err { position: fixed; inset: 0; display: none; z-index: 9; background: var(--paper-200); overflow-y: auto; }
  #err .container { min-height: 100%; display: flex; flex-direction: column; }
  #err .center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3); text-align: center; }
  .lbwrap:has(#lbTable[hidden]):has(#lbEmpty[hidden]) { border-top: 0; }

  @media (max-width: 700px) {
    :root { --fs-48: 28px; }
    .container { padding: var(--sp-4) var(--sp-4) var(--sp-7); }
    .hero h1 { font-size: var(--fs-28); }
    .bigscore, .bigstreak b, .countdown b { font-size: var(--fs-28); }
    #help { display: none; }
    #mini { width: 152px; height: 76px; }
    body.mini-toggle:not(.mini-collapsed) #miniToggle { bottom: calc(var(--sp-4) + 76px + var(--sp-2)); }
    #hud { flex-wrap: wrap; justify-content: center; top: var(--sp-2); left: var(--sp-2); right: var(--sp-2); }
    #target { order: 3; flex-basis: 100%; max-width: none; padding: var(--sp-2) var(--sp-3); }
    #tname { font-size: var(--fs-20); }
    #tflag { height: 56px; }
    #time { padding: var(--sp-1) var(--sp-3); min-width: 0; }
    #time b { font-size: var(--fs-20); }
    #coach { top: 160px; }
    body.hasclues #coach { top: 280px; }
    button.moderow, .grouphead { grid-template-columns: 40px 1fr auto; }
    button.moderow .playcue { display: none; }
    .modeglyph { width: 40px; height: 40px; }
    .weekstrip { margin-left: 0; width: 100%; justify-content: space-between; }
    .whoami { margin-left: 0; width: 100%; }
    .qpanel { padding-top: 140px; }
    .dock .qrow { flex-wrap: wrap; }
    .dock .acwrap { flex: 1 1 100%; }
    .dock .qrow button.primary { flex: 1; }
    .scene { height: 36vh; }
  }

  .hudleft { display: flex; gap: var(--sp-2); align-items: flex-start; }
  #leaveBtn { pointer-events: auto; box-shadow: var(--elev); }
  .scrim { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
    background: color-mix(in srgb, var(--paper-200) 78%, transparent); }
  .scrim.hidden { display: none; }
  .modal { max-width: 420px; width: 100%; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); animation: reveal var(--t-med) var(--ease); }
  .modal h2 { font-size: var(--fs-28); }
  .modal .btns { margin-top: var(--sp-2); }

  /* reduced motion: no movement; opacity and colour changes stay */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; }
    button:active:not(:disabled):not([aria-busy="true"]) { transform: none; }
    #toast, #toast.show { transform: translate(-50%, 0); }
    .sc-pop { transform: none; }
    @keyframes rise { from { opacity: 0; } to { opacity: 1; } }
    @keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
    @keyframes shake { 25%, 50%, 75% { transform: none; } }
    @keyframes tick { 0%, 100% { transform: none; } }
    @keyframes fbin { from { opacity: 0; } to { opacity: 1; } }
    button[aria-busy="true"]::before { animation: none; border-top-color: currentColor; opacity: .6; }
  }

  .sprite { position: absolute; width: 0; height: 0; }
  .streakline.spaced { margin-top: var(--sp-5); }
  .herorow.tight { margin-top: var(--sp-3); }
  #dailyTitle { margin: var(--sp-1) 0 var(--sp-5); }
  .link .ic { width: 16px; height: 16px; margin-left: var(--sp-1); }
  #touchbar, #miniToggle, #help { }

  /* ------------------------------------------------------------
     RUN MODES: variant tags, lives, pause, resume, end map
     ------------------------------------------------------------ */
  .tag-ranked { font-size: var(--fs-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-accent); background: var(--accent); border: 1px solid var(--ink); border-radius: var(--r-sm); padding: 0 var(--sp-2); }
  #left { flex-wrap: wrap; row-gap: var(--sp-1); transition: border-color var(--t-fast) var(--ease); }
  #left.hit { border-color: var(--wrong); }
  #left .hudstat { display: inline-flex; align-items: baseline; gap: var(--sp-1); }
  #left .hudstat.dim { color: var(--ink-2); font-weight: 400; }
  #left .lives { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); }
  #left .lives .ic { width: 18px; height: 18px; }
  #left .lives .ic.gone { color: var(--ink-3); opacity: .5; }
  #left .lives.last { color: var(--wrong); }
  .scrim.opaque { background: var(--paper-200); }
  .modal .runlist { margin: 0; }
  .resumebar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-4); }
  .resumebar .rtext { flex: 1 1 260px; font-size: var(--fs-14); color: var(--ink-2); }
  .resumebar .rtext b { display: block; font-size: var(--fs-16); color: var(--ink); }
  .endmap { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; border: 1px solid var(--ink); border-radius: var(--r-sm); background: var(--ocean); margin: 0 0 var(--sp-2); }
  .endmap[hidden] { display: none; }
  .maplegend { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: var(--fs-14); color: var(--ink-2); margin-bottom: var(--sp-5); }
  .maplegend[hidden] { display: none; }
  .maplegend i { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--ink); vertical-align: -1px; margin-right: var(--sp-1); }
  .maplegend .f { background: var(--correct-fill); }
  .maplegend .m { background: var(--ink-3); }
  .splitlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
  .splitlist h3 { font-size: var(--fs-12); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: var(--sp-1); }
  .splitlist p { font-size: var(--fs-14); color: var(--ink-2); max-height: 160px; overflow-y: auto; }
  .endrule { margin-top: calc(var(--sp-4) * -1); margin-bottom: var(--sp-4); }
  .endrule:empty { display: none; }

  /* ------------------------------------------------------------
     ECONOMY: player bar, rewards, profile
     ------------------------------------------------------------ */
  .playerbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; justify-content: flex-end; }
  .scene .playerbar { position: absolute; top: var(--sp-5); right: var(--sp-5); padding: var(--sp-2) var(--sp-3); background: var(--paper-100); border: 1px solid var(--paper-300); border-radius: var(--r-md); box-shadow: var(--elev); }
  .playerbar .lvl { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-num); font-weight: 700; font-size: var(--fs-14); white-space: nowrap; }
  .xpbar { display: inline-block; width: 72px; height: 8px; border-radius: var(--r-pill); background: var(--paper-300); overflow: hidden; flex: none; }
  .xpbar.big { width: min(260px, 50vw); height: 10px; }
  .xpbar i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left center; transform: scaleX(0); transition: transform var(--t-med) var(--ease); }
  .xpbar i.snap { transition: none; }
  .coinchip { display: inline-flex; align-items: center; gap: var(--sp-1); font-family: var(--font-num); font-weight: 700; font-size: var(--fs-14); white-space: nowrap; }
  .coinchip .ic { width: 18px; height: 18px; }
  #end .topbar .playerbar, #profile .playerbar { margin-left: auto; }
  @media (max-width: 700px) { .scene .playerbar { top: auto; bottom: var(--sp-3); right: var(--sp-3); left: var(--sp-3); justify-content: space-between; } }

  .rewards { padding: var(--sp-4) var(--sp-5); margin: 0 0 var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
  .rewards[hidden] { display: none; }
  .rew-head { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); align-items: flex-end; }
  .rew-big { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-28); line-height: var(--lh-tight); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .rew-big .ic { width: 24px; height: 24px; }
  .rew-level { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-family: var(--font-num); font-weight: 700; font-size: var(--fs-14); }
  .rew-lines { list-style: none; margin: 0; padding: 0; font-size: var(--fs-14); color: var(--ink-2); }
  .rew-lines li { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 2px 0; }
  .rew-lines .num { white-space: nowrap; }
  .rew-note { font-size: var(--fs-14); color: var(--ink-2); }
  .rew-pop { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--ink); border-radius: var(--r-sm); background: var(--paper-100); font-weight: 700; animation: rise var(--t-med) var(--ease) both; }
  .rew-pop small { display: block; font-weight: 400; color: var(--ink-2); font-size: var(--fs-12); }
  .rew-pop.up { background: var(--accent); color: var(--on-accent); }
  .rew-pop.up small { color: var(--on-accent); }

  .statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
  .statcard { padding: var(--sp-3) var(--sp-4); }
  .statcard b { display: block; font-family: var(--font-num); font-size: var(--fs-28); line-height: 1.1; font-variant-numeric: tabular-nums; }
  .statcard small { color: var(--ink-2); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
  .profhead { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
  .profname { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-28); letter-spacing: -0.02em; line-height: var(--lh-tight); }
  .profname input.q { width: 220px; }

  .trophygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-3); }
  .trophy { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3); border: 1px solid var(--ink); border-radius: var(--r-md); background: var(--paper-100); }
  .trophy.locked { border: 1px dashed var(--ink-3); background: transparent; color: var(--ink-2); }
  .trophy .tmedal { width: 40px; height: 40px; flex: none; border-radius: var(--r-pill); border: 1px solid var(--ink); display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); }
  .trophy.locked .tmedal { background: transparent; border-color: var(--ink-3); color: var(--ink-3); }
  .trophy b { display: block; line-height: 1.2; color: var(--ink); }
  .trophy.locked b { color: var(--ink-2); }
  .trophy small { display: block; margin-top: 2px; font-size: var(--fs-12); color: var(--ink-2); line-height: 1.35; }
  .trophy .tier { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

  .contlist { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; gap: var(--sp-3); }
  .controw { display: grid; grid-template-columns: 120px 1fr auto; gap: var(--sp-3); align-items: center; font-size: var(--fs-14); }
  .controw .num { font-family: var(--font-num); font-weight: 700; white-space: nowrap; }
  .contbar { height: 10px; border-radius: var(--r-pill); background: var(--paper-300); overflow: hidden; }
  .contbar i { display: block; height: 100%; background: var(--correct-fill); }
  .contbar.done i { background: var(--correct); }
  @media (max-width: 700px) { .controw { grid-template-columns: 96px 1fr auto; } }
  .cosmetics { border: 1px dashed var(--ink-3); border-radius: var(--r-md); padding: var(--sp-5); color: var(--ink-2); font-size: var(--fs-14); }
  .cosmetics b { color: var(--ink); }

  /* ------------------------------------------------------------
     SHOP and skins
     ------------------------------------------------------------ */
  .tag-premium-note { font-size: var(--fs-14); }
  .shopbal { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; margin: var(--sp-4) 0; }
  .shopbal .coinchip { font-size: var(--fs-20); }
  .upgrade { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; padding: var(--sp-4); margin-bottom: var(--sp-5); }
  .upgrade b { display: block; font-size: var(--fs-16); }
  .upgrade span { color: var(--ink-2); font-size: var(--fs-14); }
  .shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
  .skincard { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3); }
  .skincard.equipped { border-color: var(--ink); box-shadow: 0 0 0 2px var(--accent); }
  canvas.skinprev { display: block; width: 100%; aspect-ratio: 2 / 1; border-radius: var(--r-sm); border: 1px solid var(--ink); background: var(--dark-map); }
  .skinhead { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
  .skinname { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-20); letter-spacing: -0.02em; line-height: var(--lh-tight); margin: 0; }
  .skincard .tagline, .profskin .tagline { color: var(--ink-2); font-size: var(--fs-14); margin: 0; }
  .skinfoot { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: auto; }
  .skinfoot button { min-width: 140px; }
  .skinfoot .ic { width: 16px; height: 16px; }
  .skinfoot .need { font-size: var(--fs-12); color: var(--ink-2); }
  .toastbar { position: fixed; left: 50%; bottom: var(--sp-5); transform: translateX(-50%); z-index: 25; padding: var(--sp-3) var(--sp-5); font-weight: 600; font-size: var(--fs-14); max-width: 92vw; text-align: center; }
  .toastbar[hidden] { display: none; }
  .skinico { width: 18px; height: 28px; vertical-align: middle; margin-right: var(--sp-2); overflow: visible; flex: none; }
  #lbTable td.name { white-space: normal; }
  .profskin { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: var(--sp-4); padding: var(--sp-3); align-items: center; }
  .profskintext { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
  @media (max-width: 700px) { .profskin { grid-template-columns: 1fr; } }
  .databox { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4); }
  button.danger { color: var(--wrong); border-color: var(--wrong); }
  /* accounts, free tier, paywall */
  .playsline { margin-top: var(--sp-3); }
  .tag-locked { font-size: var(--fs-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: var(--paper-100); border: 1px solid var(--ink); border-radius: var(--r-sm); padding: 0 var(--sp-2); display: inline-flex; align-items: center; gap: var(--sp-1); }
  .tag-locked .ic { width: 12px; height: 12px; }
  .ordivider { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-2); font-size: var(--fs-14); }
  .ordivider::before, .ordivider::after { content: ""; flex: 1; border-top: 1px solid var(--paper-300); }
  #signin .modal .btns { justify-content: flex-end; }
  .pwusage { padding: var(--sp-4); margin: var(--sp-4) 0; display: grid; gap: var(--sp-1); }
  .pwusage b { font-family: var(--font-num); font-size: var(--fs-20); }
  .pwplans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); margin: var(--sp-5) 0 var(--sp-4); }
  .plancard { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
  .plancard.best { border-color: var(--ink); }
  .plancard .planname { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-20); letter-spacing: -0.02em; }
  .plancard .planprice { font-family: var(--font-num); font-weight: 700; font-size: var(--fs-28); line-height: var(--lh-tight); }
  .plancard .planprice small { font-family: var(--font-body); font-size: var(--fs-14); color: var(--ink-2); font-weight: 600; }
  .plancard button { margin-top: var(--sp-2); width: 100%; }
  .pwdisc { padding: var(--sp-4); margin-bottom: var(--sp-4); }
  .acctrow { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; }
  /* share card banner: the dark strip with the player's plane and contrail flying through it */
  .sc-top { position: relative; aspect-ratio: 900 / 165; align-items: flex-start; padding: 2.4cqw 3.4cqw; border-radius: var(--r-sm); border: 1px solid var(--ink); background: var(--dark-map); overflow: hidden; }
  .sc-top .sc-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  .sc-top .sc-logo, .sc-top .sc-tag { position: relative; z-index: 1; }
  .sc-top .sc-logo { color: var(--paper-100); }
  .sc-top .sc-tag { color: var(--paper-300); }
