:root {
  color-scheme: dark;
  --page: #10131b;
  --panel: #191d27;
  --edge: #2d323f;
  --ink: #f3ede5;
  --muted: #a5a8b3;
  --orange: #ff694e;
  --green: #75d592;
  --red: #ff8181;
  --yellow: #f6c66a;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
button, input, textarea { font: inherit; }
button { cursor: pointer; user-select: none; }
a { color: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #ffad72;
  outline-offset: 4px;
}
h1, h2, p, ol { margin: 0; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
.wrap { width: min(1120px, 100% - 64px); margin-inline: auto; }
.site-header {
  border-bottom: 1px solid #ffffff12;
  padding-top: env(safe-area-inset-top);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 1.85rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.08em;
  white-space: nowrap;
}
.brand em { color: var(--orange); }
.pixel-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: var(--pixel-image) center / contain no-repeat;
  mask: var(--pixel-image) center / contain no-repeat;
  image-rendering: pixelated;
}
.brand-mark {
  --pixel-image: url("assets/pixel/ui/brand.png");
  width: 23px;
  height: 23px;
  color: var(--orange);
}
.icon-forward { --pixel-image: url("assets/pixel/ui/forward.png"); }
.icon-share { --pixel-image: url("assets/pixel/ui/share.png"); }
.icon-help { --pixel-image: url("assets/pixel/ui/help.png"); }
.icon-close { --pixel-image: url("assets/pixel/ui/close.png"); }
.icon-tilt { --pixel-image: url("assets/pixel/ui/tilt.png"); }
.icon-gain { --pixel-image: url("assets/pixel/ui/gain.png"); }
.icon-loss { --pixel-image: url("assets/pixel/ui/loss.png"); }
.icon-steady { --pixel-image: url("assets/pixel/ui/steady.png"); }
.header-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.daily-meta { display: flex; align-items: center; gap: 8px; }
.daily-tag {
  padding: 8px 11px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  font-size: .8125rem;
  font-weight: 650;
  color: #d9dbe1;
  font-variant-numeric: tabular-nums;
}
.streak-tag {
  color: #ffbd86;
  font-size: .75rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.help-button, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
}
.sound-toggle { min-width: 44px; }
.sound-toggle[aria-pressed="true"] { color: #ffbd86; }
.sound-icon {
  position: relative;
  width: 18px;
  height: 18px;
}
.sound-icon::before, .sound-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.sound-icon::before {
  inset: 1px 6px 1px 0;
  clip-path: polygon(0 31%, 33% 31%, 33% 19%, 55% 19%, 55% 6%, 83% 6%, 83% 0, 100% 0, 100% 100%, 83% 100%, 83% 94%, 55% 94%, 55% 81%, 33% 81%, 33% 69%, 0 69%);
}
.sound-icon::after {
  inset: 3px 0 3px 13px;
  clip-path: polygon(0 0, 58% 0, 58% 17%, 100% 17%, 100% 83%, 58% 83%, 58% 100%, 0 100%, 0 83%, 41% 83%, 41% 17%, 0 17%);
}
.sound-toggle[aria-pressed="false"] .sound-icon::after {
  inset: 8px -1px auto -1px;
  height: 2px;
  transform: rotate(-45deg);
  clip-path: none;
  box-shadow: 0 2px var(--page);
}
main { flex: 1; padding-block: 34px; }
.scenery { background: #403443 url("assets/pixel/desert.webp") center 51% / cover no-repeat; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 530px; border: 1px solid #ffffff23; border-radius: 20px; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #10131bf5, #10131be8 21%, #10131b8c 40%, #10131b12 65%),
              linear-gradient(0deg, #10131b98, transparent 38%);
}
.hero-art img, .hero-art .cyclist-motion {
  display: block;
  position: absolute;
  bottom: 11%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: 48%;
  object-fit: contain;
  filter: drop-shadow(5px 9px 7px #100e19a6);
}
.hero-content { padding: 72px 62px 56px; }
.eyebrow {
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .133em;
  font-weight: 750;
  color: var(--muted);
}
.hero-content .eyebrow { color: #ffb58d; display: flex; align-items: center; gap: 10px; }
.signal { --pixel-image: url("assets/pixel/ui/pip.png"); width: 9px; height: 9px; color: var(--orange); }
.hero h1 {
  font-size: clamp(3.85rem, 7.35vw, 6.6rem);
  line-height: .89;
  letter-spacing: -.065em;
  font-weight: 900;
  margin: 22px 0 20px;
}
.hero h1 em { color: var(--orange); font-style: italic; }
.hero-description { max-width: 330px; color: #e0dbe0; line-height: 1.55; font-size: 1.0625rem; }
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid #ffab8869;
  border-radius: 9px;
  color: #1b1518;
  background: linear-gradient(110deg, #ff9b69, #ff694e 72%);
  font-weight: 800;
  transition: transform 120ms var(--ease-out);
}
.primary:active { transform: scale(.985); }
.hero-cta { margin-top: 26px; min-width: 218px; }
.rules-strip {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: var(--panel);
}
.rules-strip li { display: flex; align-items: center; gap: 15px; padding: 21px 23px; }
.rules-strip li + li { border-left: 1px solid var(--edge); }
.step-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #ff795a46;
  border-radius: 9px;
  color: #ffad86;
  background: #ff795a13;
  font-size: 1.35rem;
}
.step-icon img { image-rendering: pixelated; }
.rules-strip strong { font-size: .9375rem; }
.rules-strip p { margin-top: 4px; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.footer {
  text-align: center;
  gap: 12px;
  border-top: 1px solid #ffffff12;
  padding-block: 17px calc(19px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.4;
}
#drive { max-width: 760px; margin-inline: auto; }
.race-progress { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.race-progress .eyebrow { white-space: nowrap; }
.segments { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.segments span { height: 4px; border-radius: 4px; background: #353a49; }
.segments .current { background: var(--orange); }
.segments .up { background: var(--green); }
.segments .down { background: var(--red); }
.segments .same { background: var(--yellow); }
.race-stage {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  height: clamp(210px, 30vw, 300px);
  border-radius: 14px 14px 0 0;
  border: 1px solid #ffffff26;
}
.race-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(#120f20bd, #100e2012 58%, #10131ba8);
}
.race-speed { position: absolute; top: 12px; left: 18px; white-space: nowrap; }
.race-speed .eyebrow { color: #f4c4a8; }
.race-speed strong {
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: .96;
  letter-spacing: -.068em;
}
.race-speed div span { color: #eee1dc; font-size: .9375rem; font-weight: 700; }
.vehicles, .road-motion { position: absolute; inset: 0; pointer-events: none; }
.road-motion { z-index: -2; display: block; width: 100%; height: 100%; }
.vehicle-sprite, .vehicle-morph {
  position: absolute;
  width: min(48%, 282px);
  height: 71%;
  left: 50%;
  bottom: 5.5%;
  filter: drop-shadow(4px 8px 5px #100e19aa);
}
.vehicle-sprite {
  object-fit: contain;
  object-position: 50% 100%;
  opacity: 0;
  transform: translateX(-50%) scale(.96);
  transform-origin: 50% 100%;
  transition: opacity 470ms var(--ease-in-out), transform 560ms var(--ease-in-out);
}
.vehicle-sprite.active { opacity: 1; transform: translateX(-50%) scale(1); }
.vehicle-morph { display: none; transform: translateX(-50%); }
.is-morphing .vehicle-morph { display: block; }
.is-morphing .vehicle-sprite { visibility: hidden; transition: none; }
.vehicle-details {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 470ms var(--ease-in-out);
}
.vehicle-details.running { opacity: 1; }
.is-morphing .vehicle-details { visibility: hidden; }
.vehicle-name {
  display: flex;
  align-items: center;
  gap: 7px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border: 1px solid #ffffff27;
  border-radius: 6px;
  background: #10131be8;
  color: var(--ink);
  font-weight: 700;
  font-size: .8125rem;
}
.vehicle-progress {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 7px 11px 8px;
}
.vehicle-scale-heading {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: .75rem;
  font-weight: 750;
}
.vehicle-scale-heading img { image-rendering: pixelated; }
.vehicle-scale-unit { margin-left: auto; color: var(--muted); }
.speed-bar {
  --speed-fill: 0%;
  height: 13px;
  border: 1px solid #847587;
  background: #211e2b;
}
.speed-bar::before {
  content: "";
  display: block;
  height: 100%;
  background: linear-gradient(to right, #ffb260, #ff7751 var(--speed-fill), #514459 var(--speed-fill));
  mask-image: repeating-linear-gradient(to right, black 0 calc(12.5% - 2px), transparent calc(12.5% - 2px) 12.5%);
}
.vehicle-progress ol { list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding: 4px 1px 0; }
.vehicle-progress li {
  display: grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid transparent;
}
.vehicle-progress li img {
  max-width: 91%;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: .62;
}
.vehicle-progress [aria-current] { background: #ffad7422; border-color: #ffad7477; border-radius: 3px; }
.vehicle-progress [aria-current] img { opacity: 1; }
.question-card, .result-card {
  margin: 16px auto 0;
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 23px 26px;
  background: var(--panel);
}
.category { color: #ffad86; }
.question-card .category { display: flex; align-items: center; gap: 9px; }
.category-copy { display: grid; gap: 3px; }
.category-caption {
  color: var(--muted);
  font-size: .625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
[data-screen="question"] .category-caption,
[data-screen="feedback"] .category-caption { display: none; }
#category-icon { object-fit: contain; image-rendering: pixelated; flex: none; }
.question-card h1, .question-card #question-title, .result-card h1 { margin: 7px 0 17px; font-size: clamp(1.375rem, 3.4vw, 2rem); letter-spacing: -.035em; line-height: 1.15; }
.question-card #question-title { margin-top: 0; }
[data-screen="question"] .question-card .category,
[data-screen="feedback"] .question-card .category {
  margin: 0 0 7px;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#risk-heading { text-align: center; font-size: 1rem; font-weight: 800; }
.estimate-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #11141d;
  border: 1px solid #464c5b;
  border-radius: 8px;
  margin-top: 6px;
  padding-right: 13px;
}
.estimate-field:focus-within { border-color: #ffad72; outline: 1px solid #ffad72; }
.estimate-field:has([aria-invalid]) { border-color: var(--red); }
.estimate-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 0;
  color: var(--ink);
  padding: 0 13px;
  background: transparent;
  font-size: 1.0625rem;
  outline: none;
  scroll-margin-block: 1rem;
}
.estimate-field input::placeholder { color: #a0a6b4; opacity: 1; }
.estimate-unit { color: var(--muted); font-size: .875rem; font-weight: 700; white-space: nowrap; }
.input-error { margin-top: 7px; color: var(--red); font-size: .875rem; }
.risk-dial {
  --dial-center-y: 49.444%;
  position: relative;
  width: min(100%, 304px);
  margin: 7px auto 0;
}
.risk-face {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  clip-path: circle(44.2% at 50% var(--dial-center-y));
  cursor: crosshair;
  touch-action: none;
}
.risk-needle, .risk-hub, #risk-value {
  position: absolute;
}
.risk-hub, #risk-value { pointer-events: none; }
.risk-needle {
  top: var(--dial-center-y);
  left: 50%;
  width: 27.78%;
  height: 44px;
  translate: 0 -50%;
  transform-origin: left center;
  cursor: grab;
  touch-action: none;
}
.risk-needle::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: clamp(5px, 3vw, 8px);
  translate: 0 -50%;
  background: linear-gradient(180deg, #fff3d8 0 24%, var(--risk-accent) 24% 74%, #b85f51 74%);
  clip-path: polygon(0 0, 59% 0, 59% 16%, 81% 16%, 81% 32%, 100% 32%, 100% 68%, 81% 68%, 81% 84%, 59% 84%, 59% 100%, 0 100%);
}
.risk-dial.is-dragging :is(.risk-face, .risk-needle) { cursor: grabbing; }
.risk-needle.is-turning { transition: transform 150ms var(--ease-out); }
.risk-hub {
  top: var(--dial-center-y);
  left: 50%;
  width: 6.48%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: #413449;
  border: 2px solid #b58277;
  box-shadow: inset 0 0 0 2px #211824;
}
#risk-value {
  top: 69%;
  left: 50%;
  translate: -50% -50%;
  color: var(--risk-accent);
  font: 800 clamp(1.35rem, 6vw, 1.85rem)/1 ui-monospace, monospace;
}
.risk-stops { position: absolute; inset: 0; pointer-events: none; }
.risk-stop {
  position: absolute;
  display: grid;
  place-items: center;
  width: min(21%, 48px);
  aspect-ratio: 1;
  translate: -50% -50%;
  color: #f2dfd6;
  font: 800 .9375rem/1 ui-monospace, monospace;
  cursor: pointer;
  pointer-events: auto;
}
.risk-stop span {
  padding: 4px 3px;
  border: 1px solid transparent;
}
.risk-stop input:checked + span {
  color: var(--risk-accent);
  border-color: currentColor;
  background: #100e19;
}
.risk-stop input:disabled + span {
  color: #a394a8;
  text-decoration: line-through;
}
.risk-stop:has(input:disabled) { cursor: default; }
.risk-stop input:focus-visible + span { outline: 2px solid #ffad72; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .risk-stop:hover input:enabled:not(:checked) + span { color: #ffad86; }
}
@media (prefers-reduced-motion: reduce) {
  .risk-needle.is-turning { transition: none; }
}
.risk-zone .primary { text-align: start; padding-block: 9px; gap: 12px; }
#risk-reveal-text { overflow-wrap: anywhere; }
.estimate-action { display: flex; align-items: center; gap: 12px; }
#locked-risk {
  padding: 4px 7px;
  border: 1px solid #36192070;
  border-radius: 4px;
  background: #36192020;
  font: 800 .875rem/1 ui-monospace, monospace;
}
.block { width: 100%; margin-top: 16px; }
.up { color: var(--green); }
.down { color: var(--red); }
.same { color: var(--yellow); }

.reveal-comparison, .score-figure, .history-figure { margin: 0; }
.reveal-comparison, .score-figure, .answer-note, .history-figure, #round-summary {
  padding: 12px;
  border: 1px solid #3a3043;
  border-radius: 8px;
  background: #181521;
}
.reveal-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: #ece1e7;
  font-size: .75rem;
  font-weight: 800;
}
#feedback-error { color: #eab49b; text-align: right; }
#estimate-art, #score-curve, #history-chart, #speed-chart { display: block; width: 100%; height: auto; image-rendering: pixelated; }
#estimate-art { margin-top: 9px; max-height: 150px; border: 1px solid #40374f; border-radius: 4px; }
.feedback-values, .round-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.feedback-values { margin-top: 10px; }
.feedback-values div { padding-left: 8px; border-left: 2px solid #ffae70; }
.feedback-values div:last-child { border-color: #73dec5; }
.feedback-values span, .round-values dt { display: block; margin-bottom: 3px; color: var(--muted); font-size: .75rem; }
.feedback-values strong, .round-values dd { font-size: clamp(.9375rem, 3.75vw, 1.25rem); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.score-figure { margin-top: 9px; }
.score-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#feedback-delta { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: clamp(1.5rem, 6vw, 2.5rem); font-weight: 850; letter-spacing: -.045em; line-height: 1.1; font-variant-numeric: tabular-nums; }
#feedback-delta .pixel-icon { width: .8em; height: .8em; }
.score-context { display: grid; justify-items: end; gap: 5px; flex-shrink: 0; }
.verdict { padding: 4px 8px; border: 1px solid currentColor; border-radius: 3px; font-size: .75rem; line-height: 1; font-weight: 800; }
.score-risk { color: var(--muted); font-size: .75rem; }
#score-curve { margin-top: 5px; }
.curve-axis { display: flex; justify-content: space-between; margin-inline: 3.7%; }
.curve-axis, .curve-label { font-size: .6875rem; color: var(--muted); }
.curve-label { text-align: center; margin: 4px 0 0; }

.answer-note { margin: 9px 0; }
#explanation { color: #e3d9dd; font-size: .875rem; line-height: 1.5; }
#source { display: inline-block; margin-top: 6px; padding-block: 5px; color: #ffb390; font-size: .75rem; text-underline-offset: .16em; }
.feedback .block { margin-top: 5px; }

#drive[data-screen="result"] > :is(.race-progress, .race-stage, .vehicle-progress) { display: none; }
#result { overflow: hidden; padding: 0; margin-top: 0; }
.finish-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(177px, 29vw, 235px);
  display: flex;
  align-items: center;
  padding: clamp(17px, 4vw, 32px);
  background: #422f49 url("assets/pixel/desert-drive.webp") center 48% / cover;
  image-rendering: pixelated;
}
.finish-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #1b1426f7, #291c31bd 48%, #180f2320),
    linear-gradient(0deg, #20172dc9, transparent 75%);
}
.finish-info { z-index: 1; }
.finish-info .eyebrow { font-size: .6875rem; color: #ffc49e; }
.finish-info #result-title { margin: 6px 0 5px; font-size: clamp(1.1rem, 4vw, 1.5rem); letter-spacing: -.02em; }
.finish-speed { white-space: nowrap; font-variant-numeric: tabular-nums; }
.finish-speed strong { font-size: clamp(3.15rem, 13.7vw, 6.2rem); line-height: .95; letter-spacing: -.065em; }
.finish-speed span { font-size: .875rem; font-weight: 750; color: #ebccbb; }
.finish-vehicle { margin-top: 8px; color: #ffd7bd; font-size: .8125rem; font-weight: 700; }
.finish-sprite {
  position: absolute;
  right: clamp(10px, 5%, 38px);
  bottom: 9%;
  width: 39%;
  height: 63%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(4px 7px 4px #130c1ca6);
}
.finish-body { padding: 14px clamp(12px, 4vw, 24px) 18px; }
.finish-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.finish-stats div { padding: 8px 10px; border: 1px solid var(--edge); border-radius: 5px; background: #151521; }
.finish-stats dt { margin-bottom: 4px; color: var(--muted); font-size: .75rem; }
.finish-stats dd, .round-values dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.history-figure { background: linear-gradient(#211b2e, #181521); }
.history-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid #3a3043;
  border-radius: 6px;
  background: #15121e;
}
.history-tabs button {
  min-height: 40px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #bfb2c5;
  font-size: .8125rem;
  font-weight: 750;
}
.history-tabs [aria-selected="true"] {
  border-color: #ab735c;
  background: #382735;
  color: #ffd5b8;
}
.history-readout { margin: 10px 1px 0; }
.history-readout span { color: #bfb2c5; }
.history-readout strong { font-variant-numeric: tabular-nums; }
#history-chart, #speed-chart { margin: 4px 0 6px; }
.result-trail { padding: 0 0 0 var(--chart-axis-width, 0%); list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.result-trail button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 3px 1px;
  border: 1px solid #44364c;
  border-radius: 4px;
  background: #241d30;
  font-size: .75rem;
  font-weight: 800;
}
.result-trail button[aria-pressed="true"] { border-color: currentColor; background: #33273b; }
.share-action { margin-top: 14px; }
.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 9px 15px 12px;
  border: 1px solid #ffcc98;
  border-bottom: 4px solid #b7493a;
  border-radius: 8px;
  background: linear-gradient(115deg, #ffc17e, #ff865d);
  color: #25151c;
  font-size: clamp(1.125rem, 4.5vw, 1.35rem);
  font-weight: 850;
  line-height: 1.15;
  transition: transform 120ms var(--ease-out);
}
.share-button-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid #61344766;
  border-radius: 3px;
  background: #271927;
  color: #ffddb2;
}
.share-button-icon .pixel-icon { width: 24px; height: 24px; }
.share-button:active { transform: translateY(2px); }
#round-highlight { margin: 17px 0 8px; color: #ffbf98; font-size: .75rem; line-height: 1.35; }
.round-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .8125rem; }
#round-delta { white-space: nowrap; font-variant-numeric: tabular-nums; }
.round-question { margin: 7px 0 10px; font-size: .875rem; line-height: 1.45; }
.round-values { margin: 0 0 9px; }
.round-meta { color: var(--muted); font-size: .75rem; }
.next-daily, .share-status { text-align: center; margin-top: 14px; color: var(--muted); font-size: .875rem; }
.secondary { border-color: var(--edge); color: var(--ink); }
#share-fallback { margin-top: 12px; }
#share-fallback label { display: block; font-size: .875rem; margin-bottom: 5px; }
#share-text { width: 100%; padding: 8px; border: 1px solid var(--edge); background: #121620; border-radius: 6px; }
dialog { color: var(--ink); background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; width: min(440px, 100% - 28px); padding: 19px 21px; }
dialog::backdrop { background: #090c13bc; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.close-button { font-size: 1.75rem; min-width: 44px; }
dialog ol { padding-left: 1.4em; }
dialog li + li { margin-top: 9px; }
dialog p { margin-top: 15px; color: var(--muted); }
dialog li, dialog p { line-height: 1.48; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: linear-gradient(110deg, #ffb086, #ff795e 72%); }
  .share-button:hover { background: linear-gradient(115deg, #ffd49f, #ff9d77); }
  .help-button:hover, .secondary:hover { background: #ffffff0c; color: var(--ink); }
}
@media (max-width: 760px) {
  .wrap { width: auto; margin-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .header-inner { min-height: 61px; }
  main { padding-block: 17px 24px; }
  .hero { min-height: 464px; }
  .hero-content { padding: 54px 31px 40px; }
  .rules-strip li { padding: 13px; gap: 9px; }
  .step-icon { width: 34px; height: 34px; }
  .race-stage { height: 215px; }
}
@media (max-width: 530px) {
  .header-actions { gap: 3px; }
  .daily-meta { align-items: flex-end; flex-direction: column; gap: 1px; padding-inline: 6px; }
  .help-button { min-width: 44px; }
  .help-text { display: none; }
  .brand { font-size: 1.65rem; }
  .daily-tag { padding: 0; border: 0; font-size: .75rem; }
  .hero { min-height: 0; border-radius: 15px; background: #151924; }
  .hero-art { position: relative; height: clamp(160px, 42vw, 220px); background-position: center 51%; }
  .hero-art::after { background: linear-gradient(0deg, #151924, transparent 48%); }
  .hero-art img, .hero-art .cyclist-motion { left: 50%; bottom: 0; height: 73%; }
  .hero-content { padding: 0 19px 21px; margin-top: -5px; }
  .hero h1 { font-size: clamp(2.45rem, 12vw, 4.2rem); margin: 12px 0; }
  .hero-description { font-size: 1rem; }
  .hero-cta { width: 100%; margin-top: 17px; }
  .rules-strip { grid-template-columns: 1fr; margin-top: 12px; }
  .rules-strip li + li { border-left: 0; border-top: 1px solid var(--edge); }
  .race-progress { gap: 9px; margin-bottom: 8px; }
  .race-progress .eyebrow { font-size: .75rem; }
  .segments { gap: 4px; }
  .race-stage { height: clamp(154px, 43vw, 208px); }
  .race-speed { top: 9px; left: 11px; }
  .race-speed .eyebrow { font-size: .75rem; }
  .race-speed strong { font-size: 2.7rem; }
  .race-speed div span { font-size: .8125rem; }
  .vehicle-name { bottom: 7px; right: 7px; padding: 5px 7px; }
  .vehicle-progress { padding-inline: 8px; }
  .vehicle-progress li { font-size: .6875rem; }
  .question-card, .result-card { margin-top: 11px; padding: 15px 13px; }
  .question-card h1, .result-card h1 { margin: 5px 0 12px; }
  .estimate-field input { height: 44px; }
  .block { margin-top: 12px; }
}
@media (max-width: 380px) {
  .header-inner { gap: 4px; }
  .brand { gap: 5px; font-size: 1.45rem; }
  .brand-mark { width: 18px; height: 18px; }
  .daily-meta { padding-inline: 2px; }
}
@media (max-width: 350px) {
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand sound help" "daily daily daily";
    padding-bottom: 7px;
  }
  .header-inner .brand { grid-area: brand; }
  .header-actions { display: contents; }
  .daily-meta { grid-area: daily; flex-direction: row; align-items: center; gap: 8px; }
  #sound-toggle { grid-area: sound; }
  #help-open { grid-area: help; }
}
@media (prefers-reduced-motion: reduce) {
  .primary { transition: none; }
  .primary:active { transform: none; }
  .share-button { transition: none; }
  .share-button:active { transform: none; }
}
#road-motion, .scenery, .vehicle-sprite, .vehicle-morph, .hero-art img { image-rendering: pixelated; }
.pixel-burst { position:absolute; left:50%; top:62%; pointer-events:none }
.pixel-burst i { position:absolute; width:5px; height:5px; opacity:0 }

.risk-zone {
  --risk-hue: 145;
  --risk-accent: hsl(var(--risk-hue) 84% 68%);
}
.risk-zone .primary {
  background: linear-gradient(110deg, hsl(var(--risk-hue) 87% 78%), var(--risk-accent) 75%);
  border-color: hsl(var(--risk-hue) 84% 76%);
}
@media (hover: hover) and (pointer: fine) {
  .risk-zone .primary:hover { filter: brightness(1.08); }
}
.race-stage.scenery { background-image: url("assets/pixel/desert-drive.webp"); }
@media (max-width: 530px) {
  .vehicle-name { left: 7px; right: auto; }
}

.hero-art.scenery { background-image: url("assets/pixel/desert-drive.webp"); }
.hero-art .road-motion { z-index: 0; }
.cyclist-motion { image-rendering: pixelated; }
.cyclist-motion:not(.ready) { visibility: hidden; }
.hero-art:has(.cyclist-motion.ready) img { visibility: hidden; }
.hero-art .cyclist-motion { aspect-ratio: auto; }
.hero-art::after { pointer-events: none; }
.vehicles .cyclist-motion { display: none; }
.vehicles:not(.is-morphing):has(.vehicle-sprite:first-child.active) .cyclist-motion.ready { display: block; opacity: 1; transform: translateX(-50%); }
.vehicles:not(.is-morphing):has(.cyclist-motion.ready) .vehicle-sprite:first-child { visibility: hidden; }

.vehicles .cyclist-motion { width: auto; max-width: min(48%, 282px); }

.is-entering-drive .hero-art,
.is-entering-drive .race-stage { view-transition-name: drive-scene; }
.is-entering-drive #hero-cyclist.ready,
.is-entering-drive .vehicles .cyclist-motion.ready { view-transition-name: drive-cyclist; }

::view-transition-group(drive-scene),
::view-transition-group(drive-cyclist),
::view-transition-group(root) {
  animation-duration: 440ms;
  animation-timing-function: var(--ease-out);
}
::view-transition-image-pair(drive-scene) { overflow: hidden; border-radius: 14px; }
::view-transition-group(drive-cyclist) { z-index: 1; }
::view-transition-image-pair(drive-cyclist) { image-rendering: pixelated; }


.vehicles { translate: var(--steer-x, 0px) 0; }
.pixel-burst { left: calc(50% + var(--steer-x, 0px)); }
.pit-stop-banner {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: grid;
  gap: 3px;
  max-width: min(45%, 210px);
  padding: 6px 8px;
  background: #171522ee;
  border: 1px solid #edae776b;
  border-left: 3px solid #f6bd73;
  line-height: 1.3;
}
.pit-stop-banner strong { color: #ffd39b; font-size: .8125rem; }
.pit-stop-banner span { color: #ede2e9; font-size: .6875rem; }
.tilt-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  margin: -3px 0 -3px 3px;
  padding: 3px 7px;
  color: #ffe1b5;
  background: #332535;
  border: 1px solid #a57a656e;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
}
.pit-stop-banner:not([hidden]) { animation: pit-stop-arrival 250ms var(--ease-out); }
@keyframes pit-stop-arrival {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
