/* Ring Racer: a full-screen neon racer and ring clicker. Colors from the KOJA palette */
:root {
  --cream: #fcf6ef;
  --header: #ffefe5;
  --ink: #322e2f;
  --ink-hover: #424f4f;
  --line: #ddd3c4;
  --announce: #98c2de;
  --blue: #98c2de; /* used by the game HUD (launch bar, glows) */
  --lilac: #ded8ff;
  --peach: #ffdfcc;
  --pink: #ffcfd5;
  --sky: #dbe9f4;
  --coral: #e37f5d;
  --purple: #beb3ff;
  --heading: "Libre Baskerville", Georgia, serif;
  --body: "Cabin", system-ui, sans-serif;
  --sub: "Poppins", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--cream); font-family: var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--heading); font-weight: 400; line-height: 1.18; margin: 0 0 .45em; letter-spacing: -.01em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font: 500 15px/1 var(--sub); padding: 15px 28px; border-radius: 100px;
  cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); transform: translateY(-2px); box-shadow: 0 6px 0 rgba(50,46,47,.12); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 11px 20px; font-size: 14px; }
.btn-lg { padding: 18px 28px; font-size: 16px; }

/* Ring Rush (game page): neon night in the KOJA palette */
.rr-band { background: var(--ink); color: var(--cream); }
.rr-band .section-head p:last-child { margin: 0; opacity: .9; }
.rr-neon { color: var(--purple); text-shadow: 0 0 10px var(--purple), 0 0 28px #ff6635; }
.rr-stage { position: relative; max-width: 1340px; margin: 0 auto; aspect-ratio: 16 / 9; max-height: 82vh; border: 1.5px solid var(--purple); border-radius: 18px; overflow: hidden; background: var(--ink); outline: none; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 0 36px rgba(190,179,255,.35); }
.rr-stage:focus-visible { box-shadow: 0 0 0 3px var(--purple), 0 0 36px rgba(190,179,255,.5); }
.rr-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rr-stage .rr-map { position: static; width: 150px; height: 120px; }
.rr-stage:fullscreen { max-width: none; max-height: none; aspect-ratio: auto; width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.rr-hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; z-index: 2; color: var(--cream); }
.rr-left { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rr-score { background: rgba(50,46,47,.8); border: 1px solid var(--purple); border-radius: 14px; padding: 8px 16px 10px; box-shadow: 0 0 16px rgba(190,179,255,.4); }
.rr-label { display: block; font: 600 11px/1.4 var(--sub); letter-spacing: .16em; text-transform: uppercase; color: var(--pink); }
.rr-score b { font: 600 clamp(22px, 3.4vw, 36px)/1 var(--sub); font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(190,179,255,.8); }
.rr-meter { display: flex; align-items: center; gap: 8px; font: 600 11px/1 var(--sub); letter-spacing: .12em; text-transform: uppercase; }
.rr-meter i { display: block; width: 110px; height: 8px; border-radius: 8px; background: rgba(252,246,239,.15); overflow: hidden; }
.rr-meter b { display: block; height: 100%; width: 100%; background: #ff6635; box-shadow: 0 0 10px #ff6635; }
.rr-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font: 500 14px/1 var(--sub); }
.rr-chip { background: rgba(50,46,47,.75); color: var(--cream); border: 1px solid rgba(190,179,255,.45); border-radius: 100px; padding: 7px 12px; font: 500 13px/1 var(--sub); font-variant-numeric: tabular-nums; }
.rr-chip[hidden] { display: none; }
button.rr-chip { cursor: pointer; pointer-events: auto; }
.rr-ai.on { background: var(--purple); color: var(--ink); box-shadow: 0 0 16px var(--purple); }
.rr-mapbox { background: rgba(50,46,47,.75); border: 1px solid rgba(190,179,255,.45); border-radius: 14px; padding: 6px; }
.rr-board { list-style: none; margin: 4px 0 0; padding: 0; font: 500 12px/1.2 var(--sub); min-width: 150px; }
.rr-board li { display: flex; align-items: center; gap: 6px; padding: 3px 4px; }
.rr-board li.you { font-weight: 600; }
.rr-board i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }
.rr-board b { margin-left: auto; font-variant-numeric: tabular-nums; }
.rr-warn { position: absolute; top: 18px; left: 50%; translate: -50% 0; background: #ff6635; color: #fff; border-radius: 100px; padding: 8px 16px; font: 600 14px/1 var(--sub); letter-spacing: .04em; z-index: 2; animation: rr-blink .5s steps(2) infinite; pointer-events: none; box-shadow: 0 0 18px #ff6635; }
.rr-warn[hidden], .rr-banner[hidden], .rr-overlay[hidden] { display: none; }
.rr-pop { position: absolute; left: 50%; top: 40%; translate: -50% 0; font: 600 24px/1 var(--sub); color: #ff6635; text-shadow: 0 0 12px #ff6635; opacity: 0; pointer-events: none; z-index: 2; white-space: nowrap; }
.rr-pop.go { animation: rr-pop .8s ease-out; }
@keyframes rr-pop { 0% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-40px) scale(1); } }
@keyframes rr-blink { 50% { opacity: .6; } }
.rr-banner { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; z-index: 3; }
.rr-banner strong { font: 400 clamp(30px, 5vw, 56px)/1.1 var(--heading); color: var(--cream); text-shadow: 0 0 18px var(--pink), 0 0 36px #ff6635; }
.rr-banner span { display: inline-block; margin-top: 10px; background: var(--purple); color: var(--ink); border-radius: 100px; padding: 8px 16px; font: 600 15px/1 var(--sub); box-shadow: 0 0 18px var(--purple); }
.rr-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(50,46,47,.55); z-index: 4; }
.rr-card { background: var(--ink); color: var(--cream); border: 1px solid var(--purple); border-radius: 18px; padding: clamp(20px, 3vw, 32px); max-width: 460px; text-align: center; box-shadow: 0 0 40px rgba(190,179,255,.35); }
.rr-card h3 { font-size: clamp(24px, 3vw, 32px); text-shadow: 0 0 14px var(--purple); }
.rr-card p { margin: 0 0 18px; }
.rr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rr-band .btn { background: #ff6635; border-color: #ff6635; color: #fff; box-shadow: 0 0 16px rgba(255,102,53,.5); }
.rr-band .btn:hover { background: var(--coral); border-color: var(--coral); }
.rr-band .btn-ghost { background: transparent; border-color: var(--purple); color: var(--cream); box-shadow: 0 0 12px rgba(190,179,255,.4); }
.rr-band .btn-ghost:hover { background: var(--purple); color: var(--ink); }
.rr-band .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.rr-card .rr-keys { font: 500 13px/1.5 var(--sub); opacity: .75; margin: 16px 0 0; }
.rr-touch { position: absolute; left: 12px; right: 12px; bottom: 12px; display: none; justify-content: space-between; align-items: flex-end; gap: 10px; z-index: 2; }
.rr-steer { display: flex; gap: 10px; }
.rr-touch button { font: 600 15px/1 var(--sub); color: var(--cream); background: rgba(50,46,47,.75); border: 1.5px solid var(--purple); border-radius: 100px; min-width: 60px; height: 60px; padding: 0 16px; touch-action: none; }
.rr-touch [data-rr="jump"] { background: #ff6635; border-color: #ff6635; color: #fff; min-width: 84px; }
.rr-touch [data-rr="boost"] { border-color: var(--pink); }
.rr-up { display: flex; flex-direction: column; gap: 4px; background: rgba(252,246,239,.05); border: 1px solid rgba(190,179,255,.4); border-radius: 12px; padding: 10px 12px; }
.rr-up h4, .rr-up .rr-name { margin: 0; font: 600 14px/1.2 var(--sub); }
.rr-up p { margin: 0; font-size: 12.5px; line-height: 1.4; opacity: .8; }
.rr-up-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rr-up-top span { font: 500 12px/1 var(--sub); color: var(--pink); }
.rr-up-fx { font: 500 13px/1.4 var(--sub) !important; color: var(--blue); opacity: 1 !important; }
.rr-up-fx b { color: var(--cream); }
.rr-up .btn { margin-top: 4px; align-self: stretch; padding: 8px 12px; font-size: 13px; }
.rr-up.locked { border-style: dashed; opacity: .6; }
.rr-up.maxed { border-color: var(--purple); box-shadow: 0 0 14px rgba(190,179,255,.3); }
.rr-fine { text-align: center; font: 500 13px/1.5 var(--sub); margin: 20px 0 0; opacity: .75; }
@media (pointer: coarse) { .rr-touch { display: flex; } .rr-card .rr-keys { display: none; } }
@media (max-width: 640px) {
  .rr-stage { aspect-ratio: 3 / 4; }
  .rr-stage .rr-map { width: 104px; height: 84px; }
  .rr-board { min-width: 104px; font-size: 11px; }
  .rr-board li:nth-child(n+4) { display: none; }
  .rr-chip { font-size: 12px; padding: 5px 9px; }
  .rr-meter i { width: 70px; }
}
.rr-world { color: var(--pink); border-color: var(--pink); }
.rr-launch { position: absolute; top: 58px; left: 50%; translate: -50% 0; z-index: 2; display: grid; gap: 6px; justify-items: center; pointer-events: none; font: 600 13px/1 var(--sub); color: var(--cream); text-shadow: 0 0 8px var(--blue); white-space: nowrap; }
.rr-launch[hidden] { display: none; }
.rr-launch i { position: relative; display: block; width: min(320px, 60vw); height: 10px; border-radius: 10px; background: rgba(252,246,239,.15); }
.rr-launch b { display: block; height: 100%; width: 0; border-radius: 10px; background: linear-gradient(90deg, var(--purple), var(--blue) 60%, var(--pink)); box-shadow: 0 0 12px var(--blue); transition: width .15s linear; }
.rr-launch.ready b { background: #ff6635; box-shadow: 0 0 14px #ff6635; }
.rr-launch em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--cream); box-shadow: 0 0 8px var(--cream); }
.rr-flash { position: absolute; inset: 0; background: var(--cream); opacity: 0; pointer-events: none; z-index: 5; transition: opacity .6s; }
.rr-flash.on { opacity: 1; transition: opacity .35s; }
.rr-goal { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255,207,213,.45); background: rgba(252,246,239,.05); font: 500 14px/1.45 var(--sub); }
.rr-goal b { color: var(--pink); }
.rr-goal .rr-worlds { display: flex; flex-wrap: wrap; gap: 4px; }
.rr-goal .rr-worlds span { padding: 4px 10px; border-radius: 100px; border: 1px solid rgba(190,179,255,.35); font-size: 12px; opacity: .45; }
.rr-goal .rr-worlds span.done { opacity: .8; }
.rr-goal .rr-worlds span.here { opacity: 1; border-color: var(--pink); color: var(--pink); box-shadow: 0 0 10px rgba(255,207,213,.4); }

/* Ring Rush 3: garage drawer, boss bar, toasts, power chips */
.rr-chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 260px; }
.rr-frenzy { background: #ff6635; border-color: #ff6635; color: #fff; box-shadow: 0 0 14px #ff6635; }
.rr-meter[hidden] { display: none; }
.rr-boss { position: absolute; top: 14px; left: 50%; translate: -50% 0; z-index: 2; display: grid; gap: 6px; justify-items: center; pointer-events: none; font: 600 12px/1 var(--sub); letter-spacing: .12em; text-transform: uppercase; color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.rr-boss[hidden] { display: none; }
.rr-boss i { display: block; width: min(420px, 56vw); height: 12px; border-radius: 12px; background: rgba(252,246,239,.12); border: 1px solid rgba(255,207,213,.5); overflow: hidden; }
.rr-boss b { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--pink)); box-shadow: 0 0 14px var(--pink); transition: width .3s; }
.rr-boss + .rr-warn, .rr-boss ~ .rr-launch { top: 70px; }
.rr-toasts { position: absolute; left: 50%; bottom: 84px; translate: -50% 0; z-index: 3; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.rr-toast { background: rgba(50,46,47,.9); color: var(--cream); border: 1px solid var(--pink); border-radius: 100px; padding: 8px 16px; font: 500 13px/1.3 var(--sub); box-shadow: 0 0 16px rgba(255,207,213,.35); animation: rr-toast 4s ease forwards; white-space: nowrap; }
.rr-toast.gold { border-color: #ff6635; box-shadow: 0 0 18px rgba(255,102,53,.6); }
@keyframes rr-toast { 0% { opacity: 0; transform: translateY(10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.rr-stage.slowmo canvas { filter: saturate(1.4) hue-rotate(-12deg); }

.rr-dock { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; z-index: 6; display: flex; align-items: center; gap: 10px; transition: bottom .3s cubic-bezier(.2,.8,.3,1); }
.rr-gb-label { font-style: normal; }
.garage-open .rr-garage-btn { background: var(--purple); color: var(--ink); box-shadow: 0 0 22px rgba(190,179,255,.7); }
.garage-open .rr-garage-btn b { color: var(--ink); }
.rr-garage-btn { position: relative; display: flex; align-items: center; gap: 10px; background: rgba(50,46,47,.85); color: var(--cream); border: 1px solid var(--purple); border-radius: 100px; padding: 9px 18px; font: 600 14px/1 var(--sub); cursor: pointer; box-shadow: 0 0 18px rgba(190,179,255,.35); }
.rr-garage-btn span { font-weight: 500; opacity: .9; }
.rr-garage-btn b { color: #ff6635; font-variant-numeric: tabular-nums; }
.rr-badge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; border-radius: 22px; background: #ff6635; color: #fff; font: 700 12px/22px var(--sub); font-style: normal; text-align: center; box-shadow: 0 0 10px #ff6635; }
.rr-badge[hidden] { display: none; }
.rr-drawer { position: absolute; left: 10px; right: 10px; bottom: 0; height: 58%; z-index: 5; display: flex; flex-direction: column; background: rgba(50,46,47,.95); border: 1px solid var(--purple); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 40px rgba(190,179,255,.25); padding: 10px 14px 0; transform: translateY(102%); visibility: hidden; transition: transform .3s cubic-bezier(.2,.8,.3,1), visibility .3s; color: var(--cream); }
.rr-drawer.open { transform: none; visibility: visible; }
.rr-drawer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rr-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.rr-tabs button { background: transparent; color: var(--cream); border: 1px solid rgba(190,179,255,.4); border-radius: 100px; padding: 6px 12px; font: 600 13px/1 var(--sub); cursor: pointer; }
.rr-tabs button[aria-selected="true"] { background: var(--purple); color: var(--ink); box-shadow: 0 0 12px rgba(190,179,255,.6); }
.rr-tabs button[hidden] { display: none; }
.rr-drawer-note { margin: 0; font: 500 12px/1.3 var(--sub); opacity: .8; flex: 1; }
.rr-drawer .rr-goal { margin-bottom: 8px; }
.rr-pane { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 12px; overscroll-behavior: contain; }
.rr-pane[hidden] { display: none; }
.rr-shop { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
/* Buy ×1 · ×10 · ×100 · Max: a sliding pill like the Upgrades/Generators switch */
.rr-bulk-wrap { display: flex; align-items: center; gap: 8px; flex: none; font: 600 12px/1 var(--sub); letter-spacing: .1em; text-transform: uppercase; color: var(--pink); }
.rr-bulk-wrap[hidden] { display: none; }
.rr-bulk { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(252,246,239,.08); border: 1px solid rgba(190,179,255,.45); border-radius: 100px; padding: 3px; letter-spacing: 0; text-transform: none; }
.rr-bulk button { position: relative; z-index: 1; background: transparent; border: 0; color: var(--cream); font: 700 13px/1 var(--sub); padding: 7px 12px; border-radius: 100px; cursor: pointer; transition: color .2s; }
.rr-bulk button[aria-pressed="true"] { color: var(--ink); }
.rr-bulk i { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(25% - 1.5px); border-radius: 100px; background: var(--pink); box-shadow: 0 0 12px rgba(255,207,213,.6); transition: transform .25s cubic-bezier(.2,.8,.3,1); }
.rr-bulk[data-at="10"] i { transform: translateX(100%); }
.rr-bulk[data-at="100"] i { transform: translateX(200%); }
.rr-bulk[data-at="max"] i { transform: translateX(300%); }
.rr-up.launch { border-color: #ff6635; box-shadow: 0 0 12px rgba(255,102,53,.3); }
.rr-up .rr-tag { font: 600 10px/1 var(--sub); letter-spacing: .1em; text-transform: uppercase; color: #ff6635; }
.rr-achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.rr-ach { border: 1px dashed rgba(190,179,255,.35); border-radius: 10px; padding: 8px 10px; font: 500 12px/1.35 var(--sub); opacity: .5; }
.rr-ach b { display: block; font-size: 13px; }
.rr-ach.done { border-style: solid; border-color: var(--pink); opacity: 1; box-shadow: 0 0 10px rgba(255,207,213,.25); }
#rr-stardust { font: 500 14px/1.5 var(--sub); }
#rr-stardust .btn { margin-top: 10px; }
@media (max-width: 640px) {
  .rr-drawer { left: 0; right: 0; height: 72%; }
  .rr-drawer .rr-goal { font-size: 12px; padding: 8px 10px; }
  .rr-drawer .rr-worlds, .rr-drawer-note { display: none; }
  .rr-dock { bottom: 84px; }
  .rr-toasts { bottom: 140px; }
}
.rr-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0; background: radial-gradient(circle at 50% 45%, rgba(50,46,47,0) 0 8%, rgba(190,179,255,.55) 14%, rgba(50,46,47,0) 22%, rgba(255,207,213,.45) 30%, rgba(50,46,47,0) 40%, rgba(152,194,222,.4) 52%, rgba(50,46,47,.85) 75%); }
.rr-stage.wormhole::after { animation: rr-wormhole .9s ease-out; }
@keyframes rr-wormhole { 0% { opacity: 0; transform: scale(2.2) rotate(0deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(.4) rotate(160deg); } }

/* Ring Rush 3.1: top cluster (achievements, world rail, boss, launch), stardust chip, compact garage */
.rr-top { position: absolute; top: 10px; left: 50%; translate: -50% 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(560px, 52%); }
.rr-top > .rr-boss, .rr-top > .rr-launch, .rr-top > .rr-warn { position: static; translate: none; }
.rr-ach-btn { pointer-events: auto; cursor: pointer; }
.rr-ach-btn b { color: var(--pink); margin-left: 4px; }
.rr-rail { list-style: none; margin: 0; padding: 0; display: flex; width: 100%; }
.rr-rail li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 10.5px/1 var(--sub); letter-spacing: .04em; color: var(--cream); opacity: .55; white-space: nowrap; }
.rr-rail li::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: rgba(190,179,255,.35); z-index: -1; }
.rr-rail li:first-child::before { display: none; }
.rr-rail li.done, .rr-rail li.here { opacity: 1; }
.rr-rail li.done::before, .rr-rail li.here::before { background: var(--purple); box-shadow: 0 0 8px var(--purple); }
.rr-rail i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(190,179,255,.6); background: var(--ink); }
.rr-rail li.done i { background: var(--purple); border-color: var(--purple); box-shadow: 0 0 8px var(--purple); }
.rr-rail li.here i { background: var(--pink); border-color: var(--pink); box-shadow: 0 0 12px var(--pink); transform: scale(1.2); }
.rr-rail li.here span { color: var(--pink); }
.rr-ach-panel { position: absolute; top: 0; left: 50%; width: min(760px, 94%); max-height: 72%; overflow-y: auto; z-index: 6; translate: -50% -105%; visibility: hidden; transition: translate .3s cubic-bezier(.2,.8,.3,1), visibility .3s; background: rgba(50,46,47,.96); border: 1px solid var(--purple); border-top: 0; border-radius: 0 0 16px 16px; padding: 12px 14px 14px; color: var(--cream); box-shadow: 0 10px 40px rgba(190,179,255,.25); }
.rr-ach-panel.open { translate: -50% 0; visibility: visible; }
.rr-ach-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font: 500 13px/1.3 var(--sub); }
.rr-ach-head b { font-size: 16px; }
.rr-ach-head span { opacity: .8; }
.rr-ach-head .rr-chip { margin-left: auto; cursor: pointer; padding: 5px 10px; }
.rr-stardust { display: flex; flex-wrap: wrap; gap: 6px; }
.rr-stardust[hidden] { display: none; }
.rr-stardust .rr-chip { color: var(--lilac); border-color: var(--lilac); box-shadow: 0 0 10px rgba(222,216,255,.3); }
.rr-rebirth-btn { cursor: pointer; pointer-events: auto; background: var(--purple) !important; color: var(--ink) !important; }
.rr-rebirth-btn[hidden] { display: none; }

/* Garage drawer: sized to its contents, no scrolling on a normal screen */
.rr-drawer { height: auto; max-height: 74%; padding: 10px 12px 12px; }
.rr-drawer-head { margin-bottom: 6px; flex-wrap: nowrap; }
.rr-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: rgba(252,246,239,.08); border: 1px solid rgba(190,179,255,.45); border-radius: 100px; padding: 3px; flex: none; }
.rr-switch button { position: relative; z-index: 1; background: transparent; border: 0; color: var(--cream); font: 600 13px/1 var(--sub); padding: 7px 14px; border-radius: 100px; cursor: pointer; transition: color .2s; }
.rr-switch button[aria-selected="true"] { color: var(--ink); }
.rr-switch i { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 100px; background: var(--purple); box-shadow: 0 0 12px rgba(190,179,255,.6); transition: transform .25s cubic-bezier(.2,.8,.3,1); }
.rr-switch.gen i { transform: translateX(100%); }
.rr-drawer .rr-bulk { margin: 0; flex: none; }
.rr-drawer .rr-bulk[hidden] { display: none; }
.rr-drawer .rr-goal { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; background: none; font: 500 12.5px/1.35 var(--sub); }
.rr-drawer-note { margin: 0 0 8px; font: 500 11.5px/1.3 var(--sub); opacity: .7; }
.rr-drawer .rr-pane { overflow-y: auto; padding-bottom: 0; }
.rr-drawer .rr-shop { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.rr-drawer .rr-up { gap: 3px; padding: 8px 10px; border-radius: 10px; }
.rr-drawer .rr-up h4, .rr-drawer .rr-up .rr-name { font-size: 13px; }
.rr-drawer .rr-up-top span { font-size: 11px; }
.rr-drawer .rr-up-fx { font-size: 11.5px !important; line-height: 1.3; min-height: 2.6em; }
.rr-drawer .rr-up .btn { margin-top: 2px; padding: 6px 10px; font-size: 12px; }
.rr-up .rr-tag { margin-left: 6px; padding: 2px 6px; border: 1px solid #ff6635; border-radius: 100px; font-size: 9px; vertical-align: 2px; }
@media (max-width: 640px) {
  .rr-top { width: 60%; top: 8px; }
  .rr-rail span { display: none; }
  .rr-drawer-head { flex-wrap: wrap; }
  .rr-drawer .rr-goal { flex-basis: 100%; order: 3; display: block; }
  .rr-drawer .rr-shop { grid-template-columns: 1fr 1fr; }
}
.rr-up .rr-tag { font-style: normal; }


/* Full screen: the game is the whole page */
.rr-band { padding: 0; }
.rr-stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; aspect-ratio: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.rr-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--purple); }
@media (max-width: 640px) { .rr-stage { aspect-ratio: auto; } }

/* Everyone in one room: world tags on the scoreboard, racer counts on the world rail */
.rr-board small { margin-left: 4px; font-size: 10px; opacity: .65; }
.rr-rail em { position: absolute; top: -9px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 16px; background: #ff6635; color: #fff; font: 700 10px/16px var(--sub); font-style: normal; text-align: center; box-shadow: 0 0 8px #ff6635; }

/* Garage cards: each one is a whole button.
   Name and level, what it does, the current value over the (bigger) next one, then the price */
.rr-drawer button.rr-up {
  position: relative; overflow: hidden; isolation: isolate; width: 100%;
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px;
  border-radius: 14px; border: 1px solid rgba(190,179,255,.22);
  background: linear-gradient(160deg, rgba(252,246,239,.08), rgba(252,246,239,.02));
  color: var(--cream); font: inherit; text-align: left; cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.3), box-shadow .18s, border-color .18s, filter .18s;
}
.rr-drawer button.rr-up > span { display: block; }
.rr-drawer button.rr-up > .rr-up-top { display: flex; align-items: baseline; }
.rr-drawer .rr-up .rr-name { font: 700 17px/1.15 var(--sub); letter-spacing: -.01em; color: var(--cream); }
.rr-drawer .rr-up .rr-count { font: 700 15px/1 var(--sub); color: var(--pink); white-space: nowrap; }
.rr-drawer .rr-up .rr-tag { align-self: flex-start; margin: 2px 0 1px; }
.rr-drawer .rr-desc { margin-top: 3px; font: 400 11.5px/1.35 var(--body); opacity: .75; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rr-drawer .rr-now { margin-top: 6px; font: 500 12px/1.2 var(--sub); opacity: .7; }
.rr-drawer .rr-new { font: 800 18px/1.15 var(--sub); letter-spacing: -.01em; }
.rr-drawer .rr-now + .rr-new { margin-top: 1px; }
.rr-drawer .rr-desc + .rr-new { margin-top: 6px; }
.rr-drawer .rr-cost { margin-top: auto; padding-top: 10px; text-align: center; font: 800 20px/1 var(--sub); letter-spacing: -.01em; }
/* Level progress along the bottom edge */
.rr-drawer .rr-lv { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--lv) * 100%); background: var(--pink); box-shadow: 0 0 8px var(--pink); border-radius: 0 3px 3px 0; }

/* Can't afford it yet: dark glass that fills up from the left as the bank grows */
.rr-drawer button.rr-up.poor { cursor: not-allowed; }
.rr-drawer button.rr-up.poor::before { content: ""; position: absolute; inset: 0; z-index: -1; width: calc(var(--p) * 100%); background: linear-gradient(90deg, rgba(255,102,53,.06), rgba(255,102,53,.22)); transition: width .3s; }
.rr-drawer button.rr-up.poor .rr-cost { color: var(--pink); }

/* Affordable: a hot orange button with a light sweep */
.rr-drawer button.rr-up.can {
  border-color: rgba(255,207,213,.55);
  background: linear-gradient(135deg, #ff6635 0%, var(--coral) 100%);
  box-shadow: 0 6px 20px -8px rgba(255,102,53,.9), inset 0 1px 0 rgba(255,255,255,.35);
  animation: rr-can 2.4s ease-in-out infinite;
}
.rr-drawer button.rr-up.can .rr-count { color: #fff; }
.rr-drawer button.rr-up.can .rr-desc { opacity: .9; }
.rr-drawer button.rr-up.can .rr-cost { color: #fff; text-shadow: 0 1px 10px rgba(50,46,47,.35); }
.rr-drawer button.rr-up.can .rr-lv { background: var(--cream); box-shadow: 0 0 8px #fff; }
.rr-drawer button.rr-up.can .rr-tag { color: #fff; border-color: #fff; }
.rr-drawer button.rr-up.can::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-110%);
}
.rr-drawer button.rr-up.can:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 28px -8px rgba(255,102,53,1), 0 0 0 2px rgba(255,207,213,.6), inset 0 1px 0 rgba(255,255,255,.4); }
.rr-drawer button.rr-up.can:hover::after { transform: translateX(110%); transition: transform .6s ease; }
.rr-drawer button.rr-up.can:active { transform: translateY(0) scale(.97); filter: brightness(1.12); transition-duration: .06s; }
@keyframes rr-can { 50% { box-shadow: 0 6px 26px -6px rgba(255,102,53,1), inset 0 1px 0 rgba(255,255,255,.35); } }

/* Maxed: calm lilac with a check */
.rr-drawer button.rr-up.maxed { cursor: default; border-color: rgba(190,179,255,.6); background: linear-gradient(135deg, rgba(190,179,255,.2), rgba(222,216,255,.04)); }
.rr-drawer button.rr-up.maxed .rr-cost { color: var(--purple); font-size: 15px; }
.rr-drawer button.rr-up.maxed .rr-lv { background: var(--purple); box-shadow: 0 0 8px var(--purple); }

/* Launch powers keep a hot border even before you can buy them */
.rr-drawer button.rr-up.launch:not(.can) { border-color: rgba(255,102,53,.7); box-shadow: 0 0 14px -4px rgba(255,102,53,.6); }
.rr-drawer button.rr-up:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .rr-drawer button.rr-up.can { animation: none; } .rr-drawer button.rr-up { transition: none; } }
.rr-drawer .rr-shop { padding: 4px 2px 2px; } /* room for the hover lift */

/* Generator cards: the amount you're buying over its price, and the next ×2 milestone */
.rr-drawer .rr-cost .rr-qty { display: inline-block; margin-left: 7px; vertical-align: 3px; padding: 3px 6px; border: 1px solid currentColor; border-radius: 6px; font: 700 11px/1 var(--sub); letter-spacing: .04em; opacity: .9; }
.rr-drawer .rr-up .rr-milestone { align-self: flex-start; margin: 2px 0 1px; color: var(--pink); border-color: var(--pink); }
.rr-drawer button.rr-up.can .rr-milestone { color: #fff; border-color: #fff; }

/* Touch: a big Go pedal and a small brake */
.rr-touch [data-rr="gas"] { background: var(--purple); border-color: var(--purple); color: var(--ink); min-width: 96px; height: 72px; font-size: 18px; box-shadow: 0 0 16px rgba(190,179,255,.6); }
.rr-touch [data-rr="brake"] { min-width: 48px; height: 48px; padding: 0; }

/* The AI pilot: a big toggle beside the garage */
.rr-ai-btn { position: absolute; right: calc(100% + 10px); top: 50%; translate: 0 -50%; white-space: nowrap; display: flex; align-items: center; gap: 9px; padding: 9px 14px 9px 12px; border-radius: 100px; border: 1px solid var(--purple); background: rgba(50,46,47,.85); color: var(--cream); font: 700 14px/1 var(--sub); cursor: pointer; box-shadow: 0 0 18px rgba(190,179,255,.35); transition: background .2s, color .2s, box-shadow .2s, transform .15s; }
.rr-ai-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 24px rgba(190,179,255,.6); }
.rr-ai-btn kbd { font: 700 11px/1 var(--sub); padding: 3px 6px; border-radius: 6px; border: 1px solid currentColor; opacity: .7; }
.rr-ai-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(252,246,239,.25); box-shadow: inset 0 0 0 2px rgba(252,246,239,.5); }
.rr-ai-btn[aria-pressed="true"] { background: var(--purple); color: var(--ink); box-shadow: 0 0 26px var(--purple); animation: rr-ai-on 1.6s ease-in-out infinite; }
.rr-ai-btn[aria-pressed="true"] .rr-ai-dot { background: #ff6635; box-shadow: 0 0 10px #ff6635; }
.rr-ai-btn.locked { opacity: .6; border-style: dashed; }
.rr-ai-btn.locked .rr-ai-dot { background: none; box-shadow: none; width: auto; height: auto; }
.rr-ai-btn.locked .rr-ai-dot::before { content: "🔒"; font-size: 12px; font-style: normal; }
@keyframes rr-ai-on { 50% { box-shadow: 0 0 36px var(--purple); } }
@media (prefers-reduced-motion: reduce) { .rr-ai-btn[aria-pressed="true"] { animation: none; } }
/* Narrow screens: the AI pilot sits above the garage button instead of beside it */
@media (max-width: 560px) {
  .rr-ai-btn { right: auto; left: 50%; top: auto; bottom: calc(100% + 8px); translate: -50% 0; }
}

/* Escaping the black hole: the white flash stays up behind the choice */
.rr-overlay.escape { z-index: 7; background: none; }
.rr-overlay.escape .rr-card { box-shadow: 0 0 60px rgba(190,179,255,.9), 0 20px 60px rgba(50,46,47,.5); }

/* The second-tab lock sits above everything */
.rr-overlay.rr-tablock { z-index: 9; background: rgba(50,46,47,.85); }

/* Black Hole: orbit speed on the launch gauge, and the falling warning */
.rr-launch em.rr-orbit-mark { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
.rr-launch em[hidden] { display: none; }
.rr-warn.hole { color: #fff; background: rgba(255,77,77,.85); animation: rr-hole-warn .5s ease-in-out infinite alternate; }
@keyframes rr-hole-warn { to { background: rgba(190,60,90,.85); transform: scale(1.04); } }

.rr-actions .btn[hidden] { display: none; }

/* Top right: a big full-screen button; the world name and speed live elsewhere */
.rr-stats .rr-chip[hidden] { display: none; }
.rr-full { font-size: 26px; line-height: 1; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; border-radius: 12px; }

/* ===== The SPACE-Y Store (Amazon-style) ===== */
.rr-gb-cart svg { width: 18px; height: 18px; display: block; }
.rr-garage-btn { gap: 8px; }
.sy-bar { display: flex; align-items: center; gap: 14px; margin: -10px -14px 10px; padding: 9px 14px; background: #1b2330; border-bottom: 3px solid #ff9a3c; border-radius: 16px 16px 0 0; }
.sy-logo { display: flex; align-items: baseline; gap: 6px; color: #fff; }
.sy-logo b { font: 900 20px/1 var(--sub); letter-spacing: .04em; }
.sy-mark { font-size: 18px; }
.sy-store { font: 600 13px/1 var(--sub); color: #ffb45c; }
.sy-tag { margin-left: auto; font: italic 600 13px/1 var(--sub); color: #c9d6e6; }
.rr-drawer .rr-goal { background: #fff; color: #1b2330; border: 2px solid #ffb45c; border-radius: 10px; }
.rr-drawer .rr-goal b { color: #c45500; }
/* Product cards: white tiles, a product image, a blue title link, stars, a big price and a yellow Add to Cart */
.rr-drawer button.rr-up { background: #fff !important; color: #0f1111; border: 1px solid #d5d9d9 !important; border-radius: 10px; box-shadow: 0 1px 2px rgba(15,17,17,.15) !important; animation: none !important; padding: 8px 10px 10px; gap: 2px; }
.rr-drawer button.rr-up::before, .rr-drawer button.rr-up::after { display: none !important; }
.rr-drawer .rr-up .rr-ico { display: grid !important; place-items: center; height: 46px; margin: -2px -4px 4px; border-radius: 6px; background: linear-gradient(180deg, #f7f8f8, #eceeee); font-size: 30px; line-height: 1; }
.rr-drawer .rr-up .rr-name { color: #007185 !important; font: 700 18px/1.15 var(--body) !important; }
.rr-drawer .rr-up .rr-count { color: #565959 !important; font: 500 11px/1 var(--sub) !important; }
.rr-drawer .rr-stars { color: #ffa41c; font-size: 13px; letter-spacing: 1px; line-height: 1; }
.rr-drawer .rr-up .rr-tag { color: #fff !important; background: #232f3e; border: 0 !important; border-radius: 3px; padding: 2px 6px; font: 700 9px/1.2 var(--sub); }
.rr-drawer .rr-up .rr-tag.rr-milestone { background: #cc0c39; }
.rr-drawer .rr-up .rr-desc { color: #565959 !important; opacity: 1 !important; }
.rr-drawer .rr-up .rr-now { color: #565959 !important; opacity: 1 !important; text-decoration: line-through; }
.rr-drawer .rr-up .rr-new { color: #0f1111 !important; }
.rr-drawer .rr-up .rr-cost { color: #0f1111 !important; text-align: left !important; font: 700 21px/1 var(--sub) !important; padding-top: 6px !important; text-shadow: none !important; }
.rr-drawer .rr-up .rr-cost .rr-qty { color: #565959; border-color: #d5d9d9; }
.rr-drawer .rr-up .rr-cart { display: flex !important; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; padding: 7px 10px; border-radius: 100px; background: #ffd814; border: 1px solid #fcd200; color: #0f1111; font: 600 13px/1 var(--sub); }
.rr-drawer .rr-up .rr-cart svg { width: 16px; height: 16px; }
.rr-drawer button.rr-up.can:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,17,17,.25) !important; }
.rr-drawer button.rr-up.can:hover .rr-cart { background: #f7ca00; }
.rr-drawer button.rr-up.can:active .rr-cart { background: #ffa41c; }
.rr-drawer button.rr-up.poor { opacity: .75; }
.rr-drawer button.rr-up.poor .rr-cart { background: #e7e9ec; border-color: #d5d9d9; color: #8d9096; }
.rr-drawer button.rr-up.poor .rr-cost { color: #b12704 !important; }
.rr-drawer button.rr-up.maxed .rr-cart { background: #e3f4e8; border-color: #b7dfc4; color: #067d62; }
.rr-drawer button.rr-up.launch:not(.can) { border-color: #ff9a3c !important; }
.rr-drawer .rr-lv { background: #ffa41c !important; box-shadow: none !important; }

/* Price on the left, level on the right, same size, just above Add to Cart */
.rr-drawer .rr-up .rr-cost-row { display: flex !important; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.rr-drawer .rr-up .rr-cost-row .rr-cost { margin-top: 0 !important; padding-top: 0 !important; }
.rr-drawer .rr-up .rr-lvl { font: 700 21px/1 var(--sub); color: #0f1111; white-space: nowrap; }

/* Generators = SPACE-Y Business (Amazon Business style): a navy wordmark with "business" in blue */
.rr-switch .sy-biz-tab { font: 700 13px/1 var(--sub); }
.rr-switch .sy-biz-tab b { font-weight: 900; letter-spacing: .03em; }
.rr-switch .sy-biz-tab .sy-biz { font-weight: 600; color: #00a8e1; }
.rr-switch .sy-biz-tab[aria-selected="true"] .sy-biz { color: #0067a8; }
.rr-switch .sy-biz-tab { white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.rr-drawer.biz .sy-bar { border-bottom-color: #00a8e1; }
.rr-drawer.biz .sy-store { color: #36c2f0; }
.rr-drawer.biz .rr-up .rr-cart { background: #00a8e1; border-color: #0090c2; color: #fff; }
.rr-drawer.biz button.rr-up.can:hover .rr-cart { background: #0090c2; }
.rr-drawer.biz button.rr-up.poor .rr-cart { background: #e7e9ec; border-color: #d5d9d9; color: #8d9096; }
.rr-drawer.biz .rr-goal { border-color: #36c2f0; }

/* Store layout: a big centred Upgrades / Business switch, no note or goal bubble, and the product cards centred */
.rr-drawer .rr-drawer-note, .rr-drawer .rr-goal { display: none !important; }
.rr-drawer .rr-drawer-head { justify-content: center; margin: 4px 0 12px; }
.rr-drawer .rr-switch { padding: 5px; border-width: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 6px 18px rgba(0,0,0,.35); }
.rr-drawer .rr-switch button { font-size: 17px !important; padding: 12px 30px !important; min-width: 190px; }
.rr-drawer .rr-switch i { top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); }
.rr-drawer .rr-shop { grid-template-columns: repeat(auto-fit, minmax(190px, 220px)) !important; justify-content: center; }
@media (max-width: 640px) { .rr-drawer .rr-switch button { min-width: 0; padding: 10px 16px !important; font-size: 15px !important; } .rr-drawer .rr-shop { grid-template-columns: 1fr 1fr !important; } }

.rr-drawer .sy-speed { text-align: center; margin: -4px 0 12px; font: 600 16px/1 var(--sub); color: var(--cream); }
.rr-drawer .sy-speed b { color: #ff4d4d; font-weight: 800; }

/* One row of products that scrolls sideways (the drawer stays short) */
.rr-drawer .rr-shop { display: flex !important; flex-wrap: nowrap; gap: 10px; overflow-x: auto; overflow-y: hidden; justify-content: safe center; padding: 4px 4px 10px !important; scroll-snap-type: x proximity; scrollbar-width: thin; }
.rr-drawer .rr-shop > * { flex: 0 0 210px; scroll-snap-align: start; }
.rr-drawer .rr-pane { overflow: visible; }
.rr-drawer { height: auto !important; max-height: none !important; }
.rr-drawer .rr-up .rr-cost-row { flex-wrap: nowrap; }
.rr-drawer button.rr-up.maxed .rr-cost { font-size: 15px !important; white-space: nowrap; }
.rr-drawer .rr-up .rr-lvl { font-size: 19px; }

.rr-drawer .rr-shop { cursor: grab; user-select: none; }
.rr-drawer .rr-shop.dragging { cursor: grabbing; scroll-snap-type: none; }
.rr-drawer .rr-shop.dragging * { pointer-events: none; }
#rr-banner-sub:empty { display: none; }

/* The store peeks up from the bottom: only its SPACE-Y bar shows until you open it */
.rr-drawer { visibility: visible !important; transform: translateY(calc(100% - 46px)); }
.rr-drawer.open { transform: none; }
.rr-drawer .sy-bar { cursor: pointer; user-select: none; touch-action: none; position: relative; min-height: 46px; box-sizing: border-box; }
.rr-drawer .sy-tag { margin-left: 12px !important; }
.sy-grip { position: absolute; left: 50%; top: 6px; width: 46px; height: 4px; margin-left: -23px; border-radius: 4px; background: rgba(255,255,255,.35); }
.sy-badge { margin-left: auto; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 26px; background: #e2272b; color: #fff; font: 800 14px/26px var(--sub); font-style: normal; text-align: center; box-shadow: 0 0 10px rgba(226,39,43,.7); }
.sy-badge[hidden] { display: none; }
.rr-garage-btn { display: none !important; }
.rr-ai-btn { position: static !important; translate: none !important; }
.rr-touch { bottom: 58px !important; } /* above the peeking store bar */

.rr-full { width: auto !important; padding: 0 14px !important; gap: 8px; display: inline-flex !important; align-items: center; }
.rr-full span { font: 600 15px/1 var(--sub); }

/* SPACE-Y Business: a live revenue chart sits to the left of the generator row */
.rr-drawer .sy-biz-pane:not([hidden]) { display: flex; align-items: stretch; gap: 10px; }
.rr-drawer .sy-biz-pane .rr-shop { flex: 1; min-width: 0; justify-content: flex-start; }
.sy-chart { flex: 0 0 250px; display: flex; flex-direction: column; gap: 2px; margin: 4px 0 10px 4px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #d5d9d9; box-shadow: 0 1px 2px rgba(15,17,17,.15); color: #0f1111; font-family: var(--sub); }
.sy-chart-head { display: flex; justify-content: space-between; align-items: center; font: 700 13px/1 var(--sub); color: #565959; text-transform: uppercase; letter-spacing: .06em; }
.sy-chart-head em { font: 700 10px/1 var(--sub); font-style: normal; color: #fff; background: #00a8e1; padding: 3px 6px; border-radius: 4px; }
.sy-chart-head em::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #fff; vertical-align: 1px; animation: sy-live 1.4s ease-in-out infinite; }
@keyframes sy-live { 50% { opacity: .25; } }
.sy-chart-big { font: 800 26px/1.1 var(--sub); color: #0f1111; margin-top: 4px; }
.sy-chart-big small { font-size: 14px; font-weight: 600; color: #565959; }
.sy-chart-delta { font: 700 13px/1.2 var(--sub); color: #565959; }
.sy-chart-delta.up { color: #067d62; }
.sy-chart-delta.down { color: #b12704; }
.sy-chart-delta small { font-weight: 500; color: #565959; }
.sy-chart svg { flex: 1; width: 100%; min-height: 70px; margin-top: 6px; overflow: visible; }
.sy-chart svg .g { stroke: #e7e9ec; stroke-width: 1; vector-effect: non-scaling-stroke; }
.sy-chart svg .gen { stroke: #ff9900; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.sy-chart svg .tot { fill: none; stroke: #00a8e1; stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sy-chart-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font: 600 11px/1.2 var(--sub); color: #565959; }
.sy-chart-foot i { display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: 3px; border-radius: 2px; }
.sy-chart-foot .sw-tot { background: #00a8e1; }
.sy-chart-foot .sw-gen { background: #ff9900; }
@media (max-width: 640px) { .sy-chart { flex-basis: 170px; padding: 8px; } .sy-chart-big { font-size: 20px; } .sy-chart-foot { flex-direction: column; } }

/* Escape dialog: the Stardust you bring and what it adds up to */
#rr-prestige-note .rr-dust-gain { font: 800 22px/1.3 var(--sub); color: #fff; }
#rr-prestige-note .rr-dust-total { font: 600 16px/1.3 var(--sub); opacity: .75; }
#rr-prestige-note .rr-dust-line { display: block; font: 700 18px/1.5 var(--sub); color: #ffcf8a; }

/* SPACE-Y docked on the right (wide screens): always open, chart on top, then tabs, buy amount, and a vertical list.
   The game stage gives up that width, so the track and HUD stay fully visible */
@media (min-width: 761px) and (min-height: 560px) {
  :root { --sy-w: clamp(340px, 30vw, 460px); }
  .rr-stage { right: var(--sy-w); width: auto; }
  .rr-drawer { position: fixed; inset: 0 0 0 auto; width: var(--sy-w); height: auto; max-height: none; transform: none; visibility: visible; border: 0; border-left: 1px solid var(--purple); border-radius: 0; box-shadow: -8px 0 40px rgba(190,179,255,.18); padding: 10px 14px 0; z-index: 7; }
  .rr-drawer .sy-bar { border-radius: 0; cursor: default; }
  .rr-drawer .sy-grip, .rr-drawer .sy-tag, .rr-garage-btn { display: none; }
  .rr-drawer .sy-chart { flex: 0 0 auto; height: 210px; margin: 0 0 10px; }
  .rr-drawer-head { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
  .rr-drawer .rr-switch { display: grid; width: 100%; box-sizing: border-box; }
  .rr-drawer .rr-switch button { min-width: 0; padding: 10px 6px !important; font-size: 14px !important; }
  .rr-drawer .rr-bulk-wrap { justify-content: center; }
  .rr-drawer .sy-biz-pane:not([hidden]) { display: block; }
  .rr-drawer .rr-pane { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; } /* only the cards scroll */
  .rr-drawer .rr-shop { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; overflow: visible; scroll-snap-type: none; padding: 4px 2px 14px !important; }
  .rr-drawer .rr-shop > * { flex: none; }
}

/* Phones (upright or sideways) keep the bottom drawer; the chart there shows on the Business tab only */
@media (max-width: 760px), (max-height: 559px) {
  .rr-drawer:not(.biz):not(.galactic) .sy-chart { display: none; }
  .rr-drawer .sy-chart { flex: 0 0 150px; margin: 0 0 8px; }
}

/* "Carparts" in the tab is SPACE-Y orange, like the store's buttons ("Business" stays blue) */
.rr-switch .sy-biz-tab .sy-parts { color: #ff9900; }
.rr-switch .sy-biz-tab[aria-selected="true"] .sy-parts { color: #c45500; }

/* Pulled over on the road to Alpha Centauri: red and blue lights flash round the edge of the screen */
.rr-stage.rr-siren::before { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; animation: rr-siren .5s steps(1) infinite; }
@keyframes rr-siren {
  0% { box-shadow: inset 0 0 120px 30px rgba(255, 42, 58, .75), inset 0 0 0 6px rgba(255, 42, 58, .9); }
  50% { box-shadow: inset 0 0 120px 30px rgba(58, 107, 255, .75), inset 0 0 0 6px rgba(58, 107, 255, .9); }
}
.rr-stage.rr-siren #rr-banner-title { color: #fff; text-shadow: 0 0 24px #ff2a3a, 0 0 48px #3a6bff; }
@media (prefers-reduced-motion: reduce) { .rr-stage.rr-siren::before { animation: none; box-shadow: inset 0 0 120px 30px rgba(255, 42, 58, .6); } }

/* Speedometer in the bottom dock, next to the AI pilot button */
.rr-speedo { position: relative; width: 104px; height: 104px; display: grid; place-content: center; text-align: center; color: var(--cream); pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(50,46,47,.92) 58%, rgba(50,46,47,.6) 70%, rgba(50,46,47,0) 72%); filter: drop-shadow(0 0 10px rgba(190,179,255,.45)); }
.rr-speedo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rr-speedo-track, .rr-speedo-fill { fill: none; stroke-width: 7; stroke-linecap: round; transform: rotate(135deg); transform-origin: 50px 50px; } /* (only the arcs: the governor knob is placed by its own transform) */
.rr-speedo-track { stroke: rgba(252,246,239,.14); stroke-dasharray: 75 100; }
.rr-speedo-fill { stroke-dasharray: 0 100; filter: drop-shadow(0 0 4px rgba(152,194,222,.9)); transition: stroke-dasharray .12s linear; }
.rr-speedo-mark { stroke: var(--cream); stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--cream)); }
.rr-speedo b { position: relative; font: 700 26px/1 var(--sub); font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-shadow: 0 0 12px rgba(152,194,222,.9); }
.rr-speedo span { position: relative; margin-top: 3px; font: 700 10px/1 var(--sub); letter-spacing: .24em; color: var(--pink); }
.rr-speedo-min { stroke: #ff3b3b; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 4px #ff3b3b); } /* a black hole's minimum orbit speed */
.rr-speedo.go .rr-speedo-mark { stroke: #ff6635; filter: drop-shadow(0 0 4px #ff6635); }
.rr-speedo.hot b { color: #fff; text-shadow: 0 0 10px #ff6635, 0 0 22px #ff6635; }
.rr-speedo.hot .rr-speedo-fill { filter: drop-shadow(0 0 6px #ff6635); }

/* Power-ups down the right side, under the map: round gauge buttons */
.rr-powers { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; margin-top: 4px; }
.rr-pw { --p: 100; --c: var(--purple); position: relative; width: 66px; height: 66px; padding: 0; border: 0; border-radius: 50%; display: grid; place-content: center; justify-items: center; color: var(--cream); background: rgba(50,46,47,.88); box-shadow: 0 0 14px rgba(190,179,255,.35); pointer-events: auto; font: inherit; touch-action: none; user-select: none; -webkit-user-select: none; }
.rr-pw[hidden] { display: none; }
button.rr-pw { cursor: pointer; transition: transform .15s, box-shadow .2s; }
button.rr-pw:hover { transform: scale(1.06); }
button.rr-pw:active { transform: scale(.95); }
.rr-pw-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(252,246,239,.12) 0); -webkit-mask: radial-gradient(circle, transparent 26px, #000 27px); mask: radial-gradient(circle, transparent 26px, #000 27px); }
.rr-pw-icon { position: relative; font-size: 20px; line-height: 1; }
.rr-pw em { position: relative; margin-top: 2px; font: 700 11px/1 var(--sub); font-style: normal; font-variant-numeric: tabular-nums; }
.rr-pw small { position: absolute; right: calc(100% + 8px); top: 50%; translate: 0 -50%; white-space: nowrap; font: 600 11px/1 var(--sub); letter-spacing: .1em; text-transform: uppercase; color: var(--cream); text-shadow: 0 0 6px rgba(0,0,0,.9); opacity: .85; }
.rr-pw kbd { font: 700 9px/1 var(--sub); padding: 2px 4px; margin-left: 3px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; }
.rr-pw-boost { --c: #ff6635; }
.rr-pw-boost.on { box-shadow: 0 0 22px #ff6635, 0 0 40px rgba(255,102,53,.5); }
.rr-pw-boost.on .rr-pw-icon { animation: rr-pw-shake .12s linear infinite; }
.rr-pw-warp { --c: var(--blue); }
.rr-pw-warp.ready { box-shadow: 0 0 18px var(--blue); animation: rr-pw-ready 1.4s ease-in-out infinite; }
.rr-pw-shield { --c: var(--pink); }
.rr-pw-shield em { font-size: 15px; }
@keyframes rr-pw-ready { 50% { box-shadow: 0 0 30px var(--blue), 0 0 50px rgba(152,194,222,.5); } }
@keyframes rr-pw-shake { 0% { translate: 0 0; } 25% { translate: 1px -1px; } 75% { translate: -1px 1px; } }
@media (prefers-reduced-motion: reduce) { .rr-pw-warp.ready, .rr-pw-boost.on .rr-pw-icon { animation: none; } }
@media (max-width: 640px) {
  .rr-speedo { width: 84px; height: 84px; }
  .rr-speedo b { font-size: 21px; }
  .rr-pw { width: 52px; height: 52px; }
  .rr-pw-ring { -webkit-mask: radial-gradient(circle, transparent 20px, #000 21px); mask: radial-gradient(circle, transparent 20px, #000 21px); }
  .rr-pw-icon { font-size: 16px; }
  .rr-pw small { display: none; }
}

/* Store tabs: Carparts, Business and (once you reach Alpha Centauri) Intergalactic; the pill slides to tab --i of --n */
.rr-switch { --n: 2; --i: 0; }
.rr-switch button[hidden] { display: none; }
.rr-switch.three { grid-template-columns: 1fr 1fr 1fr; }
.rr-drawer .rr-switch i, .rr-switch i { width: calc((100% - 10px) / var(--n)); transform: translateX(calc(100% * var(--i))) !important; }
.rr-switch.three .sy-biz-tab { display: grid; justify-items: center; gap: 3px; padding-left: 8px !important; padding-right: 8px !important; min-width: 0 !important; }
.rr-switch.three .sy-biz-tab b { font-size: 11px; letter-spacing: .08em; }
.rr-switch.three .sy-biz-tab .sy-biz { font-size: 15px; }
.rr-switch .sy-biz-tab .sy-galactic { color: #2ed3b0; }
.rr-switch .sy-biz-tab[aria-selected="true"] .sy-galactic { color: #0b7d68; }
.rr-drawer.galactic .sy-bar { border-bottom-color: #2ed3b0; }
.rr-drawer.galactic .sy-store { color: #5ef2d0; }
.rr-drawer.galactic .rr-up .rr-cart { background: #2ed3b0; border-color: #1fb796; color: #0d2b25; }
.rr-drawer.galactic button.rr-up.can:hover .rr-cart { background: #1fb796; }
.rr-drawer.galactic button.rr-up.poor .rr-cart { background: #e7e9ec; border-color: #d5d9d9; color: #8d9096; }
.rr-drawer.galactic .rr-goal { border-color: #5ef2d0; }

/* The crash landing at the end of the road */
.rr-stage.rr-shake { animation: rr-shake .9s cubic-bezier(.36,.07,.19,.97); }
@keyframes rr-shake { 10%, 90% { translate: -2px 1px; } 20%, 80% { translate: 4px -2px; } 30%, 50%, 70% { translate: -7px 3px; } 40%, 60% { translate: 7px -3px; } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .rr-stage.rr-shake { animation: none; } }
#rr-alpha small { display: block; margin-top: 4px; font: 500 11.5px/1.3 var(--sub); opacity: .85; }

/* Notifications sit under the launch bar (and the "gap ahead" warning) at the top, out of the way of the car */
.rr-toasts { top: 168px; bottom: auto !important; max-width: min(92%, 640px); }
.rr-toast { white-space: normal; text-align: center; }
@media (max-width: 640px) { .rr-toasts { top: 132px; } }

/* The AI governor: a knob on the speedometer you drag round to cap the AI pilot's speed */
.rr-gov { pointer-events: auto; cursor: grab; outline: none; touch-action: none; }
.rr-speedo { pointer-events: auto !important; cursor: pointer; touch-action: none; } /* click anywhere on the dial to set the limit */
.rr-gov[hidden] { display: none; }
.rr-speedo.gov-drag .rr-gov { cursor: grabbing; }
.rr-gov-hit { fill: transparent; stroke: none; pointer-events: all; }
.rr-gov-knob { fill: var(--cream); stroke: #5ef2d0; stroke-width: 2.5; filter: drop-shadow(0 0 4px #5ef2d0); transition: r .15s; }
.rr-gov:hover .rr-gov-knob, .rr-gov:focus-visible .rr-gov-knob, .rr-speedo.gov-drag .rr-gov-knob { r: 7.5; }
.rr-speedo .rr-gov-label { position: absolute; left: 50%; bottom: -8px; translate: -50% 0; white-space: nowrap; padding: 3px 8px; border-radius: 100px; background: rgba(50,46,47,.92); border: 1px solid #5ef2d0; color: #5ef2d0; font: 700 10px/1 var(--sub); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.rr-speedo .rr-gov-label[hidden] { display: none; }
.rr-speedo.gov-drag .rr-gov-label { box-shadow: 0 0 10px #5ef2d0; }

/* ---- The splash: the game's attract screen. The real track shows through a dark scrim; a left-hand title block
   in the game's own type. Only transform/opacity animate, so it stays smooth while the game boots ---- */
.rr-splash { position: fixed; inset: 0; z-index: 100; display: grid; align-items: center; color: #fcf6ef; transition: opacity .6s ease, visibility .6s;
  background: linear-gradient(90deg, rgba(20,17,26,.95) 0%, rgba(20,17,26,.84) 36%, rgba(20,17,26,.38) 50%, rgba(20,17,26,.7) 60%, rgba(20,17,26,.97) 67%, #14111a 100%);
  padding-block: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px)); padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.rr-splash.gone { opacity: 0; visibility: hidden; }
.rr-splash-card { max-width: 560px; margin-left: clamp(0px, 6vw, 96px); display: grid; gap: 22px; justify-items: start; }
.splash-on .rr-hud, .splash-on .rr-top, .splash-on .rr-dock, .splash-on .rr-drawer, .splash-on .rr-touch, .splash-on .rr-overlay, .splash-on .rr-toasts, .splash-on .rr-jump, .splash-on .rr-joy-zone { opacity: 0 !important; pointer-events: none !important; } /* (just the track behind the splash) */
.rr-splash-head { display: flex; align-items: center; gap: 12px; }
.rr-splash-plate { display: grid; place-items: center; width: 40px; height: 30px; border-radius: 6px; background: #fcf6ef; color: #322e2f; font: 700 italic 17px/1 var(--sub); letter-spacing: -.02em; box-shadow: inset 0 0 0 2px #ff6635; transform: skewX(-10deg); }
.rr-splash-kicker { margin: 0; font: 600 12px/1 var(--sub); letter-spacing: .2em; text-transform: uppercase; color: #ff9a6e; }
.rr-splash-logo { margin: 0; display: grid; font: italic 400 clamp(64px, 11vw, 136px)/.86 var(--heading); letter-spacing: -.04em; color: #fcf6ef; }
.rr-splash-logo .r2 { position: relative; padding-left: .5em; justify-self: start; }
.rr-splash-logo .r2::after { display: none; content: ""; position: absolute; left: .5em; right: -.1em; bottom: -.06em; height: .07em; border-radius: 99px; background: linear-gradient(90deg, rgba(255,102,53,0), #ff6635 35%, #ffcfd5); transform-origin: left; animation: rr-streak 1.1s .35s cubic-bezier(.2,.8,.3,1) both; }
@keyframes rr-streak { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.rr-splash-route { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0; font: 500 13px/1 var(--sub); color: rgba(252,246,239,.78); white-space: nowrap; }
.rr-splash-route li { display: flex; align-items: center; gap: 7px; }
.rr-splash-route li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #beb3ff; box-shadow: 0 0 8px #beb3ff; }
.rr-splash-route li:not(:last-child)::after { content: ""; width: 14px; height: 2px; margin: 0 7px; background: rgba(190,179,255,.45); }
.rr-splash-route li:first-child::before { background: #ff6635; box-shadow: 0 0 10px #ff6635; }
.rr-splash-route li.hole::before { background: #14111a; box-shadow: 0 0 0 2px #ffcfd5, 0 0 10px #ffcfd5; }
.rr-splash-route li.hole::after { width: 34px; background: repeating-linear-gradient(90deg, #5ef2d0 0 5px, transparent 5px 9px); } /* the highway */
.rr-splash-route li.far { color: #5ef2d0; } .rr-splash-route li.far::before { background: #5ef2d0; box-shadow: 0 0 8px #5ef2d0; }
.rr-splash-card > * { animation: rr-rise .8s cubic-bezier(.2,.8,.3,1) both; }
.rr-splash-card > :nth-child(2) { animation-delay: .08s; } .rr-splash-card > :nth-child(3) { animation-delay: .16s; } .rr-splash-card > :nth-child(4) { animation-delay: .22s; } .rr-splash-card > :nth-child(5) { animation-delay: .28s; }
@keyframes rr-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rr-splash-card > *, .rr-splash-logo .r2::after { animation: none; } }
.rr-splash-tag, .rr-splash-note { text-wrap: pretty; }
.rr-splash-tag { margin: 0; max-width: 40ch; font: 400 16px/1.55 var(--sub); color: rgba(252,246,239,.85); }
.rr-splash-choose { display: grid; min-height: 120px; }
.rr-splash-out, .rr-splash-in { display: none; gap: 12px; justify-items: start; }
.rr-splash-out { grid-template-columns: auto auto; } .rr-splash-out .rr-splash-note { grid-column: 1 / -1; }
.rr-splash-choose[data-state="out"] .rr-splash-out, .rr-splash-choose[data-state="loading"] .rr-splash-out { display: grid; }
.rr-splash-choose[data-state="in"] .rr-splash-in { display: grid; }
.rr-splash .btn { background: #ff6635; border-color: #ff6635; color: #fff; text-decoration: none; }
.rr-splash .btn:hover { background: #e3552a; border-color: #e3552a; }
.rr-splash .btn-ghost { background: transparent; border-color: rgba(252,246,239,.7); color: #fcf6ef; }
.rr-splash .btn-ghost:hover { background: #fcf6ef; color: #322e2f; }
.rr-splash .btn:focus-visible { outline: 3px solid #fcf6ef; outline-offset: 3px; }
.rr-splash-note { margin: 0; max-width: 46ch; font: 400 13px/1.45 var(--sub); color: rgba(252,246,239,.6); }
@media (max-width: 640px) { .rr-splash-route { flex-wrap: wrap; gap: 10px 14px; white-space: normal; } .rr-splash-route li:not(.hole)::after { display: none; } .rr-splash-foot { display: none; }
  .rr-splash { align-items: end; } .rr-splash-card { gap: 18px; padding-bottom: 8px; } .rr-splash { background: rgba(20,17,26,.86); } .rr-splash-card { margin: 0; } .rr-splash-out { grid-template-columns: 1fr; justify-items: stretch; } .rr-splash .btn { justify-content: center; } }
.rr-splash-foot { position: absolute; left: max(24px, env(safe-area-inset-left, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); margin: 0; font: 500 11px/1 var(--sub); letter-spacing: .14em; text-transform: uppercase; color: rgba(252,246,239,.42); margin-left: clamp(0px, 6vw, 96px); }
.rr-splash-quote { margin: 0; display: grid; gap: 6px; }
.rr-splash-quote p { margin: 0; font: italic 400 20px/1.4 var(--heading); color: rgba(252,246,239,.9); }
.rr-splash-quote cite { font: 500 13px/1 var(--sub); font-style: normal; color: #ff9a6e; }
.rr-splash-quote cite::before { content: "— "; }
.rr-splash-sub { margin: -6px 0 0; font: 600 15px/1.3 var(--sub); letter-spacing: .02em; color: #ff9a6e; }
/* Trapezoid buttons that slot into each other: the first slants on its right, the second matches it on its left */
.rr-splash-out { grid-template-columns: auto auto; column-gap: 0; }
.rr-splash .rr-splash-out .btn { border: 0; border-radius: 0; padding: 16px 34px; }
.rr-splash .rr-splash-signin { clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%); padding-right: 44px; }
.rr-splash #rr-splash-guest { clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%); margin-left: -14px; padding-left: 44px; background: rgba(252,246,239,.14); color: #fcf6ef; }
.rr-splash #rr-splash-guest:hover { background: #fcf6ef; color: #322e2f; }
.rr-splash .rr-splash-out .btn:focus-visible { outline: none; filter: brightness(1.15) drop-shadow(0 0 0 #fff); text-decoration: underline; text-underline-offset: 4px; }
.rr-splash #rr-splash-play { border-radius: 0; border: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%); padding: 16px 48px 16px 34px; }
@media (max-width: 640px) { .rr-splash-out { grid-template-columns: 1fr 1fr; } .rr-splash .rr-splash-out .btn { padding-left: 18px; padding-right: 26px; font-size: 14px; } .rr-splash #rr-splash-guest { padding-left: 30px; } }
@media (max-width: 640px) { .rr-splash .rr-wide { display: none; } }
.rr-splash-quote p { text-wrap: balance; }

/* Phones: a floating joystick on the left (it appears where you touch) and a see-through Jump button on the right */
.rr-joy-zone, .rr-jump { display: none; }
@media (pointer: coarse) {
  .rr-touch { display: none !important; }
  .rr-joy-zone { display: block; position: absolute; left: 0; top: 34%; bottom: 58px; width: 55%; z-index: 2; touch-action: none; }
  .rr-joy { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .15s; pointer-events: none; }
  .rr-joy.on { opacity: 1; }
  .rr-joy::before { content: ""; position: absolute; left: -56px; top: -56px; width: 112px; height: 112px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(255,255,255,.06); }
  .rr-joy i { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.35); border: 2px solid rgba(255,255,255,.8); }
  .rr-jump { display: grid; place-items: center; position: absolute; right: max(18px, env(safe-area-inset-right, 0px)); bottom: 84px; z-index: 3; width: 84px; height: 84px; border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,.85); background: rgba(255,255,255,.08); color: #fff; font: 600 15px/1 var(--sub); letter-spacing: .04em; touch-action: none; -webkit-user-select: none; user-select: none; }
  .rr-jump:active { background: rgba(255,255,255,.22); }
}

/* Splash: fullscreen button (top right) and the iPhone home-screen tip */
.rr-splash-full { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 2; padding: 10px 16px; border-radius: 100px; border: 1.5px solid rgba(252,246,239,.6); background: rgba(20,17,26,.5); color: #fcf6ef; font: 600 14px/1 var(--sub); cursor: pointer; }
.rr-splash-full:hover { background: #fcf6ef; color: #322e2f; }
.rr-splash-ios { position: absolute; top: calc(max(16px, env(safe-area-inset-top, 0px)) + 52px); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 2; max-width: 280px; display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: #fcf6ef; color: #322e2f; font: 400 14px/1.45 var(--sub); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.rr-splash-ios small { color: #6e6573; }
/* Phones held upright: the title block sits in the middle, not at the bottom edge */
@media (max-width: 640px) { .rr-splash { align-items: center; } }
/* Short screens (a phone held sideways): title on the left, the buttons on the right, nothing below the fold */
@media (max-height: 540px) and (min-width: 560px) {
  .rr-splash { align-items: center; }
  .rr-splash-card { max-width: none; width: 100%; margin: 0; grid-template-columns: 1fr minmax(260px, 340px); column-gap: 32px; row-gap: 10px; align-items: center; }
  .rr-splash-logo { font-size: clamp(44px, 9vh, 72px); }
  .rr-splash-card > .rr-splash-logo, .rr-splash-card > .rr-splash-sub, .rr-splash-card > .rr-splash-quote { grid-column: 1; }
  .rr-splash-choose { grid-column: 2; grid-row: 1 / span 3; min-height: 0; }
  .rr-splash-out { grid-template-columns: 1fr; justify-items: stretch; }
  .rr-splash #rr-splash-guest { margin-left: 0; clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%); }
  .rr-splash .btn { justify-content: center; }
}
.rr-splash-ios[hidden], .rr-splash-full[hidden] { display: none; }

/* Phones: the open store takes at most ~60% of the screen; only its cards scroll, and the chart is compact */
@media (max-width: 760px), (max-height: 559px) {
  .rr-drawer { max-height: 62% !important; }
  .rr-drawer .rr-pane { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; }
  .rr-drawer .sy-chart { flex: 0 0 auto !important; height: 104px; padding: 6px 10px; margin: 0 0 6px; }
  .rr-drawer .sy-chart-foot { display: none; }
  .rr-drawer .sy-chart-big { font-size: 18px; }
  .rr-drawer .rr-switch button { font-size: 13px !important; padding: 9px 8px !important; }
  .rr-drawer .sy-speed { font-size: 13px; margin: 2px 0 6px; }
}
@media (max-height: 559px) { .rr-drawer { max-height: 78% !important; } .rr-drawer .sy-chart { display: none !important; } }

/* Phones upright: a tidier HUD. The world rail drops under the top row, the map shrinks (no scoreboard list),
   Fullscreen is an icon, and the speedometer + AI Pilot sit bottom-left, clear of the Jump button */
@media (max-width: 640px) {
  .rr-drawer { height: 60% !important; max-height: 60% !important; }
  .rr-top { top: 64px !important; }
  .rr-top .rr-ach-btn { display: none; }
  .rr-rail li span { font-size: 9px; }
  .rr-full span { display: none; }
  .rr-full { padding: 0 10px !important; }
  .rr-stage .rr-map { width: 96px !important; height: 72px !important; }
  .rr-board { display: none; }
  .rr-dock { left: 12px !important; translate: none !important; gap: 8px; }
  .rr-speedo { width: 78px; height: 78px; }
  .rr-speedo b { font-size: 19px; }
  .rr-ai-btn { padding: 7px 11px !important; font-size: 12px !important; }
  .rr-ai-btn kbd { display: none; }
  .rr-jump { width: 76px !important; height: 76px !important; bottom: 70px !important; }
  .rr-powers { gap: 8px; }
}

/* Phones: the whole open store scrolls (chart included) with the tabs stuck to the top; tap the SPACE-Y bar to tuck it away */
@media (max-width: 760px), (max-height: 559px) {
  .rr-drawer.open { overflow-y: auto; overscroll-behavior: contain; display: block; }
  .rr-drawer.open .rr-pane { overflow: visible; }
  .rr-drawer .rr-drawer-head { position: sticky; top: 0; z-index: 3; background: rgba(42,38,46,.97); padding-top: 6px; }
  .rr-drawer .sy-bar { position: sticky; top: 0; z-index: 4; }
}
.rr-full[hidden] { display: none !important; }
@media (pointer: coarse) { .rr-jump { right: max(10px, env(safe-area-inset-right, 0px)) !important; bottom: 62px !important; } }
@media (max-height: 559px) and (pointer: coarse) { .rr-jump { bottom: 52px !important; } }

.sy-chart svg .genl { fill: none; stroke: #ff9900; stroke-width: 1.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* Phones sideways: same tidy HUD; Jump sits above the store bar at the right, clear of the map */
@media (max-height: 559px) and (pointer: coarse) {
  .rr-stage .rr-map { width: 96px !important; height: 66px !important; }
  .rr-board { display: none; }
  .rr-top .rr-ach-btn { display: none; }
  .rr-dock { left: 12px !important; translate: none !important; gap: 8px; bottom: 54px !important; }
  .rr-speedo { width: 72px; height: 72px; }
  .rr-speedo b { font-size: 18px; }
  .rr-ai-btn { padding: 7px 11px !important; font-size: 12px !important; }
  .rr-ai-btn kbd { display: none; }
  .rr-jump { width: 70px !important; height: 70px !important; bottom: 54px !important; }
  .rr-powers { flex-direction: row; gap: 8px; }
  .rr-pw { width: 46px; height: 46px; }
  .rr-pw-ring { -webkit-mask: radial-gradient(circle, transparent 18px, #000 19px); mask: radial-gradient(circle, transparent 18px, #000 19px); }
  .rr-pw small { display: none; }
  .rr-pw-icon { font-size: 14px; }
  .rr-full span { display: none; } .rr-full { padding: 0 10px !important; }
}

/* Banner subtitles stay on one line (they shrink on narrow screens instead of wrapping) */
#rr-banner-sub { white-space: nowrap; max-width: 96vw; overflow: hidden; text-overflow: ellipsis; font-size: clamp(10px, 2.9vw, 15px) !important; }
/* First run: the next world is a secret, down a dotted line; the ones after it aren't on the rail yet */
.rr-rail li.secret::before { background: none; height: 0; border-top: 2px dotted rgba(190,179,255,.7); }
.rr-rail li.secret i { border-style: dashed; }
.rr-rail li.secret span { letter-spacing: .2em; }
.rr-rail li.blank { visibility: hidden; }
/* The laser button: red, and glowing when it's ready to fire */
.rr-pw-laser { --c: #ff1f1f; }
.rr-pw-laser.ready { box-shadow: 0 0 18px #ff1f1f; }
/* Laser lock: a red targeting reticle over the racer in your sights, and the laser button flashing */
.rr-reticle { position: absolute; left: 0; top: 0; width: 64px; height: 64px; pointer-events: none; z-index: 5; border: 2px solid #ff1f1f; border-radius: 50%; box-shadow: 0 0 12px #ff1f1f, inset 0 0 8px rgba(255,31,31,.5); animation: rr-reticle 0.9s linear infinite; }
.rr-reticle::before, .rr-reticle::after { content: ""; position: absolute; background: #ff1f1f; box-shadow: 0 0 6px #ff1f1f; }
.rr-reticle::before { left: 50%; top: -10px; bottom: -10px; width: 2px; translate: -50% 0; -webkit-mask: linear-gradient(#000 0 14px, transparent 14px calc(100% - 14px), #000 calc(100% - 14px)); mask: linear-gradient(#000 0 14px, transparent 14px calc(100% - 14px), #000 calc(100% - 14px)); }
.rr-reticle::after { top: 50%; left: -10px; right: -10px; height: 2px; translate: 0 -50%; -webkit-mask: linear-gradient(90deg, #000 0 14px, transparent 14px calc(100% - 14px), #000 calc(100% - 14px)); mask: linear-gradient(90deg, #000 0 14px, transparent 14px calc(100% - 14px), #000 calc(100% - 14px)); }
.rr-reticle[hidden] { display: none; }
@keyframes rr-reticle { 0% { scale: 1.15; opacity: .7; } 50% { scale: 1; opacity: 1; } 100% { scale: 1.15; opacity: .7; } }
.rr-pw-laser.lock, .rr-touch [data-rr="laser"].lock { animation: rr-laser-lock .35s steps(2, jump-none) infinite; }
@keyframes rr-laser-lock { 0% { background: rgba(50,46,47,.88); box-shadow: 0 0 14px rgba(255,31,31,.4); } 100% { background: #ff1f1f; box-shadow: 0 0 26px #ff1f1f; } }
@media (prefers-reduced-motion: reduce) { .rr-reticle { animation: none; } }
/* Guest name prompt on the splash */
.rr-splash-name { display: none; gap: 8px; justify-items: start; }
.rr-splash-choose[data-state="name"] .rr-splash-name { display: grid; }
.rr-splash-name label { font: 600 12px/1 var(--sub); letter-spacing: .14em; text-transform: uppercase; color: #ff9a3c; }
.rr-splash-name-row { display: flex; }
.rr-splash-name input { width: 220px; max-width: 52vw; padding: 15px 16px; border: 2px solid rgba(255,255,255,.35); border-right: 0; background: rgba(20,17,26,.7); color: var(--cream); font: 600 17px/1 var(--sub); border-radius: 0; outline: none; }
.rr-splash-name input:focus { border-color: #ff6635; }
.rr-splash .rr-splash-name .btn { border: 0; border-radius: 0; padding: 16px 30px; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
/* Name tags over other racers: their name, and a little arrow pointing down at the car */
.rr-tag { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; display: grid; justify-items: center; gap: 1px; transform-origin: 50% 100%; }
.rr-tag[hidden] { display: none; }
.rr-tag b { font: 700 12px/1 var(--sub); color: #fff; padding: 4px 8px; border-radius: 6px; background: rgba(20,17,26,.72); border: 1.5px solid var(--c, #fff); white-space: nowrap; text-shadow: 0 1px 2px #000; }
.rr-tag i { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--c, #fff); filter: drop-shadow(0 0 4px var(--c, #fff)); transform: rotate(var(--rot, 0rad)); }
/* Off screen: the pin waits on the screen's edge, its arrow turned toward them */
.rr-tag.edge { transform-origin: 50% 50%; }
.rr-tag.edge i { margin-top: 2px; }
