/* colors */
:root {
  --bg: #f7f3ea;
  --card: #ffffff;
  --ink: #1d1b18;
  --muted: #6f6a60;
  --line: #e2dccf;
  --accent: #e52521;
  --map: #1d1b18;
  --good: #2e9e4f;
  --bad: #d64534;
  --hint: #f2b705;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f; --card: #211f19; --ink: #f2eee4; --muted: #a39d90;
    --line: #36332a; --map: #f2eee4; --accent: #ff4d3d;
  }
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; overflow-y: scroll; }
[hidden] { display: none !important; }

/* scrolling background */
:root { --bg-fade: .11; --bg-speed: 45s; }
body::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  top: 0; bottom: 0; left: -400px; width: calc(100% + 400px);
  background: url("bg_tile.jpg") repeat 0 0 / 400px 400px;
  opacity: var(--bg-fade);
  animation: bg-scroll var(--bg-speed) linear infinite;
  will-change: transform;
}
@keyframes bg-scroll { from { transform: translateX(0); } to { transform: translateX(400px); } }
@media (prefers-color-scheme: dark) {
  body::before { filter: invert(1); opacity: .06; }
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Ranade", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.logo { margin: 0; font-size: 1.6rem; font-weight: 900; letter-spacing: .06em; }
.logo span { color: var(--accent); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); font-weight: 700;
}

/* game screens */
.game { width: 100%; max-width: 480px; margin: 0 auto; padding: 16px; flex: 1; }
.puzzle-no { text-align: center; color: var(--muted); margin: 0 0 10px; font-size: .9rem; }

/* minimap box */
.map-frame {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; aspect-ratio: 1; display: grid; place-items: center;
  --check: color-mix(in srgb, var(--line) 45%, var(--card));
  background-image:
    linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%),
    linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%);
  background-size: 28px 28px; background-position: 0 0, 14px 14px;
  background-color: var(--card);
}
#map { width: 100%; height: 100%; }

.map-frame.battle { background-color: #1b1a17; --check: #26241f; }
.map-frame.reveal { animation: pop .45s ease; }
.map-frame.won { border-color: var(--good); box-shadow: 0 0 0 2px var(--good), 0 0 28px color-mix(in srgb, var(--good) 45%, transparent); }
.map-frame.won canvas { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--good) 70%, transparent)); }
@keyframes pop { 50% { transform: scale(1.03); } }

/* hints */
.hints { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--line);
}
.hint:disabled { opacity: .55; cursor: not-allowed; }
.hint.shown:disabled { opacity: 1; cursor: default; }
.hint:not(:disabled) { border-style: solid; border-color: var(--hint); }
.hint.shown { background: var(--card); }
.hint-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hint-value { font-weight: 700; }
.hint-note { text-align: center; color: var(--muted); font-size: .85rem; margin: 8px 0 0; min-height: 1.2em; }

/* guess box */
.guess-form { display: flex; gap: 8px; margin-top: 14px; }
.combo { position: relative; flex: 1; }
.combo input {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.combo input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.suggestions {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.suggestions li { padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.suggestions li small { display: block; color: var(--muted); }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--bg); }
.go-btn {
  padding: 12px 18px; border: 0; border-radius: 10px; font-weight: 700;
  background: var(--accent); color: #fff;
}
.go-btn:disabled { opacity: .5; cursor: not-allowed; }

/* guess rows */
.guesses { list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid; }
.guesses li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.guesses li.empty { border-style: dashed; }
.guesses li.wrong { border-color: var(--bad); }
.guesses li.right { border-color: var(--good); }
.mark { font-weight: 900; }
.wrong .mark { color: var(--bad); }
.right .mark { color: var(--good); }

/* results */
.result {
  margin-top: 16px; padding: 16px; text-align: center; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.result h2 { margin: 0 0 6px; }
.answer { font-size: 1.25rem; font-weight: 800; margin: 4px 0; }
.answer-meta { color: var(--muted); margin: 0 0 12px; }
.next { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }

/* popups */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink);
  max-width: min(420px, calc(100vw - 32px)); padding: 20px 22px;
}
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin-top: 0; }
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; gap: 6px; }
.stats-row b { display: block; }
.stats-row span { font-size: .75rem; color: var(--muted); }
.dist { display: grid; gap: 4px; margin-bottom: 16px; }
.dist-row { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.dist-bar { background: var(--muted); color: #fff; padding: 2px 6px; border-radius: 4px; min-width: 22px; text-align: right; }
.dist-bar.today { background: var(--good); }

/* tabs */
.tabs { display: flex; justify-content: center; gap: 6px; padding: 12px 16px 0; }
.tab {
  width: 96px; padding: 8px 0; text-align: center; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-weight: 700; color: var(--muted);
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* draw mode */
.draw-track { text-align: center; margin: 0; font-size: 1.5rem; }
.draw-game { text-align: center; color: var(--muted); margin: 2px 0 12px; }
.pad-frame { position: relative; padding: 0; overflow: hidden; }
#pad { width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.pad-hint {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0;
  color: var(--muted); pointer-events: none; font-weight: 600;
}
.draw-tools { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 8px; margin-top: 12px; }
.tool-btn {
  padding: 12px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); font-weight: 600;
}
.tool-btn:disabled { opacity: .5; cursor: not-allowed; }
.peek-btn {
  width: 100%; margin-top: 10px; padding: 10px 14px; border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
  border: 1px dashed var(--peek); background: transparent; font-weight: 700;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.peek-btn small { color: var(--muted); font-weight: 600; }
.peek-btn.peeking { background: color-mix(in srgb, var(--peek) 22%, var(--card)); border-style: solid; }
.peek-btn:disabled { opacity: .45; cursor: not-allowed; border-color: var(--line); }
.big-score { font-size: 3.4rem; font-weight: 900; margin: 0; color: var(--accent); line-height: 1; }
.legend { font-size: .85rem; color: var(--muted); margin: 0 0 12px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.swatch.real { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.swatch.yours { background: var(--ink); }
.result-actions { display: flex; gap: 8px; justify-content: center; }

.empty-note { text-align: center; color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); }
.player {
  display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.play-btn {
  flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; font-size: 1.5rem;
}
.play-btn.playing { background: var(--ink); color: var(--bg); }
.timeline-wrap { flex: 1; }
.timeline {
  position: relative; height: 14px; border-radius: 7px; overflow: hidden;
  background: var(--line);
}
.tl-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--bg); z-index: 1; }
.tl-unlocked, .tl-progress { position: absolute; inset: 0 auto 0 0; width: 0; }
.tl-unlocked { background: color-mix(in srgb, var(--accent) 30%, transparent); transition: width .3s; }
.tl-progress { background: var(--accent); }
.time { margin: 6px 0 0; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.skip-btn { width: 100%; margin-top: 8px; }
.guesses li.skipped { border-style: dashed; }

/* bonus */
.bonus-tag { margin: 0; color: var(--good); font-weight: 700; }
.bonus-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.bonus-btn {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); text-align: center;
}
.bonus-btn:hover, .bonus-btn:focus-visible { border-color: var(--accent); }
.bonus-btn b { font-size: 1.1rem; }
.bonus-btn small { color: var(--muted); font-size: .72rem; }
.bonus-line { font-weight: 700; margin: 0 0 12px; }

.mode-switch {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .85rem; color: var(--muted); margin: 0 0 6px; cursor: pointer; user-select: none;
}
.mode-switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.result-actions .go-btn + .go-btn { background: var(--ink); color: var(--bg); }

/* toast */
.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }
.foot {
  margin-top: auto; padding: 28px 16px 18px; text-align: center;
  font-size: .72rem; line-height: 1.6; color: var(--muted);
}
.foot span { display: inline; }
.foot span + span::before { content: "·"; margin: 0 8px; opacity: .6; }
@media (max-width: 560px) { .foot span { display: block; } .foot span + span::before { content: none; } }

.hint, .guesses li.empty, .tab:not([aria-selected="true"]) {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}

/* tooltips */
.has-tip { position: relative; }
.has-tip::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translate(-50%, -4px); width: max-content; max-width: 240px;
  padding: 8px 10px; border-radius: 8px; background: var(--ink); color: var(--bg);
  font-size: .8rem; line-height: 1.35; text-align: center; white-space: normal;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: none; z-index: 20;
  opacity: 0; transition: opacity .15s, transform .15s;
}
.has-tip:hover::after, .has-tip:focus-within::after { opacity: 1; transform: translate(-50%, 0); }
.tip-text {
  text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: help;
}

@font-face { font-family: "Ranade"; src: url("fonts/Ranade-Variable.woff2") format("woff2"); font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Ranade"; src: url("fonts/Ranade-VariableItalic.woff2") format("woff2"); font-weight: 100 700; font-style: italic; font-display: swap; }

@font-face {
  font-family: "Orbitron"; src: url("fonts/Orbitron.ttf") format("truetype");
  font-weight: 400 900; font-display: swap;
}

/* side panels */
.stage { position: relative; display: flex; flex-direction: column; }
.side { display: contents; }
.hud { order: -1; }

.bonus-panel, .next-panel {
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: slide-in .25s ease;
}
.bonus-panel h2 { font-size: 1rem; line-height: 1.3; margin: 6px 0 12px; }
.bonus-panel .bonus-options { grid-template-columns: 1fr; }
.bonus-panel .bonus-btn { padding: 10px; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } }

/* race counter */
.hud {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: "Orbitron", system-ui, sans-serif;
  font-style: italic; text-transform: uppercase; user-select: none;
}
.hud:empty { display: none; }
.hud-mode {
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; color: var(--muted); font-style: normal;
}
.hud-main { display: flex; align-items: center; gap: 6px; }
.hud-flag { width: 32px; height: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.hud-big {
  font-size: 2.9rem; line-height: 1; font-weight: 900; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: #fff; padding: 0 .12em 0 .04em;
  --o: #1b1d2b;
  text-shadow:
    2px 0 0 var(--o), -2px 0 0 var(--o), 0 2px 0 var(--o), 0 -2px 0 var(--o),
    1.5px 1.5px 0 var(--o), -1.5px 1.5px 0 var(--o), 1.5px -1.5px 0 var(--o), -1.5px -1.5px 0 var(--o),
    0 5px 0 var(--o), 0 8px 12px rgba(0,0,0,.4);
}
.hud-big small { font-size: .55em; margin-left: .04em; }
.hud-sub { font-size: .72rem; color: var(--muted); font-style: normal; letter-spacing: .04em; text-transform: none; }

@media (min-width: 900px) {
  .side { display: block; position: absolute; top: 0; width: 190px; }
  .side-left { right: calc(100% + 20px); }
  .side-right { left: calc(100% + 20px); }
  .hud { align-items: flex-start; padding-top: 4px; }
  .hud-big { font-size: 3.4rem; }
  .hud-flag { width: 42px; }
}

@media (max-width: 899.98px) {
  .hud { flex-direction: row; justify-content: center; gap: 10px; margin: 0 0 10px; }
  .hud-big { font-size: 2rem; }
  .hud-flag { width: 24px; }
  .bonus-panel {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
    max-width: 460px; margin: 0 auto; animation-name: slide-up;
  }
  .bonus-panel .bonus-options { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
}
@keyframes slide-up { from { opacity: 0; transform: translateY(16px); } }

/* mode header */
.mode-head {
  display: grid; grid-template-rows: 26px auto auto auto; align-content: start; justify-items: center;
  height: 99px; margin: 0 0 14px; padding: 10px 16px 12px; text-align: center;
  background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line); border-radius: var(--radius);
}
.mode-head-switches { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: nowrap; }
.mode-head-switches .mode-switch { margin: 0; white-space: nowrap; }
.mode-kicker {
  margin: 6px 0 2px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.mode-title {
  margin: 0; font-size: 1.45rem; line-height: 1.2; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 420px) {
  .mode-head { height: 93px; padding: 8px 10px 10px; }
  .mode-head-switches { gap: 10px; font-size: .8rem; }
  .mode-title { font-size: 1.25rem; }
}

/* next race panel */
.next-panel { display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: center; }
.next-panel h2 { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.25; }
.next-btn { width: 100%; }
.next-panel small { color: var(--muted); font-size: .72rem; }
@media (max-width: 899.98px) {
  .next-panel {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
    max-width: 460px; margin: 0 auto; flex-direction: row; align-items: center; padding: 10px 12px;
    animation: slide-up .25s ease;
  }
  .next-panel h2, .next-panel small { display: none; }
}

/* side cards */
.side-card {
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); text-align: center;
}
.side-tag { margin: 0 0 8px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hints-card .hints { margin-top: 0; }
.hints-card .hint-note { margin-top: 8px; font-size: .78rem; min-height: 0; }
.hints-card .hint-note:empty { display: none; }

.game-card {
  --game: var(--hint);
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--game) 22%, #17161b), #121115 70%);
  color: #f2eee4; border: 2px solid var(--game);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 22px color-mix(in srgb, var(--game) 35%, transparent);
}
.game-card .side-tag { color: var(--game); }
.game-card-logo {
  display: block; width: 100%; max-height: 92px; object-fit: contain; margin: 4px auto 6px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.5));
}
.game-card-logo[hidden] { display: none; }
.game-card-name { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.25; }
.game-card-console {
  display: inline-block; margin: 4px 0 0; padding: 2px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: var(--game);
  border: 1px solid color-mix(in srgb, var(--game) 60%, transparent);
}
.game-card-note { margin: 8px 0 0; font-size: .8rem; font-weight: 700; color: var(--game); }

@media (min-width: 900px) {
  .side-card { margin-top: 16px; }
  .hints-card .hints { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 899.98px) {
  .hints-card { order: 1; margin-top: 12px; padding: 12px; box-shadow: none; }
  .game-card { order: -1; margin: 0 0 12px; padding: 10px 12px; box-shadow: none; }
  .game-card .side-tag { margin-bottom: 4px; }
  .game-card-logo { max-height: 60px; width: auto; max-width: 70%; }
}

/* peeks */
.peek-card { --peek: #808080; }
.peek-card[hidden] { display: none; }
.peek-card .peek-btn {
  margin-top: 0; flex-direction: column; justify-content: center; gap: 4px; padding: 14px 10px;
  background: color-mix(in srgb, var(--peek) 8%, transparent);
}
.peek-icon { font-size: 1.6rem; line-height: 1; }
.peek-label { font-size: 1rem; }
.peek-note { margin: 8px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.35; }
@media (min-width: 900px) {
  .side-left .peek-card { margin-top: 0; }
  .peek-card + #draw-bonus-slot:not(:empty) { margin-top: 12px; }
}
@media (max-width: 899.98px) {
  .peek-card { order: 1; margin-top: 10px; padding: 10px 12px; box-shadow: none; }
  .peek-card .side-tag, .peek-card .peek-note { display: none; }
  .peek-card .peek-btn { flex-direction: row; justify-content: space-between; padding: 10px 14px; }
  .peek-icon { font-size: 1.1rem; }
}

/* fonts */
@font-face { font-family: "Racers Delight"; src: url("fonts/RacersDelight.otf") format("opentype"); font-display: swap; }
.logo { color: inherit; text-decoration: none; }
.logo.on-home { visibility: hidden; }

/* home */
.home {
  flex: 1; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 460px); justify-content: center;
  align-items: center; gap: 40px; padding: 30px 24px 60px;
}
.home[hidden] { display: none; }
.home-welcome, .home-title, .menu-label, .menu-section { font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; }
.home-welcome {
  margin: 0 0 4px 6px; font-size: 1.5rem; letter-spacing: .04em; color: #ffd400; transform: rotate(-3deg); transform-origin: left;
  text-shadow: 2px 0 0 #1b1d2b, -2px 0 0 #1b1d2b, 0 2px 0 #1b1d2b, 0 -2px 0 #1b1d2b, 0 4px 0 #1b1d2b;
}
.home-title {
  margin: 0 0 26px; font-size: clamp(2.8rem, 7.5vw, 4.6rem); letter-spacing: .02em; line-height: 1; color: #fff;
  transform: rotate(-3deg); transform-origin: left;
  text-shadow: 3px 0 0 #1b1d2b, -3px 0 0 #1b1d2b, 0 3px 0 #1b1d2b, 0 -3px 0 #1b1d2b, 2px 2px 0 #1b1d2b, -2px -2px 0 #1b1d2b,
               2px -2px 0 #1b1d2b, -2px 2px 0 #1b1d2b, 0 7px 0 #1b1d2b, 0 12px 18px rgba(0,0,0,.4);
}
.home-title span { color: var(--accent); }

/* home menu */
.home-menu { display: flex; flex-direction: column; gap: 6px; }
.menu-section {
  margin: 6px 0 2px 8px; font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.menu-section::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--line), transparent); }
.menu-section:not(:first-child) { margin-top: 18px; }
.menu-item { position: relative; display: flex; align-items: center; height: 74px; text-decoration: none; color: #fff; outline: none; }
.menu-item:nth-of-type(2) { margin-left: 22px; }
.menu-item:nth-of-type(3) { margin-left: 38px; }
.menu-item.menu-free { margin-left: 50px; }

.menu-banner {
  position: relative; display: flex; flex-direction: column; justify-content: center; height: 62px; flex: 1;
  padding: 0 60px 0 28px; transform: skewX(-10deg);
  background: linear-gradient(90deg, rgba(14,13,16,.92), rgba(14,13,16,.75) 60%, rgba(14,13,16,0));
  -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent);
          mask-image: linear-gradient(90deg, #000 70%, transparent);
  transition: background .15s ease, transform .15s ease;
}
.menu-label, .menu-desc { transform: skewX(10deg); }
.menu-label {
  font-size: 2.1rem; letter-spacing: .02em; line-height: 1.05;
  text-shadow: 2px 0 0 #1b1d2b, -2px 0 0 #1b1d2b, 0 2px 0 #1b1d2b, 0 -2px 0 #1b1d2b, 0 4px 0 #1b1d2b;
  transition: color .15s ease;
}
.menu-desc {
  max-height: 0; overflow: hidden; opacity: 0; font-weight: 800; font-size: .88rem; color: #f2eee4;
  transition: max-height .18s ease, opacity .18s ease;
}
.menu-item:hover .menu-label, .menu-item:focus-visible .menu-label { color: #ffd400; }
.menu-item:hover .menu-desc, .menu-item:focus-visible .menu-desc { max-height: 1.4em; opacity: 1; }
.menu-item:hover .menu-banner, .menu-item:focus-visible .menu-banner {
  transform: skewX(-10deg) translateX(8px);
  background: linear-gradient(90deg, rgba(0,0,0,.97), rgba(0,0,0,.85) 65%, rgba(0,0,0,0));
}

/* home preview cards */
.home-hero { position: relative; display: grid; place-items: center; }
.hero-stack { position: relative; width: min(380px, 100%); aspect-ratio: 1; }
.hero-card {
  position: absolute; inset: 0; padding: 34px; border-radius: 22px; overflow: hidden;
  background-color: #1b1a17; border: 3px solid #ffd400; --check: #26241f;
  background-image:
    linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%),
    linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%);
  background-size: 28px 28px; background-position: 0 0, 14px 14px;
  box-shadow: 0 8px 0 #1b1d2b, 0 24px 50px rgba(0,0,0,.45);
  transition: transform .3s ease, opacity .3s ease;
}
.hero-card img, .hp-drawn { position: absolute; inset: 34px; width: calc(100% - 68px); height: calc(100% - 68px); object-fit: contain; }
.hero-card.main { transform: rotate(5deg); z-index: 4; }
.hp-track { transition: opacity .25s; }
.hero-card.back { opacity: 0; transform: rotate(5deg) scale(.9); border-color: var(--line); }
.hero-card.back img { opacity: .7; }

.hp-real, .hp-drawn, .hp-guess, .hp-score, .hp-player, .hp-notes, .hp-free { opacity: 0; transition: opacity .25s ease, transform .25s ease; }
.hp-drawn path { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.hp-guess { position: absolute; left: 22px; right: 22px; bottom: 20px; display: grid; gap: 6px; transform: translateY(10px); }
.hp-row { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; font-weight: 800; font-size: .85rem;
          background: rgba(20,19,16,.92); border: 2px solid; }
.hp-row.bad { border-color: var(--bad, #d64534); color: #f2eee4; } .hp-row.bad b { color: var(--bad, #d64534); }
.hp-row.good { border-color: var(--good); color: #f2eee4; } .hp-row.good b { color: var(--good); }
.hp-score { position: absolute; right: 18px; top: 14px; font: 900 2.4rem/1 "Orbitron", system-ui; color: #fff;
            text-shadow: 2px 0 0 #1b1d2b, -2px 0 0 #1b1d2b, 0 2px 0 #1b1d2b, 0 -2px 0 #1b1d2b, 0 4px 0 #1b1d2b; transform: scale(.8); }
.hp-player { position: absolute; left: 22px; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
             border-radius: 14px; background: rgba(20,19,16,.92); transform: translateY(10px); }
.hp-play { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }
.hp-bar { flex: 1; height: 10px; border-radius: 5px; background: #3a3730; overflow: hidden; }
.hp-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.hp-notes span { position: absolute; font-size: 2.2rem; color: #ffd400; text-shadow: 0 3px 0 #1b1d2b; }
.hp-notes span:nth-child(1) { left: 16%; top: 14%; } .hp-notes span:nth-child(2) { right: 18%; top: 22%; } .hp-notes span:nth-child(3) { left: 46%; top: 6%; }
.hp-free { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px;
           font: 400 1.2rem/1.2 "Racers Delight", "Titan One", sans-serif; color: #1b1d2b; background: #ffd400; white-space: nowrap; }

.home-hero[data-preview="guess"] .hp-guess { opacity: 1; transform: none; }

.home-hero[data-preview="draw"] .hp-track { opacity: 0; }
.home-hero[data-preview="draw"] .hp-real, .home-hero[data-preview="draw"] .hp-drawn { opacity: 1; }
.home-hero[data-preview="draw"] .hp-score { opacity: 1; transform: none; transition-delay: .15s; }

.home-hero[data-preview="music"] .hp-track { opacity: .25; }
.home-hero[data-preview="music"] .hp-player, .home-hero[data-preview="music"] .hp-notes { opacity: 1; transform: none; }
.home-hero[data-preview="music"] .hp-bar i { animation: hp-play 3s linear infinite; }
.home-hero[data-preview="music"] .hp-notes span { animation: hp-float 1.6s ease-in-out infinite alternate; }
.home-hero[data-preview="music"] .hp-notes span:nth-child(2) { animation-delay: .4s; }
.home-hero[data-preview="music"] .hp-notes span:nth-child(3) { animation-delay: .8s; }
@keyframes hp-play { from { width: 0; } to { width: 100%; } }
@keyframes hp-float { to { transform: translateY(-10px) rotate(-8deg); } }

.home-hero[data-preview="free"] .hero-card.back { opacity: 1; }
.home-hero[data-preview="free"] .b1 { transform: rotate(-16deg) translate(-150px, 40px) scale(.62); }
.home-hero[data-preview="free"] .b2 { transform: rotate(-3deg) translate(-40px, -150px) scale(.62); }
.home-hero[data-preview="free"] .b3 { transform: rotate(14deg) translate(150px, 60px) scale(.62); }
.home-hero[data-preview="free"] .hero-card.main { transform: rotate(5deg) scale(.72) translateY(40px); }
.home-hero[data-preview="free"] .hp-free { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .home-hero .hp-bar i, .home-hero .hp-notes span { animation: none !important; } }

@media (max-width: 899.98px) {
  .home { grid-template-columns: minmax(0, 520px); padding-top: 18px; }
  .home-hero { display: none; }
  .menu-item { height: 68px; }
  .menu-label { font-size: 1.7rem; }
}

@media (hover: none) {
  .menu-desc { max-height: 1.4em; opacity: 1; }
}

/* mode tabs */
.screen-nav { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px 16px 0; flex-wrap: wrap; }
.screen-nav[hidden], .screen-nav .tabs[hidden] { display: none; }
.screen-nav .tabs { padding: 0; }
.back-btn {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap;
}
.back-btn:hover, .back-btn:focus-visible { border-color: var(--accent); }
a.tab { text-decoration: none; display: inline-block; }
.mode-tag { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.topbar .logo { font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; letter-spacing: .03em; font-size: 1.9rem; }

/* results on the side */
.result.in-side {
  margin: 0 0 12px; padding: 16px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: slide-in .25s ease;
}
.result.in-side[hidden] { display: none; }
.result.in-side h2 { font-size: 1.15rem; line-height: 1.25; }
.result.in-side .big-score { font-size: 2.8rem; }
.result.in-side .answer { font-size: 1.05rem; }
.result.in-side .answer-meta, .result.in-side .legend, .result.in-side .next { font-size: .8rem; }
.result.in-side .bonus-line { font-size: .85rem; }
.result.in-side .result-actions { flex-direction: column; }
.result.in-side .result-actions .go-btn, .result.in-side .result-actions .tool-btn { width: 100%; }
.side-left .result.in-side + .bonus-panel, .side-left .bonus-panel + .result.in-side { margin-top: 12px; }

/* stats */
.stats-icon { display: grid; place-items: center; padding: 0; }
.stats-icon svg { width: 24px; height: 10px; }
#stats-dialog { width: min(440px, calc(100vw - 32px)); }
.stats-tabs { display: flex; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.stats-tab {
  flex: 1; padding: 7px 0; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-weight: 800; font-size: .85rem;
}
.stats-tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stats-body { min-height: 240px; }
.stats-body h3 { margin: 16px 0 8px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stats-body h3:first-child { margin-top: 0; }
.stats-row b { font-size: 1.45rem; }
.dist-label { width: 44px; flex: none; text-align: right; color: var(--muted); font-size: .78rem; }
.stats-note { color: var(--muted); font-size: .85rem; text-align: center; margin: 18px 0; }

#stats-dialog h2 { font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; font-size: 1.8rem; letter-spacing: .02em; }

.topbar-spacer { width: 38px; height: 38px; }

.result[hidden] + .free-promo { display: none; }
.free-promo { margin-top: 12px; }
.free-promo h2 { margin-bottom: 12px; }
.free-promo a.go-btn { display: inline-block; text-decoration: none; text-align: center; }

.meta-logo {
  display: inline-flex; align-items: center; justify-content: center; max-width: 100%;
  padding: 8px 12px; border-radius: 10px; background: #17161b; color: #f2eee4; font-weight: 800; font-size: .9rem;
}
.meta-logo img { display: block; max-width: 160px; max-height: 54px; object-fit: contain; }
.meta-sub { display: block; margin-top: 8px; }

.bonus-line.right { color: var(--good); }
.bonus-line.wrong { color: var(--bad); }

.free-promo .if-lose { display: none; }
.result[data-outcome="lose"] + .free-promo .if-win { display: none; }
.result[data-outcome="lose"] + .free-promo .if-lose { display: inline; }

/* draw pad */
.pad-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 28px; border-radius: 22px;
  border: 0; background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink);
  box-shadow: 0 10px 30px rgba(0,0,0,.3); cursor: pointer; transition: transform .12s ease;
}
.pad-play[hidden] { display: none; }
.pad-play:hover, .pad-play:focus-visible { transform: translate(-50%, -50%) scale(1.05); outline: none; }
.pad-play-icon {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; padding-left: 5px;
  background: var(--accent); color: #fff; font-size: 1.8rem; box-shadow: inset 0 -4px 0 rgba(0,0,0,.2);
}
.pad-play small { color: var(--muted); font-size: .78rem; }

.pad-timer { position: absolute; left: 12px; top: 12px; z-index: 2; width: 44px; height: 44px; pointer-events: none; }
.pad-timer[hidden] { display: none; }
.pad-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pad-timer circle { fill: none; stroke-width: 4; }
.pt-track { stroke: color-mix(in srgb, var(--ink) 18%, transparent); fill: color-mix(in srgb, var(--card) 80%, transparent) !important; }
.pt-ring { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 0; }
.pad-timer span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 900 .95rem/1 "Orbitron", system-ui, sans-serif; color: var(--ink);
}

#draw .mode-kicker { color: var(--game, var(--accent)); }
#draw .pad-play-icon { background: var(--game, var(--accent)); color: var(--game-ink, #fff); }
#draw .pt-ring { stroke: var(--game, var(--accent)); }
#draw #draw-done { background: var(--game, var(--accent)); color: var(--game-ink, #fff); }

/* suggestions */
.suggestions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sg-name { min-width: 0; font-weight: 600; }
.sg-name mark { background: none; color: var(--accent); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.g-chip {
  display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: .68rem; font-weight: 800; letter-spacing: .02em;
  background: var(--c); color: var(--ci); vertical-align: 1px; white-space: nowrap;
}
.sg-name .g-chip { font-size: .72rem; margin-right: 2px; }
.suggestions li.used { opacity: .45; cursor: default; }
.suggestions li.used:hover { background: none; }
.suggestions li.used .sg-name { text-decoration: line-through; text-decoration-thickness: 2px; }
.suggestions li.used mark { color: inherit; text-decoration: none; }

.menu-item.menu-practice { margin-left: 62px; }

/* kartography */
.practice { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 16px 60px; }
.practice[hidden] { display: none; }
.pr-title { margin: 6px 0 0; text-align: center; font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; font-size: 2.6rem; }
.pr-sub { margin: 4px 0 22px; text-align: center; color: var(--muted); }
.pr-games { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.pr-game, .pr-head {
  --game: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid var(--game);
  color: #f2eee4;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--game) 22%, #17161b), #121115 70%);
}
.pr-game img { max-width: 100%; }
.pr-game small { font-weight: 800;
  font-size: .78rem; }
.pr-head { max-width: 320px; margin: 0 auto 16px; padding: 14px 20px; }
.pr-head img { max-width: 100%; max-height: 70px; object-fit: contain; }
.pr-track {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700;
}
.pr-track:hover, .pr-track:focus-visible { border-color: var(--accent); outline: none; }
.pr-course { text-align: center; margin: 0 0 18px; font-size: 1.7rem; }
.pr-secret { background: linear-gradient(90deg, #ffd400, #ff7a1a); color: #1b1d2b; }

/* track page */
.pr-variants { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.pr-variant { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 800; }
.pr-variant[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pr-view { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.pr-map {
  position: relative; aspect-ratio: 1; padding: 34px; border-radius: var(--radius); border: 2px solid var(--game);
  background-color: #1b1a17; --check: #26241f;
  background-image:
    linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%),
    linear-gradient(45deg, var(--check) 25%, transparent 25%, transparent 75%, var(--check) 75%);
  background-size: 28px 28px; background-position: 0 0, 14px 14px;
}
.pr-map img { width: 100%; height: 100%; object-fit: contain; }
.pr-draw {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: .9rem;
  background: var(--game); color: #1b1d2b; box-shadow: 0 6px 16px rgba(0,0,0,.4); transition: transform .12s ease, font-size .12s ease;
}
.pr-draw:hover, .pr-draw:focus-visible { transform: translateY(-2px); font-size: .94rem; outline: none; }
.pr-draw.pr-secret { background: linear-gradient(90deg, #ffd400, #ff7a1a); }
.pr-notes { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.pr-notes .side-tag { color: var(--game); margin: 0; }
.pr-notes textarea {
  width: 100%; box-sizing: border-box; min-height: 180px; resize: vertical; padding: 10px; border-radius: 8px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink);
  font: inherit; font-size: .9rem; line-height: 1.45;
}
.pr-notes textarea:focus { outline: none; border-color: var(--game); box-shadow: 0 0 0 2px color-mix(in srgb, var(--game) 35%, transparent); }
.pr-notes textarea::placeholder { color: var(--muted); font-style: italic; }
.pr-notes-status { color: var(--muted); font-size: .72rem; }
@media (max-width: 700px) { .pr-view { grid-template-columns: 1fr; } }

/* map rain */
.hp-physics { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.hp-physics.on { opacity: 1; }
.hp-physics canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-hero[data-preview="kart"] .hp-track { opacity: 0; transition: none; }
.hp-lakitu {
  position: absolute; top: 6px; left: 0; width: 70px; opacity: 0;
  filter: drop-shadow(0 5px 6px rgba(0,0,0,.45)); transition: opacity .4s ease;
}
.hp-lakitu.in { opacity: 1; animation: hp-lakitu 6s ease-in-out infinite, hp-bob 1.6s ease-in-out infinite; }
@keyframes hp-lakitu {
  0%   { left: 4%;  transform: scaleX(1); }
  48%  { left: calc(96% - 70px); transform: scaleX(1); }
  50%  { left: calc(96% - 70px); transform: scaleX(-1); }
  98%  { left: 4%;  transform: scaleX(-1); }
  100% { left: 4%;  transform: scaleX(1); }
}
@keyframes hp-bob { 0%, 100% { top: 6px; } 50% { top: 16px; } }
@media (prefers-reduced-motion: reduce) { .hp-lakitu.in { animation: none; left: calc(50% - 35px); } }
.hero-card img.hp-lakitu { inset: auto; top: 6px; width: 70px; height: auto; }

/* cups */
.pr-cups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; align-items: start; }
.practice:has(.pr-cups) { max-width: 1080px; }
.pr-cup h3 {
  margin: 0 0 8px; padding-bottom: 6px; border-bottom: 3px solid var(--game);
  font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; font-size: 1.25rem; letter-spacing: .02em;
}
.pr-cup ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pr-cup .pr-track { padding: 8px 10px; font-size: .92rem; }
@media (max-width: 899.98px) { .pr-cups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; } }
@media (max-width: 560px) { .pr-cups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .pr-cup h3 { font-size: 1.05rem; } .pr-cup .pr-track { padding: 7px 8px; font-size: .84rem; } }

.home-hero.hp-egg[data-preview="music"] .hp-track { opacity: .5; }

.menu-section.menu-divider { gap: 0; }

/* similar tracks */
.pr-similar { margin-top: 18px; }
.pr-similar .side-tag { margin: 0 0 8px; }
.pr-similar-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pr-game.pr-sim { min-height: 0;
  width: 150px;
  height: 64px; }

/* item box */
.item-box {
  position: relative; width: 48px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35));
}
.item-box img { width: 100%; height: 100%; object-fit: contain; transition: transform .15s ease; animation: item-bob 2.4s ease-in-out infinite; }
.item-box:hover img, .item-box:focus-visible img { transform: scale(1.12) rotate(-6deg); }
.item-box:focus-visible { outline: 2px solid #ffd400; outline-offset: 4px; border-radius: 12px; }
.item-box.spin img { animation: item-spin .45s ease; }
@keyframes item-bob { 50% { translate: 0 -4px; } }
@keyframes item-spin { from { rotate: 0deg; scale: .8; } to { rotate: 360deg; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .item-box img, .item-box.spin img { animation: none; } }

.item-box::after {
  content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); transform: translate(-50%, -4px);
  white-space: nowrap; padding: 5px 9px; border-radius: 8px; font: 700 .75rem/1 "Ranade", system-ui, sans-serif;
  background: #1b1a17; color: #f2eee4; border: 1px solid #ffd400; opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease; z-index: 5;
}
.item-box:hover::after, .item-box:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

.mode-head { position: relative; }
.mode-head > .item-box { position: absolute; top: 50%; left: calc(100% + 20px); transform: translateY(-50%); }
@media (max-width: 899.98px) { .mode-head > .item-box { left: auto; right: 8px; top: 8px; transform: none; width: 38px; height: 38px; } }

.pr-titlewrap { text-align: center; }
.pr-titleblock { position: relative; display: inline-block; }
.pr-titleblock .pr-sub { margin-bottom: 0; }
.pr-titlewrap { margin-bottom: 22px; }
.pr-titleblock > .item-box { position: absolute; top: 50%; left: calc(100% + 14px); transform: translateY(-50%); }

.pr-headrow { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.pr-headrow .pr-head { margin: 0; }
@media (max-width: 560px) { .pr-titleblock > .item-box { left: calc(100% + 6px); width: 36px; height: 36px; } .pr-headrow > .item-box { width: 38px; height: 38px; } }

/* favorites */
.pr-fav { position: absolute; top: 10px; left: 10px; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.pr-fav > * { grid-area: 1 / 1; transition: opacity .35s ease, transform .35s ease; }
.pr-fav .pr-fav-empty { width: 34px; height: 34px; fill: none; stroke: #f2eee4; stroke-width: 1.8; stroke-linejoin: round; opacity: .75; }
.pr-map .pr-fav .pr-fav-full { width: 42px; height: 42px; object-fit: contain; opacity: 0; transform: scale(.4); filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
.pr-fav:hover .pr-fav-empty { opacity: 1; stroke: #ffd400; }
.pr-fav.on .pr-fav-empty { opacity: 0; transform: scale(.4); }
.pr-map .pr-fav.on .pr-fav-full { opacity: 1; transform: none; }

.pr-fav.spin { animation: fav-spin .6s cubic-bezier(.45, .05, .35, 1), fav-pop .6s ease-in-out; }
@keyframes fav-spin { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes fav-pop { 50% { scale: 1.2; } }
.pr-fav:focus-visible { outline: 2px solid #ffd400; outline-offset: 2px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .pr-fav.spin { animation: none; } }

.pr-favs { margin-top: 30px; }
.pr-favs-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 3px solid #ffd400;
  font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; font-size: 1.6rem; }
.pr-favs-title img { width: 34px; height: 34px; object-fit: contain; }
.pr-favs-empty { color: var(--muted); margin: 6px 0 0; }
.pr-favgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pr-favcard {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; text-decoration: none; color: #f2eee4;
  border-radius: var(--radius); border: 2px solid var(--game); background: #1b1a17; transition: transform .12s ease, box-shadow .12s ease;
}
.pr-favcard:hover, .pr-favcard:focus-visible { transform: translateY(-3px); box-shadow: 0 0 18px color-mix(in srgb, var(--game) 45%, transparent); outline: none; }
.pr-favcard-map { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.pr-favcard-map img { width: 88%; height: 88%; object-fit: contain; }
.pr-favcard-name { font-weight: 800; font-size: .85rem; text-align: center; line-height: 1.2; }
.pr-favcard > img { max-width: 80%; max-height: 26px; object-fit: contain; }

.pr-headrow .pr-head { flex: 0 0 auto;
  height: 100px;
  box-sizing: border-box;
  padding: 12px 20px; }
.pr-headrow .pr-head img { max-width: 100%; max-height: 70px; width: auto; height: auto; object-fit: contain; }

.pr-favitem { position: relative; transition: transform .12s ease; }
.pr-favitem .pr-favcard { height: 100%; box-sizing: border-box; }
.pr-favitem .pr-favcard:hover, .pr-favitem .pr-favcard:focus-visible { transform: none; }
.pr-favitem:hover { transform: translateY(-3px); }
.pr-favitem:hover .pr-favcard { box-shadow: 0 0 18px color-mix(in srgb, var(--game) 45%, transparent); }
.pr-favx {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
  opacity: .65; transition: opacity .15s ease, transform .15s ease;
}
.pr-favx i {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 2.5px; margin: -1.25px 0 0 -9px; border-radius: 2px;
  background: #f2eee4; transition: transform .22s cubic-bezier(.5,0,.75,0);
}
.pr-favx i:first-child { transform: rotate(45deg); }
.pr-favx i:last-child { transform: rotate(-45deg); }
.pr-favx:hover, .pr-favx:focus-visible { opacity: 1; transform: scale(1.12); outline: none; }
.pr-favx:focus-visible i { background: #ffd400; }

.pr-favitem.gone .pr-favx { opacity: 1; }
.pr-favitem.gone .pr-favx i:first-child { transform: rotate(45deg) scaleX(0); }
.pr-favitem.gone .pr-favx i:last-child { transform: rotate(-45deg) scaleX(0); }
.pr-favitem.gone { pointer-events: none; animation: fav-out .34s ease forwards; }
@keyframes fav-out { 0%, 30% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) { .pr-favitem.gone { animation-duration: .01s; } }

.pr-headrow { position: relative; --head-w: min(320px, calc(100vw - 110px)); }
.pr-headrow .pr-head { width: var(--head-w); }
.pr-headrow > .item-box { position: absolute; top: 50%; left: calc(50% + var(--head-w) / 2 + 14px); transform: translateY(-50%); }
@media (max-width: 560px) { .pr-headrow > .item-box { left: calc(50% + var(--head-w) / 2 + 8px); } }

.pr-mapcol { min-width: 0; }
.pr-seq { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.pr-seq-btn {
  padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 800; text-decoration: none; white-space: nowrap;
  color: #f2eee4; background: #1b1a17; border: 1px solid var(--game); transition: background .15s ease, transform .12s ease;
}
a.pr-seq-btn:hover, a.pr-seq-btn:focus-visible { background: color-mix(in srgb, var(--game) 30%, #1b1a17); transform: translateY(-1px); outline: none; }
.pr-seq-btn[aria-disabled="true"] { opacity: .35; border-color: var(--line); cursor: not-allowed; }

/* game arrows */
.pr-gamearrow {
  position: fixed; top: 50%; z-index: 5; transform: translateY(-50%);
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font: 400 2.6rem/1 "Ranade", system-ui, sans-serif; padding-bottom: 6px; box-sizing: border-box; text-decoration: none;
  color: #f2eee4; background: rgba(20,19,17,.85); border: 2px solid var(--game, var(--line));
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.pr-gamearrow.left { left: max(10px, calc(50% - 620px)); }
.pr-gamearrow.right { right: max(10px, calc(50% - 620px)); }
a.pr-gamearrow:hover, a.pr-gamearrow:focus-visible {
  transform: translateY(-50%) scale(1.1); outline: none;
  background: color-mix(in srgb, var(--game) 28%, #141311); box-shadow: 0 0 18px color-mix(in srgb, var(--game) 50%, transparent);
}
.pr-gamearrow[aria-disabled="true"] { opacity: .3; border-color: var(--line); cursor: not-allowed; }
@media (max-width: 760px) { .pr-gamearrow { width: 36px; height: 36px; font-size: 1.8rem; padding-bottom: 4px; }
  .pr-gamearrow.left { left: 4px; } .pr-gamearrow.right { right: 4px; } }

/* home/back buttons */
.topbar-center { display: flex; align-items: center; gap: 14px; }
.topbar-center.on-home .nav-circle { visibility: hidden; }
.nav-circle {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: #d6d3cc; color: #2b2a27; text-decoration: none;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.25);
  opacity: .78; transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.nav-circle svg { width: 21px; height: 21px; fill: currentColor; }
.nav-circle:hover, .nav-circle:focus-visible { opacity: 1; transform: translateY(-1px); background: #e6e3dc; outline: none; }
.nav-circle:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
@media (max-width: 420px) { .topbar-center { gap: 8px; } .nav-circle { width: 28px; height: 28px; } .nav-circle svg { width: 18px; height: 18px; }
  .topbar .logo { font-size: 1.55rem; } }

.topbar .logo { display: inline-block; user-select: none; cursor: default; }
.topbar .logo, .topbar .logo span { transition: color .25s ease; }
.topbar .logo.swapped { color: var(--accent); }
.topbar .logo.swapped span { color: var(--ink); }
.topbar .logo.bounce { animation: logo-bounce .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes logo-bounce { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-6px) scale(1.06); } 70% { transform: translateY(1px) scale(.98); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .topbar .logo.bounce { animation: none; } }

#draw .big-score { color: var(--game, var(--accent)); }
#draw .result, #draw .next-panel { border-color: var(--game, var(--line)); box-shadow: 0 0 0 1px var(--game, transparent), 0 10px 30px rgba(0,0,0,.25); }
#draw .go-btn { background: var(--game, var(--accent)); color: var(--game-ink, #fff); }
#draw .swatch.real { background: color-mix(in srgb, var(--game, var(--accent)) 55%, transparent); }

/* stabilizer */
.stabilizer { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 8px; font-size: .78rem; }
.stab-label { color: var(--muted); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; cursor: help; }
.stabilizer button {
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.stabilizer button:hover { color: var(--ink); }
.stabilizer button[aria-checked="true"] { background: var(--game, var(--accent)); border-color: var(--game, var(--accent)); color: var(--game-ink, #fff); }

@media (max-width: 560px) {
  .menu-item { height: auto; min-height: 68px; }
  .menu-banner { height: auto; min-height: 58px; padding: 8px 26px 8px 22px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .menu-desc, .menu-item:hover .menu-desc { max-height: 2.8em; font-size: .8rem; line-height: 1.3; }
  .menu-item:nth-of-type(2) { margin-left: 10px; } .menu-item:nth-of-type(3) { margin-left: 18px; }
  .menu-item.menu-free { margin-left: 24px; } .menu-item.menu-practice { margin-left: 32px; }
}
.mode-switch[hidden] { display: none !important; }

/* seen in dailies */
.pr-progress { max-width: 560px; margin: 0 auto 20px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 80%, transparent); }
.pr-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.pr-progress-top b { font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; font-size: 1.15rem; letter-spacing: .02em; }
.pr-progress-top span { color: var(--muted); font-weight: 700; }
.pr-progress-top strong { color: var(--ink); font-size: 1.15rem; }
.pr-progress-bar { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.pr-progress-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd400, #ff8a00); transition: width .4s ease; }
.pr-progress-note { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }
.pr-progress-note b { color: var(--ink); }
.pr-game-seen { font-weight: 700 !important;
  font-size: .7rem !important; }
.pr-track.seen { position: relative; padding-right: 28px; }
.pr-track.seen::after { content: "\2713"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #4caf50; font-weight: 900; }
.pr-seen-badge { margin: -6px 0 10px; text-align: center; font-size: .78rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.pr-seen-badge.on { color: #4caf50; }

body { overflow-x: clip; }
@media (max-width: 560px) { .item-box::after { left: auto; right: 0; transform: translateY(-4px); }
  .item-box:hover::after, .item-box:focus-visible::after { transform: none; } }

/* daily tabs */
#daily-tabs .tab { width: auto; padding: 8px 16px; white-space: nowrap; }
@media (max-width: 420px) { #daily-tabs { gap: 4px; } #daily-tabs .tab { padding: 7px 10px; font-size: .82rem; } }

.pr-progress { cursor: pointer; transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease; }
.pr-progress:hover, .pr-progress:focus-visible { border-color: #ffd400; transform: translateY(-2px); box-shadow: 0 0 16px rgba(255,212,0,.18); outline: none; }
.pr-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s ease; }
.pr-modal.in { opacity: 1; }
.pr-modal-card { position: relative; width: min(860px, 100%); max-height: min(80vh, 760px); overflow-y: auto; box-sizing: border-box;
  padding: 18px 20px 22px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); transform: translateY(10px) scale(.98); transition: transform .2s ease; }
.pr-modal.in .pr-modal-card { transform: none; }
.pr-modal-card .pr-favs-title { padding-right: 34px; }
.pr-modal-card .pr-favs-title small { margin-left: auto; font-family: "Ranade", system-ui, sans-serif; font-size: .9rem; color: var(--muted); font-weight: 700; }
.pr-modal-x { top: 14px; right: 14px; z-index: 2; }
.pr-modal-card.closing .pr-modal-x { opacity: 1; }
.pr-modal-card.closing .pr-modal-x i:first-child { transform: rotate(45deg) scaleX(0); }
.pr-modal-card.closing .pr-modal-x i:last-child { transform: rotate(-45deg) scaleX(0); }
body.pr-modal-open { overflow: hidden; }

.home-title .home-version {
  margin-left: 8px; vertical-align: baseline; font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-size: 1rem; font-weight: 400;
  letter-spacing: .04em; color: var(--muted); text-shadow: none; -webkit-text-stroke: 0;
}

/* turn card */
.pr-map { perspective: 1400px; }
.pr-card { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.45, .05, .35, 1); }
.pr-map.mono .pr-card { transform: rotateY(-180deg); }
.pr-card .pr-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pr-card .pr-back { transform: rotateY(180deg); }
.pr-flip { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(242, 238, 228, .1); transition: background .2s ease, transform .2s ease; }
.pr-flip svg { width: 22px; height: 22px; fill: none; stroke: #f2eee4; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.pr-flip:hover, .pr-flip:focus-visible { background: rgba(242, 238, 228, .2); transform: scale(1.06); outline: none; }
.pr-flip:hover svg, .pr-flip:focus-visible svg { opacity: 1; stroke: var(--game); }
.pr-flip .pr-flip-a { fill: #f2eee4; }
.pr-flip:hover .pr-flip-a, .pr-flip:focus-visible .pr-flip-a { fill: var(--game); }
.pr-flip svg { transition: transform .4s ease; }
.pr-map.mono .pr-flip svg { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .pr-card { transition: none; } }

.pr-gamenote { margin: 22px 0 0; padding-left: 20px; color: var(--muted); font-size: .85rem; font-style: italic; }
.pr-gamenote li::marker { color: var(--game); }

.menu-item.menu-credits { margin-left: 74px; }
@media (max-width: 560px) { .menu-item.menu-credits { margin-left: 40px; } }
.credits-card { width: min(480px, 100%); }
.credits-list { margin: 6px 0 4px; padding-left: 22px; display: grid; gap: 10px; font-size: 1rem; line-height: 1.4; }
.credits-list li::marker { color: var(--accent); }
.credits-contact { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; text-align: center; }
.credits-contact a { color: var(--accent); font-weight: 700; text-decoration: none; }
.credits-contact a:hover, .credits-contact a:focus-visible { text-decoration: underline; }

#daily-tabs { align-items: center; }
#daily-tabs .tabs-label { margin-right: 4px; font-weight: 800; color: var(--ink); }

/* guess rows (menu style) */
.guesses { gap: 8px; }
.guesses li {
  transform: skewX(-10deg); border-radius: 3px; border: 0; min-height: 46px; padding: 10px 18px; color: #fff;
  background: linear-gradient(90deg, rgba(14,13,16,.93), rgba(14,13,16,.84) 70%, rgba(14,13,16,.45));
  font-family: "Racers Delight", system-ui; font-size: 1.15rem; letter-spacing: .02em;
  text-shadow: 2px 0 0 #1b1d2b, -2px 0 0 #1b1d2b, 0 2px 0 #1b1d2b, 0 -2px 0 #1b1d2b, 0 3px 0 #1b1d2b;
}
.guesses li > * { transform: skewX(10deg); }
.guesses li.wrong { box-shadow: inset 6px 0 0 var(--bad); }
.guesses li.wrong .mark { color: #ff6a5a; }
.guesses li.right { box-shadow: inset 6px 0 0 var(--good); background: linear-gradient(90deg, rgba(20,60,34,.95), rgba(20,60,34,.85) 70%, rgba(20,60,34,.45)); }
.guesses li.right .mark { color: #5fd47f; }
.guesses li.skipped { color: #cfcac0; box-shadow: inset 6px 0 0 #8a8478; }
.guesses li small { color: #a8a39a; font-family: "Ranade", system-ui; font-weight: 800; text-shadow: none; }
.guesses li.empty { background: color-mix(in srgb, var(--bg) 70%, transparent); border: 2px dashed color-mix(in srgb, var(--ink) 45%, transparent);
  color: var(--muted); text-shadow: none; box-shadow: none; }
.guesses li.empty small { color: var(--muted); }

@media (min-width: 900px) {
  .side-right .next-panel { margin-top: 14px; animation-name: slide-in-r; }
}
@keyframes slide-in-r { from { opacity: 0; transform: translateX(12px); } }

/* freeplay: no share */
.is-free .result .result-actions, .is-free .result .next { display: none !important; }
.is-free .result::after { content: ""; display: block; margin-top: -12px; }

/* game cards (world style) */
.pr-games { gap: 14px 12px; }
.pr-game {
  position: relative; isolation: isolate; justify-content: flex-start; gap: 2px;
  min-height: 0; padding: 7px 7px 16px; border: 0; border-radius: 20px;

  background: linear-gradient(180deg, rgba(74,72,80,.92), rgba(30,29,34,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.08),
              0 6px 14px rgba(0,0,0,.35);
  transition: transform .14s ease, box-shadow .14s ease;
}

.pr-game::before {
  content: ""; position: absolute; z-index: -1; inset: 7px; border-radius: 14px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(255,255,255,.28), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--game) 72%, #fff 6%) 0%, color-mix(in srgb, var(--game) 50%, #101014) 62%, color-mix(in srgb, var(--game) 30%, #101014) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28), inset 0 -10px 18px rgba(0,0,0,.28);
}
.pr-game img { height: 98px; max-height: 98px; width: 100%; padding: 14px 10px; object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)) drop-shadow(0 6px 10px rgba(0,0,0,.3)); transition: transform .14s ease; }
.pr-game small { margin-top: 2px; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.55), 0 0 6px rgba(0,0,0,.35); }
.pr-game small + small { margin-top: 0; }
.pr-game-seen { color: color-mix(in srgb, var(--game) 25%, #fff) !important; text-shadow: 0 1px 0 rgba(0,0,0,.55), 0 0 6px rgba(0,0,0,.35); }

.pr-game:hover, .pr-game:focus-visible {
  transform: translateY(-3px); outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 0 0 3px var(--game), 0 0 0 6px color-mix(in srgb, var(--game) 45%, transparent), 0 0 24px color-mix(in srgb, var(--game) 50%, transparent), 0 10px 22px rgba(0,0,0,.4);
}
.pr-game:hover img, .pr-game:focus-visible img { transform: scale(1.07) translateY(-2px); }

.pr-game.pr-sim { padding: 7px; justify-content: center; border-radius: 16px; }
.pr-game.pr-sim::before { border-radius: 11px; }
.pr-game.pr-sim img { height: 50px; max-height: 50px; padding: 6px 8px; }

/* stats close button */
#stats-dialog [data-close] { margin-top: 18px; }

/* live replay */
.replay-btn { display: block; width: 100%; margin: 10px 0 12px; border-color: var(--game, var(--line)); color: var(--ink); }
.replay-btn:hover, .replay-btn:focus-visible { background: color-mix(in srgb, var(--game) 22%, transparent); }

/* bonus star */
.star-ico, .pr-map .star-ico { height: 1.15em; width: auto; vertical-align: -0.2em; object-fit: contain; }
.replay-ico { height: 1.4em; width: auto; flex: none; }
.replay-btn { display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }

/* cup icons */
.pr-cup h3 { display: flex; align-items: center; gap: 7px; }
.pr-cup h3 span { min-width: 0; }
.cup-ico { height: 1.4em; width: auto; flex: none; }
.hint-value .cup-ico { height: 1.35em; vertical-align: -0.35em; margin-right: 5px; }
.cup-logo { height: 1.4em; width: auto; max-width: 62%; object-fit: contain; object-position: left center; flex: 0 1 auto; min-width: 0; }

/* logo link */
.pr-head-link { text-decoration: none; transition: transform .14s ease, box-shadow .14s ease; }
.pr-head-link:hover, .pr-head-link:focus-visible { transform: translateY(-2px); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--game) 45%, transparent), 0 0 22px color-mix(in srgb, var(--game) 45%, transparent); }

/* pinned top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 96%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
html { scroll-padding-top: 72px; }

/* menu stickers */
.menu-ico { position: relative; z-index: 1; flex: none; width: 64px; height: 64px; margin-right: -16px; object-fit: contain;
  transform: rotate(-8deg); filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)) drop-shadow(0 6px 10px rgba(0,0,0,.3)); transition: transform .15s ease; }
.menu-item:hover .menu-ico, .menu-item:focus-visible .menu-ico { transform: rotate(-12deg) translateY(-3px) scale(1.06); }
@media (max-width: 560px) { .menu-ico { width: 50px; height: 50px; margin-right: -12px; } }
@media (prefers-reduced-motion: reduce) { .menu-ico { transition: none; } }
#draw-track { font-family: "Racers Delight", "Titan One", system-ui, sans-serif; font-weight: 400; letter-spacing: .02em; font-size: 1.6rem; }
@media (max-width: 420px) { #draw-track { font-size: 1.3rem; } }

.victory-burst { position: fixed; inset: 0; z-index: 100; pointer-events: none; overflow: hidden; }
.victory-burst img { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; object-fit: contain;
  opacity: 0; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000) drop-shadow(0 2px 3px rgba(0,0,0,.45)); }

/* music checkbox on phones */
@media (max-width: 560px) {
  #music .mode-head-switches { padding: 0 36px; max-width: 100%; }
  #music .mode-head-switches:has(.mode-switch:not([hidden])) .mode-tag { display: none; }
}
@media (max-width: 359.98px) { #music .mode-head-switches .mode-switch { font-size: .7rem; } }

/* fav switchers */
.pr-favflip { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--game); background: #1b1a17; color: #f2eee4; transition: background .2s ease, transform .15s ease; }
.pr-favflip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pr-favflip .pr-flip-a { fill: #f2eee4; }
.pr-favflip[aria-pressed="true"] { background: var(--game); color: #1b1a17; }
.pr-favflip[aria-pressed="true"] .pr-flip-a { fill: #1b1a17; }
.pr-favflip:hover, .pr-favflip:focus-visible { transform: scale(1.1); outline: none; }

#draw-score { font-family: "Orbitron", system-ui, sans-serif; font-weight: 900; }
.is-free #draw-result .result-actions { display: flex !important; }
.is-free #draw-share { display: none; }
.free-promo[hidden] { display: none !important; }
.free-promo[data-outcome="lose"] .if-win { display: none; }
.free-promo[data-outcome="lose"] .if-lose { display: inline; }
.side-right .free-promo { margin-top: 14px; animation-name: slide-in-r; }
