/* ==========================================================================
   FLIPPING SURF v1.1 — visual system
   Original work by Tawajo (www.tawajo.com). © 2026 Tawajo. All rights reserved.
   ========================================================================== */

@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/bebas-neue-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/outfit-latin.woff2') format('woff2');
}

:root {
  /* procedural grain + weave textures (inline SVG, no assets) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.6 0.6 0.6 0 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  --weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='none'/%3E%3Cpath d='M0 8L8 0M-2 2L2 -2M6 10L10 6' stroke='rgba(255,255,255,0.05)' stroke-width='1'/%3E%3C/svg%3E");
  --ink: #eefbff;
  --ink-soft: #b7ddec;
  --muted: #7fa9bd;
  --teal: #23d6cf;
  --teal-deep: #0a8f96;
  --sun: #ffd05a;
  --orange: #ff8a45;
  --coral: #ff6a5e;
  --mint: #93ffd0;
  --deep: #04243c;
  --night: #01121f;
  --glass: rgba(4, 33, 53, .72);
  --glass-strong: rgba(3, 26, 43, .9);
  --glass-light: rgba(24, 82, 111, .38);
  --stroke: rgba(157, 226, 250, .16);
  --stroke-strong: rgba(157, 226, 250, .3);
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  --radius: 18px;
  --radius-lg: 24px;
  --display: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --body: 'Outfit', 'Trebuchet MS', 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #04233a;
  color: var(--ink);
  font-family: var(--body);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { position: relative; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; }

/* full-screen film grain — makes every surface feel printed rather than flat */
#app::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 210;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 160px 160px;
  opacity: .12;
  mix-blend-mode: overlay;
}

canvas#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -0.16em;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: rgba(140, 220, 240, .25);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(140, 220, 240, .42); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   Splash
   ========================================================================== */
#splash {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 600px at 50% 40%, rgba(24, 140, 160, .38), transparent 65%),
    linear-gradient(160deg, #061c2e, #02101c 70%);
  transition: opacity .55s ease, visibility .55s;
}
/* painted splash decor: setting sun over layered swells */
#splash::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 26%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff6d8, #ffd05a 52%, #ff8a45 78%, rgba(255, 138, 69, 0) 82%);
  opacity: .85;
  filter: blur(1px);
}
#splash::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(64, 214, 208, .18), transparent 60%),
    linear-gradient(180deg, rgba(4, 52, 76, 0) 0%, rgba(3, 40, 60, .65) 38%, #021927 100%);
}
#splash::after {
  box-shadow:
    inset 0 2px 0 rgba(170, 240, 238, .25),
    inset 0 22px 40px rgba(6, 90, 110, .18);
}
.splash-brand { position: relative; z-index: 2; text-align: center; animation: splashIn .8s cubic-bezier(.2,.9,.25,1) both; }
#splash.done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-mark {
  font-family: var(--display);
  font-size: clamp(64px, 12vw, 150px);
  line-height: .8;
  letter-spacing: .055em;
  color: #fff;
  text-shadow: 0 8px 0 rgba(5, 55, 78, .75), 0 30px 70px rgba(0,0,0,.5);
}
.splash-mark span {
  display: block;
  color: transparent;
  background: linear-gradient(180deg, #8afff7, #25d6cf 55%, #0a8f96);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: .74em;
  letter-spacing: .3em;
  padding-left: .3em;
}
.splash-by {
  margin-top: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .42em;
  color: var(--ink-soft);
  opacity: .8;
}
@keyframes splashIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ==========================================================================
   Shared chrome
   ========================================================================== */
.overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: env(safe-area-inset-top, 0) 18px env(safe-area-inset-bottom, 0);
}
.overlay:not(.trans) {
  background:
    radial-gradient(1100px 700px at 50% 0%, rgba(23, 112, 145, .3), transparent 62%),
    linear-gradient(180deg, rgba(1, 17, 29, .88), rgba(2, 36, 58, .95));
  backdrop-filter: blur(7px);
}
.overlay.trans {
  background: rgba(1, 14, 24, .66);
  backdrop-filter: blur(8px);
}
.screen.overlay { overflow-y: auto; overscroll-behavior: contain; }

.subtitle {
  font-family: var(--display);
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: .9;
  letter-spacing: .055em;
  font-weight: 400;
  text-transform: uppercase;
  text-shadow: 0 4px 0 rgba(0, 16, 28, .45), 0 18px 40px rgba(0,0,0,.35);
}
.subtitle.red { color: #ff8378; }
.subtitle.gold { color: var(--sun); }
.subtitle.center { text-align: center; }

.menu-buttons { display: flex; flex-direction: column; gap: 11px; align-items: stretch; }
.menu-row { display: flex; gap: 11px; align-items: stretch; }
.menu-row > .btn { flex: 1; }
.menu-row.center { justify-content: center; }

/* buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 52px;
  padding: 11px 20px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(20, 82, 112, .94), rgba(5, 45, 69, .96));
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 5px 0 rgba(0, 12, 22, .38), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform .12s ease, filter .18s ease, border-color .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.13) 48%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .6s ease;
  pointer-events: none;
}
.btn:hover::before { transform: translateX(130%); }
.btn:hover { filter: brightness(1.12); transform: translateY(-2px); border-color: rgba(157, 226, 250, .48); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,12,22,.38), inset 0 1px 0 rgba(255,255,255,.1); }
.btn:focus-visible, .icon-btn:focus-visible, .setting-row:focus-visible, .tc-btn:focus-visible {
  outline: 3px solid rgba(255, 208, 90, .85);
  outline-offset: 3px;
}
.btn .ic { font-size: 19px; }
.btn b { font-weight: 800; }

.btn-primary {
  color: #2a1200;
  background: linear-gradient(135deg, #ffdc74 0%, #ffb23e 44%, #ff7f42 100%);
  border-color: rgba(255, 246, 204, .85);
  box-shadow: 0 6px 0 rgba(125, 52, 8, .42), 0 18px 34px rgba(255, 132, 55, .22), inset 0 1px 0 rgba(255,255,255,.6);
}
.btn-primary:hover { box-shadow: 0 8px 0 rgba(125, 52, 8, .38), 0 22px 46px rgba(255, 132, 55, .34), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-primary .ic { color: #3b1a00; }
.btn-gold {
  color: #2a1200;
  background: linear-gradient(135deg, #fff2b0, #ffd05a 58%, #ffb03a);
  border-color: rgba(255, 250, 214, .9);
}
.btn-ghost {
  background: rgba(8, 43, 64, .42);
  border-color: var(--stroke);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(18, 69, 96, .62); }
.btn-danger {
  color: #ffd8d2;
  background: linear-gradient(180deg, rgba(92, 29, 33, .8), rgba(58, 16, 24, .9));
  border-color: rgba(255, 122, 106, .38);
}
.btn-danger:hover { border-color: rgba(255, 122, 106, .7); }
.btn-small { min-height: 42px; padding: 8px 14px; font-size: 12.5px; border-radius: 12px; }
.btn-mini-primary {
  min-height: 38px;
  padding: 7px 14px;
  font-size: 11.5px;
  border-radius: 11px;
  color: #2a1200;
  background: linear-gradient(135deg, #ffdc74, #ff9a43);
  border: 1px solid rgba(255,255,255,.6);
  cursor: pointer;
  font-family: var(--body);
  font-weight: 800;
  letter-spacing: .08em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-icon-back {
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 14px;
  font-size: 19px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-size: 21px;
  color: var(--ink);
  background: rgba(5, 43, 65, .72);
  border: 1px solid var(--stroke-strong);
  border-radius: 13px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,12,22,.32), inset 0 1px 0 rgba(255,255,255,.1);
  transition: filter .15s ease, transform .08s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { filter: brightness(1.2); background: rgba(17, 70, 97, .85); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,12,22,.3); }
.icon-btn .ic { font-size: 23px; }

.coin-icon {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff8c6, #ffcf4d 46%, #c47a0a 80%);
  border: 2px solid #ffe9a8;
  box-shadow: 0 0 10px rgba(255, 190, 40, .5), inset 0 -2px 3px rgba(120, 70, 0, .35);
  vertical-align: -.14em;
  margin-right: .18em;
  flex: 0 0 auto;
}

.badge-new {
  position: absolute;
  top: -7px;
  right: -6px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  color: #341500;
  background: linear-gradient(135deg, #fff0a0, #ffb53e);
  border-radius: 99px;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
  animation: badgePop 1.8s ease-in-out infinite;
  z-index: 2;
}
@keyframes badgePop { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(2deg); } }

/* Rich surface treatment: soft top gloss + fine weave on the big panels so
   glass cards feel like layered material instead of flat fills. */
.menu-panel {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 22%),
    linear-gradient(180deg, rgba(7, 43, 65, .84), rgba(2, 24, 39, .9)),
    var(--weave);
}
.modal-card {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 22%),
    linear-gradient(180deg, rgba(8, 48, 70, .96), rgba(2, 22, 37, .98)),
    var(--weave);
}
.result-card {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 22%),
    linear-gradient(180deg, rgba(8, 47, 69, .97), rgba(2, 20, 34, .98)),
    var(--weave);
}
.records-list {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, rgba(4, 35, 56, .7), rgba(3, 30, 48, .7)),
    var(--weave);
}
.level-card {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 20%),
    linear-gradient(180deg, rgba(12, 64, 91, .8), rgba(3, 32, 50, .9)),
    var(--weave);
}
.ride-card {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 20%),
    linear-gradient(180deg, rgba(12, 64, 91, .82), rgba(3, 32, 50, .92)),
    var(--weave);
}
.skin-card {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 20%),
    linear-gradient(180deg, rgba(12, 64, 91, .8), rgba(3, 32, 50, .92)),
    var(--weave);
}
.menu-panel, .modal-card, .result-card {
  position: relative;
}
.menu-panel::after, .modal-card::after, .result-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--grain);
  background-size: 120px 120px;
  opacity: .1;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.menu-panel > *, .modal-card > *, .result-card > * { position: relative; z-index: 1; }

/* hairline gold edge accent on the primary panels */
.menu-panel::before, .result-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(126, 244, 238, .4), rgba(255, 208, 90, .12) 40%, transparent 75%, rgba(126, 244, 238, .2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* ==========================================================================
   Main menu
   ========================================================================== */
.overlay.menu-screen {
  justify-content: center;
  align-items: stretch;
  padding:
    calc(30px + env(safe-area-inset-top, 0px))
    calc(clamp(24px, 5vw, 90px) + env(safe-area-inset-right, 0px))
    calc(64px + env(safe-area-inset-bottom, 0px))
    calc(clamp(24px, 5vw, 90px) + env(safe-area-inset-left, 0px));
  background:
    linear-gradient(90deg, rgba(1, 15, 26, .42) 0%, rgba(1, 15, 26, .26) 28%, rgba(1, 15, 26, .06) 52%, rgba(1, 15, 26, 0) 74%),
    linear-gradient(180deg, rgba(1, 15, 26, .1), transparent 28%, rgba(1, 15, 26, .3));
  backdrop-filter: none;
}
.menu-shell {
  width: 100%;
  max-width: 1240px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 76px);
}
.menu-hero {
  flex: 1 1 auto;
  min-width: 0;
  animation: menuIn .55s cubic-bezier(.2,.9,.25,1) both;
}
.menu-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .34em;
  color: var(--ink-soft);
  opacity: .82;
  margin-bottom: 42px;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(35, 214, 207, .55);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(35, 214, 207, .5); }
  70% { box-shadow: 0 0 0 9px rgba(35, 214, 207, 0); }
  100% { box-shadow: 0 0 0 0 rgba(35, 214, 207, 0); }
}
.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(88px, 12.6vw, 178px);
  line-height: .74;
  letter-spacing: .035em;
  color: #fff;
  text-shadow: 0 7px 0 #073f5c, 0 15px 0 rgba(3, 38, 60, .82), 0 34px 60px rgba(0,0,0,.5);
  animation: titleFloat 5s ease-in-out infinite;
}
.title-top { display: block; }
.title-bottom {
  display: block;
  font-size: .88em;
  letter-spacing: .12em;
  padding-left: .08em;
  color: #52f4e9;
  text-shadow:
    0 5px 0 #073f5c,
    0 11px 0 rgba(3, 38, 60, .75),
    0 0 26px rgba(82, 244, 233, .24);
  position: relative;
}
.title-bottom::after {
  content: '';
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: -.02em;
  height: .055em;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(126, 244, 238, .85), rgba(255, 208, 90, .75), transparent);
  opacity: .65;
}
@keyframes titleFloat { 0%,100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-9px) rotate(.4deg); } }
@keyframes menuIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.tagline {
  margin-top: 26px;
  max-width: 430px;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .015em;
  color: var(--ink-soft);
  opacity: .95;
  text-shadow: 0 2px 8px rgba(0, 16, 28, .65);
}
.menu-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.menu-daily, .menu-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 99px;
  white-space: nowrap;
}
.menu-daily {
  color: #a9fff4;
  background: rgba(5, 56, 76, .62);
  border: 1px solid rgba(126, 244, 238, .26);
}
.menu-level {
  color: var(--sun);
  background: rgba(64, 44, 6, .42);
  border: 1px solid rgba(255, 208, 90, .3);
}
.menu-session {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  width: fit-content;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(3, 32, 50, .48);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
}
.session-item { display: flex; flex-direction: column; gap: 3px; }
.session-label { font-size: 9px; font-weight: 800; letter-spacing: .2em; color: var(--muted); }
.session-value { font-size: 15px; font-weight: 800; letter-spacing: .03em; display: flex; align-items: center; }
.session-divider { width: 1px; height: 28px; background: var(--stroke); }

.menu-panel {
  flex: 0 1 430px;
  width: min(430px, 100%);
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(7, 43, 65, .84), rgba(2, 24, 39, .9));
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.1);
  backdrop-filter: blur(16px);
  animation: menuIn .55s .08s cubic-bezier(.2,.9,.25,1) both;
}
.menu-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .24em;
  color: var(--ink-soft);
  opacity: .8;
}
.menu-panel-actions { display: flex; gap: 8px; }
.menu-panel-actions .icon-btn { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }

.btn-hero {
  width: 100%;
  min-height: 76px;
  justify-content: flex-start;
  padding: 12px 16px;
  border-radius: 18px;
  gap: 14px;
  text-align: left;
  animation: heroPulse 3.2s ease-in-out infinite;
}
.btn-hero::before { animation: heroShine 4.4s ease-in-out infinite; }
@keyframes heroShine {
  0%, 55% { transform: translateX(-130%); }
  78%, 100% { transform: translateX(130%); }
}
@keyframes heroPulse {
  0%,100% { box-shadow: 0 6px 0 rgba(125, 52, 8, .42), 0 16px 34px rgba(255, 132, 55, .2), inset 0 1px 0 rgba(255,255,255,.6); }
  50% { box-shadow: 0 6px 0 rgba(125, 52, 8, .42), 0 22px 52px rgba(255, 158, 62, .38), inset 0 1px 0 rgba(255,255,255,.6); }
}
.btn-hero .btn-ic {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: rgba(59, 21, 0, .16);
  color: #3a1700;
  flex: 0 0 auto;
}
.btn-hero .btn-ic .ic { font-size: 24px; }
.btn-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.btn-copy b { font-family: var(--display); font-size: 31px; line-height: 1; letter-spacing: .06em; font-weight: 400; }
.btn-copy small { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; opacity: .68; text-transform: none; }
.btn-arrow { margin-left: auto; display: flex; opacity: .6; transition: transform .18s ease, opacity .18s ease; }
.btn-arrow .ic { font-size: 22px; }
.btn:hover .btn-arrow { transform: translateX(4px); opacity: 1; }

/* icon tiles get a springy icon lift on hover */
.btn-tile .btn-ic { transition: transform .18s cubic-bezier(.2,1.4,.3,1), background .18s ease, box-shadow .18s ease; }
.btn-tile:hover .btn-ic { transform: translateY(-2px) scale(1.06); box-shadow: 0 6px 14px rgba(0, 12, 22, .25); }
.btn-tile:active .btn-ic { transform: scale(.94); }
.btn-ghost .btn-ic { transition: transform .18s cubic-bezier(.2,1.4,.3,1); }
.btn-ghost:hover .btn-ic { transform: translateX(2px); }

/* staggered entrance for the menu panel contents */
.menu-panel > * { animation: menuIn .5s cubic-bezier(.2,.9,.25,1) both; }
.menu-panel > *:nth-child(1) { animation-delay: .1s; }
.menu-panel > *:nth-child(2) { animation-delay: .16s; }
.menu-panel > *:nth-child(3) { animation-delay: .22s; }
.menu-panel > *:nth-child(4) { animation-delay: .28s; }
.menu-panel > *:nth-child(5) { animation-delay: .34s; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}
.btn-tile {
  justify-content: flex-start;
  min-height: 64px;
  padding: 9px 12px;
  gap: 10px;
  border-radius: 14px;
  text-align: left;
}
.btn-tile .btn-ic {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(126, 244, 238, .1);
  color: #9af4ee;
  flex: 0 0 auto;
}
.btn-tile .btn-ic .ic { font-size: 19px; }
.btn-tile .btn-copy b { font-family: var(--body); font-size: 12.5px; letter-spacing: .08em; font-weight: 800; line-height: 1.15; }
.btn-tile .btn-copy small { font-size: 9.5px; opacity: .55; }
.btn-tile:hover .btn-ic { background: rgba(126, 244, 238, .19); }

.menu-secondary {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(157, 226, 250, .1);
}
.btn-ghost {
  justify-content: flex-start;
  min-height: 46px;
  padding: 7px 11px;
  gap: 10px;
  border-radius: 12px;
  text-align: left;
}
.btn-ghost .btn-ic { width: 24px; display: flex; justify-content: center; color: #8fdce7; }
.btn-ghost .btn-ic .ic { font-size: 17px; }
.btn-ghost .btn-copy b { font-family: var(--body); font-size: 11.5px; letter-spacing: .09em; font-weight: 800; line-height: 1.2; }
.btn-ghost .btn-copy small { font-size: 9.5px; opacity: .5; }
.btn-ghost .badge-new { top: 3px; right: 8px; }

.menu-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  color: rgba(183, 221, 236, .66);
  text-align: center;
  padding: 0 18px;
}
.footer-credit { color: rgba(234, 251, 255, .9); }
.footer-credit b { color: var(--sun); letter-spacing: .22em; }
.footer-dot { opacity: .35; }
.footer-soft { opacity: .62; }

/* ==========================================================================
   Sub screens
   ========================================================================== */
.sub-screen { align-items: center; justify-content: flex-start; padding-top: 24px; padding-bottom: 24px; }
.sub-shell {
  width: 100%;
  max-width: 1120px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: menuIn .4s cubic-bezier(.2,.9,.25,1) both;
}
.sub-shell.narrow { max-width: 860px; }
.sub-shell.scrollable { max-height: calc(100dvh - 40px); overflow-y: auto; padding-right: 4px; }
.sub-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  flex: 0 0 auto;
}
.sub-title-wrap { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.sub-eyebrow { font-size: 9px; font-weight: 800; letter-spacing: .28em; color: var(--ink-soft); opacity: .62; }
.sub-head .subtitle { font-size: clamp(34px, 4vw, 52px); }
.sub-balance {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(3, 30, 48, .65);
  border: 1px solid var(--stroke);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
}
.sub-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; padding-top: 2px; }
.sub-actions .btn-primary { min-width: 260px; }
.sub-actions .btn-primary .btn-copy b { font-size: 20px; }
.sub-actions .btn-primary .btn-copy small { font-size: 10px; opacity: .6; }

/* level cards */
.level-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 13px;
  max-height: none;
  padding: 2px;
}
.level-card {
  position: relative;
  padding: 9px;
  background: linear-gradient(180deg, rgba(12, 64, 91, .8), rgba(3, 32, 50, .9));
  border: 1px solid var(--stroke);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.level-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 8, 14, .5));
  pointer-events: none;
}
.level-card:hover { transform: translateY(-4px); border-color: rgba(157, 226, 250, .4); box-shadow: 0 16px 34px rgba(0,0,0,.28); }
.level-card:focus-visible, .ride-card:focus-visible, .skin-card:focus-visible {
  outline: 3px solid rgba(255, 208, 90, .85);
  outline-offset: 3px;
}
.level-card.selected {
  border-color: rgba(255, 208, 90, .92);
  box-shadow: 0 0 0 1px rgba(255, 208, 90, .32), 0 14px 34px rgba(255, 186, 60, .16);
}
.level-card.selected::before {
  content: '✓';
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #2b1400;
  background: linear-gradient(135deg, #ffe9a0, #ffbe3d);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
.level-card canvas {
  width: 100%;
  height: 88px;
  display: block;
  border-radius: 11px;
  background: #08283e;
}
.level-card h3 {
  position: relative;
  z-index: 1;
  margin: 9px 3px 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #fff;
}
.level-card h3 .lv-num { color: var(--sun); opacity: .92; }
.level-card .level-tag {
  position: relative;
  z-index: 1;
  margin: 0 3px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink-soft);
  opacity: .62;
  min-height: 28px;
}
.level-card .level-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 3px 0;
}
.level-card .level-meta span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  padding: 3px 7px;
  border-radius: 99px;
  background: rgba(255,255,255,.07);
  color: var(--ink-soft);
  white-space: nowrap;
}
.level-card .level-meta span.diff-easy { color: #9dffc9; }
.level-card .level-meta span.diff-medium { color: #ffe08a; }
.level-card .level-meta span.diff-hard { color: #ffb07c; }
.level-card .level-meta span.diff-extreme { color: #ff8d7e; }
.level-card .level-best {
  position: relative;
  z-index: 1;
  margin: 7px 3px 1px;
  padding-top: 6px;
  border-top: 1px solid rgba(157, 226, 250, .1);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #92e9e4;
}
.level-card .level-best.cleared { color: #99ffc9; }
.level-card .level-best.muted { color: var(--muted); }
.level-card.locked { opacity: .55; }

/* ride cards */
.ride-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 15px; padding: 2px; }
.ride-card {
  position: relative;
  padding: 16px;
  background: linear-gradient(180deg, rgba(12, 64, 91, .82), rgba(3, 32, 50, .92));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.ride-card:hover { transform: translateY(-4px); border-color: rgba(157, 226, 250, .4); }
.ride-card.selected {
  border-color: rgba(255, 208, 90, .92);
  box-shadow: 0 0 0 1px rgba(255, 208, 90, .3), 0 18px 38px rgba(255, 186, 60, .13);
}
.ride-card.locked { opacity: .76; }
.ride-card canvas {
  width: 100%;
  height: 112px;
  display: block;
  border-radius: 12px;
  background:
    radial-gradient(120% 90% at 50% 20%, rgba(94, 210, 220, .18), transparent 60%),
    linear-gradient(180deg, rgba(8, 48, 70, .8), rgba(2, 22, 36, .9));
  margin-bottom: 10px;
}
.ride-card h3 { font-family: var(--display); font-size: 28px; letter-spacing: .06em; font-weight: 400; line-height: 1; }
.ride-card .desc { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--ink-soft); opacity: .72; min-height: 52px; }
.ride-card .stat-lines { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.stat-line-row { display: flex; align-items: center; gap: 8px; }
.stat-line-row span { width: 28px; font-size: 8.5px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.stat-track { flex: 1; height: 5px; border-radius: 99px; background: rgba(0,0,0,.34); overflow: hidden; }
.stat-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #43e4dc, #ffd05a); box-shadow: 0 0 8px rgba(67, 228, 220, .3); }
.ride-card .streak {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  padding: 6px 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--sun);
  background: rgba(255, 190, 60, .09);
  border: 1px solid rgba(255, 190, 60, .18);
  border-radius: 9px;
}
.ride-card .streak .ic { font-size: 14px; }
.ride-card .lock-row, .ride-card .owned-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
}
.ride-card .lock-row { color: var(--sun); }
.ride-card .lock-row.cant { color: #ff9a8e; }
.ride-card .owned-tag { color: var(--mint); }
.ride-card .equipped-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 9px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  color: #291300;
  background: linear-gradient(135deg, #ffe9a0, #ffbe3d);
  border-radius: 99px;
  box-shadow: 0 4px 10px rgba(0,0,0,.28);
}

/* shop */
.shop-progress-wrap { display: flex; flex-direction: column; gap: 5px; padding: 0 2px; }
.shop-progress-label { display: flex; justify-content: space-between; font-size: 9px; font-weight: 800; letter-spacing: .18em; color: var(--muted); }
.shop-progress { height: 6px; border-radius: 99px; background: rgba(0,0,0,.32); overflow: hidden; border: 1px solid rgba(157,226,250,.1); }
.shop-progress i { display: block; height: 100%; width: 14%; border-radius: 99px; background: linear-gradient(90deg, #23d6cf, #ffd05a); box-shadow: 0 0 12px rgba(255,208,90,.35); transition: width .4s ease; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 2px; }
.skin-card {
  position: relative;
  padding: 9px;
  background: linear-gradient(180deg, rgba(12, 64, 91, .8), rgba(3, 32, 50, .92));
  border: 1px solid var(--stroke);
  border-radius: 15px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.skin-card:hover { transform: translateY(-3px); border-color: rgba(157, 226, 250, .4); }
.skin-card canvas { width: 100%; height: 74px; display: block; border-radius: 10px; background: rgba(3, 24, 38, .7); }
.skin-card .name { margin: 8px 0 2px; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.skin-card .price { font-size: 11px; display: flex; align-items: center; justify-content: center; gap: 2px; color: var(--ink-soft); }
.skin-card .price .ic { font-size: 14px; }
.skin-card.owned .price { color: var(--mint); }
.skin-card.equipped {
  border-color: rgba(255, 208, 90, .92);
  box-shadow: 0 0 0 1px rgba(255, 208, 90, .28), 0 12px 26px rgba(255, 186, 60, .14);
}
.skin-card.equipped::after {
  content: 'EQUIPPED';
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 6px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .1em;
  color: #291300;
  background: linear-gradient(135deg, #ffe9a0, #ffbe3d);
  border-radius: 99px;
}
.skin-card .price.cant { color: #ff9a8e; }

/* selection feedback: gentle glow pulse ring on the chosen card */
.level-card.selected, .ride-card.selected, .skin-card.equipped {
  animation: selPulse 2.4s ease-in-out infinite;
}
@keyframes selPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 208, 90, .32), 0 14px 34px rgba(255, 186, 60, .16); }
  50% { box-shadow: 0 0 0 1px rgba(255, 208, 90, .52), 0 14px 40px rgba(255, 186, 60, .3); }
}

/* light sweep across cards on hover for that premium feel */
.level-card:not(.selected)::before, .ride-card::before, .skin-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.09) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .55s ease;
  pointer-events: none;
  z-index: 4;
}
.level-card:not(.selected):hover::before, .ride-card:hover::before, .skin-card:hover::before { transform: translateX(130%); }

/* skill bars get a running shine */
.stat-track i { position: relative; overflow: hidden; }
.stat-track i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.5) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: statShine 3.4s ease-in-out infinite;
}
@keyframes statShine { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }

/* records */
.record-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.record-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(13, 67, 93, .62), rgba(3, 31, 48, .78));
  border: 1px solid var(--stroke);
}
.record-stat span { font-size: 8.5px; font-weight: 800; letter-spacing: .18em; color: var(--muted); }
.record-stat b { font-family: var(--display); font-size: 32px; line-height: 1; color: var(--sun); font-weight: 400; letter-spacing: .04em; }
.records-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
  background: rgba(3, 30, 48, .7);
  border: 1px solid var(--stroke);
  border-radius: 18px;
}
.record-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.record-row:last-child { border-bottom: 0; }
.record-row .rk {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 18px;
  color: var(--sun);
  background: rgba(255, 208, 90, .1);
  border: 1px solid rgba(255, 208, 90, .18);
  border-radius: 8px;
  flex: 0 0 auto;
}
.record-row:nth-child(1) .rk { background: linear-gradient(135deg, #ffe9a0, #ffbe3d); color: #2a1200; border-color: transparent; }
.record-row .rs { font-weight: 800; letter-spacing: .04em; font-size: 15px; }
.record-row .rm { margin-left: auto; font-size: 10.5px; line-height: 1.45; opacity: .58; text-align: right; }
.record-row.empty { justify-content: center; opacity: .55; font-size: 13px; padding: 26px 8px; }

/* help */
.help-goal {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 15px;
  background: linear-gradient(100deg, rgba(255, 190, 60, .11), rgba(35, 214, 207, .06));
  border: 1px solid rgba(255, 208, 90, .18);
}
.help-goal .ic { font-size: 21px; color: var(--sun); margin-top: 2px; }
.help-goal p { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.help-goal b { color: #fff; }
.help-section-title { font-size: 9.5px; font-weight: 800; letter-spacing: .26em; color: var(--muted); margin-top: 6px; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.help-card {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 13px;
  background: rgba(5, 39, 59, .55);
  border: 1px solid var(--stroke);
}
.help-kbd { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.help-kbd span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 900;
  color: #cfeeff;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.24);
  border-bottom-width: 3px;
  border-radius: 6px;
}
.help-card b { display: block; font-size: 11px; letter-spacing: .08em; }
.help-card p { margin-top: 2px; font-size: 10.5px; line-height: 1.4; color: var(--ink-soft); opacity: .68; }
.help-steps { display: flex; flex-direction: column; gap: 7px; }
.help-step {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(5, 39, 59, .5);
  border: 1px solid var(--stroke);
}
.help-step > span { font-family: var(--display); font-size: 26px; line-height: 1; color: var(--teal); opacity: .8; flex: 0 0 34px; }
.help-step b { display: block; font-size: 11px; letter-spacing: .08em; }
.help-step p { margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--ink-soft); opacity: .7; }
.help-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.help-note-card {
  padding: 12px;
  border-radius: 13px;
  background: rgba(5, 39, 59, .55);
  border: 1px solid var(--stroke);
}
.help-note-card .ic { font-size: 18px; color: var(--teal); }
.help-note-card p { margin-top: 7px; font-size: 10.5px; line-height: 1.45; color: var(--ink-soft); opacity: .72; }
.help-note-card b { color: #fff; }
.help-note.small { font-size: 10.5px; line-height: 1.5; opacity: .55; text-align: center; }
.help-note.small b { color: #fff; }

/* settings */
.settings-list { display: flex; flex-direction: column; gap: 8px; }
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  font-family: var(--body);
  color: var(--ink);
  text-align: left;
  background: rgba(5, 39, 59, .55);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.setting-row:hover { background: rgba(13, 62, 88, .7); border-color: var(--stroke-strong); }
.setting-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(126, 244, 238, .09);
  color: #8eeae9;
  flex: 0 0 auto;
}
.setting-icon .ic { font-size: 19px; }
.setting-copy { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.setting-copy b { font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.setting-copy small { font-size: 10.5px; color: var(--ink-soft); opacity: .55; }
.switch {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: rgba(0, 10, 18, .55);
  border: 1px solid rgba(157, 226, 250, .2);
  padding: 2px;
  flex: 0 0 auto;
  transition: background .2s ease, border-color .2s ease;
}
.switch i {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #7696a8;
  transition: transform .2s cubic-bezier(.2,.9,.25,1), background .2s ease;
}
.setting-row[aria-checked="true"] .switch { background: rgba(35, 214, 207, .35); border-color: rgba(126, 244, 238, .55); }
.setting-row[aria-checked="true"] .switch i { transform: translateX(18px); background: #b7fff8; box-shadow: 0 0 10px rgba(126, 244, 238, .65); }
.settings-credit {
  margin-top: 10px;
  padding: 18px;
  text-align: center;
  border-radius: 16px;
  background: rgba(3, 28, 45, .55);
  border: 1px solid var(--stroke);
}
.settings-credit-mark { font-family: var(--display); font-size: 34px; line-height: .8; letter-spacing: .06em; }
.settings-credit-mark span { display: inline-block; color: var(--teal); margin-left: .08em; }
.settings-credit p { margin-top: 10px; font-size: 11px; color: var(--ink-soft); opacity: .7; }
.settings-credit p.dim { margin-top: 4px; font-size: 9.5px; opacity: .45; }
.settings-credit b { color: var(--sun); }

/* ==========================================================================
   Modals / prompt / results
   ========================================================================== */
.modal-card {
  position: relative;
  width: min(560px, 94vw);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: clamp(20px, 3.4vw, 34px);
  text-align: center;
  background: linear-gradient(180deg, rgba(8, 48, 70, .96), rgba(2, 22, 37, .98));
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.1);
  animation: modalIn .32s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-eyebrow {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .32em;
  color: var(--ink-soft);
  opacity: .55;
  margin-bottom: 7px;
}
.modal-card .subtitle { margin-bottom: 10px; }
.prompt-copy { max-width: 420px; margin: 0 auto 18px; font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
.prompt-copy b { color: #fff; }
.prompt-foot { margin-top: 14px; font-size: 10px; opacity: .45; }

.tutorial-prompt-card { text-align: center; }
.prompt-art {
  position: relative;
  height: 92px;
  margin: -4px 0 12px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(19, 120, 145, .2), rgba(2, 22, 37, .1));
  border: 1px solid var(--stroke);
}
.prompt-wave {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -42px;
  height: 84px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, rgba(45, 200, 200, .45), rgba(7, 82, 108, .65));
  box-shadow: 0 -2px 0 rgba(213, 255, 255, .5);
  animation: promptWave 4s ease-in-out infinite;
}
@keyframes promptWave { 0%,100% { transform: translateX(-2%) scaleY(1); } 50% { transform: translateX(2%) scaleY(1.08); } }
.prompt-board {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 66px;
  height: 66px;
  color: #ffd05a;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.35));
  transform: translateX(-50%) rotate(-8deg);
  animation: promptBoard 3s ease-in-out infinite;
}
@keyframes promptBoard { 0%,100% { transform: translateX(-50%) rotate(-8deg) translateY(0); } 50% { transform: translateX(-50%) rotate(-2deg) translateY(-5px); } }
.prompt-points { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.prompt-points span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--ink-soft);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  border-radius: 99px;
}
.prompt-points .ic { font-size: 14px; color: var(--teal); }
.tutorial-done-card .done-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #2a1200;
  background: radial-gradient(circle at 35% 28%, #fff7c2, #ffca4a 55%, #e28a10);
  box-shadow: 0 0 0 8px rgba(255, 208, 90, .1), 0 16px 34px rgba(255, 180, 40, .25);
  animation: donePop .6s cubic-bezier(.2,1.3,.3,1) both;
  position: relative;
  z-index: 2;
}
.tutorial-done-card > *:not(#tut-fx) { position: relative; z-index: 1; }
.tutorial-done-card .done-badge .ic { font-size: 38px; }
@keyframes donePop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 auto 18px;
  width: fit-content;
  padding: 9px 16px;
  border-radius: 99px;
  background: rgba(255, 208, 90, .1);
  border: 1px solid rgba(255, 208, 90, .28);
  color: var(--sun);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.done-reward b { font-size: 18px; color: #fff; }
.done-reward .done-tag { margin-left: 4px; color: var(--muted); font-size: 8px; letter-spacing: .14em; }

/* result screen */
#menu-over { padding: 16px; }
.result-card {
  width: min(980px, 96vw);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: clamp(16px, 2.2vw, 26px);
  background: linear-gradient(180deg, rgba(8, 47, 69, .97), rgba(2, 20, 34, .98));
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.1);
  animation: modalIn .34s cubic-bezier(.2,.9,.25,1) both;
}
.result-head { display: flex; align-items: center; gap: 16px; position: relative; }
.result-head-copy { position: relative; z-index: 1; }
.rank-badge { z-index: 1; }
.rank-badge {
  width: 86px;
  height: 86px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 15px;
  border-radius: 50%;
  font-family: var(--display);
  color: #2a1200;
  background: radial-gradient(circle at 35% 28%, #fff7c2, #ffca4a 55%, #e28a10);
  box-shadow: 0 0 0 7px rgba(255, 208, 90, .1), 0 12px 28px rgba(0,0,0,.3);
  flex: 0 0 auto;
  position: relative;
}
.rank-badge span { font-size: 46px; line-height: .8; }
.rank-badge i { font-family: var(--body); font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: .06em; margin-left: 1px; }
.rank-badge.silver { background: radial-gradient(circle at 35% 28%, #f4fbff, #c6d6e2 55%, #7f96a8); }
.rank-badge.bronze { background: radial-gradient(circle at 35% 28%, #ffe4c4, #dd9a5c 55%, #9a5524); }
.rank-badge.dnf { background: radial-gradient(circle at 35% 28%, #ffd8d2, #ff7a6a 55%, #a3281e); }
.rank-badge.dnf span { font-size: 24px; }
.result-head-copy { min-width: 0; flex: 1; }
.over-level {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .2em;
  color: var(--sun);
  text-transform: uppercase;
  opacity: .9;
  margin-bottom: 3px;
}
.result-head .subtitle { font-size: clamp(38px, 5vw, 58px); margin-bottom: 4px; }
.over-tip { max-width: 620px; font-size: 11.5px; line-height: 1.45; color: var(--ink-soft); opacity: .68; }
.result-fx { position: absolute; inset: -20px -10px; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti-piece {
  position: absolute;
  top: -10px;
  width: 7px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall 1.6s ease-in forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
  100% { opacity: 0; transform: translate3d(var(--dx, 20px), 150px, 0) rotate(var(--rot, 300deg)); }
}
.result-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 14px; }
.result-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.over-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px;
  background: rgba(3, 31, 49, .74);
  border: 1px solid var(--stroke);
  border-radius: 15px;
}
.over-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-soft);
  padding: 2px 0;
}
.over-row > span:first-child { flex: 1; }
.over-row b { font-family: var(--display); font-size: 24px; line-height: 1; color: var(--sun); font-weight: 400; letter-spacing: .03em; }
.over-row.coins-line { margin-top: 3px; padding-top: 7px; border-top: 1px solid rgba(157,226,250,.1); }
.over-row.coins-line > .coin-icon { flex: 0 0 auto; width: 18px; height: 18px; margin-right: 2px; }
.over-row.coins-line > b { margin-left: 1px; }
.over-row.coins-line > .dim { margin-left: 4px; }
.over-row .dim { font-size: 9.5px; opacity: .45; }
.over-row .new-tag {
  color: #2a1200;
  background: var(--sun);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .35; } }

.over-objectives, .over-leaderboard, .over-standings {
  width: 100%;
  background: rgba(3, 31, 49, .72);
  border: 1px solid var(--stroke);
  border-radius: 15px;
  padding: 11px 14px;
}
.over-standings { border-color: rgba(255, 208, 90, .22); }
.ov-title { font-size: 8.5px; font-weight: 800; letter-spacing: .2em; opacity: .55; margin-bottom: 7px; }
.stand-row { display: flex; align-items: center; gap: 9px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.stand-row:last-child { border-bottom: 0; }
.stand-row .st-rank { width: 16px; opacity: .5; font-weight: 900; }
.stand-row .st-name { flex: 1; font-weight: 800; letter-spacing: .05em; }
.stand-row .st-flips { font-weight: 900; color: var(--sun); }
.stand-row .st-flips i { font-style: normal; font-size: 8.5px; opacity: .55; font-weight: 600; }
.stand-row.you { color: var(--sun); }
.stand-row.you .st-name { color: var(--sun); }
.obj-line { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; padding: 3px 0; color: var(--ink-soft); }
.obj-line .tick { color: var(--mint); font-weight: 900; }
.obj-line.miss { opacity: .45; }
.obj-line .obj-coins { color: var(--sun); font-size: 10px; }
.lb-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; padding: 3px 0; opacity: .72; }
.lb-row.you { color: var(--sun); opacity: 1; font-weight: 800; }
.lb-row .lb-meta { font-size: 9.5px; opacity: .6; text-align: right; }
.result-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.result-actions .btn { flex: 1 1 170px; min-width: 150px; }
.result-credit {
  margin-top: 11px;
  text-align: center;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .2em;
  color: rgba(183,221,236,.38);
}
.result-credit b { color: rgba(255, 208, 90, .72); }

.pause-card { width: min(450px, 94vw); }
.pause-meta {
  display: grid;
  grid-template-columns: 1.4fr .7fr .9fr;
  gap: 6px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(3, 31, 49, .7);
  border: 1px solid var(--stroke);
}
.pause-meta div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pause-meta span { font-size: 7.5px; font-weight: 800; letter-spacing: .16em; color: var(--muted); }
.pause-meta b { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pause-card .menu-buttons { gap: 8px; }
.pause-card .btn { width: 100%; }
.pause-card .menu-row .btn { flex: 1; }
.pause-tip {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255,255,255,.07);
  text-align: left;
}
.pause-tip b { color: var(--sun); letter-spacing: .1em; margin-right: 4px; }

/* confirm */
.confirm-card { width: min(440px, 92vw); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { flex: 1; min-width: 0; }

/* toasts */
#toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 340px;
  padding: 11px 14px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(9, 55, 78, .97), rgba(2, 25, 41, .98));
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 14px 34px rgba(0,0,0,.32);
  animation: toastIn .28s cubic-bezier(.2,.9,.25,1) both;
  overflow: hidden;
}
.toast.out { animation: toastOut .26s ease forwards; }
.toast .t-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(126, 244, 238, .1);
  color: var(--teal);
  flex: 0 0 auto;
}
.toast.gold .t-ic { background: rgba(255, 208, 90, .12); color: var(--sun); }
.toast.bad .t-ic { background: rgba(255, 106, 94, .12); color: var(--coral); }
.toast-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.toast-copy b { font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.toast-copy small { font-size: 10px; color: var(--ink-soft); opacity: .6; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   Tutorial HUD
   ========================================================================== */
#tutorial-hud {
  position: absolute;
  top: 112px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: min(540px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  animation: tutIn .35s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes tutIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tut-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tut-badge {
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--sun);
  background: rgba(4, 30, 48, .7);
  border: 1px solid rgba(255, 208, 90, .25);
  text-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.tut-skip {
  pointer-events: auto;
  padding: 5px 10px;
  border-radius: 99px;
  font-family: var(--body);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--ink-soft);
  background: rgba(4, 30, 48, .62);
  border: 1px solid var(--stroke);
  cursor: pointer;
}
.tut-skip:hover { color: #fff; border-color: var(--stroke-strong); }
.tut-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(8, 49, 70, .94), rgba(2, 24, 40, .96));
  border: 1px solid rgba(126, 244, 238, .3);
  box-shadow: 0 18px 40px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.1);
  animation: tutCard .3s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes tutCard { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.tut-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(126, 244, 238, .1);
  color: #8afff7;
  flex: 0 0 auto;
}
.tut-icon .ic { font-size: 24px; }
.tut-copy { flex: 1; min-width: 0; }
.tut-copy h3 {
  font-family: var(--display);
  font-size: 25px;
  line-height: .95;
  letter-spacing: .06em;
  font-weight: 400;
  color: #fff;
}
.tut-copy p { margin-top: 4px; font-size: 11.5px; line-height: 1.45; color: var(--ink-soft); }
.tut-copy p b { color: var(--sun); }
.tut-keys { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tut-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .06em;
  color: #d9f8ff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-bottom-width: 3px;
}
.tut-key.hot {
  color: #2a1200;
  background: linear-gradient(135deg, #ffe9a0, #ffbe3d);
  border-color: rgba(255,255,255,.6);
  animation: keyPulse 1s ease-in-out infinite;
}
@keyframes keyPulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.tut-bar {
  margin-top: 9px;
  height: 5px;
  border-radius: 99px;
  background: rgba(0,0,0,.35);
  overflow: hidden;
}
.tut-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #23d6cf, #ffd05a);
  box-shadow: 0 0 10px rgba(255, 208, 90, .4);
  transition: width .15s ease;
}
.tut-dots { display: flex; align-items: center; justify-content: center; gap: 6px; }
.tut-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.16);
  transition: all .25s ease;
}
.tut-dots i.on { width: 24px; border-radius: 99px; background: var(--sun); border-color: rgba(255,255,255,.5); box-shadow: 0 0 12px rgba(255,208,90,.6); }
.tut-dots i.done { background: rgba(126, 244, 238, .72); border-color: rgba(126,244,238,.6); }
.tut-toast {
  align-self: center;
  margin-top: 1px;
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  color: #2a1200;
  background: linear-gradient(135deg, #b7ffd8, #5ef2a8);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
}
.tut-toast.show { opacity: 1; transform: none; }

body.tutorial-mode #hud-objectives,
body.tutorial-mode #hud-powerups,
body.tutorial-mode #hud-race,
body.tutorial-mode #hud-race-board,
body.tutorial-mode #hud-set,
body.tutorial-mode #hud-hint { display: none !important; }
body.tutorial-mode #hud-topleft { opacity: .82; }

/* ==========================================================================
   HUD in play
   ========================================================================== */
#hud { pointer-events: none; z-index: 3; }
#hud:not(.hidden) { animation: hudIn .35s ease both; }
@keyframes hudIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
#hud button { pointer-events: auto; }
#hud-topleft {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  min-width: 226px;
  max-width: 280px;
  padding: 11px 14px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(4, 34, 52, .78), rgba(2, 20, 34, .56));
  border: 1px solid rgba(157, 226, 250, .13);
  box-shadow: 0 10px 26px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter: blur(9px);
}
#hud-level {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--sun);
  text-shadow: 0 2px 4px rgba(0,0,0,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-meta-row { display: flex; align-items: center; gap: 12px; margin-top: 3px; }
#hud-best, #hud-coins {
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 11.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  gap: 2px;
}
#hud-coins { color: var(--sun); }
#hud-coins .coin-icon { font-size: 12px; }
#hud-objectives {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(157, 226, 250, .1);
  max-width: 250px;
}
.obj-row { display: flex; flex-direction: column; gap: 3px; opacity: .8; transition: opacity .2s, color .2s; }
.obj-top { display: flex; align-items: center; gap: 6px; }
.obj-row .obj-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(255,255,255,.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  color: #062a1c;
}
.obj-row .obj-t { font-size: 10px; font-weight: 700; letter-spacing: .01em; text-shadow: 0 2px 4px rgba(0,0,0,.55); }
.obj-row .obj-prog { margin-left: auto; font-size: 9px; opacity: .55; font-weight: 800; white-space: nowrap; }
.obj-row .obj-bar { height: 4px; border-radius: 99px; background: rgba(0,0,0,.48); overflow: hidden; }
.obj-row .obj-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #23d6cf, #ffd05a); opacity: .9; }
.obj-row.done { opacity: 1; color: var(--mint); }
.obj-row.done .obj-box { background: var(--mint); border-color: #d5ffe9; }
.obj-row.done .obj-bar i { background: var(--mint); }
#hud-powerups { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.pu-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--pc, #fff);
  text-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.pu-chip b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1;
}
.pu-chip i { font-style: normal; opacity: .5; font-size: 8.5px; }

#hud-score-wrap {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  min-width: 188px;
  padding: 6px 22px 7px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(3, 30, 48, .68), rgba(2, 20, 34, .46));
  border: 1px solid rgba(157, 226, 250, .14);
  box-shadow: 0 10px 26px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(9px);
}
#hud-score-label {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .26em;
  color: var(--ink-soft);
  opacity: .62;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
#hud-score {
  font-family: var(--display);
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: .86;
  font-weight: 400;
  letter-spacing: .05em;
  text-shadow: 0 3px 0 rgba(0,0,0,.28), 0 8px 22px rgba(0,0,0,.32);
  transition: transform .1s;
}
#hud-score.pop { transform: scale(1.16); }
#hud-points {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  opacity: .6;
  margin-top: 1px;
  text-shadow: 0 2px 5px rgba(0,0,0,.55);
}
#hud-combo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  font-weight: 900;
  color: var(--sun);
  letter-spacing: .1em;
  font-size: 14px;
  text-shadow: 0 2px 6px rgba(0,0,0,.55);
  animation: comboGrow .25s ease;
}
@keyframes comboGrow { from { transform: scale(1.45); } to { transform: scale(1); } }
#hud-combo-bar {
  width: 94px;
  height: 4px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(0,0,0,.4);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
#hud-combo-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffd24a, #ff7a3c);
}
#hud-topright { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); display: flex; gap: 8px; }
#hud-topright .icon-btn { width: 42px; height: 42px; border-radius: 12px; background: rgba(3, 28, 45, .55); }
#hud-topright .icon-btn .ic { font-size: 20px; }

#hud-race {
  position: absolute;
  top: 122px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 52vw);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 6px 11px 7px;
  border-radius: 11px;
  background: rgba(2, 20, 34, .46);
  border: 1px solid rgba(157, 226, 250, .12);
  backdrop-filter: blur(6px);
}
#hud-race-line {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .12em;
  text-shadow: 0 2px 5px rgba(0,0,0,.6);
}
#hud-race-pos { color: var(--sun); }
#hud-race-dist { opacity: .72; }
#hud-race-bar {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(0,0,0,.44);
  border: 1px solid rgba(255,255,255,.2);
}
#hud-race-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7ef4ee, #ffd24a);
  border-radius: 5px;
  box-shadow: 0 0 9px rgba(126, 244, 238, .4);
}

#hud-race-board {
  position: absolute;
  top: calc(66px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  padding: 8px 10px;
  background: rgba(2, 20, 34, .5);
  border: 1px solid rgba(157, 226, 250, .13);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: 0 2px 4px rgba(0,0,0,.55);
  backdrop-filter: blur(7px);
}
.race-row { display: flex; align-items: center; gap: 6px; opacity: .78; padding: 1px 0; }
.race-row .rr-rank { width: 11px; opacity: .45; font-size: 8.5px; font-weight: 900; }
.race-row .rr-name { flex: 1; }
.race-row .rr-flips { color: var(--sun); font-weight: 900; }
.race-row.you { opacity: 1; color: #fff; }
.race-row.you .rr-name { color: #fff; }
.race-row.dnf { opacity: .4; }
.race-row.dnf .rr-name { color: #ff8d7e !important; text-decoration: line-through; }
.race-row.dnf .rr-flips { color: #ff8d7e; }

#hud-event {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  color: var(--ec, #ff6a5e);
  background: rgba(2, 20, 34, .8);
  border: 1px solid var(--ec, #ff6a5e);
  border-radius: 99px;
  padding: 6px 16px;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0,0,0,.55);
  box-shadow: 0 0 22px rgba(2, 22, 38, .35);
  animation: eventPulse .5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes eventPulse {
  from { transform: translateX(-50%) scale(1); opacity: .82; }
  to { transform: translateX(-50%) scale(1.04); opacity: 1; }
}
#hud-set {
  position: absolute;
  top: 198px;
  right: 16px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--sun);
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  padding: 6px 13px;
  border-radius: 99px;
  background: rgba(2, 20, 34, .62);
  border: 1px solid rgba(255, 210, 74, .35);
  animation: setPulse 1s ease-in-out infinite;
}
#hud-set b { font-size: 14px; margin-left: 2px; }
@keyframes setPulse { 0%,100% { opacity: .78; } 50% { opacity: 1; transform: translateX(3px); } }

#hud-special {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#hud-special-label {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .22em;
  text-shadow: 0 2px 4px rgba(0,0,0,.55);
}
#hud-special-bar {
  width: 210px;
  height: 10px;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#hud-special-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffd24a, #ff7a3c);
  border-radius: 7px;
  box-shadow: 0 0 10px rgba(255, 170, 60, .45);
}
#hud-hint {
  position: absolute;
  bottom: calc(54px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: .08em;
  opacity: .62;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,.55);
  transition: opacity 1s;
  white-space: nowrap;
}

/* coach */
#coach {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: auto;
  cursor: pointer;
  text-align: center;
  background: linear-gradient(180deg, rgba(6, 42, 62, .95), rgba(2, 21, 35, .96));
  border: 1px solid rgba(126, 244, 238, .34);
  border-radius: 14px;
  padding: 10px 22px 8px;
  box-shadow: 0 10px 26px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08);
  animation: coachIn .3s ease;
  max-width: min(92vw, 560px);
}
@keyframes coachIn { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
#coach-text {
  font-weight: 900;
  letter-spacing: .12em;
  font-size: clamp(12px, 2.2vw, 16px);
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
}
#coach-sub { font-size: 8.5px; letter-spacing: .16em; opacity: .45; margin-top: 3px; text-transform: uppercase; }
#coach.pulse { border-color: var(--sun); box-shadow: 0 0 22px rgba(255,190,60,.4); }

/* touch controls */
#touch-controls { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
#touch-controls:not(.hidden) { animation: hudIn .4s .08s ease both; }
.tc-btn {
  position: absolute;
  pointer-events: auto;
  font-family: var(--body);
  font-weight: 900;
  letter-spacing: .06em;
  color: rgba(255,255,255,.92);
  background: rgba(3, 35, 55, .4);
  border: 1.5px solid rgba(180, 240, 255, .32);
  border-radius: 18px;
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  transition: background .08s, transform .08s, border-color .08s;
}
.tc-btn.on {
  background: rgba(255, 176, 58, .62);
  border-color: rgba(255, 255, 255, .85);
  transform: scale(.96);
  color: #2b1000;
}
.tc-big {
  left: calc(14px + env(safe-area-inset-left, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 122px;
  height: 122px;
  border-radius: 50%;
  font-size: 16px;
}
.tc-small { font-size: 11px; padding: 0 14px; height: 44px; border-radius: 22px; }
#tc-brake {
  left: calc(26px + env(safe-area-inset-left, 0px));
  bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  width: 100px;
}
.tc-flip { width: 84px; height: 84px; border-radius: 50%; font-size: 32px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
#tc-back { right: calc(118px + env(safe-area-inset-right, 0px)); }
#tc-fwd  { right: calc(20px + env(safe-area-inset-right, 0px)); }
.tc-jump {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 112px;
  height: 112px;
  border-radius: 50%;
  font-size: 17px;
  background: rgba(255, 176, 58, .24);
  border-color: rgba(255, 224, 130, .55);
  color: #fff;
}
.tc-jump.on { transform: translateX(-50%) scale(.95); background: rgba(255, 176, 58, .7); border-color: #fff; color: #2b1000; }
#tc-special {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  width: 128px;
  color: var(--sun);
  border-color: rgba(255, 210, 74, .45);
}
#tc-special.on { transform: translateX(-50%) scale(.96); color: #2b1000; }
#tc-special.ready { border-color: #ffd24a; box-shadow: 0 0 20px rgba(255,190,60,.45); color: #fff; }
body:not(.touch) #touch-controls { display: none !important; }
body.touch #hud-special { display: none; }
body.touch #hud-hint { display: none; }
/* keep the coach line above the on-screen buttons so they never collide */
body.touch #coach { bottom: calc(196px + env(safe-area-inset-bottom, 0px)); }

/* rotate hint */
#rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 90;
  background:
    radial-gradient(700px 500px at 50% 30%, rgba(25, 140, 160, .22), transparent 65%),
    linear-gradient(180deg, #04233a, #021a2c);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.rotate-body { text-align: center; max-width: 320px; }
.rotate-icon { font-size: 64px; animation: spinHint 3s ease-in-out infinite; color: var(--teal); }
@keyframes spinHint { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
.rotate-body h3 { font-family: var(--display); font-size: 30px; letter-spacing: .08em; margin: 10px 0 6px; }
.rotate-body p { opacity: .62; font-size: 13px; margin-bottom: 18px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1020px) {
  .menu-screen {
    padding:
      calc(22px + env(safe-area-inset-top, 0px))
      calc(22px + env(safe-area-inset-right, 0px))
      calc(54px + env(safe-area-inset-bottom, 0px))
      calc(22px + env(safe-area-inset-left, 0px));
    overflow-y: auto;
  }
  .menu-shell { flex-direction: column; justify-content: center; gap: 22px; max-width: 560px; }
  .menu-hero { text-align: center; width: 100%; }
  .menu-eyebrow { justify-content: center; }
  .title { font-size: clamp(74px, 17vw, 128px); }
  .tagline { margin-left: auto; margin-right: auto; }
  .menu-chips { justify-content: center; }
  .menu-session { margin-left: auto; margin-right: auto; }
  .menu-panel { flex-basis: auto; }
  .menu-footer { position: static; margin-top: 4px; }
  .help-notes { grid-template-columns: 1fr; }
  .result-body { grid-template-columns: 1fr; }
  .result-head .subtitle { font-size: 42px; }
}

@media (max-width: 720px) {
  .overlay { gap: 12px; padding-left: 12px; padding-right: 12px; }
  .menu-screen {
    padding:
      calc(14px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      calc(42px + env(safe-area-inset-bottom, 0px))
      calc(14px + env(safe-area-inset-left, 0px));
  }
  .menu-shell { gap: 14px; }
  .title { font-size: clamp(64px, 19vw, 100px); }
  .title-bottom { letter-spacing: .1em; }
  .tagline { margin-top: 16px; font-size: 13px; }
  .menu-session { margin-top: 16px; padding: 9px 12px; gap: 12px; }
  .session-value { font-size: 12.5px; }
  .menu-panel { padding: 12px; border-radius: 20px; }
  .btn-hero { min-height: 66px; }
  .btn-copy b { font-size: 26px; }
  .btn-tile { min-height: 56px; padding: 7px 9px; }
  .btn-tile .btn-ic { width: 30px; height: 30px; }
  .btn-tile .btn-copy b { font-size: 11px; }
  .btn-tile .btn-copy small { display: none; }
  .btn-ghost { min-height: 42px; }
  .menu-footer { font-size: 8px; letter-spacing: .12em; gap: 6px; }
  .sub-screen { padding-top: 12px; padding-bottom: 12px; }
  .sub-shell { gap: 12px; }
  .sub-head { gap: 9px; }
  .sub-head .subtitle { font-size: 34px; }
  .sub-eyebrow { font-size: 8px; letter-spacing: .18em; }
  .sub-balance { padding: 6px 10px; font-size: 11px; }
  .level-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .level-card { padding: 7px; }
  .level-card canvas { height: 68px; }
  .level-card h3 { font-size: 11px; }
  .level-card .level-tag { display: none; }
  .level-card .level-best { font-size: 8.5px; }
  .ride-cards { grid-template-columns: 1fr; gap: 9px; }
  .ride-card { padding: 11px; }
  .ride-card canvas { height: 86px; margin-bottom: 7px; }
  .ride-card h3 { font-size: 23px; }
  .ride-card .desc { min-height: 0; font-size: 10.5px; }
  .ride-card .streak { margin-top: 8px; }
  .help-grid { grid-template-columns: 1fr; }
  .record-summary { gap: 6px; }
  .record-stat b { font-size: 25px; }
  .modal-card { padding: 18px 14px; }
  .result-card { padding: 13px; }
  .result-head { gap: 10px; align-items: flex-start; }
  .rank-badge { width: 64px; height: 64px; padding-top: 12px; }
  .rank-badge span { font-size: 34px; }
  .result-head .subtitle { font-size: 34px; }
  .over-tip { font-size: 10px; }
  .result-actions .btn { flex-basis: 46%; min-width: 0; padding: 9px 10px; font-size: 10px; }
  .result-actions .btn .ic { font-size: 16px; }
  .over-row b { font-size: 20px; }
  .pause-meta { grid-template-columns: 1fr 1fr; }
  .pause-meta div:first-child { grid-column: 1 / -1; }
  #toasts { left: 10px; right: 10px; bottom: 10px; }
  .toast { min-width: 0; max-width: none; }
}

/* short landscape phones: compact two-column menu */
@media (max-height: 540px) {
  .overlay.menu-screen {
    justify-content: flex-start;
    overflow-y: auto;
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      calc(28px + env(safe-area-inset-bottom, 0px))
      calc(14px + env(safe-area-inset-left, 0px));
  }
  .menu-shell {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    margin: auto;
  }
  .menu-hero { text-align: left; flex: 1 1 auto; }
  .menu-eyebrow { margin-bottom: 10px; font-size: 8px; letter-spacing: .24em; justify-content: flex-start; }
  .title { font-size: clamp(52px, 9vw, 78px); letter-spacing: .03em; }
  .title-bottom { font-size: .72em; letter-spacing: .08em; }
  .tagline { display: none; }
  .menu-chips { margin-top: 8px; gap: 5px; justify-content: flex-start; }
  .menu-daily, .menu-level { font-size: 8px; padding: 4px 8px; letter-spacing: .1em; }
  .menu-session { display: none; }
  .menu-panel { flex: 0 0 360px; width: 360px; padding: 10px; border-radius: 18px; }
  .menu-panel-head { display: none; }
  .btn-hero { min-height: 52px; padding: 7px 10px; border-radius: 14px; }
  .btn-hero .btn-ic { width: 36px; height: 36px; border-radius: 10px; }
  .btn-copy b { font-size: 23px; }
  .btn-copy small { font-size: 8.5px; }
  .menu-grid { gap: 5px; margin-top: 5px; }
  .btn-tile { min-height: 43px; padding: 5px 8px; border-radius: 10px; }
  .btn-tile .btn-ic { width: 25px; height: 25px; border-radius: 7px; }
  .btn-tile .btn-ic .ic { font-size: 15px; }
  .btn-tile .btn-copy b { font-size: 10px; }
  .btn-tile .btn-copy small { display: none; }
  .menu-secondary { gap: 4px; margin-top: 5px; padding-top: 5px; }
  .btn-ghost { min-height: 32px; padding: 3px 8px; border-radius: 9px; }
  .btn-ghost .btn-ic { width: 18px; }
  .btn-ghost .btn-ic .ic { font-size: 14px; }
  .btn-ghost .btn-copy b { font-size: 9.5px; }
  .btn-ghost .btn-copy small { display: none; }
  .btn-ghost .badge-new { top: 2px; right: 4px; font-size: 7px; padding: 2px 5px; }
  .menu-footer { position: static; margin-top: 4px; font-size: 7.5px; gap: 5px; }
}

@media (max-height: 540px) and (max-width: 700px) {
  .menu-hero { display: none; }
  .menu-shell { justify-content: center; }
  .menu-panel { flex-basis: 360px; }
}

/* short landscape touch HUD */
@media (max-height: 540px) {
  body.touch #hud-objectives,
  body.touch #hud-best,
  body.touch #hud-race-board { display: none !important; }
  body.touch #hud-topleft {
    top: calc(7px + env(safe-area-inset-top, 0px));
    left: calc(7px + env(safe-area-inset-left, 0px));
    min-width: 0;
    max-width: 170px;
    padding: 7px 10px 8px;
  }
  body.touch #hud-level { font-size: 8px; }
  body.touch .hud-meta-row { margin-top: 2px; }
  body.touch #hud-coins { font-size: 10px; }
  body.touch #hud-score-wrap { top: calc(5px + env(safe-area-inset-top, 0px)); min-width: 142px; padding: 4px 12px 5px; }
  body.touch #hud-score { font-size: 32px; }
  body.touch #hud-race { top: 80px; width: 42vw; }
  body.touch #hud-topright { top: calc(7px + env(safe-area-inset-top, 0px)); right: calc(7px + env(safe-area-inset-right, 0px)); }
  body.touch #hud-topright .icon-btn { width: 34px; height: 34px; }
  body.touch #coach {
    top: 112px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 70vw;
    padding: 7px 14px 5px;
  }
  body.touch #hud-event { top: 132px; }
  body.touch #hud-special { bottom: 8px; }
}

/* compact result, pause and onboarding cards on short screens */
@media (max-height: 540px) {
  .sub-screen { padding-top: 6px; padding-bottom: 6px; }
  .sub-shell { gap: 9px; }
  .sub-head {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 5px 0;
    background: linear-gradient(180deg, rgba(2, 24, 40, .96), rgba(2, 24, 40, .72) 70%, transparent);
  }
  .sub-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    padding: 7px 0 3px;
    background: linear-gradient(0deg, rgba(2, 24, 40, .96), rgba(2, 24, 40, .72) 70%, transparent);
  }
  .sub-actions .btn-primary { min-height: 40px; min-width: 220px; }
  .sub-actions .btn-primary .btn-copy b { font-size: 17px; }
  .level-cards { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
  .level-card { padding: 5px; }
  .level-card canvas { height: 58px; }
  .level-card h3 { font-size: 10px; margin-top: 5px; }
  .level-card .level-meta span { font-size: 7.5px; padding: 2px 5px; }
  .level-card .level-best { font-size: 8px; margin-top: 4px; padding-top: 4px; }
  .ride-cards { gap: 7px; }
  .ride-card { padding: 8px; }
  .ride-card canvas { height: 64px; }
  .ride-card h3 { font-size: 20px; }
  .ride-card .desc { display: none; }
  .ride-card .stat-lines { margin-top: 5px; gap: 3px; }
  .ride-card .streak { margin-top: 5px; font-size: 9px; padding: 4px 6px; }
  .skin-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
  .skin-card canvas { height: 54px; }
  .skin-card .name { font-size: 9px; margin: 5px 0 1px; }
  .skin-card .price { font-size: 9px; }

  #menu-over { padding: 6px; }
  .result-card { padding: 9px 12px; max-height: calc(100dvh - 12px); }
  .result-head { gap: 10px; align-items: center; }
  .rank-badge { width: 60px; height: 60px; padding-top: 10px; box-shadow: 0 0 0 5px rgba(255,208,90,.1), 0 8px 18px rgba(0,0,0,.3); }
  .rank-badge span { font-size: 31px; }
  .rank-badge i { font-size: 8px; }
  .result-head .subtitle { font-size: 32px; margin-bottom: 0; }
  .over-level { font-size: 8px; margin-bottom: 1px; }
  .over-tip { display: none; }
  .result-body { grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 0 7px; }
  .result-col { gap: 6px; }
  .over-stats { padding: 7px 10px; border-radius: 11px; }
  .over-row { font-size: 10px; padding: 0; gap: 6px; }
  .over-row b { font-size: 19px; }
  .over-row .dim { font-size: 8px; }
  .over-row .new-tag { font-size: 7px; padding: 0 4px; }
  .over-objectives, .over-leaderboard, .over-standings { padding: 7px 9px; border-radius: 11px; }
  .over-leaderboard { display: none !important; }
  .ov-title { font-size: 7.5px; margin-bottom: 4px; }
  .stand-row { font-size: 10px; padding: 2px 0; }
  .obj-line { font-size: 9.5px; padding: 1px 0; }
  .result-actions { flex-wrap: nowrap; gap: 5px; }
  .result-actions .btn { flex: 1 1 0; min-width: 0; min-height: 38px; padding: 4px 5px; font-size: 9px; letter-spacing: .02em; gap: 4px; border-radius: 10px; }
  .result-actions .btn .ic { font-size: 13px; }
  .result-credit { display: none; }
  .result-fx { display: none; }

  .pause-card { padding: 14px 18px; }
  .pause-card .subtitle { font-size: 36px; }
  .pause-meta { margin-bottom: 10px; padding: 7px 10px; }
  .pause-card .menu-buttons { gap: 6px; }
  .pause-card .btn { min-height: 40px; font-size: 12px; padding: 6px 10px; }
  .pause-card .btn-small { font-size: 10px; }
  .pause-tip { margin-top: 8px; font-size: 9.5px; padding: 7px 9px; }

  .tutorial-prompt-card, .tutorial-done-card, .confirm-card { padding: 14px 18px; }
  .prompt-art { height: 62px; margin-bottom: 8px; }
  .prompt-board { width: 46px; height: 46px; bottom: 10px; }
  .modal-eyebrow { font-size: 8px; margin-bottom: 4px; }
  .modal-card .subtitle { font-size: 34px; margin-bottom: 6px; }
  .prompt-copy { font-size: 11px; line-height: 1.45; margin-bottom: 10px; }
  .prompt-points { display: none; }
  .prompt-foot { display: none; }
  .modal-card .menu-buttons { gap: 6px; }
  .modal-card .btn { min-height: 40px; font-size: 12px; padding: 6px 12px; }
  .done-reward { margin-bottom: 10px; padding: 5px 12px; }
  .done-badge { width: 52px; height: 52px; margin-bottom: 6px; }
  .done-badge .ic { font-size: 28px; }
}
@media (max-height: 660px) and (min-width: 1021px) {
  .menu-screen { padding-top: 16px; padding-bottom: 42px; }
  .title { font-size: clamp(74px, 10vw, 130px); }
  .tagline { margin-top: 14px; font-size: 13px; }
  .menu-session { margin-top: 14px; padding: 9px 14px; }
  .menu-panel { padding: 13px; }
  .btn-hero { min-height: 64px; }
  .btn-copy b { font-size: 26px; }
  .menu-grid { margin-top: 8px; }
  .btn-tile { min-height: 54px; }
  .menu-secondary { margin-top: 8px; padding-top: 8px; }
  .btn-ghost { min-height: 39px; }
  .menu-footer { bottom: 10px; }
}

/* HUD responsive */
@media (max-width: 720px), (max-height: 520px) {
  #hud-topleft { min-width: 0; max-width: 190px; padding: 8px 10px 9px; top: 8px; left: 8px; }
  #hud-level { font-size: 8px; }
  #hud-best, #hud-coins { font-size: 9.5px; }
  #hud-objectives { max-width: 172px; }
  .obj-row .obj-t { font-size: 8.5px; }
  #hud-score-wrap { min-width: 150px; padding: 0 10px 4px; top: 6px; }
  #hud-score { font-size: 34px; }
  #hud-score-label { font-size: 7px; letter-spacing: .18em; }
  #hud-points { font-size: 8px; }
  #hud-combo { font-size: 11px; }
  #hud-combo-bar { width: 70px; }
  #hud-topright { top: 8px; right: 8px; gap: 6px; }
  #hud-topright .icon-btn { width: 36px; height: 36px; }
  #hud-race { top: 82px; width: 44vw; padding: 4px 8px 5px; }
  #hud-race-line { font-size: 8px; }
  #hud-race-board { top: 48px; right: 8px; min-width: 114px; padding: 5px 7px; font-size: 8.5px; }
  #hud-event { top: 132px; font-size: 9px; padding: 4px 10px; }
  #hud-set { top: 164px; right: 8px; font-size: 9px; padding: 4px 9px; }
  #hud-hint { display: none; }
  #hud-special { bottom: 10px; }
  #hud-special-bar { width: 160px; height: 8px; }
  #tutorial-hud { top: 80px; width: min(470px, 94vw); }
  .tut-card { padding: 10px 12px; }
  .tut-copy h3 { font-size: 21px; }
  .tut-copy p { font-size: 10px; }
  .tut-icon { width: 36px; height: 36px; }
  #coach { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); padding: 8px 16px 6px; }
}

@media (max-width: 560px) {
  #hud-objectives { display: none; }
  #hud-score-wrap { top: 4px; }
  #hud-score { font-size: 30px; }
  #hud-race { top: 74px; width: 46vw; }
  #hud-race-board { top: 42px; min-width: 100px; padding: 4px 6px; font-size: 8px; }
  #hud-topright .icon-btn { width: 32px; height: 32px; }
  #hud-topleft { max-width: 150px; }
  .tc-big { width: 104px; height: 104px; font-size: 14px; }
  #tc-brake { width: 92px; bottom: calc(128px + env(safe-area-inset-bottom, 0px)); }
  .tc-flip { width: 64px; height: 64px; font-size: 24px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  #tc-back { right: calc(80px + env(safe-area-inset-right, 0px)); }
  #tc-fwd { right: calc(8px + env(safe-area-inset-right, 0px)); }
  .tc-jump { width: 96px; height: 96px; font-size: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  #tc-special { width: 122px; bottom: calc(122px + env(safe-area-inset-bottom, 0px)); }
  body.touch #coach { bottom: calc(200px + env(safe-area-inset-bottom, 0px)); max-width: 44vw; }
  .tut-card { flex-direction: column; gap: 8px; }
  .tut-icon { width: 30px; height: 30px; }
  .tut-icon .ic { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
