/* Bike nas Montanhas — caderno de viagem com a identidade da ECOA.
   Tokens da marca (ecoa-site/theme.json): papel, tinta, verdes, névoa, aquarela. */

@font-face {
  font-family: "Quicksand";
  src: url("public/fonts/quicksand-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Quicksand";
  src: url("public/fonts/quicksand-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #fbfbf7;
  --ink: #141814;
  --green: #129f4a;
  --green-dark: #0b6b32;
  --forest: #1f2d20;
  --mist: #5b635c;
  --wash: #eaf3eb;
  --horizon: #90a7b9;
  --sun: #f2c230;
  --red: #c8322b;
  --hand: 255px 18px 225px 18px / 18px 225px 18px 255px;
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
/* `hidden` vence o display dos componentes (botão é inline-flex): sem isto,
   "Continuar o passeio" aparecia numa primeira visita sem progresso. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); }
body { -webkit-tap-highlight-color: transparent; touch-action: none; user-select: none; -webkit-user-select: none; }

#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-weight: 700; margin: 0 0 .4em; line-height: 1.1; }
p { margin: 0 0 .7em; line-height: 1.45; }
strong { font-weight: 700; }

button, .button {
  font: 600 1rem/1 "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--hand);
  padding: .8em 1.3em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-height: 44px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
  box-shadow: 2px 3px 0 rgba(20, 24, 20, .85);
}
button:hover, .button:hover { transform: translate(-1px, -1px); box-shadow: 3px 4px 0 rgba(20, 24, 20, .85); }
button:active, .button:active { transform: translate(1px, 2px); box-shadow: 0 0 0 rgba(20, 24, 20, .85); }
button:focus-visible, .button:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; transform: none; }
.primary { background: var(--green-dark); color: var(--paper); border-color: var(--forest); }

.screen { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow: auto; touch-action: auto; }
.screen[hidden] { display: none; }

.sheet {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--hand);
  padding: clamp(18px, 3vw, 30px);
  max-width: 640px;
  width: 100%;
  margin: auto; /* centraliza quando cabe; rola desde o topo quando não cabe */
  box-shadow: 4px 6px 0 rgba(20, 24, 20, .12);
}
.sheet::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 110px; height: 24px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(209, 195, 96, .55); border: 1px solid rgba(20, 24, 20, .15);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.actions.column { flex-direction: column; }
.note { color: var(--mist); font-size: .95rem; }

/* ---------- Abertura: cartão de caderno sobre o jogo rodando */
#title { align-items: flex-start; justify-content: center; background: transparent; pointer-events: none; }
.title-card {
  pointer-events: auto; margin-top: max(3vh, 12px); display: flex; align-items: center; gap: clamp(12px, 3vw, 28px);
  background: rgba(251, 251, 247, .93); border: 2px solid var(--ink); border-radius: var(--hand);
  padding: clamp(14px, 2.4vw, 26px) clamp(16px, 3vw, 32px); max-width: 860px; width: 100%;
  box-shadow: 4px 6px 0 rgba(20, 24, 20, .14);
}
.title-logo { width: clamp(120px, 20vw, 210px); height: auto; flex: none; }
.title-copy { min-width: 0; }
#title h1 { font-size: clamp(2rem, 5.4vw, 3.6rem); letter-spacing: -.01em; margin-bottom: .2em; }
.lede { font-size: clamp(.95rem, 1.8vw, 1.12rem); max-width: 520px; }
.title-copy .actions { margin-top: 12px; }

/* ---------- Bikes */
#bikes .sheet { max-width: 940px; }
.bike-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.bike-card { flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px 12px; box-shadow: 1px 2px 0 rgba(20, 24, 20, .5); font-size: .88rem; line-height: 1.15; text-align: center; }
.bike-card canvas { width: 96px; height: 60px; }
.bike-card strong { font-size: .92rem; }
.bike-card .tag { color: var(--green-dark); font-weight: 700; font-size: .78rem; }
.bike-card[aria-checked="true"] { background: var(--wash); border-color: var(--green-dark); box-shadow: 0 0 0 3px var(--green) inset, 2px 3px 0 rgba(20, 24, 20, .85); }
.stats-dots { display: inline-flex; flex-direction: column; gap: 1px; margin-top: 4px; font-size: .74rem; }
.stat { display: flex; justify-content: space-between; gap: 8px; min-width: 118px; }
.stat em { font-style: normal; color: var(--mist); font-weight: 600; }
.stat b { color: var(--green-dark); letter-spacing: 1px; font-size: .8rem; }
.stat b i { font-style: normal; color: #cfd5cf; }
.bike-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: .9rem; }
.bike-line .stats-dots { flex-direction: row; gap: 10px; margin: 2px 0 0; }
.bike-line .stat { min-width: 0; }

/* ---------- Mapa */
#map { align-items: stretch; justify-content: stretch; padding: 0; pointer-events: none; }
#map > * { pointer-events: auto; }
#map-nodes { position: absolute; inset: 0; pointer-events: none; }
.node {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  width: 52px; height: 52px; min-height: 0; padding: 0; border-radius: 50%;
  background: transparent; border: none; box-shadow: none; color: transparent;
}
.node:hover { transform: translate(-50%, -50%) scale(1.06); box-shadow: none; }
.node:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.map-bar {
  position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--hand);
  padding: 10px 12px 10px 18px; box-shadow: 3px 4px 0 rgba(20, 24, 20, .15); max-width: calc(100vw - 24px);
}
.map-info { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.map-info span { color: var(--mist); }
#map-go { white-space: nowrap; }
.corner { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: flex; gap: 8px; }
.corner-btn { font-size: .85rem; padding: .5em .9em; min-height: 38px; }
button.small { font-size: .82rem; padding: .45em .9em; min-height: 36px; box-shadow: 1px 2px 0 rgba(20, 24, 20, .6); }
.title-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.title-extra .note { margin: 0; font-size: .82rem; }

/* ---------- Cartões */
.card h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.card .kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--green-dark); font-weight: 700; margin-bottom: .5em; }
.card .real { font-style: italic; color: var(--mist); border-left: 3px solid var(--green); padding-left: 10px; }
.goals { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.goals li { display: flex; align-items: center; gap: 10px; }
.goals .s { width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; font-size: 1.1rem; }
.goals li.got .s { color: #d9a200; }
.goals li.miss { color: var(--mist); }
.goals li.miss .s { color: #b9bdb6; }
.stamp-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.stamp {
  flex: none; width: 96px; height: 96px; border-radius: 50%; border: 3px double var(--green-dark); color: var(--green-dark);
  display: grid; place-items: center; text-align: center; font-weight: 700; font-size: .6rem; line-height: 1.05; padding: 6px; overflow-wrap: normal;
  transform: rotate(-9deg); background: rgba(234, 243, 235, .7);
}
.stamp canvas { width: 38px; height: 38px; display: block; margin: 0 auto 2px; }
.stamp.long { font-size: .5rem; letter-spacing: -.01em; }
.stamp.pop { animation: stamp .45s cubic-bezier(.2, 1.6, .5, 1) both; }
@keyframes stamp { from { transform: rotate(-30deg) scale(2.2); opacity: 0; } to { transform: rotate(-9deg) scale(1); opacity: 1; } }
.stats { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--mist); font-size: .92rem; margin-top: 10px; }
.race { margin-top: 10px; font-weight: 600; }
.time-box { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.time-big { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.record { font-size: .85rem; font-weight: 700; color: var(--mist); white-space: nowrap; }
.record.new { color: var(--paper); background: var(--green-dark); padding: 3px 8px; border-radius: 6px; transform: rotate(-3deg); animation: stamp .45s cubic-bezier(.2, 1.6, .5, 1) both .25s; }
button kbd { font-size: .72em; margin-left: 4px; opacity: .8; }
.primary kbd { background: transparent; color: inherit; border-color: currentColor; }
.controls-hint { margin-top: 14px; font-size: .9rem; color: var(--mist); }
kbd { font: 600 .82em "Quicksand", sans-serif; border: 1.5px solid var(--ink); border-radius: 5px; padding: 1px 5px; background: var(--paper); }

/* ---------- Chegada com ranking ao lado */
#card .sheet:has(.arrival) { max-width: 900px; }
.arrival { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 700px) {
  .arrival { grid-template-columns: minmax(0, 1fr) minmax(230px, 36%); align-items: start; }
}
.rank-box { border: 2px dashed rgba(20, 24, 20, .45); border-radius: 14px; padding: 12px 14px; background: rgba(234, 243, 235, .55); min-height: 88px; }
.rank-box[hidden] { display: none; }
.final .rank-box { max-width: 420px; margin: 4px auto 0; text-align: left; }
.rank-title { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--green-dark); margin-bottom: .4em; }
.rank-title.new { display: inline-block; color: var(--paper); background: var(--green-dark); padding: 3px 8px; border-radius: 6px; transform: rotate(-2deg); animation: stamp .45s cubic-bezier(.2, 1.6, .5, 1) both; }
.rank-lede, .rank-done { font-size: .92rem; margin-bottom: .5em; }
.rank-error { color: var(--red); font-weight: 700; font-size: .85rem; margin: .4em 0 0; }
.rank-error[hidden] { display: none; }
.rank-entry { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.rank-entry .primary { margin-top: 4px; }
.rank-list { list-style: none; margin: 0 0 .4em; padding: 0; display: grid; gap: 1px; font-variant-numeric: tabular-nums; }
.rank-list li { display: grid; grid-template-columns: 2.4em 4.6em 1fr; align-items: baseline; gap: 6px; padding: 2px 0; font-size: .92rem; }
.rank-list .pos { color: var(--mist); font-weight: 700; }
.rank-list .who { font-weight: 700; letter-spacing: .12em; }
.rank-list .t { text-align: right; }
.rank-list li.me { color: var(--green-dark); }
.rank-list li.me .who { text-decoration: underline wavy var(--green); text-underline-offset: 4px; }
.rank-list li.gap { display: block; text-align: center; color: var(--mist); padding: 0; line-height: .8; }
.rank-list.full { margin: 8px 0 10px; }
.rank-list.full li { grid-template-columns: 2.6em 5em 5.2em 1fr; padding: 5px 8px; border-radius: 8px; font-size: 1rem; }
.rank-list.full li:nth-child(odd) { background: rgba(234, 243, 235, .7); }
.rank-list.full .bike { color: var(--mist); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-board-title { font-weight: 700; margin: 10px 0 0; }
/* 5 letras, estilo fliperama: o campo de verdade fica por cima, invisível */
.name-slots { position: relative; display: inline-flex; gap: 6px; cursor: text; }
.name-slots input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; caret-color: transparent; cursor: text; }
.slot { width: 1.7em; height: 1.9em; display: grid; place-items: center; font: 700 1.55rem/1 "Quicksand", system-ui, sans-serif; background: var(--paper); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 8px; }
.slot.cursor { border-color: var(--green-dark); background: var(--wash); animation: cursor 1s steps(2) infinite; }
.name-slots:focus-within { outline: 3px solid var(--sun); outline-offset: 4px; border-radius: 8px; }
@keyframes cursor { 50% { border-bottom-color: transparent; } }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tabs button { font-size: .82rem; padding: .4em .8em; min-height: 34px; box-shadow: 1px 2px 0 rgba(20, 24, 20, .5); }
.tabs button[aria-selected="true"] { background: var(--green-dark); color: var(--paper); border-color: var(--forest); }

.final { text-align: center; max-width: 720px; }
.final-logo { width: min(240px, 60vw); height: auto; display: block; margin: 0 auto 8px; }
.stamps { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 14px 0; }
.stamps .stamp { width: 84px; height: 84px; font-size: .62rem; }
.stamps .stamp:nth-child(even) { transform: rotate(7deg); }
.final .actions { justify-content: center; }

/* ---------- HUD */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud[hidden] { display: none; }
#hud button { pointer-events: auto; }
.hud-left, .hud-right, .hud-center { position: absolute; top: max(10px, env(safe-area-inset-top)); display: flex; gap: 10px; align-items: flex-start; }
.hud-left { left: max(12px, env(safe-area-inset-left)); flex-direction: column; gap: 4px; }
.hud-right { right: max(12px, env(safe-area-inset-right)); align-items: center; }
.hud-center { left: 50%; transform: translateX(-50%); flex-direction: column; align-items: center; width: min(460px, 44vw); }
.battery {
  position: relative; width: 132px; height: 30px; border: 2.5px solid var(--ink); border-radius: 7px; background: var(--paper);
  box-shadow: 2px 3px 0 rgba(20, 24, 20, .2);
}
.battery::after { content: ""; position: absolute; right: -8px; top: 8px; width: 6px; height: 10px; background: var(--ink); border-radius: 0 3px 3px 0; }
.battery-cell { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc(100% - 6px); background: var(--green); border-radius: 3px; transition: background .3s; transform-origin: left; }
.battery-text { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: .95rem; text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper); }
.battery.low .battery-cell { background: var(--red); }
.battery.mid .battery-cell { background: var(--sun); }
.battery.low { animation: blink .8s steps(2) infinite; }
.battery.charged { animation: glow .6s ease-out; }
@keyframes blink { 50% { border-color: var(--red); } }
@keyframes glow { from { box-shadow: 0 0 0 6px rgba(18, 159, 74, .45); } }
.speed { font-weight: 700; font-size: .95rem; background: rgba(251, 251, 247, .85); padding: 2px 8px; border-radius: 6px; }
.speed em { font-style: normal; font-weight: 600; color: var(--mist); font-size: .8rem; margin-left: 4px; }
.progress { display: flex; align-items: center; gap: 8px; width: 100%; font-size: .78rem; font-weight: 700; background: rgba(251, 251, 247, .85); padding: 4px 10px; border-radius: 8px; }
.progress span { white-space: nowrap; max-width: 30%; overflow: hidden; text-overflow: ellipsis; }
.progress-line { position: relative; flex: 1; height: 3px; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 11px); }
.progress-line i { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); }
.race-row { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 6px; background: rgba(251, 251, 247, .88); padding: 2px 12px; border-radius: 10px; }
.timer { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.timer.over { color: var(--mist); }
.race-side { display: flex; flex-direction: column; align-items: flex-start; font-size: .78rem; font-weight: 700; line-height: 1.2; }
.best { color: var(--mist); }
.delta { color: var(--red); font-variant-numeric: tabular-nums; }
.delta.ahead { color: var(--green-dark); }
/* −0,2 s por sabor: selo verde que pula ao lado do relógio */
.bonus { position: absolute; left: calc(100% + 6px); top: 50%; margin-top: -.75em; font-weight: 700; font-size: .95rem; color: var(--paper); background: var(--green-dark); padding: 1px 7px; border-radius: 6px; transform: rotate(-4deg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bonus.pop { animation: bonus .35s cubic-bezier(.2, 1.6, .5, 1) both; }
@keyframes bonus { from { transform: rotate(-4deg) scale(1.6) translateY(-6px); opacity: .3; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
.countdown {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: clamp(5rem, 16vw, 9rem); font-weight: 700;
  color: var(--ink); text-shadow: 0 0 0 var(--paper), 4px 4px 0 rgba(251, 251, 247, .9); pointer-events: none;
}
.countdown.tick { animation: count .8s ease-out both; }
.countdown.go { color: var(--green-dark); animation: go .7s ease-out both; }
@keyframes count { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: translate(-50%, -50%) scale(.9); opacity: .15; } }
@keyframes go { from { transform: translate(-50%, -50%) scale(.6) rotate(-6deg); opacity: 1; } to { transform: translate(-50%, -50%) scale(1.5) rotate(-6deg); opacity: 0; } }
.coach {
  margin-top: 8px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--hand); padding: 8px 14px; font-weight: 600;
  font-size: .95rem; text-align: center; opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; max-width: 100%;
}
.coach.show { opacity: 1; transform: none; }
.basket { display: flex; align-items: center; gap: 4px; font-weight: 700; background: rgba(251, 251, 247, .85); padding: 2px 10px 2px 4px; border-radius: 8px; }
.basket canvas { width: 36px; height: 36px; }
.basket.bump { animation: bump .25s ease-out; }
@keyframes bump { 50% { transform: scale(1.15); } }
.icon-btn { padding: .45em .8em; min-height: 38px; font-size: .85rem; }
.icon-btn[aria-pressed="true"] { background: var(--wash); text-decoration: line-through; }

.touch-hints { display: none; }
.has-touch .touch-hints { display: block; }
.touch { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); width: 132px; height: 88px; border: 2.5px dashed rgba(20, 24, 20, .5); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(251, 251, 247, .55); font-size: .75rem; color: var(--mist); }
.touch b { font-size: 1.05rem; color: var(--ink); }
.touch.turbo { left: max(16px, env(safe-area-inset-left)); }
.touch.jump { right: max(16px, env(safe-area-inset-right)); }
.touch.on { background: rgba(18, 159, 74, .25); border-style: solid; border-color: var(--green-dark); }
.key-hints { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 18px; font-size: .82rem; color: var(--mist); background: rgba(251, 251, 247, .8); padding: 6px 12px; border-radius: 10px; white-space: nowrap; transition: opacity .6s; }
.has-touch .key-hints { display: none; }
.key-hints.fade { opacity: 0; }

dialog { border: none; padding: 0; background: transparent; max-width: 360px; width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(20, 24, 20, .35); }

.rotate { position: absolute; inset: 0; z-index: 5; background: rgba(251, 251, 247, .96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px; text-align: center; }
.rotate[hidden] { display: none; }
.rotate p { max-width: 300px; font-size: 1.05rem; }
.phone { width: 64px; height: 108px; border: 3px solid var(--ink); border-radius: 12px; position: relative; animation: turn 2.2s ease-in-out infinite; background: var(--wash); }
.phone i { position: absolute; left: 50%; bottom: 6px; width: 12px; height: 4px; margin-left: -6px; border-radius: 2px; background: var(--ink); }
@keyframes turn { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }

@media (max-width: 720px) {
  .hud-center { top: calc(max(10px, env(safe-area-inset-top)) + 64px); width: min(420px, 92vw); }
  .battery { width: 104px; height: 26px; }
  .battery::after { top: 6px; }
  .map-bar { gap: 10px; padding-left: 12px; }
}
/* Celular deitado e telas baixas: tudo cabe sem rolar (ou quase). */
@media (max-height: 520px) {
  .sheet { padding: 12px 16px; max-width: 760px; }
  .sheet::before { display: none; }
  h2, .card h2 { font-size: 1.25rem; margin-bottom: .25em; }
  p { margin-bottom: .4em; line-height: 1.3; font-size: .9rem; }
  .actions { margin-top: 10px; }
  button, .button { min-height: 40px; padding: .6em 1.1em; }
  .bike-list { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 4px; }
  .bike-card canvas { width: 56px; height: 35px; }
  #bikes .note { display: none; }
  .goals { gap: 2px; margin-top: 6px; font-size: .88rem; }
  .goals .s { width: 20px; height: 20px; }
  .stamp { width: 70px; height: 70px; font-size: .52rem; }
  .stamp canvas { width: 28px; height: 28px; }
  .stamp-row { gap: 12px; margin-bottom: 2px; }
  .stats { gap: 2px 12px; font-size: .8rem; margin-top: 6px; }
  .controls-hint { margin-top: 6px; font-size: .8rem; }
  .final-logo { width: 120px; }
  .stamps { gap: 6px; margin: 6px 0; }
  .stamps .stamp { width: 64px; height: 64px; }
  .title-card { padding: 10px 14px; gap: 12px; margin-top: 8px; max-width: 700px; }
  .title-logo { width: 96px; }
  #title h1 { font-size: 1.6rem; }
  .lede { font-size: .82rem; }
  .title-copy .actions { margin-top: 6px; }
  .timer { font-size: 1.35rem; }
  .race-row { margin-top: 3px; padding: 0 8px; }
  .bike-card { padding: 4px; gap: 1px; }
  .bike-card strong { font-size: .72rem; }
  .bike-card .tag { font-size: .64rem; }
  .stats-dots { font-size: .6rem; margin-top: 1px; }
  .stat { min-width: 86px; gap: 4px; }
  .time-big { font-size: 1.5rem; }
  .hud-center { top: max(8px, env(safe-area-inset-top)); width: min(360px, 40vw); }
  .coach { font-size: .8rem; padding: 5px 10px; }
  .touch { width: 110px; height: 70px; }
  .bonus { font-size: .8rem; }
  .title-extra { margin-top: 6px; }
  .arrival { gap: 12px; }
  .tasting { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rank-box { padding: 8px 10px; }
  .rank-list li { padding: 1px 0; }
  .slot { width: 1.5em; height: 1.65em; font-size: 1.2rem; }
  .rank-list.full li { padding: 3px 6px; }
  .map-bar { padding: 6px 8px 6px 12px; gap: 10px; }
  .map-info { font-size: .8rem; }
}
@media (max-width: 560px) {
  .title-card { flex-direction: column; text-align: center; }
  .title-copy .actions { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .stamp.pop, .battery.low, .basket.bump, .countdown.tick, .countdown.go, .record.new, .bonus.pop, .rank-title.new, .slot.cursor { animation: none; }
}
