:root {
  color-scheme: dark;
  font: 500 16px/1.35 "Avenir Next", system-ui, sans-serif;
  color: #fffbed; background: #162019;
  --panel: #18231f; --edge: #657366; --muted: #b6c3b5;
  --gold: #ffcc62; --mint: #c5f49b;
  --heading: "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --gutter: clamp(.55rem, 2.5vw, 2.6rem);
  --shadow: 0 2px 5px #102016de, 0 0 18px #101810ac;
  --glass: #15231ee6;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select, summary { font: inherit; color: inherit; }
button, select { background: var(--panel); border: 1px solid #81918299; border-radius: 6px; padding: .48rem .72rem; min-height: 44px; }
button, summary { cursor: pointer; font-weight: 750; touch-action: manipulation; }
@media (hover:hover) { button:hover, select:hover, summary:hover { border-color: var(--mint); } }
:is(button,summary,select,input):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
kbd { font: 700 .65rem/1 ui-monospace,monospace; border: 1px solid currentColor; border-radius: 3px; padding: .16rem .25rem; margin-left: .22rem; opacity: .7; }
.primary { background: var(--gold); border-color: var(--gold); color: #201d13; }
.game { position: relative; isolation: isolate; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
.stage, #world { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage { isolation: isolate; background: #89978c; }
#world { display: block; touch-action: none; user-select: none; -webkit-touch-callout: none; z-index: -2; }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; background: linear-gradient(180deg,#08181071 0,transparent 20%,transparent 75%,#0b180f64); }
.game[data-mode=ready] .stage::after { background: linear-gradient(0deg,#0c1a13ce,transparent 55%), linear-gradient(90deg,#10201977,transparent 65%); }
.top, .stage-top, .riding-controls { position: absolute; inset-inline: var(--gutter); pointer-events: none; }
.top { top: max(.55rem,env(safe-area-inset-top)); z-index: 3; display: flex; align-items: center; gap: 1rem; }
.top button, .stage-top button, #camera-tools, .riding-controls button { pointer-events: auto; }
.brand { font: italic 950 clamp(1.35rem,3vw,2.8rem)/1 var(--heading); letter-spacing: -.085em; text-shadow: var(--shadow); }
.brand span { color: var(--gold); }
.brand small { display: none; }
#rider-picker { min-width: 0; padding: 0; border: 0; margin: 0 0 0 auto; pointer-events: auto; }
.game:not([data-mode=ready]) #rider-picker { display: none; }
#rider-picker legend { padding: 0 .18rem .18rem; color: #fffae9; text-shadow: var(--shadow); font: 750 .62rem/1 system-ui,sans-serif; text-transform: uppercase; letter-spacing: .1em; }
#rider-picker details { position: relative; }
#rider-picker summary, #rider-options label {
  display: flex; align-items: center; gap: .45rem; min-height: 44px;
  border: 1px solid #9eb3a482; border-radius: .48rem; padding: .18rem .55rem .18rem .2rem;
  background: #15231ef5; color: #fffbed; font: 700 .85rem/1.12 system-ui,sans-serif;
}
#rider-picker summary { list-style: none; }
#rider-picker summary::-webkit-details-marker { display: none; }
#rider-picker summary::after { content: '▾'; margin-left: auto; color: var(--mint); }
#rider-picker details[open] summary::after { content: '▴'; }
#rider-picker img { width: 2.5rem; height: 2.6rem; object-fit: cover; flex: none; }
.rider-info { display: grid; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
.rider-info small { color: #c6d4cb; font-size: .76rem; font-weight: 500; }
#rider-picker summary .rider-kit { display: none; }
#rider-options { position: absolute; right: 0; top: calc(100% + .25rem); width: min(35rem,calc(100vw - 2 * var(--gutter)));
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem; padding: .45rem;
  max-height: calc(100dvh - 6rem); overflow-y: auto; border-radius: .6rem; background: #101c18; box-shadow: 0 .25rem 1rem #0007; }
#rider-options label { position: relative; cursor: pointer; display: grid; grid-template-columns: 2.5rem minmax(0,1fr);
  grid-template-rows: auto auto 1fr; column-gap: .4rem; row-gap: .12rem; align-items: start; padding: .32rem; }
#rider-options img { grid-row: 1 / 3; }
#rider-options .rider-info { display: contents; }
#rider-options .rider-info > span { align-self: end; }
#rider-options .rider-kit { grid-column: 1 / -1; font-weight: 450; line-height: 1.25; }
#rider-options .rider-kit:empty { display: none; }
#rider-options input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
#rider-options label:has(:checked) { border-color: var(--kit-color); box-shadow: inset 0 -3px var(--kit-color); }
#rider-options label:has(:focus-visible) { outline: 2px solid var(--gold); }
.stats { display:flex; align-items:stretch; gap:.5rem; width:fit-content; padding-right:.7rem; background:#0e181ae8; color:#fffbed; border-left:3px solid #d8ff45; }
.stats > div { padding-left:.45rem; border-left:1px solid #8b968c55; }
.stats #instant-replay { padding-inline:.15rem; }
.stats #instant-replay:enabled { color:#d8ff45; }
#jump-progress, #start-career-xp { display:block; appearance:none; border:0; border-radius:0; background:#6c766b; color:#d8ff45; accent-color:#d8ff45; }
#jump-progress::-webkit-progress-bar, #start-career-xp::-webkit-progress-bar { background:#657066; }
#jump-progress::-webkit-progress-value, #start-career-xp::-webkit-progress-value { background:#d8ff45; }
#jump-progress::-moz-progress-bar, #start-career-xp::-moz-progress-bar { background:#d8ff45; }
#jump-progress { width:100%; height:2px; }
.speed:has(#boost-ride:not([hidden])) #jump-progress { display:none; }
.stats #boost-ride { display:flex; align-items:center; gap:2px; color:var(--gold); font:850 .5rem/1 system-ui,sans-serif; letter-spacing:.02em; }
#boost-ride i { width:4px; height:5px; border-radius:1px; background:#697568; }
#boost-ride[data-charge="1"] i:first-of-type { background:var(--gold); }
.stats #boost-ride[data-charge="2"] { color:var(--mint); }
#boost-ride[data-charge="2"] i { background:var(--mint); }
@media (prefers-reduced-motion:no-preference) {
  #boost-ride[data-charge="1"] i:first-of-type, #boost-ride[data-charge="2"] i:last-of-type { animation:boost-cell .45s ease-out; }
  @keyframes boost-cell { from { transform:scale(1.6); box-shadow:0 0 8px currentColor; } to { transform:none; } }
}
.stats > div, #instant-replay { display: grid; text-align: left; align-content: center; }
.stats span, .speed small { font: 850 .6rem/1.35 system-ui,sans-serif; letter-spacing: .1em; }
.stats strong, .speed strong { font: italic 850 1.45rem/1 var(--heading); font-variant-numeric: tabular-nums; }
.stats strong.scored, #instant-replay:enabled #score-label { color: var(--mint); }
#ranking-ride-goal { color:var(--gold); font:800 .57rem/1.15 system-ui,sans-serif; white-space:nowrap; }
#ranking-ride-goal[data-ahead] { color:var(--mint); }
.stats:has(#ranking-ride-goal[data-personal]:not([hidden])) > div { display:none; }
@media (prefers-reduced-motion:no-preference) {
  #ranking-ride-goal[data-ahead] { animation:score-land .28s ease-out; }
}
#instant-replay { position:relative; border:none; background:transparent; padding:0; text-shadow:var(--shadow); }
#score-gain {
  position:absolute; top:calc(100% + .25rem); left:0; opacity:0; pointer-events:none;
  padding:.17rem .55rem .2rem .43rem; border-left:3px solid var(--gold);
  background:#202a23; color:#fff4cf; clip-path:polygon(0 0,100% 0,calc(100% - .35rem) 100%,0 100%);
  font:italic 900 .9rem/1 var(--heading); font-variant-numeric:tabular-nums; letter-spacing:0;
}
.restart, #freeze, #camera-tools summary { background: var(--glass); text-align: center; }
.restart { margin-left: auto; }
#retry-replay { margin-left: auto; background: var(--glass); white-space: nowrap; }
.game[data-mode=ride] #retry-replay { position: absolute; top: 3.15rem; right: 0; }
.game[data-mode=ride]:has(#camera-tools[open]) #retry-replay { visibility: hidden; }
@media (pointer:coarse) {
  .game[data-mode=ride]:has(#camera-tools[open]) .stage-top { z-index: 4; }
  .game[data-mode=ride]:has(#camera-tools[open]) #retry-replay {
    visibility: visible; width: 5.8rem; padding-inline: .2rem; white-space: normal;
  }
  .game[data-mode=ride]:has(#camera-tools[open]) #retry-replay kbd { display: none; }
}
.game:is([data-mode=ride],[data-mode=replay]) .restart { display: none; }
.game:is([data-mode=ride],[data-mode=pause]) #freeze { right: 0; width: 5.8rem; padding-inline: .2rem; }
.game:is([data-mode=ride],[data-mode=pause]) #camera-tools { top: 0; right: 6.1rem; }
.game[data-mode=pause] .restart { position:absolute; top:3.25rem; right:0; }
.game[data-mode=pause]:has(#camera-tools[open]) .restart { visibility:hidden; }

/* The camera cut stays within one press while the other thumb holds a trick. */
#quick-camera { display: none; }
.game[data-mode=ride] .stage-top {
  display: flex; align-items: flex-start; justify-content: flex-end; gap: 3px;
}
.game[data-mode=ride] #quick-camera,
.game[data-mode=ride] #camera-tools,
.game[data-mode=ride] #freeze { position: relative; inset: auto; }
.game[data-mode=ride] #quick-camera {
  display: inline-flex; align-items: center; justify-content: center; min-width: 8.5rem;
  background: var(--glass); color: var(--mint); border-radius: 6px 0 0 6px;
}
.game[data-mode=ride] .stats #instant-replay { min-width: 44px; }
.game[data-mode=ride] #camera-tools { margin-left: -4px; }
.game[data-mode=ride] #camera-tools summary {
  justify-content: center; width: 44px; font-size: 0; border-radius: 0 6px 6px 0;
}
.game[data-mode=ride] #camera-tools summary::after {
  content: ''; width: 8px; height: 8px; margin: -3px 0 0;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.game[data-mode=ride] #camera-tools[open] summary::after {
  margin: 3px 0 0; transform: rotate(225deg);
}
.game[data-mode=ride] #camera-tools .lenses { right: 0; }
@media (max-width: 660px), (pointer: coarse) {
  .game[data-mode=ride] #quick-camera {
    min-width: 0; width: 6.1rem; padding: .2rem .25rem; font-size: .78rem; line-height: 1.1;
  }
  .game[data-mode=ride] #freeze {
    width: 44px; font-size: 0;
  }
  .game[data-mode=ride] #freeze::after {
    content: ''; display: inline-block; height: 14px; width: 11px;
    border-inline: 4px solid currentColor;
  }
}

#pause-actions { position: absolute; z-index: 2; right: max(var(--gutter),env(safe-area-inset-right)); bottom: max(.65rem,env(safe-area-inset-bottom)); }
.stage-top { top: max(.55rem,env(safe-area-inset-top)); height: 44px; z-index: 2; }
.speed { display:grid; align-content:center; gap:1px; min-width:3rem; max-width:8rem; min-height:44px; margin:0; padding:.12rem .45rem; background:#293626; }
.speed:has(#jump-progress[hidden]) { width:4.6rem; }
.speed:has(#jump-progress[hidden]) strong { font:800 .75rem/1.04 system-ui,sans-serif; }
.game:is([data-mode=ride],[data-mode=pause],[data-mode=replay]) .brand { display: none; }
#freeze { position: absolute; right: 9.5rem; top: 0; }
#camera-tools { position: absolute; top: 3.25rem; right: 0; text-align: right; }
#camera-tools summary { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .65rem; border: 1px solid #81918299; border-radius: 6px; }
#camera-tools summary::after { content: "+"; width: 1ch; margin-left: .25rem; color: var(--gold); }
#camera-tools[open] summary::after { content: "−"; }
#camera-tools[open] { z-index: 3; }
#camera-tools .lenses {
  position: absolute; top: 100%; right: 0; width: min(14rem,64vw); margin-top: .2rem;
  display: flex; flex-wrap: wrap; gap: .2rem; justify-content: flex-end;
  padding: .25rem; background: #192820f2; border-radius: 6px;
}
#camera-tools button { font-size: .8rem; }
.lenses button[aria-pressed=true] { color: var(--mint); border-color: currentColor; }
.zoom-controls { display:grid; width:100%; grid-template-columns:44px 1fr 44px; align-items:center; gap:.25rem; }
#camera-tools .zoom-controls button { min-height:44px; padding:0; text-align:center; font-size:1.25rem; }
.zoom-controls button[aria-disabled=true] { opacity:.5; }
#zoom-level { text-align:center; color:var(--mint); font:850 .9rem/1 system-ui,sans-serif; font-variant-numeric:tabular-nums; }
.game[data-mode=ready] :is(.stats,.restart,.stage-top), .game[data-mode=ready]:not(:has(#setup[open] #loadout[open])) .riding-controls, .game[data-mode=result] :is(.stats,.stage-top,.restart), .game[data-mode=pause] .riding-controls { display: none; }

.card { position: absolute; z-index: 2; left: var(--gutter); bottom: max(var(--gutter),env(safe-area-inset-bottom)); width: min(28rem,calc(100% - 2 * var(--gutter))); }
.card h1, .card h2 { font: italic 950 clamp(2.35rem,6.4vw,6.6rem)/.9 var(--heading); letter-spacing: -.06em; margin: 0; text-wrap: balance; }
.intro { display: flex; flex-direction: column; align-items: flex-start; max-height: calc(100% - 4.3rem); }
.intro h1, #start-line { text-shadow: var(--shadow); flex: none; }
#whistler-lines { display: flex; gap: .2rem; margin-top: .55rem; padding: .18rem; border-radius: .55rem; background: var(--glass); }
#whistler-lines a { display: grid; place-items: center; min-height: 44px; padding: 0 .65rem; border-radius: .4rem; color: #f7f2dc; font-size: .85rem; font-weight: 700; text-decoration: none; }
#whistler-lines a[aria-current] { color: #19241c; background: var(--mint); }
#start-line { margin: .45rem 0 .8rem; color: #f7f2dc; font-size: .93rem; }
#start { flex: none; font: italic 900 1.18rem/1 var(--heading); padding-inline: 1.65rem; min-height: 48px; box-shadow: 0 3px 0 #83622c; }
#setup { margin-top: .65rem; min-height: 0; max-width: 100%; overflow-y: auto; overscroll-behavior: contain; }
#setup > summary { width: fit-content; padding: .7rem .6rem; min-height: 44px; color: #faf7e7; text-shadow: var(--shadow); }
#setup[open] { background: #15231ef5; border-radius: 6px; padding: 0 .7rem .6rem; width: 100%; }
#setup[open] > summary { position: sticky; top: 0; z-index: 1; background: #15231e; width: 100%; }
#setup #audio-muted { width: 1.2rem; height: 1.2rem; vertical-align: middle; }
#setup p { margin: .3rem 0; font-size: .82rem; }
#career-status { color: var(--mint); }
#venue { max-width: 100%; }
.gesture-tip { display: none; }
.result { padding: 1rem; background: #16241ef2; border-left: 4px solid var(--gold); max-height: calc(100% - 4.5rem); overflow-y: auto; overscroll-behavior: contain; }
.result[data-success=true] { border-color: var(--mint); }
.result h2 { font-size: clamp(2rem, 4vw, 3.7rem); }
.result[data-success=true] h2 { font-size: 1.1rem; letter-spacing: .02em; }
#result-score:not([hidden]) { display: block; width: fit-content; margin-top: .2rem; color: var(--mint); font: italic 950 clamp(2.65rem, 5vw, 4.5rem)/1 var(--heading); letter-spacing: -.05em; transform-origin: left bottom; }
@keyframes score-land { from { transform: scale(.84); } 65% { transform: scale(1.04); } to { transform: none; } }
@media (prefers-reduced-motion:no-preference) { #result-score:not([hidden]) { animation: score-land .36s ease-out; } }
.result p { margin: .4rem 0; }
#flight-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) max-content; gap: .5rem; margin: .45rem 0; padding: .35rem 0; border-block: 1px solid var(--edge); }
#flight-stats dt { color: #c6d2cd; font-size: .75rem; }
#flight-stats dd { margin: 0; font: italic 850 clamp(1rem, 3.8vw, 1.22rem)/1.2 var(--heading); font-variant-numeric: tabular-nums; }
#flight-speed { white-space: nowrap; }
#flight-comparison { color:var(--mint); font-size:.85rem; font-weight:750; }
.actions, #boost-result { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .55rem; }
#career-result { color: var(--mint); }
.rank-receipt { margin: .7rem 0; padding: .6rem .7rem; border-left: 3px solid #d8ff45; background: #202e2c; }
.rank-receipt > div { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.rank-receipt #career-result { color: #d8ff45; font: italic 900 1.45rem/1 var(--heading); white-space:nowrap; }
.rank-receipt #result-rank { color: #e2eade; font-size: .8rem; font-weight: 750; }
.rank-receipt progress { display:block; width:100%; height:5px; border:0; margin:.45rem 0; background:#42524e; accent-color:#d8ff45; }
.rank-receipt progress::-webkit-progress-bar { background:#42524e; }
.rank-receipt progress::-webkit-progress-value { background:#d8ff45; }
.rank-receipt progress::-moz-progress-bar { background:#d8ff45; }
.rank-receipt #result-unlock { margin:.25rem 0 0; font-weight:750; font-size:.88rem; }
.rank-receipt small { color:#c6d2cd; font-size:.76rem; }
.rank-receipt:has(#equip-reward:not([hidden])) { border-color:var(--gold); }
.equip-reward { display:flex; align-items:center; justify-content:center; width:100%; gap:.5rem; min-height:44px; padding:.2rem .5rem; background:var(--gold); color:#211b0e; border-color:transparent; font:750 .94rem/1.2 system-ui,sans-serif; }
#equip-reward { margin-top:.55rem; }
.next-run #equip-reward { margin-top:0; }
.next-run #hunt-trick:not([data-quick-train]) { background:var(--gold); color:#211b0e; border-color:var(--gold); }
.next-run #hunt-trick[data-quick-train] { background:#26372b; color:#e4f7d4; border-color:#a5cb87; }
#result-trick-actions:not(:has(button:not([hidden]))) { display:none; }
@media (orientation:landscape) and (max-height:470px) {
  .next-run:has(> :is(#equip-reward,#hunt-trick):not([hidden])) > :is(button:first-child,#equip-reward,#hunt-trick) { flex:1 1 45%; min-width:0; }
  .result:has(#replay-best:not([hidden])) { width:min(34rem,calc(100% - 2 * var(--gutter))); max-height:calc(100% - 3.4rem); padding:.65rem .8rem; }
  .next-run:has(> :is(#equip-reward,#hunt-trick):not([hidden])):has(> #retry-line:not([hidden])) > :is(button:first-child,#equip-reward,#hunt-trick,#retry-line) {
    flex:1 1 29%; min-width:0; padding-inline:.35rem;
  }
  .next-run:has(> :is(#equip-reward,#hunt-trick):not([hidden])):has(> #retry-line:not([hidden])) > #again:first-child { flex-basis:39%; }
  .next-run:has(> #hunt-trick[data-quick-train]:not([hidden])):has(> #retry-line:not([hidden])) > :is(#again,#equip-reward,#hunt-trick,#retry-line) {
    flex:1 1 20%; align-self:stretch; min-width:0; padding:.38rem .28rem; font-size:.86rem; line-height:1.1;
  }
  .next-run:has(> #hunt-trick[data-quick-train]:not([hidden])):has(> #retry-line:not([hidden])) > #again:first-child { flex-basis:26%; }
  .next-run:has(> #hunt-trick[data-quick-train]:not([hidden])) #again-goal { font-size:.67rem; }
  .next-run:has(> #hunt-trick[data-quick-train]:not([hidden])) .equip-reward::before { display:none; }
  .result:has(.next-run > #hunt-trick[data-quick-train]:not([hidden])) {
    bottom:max(.35rem,env(safe-area-inset-bottom)); max-height:calc(100% - 2.5rem);
  }
}
.equip-reward::before { content:''; width:3rem; height:2rem; background:var(--trick-sheet,url('./manobras.webp')) 50% var(--pose-row) / 900% var(--sheet-height,1000%) no-repeat; }
.next-run button { flex:1 1 auto; }
#again-goal { display:block; margin-top:.2rem; font:750 .75rem/1.2 system-ui,sans-serif; text-transform:none; }
.trick-book { border-top:1px solid var(--edge); font-size:.86rem; }
.trick-book summary { padding:.65rem 0; min-height:44px; }
.trick-book ul { display:flex; flex-wrap:wrap; gap:.3rem; list-style:none; margin:.5rem 0 0; padding:0; }
.trick-book li { padding:.15rem .4rem; border:1px solid #61726a; color:#d1dcd5; }
.trick-book li[data-earned=true] { color:#d8ff45; border-color:#91a83f; }
#beat-result { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.35rem; width:100%; }
#beat-result button { display:grid; align-content:center; padding:.25rem .5rem; text-align:left; line-height:1.15; }
#beat-result small { color:var(--mint); font-weight:800; }
#beat-result button[data-hit=false] small { color:#ffc4ad; }
#beat-result strong { font-size:.81rem; }
@media (orientation:landscape) and (max-height:470px) {
  #boost-result:has(#beat-result:not([hidden])) { flex-wrap:nowrap; }
  #boost-result #beat-result { flex:1 1 0; min-width:0; }
  #boost-result #retry-boost { flex:none; }
}
#score-sheet { margin-top: .55rem; border-block: 1px solid var(--edge); }
#score-sheet section > small { display: block; color: var(--gold); }
#score-sheet summary { padding-block: .65rem; min-height: 44px; color: var(--mint); font-weight: 800; }
#score-sheet section { padding: .45rem 0; border-top: 1px solid var(--edge); }
#score-sheet header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#score-sheet h3 { margin: 0; font-size: .86rem; }
#score-sheet h3 small { display: block; margin-top: .14rem; color: #c6d2cd; font-weight: 650; }
#score-sheet .split-comparison[data-change=gain] { color:var(--mint); }
#score-sheet .split-comparison[data-change=loss] { color:#ffc4ad; }
#score-sheet header button { flex: none; min-height: 44px; padding: .25rem .65rem; font-size: .8rem; }
#score-sheet .score-row { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; font-size: .88rem; }
#score-sheet button.score-row {
  width: 100%; margin-top: .25rem; padding: .3rem .55rem; align-items: center;
  text-align: left; background: #182a23; border-color: var(--edge);
}
#score-sheet button.score-row:is(:hover,:focus-visible) { border-color: var(--mint); }
#score-sheet button.score-row b::after { content: "▶"; margin-inline-start: .45rem; font-size: .72em; }
#score-sheet .score-row small { display: block; margin-top: .1rem; color: #c6d2cd; }
#score-sheet .score-row b { color: var(--mint); font-variant-numeric: tabular-nums; white-space: nowrap; }
#score-sheet [data-failed] .score-row b { color: #c6d2cd; }
#score-sheet .score-row[data-deduction] b { color: #ffc4ad; }

.riding-controls { z-index: 2; bottom: max(.65rem,env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: flex-end; }
.rotation-pad,.pose-pad { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: clamp(8.3rem,19vw,14rem); gap: .25rem; touch-action: none; }
.riding-controls button { position: relative; overflow: hidden; background: #172a21a8; border: 1px solid #e1f0d471; border-radius: 1.4rem; text-shadow: 0 1px 3px #142419; color: #fff9e8; min-height: 44px; padding: .25rem; font-size: clamp(.67rem,1.4vw,.85rem); white-space: nowrap; user-select: none; touch-action: none; }
#undo-queued, :is(#riding-controls,#left-thumb) > #slow { position: absolute; right: 0; bottom: calc(100% + .28rem); padding: 0 .65rem; min-height: 44px; background: var(--glass); border: 1px solid #81918299; color: #fffbed; font: 700 .78rem/1.2 system-ui,sans-serif; }
#riding-controls > #slow { min-width: 5rem; }
#left-thumb > #slow { left: 0; right: auto; width: 5.75rem; }
:is(#riding-controls,#left-thumb) > #slow[aria-pressed=true] { color: var(--mint); border-color: currentColor; }
#undo-queued kbd { position: static; }
.riding-controls button.primary { background: #424e32b5; border-color: #e2d49294; }
.riding-controls button[data-active=true], .riding-controls .charging { color: var(--mint); border-color: var(--mint); background: #2b452beb; }
.rotation-pad .charging::after,.pose-pad .thumb-down::after { content: ""; position: absolute; inset: auto 6px 3px; height: 3px; background: var(--mint); transform-origin: left; }
.rotation-pad .charging::after { transform: scaleX(var(--charge,0)); }
.pose-pad button.boost-choice { background: var(--gold); color: #251c10; }
.pose-pad button[data-boost-aim] { outline: 3px solid var(--gold); outline-offset: -3px; }
.pose-pad button.plan-choice { outline: 3px solid var(--mint); outline-offset: -3px; }
.pose-pad button:is(.catch-ready,.catch-save) { color: #241c0e; background: var(--gold); border-color: #fff4c5; box-shadow: 0 0 0 3px #f1c86b80; }
.pose-pad button:is(.catch-ready,.catch-save)::before {
  content: "SOLTE"; position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
  padding: 1px 4px; border-radius: 2px; color: #ffda86; background: #2b2313;
  font: 750 9px/1 system-ui,sans-serif; letter-spacing: .07em; text-shadow: none;
}
.game:not(.slow-controls) .pose-pad :is(.catch-ready,.catch-save) .move-name { display: inline-block; transform: translateY(4px); }
.pose-pad button.catch-center::before { content: "SOLTE +150"; background: #fff5d2; color: #272319; }
.pose-pad button[data-partner]:not(.catch-ready,.catch-save)::before {
  content: attr(data-partner); position: absolute; top: 2px; right: 3px;
  width: 1.1rem; border-radius: 50%; background: #c4ffd7; color: #102318;
  font: 850 .94rem/1.1rem system-ui,sans-serif; text-align: center; text-shadow: none;
}
.pose-pad button.pose-transfer, .slow-controls .pose-pad button.pose-transfer {
  color: #efffee; background: #245448f5; border-color: var(--mint); box-shadow: inset 0 -3px var(--mint);
}
.pose-pad button.pose-transfer .move-name::before { content: '↳ '; color: var(--mint); }
@media (prefers-reduced-motion:no-preference) {
  .pose-pad button.pose-transfer { animation: pose-transfer .56s ease-out 2; }
  @keyframes pose-transfer { from { box-shadow: inset 0 0 0 3px #9effbfaa; } }
}
.pose-pad button.link-pose::before {
  content: "+"; position: absolute; top: 2px; left: 5px;
  color: var(--mint); font: 900 .8rem/1 system-ui,sans-serif;
}
.game[data-mode=ride] .pose-pad button[data-ready=false][data-active=false]:not([data-award],[data-boost-hit],[data-queued],.pose-rejected) { opacity: .6; }
.riding-controls .pose-pad button[data-queued][data-active=false] {
  color: var(--gold); border-color: var(--gold); background: #403318f5;
}
.pose-pad button[data-queued][data-active=false]::after {
  content: 'A seguir'; position: absolute; inset: 2px auto auto 4px; height: auto;
  padding: .1rem .2rem; border-radius: .2rem; color: #252010; background: var(--gold);
  font: 800 .62rem/1 system-ui,sans-serif; text-shadow: none;
}
.riding-controls button.move-late, .pad-directions .move-late i, #pad-cashroll.move-late { outline: 2px solid var(--gold); outline-offset: -2px; }
.riding-controls button.turn-window-closed, .pad-directions .turn-window-closed i, #pad-cashroll.turn-window-closed { opacity: .6; }
.riding-controls button:is(.turn-rejected,.pose-rejected), .pad-directions .turn-rejected i, #pad-cashroll.turn-rejected {
  opacity: 1; color: var(--gold); outline: 2px solid currentColor; outline-offset: -2px;
}

#turn-repeat {
  position: absolute; left: 25%; top: clamp(18px, var(--tap-y), calc(100% - 18px));
  translate: -50% -50%; pointer-events: none; padding: 4px 8px;
  color: #152119; background: var(--mint); border: 2px solid #203425; border-radius: 999px;
  font: 750 12px/1.2 system-ui, sans-serif; white-space: nowrap;
}
#steering-stick { position: absolute; translate: -50% -50%; width: 80px; height: 80px; display: grid; place-items: center; border-radius: 50%; pointer-events: none; border: 1px solid #fffc; background: #18261944; }
#steering-stick.orbit-pending::after { content: ''; position: absolute; inset: 7px; border: 2px solid var(--gold); border-radius: 50%; animation: orbit-hold .24s ease-out both; }
@keyframes orbit-hold { from { transform: scale(.45); opacity: .25; } to { transform: scale(1); opacity: 1; } }
#steering-stick i { width: 16px; height: 16px; border: 2px solid var(--gold); border-radius: 50%; background: var(--panel); }

.air,.notice,#trick-credits,#replay-caption { position: absolute; pointer-events: none; text-shadow: var(--shadow); }
.air { top: clamp(4.5rem,12vh,8rem); left: var(--gutter); width: min(18rem,57%); }
.air > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .45rem; }
#air-title,.notice b { font: italic 900 clamp(1.15rem,2.8vw,2.5rem)/1 var(--heading); letter-spacing: -.035em; }
.notice { color: var(--mint); font-weight: 850; }
#air-score { display: inline-flex; align-items: baseline; gap: .3rem; padding: .08rem .35rem; border-radius: .22rem; background: #172019e8; color: var(--gold); font-weight: 850; white-space: nowrap; text-shadow: none; }
#air-score small { font: 800 .64rem/1 system-ui,sans-serif; letter-spacing: .035em; text-transform: uppercase; }
#air-score.at-risk { color: #ffc4ad; }
#air-score[data-target-ready] { color: var(--mint); }
@media (prefers-reduced-motion:no-preference) {
  #air-score[data-target-ready] { animation: resi-target-ready .34s ease-out; }
  @keyframes resi-target-ready {
    34% { transform: translateY(-2px) scale(1.08); }
  }
}
#air-combo {
  padding: .18rem .38rem; border: 1px solid #ffcc6280; border-radius: .3rem;
  background: #2c260fee; color: var(--gold); text-shadow: none; white-space: nowrap;
  font: 800 .73rem/1.1 system-ui,sans-serif;
}
#air-detail { margin: .25rem 0; font-size: clamp(.73rem,1.4vw,.88rem); font-weight: 700; }
#air-balance { margin: .08rem 0 .25rem; font: 850 clamp(.73rem,1.4vw,.88rem)/1.15 system-ui,sans-serif; color: var(--gold); }
.air[data-prompt=pop-ready] #air-title { color: var(--gold); }
.air[data-state=late] #air-detail, .air[data-balance=correct] #air-detail, .air[data-prompt=late-move] #air-detail { color: var(--gold); }
.air[data-balance=aligned] #air-balance, .air[data-balance=aligned]:has(#air-balance[hidden]) #air-detail { color: var(--mint); }
.air[data-prompt=idle]:not(:has(#fire-plan:not([hidden]), #air-meter:not([hidden]))) { display: none; }
.air[data-prompt=idle] > :not(.air-clock, #fire-plan, #flow-air-cue) { display: none; }
progress { display: block; height: 4px; width: 100%; margin-top: .35rem; border: none; border-radius: 4px; accent-color: var(--gold); }
.air-clock { position: relative; display: block; max-width: 9rem; }
#air-meter { --flight-fill: var(--mint); appearance: none; background: #30483b; }
.air[data-state=late] #air-meter { --flight-fill: var(--gold); }
#air-meter::-webkit-progress-bar { background: transparent; }
#air-meter::-webkit-progress-value { background: var(--flight-fill); border-radius: inherit; }
#air-meter::-moz-progress-bar { background: var(--flight-fill); border-radius: inherit; }
#retry-window, #retry-mark { position: absolute; pointer-events: none; }
#retry-window { top: -3px; height: 10px; border: 1px solid var(--mint); border-radius: 2px; background: #99facb35; }
#retry-window.retry-open { background: #99facbaa; }
#retry-window.catch-target::after { content: ''; position: absolute; inset: -2px var(--center-inset); border-inline: 2px solid #fff5d2; }
#retry-mark { top: -3px; width: 2px; height: 10px; background: #ffbd91; box-shadow: 0 0 0 1px #442f25; }
.riding-controls button.retry-go, .pad-directions .retry-go i { outline: 2px solid var(--mint); outline-offset: -2px; }
.riding-controls .combo-cue, .pad-directions .combo-cue i { outline: 2px solid var(--gold); outline-offset: 1px; }
@media (prefers-reduced-motion:no-preference) {
  .riding-controls .combo-cue, .pad-directions .combo-cue i { animation: combo-cue .85s ease-out 2; }
  @keyframes combo-cue { from { box-shadow: 0 0 0 2px #ffcc62ab; } to { box-shadow: 0 0 0 8px transparent; } }
}
.pose-pad button.retry-go::before { content: 'AGORA'; position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font: 800 .62rem/1 system-ui,sans-serif; color: var(--mint); }
.boost-readout { display: flex; align-items: center; gap: .45rem; margin-bottom: .25rem; color: var(--gold); font: 800 .7rem/1.2 system-ui,sans-serif; }
#fire-plan { pointer-events: auto; margin-top: .45rem; color: #152319; background: var(--mint); font-size: .84rem; }
#trick-credits { top: 32%; left: var(--gutter); display: grid; gap: .15rem; }
#trick-credits span {
  width: max-content; padding: .24rem .6rem; font: 700 .89rem/1.2 system-ui,sans-serif;
  font-variant-numeric: tabular-nums; color: #eeffdd; background: #132820eb;
  border-left: 3px solid var(--mint); border-radius: 0 .32rem .32rem 0;
}
#trick-credits .echo-credit {
  border-color: #9df6ff; color: #ddfdff; background: linear-gradient(105deg,#143641f5,#17272de8);
}
#boost-count { display:none; white-space:nowrap; }
.boost-readout:has(> #trick-credits > span) #boost-label {
  position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%);
}
.boost-readout:has(> #trick-credits > span) #boost-count { display:inline; }
.boost-readout > #trick-credits { position:static; display:flex; min-width:0; overflow:hidden; --credit-exit-y:0px; }
.boost-readout > #trick-credits > span {
  max-width:100%; padding:0 .15rem; border:0; background:none; color:var(--mint); font:inherit;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.boost-readout > #trick-credits > span.echo-credit { background:none; color:#9df6ff; }
.boost-readout > #trick-credits > span:not(:last-child) { display:none; }
.notice { top: max(4.6rem,13%); left: 50%; width: min(32rem,90%); transform: translateX(-50%); text-align: center; margin: 0; }
.notice b,.notice span { display: block; }
.notice span { color: #fff9e8; font-size: .8rem; }
#credit-brief { display: none; }
.notice .notice-head { display: flex; align-items: center; justify-content: center; gap: .5rem; }
#credit-boost {
  padding: .2rem .4rem; border: 1px solid #e5bf73; border-radius: .3rem;
  background: #18251ef2; color: var(--gold); text-shadow: none; white-space: nowrap;
  font: 850 .72rem/1.1 system-ui,sans-serif;
}
#credit-boost[data-charge="2"] { border-color: var(--mint); color: var(--mint); }
#credit-moves:not(:empty) { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem .8rem; margin: .16rem auto; font: 800 clamp(.86rem,1.8vw,1.08rem)/1.2 system-ui,sans-serif; }
#credit-moves > span { font: inherit; }
#style-reward { width: max-content; max-width: 85vw; margin: .25rem auto 0; padding: .27rem .6rem;
  border-radius: .3rem; border-left: 3px solid var(--gold); background: #15241ef2;
  color: #ffdb8d; font: 720 .8rem/1.2 system-ui,sans-serif; text-shadow: none; }
.replay-controls { position: absolute; z-index: 2; bottom: max(.5rem,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: minmax(0,1fr); gap: .25rem; width: min(34rem,calc(100% - 2 * var(--gutter))); padding: .5rem; background: #16251eea; border-radius: 8px; }
.replay-row,.replay-rate { display: flex; align-items: center; justify-content: space-between; gap: .25rem; }
.replay-row > *, .replay-rate select { min-width: 0; }
.replay-row select { max-width: 100%; }
.replay-timeline { display: flex; align-items: center; gap: .5rem; }
#store-combo { flex: none; color: var(--gold); }
.replay-seek { position: relative; min-width: 0; flex: 1; }
.scrub-track { position: relative; }
#my-angle {
  position: relative;
  width: 5.5rem; max-width: 100%;
  left: clamp(0px, calc(var(--shot-at) - 2.75rem), calc(100% - 5.5rem));
  padding-inline: .25rem; color: var(--gold); border-color: currentColor; font: 700 .8rem/1.1 system-ui,sans-serif;
}
#my-angle[hidden] + .scrub-track #camera-tick { display: none; }
#camera-tick {
  position: absolute; pointer-events: none; z-index: 1;
  left: var(--shot-at); top: 0; height: calc(50% - 4px); width: 2px;
  background: var(--gold); transform: translateX(-50%);
}
#replay-band { position: absolute; bottom: calc(50% - 9px); height: 3px; border-radius: 2px; background: var(--mint); pointer-events: none; }
#scrub { display: block; min-width: 0; width: 100%; min-height: 28px; margin: 0; accent-color: var(--gold); }
#replay-caption { bottom: calc(100% + .3rem); left: 50%; transform: translateX(-50%); width: max-content; max-width: 100%; margin: 0; text-align: center; font-weight: 750; }
#replay-caption[data-landing] { padding: .25rem .55rem; border: 1px solid #a4e2bc78; border-radius: .4rem; background: #102720ed; color: var(--mint); }
#replay-caption[data-landing=saved] { border-color: #ecb86b; color: var(--gold); }
@media (prefers-reduced-motion:no-preference) {
  #replay-caption[data-landing] { animation: replay-landing .25s ease-out; }
  @keyframes replay-landing { from { opacity: .6; scale: .94; } to { opacity: 1; scale: 1; } }
}
.replay-timeline:has(#replay-beats:not([hidden])) { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 .35rem; }
.replay-timeline:has(#replay-beats:not([hidden])) .replay-seek { grid-column: 1 / -1; }
#replay-windows { position: absolute; inset: 0 8px; pointer-events: none; }
#replay-windows i { position: absolute; top: calc(50% - 9px); height: 3px; border-radius: 2px; background: var(--mint); }
#replay-windows i::before { content: ''; position: absolute; inset: -1px var(--precision-inset); border-radius: 2px; background: #fff6cb; }
#replay-windows i:is([data-hit=true],[data-attempted])::after { content: ''; position: absolute; left: var(--hit); top: 50%; transform: translate(-50%,-50%); width: 8px; height: 8px; border: 1px solid #16231d; border-radius: 50%; background: #ecffed; }
#replay-windows i[data-attempted]::after { border-radius: 1px; background: var(--gold); transform: translate(-50%,-50%) rotate(45deg); }
#replay-windows i[data-hit=false] { background: repeating-linear-gradient(90deg,#ffbf96 0 4px,transparent 4px 6px); }
#replay-beats { display: flex; gap: .35rem; }
#replay-beats button { flex: 1; min-width: 0; font: 700 .78rem/1.1 system-ui,sans-serif; padding: .25rem; color: var(--mint); }
#replay-beats button[data-hit=false] { color: #ffbf96; }
#replay-beats button[aria-pressed=true] { background: #364b40; border-color: currentColor; }
#replay-beats button[data-compare] { color: var(--gold); border-color: currentColor; }
#replay-beats #retry-replay { white-space:normal; color:#16200a; background:#d8ff45; border-color:#d8ff45; }
@media (orientation:landscape) and (min-width:540px) and (max-height:470px) {
  /* Keep the jump replay's controls outside the viewport rendered by the camera. */
  #game[data-mode=replay]:not(:has(#lap-review[open])):has(#replay-controls:not([hidden])) {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  #game[data-mode=replay]:not(:has(#lap-review[open])):has(#replay-controls:not([hidden])) #stage {
    position: relative;
    grid-row: 1;
  }
  #game[data-mode=replay]:not(:has(#lap-review[open])) #replay-controls:not([hidden]) {
    position: relative;
    inset: auto;
    transform: none;
    grid-row: 2;
    justify-self: center;
    grid-template-rows: minmax(1.75rem, auto) auto;
    margin-bottom: max(.5rem, env(safe-area-inset-bottom));
  }
  .replay-controls {
    width: min(54rem, calc(100% - 2 * var(--gutter)));
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    align-items: center; gap: .15rem .5rem; padding: .25rem .45rem;
  }
  .replay-row,.replay-timeline { grid-row: 2; }
  .replay-controls .replay-row select { padding-inline: .25rem; }
  .replay-controls #close-replay { max-width: 3.25rem; padding-inline: .18rem; }
  #replay-beats button { padding-inline: .18rem; }
  .replay-controls #store-combo { width: 4.25rem; padding-inline: .25rem; line-height: 1.1; white-space: normal; }
  #replay-caption {
    position: static; grid-column: 1 / -1; grid-row: 1; justify-self: center;
    transform: none; font-size: .87rem; line-height: 1.25; text-shadow: none;
  }
}
#boost-timing { position: absolute; bottom: calc(100% + .35rem); right: 0; width: clamp(11.5rem, 23vw, 14rem); height: 1.75rem;
  margin: 0; border: solid #14231f; border-width: 0 .45rem .3rem; border-radius: .35rem;
  background: linear-gradient(#4f635a, #4f635a) left bottom / 100% 4px no-repeat, #14231f; pointer-events: none; }
@media (orientation:portrait) { #boost-timing { width: max(49%, 11rem); } }
@media (orientation:landscape) and (max-height:470px) { #boost-timing { width: clamp(11rem, 24vw, 12rem); } }
#boost-timing span::after { content: ''; position: absolute; inset: auto var(--precision-inset) -4px; height: 7px; background: #fff6cb; border-radius: 1px; }
#boost-timing :is(.previous-hit, .previous-miss)::before {
  content: ''; position: absolute; z-index: 1; left: var(--previous-at); bottom: -5px;
  width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg);
  background: #14231f; border: 1.5px solid #ffcf73;
}
#boost-timing .previous-miss::before { background: var(--gold); border-color: #14231f; width: 8px; height: 8px; }
#boost-timing.on-target #timing-cursor { width: 4px; height: 15px; box-shadow: 0 0 0 1px #163221, 0 0 5px #d5ffd8; background: var(--mint); }
.game[data-mode=ride]:has(#boost-timing.on-target) .boost-flight #air-detail { color: var(--mint); }
#boost-timing span, #boost-timing small { position: absolute; bottom: 0; font: 750 .68rem/1 system-ui, sans-serif; color: #d1d6ce; }
#boost-timing span { white-space: nowrap; padding-bottom: .35rem; border-bottom: 4px solid #c4b388; }
#boost-timing small { right: 0; padding-bottom: .6rem; }
#boost-timing:has(.previous-hit, .previous-miss) small { color: var(--gold); }
#boost-timing [data-state="open"] { color: var(--gold); border-color: var(--gold); }
#boost-timing [data-state="hit"] { color: var(--mint); border-color: var(--mint); }
#boost-timing [data-state="miss"] { color: #ffb8a3; border-color: #e39780; }
#boost-timing #timing-cursor { position: absolute; z-index: 2; left: var(--time); bottom: -2px; width: 3px; height: 10px; border-radius: 2px; background: white; box-shadow: 0 0 0 1px #253027; }
#boost-timing .timing-hit {
  position: absolute; z-index: 1; left: var(--hit-at); bottom: -.43rem;
  width: 7px; height: 7px; border-radius: 50%; transform: translateX(-50%);
  background: var(--mint); box-shadow: 0 0 0 1px #253027;
}
#boost-timing[data-preview]:not([hidden]) { display:grid; grid-template-columns:1fr 1fr; align-items:end; gap:.4rem; background:#14231f; }
#boost-timing[data-preview] span { position:static; text-align:center; padding-bottom:.3rem; }
#boost-timing[data-preview] #timing-lip { color:var(--gold); border-color:var(--gold); }
#boost-timing[data-preview] span::before, #boost-timing[data-preview] span::after,
#boost-timing[data-preview] :is(small,i) { display:none; }
.pose-pad:has(> #fire-plan) { position: relative; }
#riding-controls .pose-pad > #fire-plan, #left-thumb > #fire-plan {
  position: absolute; inset: auto 0 calc(100% + .35rem); width: 100%; margin: 0;
  min-height: 44px; padding: .2rem; white-space: normal; border-radius: .65rem;
  color: #152319; background: var(--mint); text-shadow: none; font: 750 .85rem/1.1 system-ui,sans-serif;
}
#fire-plan[data-release], #left-thumb > #fire-plan[data-release] {
  background: var(--gold); color: #211b0e; border-color: #ffe5a2;
}
#fire-plan[data-precision], #left-thumb > #fire-plan[data-precision],
.slow-controls .pose-pad button[data-boost-aim][data-precision] {
  background: var(--mint); color: #14261b; border-color: #edffd9; outline-color: #edffd9;
}
@media (pointer:fine) and (min-width:661px) {
  .riding-controls button:not([data-active=true],.charging,.boost-choice,.plan-choice,.pose-transfer,.catch-save) {
    background: transparent; border-color: transparent; text-shadow: var(--shadow);
  }
  .riding-controls button:not([data-active=true],.charging,.boost-choice,.plan-choice,.pose-transfer,.catch-save):hover {
    background: #15271d94; border-color: #edf6dc77;
  }
  .riding-controls button { font-size: .78rem; }
  .riding-controls kbd { background: #142319b8; color: #fff; opacity: 1; }
}
@media (pointer:coarse), (max-width:660px) {
  kbd,.restart-label,.rate-label { display: none; }
  .restart { width: 44px; font-size: 1.15rem; }
  #freeze { right: 3.1rem; }
  .stats { gap: .5rem; }
  .replay-row button,.replay-row select { padding-inline: .35rem; font-size: .75rem; }
  .replay-row :is(button,select), #store-combo { font-family: system-ui, sans-serif; }
  .replay-row > button, .replay-rate { flex: none; }
  #close-replay { max-width: 3.75rem; }
  #replay-jump { flex: 1; }
  #store-combo { padding-inline: .5rem; font-size: .8rem; }
  .riding-controls { -webkit-user-select: none; }
}
@media (pointer:coarse) {
  .gesture-tip { display: block; }
  .keyboard-tip { display: none; }
  #scrub { min-height: 44px; }
}
@media (max-width:420px) {
  .game:is([data-mode=ride],[data-mode=pause]) .stats > div { display: none; }
  .game:is([data-mode=ride],[data-mode=pause]) .stats { max-width:calc(100% - 11.5rem); }
  .stats #instant-replay { min-width:0; }
  .rotation-pad,.pose-pad { width: 41%; }
  .air { width: 65%; top: 4.3rem; }
  .intro h1 { font-size: clamp(2.6rem,13vw,3.8rem); }
}
@media (max-width:600px) and (orientation:portrait) {
  .notice:not([data-boost-contact]) {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 3.45rem);
    left: var(--gutter); width: min(12rem, 47%); bottom: auto;
    transform: none; text-align: left;
  }
  .notice:not([data-boost-contact]) .notice-head { justify-content: flex-start; flex-wrap: wrap; gap: .2rem; }
  .notice:not([data-boost-contact]) #credit-moves { justify-content: flex-start; }
  .notice:not([data-boost-contact]):has(+ #air:not([hidden], [data-prompt=idle])) { display: none; }
  .game:has(.notice:not([hidden], [data-boost-contact])) #score-gain { visibility: hidden; }
  .notice:not([data-boost-contact]) #style-reward { max-width: 100%; margin-left: 0; }
}
@media (max-width:355px) {
  .game[data-mode=replay] .stats > div { display: none; }
  .game[data-mode=replay] .stage-top:has(#combo-frame:not([hidden])) :is(button,#camera-tools summary) { padding-inline: .48rem; font-size: .88rem; }
}
@media (max-height:470px) {
  .intro h1 { font-size: 2.25rem; }
  #start-line { margin: .15rem 0 .4rem; }
  #setup { margin-top: .25rem; }
  .game { --pose-width: clamp(8.3rem,24vw,12rem); }
  .rotation-pad,.pose-pad { width: var(--pose-width); }
  .air { left: 50%; top: auto; bottom: .5rem; transform: translateX(-50%); width: min(43%,18rem); }
  #air-title { font-size: 1.15rem; }
  #air-detail { font-size: .72rem; }
  #fire-plan { margin-top: .1rem; }
  #trick-credits { top: 3.65rem; }
  .notice { bottom: auto; top: max(14%, calc(max(.55rem, env(safe-area-inset-top)) + 44px + .4rem)); }
}
.notice[data-boost-contact] {
  bottom: auto; top: calc(max(.55rem,env(safe-area-inset-top)) + 3.15rem + 44px + .35rem);
  width: min(16.5rem,calc(100% - 2 * var(--gutter))); padding: .32rem .45rem .38rem;
  border-radius: .4rem; background: var(--glass); text-shadow: none;
}
.notice[data-boost-contact] b { font-size: clamp(1.15rem,2.8vw,1.65rem); }
.notice[data-boost-contact] :is(#credit-moves,#credit-total,#style-reward) { display: none; }
.notice[data-boost-contact] #credit-brief:not(:empty) { display: block; margin-top: .16rem; font: 750 .75rem/1.15 system-ui,sans-serif; }
@media (max-height:470px) {
  .notice[data-boost-contact] { top: calc(max(.55rem,env(safe-area-inset-top)) + 44px + .4rem); width: min(15rem,calc(100% - 2 * var(--gutter))); }
}
@media (prefers-reduced-motion:reduce) { *,*::after,*::before { animation: none !important; } }

.game[data-mode=replay] .stage-top { display: flex; justify-content: flex-end; align-items: flex-start; gap: .35rem; }
.game[data-mode=replay] .stage-top:has(#camera-tools[open]) { z-index: 3; }
.game[data-mode=replay] :is(#combo-frame,#apex,#replay-touchdown,#camera-tools) { position: relative; top: 3.25rem; right: auto; }
@media (orientation:landscape) and (min-width:540px) and (max-height:470px) {
  .game[data-mode=replay] :is(#combo-frame,#apex,#replay-touchdown,#camera-tools) { top: 0; }
  .game[data-mode=replay] .top #retry-replay { position: absolute; top: 3.25rem; right: 0; }
  .game[data-mode=replay] .stage-top :is(button,#camera-tools summary) { padding-inline: .45rem; font-size: .86rem; }
}
#combo-frame { color: var(--gold); border-color: currentColor; }
.audio-setting { display: flex; align-items: center; gap: .45rem; min-height: 44px; }
.trick-art { display: none; }
/* Keep each thumb's targets still from the Boost approach through the landing. */
.slow-controls .riding-controls {
  inset: auto max(var(--gutter), env(safe-area-inset-right)) max(.65rem, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  align-items: flex-end;
}
.slow-controls :is(.rotation-pad,.pose-pad) {
  width: clamp(11.5rem, 23vw, 14rem);
  gap: .35rem;
}
.slow-controls .riding-controls button {
  min-height: 4.55rem;
  padding: .18rem .2rem .38rem;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.12;
  font-family: system-ui, sans-serif; font-weight: 650; letter-spacing: -.025em;
  border-radius: .68rem;
  background: linear-gradient(155deg,#354743f2,#10201df7 78%);
  border: 1px solid #c6ded673;
  border-bottom: 2px solid #86a59a;
  box-shadow: inset 0 1px 0 #ffffff24, 0 3px 8px #0d171b80;
}
.slow-controls .turn-arrow {
  position: absolute; left: .28rem; top: .25rem; display: grid; place-items: center;
  width: 1.1rem; height: 1.1rem; border-radius: .28rem;
  background: #0b1b19aa; color: #deeee3; font: 700 .85rem/1 system-ui, sans-serif;
}
.slow-controls .riding-controls button[data-active=true] { background: #284535f5; border-color: var(--mint); }
.slow-controls .pose-pad button.apex-preview { border-color: var(--gold); box-shadow: inset 0 -2px #ffcf738c; }
.slow-controls .pose-pad button:is(.boost-choice,.catch-ready,.catch-save) {
  background: linear-gradient(155deg,#ffe2a1,#ffbf46 83%); color: #201a10; border-color: #ffe5aa; text-shadow: none;
}
.slow-controls .pose-pad button[data-boost-aim]::before {
  content: attr(data-boost-aim); position: absolute; inset: .45rem 0 auto;
  font: 900 .75rem/1.1 system-ui,sans-serif; text-align: center; text-transform: uppercase;
}
.slow-controls .pose-pad button[data-boost-aim][data-precision]::before {
  inset: .3rem .12rem auto; font-size: .68rem; white-space: nowrap;
}
.slow-controls .pose-pad button[data-boost-aim] .trick-art { visibility: hidden; }
.slow-controls .pose-pad button[data-boost-swipe]:not([data-award])::after {
  content: attr(data-boost-swipe); position: absolute; inset: .15rem .15rem auto auto;
  width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--gold); color: #231a0e;
  font: 850 .95rem/1.1rem system-ui,sans-serif; text-align: center; text-shadow: none;
}
.slow-controls .air {
  inset: auto auto 69% 50%;
  transform: translateX(-50%);
  width: min(28rem, 90%);
  text-align: center;
}
.slow-controls .air > div, .slow-controls .boost-readout { justify-content: center; }
.boost-flight .air {
  padding: .55rem .9rem .65rem;
  width: min(20rem, 85%); border-radius: .6rem;
  background: linear-gradient(115deg,#12201ded,#1b272be3);
  box-shadow: 0 4px 14px #0a141237; text-shadow: none;
}
.slow-controls .boost-readout { font-weight: 650; letter-spacing: .045em; }
.slow-controls #air-title { font-size: clamp(1.3rem, 2.3vw, 2rem); }
.slow-controls #air-detail { font-size: clamp(.94rem, 1.2vw, 1.1rem); }
.slow-controls .air-clock { margin-inline: auto; max-width: 18rem; }
@media (orientation:portrait) {
  .slow-controls :is(.rotation-pad,.pose-pad) { width: 49%; }
  .slow-controls .riding-controls button { min-height: clamp(3.5rem, 7.5vh, 4.25rem); }
  .slow-controls .riding-controls :is([data-move=onehand],[data-move=euroonefoot]) { font-size: clamp(.85rem,3.8vw,1rem); }
  .slow-controls .air { bottom: 73%; }
}
@media (orientation:portrait) and (max-width:600px) {
  .game[data-mode=ride]:has(#camera-tools[open]) .air[data-prompt=late-move] {
    top: calc(max(.55rem,env(safe-area-inset-top)) + 44px + .55rem + var(--lens-tray-height, 0px));
    bottom: auto;
  }
}
@media (orientation:portrait) and (max-width:355px), (orientation:landscape) and (max-height:470px) and (max-width:640px) {
  .slow-controls .riding-controls .move-name { font: 700 14px/1 Arial,sans-serif; letter-spacing: -.03em; }
  .slow-controls [data-move=onehand] .move-name { display: block; white-space: normal; }
}
@media (orientation:landscape) and (max-height:470px) {
  .game.slow-controls { --pose-width: clamp(10rem,24vw,12rem); }
  .slow-controls :is(.rotation-pad,.pose-pad) { width: var(--pose-width); }
  .slow-controls .riding-controls button { min-height: 3.4rem; }
  .slow-controls .air { top: auto; bottom: .3rem; width: 48%; }
  .slow-controls .boost-readout { display: none; }
  .slow-controls #air-detail { margin: .12rem 0; }
  .boost-flight .air { padding: .2rem .55rem .32rem; width: min(38%,18rem); }
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:470px) {
  .game[data-mode=ride] .air {
    left: calc(max(var(--gutter),env(safe-area-inset-left)) + var(--pad-width) + .4rem);
    right: calc(max(var(--gutter),env(safe-area-inset-right)) + var(--pose-width) + .4rem);
    width: auto; max-width: 18rem; margin-inline: auto; transform: none;
  }
  .game[data-mode=ride] .boost-flight .air {
    inset: calc(max(.55rem,env(safe-area-inset-top)) + 3.5rem) auto auto max(var(--gutter),env(safe-area-inset-left));
    width: min(28%,14rem);
    margin: 0;
  }
  .game.slow-controls #boost-timing { width: var(--pose-width); }
  .boost-flight .air { padding: .3rem .45rem; }
  .boost-flight #air-title { font-size: clamp(1rem, 2.4vw, 1.2rem); }
  .boost-flight #air-detail { margin: .14rem 0 0; font-size: .8rem; line-height: 1.16; text-wrap: balance; }
  .boost-flight #air-points { font-size: .84rem; }
}
.trick-art {
  pointer-events: none; margin: auto;
  background: var(--trick-sheet,url('./manobras.webp')) 50% var(--pose-row,0%) / 900% var(--sheet-height,1000%) no-repeat;
  filter: drop-shadow(0 1px 1px #eef4da88);
}
.slow-controls .trick-art { display: block; width: 3.75rem; height: 2.5rem; }
@media (pointer:coarse) and (orientation:portrait) {
  .game[data-mode=ride]:not(.slow-controls) .pose-pad { width: min(49%, 13rem); }
}
@media (pointer:coarse) {
  .game[data-mode=ride]:not(.slow-controls) .pose-pad button {
    min-height: 52px; border-radius: .7rem; padding: .16rem;
    font: 700 .79rem/1.05 system-ui,sans-serif; letter-spacing: -.02em; white-space: normal;
  }
  .game[data-mode=ride]:not(.slow-controls) .pose-pad .trick-art { display: block; width: 2.25rem; height: 1.5rem; }
}
.game[data-rider]:not([data-rider=tiao-bringo],[data-rider=johny-nestle]) .trick-art { filter: brightness(0) invert(var(--pose-ink, .86)); }
.pose-pad button:is(.boost-choice,.catch-ready,.catch-save) { --pose-ink: .14; }
.game[data-rider=johny-nestle] { --trick-sheet: url('./manobras-johny.webp'); }
[data-move=right360] { --pose-row: 11.111%; }
[data-move=frontflip] { --pose-row: 22.222%; }
[data-move=backflip] { --pose-row: 33.333%; }
[data-move=cashroll] { --pose-row: 44.444%; }
[data-move=whip] .trick-art:empty { background: none; align-content: center; }
[data-move=whip] .trick-art:empty::before { content: 'Segure'; font: 750 .68rem/1 system-ui,sans-serif; }
[data-move=whip].thumb-down .trick-art:empty::before { content: 'Solte'; }
[data-move=xup] { --pose-row: 55.556%; }
[data-move=tabletop] { --pose-row: 66.667%; }
[data-move=nofooter] { --pose-row: 77.778%; }
[data-move=onehand] { --pose-row: 88.889%; }
[data-move=euroonefoot] { --pose-row: 100%; }
[data-move=superman] { --trick-sheet: url('./superman.webp'); --sheet-height: 200%; --pose-row: 0%; }
.game[data-rider=johny-nestle] [data-move=superman] { --pose-row: 100%; }
[data-move=barspin], [data-move=tailwhip], [data-move=rocksolid], [data-move=toboggan], [data-move=tucknohander] { --trick-sheet: none; }
.pose-pad :is([data-move=barspin], [data-move=rocksolid], [data-move=toboggan], [data-move=tucknohander]) .trick-art:empty { display: none; }
[data-move=tailwhip] .trick-art:empty::before { content: '↻'; font: 800 1.35rem/1 system-ui,sans-serif; }
[data-move=nacnac] { --trick-sheet: url('./nacnac.webp'); --sheet-height: 200%; --pose-row: 0%; }
.game[data-rider=johny-nestle] [data-move=nacnac] { --pose-row: 100%; }
[data-move=supermanseatgrab] { --trick-sheet: url('./superman-seat-grab.webp'); --sheet-height: 200%; --pose-row: 0%; }
.game[data-rider=johny-nestle] [data-move=supermanseatgrab] { --pose-row: 100%; }
.riding-controls [data-move=euroonefoot] .move-name { display: inline-block; max-width: 100%; white-space: normal; line-height: 1.12; }
@media (pointer:fine) and (min-width:661px) {
  .riding-controls .pose-pad [data-move] { white-space: normal; }
  .riding-controls [data-move=euroonefoot] kbd { display: inline-block; margin-inline: .15rem; }
  .slow-controls [data-move=euroonefoot] kbd { margin: 0; }
}
.slow-controls .riding-controls kbd { position: absolute; top: .25rem; right: .25rem; font-size: .66rem; }
.slow-controls .pose-pad button[data-boost-hit]:not([data-award],[data-boost-aim])::before {
  content: attr(data-boost-hit); position: absolute; left: .15rem; top: .15rem; padding: .1rem .22rem;
  border-radius: .2rem; background: #193224; color: var(--mint); font: 750 .63rem/1 system-ui,sans-serif;
}
.slow-controls .riding-controls button[data-award], .game .riding-controls .pose-pad button[data-catch-award] {
  border-color: var(--mint); background: #214432; color: #efffe2;
}
.slow-controls .pose-pad button[data-award] .trick-art {
  display: grid; place-items: center; width: auto;
  background: none; filter: none; color: var(--mint);
  font: italic 900 1.4rem/1 var(--heading); text-shadow: none;
}
.slow-controls .pose-pad button[data-boost-offer] .trick-art {
  display: grid; place-items: center; width: auto;
  background: none; filter: none; color: inherit;
  font: 900 .92rem/1 system-ui,sans-serif; text-shadow: none;
}
@media (pointer:coarse) {
  .slow-controls .pose-pad button[data-boost-hit][data-boost-offer] .trick-art {
    width: 100%; justify-items: end; padding-right: .27rem;
  }
}
.pose-pad button[data-catch-award]::after {
  content: attr(data-catch-award); position: absolute; inset: 2px auto auto 5px; height: auto;
  border-radius: .25rem; padding: .12rem .22rem; background: var(--mint); color: #102318;
  font: 850 .7rem/1 system-ui,sans-serif; text-shadow: none;
}
@media (prefers-reduced-motion:no-preference) {
  .stage.echo-burst::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: repeating-conic-gradient(from 9deg at 50% 48%, transparent 0deg 15deg, #e6fdff99 15.2deg 15.48deg, transparent 15.8deg 33deg);
    -webkit-backdrop-filter: blur(2.5px); backdrop-filter: blur(2.5px);
    mask-image: radial-gradient(ellipse at 50% 48%, transparent 44%, #000 95%);
    animation: echo-shutter .25s ease-out both;
  }
  #trick-credits span { animation: bank-points .95s ease-out both; }
  .notice b, #credit-boost, #air-combo { animation: score-land .28s ease-out both; }
  .slow-controls button:is(.thumb-down,.charging,[data-active=true]) .trick-art {
    animation: trick-demo .72s steps(8,end) 1;
  }
  .slow-controls button.boost-choice, #fire-plan[data-release] { animation: beat-light .63s ease-out 2; }
  .slow-controls .pose-pad button[data-award] .trick-art, .pose-pad button[data-catch-award]::after { animation: catch-score .24s ease-out; }
}
@keyframes echo-shutter { 0% { opacity: 0; } 18% { opacity: .9; } 100% { opacity: 0; } }
@keyframes bank-points {
  0% { opacity: 0; transform: translateX(-12px); }
  15%,78% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(var(--credit-exit-y,-6px)); }
}
@keyframes trick-demo { from { background-position-x: 0%; } to { background-position-x: 100%; } }
@keyframes beat-light { from { box-shadow: 0 0 0 0 #ffcf73ab; } to { box-shadow: 0 0 0 6px #ffcf7300; } }
@keyframes catch-score { from { transform: scale(1.12); } to { transform: none; } }
@media (max-height:470px) {
  .slow-controls .trick-art { width: 2.6rem; height: 1.73rem; }
}

@media (orientation:portrait) and (max-height:700px) {
  .slow-controls .air:has(#air-combo:not([hidden])) {
    top:calc(max(.55rem,env(safe-area-inset-top)) + 44px + .35rem); bottom:auto;
  }
  .boost-flight .air {
    top:max(calc(max(.55rem,env(safe-area-inset-top)) + 44px + .35rem), calc(27% - 4.25rem));
    bottom:auto; width:min(20rem,calc(100% - 2 * var(--gutter))); padding:.35rem .55rem .4rem;
  }
  .boost-flight #air-title { font-size:clamp(1.05rem,5.2vw,1.3rem); }
  .boost-flight #air-points { font-size:.85rem; }
  .boost-flight #air-detail { font-size:.86rem; margin:.15rem 0 0; }
  .slow-controls .trick-art { width: 2.7rem; height: 1.8rem; }
  .slow-controls .riding-controls button { min-height: 3rem; }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) .pose-pad {
    grid-auto-rows: 44px; row-gap: 3px;
  }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) .pose-pad button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 .125rem; font: 700 14px/1 Arial,sans-serif;
  }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) .pose-pad .trick-art { margin: 0; width: 1.5rem; height: 1rem; }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) .pose-pad button[data-boost-offer] .trick-art { width: 100%; font-size: .8rem; }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) .pose-pad :is([data-move=euroonefoot],[data-move=onehand]) .move-name {
    font: 700 13px/1 Arial,sans-serif; white-space: normal;
  }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) .pose-pad button[data-boost-hit]:not([data-award],[data-boost-offer]) .trick-art { visibility: hidden; }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) .pose-pad button[data-award] .trick-art {
    width: auto; font-size: 1rem;
  }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) #boost-timing {
    height: 1.125rem; bottom: calc(100% + 2px);
  }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) #boost-timing span { padding-bottom: .1rem; }
  .slow-controls:has(#left-thumb > #fire-plan[data-boost]) #boost-timing small { padding-bottom: .35rem; }
}

@media (pointer:fine), (orientation:landscape) and (min-height:471px) {
  .game[data-mode=ride] .boost-flight .air {
    inset: calc(max(.55rem, env(safe-area-inset-top)) + 3.5rem) auto auto var(--gutter);
    width: fit-content;
    max-width: min(23vw, 17rem);
    padding: .32rem .55rem;
    transform: none;
    text-align: left;
  }
  .boost-flight .air > div { justify-content: flex-start; }
  .boost-flight #air-title { font-size: 1.1rem; }
}

@media (pointer:coarse) and (orientation:portrait) {
  .game[data-mode=ride] .boost-flight .air {
    inset: calc(max(.55rem,env(safe-area-inset-top)) + 3.15rem) auto auto max(var(--gutter),env(safe-area-inset-left));
    width: min(40%,10rem);
    margin: 0; padding: .28rem .42rem;
    transform: none;
  }
  .boost-flight .boost-readout { display: none; }
  .boost-flight #air-title { font-size: 1rem; }
  .boost-flight #air-detail { font-size: .8rem; line-height: 1.15; }
}

@media (pointer: coarse) and (max-width: 900px) {
  .game[data-mode=ride]:has(#slow[aria-pressed=true]) #stage:not(.boost-flight):has(#air-meter:not([hidden])) {
    .air {
      inset: calc(max(.55rem,env(safe-area-inset-top)) + 3.15rem) auto auto max(var(--gutter),env(safe-area-inset-left));
      width: min(54%,12.6rem); margin: 0; transform: none;
    }
    #air-title { font-size: 1rem; }
    #air-detail { font-size: .8rem; line-height: 1.15; }
    .air-clock { width: min(100%,6.25rem); margin-inline: 0; }
    > #trick-credits {
      inset: calc(max(.55rem,env(safe-area-inset-top)) + 6rem) max(var(--gutter),env(safe-area-inset-right)) auto auto;
      justify-items: end;
      span { padding: .16rem .4rem; font-size: .8rem; max-width: 40vw; white-space: normal; text-align: right; }
    }
  }
}
/* Phone portrait: keep score labels and the repeat hint off the rider. */
@media (pointer: coarse) and (max-width: 900px) and (orientation: portrait) {
  #stage > #trick-credits { top: calc(max(.55rem,env(safe-area-inset-top)) + 9.3rem); }
  #turn-repeat {
    left: max(var(--gutter),env(safe-area-inset-left)); top: auto; bottom: 11.7rem; translate: none;
  }
}

#silveira-fork { position:absolute; top:calc(max(.55rem,env(safe-area-inset-top)) + 48px); left:var(--gutter); display:flex; gap:.25rem; padding:.2rem; background:var(--glass); border-radius:.55rem; white-space:nowrap; }
#silveira-fork button { min-height:44px; }
#silveira-fork button[aria-pressed=true] { background:var(--mint); color:#16221a; }
#silveira-map a { color: var(--mint); }

/* The circuit sits on top of the live course camera. */
.game[data-mode=ready] { --tour-accent: #d8ff45; }
.game[data-mode=ready] .stage::after {
  background: linear-gradient(0deg,#080e11 0%,#080e11d9 15%,transparent 66%),
              linear-gradient(90deg,#081014a8,transparent 65%),linear-gradient(#07101580,transparent 20%);
}
.game[data-mode=ready] .top { align-items: flex-start; }
.game[data-mode=ready] .brand { align-self:center; font-size:clamp(1.8rem,4vw,3.5rem); -webkit-text-stroke:1px #102019; paint-order:stroke fill; text-shadow:2px 3px #111918; }
.game[data-mode=ready] .brand span { color:var(--tour-accent); }
#rider-picker legend { display:none; }
#rider-picker summary { border-radius:2px; background:#10191ee8; border-color:#84918c; }
#rider-picker summary .rider-info { text-align:left; }
#rider-picker summary .rider-info>span { font-style:italic; font-weight:900; }
#rider-options { background:#10191efa; border-radius:2px; box-shadow:0 12px 36px #0008; }
.game .intro { width:auto; right:var(--gutter); display:grid; grid-template-columns:minmax(0,1fr) minmax(16.5rem,24rem);
  grid-template-areas:"briefing console" "missions console"; align-items:end; gap:0 clamp(.8rem,3vw,3rem); max-height:calc(100% - 4.75rem); bottom:max(1.3rem,env(safe-area-inset-bottom)); }
.launch-console { grid-area:console; padding:.9rem 1rem .65rem; border-top:3px solid var(--tour-accent); background:linear-gradient(125deg,#18201ef7,#0a1013f5); box-shadow:0 .25rem 1.5rem #05090b50; }
.tour-career { display:grid; gap:.43rem; margin-bottom:.68rem; }
#start-next-upgrade { color:var(--gold); font:italic 850 .97rem/1.1 var(--heading); }
#start-career-goal { font:650 .81rem/1.25 system-ui,sans-serif; color:#f4f3e8; }
#start-hunt-trick { padding:.3rem .5rem; background:#21362d; border-color:#a8c99f; color:#f2ffdf; font:750 .81rem/1.25 system-ui,sans-serif; text-align:left; }
#start-career-xp { width:100%; height:4px; }
.launch-console .launch-row { display:grid; grid-template-columns:minmax(0,1.45fr) repeat(3,minmax(0,1fr)); align-items:stretch; gap:.28rem; }
.launch-console #start { display:flex; align-items:center; justify-content:center; gap:.32rem; min-width:0; padding-inline:.35rem; }
.launch-console :is(#open-combos,#open-phases,#workshop-open) { padding:.35rem; border:1px solid #a0a9986b; border-radius:2px; background:#25312b; color:#faf9f0; font:italic 900 1rem/1 var(--heading); text-transform:uppercase; }
.launch-console #workshop-open span { display:none; }
.launch-console .lap-launch { font:600 .75rem/1.2 system-ui,sans-serif; color:#d3dacd; }
.launch-console .lap-launch label { min-height:36px; }
.launch-console #lap-arm { appearance:none; width:.88rem; height:.88rem; border:1px solid #b9c4b9; border-radius:50%; margin:0 .15rem 0 0; }
.launch-console #lap-arm:checked { background:#ff715f; border-color:#ff715f; box-shadow:inset 0 0 0 2px #18211d; }
.launch-console #lap-launch-format { max-width:100%; }
.briefing { grid-area:briefing; min-width:0; }
#start-studio { color:var(--gold); text-underline-offset:.22em; padding:.6rem .35rem; margin-block:-.6rem; }
.stage-goals { grid-area:missions; }
.tour-heading,.tour-bar { font:800 .7rem/1.35 var(--heading); text-transform:uppercase; letter-spacing:.12em; }
.tour-heading { display:flex; align-items:center; gap:.6rem; color:white; margin:0 0 .55rem; }
#phase-number { background:var(--tour-accent); color:#151b0d; padding:.31rem .6rem; transform:skewX(-7deg); }
.game .intro h1 { font:italic 950 clamp(3rem,7.6vw,7.6rem)/.95 var(--heading); letter-spacing:-.065em; text-transform:uppercase; -webkit-text-stroke:2px #17221b; paint-order:stroke fill; text-shadow:2px 4px 0 #142019,0 4px 18px #0008; }
#whistler-lines,#silveira-lines { display:inline-flex; align-items:center; gap:2px; margin:.4rem 0 0; padding:0; border-radius:0; background:none; }
:is(#whistler-lines,#silveira-lines) a { display:grid; place-items:center; min-height:44px; padding:0 .85rem; color:#fff;
  font:750 .83rem var(--heading); text-decoration:none; background:#10181bbd; border-radius:0; border-bottom:2px solid #ffffff4d; }
:is(#whistler-lines,#silveira-lines) a[aria-current] { background:#1b261de0; color:var(--tour-accent); border-bottom-color:currentColor; }
#whistler-lines a { align-content:center; gap:.12rem; padding-inline:.65rem; }
#whistler-lines small { color:#c6d2cd; font:700 .68rem/1.2 system-ui,sans-serif; white-space:nowrap; }
#start-line { max-width:42rem; font-size:.86rem; margin:.62rem 0 .75rem; line-height:1.35; }
.launch-row { display:flex; align-items:center; gap:.55rem; }
#start,#setup > summary,.next-run > button:first-child { text-transform:uppercase; font:italic 900 1.03rem var(--heading); border-radius:2px; }
#start,.next-run > button:first-child { background:#d8ff45; border-color:#d8ff45; color:#16200a; box-shadow:none; }
#start { min-width:10rem; }
#setup { margin:0; }
#setup > summary { list-style:none; padding:.65rem 1rem; border:1px solid #89938b; background:#141d21ed; text-shadow:none; min-height:46px; }
#setup > summary::-webkit-details-marker {display:none;}
#setup > summary::before { content:'+'; margin-right:.5rem; color:var(--tour-accent); }
#setup[open] > summary::before { content:'×'; }
#setup[open] { position:fixed; z-index:4; left:var(--gutter); bottom:max(1rem,env(safe-area-inset-bottom)); width:min(30rem,calc(100% - 2 * var(--gutter))); max-height:calc(100dvh - 5rem); padding:.5rem .85rem; background:#111c20fa; border:1px solid #58615b; }
.game:has(#loadout[open]) #setup[open] { bottom:9.3rem; max-height:calc(100dvh - 13.2rem); }
.intro:has(#setup[open]) :is(#phase-map,.tour-heading,h1,#start-line,#whistler-lines,#silveira-lines,#start) {visibility:hidden;}
#phase-picker, #ranking-dialog, #combo-picker {
  width:min(53rem,calc(100% - 2 * var(--gutter))); max-height:calc(100dvh - 2 * var(--gutter));
  padding:clamp(.8rem,2.5vw,1.5rem); border:1px solid #6c786e; border-top:4px solid #d8ff45;
  color:#fff9e8; background:#101a1bf7; box-shadow:0 1rem 4rem #05090a99; overscroll-behavior:contain;
}
#phase-picker::backdrop, #ranking-dialog::backdrop, #combo-picker::backdrop { background:#071012c9; }
#combo-picker { width:min(31rem,calc(100% - 2 * var(--gutter))); }
#combo-picker fieldset { position:relative; padding:0; margin:0 0 .9rem; min-width:0; border:0; }
#combo-picker fieldset:has(#combo-other-turn) { margin-top:1.2rem; }
#combo-picker fieldset:has(#combo-other-turn) legend { margin-bottom:1.1rem; }
#combo-other-turn { appearance:menulist-button; height:44px; position:absolute; right:0; bottom:calc(100% + .16rem); max-width:61%; padding:0 .3rem; border:0; background:#1c2823; color:#d4dfce; font:700 .85rem system-ui,sans-serif; }
#combo-picker legend { margin-bottom:.35rem; padding:0; font-weight:750; color:#d4dfce; }
.combo-turns,.combo-poses,.combo-actions { display:grid; gap:.3rem; }
.combo-turns { grid-template-columns:repeat(4,minmax(0,1fr)); }
.combo-poses { grid-template-columns:repeat(2,minmax(0,1fr)) minmax(0,1.7fr); }
#combo-picker :is(button,select),#workshop-combos { min-height:44px; }
#combo-picker :is(.combo-turns,.combo-poses,.combo-actions) > * { min-width:0; padding:.35rem; border-radius:3px; font:750 .88rem/1.2 system-ui,sans-serif; }
#combo-picker :is([aria-pressed=true],select:has(option:checked:not([value=""]))) { color:#f2ffcb; border-color:#c3e973; background:#35492b; }
#combo-access { margin:.35rem 0 .8rem; color:#c6d4c8; font-size:.85rem; line-height:1.4; }
.combo-actions { grid-template-columns:1.45fr 1fr; }
#combo-train { background:#d8ff45; color:#17230d; border-color:#d8ff45; }
#combo-ride:disabled { opacity:.48; }
#workshop-combos { margin-bottom:.65rem; }
@media (max-width:760px) {
  .launch-console #start kbd { display:none; }
  .launch-console :is(#open-combos,#open-phases,#workshop-open) { padding-inline:.1rem; font-size:.9rem; }
}
@media (max-height:420px) {
  #combo-picker { padding-block:.5rem; }
  #combo-picker fieldset { margin-bottom:.45rem; }
  #combo-picker .tour-bar { margin-bottom:.2rem; }
}
#ranking-dialog { width:min(30rem,calc(100% - 2 * var(--gutter))); --tour-accent:#d8ff45; }
#ranking-dialog button { min-height:44px; }
#ranking-entry { display:grid; gap:.35rem; padding:.65rem; background:#223126; }
#ranking-entry strong { color:var(--tour-accent); }
#ranking-entry label { font-size:.82rem; }
#ranking-entry > div { display:flex; gap:.4rem; }
#ranking-nickname { flex:1; min-width:0; padding:.35rem .5rem; font:inherit; color:inherit; background:#111c20; border:1px solid #87918a; }
#ranking-submit { background:var(--tour-accent); color:#151e10; border-color:transparent; }
#ranking-challenge { width:100%; margin:0 0 .3rem; background:var(--tour-accent); color:#151e10; border-color:transparent; }
#ranking-goal-result { margin:.25rem 0; color:var(--gold); font-weight:800; }
#ranking-goal-result[data-won] { color:var(--mint); }
#ranking-status { margin:.65rem 0; font-size:.85rem; }
#ranking-status:empty { display:none; }
#ranking-rows { margin:0; padding-left:2rem; }
#ranking-rows li { padding:.6rem .4rem; border-bottom:1px solid #ffffff28; }
#ranking-rows li::marker { color:var(--tour-accent); font-weight:800; }
#ranking-rows li[data-own] { background:#293b24; }
#ranking-rows li > :is(div, button) { display:flex; align-items:baseline; justify-content:space-between; gap:.5rem; }
#ranking-rows li:has(> button) { padding:0; }
#ranking-rows li > button { width:100%; padding:.35rem .4rem; border:0; border-radius:0; background:transparent; text-align:left; font:inherit; }
#ranking-rows li > button:is(:hover,:focus-visible) { background:#314536; }
#ranking-rows li > button small { display:block; margin-top:.15rem; color:var(--tour-accent); font-size:.72rem; }
#ranking-rows li span { overflow-wrap:anywhere; }
#ranking-rows li strong { flex:none; white-space:nowrap; font-variant-numeric:tabular-nums; }
.tour-bar { display:flex; justify-content:space-between; align-items:center; gap:.6rem; margin-bottom:.85rem; }
.tour-bar h2 { margin:0 0 .28rem; font:italic 950 clamp(1.8rem,4vw,3.15rem)/1 var(--heading); letter-spacing:-.045em; }
.tour-bar span { color:#d8ff45; font:750 .72rem/1.1 system-ui,sans-serif; letter-spacing:.035em; }
.tour-bar button { padding:.5rem .85rem; background:transparent; border:1px solid #87918a; border-radius:2px; color:#fff9e8; font:700 .8rem system-ui,sans-serif; }
.phase-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(.35rem,1vw,.75rem); }
.phase-tiles a { position:relative; isolation:isolate; min-width:0; display:flex; flex-direction:column; justify-content:flex-end;
  height:clamp(7.2rem,20vh,11.5rem); padding:.65rem .85rem; overflow:hidden; color:white;
  background:#182720; border:2px solid #79877985; text-decoration:none; }
.phase-tiles .phase-meta {
  display:block; margin-top:.18rem; font:750 .68rem/1.2 system-ui,sans-serif; color:#d8ff45;
  text-shadow:0 1px 4px #000c; overflow-wrap:anywhere;
}
.phase-tiles a img,.phase-tiles a::before { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; }
.phase-tiles a::before { content:''; z-index:-1; background:linear-gradient(0deg,#091010ed 0, #09101084 40%,#08121416 76%); }
.phase-tiles a small { position:absolute; left:.62rem; top:.48rem; padding:.1rem .25rem; color:#f3f4e9; background:#101a1ac7; font:850 .75rem/1.1 ui-monospace,monospace; }
.phase-tiles a b { font:italic 950 clamp(1.25rem,3.5vw,2.5rem)/1 var(--heading); letter-spacing:-.035em; text-transform:uppercase; text-shadow:1px 2px #121917; }
.phase-tiles a[aria-current] { border-color:#d8ff45; box-shadow:inset .25rem 0 #d8ff45; }
.phase-tiles a[aria-current] small { background:#d8ff45; color:#101915; }
.phase-tiles .seal { position:absolute; top:.45rem; right:.36rem; background:#111916e8; padding:.17rem .28rem; color:#f8f6e6; font:750 .65rem/1.15 system-ui,sans-serif; }
.phase-tiles .seal[data-earned=true] { color:#d8ff45; }
.phase-record { margin-top:.2rem; font:700 .72rem/1.2 system-ui,sans-serif; color:#f8f6e6; white-space:pre-line; }
.phase-tiles a:focus-visible { outline:2px solid white; outline-offset:2px; }
@media (prefers-reduced-motion:no-preference) {
  #phase-picker[open] { animation:tour-arrival .18s ease-out; }
  .phase-tiles img {transition:transform .24s ease-out;}
  .phase-tiles a:is(:hover,:focus-visible) img {transform:scale(1.06);}
  .briefing h1 {animation:tour-arrival .28s ease-out;}
  @keyframes tour-arrival {from {opacity:0;transform:translateX(-12px)} to {opacity:1;transform:none}}
}
.result { background:linear-gradient(120deg,#122027fa,#0c1518f5);border-radius:1px; }
#finish-phase { color:#d8ff45; }
@media(max-width:700px) and (orientation:portrait) {
  .game .intro { top:calc(max(.55rem,env(safe-area-inset-top)) + 3.7rem); bottom:max(.65rem,env(safe-area-inset-bottom)); max-height:none;
    grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr) auto auto; grid-template-areas:"briefing" "." "missions" "console";
    align-items:start; gap:.35rem; pointer-events:none; }
  .intro > * { pointer-events:auto; }
  .intro .stage-goals { margin:0 0 .2rem; }
  .game .intro h1 { font-size:clamp(2.45rem,12.8vw,4rem); }
  .launch-console { padding:.55rem .6rem .12rem; }
  .launch-console .lap-launch { margin-top:0; }
  .tour-career { margin-bottom:.5rem; }
  #rider-options { max-height:calc(100dvh - 4rem); }
  .phase-tiles a { height:clamp(6.9rem,18vh,11rem); padding:.5rem; }
}
@media(max-height:470px) and (orientation:landscape) {
  .game .intro { grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:.55rem; bottom:max(.55rem,env(safe-area-inset-bottom)); }
  .game .intro h1 { font-size:clamp(2.2rem,6vw,3.7rem); }
  .launch-console { padding:.48rem .5rem .12rem; }
  .tour-bar { margin-bottom:.5rem; }
  .phase-tiles a { height:clamp(4.25rem,24vh,7rem); }
  #start-line { margin:.2rem 0 .4rem; }
}
.stage-goals { margin:.55rem 0 .85rem; padding-left:.65rem; border-left:2px solid #c6d1b2; }
#pass-goal { margin:0; font:750 .91rem/1.3 system-ui,sans-serif; color:white; text-shadow:var(--shadow); }
.stage-goals #start-line { margin:.2rem 0 0; color:#e1e9d3; font-size:.79rem; }
#style-mission { display:grid; grid-template-columns:1fr auto auto; gap:.12rem .65rem; align-items:center;
  margin:.3rem 0 0; min-height:44px; padding:.3rem .65rem; text-align:left; border:1px solid #839269;
  border-left:3px solid var(--tour-accent); border-radius:.2rem; background:#182017eb; color:#f6f6eb; }
#style-mission:hover, #style-mission:focus-visible { background:#30432b; border-color:var(--tour-accent); }
:is(#pair-goal,#start-pumps) {
  display:block; margin:.2rem 0 0; min-height:44px; padding:.3rem .6rem; text-align:left;
  border:1px solid #829087; border-radius:.2rem; background:#14221fee; color:#f5f7ef;
  font:750 .8rem/1.2 system-ui,sans-serif;
}
:is(#pair-goal,#start-pumps):not(:disabled):is(:hover,:focus-visible) { border-color:var(--tour-accent); }
#pair-goal:disabled { min-height:0; color:var(--tour-accent); border-color:transparent; opacity:1; }
#mission-label { text-transform:uppercase; font:800 .76rem var(--heading); letter-spacing:.06em; }
#mission-prize { font-size:.74rem; font-weight:800; color:var(--tour-accent); }
#mission-combo { grid-column:1/3; font-size:.8rem; }
.mission-play { grid-column:3; grid-row:1/3; color:var(--tour-accent); }
.intro:has(#setup[open]) .stage-goals { visibility:hidden; }
#setup .control-guide > summary { padding:.65rem .1rem; min-height:44px; }
@media(max-height:470px) { .stage-goals {margin:.25rem 0;} }

.game:has(#garage[open]) .intro { display:none; }
.game:has(#garage[open]) #world { cursor:grab; }
.game:has(#garage[open]) #world:active { cursor:grabbing; }
.garage-deck { position:fixed; bottom:max(.75rem,env(safe-area-inset-bottom)); left:var(--gutter); right:var(--gutter); margin:auto;
  width:min(48rem,calc(100% - 2 * var(--gutter))); background:linear-gradient(125deg,#101a1df5,#0a1015fa);
  padding:clamp(.65rem,1.7vw,1.25rem); border-top:2px solid var(--tour-accent); box-shadow:0 8px 20px #0004; }
.garage-heading { display:flex;justify-content:space-between;color:var(--tour-accent);font:800 .72rem/1.4 system-ui,sans-serif;letter-spacing:.12em;text-transform:uppercase; }
#garage-name { margin:.2rem 0 0;font:italic 900 clamp(1.65rem,4vw,3rem)/1 var(--heading);letter-spacing:-.035em;text-transform:uppercase; }
#garage-bike { margin:.2rem 0 .55rem;color:#d4dfdd;font-size:.88rem; }
.garage-deck #rider-options { position:static; display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:.25rem;width:auto;max-height:none;
  padding:0;overflow:visible;background:transparent;box-shadow:none; }
.garage-deck #rider-options label { display:block;min-width:0;padding:0;background:#27302e;border-radius:2px;border-color:#59605e; }
.garage-deck #rider-options label:has(:checked) {border-color:var(--tour-accent);box-shadow:inset 0 -3px var(--tour-accent);background:#404938;}
.garage-deck #rider-options img {display:block;width:100%;height:clamp(2.9rem,7vh,4.4rem);object-fit:contain;}
.garage-deck #rider-options .rider-info {display:block;position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
.garage-actions {display:flex;gap:.45rem;margin-top:.55rem;}
.garage-actions button {border-radius:2px;font:italic 850 .95rem var(--heading);text-transform:uppercase;}
#garage-start {background:var(--tour-accent);color:#14200b;border-color:var(--tour-accent);min-width:8rem;}
@media(max-width:620px) {
  .garage-deck #rider-options {grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media(max-height:470px) and (orientation:landscape) {
  .garage-deck {left:auto;right:var(--gutter);width:43%;padding:.55rem;}
  .garage-deck #rider-options {grid-template-columns:repeat(4,minmax(0,1fr));}
}

#replay-best {
  display:flex;align-items:center;gap:.65rem;width:100%;margin:.65rem 0;
  padding:.6rem .7rem;text-align:left;border-radius:2px;background:#202d29;border-color:#72816c;
}
.highlight-play { color:#d8ff45;font-size:1.3rem; }
#replay-best small { display:block;color:#d8ff45;font:800 .65rem/1.4 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.1em; }
#best-tricks { display:block;font:italic 900 1.1rem/1.12 var(--heading); }
#best-jump-score { margin-left:auto;text-align:right;font-size:.78rem; }
@media (max-width:355px) {
  #replay-best { gap:.45rem; margin-block:.5rem; padding:.45rem .6rem; }
  #replay-best small { letter-spacing:.06em; }
  #best-jump-score { font-size:.73rem; }
}

.lap-launch,.lap-actions,.lap-transport,#lap-review header{display:flex;align-items:center;gap:.55rem}
.lap-launch{margin-top:.42rem;flex-wrap:wrap;font-size:.82rem}
.lap-launch label{display:flex;align-items:center;gap:.35rem;cursor:pointer}
.lap-launch input{accent-color:#d2ef8e}
#saved-laps{padding:.22rem .45rem}
#lap-review{box-sizing:border-box;position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;max-height:52dvh;overflow:auto;border:0;border-top:1px solid #64705e;border-radius:0;background:#182019;color:#f2f5ed;padding:.65rem max(.75rem,env(safe-area-inset-right)) max(.65rem,env(safe-area-inset-bottom)) max(.75rem,env(safe-area-inset-left))}
#game:has(#lap-review[open]) #stage{height:calc(100% - var(--lap-dock-height,11rem))}
@media(min-width:540px) and (min-aspect-ratio:4/3){
  #game{--lap-dock-width:clamp(16rem,29vw,24rem)}
  #game:has(#lap-review[open]) #stage{width:calc(100% - var(--lap-dock-width));height:100%}
  #lap-review{inset:0 0 0 auto;width:var(--lap-dock-width);height:100dvh;max-height:100dvh;border-top:0;border-left:1px solid #64705e}
}
#lap-review::backdrop{background:transparent}
#game:has(#lap-review[open]) #stage>:not(#world),#game:has(#lap-review[open])>:is(.top,.stage-top,#replay-controls){visibility:hidden}
#lap-review header{justify-content:space-between}
#lap-review h2{font-size:1.02rem;line-height:1.2;margin:0}
#lap-launch-format,#lap-review select{max-width:100%;background:#242e24;color:inherit;border:1px solid #75806b;padding:.36rem;border-radius:.35rem}
#lap-library{margin:.6rem 0}
#lap-library{border:0;padding:0;background:transparent}
#lap-library summary{font-size:.85rem;color:#cadab9;padding:.25rem 0}
#lap-library select{margin:.35rem 0;width:100%}
#lap-delete{font-size:.8rem}
#lap-review .lap-transport{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.3rem .65rem}
#lap-seek{width:100%;min-height:26px;margin:0}
#lap-clock{grid-column:2;text-align:right;line-height:1}

.lap-transport{margin:.7rem 0}
#lap-seek{min-width:2rem;flex:1;accent-color:#d2ef8e}
#lap-clock{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:.8rem}
.lap-actions{flex-wrap:wrap}
#lap-review button{min-height:2.2rem}
#lap-record,#lap-share{background:#d2ef8e;color:#172212}
#lap-review video{position:fixed;inset:0 auto auto 0;width:100vw;height:calc(100dvh - var(--lap-dock-height,11rem));object-fit:contain;background:#101610}
#lap-review.reviewing-file #lap-player{display:none}
#lap-export .lap-actions{margin-top:.65rem}
#lap-export .lap-actions button{min-height:44px;flex:1}
#lap-mode{margin-top:.5rem;width:100%;min-height:44px}
@media(min-width:540px) and (min-aspect-ratio:4/3){
  #lap-review video{width:calc(100vw - var(--lap-dock-width));height:100dvh}
}
#lap-status{font-size:.84rem;margin:.5rem 0 0}
#lap-status:empty{display:none}

.game[data-mode=ride] #lap-live-indicator{position:absolute;top:calc(100% + 1px);left:0;}
#lap-live-indicator{align-self:center;white-space:nowrap;background:#47181b;color:#fff0ee;border-radius:.35rem;padding:.25rem .45rem;font-size:.75rem}

#lap-player .lap-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem}
#lap-player .lap-actions>*{width:100%;min-width:0;min-height:44px;padding-inline:.4rem;font-size:.9rem}
#game:has(#lap-review[open]) #stage{background:#101610}
#game:has(#lap-review[open]) #stage::after{display:none}

#hop-button {
  touch-action: none; -webkit-user-select: none; user-select: none;
  display: grid; position: relative; align-content: center; gap: 2px; width: 100%; min-height: 52px; margin-bottom: 5px;
  padding: .25rem .6rem .6rem; border: 1px solid #afc4a6; border-radius: .7rem;
  background: linear-gradient(90deg, #435e43 calc(var(--hop-charge,0) * 100%), #14241ff2 0);
  color: #f5f8e9; text-align: left;
}
@media (pointer:coarse) and (orientation:portrait) {
  #hop-button { max-width: 6rem; padding-inline: .45rem; }
}
#hop-button[hidden] { display: none; }
#hop-button b { font: italic 850 .98rem/1 var(--heading); }
#hop-button small { font: 650 .66rem/1 system-ui, sans-serif; color: #d6e6ce; }
.hop-meter {
  position: absolute; left: .45rem; right: .45rem; bottom: 3px; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #718675 var(--hop-window,80%), #ffcc62 var(--hop-window,80%)); pointer-events: none;
}
#hop-button[data-prior-pop] .hop-meter::before {
  content: ''; position: absolute; left: clamp(3px,var(--hop-previous),calc(100% - 3px)); top: 50%;
  width: 6px; height: 6px; border: 1px solid #ffcf73; background: #18231f;
  transform: translate(-50%,-50%) rotate(45deg);
}
.hop-meter::after {
  content: ''; position: absolute; left: clamp(0px,var(--hop-timing,0%),calc(100% - 3px)); top: -2px;
  width: 3px; height: 8px; background: white; box-shadow: 0 0 0 1px #18231f; border-radius: 2px;
}
#hop-button:is([data-state=ready],[data-state=release],[data-state=armed],[data-turn-ready]) {
  background: #efc25a; color: #262213; border-color: #ffeabe;
}
#hop-button:is([data-state=ready],[data-state=release],[data-state=armed],[data-turn-ready]) small { color: #352e18; }
#hop-button[data-state=early] small { color: #ffcaa8; }
#hop-button[data-state=air]:not([data-turn-ready]) { background: #21463df0; border-color: #bcf4ca; }
#hop-button[data-state=air] .hop-meter { visibility: hidden; }

/* The start gate is painted by the document, before the 3D bundle arrives. */
#course-loading {
  --gate-accent: #f5c550;
  position: fixed; inset: 0; z-index: 20; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; color: #fffaf0;
  padding: max(1.15rem, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: #18211f; font-family: system-ui,sans-serif;
}
.load-photo {
  position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%;
  object-fit: cover; object-position: 40% 43%; filter: saturate(.86);
}
#course-loading::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(180deg,#0c1718bc 0%,transparent 22%,transparent 38%,#101918b8 75%,#101717 100%),
              linear-gradient(90deg,#1220227d,transparent 67%);
}
.load-header,.load-destination,.load-footer { width: min(100%, 91rem); margin-inline: auto; }
.load-header { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.load-brand { font: italic 1000 clamp(1.65rem,4.2vw,3rem)/1 var(--heading); letter-spacing: -.075em; }
.load-brand i { color: var(--gate-accent); }
#load-rider {
  display: flex; align-items: center; gap: .6rem; padding: .2rem .8rem .2rem .25rem;
  border-left: 3px solid var(--gate-accent); background: #101a1bee;
}
#load-portrait { width: 2.8rem; height: 2.8rem; object-fit: cover; }
#load-rider b,#load-rider small { display: block; }
#load-rider b { font: 800 .95rem/1.15 system-ui,sans-serif; }
#load-rider small { margin-top: .12rem; color: #d4d7c9; font-size: .72rem; }
.load-destination { margin-top: auto; padding: 2rem 0 clamp(1.25rem,4vh,2.7rem); }
#load-line {
  display: table; margin: 0 0 .7rem; padding: .28rem .55rem;
  color: #191d19; background: var(--gate-accent);
  font: 850 .78rem/1.2 system-ui,sans-serif; letter-spacing: .065em; text-transform: uppercase;
}
#load-venue { margin: 0; font: italic 950 clamp(3.8rem,9.5vw,9.5rem)/.94 var(--heading); letter-spacing: -.045em; text-transform: uppercase; text-wrap: balance; }
.load-footer { position: relative; padding-top: .65rem; }
.load-rail {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  height: .47rem; overflow: hidden; transform: skewX(-18deg);
}
.load-rail i { position: relative; overflow: hidden; background: #fff9df45; }
#course-loading[data-step=game] .load-rail i:first-child,
#course-loading[data-step=course] .load-rail i:nth-child(-n+2),
#course-loading[data-step=scene] .load-rail i { background: var(--gate-accent); }
#course-loading[data-step=game] .load-rail i:first-child::after,
#course-loading[data-step=course] .load-rail i:nth-child(2)::after,
#course-loading[data-step=scene] .load-rail i:last-child::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg,#3b301c7d 0 3px,transparent 3px 12px);
}
#load-status { margin: .7rem 0 0; font: 720 .92rem/1.25 system-ui,sans-serif; }
#course-loading #error { margin: .3rem 0 .7rem; max-width: 45rem; font: 500 .92rem/1.4 system-ui,sans-serif; }
#load-retry { min-height: 44px; padding: .5rem 1rem; background: var(--gate-accent); color: #191d19; border: 0; border-radius: 0; }
#load-retry span { margin-left: .5rem; }
#course-loading[data-step=error] .load-rail { display: none; }
@media (prefers-reduced-motion:no-preference) {
  #course-loading:not([hidden]) .load-photo { animation: load-pan 8s ease-out both; }
  #course-loading .load-rail i::after { animation: load-tread .8s linear infinite; }
  @keyframes load-pan { from { transform: scale(1.075); } to { transform: scale(1); } }
  @keyframes load-tread { to { background-position: 26.5px 0; } }
}
@media (max-width:600px) and (orientation:portrait) {
  #course-loading { padding-inline: max(1rem,env(safe-area-inset-left)) max(1rem,env(safe-area-inset-right)); }
  #load-rider { padding-right: .5rem; gap: .35rem; }
  #load-portrait { width: 2.25rem; height: 2.25rem; }
  #load-rider b { font-size: .8rem; }
  #load-venue { font-size: clamp(3.35rem,13vw,4.8rem); }
  .load-photo { object-position: 40% center; }
}
@media (max-height:450px) {
  #course-loading { padding-block: max(.65rem,env(safe-area-inset-top)) max(.65rem,env(safe-area-inset-bottom)); }
  .load-destination { padding-block: .5rem; }
  #load-venue { font-size: clamp(2.8rem,10vh,4rem); }
  #load-line { margin-bottom: .28rem; }
}

#game.whip-practice > :not(#stage,#whip-session), #game.whip-practice #stage > :not(canvas) { display:none !important; }
:is(#whip-session,#roller-session) { position:absolute; inset:0; z-index:10; pointer-events:none; color:white; }
:is(#whip-session,#roller-session) header, .whip-deck { display:flex; align-items:center; justify-content:space-between; gap:12px; }
:is(#whip-session,#roller-session) header { padding:max(14px,env(safe-area-inset-top)) 16px; background:linear-gradient(#101811bc,transparent); }
:is(#whip-session,#roller-session) header span { color:#daff58; }
:is(#whip-session,#roller-session) button { pointer-events:auto; min-height:44px; touch-action:none; user-select:none; }
.whip-deck { position:absolute; bottom:max(12px,env(safe-area-inset-bottom)); right:max(14px,env(safe-area-inset-right)); left:max(14px,env(safe-area-inset-left)); display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; }
.whip-readout { justify-self:start; padding:6px 10px; border-radius:8px; background:#111b16d9; }
.whip-deck b, .whip-deck small { display:block; }
.whip-deck small { margin-top:3px; color:#e0eadd; line-height:1.2; }
.whip-pads { display:flex; gap:8px; }
.whip-deck button { min-width:84px; min-height:58px !important; border:1px solid #e1f3c8; border-radius:15px; background:#243127e8; color:white; font-weight:800; }
.whip-deck button kbd { display:block; font-size:.68rem; }
.whip-deck button[aria-disabled=true] { opacity:.64; }
.whip-deck button[aria-pressed=true], #whip-go { background:#daff58; color:#142015; }
.whip-deck.release-cue button[aria-pressed=true], .whip-deck.release-cue .whip-readout { background:#ffd26a; color:#171d13; }
.whip-deck.release-cue small { color:inherit; }
.whip-deck[data-phase=gate] .whip-pads { display:none; }
@media (pointer:coarse), (max-width:600px) {
  .whip-deck { gap:7px; }
  .whip-deck button kbd { display:none; }
  .whip-deck small { font-size:.72rem; }
  .whip-pads { gap:5px; }
  .whip-deck button { min-width:72px; }
}
#game.whip-practice #world { pointer-events:none; }

#game.roller-practice > :not(#stage,#roller-session), #game.roller-practice #stage > :not(canvas) {display:none !important;}
#game.roller-practice #world {pointer-events:none;}
#roller-pad {width:clamp(96px,28vw,142px);touch-action:none;}
#roller-go {background:#daff58;color:#142015;}

#roller-pad[data-active=true] {background:#38483c;color:white;}
#roller-speed {font-variant-numeric:tabular-nums;}

/* Floating touch origins leave the lower corners as legends for the two hands. */
#game.split-gestures[data-mode=ride] {
  --turn-legend: clamp(8.5rem, 39vw, 10.75rem);
}
#game.split-gestures[data-mode=ride] #left-thumb {
  display: block; position: absolute; z-index: 2;
  left: max(var(--gutter), env(safe-area-inset-left)); bottom: max(.65rem, env(safe-area-inset-bottom));
  width: var(--turn-legend); pointer-events: none;
}
#game.split-gestures[data-mode=ride] :is(#left-thumb > button, #fire-plan) { pointer-events: auto; }
#game.split-gestures[data-mode=ride]:has(.rotation-pad [data-move=cashroll]) #left-thumb {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 4px;
}
#game.split-gestures[data-mode=ride] .riding-controls { justify-content: flex-end; }
#game.split-gestures[data-mode=ride] #riding-controls > #slow { left: 0; right: auto; }
#game.split-gestures[data-mode=ride] .rotation-pad { display: none; }
#game.split-gestures[data-mode=ride] :is(#free-pad, #free-pad *, .pose-pad, .pose-pad [data-slot], .pose-pad [data-slot] *) {
  pointer-events: none;
}
#game.split-gestures[data-mode=ride] #free-pad {
  --caption-height: .92rem;
  position: relative; width: 100%; max-width: none; height: auto; overflow: visible;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}
#game.split-gestures[data-mode=ride] #free-pad :is(.axis-cross, .pad-ink, #pad-vector) { display: none; }
#game.split-gestures[data-mode=ride] .pad-directions,
#game.split-gestures[data-mode=ride] .pose-pad {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto;
  gap: 3px; padding: 3px; border-radius: 8px; background: #0d1916bb;
}
#game.split-gestures[data-mode=ride] .pad-directions { position: static; }
#game.split-gestures[data-mode=ride] .pose-pad { width: min(51%, 14rem); }
@media (pointer:coarse) and (orientation:landscape) and (max-width:760px) and (max-height:470px) {
  #game.split-gestures[data-mode=ride]:not(.slow-controls) .pose-pad { width: 10rem; }
}
#game.split-gestures[data-mode=ride] .pad-directions button,
#game.split-gestures[data-mode=ride] .pose-pad button[data-slot] {
  position: relative; inset: auto; transform: none; width: auto; height: auto; min-height: 26px;
  display: flex; align-items: center; justify-content: flex-start; gap: 3px;
  border: 1px solid transparent; border-radius: 4px; padding: 2px 4px;
  font: 650 clamp(11px, 2.9vw, 13px)/1.12 system-ui, sans-serif; text-align: left; white-space: normal;
}
#game.split-gestures[data-mode=ride] .pad-directions button,
#game.split-gestures[data-mode=ride] .pose-pad [data-slot]:not(.thumb-down,.catch-ready,.catch-save,.boost-choice,.pose-transfer,[data-active=true],[data-award]) {
  color: #f8f8f2; background: #23322c99; box-shadow: none;
}
#game.split-gestures[data-mode=ride] .pad-directions i {
  width: auto; height: auto; background: transparent; color: var(--mint); font: 750 14px/1 system-ui, sans-serif;
}
#game.split-gestures[data-mode=ride] .pad-directions button { gap: 2px; padding-inline: 2px; }
#game.split-gestures[data-mode=ride] .pad-directions :is(.aiming,.turning,.correct) i { color: var(--gold); }
#game.split-gestures[data-mode=ride] .pad-directions [data-turn$="360"]::after { content: '360°'; }
#game.split-gestures[data-mode=ride] [data-turn=frontflip]::after { content: 'Frontflip'; }
#game.split-gestures[data-mode=ride] [data-turn=backflip]::after { content: 'Backflip'; }
#game.split-gestures[data-mode=ride] #pad-gesture { display: none; }
#game.split-gestures[data-mode=ride] #free-pad:is([data-spin],[data-turn-active],[data-stroke-ready],[data-pop=loading],[data-pop=ready],:has(.turn-rejected,.correct)) { padding-bottom: var(--caption-height); }
#game.split-gestures[data-mode=ride] #free-pad:is([data-turn-active],[data-stroke-ready],[data-pop=loading],[data-pop=ready],:has(.turn-rejected,.correct)) #pad-gesture { display: block; }
#game.split-gestures[data-mode=ride] .pose-pad :is(kbd, .trick-art:empty) { display: none; }
#game.split-gestures[data-mode=ride] .pose-pad .trick-art:not(:empty) { width: auto; height: auto; margin: 0; font-size: 12px; }
#game.split-gestures[data-mode=ride] .pose-pad .move-name { transform: none; white-space: normal; line-height: 1.12; }
#game.split-gestures[data-mode=ride] .pose-pad [data-ready=false][data-active=false] { opacity: .84; }
#game.split-gestures[data-mode=ride] .pose-pad .move-name::before { content: var(--gesture-arrow); padding-right: .18em; font-weight: 800; }
#game.split-gestures :is(.pose-pad, #pose-slots) [data-slot="0"] { --gesture-arrow: '↖'; }
#game.split-gestures :is(.pose-pad, #pose-slots) [data-slot="1"] { --gesture-arrow: '↗'; }
#game.split-gestures :is(.pose-pad, #pose-slots) [data-slot="2"] { --gesture-arrow: '↙'; }
#game.split-gestures :is(.pose-pad, #pose-slots) [data-slot="3"] { --gesture-arrow: '↘'; }
#pose-slots .trial-note { display: block; font-size: .65rem; font-weight: 500; margin-top: .2em; }
#game.split-gestures #pose-slots button[aria-pressed=false]::after {
  content: var(--gesture-arrow); color: var(--shop-gold); font-size: .95rem;
}
#game.split-gestures #pose-slots button[aria-pressed=true] .move-name::before {
  content: var(--gesture-arrow); margin-right: .3em;
}
@media (pointer: fine) {
  #game #pose-slots kbd { display: inline; }
  #game #pose-slots button[aria-pressed=false]::after { content: none; }
}
#game.split-gestures[data-mode=ride] .pose-pad :is(.catch-ready,.catch-save,[data-boost-hit],[data-boost-aim],[data-catch-award]) { padding-top: .9rem; }
#game.split-gestures[data-mode=ride] .pose-pad [data-boost-swipe]::after { content: none; }

#pose-gesture-origin {
  position: absolute; z-index: 1; width: 36px; height: 36px; translate: -50% -50%;
  border: 1px solid #eaffdfb3; border-radius: 50%; background: #15271c38;
  pointer-events: none; user-select: none; color: #f4ffe9;
}
#pose-gesture-origin i {
  position: absolute; left: 50%; top: 50%; margin: -4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 1px #173022;
}
#pose-gesture-origin span {
  position: absolute; left: 50%; bottom: calc(100% + 3px); translate: -50%;
  border-radius: 4px; padding: 3px 5px; background: #102019e6;
  font: 750 12px/1.1 system-ui,sans-serif; text-align: center; white-space: nowrap;
}
#pose-gesture-origin span:empty { display: none; }

.split-tip, #game.split-gestures .control-guide .gesture-tip { display: none; }
#game.split-gestures .control-guide .split-tip { display: block; }
#touch-scheme-label:not([hidden]) { display: flex; align-items: center; justify-content: space-between; }
#touch-scheme { min-height: 44px; font: inherit; }

.game:not([data-mode=ride]) .direct-pose { display: none; }
#game[data-mode=ride] .pose-pad .direct-pose {
  pointer-events: auto;
  min-height: 44px;
  padding: .25rem;
  border-radius: .55rem;
  background: #20362de8;
  border-color: #9db99d;
}
#game[data-mode=ride] .direct-pose .trick-art:empty { display: none; }
#game[data-mode=ride] .direct-pose .move-name::before { content: none; }
#game[data-mode=ride] .direct-pose[data-active=true] { background: #326148; }

.learn-controls { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-bottom:5px; }
.learn-controls:has(#launch-touch-scheme:not([hidden])) { display:grid; grid-template-columns:minmax(0,1fr) auto; }
#launch-touch-scheme { min-height:44px; font:inherit; }
#learn-ride { justify-self:start; margin:0; min-height:44px; padding:6px 14px; }
#learn-ride small { display:inline; margin-left:5px; font-weight:400; }
#learn-ride.first-choice { background:var(--lime,#d8fa58); color:#172010; border-color:transparent; }
/* The first lap teaches by itself; replay the guide from Menu → Aprender jogando. */
#learn-ride { display:none; }
#ride-lesson:not([hidden]) { position:absolute; z-index:12; top:max(12%, calc(env(safe-area-inset-top) + 60px)); left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100% - 24px); box-sizing:border-box; display:flex; align-items:center; gap:10px; padding:5px 8px 5px 13px; border-radius:10px; background:#10261ff2; color:white; box-shadow:0 2px 12px #0004; }
#lesson-instruction { max-width:36ch; font-size:14px; line-height:1.3; }
#lesson-skip { flex:none; min-height:44px; font-size:12px; }
#intro.first-visit:not(.show-goals) .stage-goals > :not(#novice-goals):not(#pass-goal),
#intro.first-visit:not(.show-goals) .tour-career,
#stage:has(#ride-lesson:not([hidden])) #air { display:none; }
#novice-goals { min-height:44px; }
#game:has(#ride-lesson:not([hidden])) #retry-replay { display:none; }
@media (pointer:coarse) and (orientation:landscape) and (max-height:470px) {
  .game[data-mode=ride]:has(#camera-tools[open]) #ride-lesson:not([hidden]) {
    left:var(--gutter); transform:none;
    max-width:calc(100% - 2 * var(--gutter) - min(14rem,64vw) - 3.5rem);
  }
  .game[data-mode=ride]:has(#retry-replay:not([hidden])):not(:has(#ride-lesson:not([hidden]))) #camera-tools .lenses {
    right:3rem;
  }
}

#ride-mode { min-height:44px; font:inherit; }
.learn-controls:has(#launch-touch-scheme:not([hidden])) #ride-mode { grid-column:1 / -1; justify-self:start; }
#game[data-ride-mode=livre] :is(.tour-career,.rank-receipt,.trick-book,#career-status) { display:none; }

#phase-board {
  width:min(100%,21rem); box-sizing:border-box; margin-top:.85rem;
  color:#f7f7ee; background:linear-gradient(100deg,#0a1718ed,#0a1718b8 76%,#0a171856);
  border-left:3px solid var(--tour-accent); padding:.55rem .85rem .45rem;
  text-shadow:0 1px 3px #08100f;
}
#phase-board header,#phase-board li { display:flex; align-items:baseline; gap:.55rem; }
#phase-board header { justify-content:space-between; margin-bottom:.25rem; }
#phase-board h2 { font:italic 900 .95rem/1.1 var(--heading); letter-spacing:.015em; text-transform:uppercase; }
#phase-board-mode { color:#d7ded0; font:650 .7rem/1.2 system-ui,sans-serif; }
#phase-board-list { list-style:none; padding:0; margin:0; }
#phase-board li { padding:.18rem 0; border-top:1px solid #d4e5dd38; font:650 .84rem/1.2 system-ui,sans-serif; }
#phase-board li:first-child { color:var(--tour-accent); }
.board-place,.board-score { font-variant-numeric:tabular-nums; }
.board-place { min-width:1.4em; font-weight:850; font-style:italic; }
.board-rider { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.board-score { margin-left:auto; white-space:nowrap; }
#phase-board-status { margin:.25rem 0 0; font:550 .78rem/1.3 system-ui,sans-serif; }
#phase-board-status:empty { display:none; }
@media(prefers-reduced-motion:no-preference) {
  #phase-board:not([hidden]) { animation:tour-arrival .55s ease-out backwards; }
}
@media(max-width:700px) and (orientation:portrait) {
  #phase-board { width:min(82%,19rem); margin-top:.55rem; padding:.4rem .65rem; }
}
@media(max-height:710px) and (orientation:portrait), (max-height:470px) and (orientation:landscape) {
  #phase-board { margin-top:.35rem; padding:.32rem .55rem; }
  #phase-board li { font-size:.75rem; padding:.1rem 0; }
}

/* Phase title and confirmed ranking finish. */
.game[data-mode=ready] #venue-name {
  width: fit-content;
  border-bottom: .08em solid var(--tour-accent);
  padding-bottom: .12em;
}
#ranking-finish-status:not([hidden]) {
  max-width: fit-content;
  position: relative;
  overflow: hidden;
  padding: .35rem .65rem;
  border-left: .22rem solid #ffca6b;
  background: linear-gradient(105deg,#302615,#19231b 90%);
  color: #fff6dc;
  font: italic 900 clamp(1.16rem,3.5vw,1.5rem)/1.2 var(--heading);
}
#result.top-ten { border-color: #ffca6b; }
#ranking-rows li[data-current] {
  background: #52431b;
  color: #fff8e5;
  outline: 1px solid #eeb957;
  outline-offset: -1px;
}
@media (prefers-reduced-motion: no-preference) {
  .game[data-mode=ready] #venue-name { animation: phase-title-in .28s ease-out both; }
  #result.top-ten #ranking-finish-status:not([hidden]) { animation: rank-stamp-in .42s ease-out both; }
  #result.top-ten #ranking-finish-status:not([hidden])::after {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,transparent 38%,#ffca6b60 52%,transparent 66%);
    transform: translateX(-100%);
    animation: rank-light-swipe .65s .10s ease-out both;
  }
}
@keyframes phase-title-in {
  from { opacity: 0; transform: translateX(-.38em) skew(-7deg); }
  to { opacity: 1; transform: none; }
}
@keyframes rank-stamp-in {
  from { opacity: 0; transform: translateY(.35rem) scale(.95); }
  75% { opacity: 1; transform: translateY(0) scale(1.03); }
  to { opacity: 1; transform: none; }
}
@keyframes rank-light-swipe {
  to { transform: translateX(100%); }
}

.rank-medal { display:none; }
#ranking-dialog[data-rank] {
  border-top-color:#ffc769;
  background:linear-gradient(143deg,#293326,#10201c 46%,#0d1816);
}
#ranking-dialog[data-rank] .tour-bar {
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;
  gap:clamp(.45rem,2vw,.9rem);
}
#ranking-dialog[data-rank] .rank-medal {
  display:grid;place-items:center;
  width:clamp(2.8rem,9vw,4.5rem);aspect-ratio:.88;
  clip-path:polygon(0 0,100% 0,94% 74%,50% 100%,6% 74%);
  background:linear-gradient(128deg,#fff2bf 0%,#ffcf70 38%,#af701e 39%,#ffcf72 42%,#de9d36 74%,#925910);
  color:#1e1b10;text-shadow:0 1px #fff4bf;
  font:italic 900 clamp(1.55rem,5vw,2.35rem)/1 var(--heading);
}
@media(prefers-reduced-motion:no-preference){
  #ranking-dialog[open][data-rank] .rank-medal {animation:rank-flip-in .58s cubic-bezier(.18,.76,.27,1) both;}
  #ranking-dialog[open][data-rank] li[data-current] {animation:rank-row-in .34s ease-out both;}
}
@keyframes rank-flip-in {
  from {opacity:0;transform:perspective(220px) rotateY(-84deg) scale(.75);}
  68% {transform:perspective(220px) rotateY(12deg) scale(1.06);}
  to {opacity:1;transform:none;}
}
@keyframes rank-row-in {from{transform:translateX(.65rem);opacity:.25;}to{transform:none;opacity:1;}}

/* Game feel (jogo/feel.js): light lives at the screen edges and in the HUD, never over the rider. */
.feel-edge {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; will-change: opacity;
  --feel-c: var(--mint);
  /* Gradients, not a blurred shadow: cheap to raster on a phone at DPR 3. */
  background:
    linear-gradient(90deg, var(--feel-c), transparent 24px), linear-gradient(270deg, var(--feel-c), transparent 24px),
    linear-gradient(180deg, var(--feel-c), transparent 24px), linear-gradient(0deg, var(--feel-c), transparent 24px);
}
.feel-flow-edge {
  --feel-c: #c5f49b; transition: opacity .6s ease;
  /* The standing flow light keeps to the top and bottom bands, where the rider never is. */
  background: linear-gradient(180deg, var(--feel-c) 0, transparent 22px, transparent calc(100% - 22px), var(--feel-c) 100%);
}
.game[data-mode=ride] .feel-flow-edge[data-level="2"] { opacity: .16; }
.game[data-mode=ride] .feel-flow-edge[data-level="3"] { opacity: .28; --feel-c: #ffcc62; }
.top .stats { position: relative; }
.feel-flow {
  position: absolute; left: -3px; right: 0; bottom: -4px; height: 3px; overflow: hidden; pointer-events: none;
  background: linear-gradient(90deg, #ffffff1f 0 30%, #0000 30% 30.6%, #ffffff1f 30.6% 60%, #0000 60% 60.6%, #ffffff1f 60.6% 90%, #0000 90% 90.6%, #ffffff1f 90.6%);
  transform-origin: left center;
}
.feel-flow-fill {
  position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0);
  background: var(--mint); transition: transform .35s cubic-bezier(.2,.8,.3,1), background-color .3s;
}
.feel-flow[data-level="2"] .feel-flow-fill { background: #d8ff45; }
.feel-flow[data-level="3"] .feel-flow-fill { background: var(--gold); }
.game:not([data-mode=ride]) .feel-flow { display: none; }
.feel-score-flash {
  position: absolute; inset: -.2rem -.35rem; pointer-events: none; opacity: 0; border-radius: .3rem; mix-blend-mode: screen;
  --feel-c: var(--mint);
  background: radial-gradient(closest-side, var(--feel-c), transparent); will-change: opacity, transform;
}
@media (prefers-reduced-motion: no-preference) {
  /* Each trick caught in one flight lands its chip a little bigger: the combo ladder. */
  #trick-credits > span:last-child {
    transform-origin: left center;
    animation: bank-points .95s ease-out both, feel-ladder .26s cubic-bezier(.2,.9,.3,1.4) both;
  }
  .game[data-mode=ride] .feel-flow-edge[data-level="3"] { animation: feel-breathe 1.8s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) { .feel-edge, .feel-score-flash { display: none; } .feel-flow-fill { transition: none; } }
@keyframes feel-ladder {
  from { scale: calc(1.08 + .07 * var(--feel-ladder, 0)); }
  to { scale: 1; }
}
@keyframes feel-breathe { from { opacity: .2; } to { opacity: .34; } }

/* ==========================================================================
   First lap (first-lap.js): one ghost thumb per jump, never takes a touch.
   ========================================================================== */
#first-lap { position:absolute; inset:0; z-index:5; pointer-events:none; overflow:hidden; }
#first-lap * { pointer-events:none; }
#game:not([data-mode=ride]) #first-lap .fl-hand { display:none; }
.fl-hand { position:absolute; left:var(--x); top:var(--y); width:0; height:0; }
.fl-hand[hidden] { display:none; }
.fl-thumb {
  position:absolute; left:-23px; top:-23px; width:46px; height:46px; border-radius:50%;
  background:radial-gradient(circle at 42% 36%, #fffdf4f2, #f3ead2d9 58%, #dccfa9b3);
  box-shadow:0 0 0 2px #10261fb3, 0 4px 12px #0008;
}
.fl-trail {
  position:absolute; left:0; top:-3px; width:var(--len,60px); height:6px; border-radius:3px;
  transform-origin:0 50%; rotate:var(--angle,0rad);
  background:linear-gradient(90deg,#d8fa5800,#d8fa58e6); opacity:0;
}
.fl-trail::after {
  content:''; position:absolute; right:-7px; top:-5px;
  border:8px solid transparent; border-left:11px solid #d8fa58; border-right:0;
}
.fl-name {
  position:absolute; left:0; bottom:32px; translate:-50% 0; display:flex; align-items:center; gap:.3rem;
  padding:.32rem .65rem; border:2px solid var(--lime,#d8fa58); border-radius:999px;
  background:#10261ff2; color:#fff; white-space:nowrap; text-shadow:none;
  font:850 15px/1 system-ui,sans-serif; letter-spacing:.01em; box-shadow:0 3px 10px #0006;
}
.fl-name kbd { padding:.12rem .38rem; border-radius:.25rem; background:#fff; color:#10261f; font:900 13px/1 system-ui,sans-serif; }
.fl-name kbd:empty { display:none; }
/* Approach: the thumb rests where it will start. In the air: it swipes, over and over. */
.fl-hand[data-state=ready] .fl-thumb { opacity:.72; animation:fl-breathe 1.1s ease-in-out infinite alternate; }
.fl-hand[data-state=go][data-kind=swipe] .fl-thumb { animation:fl-swipe 1s cubic-bezier(.3,.1,.3,1) infinite; }
.fl-hand[data-state=go][data-kind=swipe] .fl-trail { animation:fl-trail 1s ease-out infinite; }
.fl-hand[data-kind=tap] .fl-trail, .fl-hand[data-kind=key] .fl-trail { display:none; }
.fl-hand:is([data-kind=tap],[data-kind=key]) .fl-thumb {
  background:none; border:3px solid var(--lime,#d8fa58); box-shadow:0 0 0 2px #10261fb3, 0 0 14px #d8fa5899;
}
.fl-hand[data-state=go]:is([data-kind=tap],[data-kind=key]) .fl-thumb { animation:fl-tap .9s ease-out infinite; }
.fl-cheer {
  position:absolute; left:var(--x,50%); top:var(--y,40%); translate:-50% -50%; margin:0;
  padding:.35rem .8rem; border-radius:999px; background:var(--lime,#d8fa58); color:#10261f;
  font:italic 900 clamp(1.05rem,4.6vw,1.5rem)/1 var(--heading,system-ui); letter-spacing:-.02em;
  white-space:nowrap; text-shadow:none; box-shadow:0 4px 14px #0007;
}
.fl-cheer[hidden] { display:none; }
.fl-cheer[data-final=true] { background:#10261ff2; color:var(--lime,#d8fa58); border:2px solid var(--lime,#d8fa58); }
.fl-cheer.pop { animation:fl-pop .5s cubic-bezier(.2,1.6,.4,1) both; }
/* Live non-blocking Paredão / Wallride & Flow / Boost micro-coach pill */
.fl-coach {
  position:absolute; left:50%; bottom:1.3rem;
  transform:translateX(-50%); margin:0; max-width:min(26rem, calc(100% - 1.5rem));
  padding:.38rem .82rem; border-radius:999px; border:1.5px solid var(--lime, #d8ff45);
  background:#0c1914ec; color:#f4ffe8; text-align:center; text-wrap:balance;
  font:800 .78rem/1.25 system-ui,sans-serif; box-shadow:0 6px 18px #0008; text-shadow:none;
}
.fl-coach[hidden] { display:none; }
.fl-coach[data-tone=paredao] { border-color:var(--gold, #f2c14e); color:#fff4cf; }
.fl-coach[data-tone=wall] { border-color:#ffcf56; background:#231b0df0; color:#ffe69b; }
.fl-coach[data-tone=boost] { border-color:var(--gold, #f2c14e); background:#251d0cf0; color:#ffe58f; }
.fl-coach[data-tone=flow] { border-color:var(--lime, #d8ff45); background:#112312f0; color:#eaffb8; }
@media (pointer: coarse) {
  .fl-coach { bottom:calc(max(.75rem, env(safe-area-inset-bottom)) + 13.4rem); font-size:.72rem; padding:.34rem .64rem; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .fl-coach { bottom:calc(max(.55rem, env(safe-area-inset-bottom)) + 9.2rem); font-size:.7rem; }
}
#game[data-mode=pause] #lap-goals { display:none; }
@keyframes fl-breathe { from { scale:.92; } to { scale:1.04; } }
@keyframes fl-swipe {
  0% { translate:0 0; opacity:0; scale:.9; }
  14% { translate:0 0; opacity:1; scale:1; }
  62% { translate:var(--dx) var(--dy); opacity:1; }
  100% { translate:var(--dx) var(--dy); opacity:0; }
}
@keyframes fl-trail { 0%,14% { opacity:0; clip-path:inset(0 100% 0 0); } 62% { opacity:1; clip-path:inset(0 0 0 0); } 100% { opacity:0; } }
@keyframes fl-tap { 0% { scale:1.25; opacity:.2; } 35% { scale:.92; opacity:1; } 100% { scale:1.35; opacity:0; } }
@keyframes fl-pop { 0% { scale:.6; opacity:0; } 100% { scale:1; opacity:1; } }
@media (prefers-reduced-motion:reduce) {
  /* No looping motion: the thumb sits at the end of the swipe and the trail stays drawn. */
  .fl-hand[data-state=go][data-kind=swipe] .fl-thumb { translate:var(--dx) var(--dy); }
  .fl-hand[data-state=go][data-kind=swipe] .fl-trail { opacity:1; }
}
/* While a ghost shows, it is the only instruction: the game's own hint line waits. */
#game[data-lesson] #air-detail, #game[data-lesson] #turn-repeat, #game[data-lesson] #pose-gesture-origin span { visibility:hidden; }

/* ==========================================================================
   HUD limpo (default). Menu → Tela → Completo shows everything again.
   In the air: trick running, what is next, points, and one hint when it matters.
   #air[data-hint] comes from game.js: cue | catch | echo | double | info.
   #game[data-knows] comes from first-lap.js (lifetime counts in this browser).
   ========================================================================== */
/* "No pouso" repeats what the points already mean; keep the state only when it is news. */
#game:not([data-hud=completo]) #air-score:not(.at-risk):not([data-target-ready]) #air-score-state { display:none; }
/* Distances, landing-soon and cancel tips: the picture says it. */
#game:not([data-hud=completo]) .air[data-hint=info] #air-detail { display:none; }
/* Eco and 720 tips wait for the first lap, then leave once the player has done them three times. */
#game:not([data-hud=completo]):is([data-first-lap],[data-knows~=echo]) .air[data-hint=echo] #air-detail,
#game:not([data-hud=completo]):is([data-first-lap],[data-knows~=double]) .air[data-hint=double] #air-detail,
#game:not([data-hud=completo]):is([data-first-lap],[data-knows~=double]) #turn-repeat { display:none; }
#game:not([data-hud=completo]):is([data-first-lap],[data-knows~=echo]) .air[data-hint=echo]:has(#air-meter[hidden]) { display:none; }
/* The 720 tip was printed twice: under the rotation legend and in the trick line. Keep the trick line. */
#game:not([data-hud=completo]) #free-pad[data-spin]::after { content:none; }
#game:not([data-hud=completo]).split-gestures[data-mode=ride] #free-pad[data-spin]:not([data-turn-active],[data-stroke-ready],[data-pop]) { padding-bottom:0; }
/* One list of tricks: the title already names them and the points add up; the flying chips were a third copy. */
/* Clean HUD: drop the flying trick chips, keep the lap-goal tick. */
#game:not([data-hud=completo]) #stage > #trick-credits > span:not(.goal-credit) { display:none; }
/* Landing: points, Boost and the landing quality. The trick names were on screen a moment ago. */
#game:not([data-hud=completo]) .notice:not([data-boost-contact]) #credit-moves { display:none; }
#game:not([data-hud=completo]) .notice:not([data-boost-contact]) #credit-total { margin-top:.3rem; }
/* Refazer during the ride is an icon; the label stays for screen readers and the Menu. */
#game:not([data-hud=completo]):is([data-mode=ride]) .top #retry-replay {
  min-width:44px; min-height:44px; padding:0 .55rem; display:inline-flex; align-items:center; justify-content:center; gap:.2rem;
}
#game:not([data-hud=completo]):is([data-mode=ride]) .top #retry-replay::before { content:'↺'; font:900 1.25rem/1 system-ui,sans-serif; }
#game:not([data-hud=completo]):is([data-mode=ride]) .top #retry-label {
  position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
#game:not([data-hud=completo]):is([data-mode=ride]) .top #retry-replay kbd { display:none; }
@media (pointer:fine) { #game:not([data-hud=completo]):is([data-mode=ride]) .top #retry-replay kbd { display:inline; } }
/* Once the gestures are known, the legends shrink and fade to give the picture its lower fifth back. */
#game[data-knows~=gestures]:not([data-hud=completo]):not(.slow-controls)[data-mode=ride] :is(.pose-pad,.pad-directions) { opacity:.55; }
#game.split-gestures[data-knows~=gestures]:not([data-hud=completo]):not(.slow-controls)[data-mode=ride] :is(.pad-directions button,.pose-pad button[data-slot]) {
  min-height:20px; padding-block:1px; font-size:11px;
}
#game.split-gestures[data-knows~=gestures]:not([data-hud=completo]):not(.slow-controls)[data-mode=ride] :is(#hop-button,#pad-cashroll) { opacity:.6; }
/* Phone on its side: the trick line sits in the top band, between the score and the camera buttons,
   off the handlebars in the helmet view and off the wheels in the others. */
@media (pointer:coarse) and (orientation:landscape) and (max-height:470px) {
  #game[data-mode=ride] .air,
  #game[data-mode=ride].slow-controls .air,
  #game[data-mode=ride] .boost-flight .air {
    inset:calc(max(.45rem,env(safe-area-inset-top)) + .1rem) calc(max(var(--gutter),env(safe-area-inset-right)) + 13.2rem) auto calc(max(var(--gutter),env(safe-area-inset-left)) + 16.4rem);
    width:auto; max-width:none; margin:0; transform:none; text-align:left;
  }
  #game[data-mode=ride] .air > div { justify-content:flex-start; }
  /* Landing notice: under the score, not over the rider. */
  .notice:not([data-boost-contact]) {
    left:max(var(--gutter),env(safe-area-inset-left)); width:min(15rem,34%); transform:none; text-align:left;
    top:calc(max(.55rem,env(safe-area-inset-top)) + 4.1rem);
  }
  .game:has(.notice:not([hidden], [data-boost-contact])) #score-gain { visibility:hidden; }
  .notice:not([data-boost-contact]) .notice-head { justify-content:flex-start; flex-wrap:wrap; gap:.25rem; }
}

/* ==========================================================================
   Queue chips and Boost button, built in game.js (moveQueueList, boostButton).
   ========================================================================== */
#move-queue {
  position:absolute; top:max(clamp(4.5rem,12vh,8rem), calc(max(.55rem,env(safe-area-inset-top)) + 44px + 44px + .9rem));
  right:var(--gutter,1rem); margin:0; padding:0; list-style:none;
  display:flex; flex-direction:column; align-items:flex-end; gap:.25rem;
  pointer-events:none; z-index:3; font:800 .78rem/1.15 system-ui,sans-serif; color:#fff; text-shadow:var(--shadow);
}
#move-queue[hidden] { display:none; }
#move-queue li:first-child { font-size:.62rem; letter-spacing:.06em; text-transform:uppercase; opacity:.85; }
#move-queue li + li { padding:.2rem .5rem; border-radius:.3rem; background:#172019d9; border-right:3px solid var(--gold,#f2c14e); }
@media (orientation:landscape) and (max-height:470px) {
  /* Right column under the camera buttons, above the pose legend. */
  #move-queue { top:calc(max(.55rem,env(safe-area-inset-top)) + 44px + 44px + .8rem); }
}
#boost-fire {
  position:absolute; left:50%; bottom:calc(136px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:4;
  min-height:52px; padding:.7rem 1.4rem; border:2px solid var(--gold,#f2c14e); border-radius:999px;
  background:#172019e8; color:var(--gold,#f2c14e); box-shadow:0 0 0 0 #f2c14e66, 0 4px 14px #0008;
  font:900 1.08rem/1 system-ui,sans-serif; letter-spacing:.04em; white-space:nowrap; touch-action:manipulation;
  animation:boost-call 1.3s ease-in-out infinite;
}
#boost-fire[hidden] { display:none; }
#boost-fire[data-armed=true] { background:var(--gold,#f2c14e); color:#172019; animation:none; }
@keyframes boost-call { 50% { box-shadow:0 0 0 8px #f2c14e00, 0 4px 14px #0008; } }
@media (orientation:landscape) and (max-height:470px) {
  /* Right thumb, just above the pose legend: big and near the finger, clear of the rider in the middle. */
  #boost-fire {
    left:auto; right:max(var(--gutter,1rem),env(safe-area-inset-right)); transform:none;
    bottom:calc(max(.65rem,env(safe-area-inset-bottom)) + 8.2rem);
  }
}

/* ==========================================================================
   Reserved: lap goals UI (gameplay agent). Paste its CSS below this line.
   Free zones while riding (measured: <5% of ride time under HUD or the rider box):
   portrait 390x844 — top band between the score and the ↺ button, x 200–325, y 58–100;
     a second strip x 220–300, y 120–160. Below y 240 the rider box spans x 60–330.
   landscape 844x390 — left column between the landing notice and the rotation legend,
     x 10–260, y 140–230; and x 560–630, y 60–120 left of the camera buttons.
   Keep the centre (rider), the bottom legends and the top-band trick line free.
   ========================================================================== */

/* Livre lap goals (jogo/lap-goals-ui.js). For the style owner: append to jogo/style.css.
   Nodes: #lap-goals (ride HUD, top-right edge), .goal-credit (chip in #trick-credits),
   #lap-goals-result and #lap-goals-next (result card, around .actions.next-run). */

/* Ride HUD: top-right edge, under the camera bar and "Refazer salto". Never over the rider. */
#lap-goals {
  position: absolute; z-index: 2; pointer-events: none;
  top: calc(max(.55rem, env(safe-area-inset-top)) + 6.4rem); right: var(--gutter);
  width: max-content; max-width: min(15rem, 46%);
  margin: 0; padding: .32rem .5rem .38rem; border-radius: .45rem;
  background: #10201ad0; border-right: 3px solid var(--mint);
  font: 700 .74rem/1.25 system-ui, sans-serif; color: #f3ffe8; text-shadow: var(--shadow);
  transition: opacity .25s ease, max-width .25s ease, padding .25s ease;
}
.lap-goals-head { display: flex; justify-content: space-between; gap: .6rem; margin: 0 0 .2rem; font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lap-goals-flow { color: var(--gold); font-variant-numeric: tabular-nums; }
.lap-goals-flow[data-level="0"] { color: var(--muted); }
#lap-goals .lap-goals-list, .lap-goals-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: .16rem; }
.lap-goal { display: flex; align-items: baseline; gap: .38rem; }
.lap-goal-mark { flex: none; width: 1.05em; font-style: normal; text-align: center; color: var(--gold); }
.lap-goal-text { min-width: 0; }
.lap-goal-progress { margin-left: auto; padding-left: .3rem; color: var(--muted); font-size: .66rem; font-variant-numeric: tabular-nums; }
.lap-goal[data-state=done] .lap-goal-mark { color: var(--mint); }
.lap-goal[data-state=done] .lap-goal-text { color: var(--mint); }
.lap-goal[data-state=failed] { opacity: .55; }
.lap-goal[data-state=failed] .lap-goal-mark { color: #ff9f6b; }

/* In the air the list folds to its marks: a thin column at the edge. */
#lap-goals[data-phase=air] { max-width: 2.1rem; padding: .3rem .32rem; opacity: .8; }
#lap-goals[data-phase=air] :is(.lap-goals-head, .lap-goal-text, .lap-goal-progress) { display: none; }
.game:has(#camera-tools[open]) #lap-goals { visibility: hidden; }

/* Goal met: a short glow on its line and a chip in the credits column. */
#trick-credits .goal-credit { border-color: var(--gold); color: #fff3d4; background: linear-gradient(105deg, #3a2e10f2, #1e2414e8); }
@media (prefers-reduced-motion: no-preference) {
  .lap-goal.just-done { animation: lap-goal-done 1.4s ease-out; }
  @keyframes lap-goal-done {
    0% { transform: scale(1.18); filter: brightness(1.9); }
    35% { transform: scale(1); filter: brightness(1.4); }
    100% { filter: none; }
  }
}

/* Result card. */
.lap-goals-result, .lap-goals-next { margin: .45rem 0; display: grid; gap: .3rem; font: 650 .82rem/1.3 system-ui, sans-serif; }
.lap-goals-result .lap-goals-summary { grid-template-columns: 1fr; }
.lap-medal { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .55rem; margin: 0; }
.lap-medal-name { font: italic 900 1.05rem/1 var(--heading); letter-spacing: -.02em; }
.lap-medal-name::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .35em; border-radius: 50%; vertical-align: -.05em; background: #5d6b5f; box-shadow: inset 0 0 0 2px #ffffff30; }
.lap-medal[data-medal="1"] .lap-medal-name::before { background: #c98a4b; }
.lap-medal[data-medal="2"] .lap-medal-name::before { background: #cfd8d6; }
.lap-medal[data-medal="3"] .lap-medal-name::before { background: var(--gold); }
.lap-medal-gap, .lap-goals-news, .lap-goals-tip { color: var(--muted); font-size: .76rem; margin: 0; }
.lap-goals-next-head { margin: 0; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.lap-goals-tip { color: #f3ffe8; }

/* Landscape phones: under "Refazer salto", above the pose pad; the result card keeps
   only the medal and the one-line summary above its main button. */
@media (orientation: landscape) and (max-height: 470px) {
  #lap-goals { top: calc(max(.45rem, env(safe-area-inset-top)) + 6.2rem); max-width: min(15rem, 30%); font-size: .7rem; }
  .lap-goals-result { gap: .1rem; margin: .25rem 0; }
  .lap-goals-result .lap-goals-summary { display: none; }
  .lap-goals-result .lap-goals-news { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ST has no Studio scenario yet: a quiet note replaces the two Studio buttons on the result card. */
.studio-soon { align-self: center; opacity: .72; font-size: .8rem; }
#ranking-rows time { margin-left:.3rem; color:#c9d3c4; font-size:.72rem; font-weight:400; white-space:nowrap; }
#ranking-rows li:has(> .rank-replay) { position:relative; }
#ranking-rows li:has(> .rank-replay) > :is(div, button):first-child { padding-right:3.4rem; }
#ranking-rows li > button.rank-replay { position:absolute; right:.2rem; top:50%; transform:translateY(-50%); display:block; width:auto; min-width:44px; min-height:44px;
  padding:0 .55rem; border:1px solid #ffffff40; border-radius:2px; background:#1b2a20; color:var(--tour-accent); font-size:.85rem; text-align:center; }
#ranking-rows li > button.rank-replay:disabled { color:#a9b3a4; font-size:.62rem; max-width:5.6rem; white-space:normal; line-height:1.1; }
#ranking-rows li:has(> .rank-replay:disabled) > :is(div, button):first-child { padding-right:6rem; }
#lap-beat { background:#d8ff45; color:#16200a; border-color:#d8ff45; font-weight:800; }
#ranking-device { width:100%; margin-top:.5rem; background:transparent; color:#e4f7d4; border:1px solid #ffffff40; font-size:.82rem; }
#ranking-mine { margin-top:.6rem; border-top:1px solid #ffffff28; padding-top:.4rem; }
#ranking-mine summary { cursor:pointer; font-weight:800; color:var(--tour-accent); min-height:44px; display:flex; align-items:center; }
#ranking-mine ol { margin:0; padding:0; list-style:none; }
#ranking-mine li { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.2rem 0; border-bottom:1px solid #ffffff18; font-size:.85rem; }
#ranking-mine li button { min-width:44px; min-height:44px; background:#1b2a20; color:var(--tour-accent); border:1px solid #ffffff40; }

/* Phone feel: the game is an app surface, not a document. No text selection, long-press menu, tap flash, pinch or
   double-tap zoom, and no pull-to-refresh / rubber band. Scrolling inside menus still works (pan-x pan-y). Fields and
   the backup code stay selectable. */
html, body { overscroll-behavior: none; touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
#parts-backup-code { -webkit-user-select: all; user-select: all; }
img { -webkit-user-drag: none; }
/* Installed on the Home Screen, the page can run under a notch or camera cutout: the top bar then sits lower (see .top),
   so the result card leaves that much more room. Where the insets are 0 (a normal browser tab) nothing changes. */
.result { max-height: calc(100% - 4.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }

/* Ranking dialog: the title bar, Voltar and the challenge (play) button stay in view; only the list scrolls. */
#ranking-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
#ranking-dialog > :not(#ranking-rows, #ranking-mine) { flex:none; }
#ranking-rows { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
#ranking-mine { flex:0 1 auto; min-height:44px; max-height:38%; overflow-y:auto; overscroll-behavior:contain; }
/* After a lap the rows are plain text (no challenge button) and were shorter than the 44 px replay button, so the
   buttons overlapped each other. A row with a replay button is at least as tall as the button. */
#ranking-rows li:has(> .rank-replay) > div:first-child { min-height:48px; box-sizing:border-box; padding:.35rem 3.4rem .35rem .4rem; align-items:center; }

/* Feedback mode: numbered jump markers (?nums=1 or key N/0) — no backdrop-filter to avoid WebGL readback hitches */
#jump-num-hud {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .28rem .65rem; border-radius: 999px;
  background: rgba(15, 23, 42, .92); border: 1.5px solid #facc15;
  color: #f8fafc; font-size: .82rem; line-height: 1.15;
  pointer-events: none; contain: layout style;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
#jump-num-hud[hidden] { display: none; }
#jump-num-tag { color: #facc15; font-weight: 900; font-size: .95rem; letter-spacing: .01em; }
#jump-num-meta { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; color: #e2e8f0; }
#jump-nums-toggle[aria-pressed="true"] { border-color: #facc15; color: #facc15; }

/* ==========================================================================
   Paredão Pump & Style HUD + contextual Style bar (paredao-mechanic.mjs)
   Pure transform/opacity updates and data-attribute coordination (zero root :has()).
   ========================================================================== */
#paredao-hud {
  position: absolute; left: 50%; top: calc(max(.55rem, env(safe-area-inset-top)) + 4.2rem);
  transform: translateX(-50%); z-index: 4; pointer-events: none; contain: layout style;
  width: min(17.5rem, 68%); padding: .34rem .58rem .4rem; border-radius: .5rem;
  background: #111c17e8; border: 1px solid #d7f2cf36; border-bottom: 2px solid #9df6ff44;
  box-shadow: 0 4px 16px #0006; color: #f4ffe9; text-shadow: var(--shadow);
  font: 700 .76rem/1.2 system-ui, sans-serif; box-sizing: border-box;
}
#paredao-hud[hidden] { display: none; }
.game[data-paredao="1"] #air { visibility: hidden; }
#paredao-hud[data-state=sweet] { border-color: #f2c14e99; border-bottom-color: var(--gold, #f2c14e); }
#paredao-hud[data-state=holding] { border-color: #c5f49b99; border-bottom-color: var(--mint, #c5f49b); }
#paredao-hud[data-state=perfect] { border-color: var(--gold, #f2c14e); background: linear-gradient(105deg, #2d2510eb, #14211ae8); }
#paredao-hud[data-state=combo] { border-color: var(--gold, #f2c14e); background: linear-gradient(105deg, #3c2a0ef2, #1b2814eb); box-shadow: 0 0 18px #f2c14e44, 0 4px 16px #0008; }
#paredao-hud[data-kind=wall] #paredao-tag { color: #ffd778; }
.paredao-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .16rem .45rem; }
#paredao-tag { font-size: .62rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; color: var(--mint, #c5f49b); white-space: nowrap; }
#paredao-callout { font: italic 900 .88rem/1.1 var(--heading, system-ui); color: #fff; text-align: right; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#paredao-hud[data-state=sweet] #paredao-callout,
#paredao-hud[data-state=perfect] #paredao-callout,
#paredao-hud[data-state=combo] #paredao-callout { color: var(--gold, #f2c14e); }
.paredao-track {
  position: relative; height: 7px; margin: .26rem 0 .22rem; border-radius: 999px;
  background: #ffffff1f; overflow: hidden;
}
#paredao-hud[data-callout-only=true] .paredao-track { display: none; }
#paredao-sweet {
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  background: linear-gradient(90deg, #f2c14e88, #ffd966cc);
  transform-origin: left center; will-change: transform;
}
#paredao-fill {
  position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, #8df0a5, #f2c14e);
  transform-origin: left center; transform: scaleX(0); will-change: transform; opacity: .82;
}
#paredao-pip {
  position: absolute; inset: -1px 0; pointer-events: none;
  transform: translateX(0%); will-change: transform;
}
#paredao-pip::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -2px; width: 4px; border-radius: 2px;
  background: #fff; box-shadow: 0 0 6px #fff;
}
#paredao-hint { display: block; font-size: .68rem; font-weight: 650; color: #d6e6ce; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#paredao-hud[data-state=sweet] #paredao-hint { color: #ffe58f; font-weight: 800; }

#paredao-style-bar {
  position: absolute; right: max(var(--gutter, 1rem), env(safe-area-inset-right));
  bottom: calc(max(.75rem, env(safe-area-inset-bottom)) + 7.2rem); z-index: 5;
  display: flex; flex-direction: column; gap: .42rem; align-items: stretch;
}
#paredao-style-bar[hidden] { display: none; }
#paredao-style-bar button {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .12rem;
  min-width: 6.2rem; min-height: 48px; padding: .4rem .82rem; border-radius: .7rem;
  border: 2px solid #f2c14ecc; background: linear-gradient(155deg, #2b2312ee, #15221be8);
  color: #fff6d6; box-shadow: 0 4px 14px #0008; touch-action: manipulation; cursor: pointer;
}
#paredao-style-bar button[hidden] { display: none; }
#paredao-style-bar button b { font: italic 900 .92rem/1 var(--heading, system-ui); letter-spacing: .02em; color: var(--gold, #f2c14e); }
#paredao-style-bar button small { font: 700 .62rem/1 system-ui, sans-serif; color: #dbe9d4; }
#paredao-style-bar button:active { transform: scale(.95); }
#paredao-style-bar button[data-armed="true"] {
  border-color: #d8ff45; background: linear-gradient(155deg, #3c3a0ef5, #182b14ee);
  box-shadow: 0 0 14px #d8ff4566, 0 4px 14px #0008;
}
#paredao-footout-btn { border-color: #7ee8ffbb; background: linear-gradient(155deg, #102a30ee, #13211ce8); }
#paredao-footout-btn b { color: #8cf2ff; }
#paredao-style-btn[data-kind=wall] { border-color: #ffcf56; background: linear-gradient(155deg, #3b2a10f2, #1c2216ee); }

@media (max-width: 600px) and (orientation: portrait) {
  #paredao-hud { left: var(--gutter, 1rem); transform: none; width: min(17rem, calc(100% - 2 * var(--gutter, 1rem))); padding: .3rem .48rem .34rem; }
  #paredao-callout { font-size: .74rem; }
  #paredao-hint { font-size: .62rem; }
  #paredao-style-bar { bottom: calc(max(.75rem, env(safe-area-inset-bottom)) + 9.4rem); flex-direction: row; gap: .38rem; }
  #paredao-style-bar button { min-width: 5.2rem; min-height: 44px; padding: .34rem .62rem; }
}
@media (orientation: landscape) and (max-height: 470px) {
  #paredao-hud { top: calc(max(.45rem, env(safe-area-inset-top)) + .25rem); width: min(14rem, 36%); padding: .24rem .48rem .28rem; }
  #paredao-style-bar { bottom: calc(max(.55rem, env(safe-area-inset-bottom)) + 5.6rem); flex-direction: row; }
  #paredao-style-bar button { min-height: 44px; }
}
@media (pointer: fine) and (min-width: 760px) {
  #paredao-hud { top: calc(max(.55rem, env(safe-area-inset-top)) + 4.4rem); width: 18.5rem; }
  #paredao-style-bar { bottom: 11.4rem; right: 1.5rem; }
}

/* ==========================================================================
   Flow Streak, Stomp Callouts, Sector Splits, Speed Lines & Run Highlights
   (jogo/flow-streak.mjs + jogo/flow-fx.js)
   ========================================================================== */

/* Peripheral speed-rush edge vignette: single static GPU-composited layer (opacity-only,
   no conic-gradient or mask-image re-rasterization, center 100% clear). */
.flow-speed-lines {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0; will-change: opacity; contain: strict;
  transition: opacity .35s ease;
  background:
    linear-gradient(90deg, #ffe28a44 0, #ffd16614 26px, transparent 58px),
    linear-gradient(270deg, #ffe28a44 0, #ffd16614 26px, transparent 58px),
    linear-gradient(180deg, #c5f49b24 0, transparent 30px),
    linear-gradient(0deg, #ffe28a2a 0, transparent 34px);
}
.game[data-mode=ride] .flow-speed-lines[data-tier="1"] { opacity: .28; }
.game[data-mode=ride] .flow-speed-lines[data-tier="2"] { opacity: .52; }
.game[data-mode=ride] .flow-speed-lines[data-tier="3"] { opacity: .78; }
.game[data-mode=ride] .feel-flow-edge[data-flow-hot="1"] {
  opacity: .30;
  --feel-c: #ffb940;
}

/* Top-band Flow HUD strip: Flow Streak badge + Sector Split pill. */
.flow-hud {
  position: absolute; z-index: 3; pointer-events: none; contain: layout style;
  top: max(.65rem, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  max-width: min(30rem, calc(100% - 2 * var(--gutter)));
}
.game:not([data-mode=ride]) .flow-hud { display: none; }
.game:has(#camera-tools[open]) .flow-hud { visibility: hidden; }

/* Coordinate #jump-num-hud, .flow-hud, #paredao-hud and #notice via zero-cost data attributes (no root :has()). */
.game[data-jump-nums="1"] .flow-hud {
  top: calc(max(.65rem, env(safe-area-inset-top)) + 2.95rem);
}
.game[data-jump-nums="1"] #paredao-hud {
  top: calc(max(.55rem, env(safe-area-inset-top)) + 5.65rem);
}
.game[data-paredao="1"] .notice:not([data-boost-contact]) {
  visibility: hidden;
}

.flow-streak {
  display: inline-flex; align-items: center; gap: .36rem;
  padding: .22rem .55rem .22rem .42rem; border-radius: .35rem;
  background: #0e1c18e8; border: 1px solid #8eb89475; border-left: 3px solid var(--mint);
  box-shadow: 0 2px 10px #00000055;
  white-space: nowrap; will-change: transform;
}
.flow-streak-mult {
  font: italic 950 1rem/1 var(--heading); letter-spacing: -.03em; color: var(--mint);
  font-variant-numeric: tabular-nums;
}
.flow-streak-label {
  font: 850 .64rem/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #f4ffea;
}
.flow-streak-rate {
  padding: .08rem .28rem; border-radius: .2rem;
  background: #ffffff18; color: var(--mint);
  font: 850 .62rem/1 system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.flow-pips { display: inline-flex; gap: 2px; align-items: center; margin-left: .08rem; }
.flow-pips i {
  width: 5px; height: 8px; border-radius: 1px; background: #ffffff26;
  transition: background-color .2s ease, transform .2s ease;
}
.flow-pips i[data-lit="1"] { background: var(--mint); }

/* Escalating tier themes x2..x5 */
.flow-streak[data-level="2"] { border-left-color: #d8ff45; }
.flow-streak[data-level="2"] :is(.flow-streak-mult, .flow-streak-rate) { color: #d8ff45; }
.flow-streak[data-level="2"] .flow-pips i[data-lit="1"] { background: #d8ff45; }

.flow-streak[data-level="3"] { border-color: #ffcc6288; border-left-color: var(--gold); background: #1e1d10eb; }
.flow-streak[data-level="3"] :is(.flow-streak-mult, .flow-streak-rate) { color: var(--gold); }
.flow-streak[data-level="3"] .flow-pips i[data-lit="1"] { background: var(--gold); }

.flow-streak[data-level="4"] { border-color: #ff9c42b0; border-left-color: #ff9c42; background: #26180def; }
.flow-streak[data-level="4"] :is(.flow-streak-mult, .flow-streak-rate) { color: #ffba52; }
.flow-streak[data-level="4"] .flow-streak-label { color: #ffe7c2; }
.flow-streak[data-level="4"] .flow-pips i[data-lit="1"] { background: #ff9c42; }

.flow-streak[data-level="5"] {
  border-color: #ffe26a; border-left-color: #d8ff45;
  background: linear-gradient(105deg, #2b230cf5, #172716f2);
}
.flow-streak[data-level="5"] .flow-streak-mult { color: #ffe573; }
.flow-streak[data-level="5"] .flow-streak-label { color: #fff8d6; }
.flow-streak[data-level="5"] .flow-streak-rate { background: #d8ff45; color: #12210b; }
.flow-streak[data-level="5"] .flow-pips i[data-lit="1"] { background: linear-gradient(180deg, #ffe573, #d8ff45); }

/* Live Sector Split Delta Pill */
.flow-split {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .5rem; border-radius: .35rem;
  font: 800 .7rem/1.05 system-ui, sans-serif; font-variant-numeric: tabular-nums;
  white-space: nowrap; box-shadow: 0 2px 10px #00000055;
  will-change: transform, opacity;
}
.flow-split[data-sign="+"] { background: #132c19f0; border: 1px solid #9df265aa; color: #c8ff8c; }
.flow-split[data-sign="-"] { background: #2c1e0ef0; border: 1px solid #ffb347aa; color: #ffd089; }
.flow-split[data-sign="="] { background: #1a2621ef; border: 1px solid #a6b9ad88; color: #eef5f0; }
.flow-split-ctx {
  font-size: .58rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase;
  opacity: .8; border-left: 1px solid currentColor; padding-left: .28rem;
}

/* Mobile portrait & narrow screens: park cleanly below .stats, clear of #jump-num-hud, #paredao-hud, #retry-replay and .air/.notice */
@media (max-width: 660px) {
  #jump-num-hud {
    position: absolute; top: 56px; left: 0; right: auto;
    padding: .16rem .45rem; gap: .3rem; font-size: .7rem;
    max-width: calc(100vw - 2 * var(--gutter) - 54px);
  }
  #jump-num-tag { font-size: .76rem; white-space: nowrap; }
  #jump-num-meta { font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .flow-hud {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 56px);
    left: var(--gutter); right: calc(var(--gutter) + 52px);
    transform: none; justify-content: flex-start; flex-wrap: nowrap;
    max-width: none; gap: .3rem;
  }
  .game[data-jump-nums="1"] .flow-hud {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 84px);
  }
  #paredao-hud {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 5.75rem);
    left: var(--gutter, 1rem); transform: none; width: min(17rem, calc(100% - 2 * var(--gutter, 1rem)));
    padding: .3rem .52rem .34rem;
  }
  .game[data-jump-nums="1"] #paredao-hud {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 7.45rem);
  }
  .game[data-paredao="1"] :is(.lap-goals, .lap-goal-toast) {
    visibility: hidden;
  }
  .flow-streak { padding: .16rem .4rem .16rem .34rem; gap: .24rem; }
  .flow-streak-mult { font-size: .88rem; }
  .flow-streak-label { font-size: .56rem; letter-spacing: .04em; }
  .flow-streak-rate { font-size: .56rem; padding: .06rem .2rem; }
  .flow-pips i { width: 4px; height: 7px; }
  .flow-split { padding: .18rem .38rem; font-size: .64rem; gap: .2rem; }
  .flow-split-ctx { display: none; }
  /* Push landing notice cleanly below #flow-hud so zero overlap occurs. */
  .notice:not([data-boost-contact]) {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 88px);
  }
  .game[data-jump-nums="1"] .notice:not([data-boost-contact]) {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 116px);
  }
  .notice:not([data-boost-contact]) .flow-callout {
    margin: 0 0 .14rem; padding: .12rem .42rem; gap: .3rem;
  }
  .notice:not([data-boost-contact]) .flow-callout-main { font-size: .92rem; }
  .notice:not([data-boost-contact]) .flow-callout-tags { font-size: .58rem; padding-left: .28rem; }
}
.lap-goals-flow { white-space: nowrap; }
@media (orientation: landscape) and (max-height: 470px) {
  .flow-hud {
    top: calc(max(.45rem, env(safe-area-inset-top)) + 48px);
    left: max(var(--gutter), env(safe-area-inset-left));
    transform: none; justify-content: flex-start;
  }
  .flow-streak { padding: .14rem .38rem; gap: .24rem; }
  .flow-streak-mult { font-size: .84rem; }
  .flow-streak-label, .flow-streak-rate { font-size: .54rem; }
  .flow-split { padding: .15rem .36rem; font-size: .62rem; }
  .flow-split-ctx { display: none; }
}

/* Punchy Stomp / Big-Air / Sweet-Spot Callout inside #notice */
.flow-callout {
  display: inline-flex !important; align-items: center; justify-content: center; gap: .42rem;
  margin: 0 auto .22rem; padding: .18rem .6rem; border-radius: .28rem;
  background: #10241cf0; border-left: 3px solid var(--mint);
  box-shadow: 0 2px 12px #00000066; text-shadow: none;
  will-change: transform, opacity;
}
.flow-callout-main {
  font: italic 950 clamp(.92rem, 2.2vw, 1.32rem)/1.05 var(--heading);
  letter-spacing: -.015em; color: var(--mint);
}
.flow-callout-tags {
  font: 800 .66rem/1 system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase;
  color: #e9f5e6; opacity: .92;
  border-left: 1px solid #ffffff38; padding-left: .4rem;
}
.flow-callout[data-tone="gold"] { background: #261e0cf2; border-left-color: var(--gold); }
.flow-callout[data-tone="gold"] .flow-callout-main { color: var(--gold); }
.flow-callout[data-tone="fire"] { background: #2c170af2; border-left-color: #ff9c42; }
.flow-callout[data-tone="fire"] .flow-callout-main { color: #ffbe5c; }
.flow-callout[data-tone="max"] {
  background: linear-gradient(100deg, #ffe26a, #c8f98a); border-left-color: #152414;
}
.flow-callout[data-tone="max"] .flow-callout-main { color: #122112; }
.flow-callout[data-tone="max"] .flow-callout-tags { color: #1d321c; border-left-color: #12211244; }
.flow-callout[data-tone="saved"] { background: #2b1812f0; border-left-color: #ff9f6b; }
.flow-callout[data-tone="saved"] .flow-callout-main { color: #ffba90; }

@media (max-width: 660px) {
  .notice:not([data-boost-contact]) .flow-callout { margin-inline: 0; }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 470px) {
  .notice:not([data-boost-contact]) .flow-callout { margin-inline: 0; padding: .14rem .45rem; }
}

/* End-of-Run Highlights Strip inside #result */
.flow-highlights {
  margin: .5rem 0 .45rem; padding: .5rem .6rem; border-radius: .35rem;
  background: #101e19e8; border: 1px solid #596c5d66; border-left: 3px solid var(--mint);
}
.flow-highlights[data-max-level="3"],
.flow-highlights[data-max-level="4"],
.flow-highlights[data-max-level="5"] { border-left-color: var(--gold); }
.flow-hl-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem;
}
.flow-hl-stat { display: grid; gap: .08rem; min-width: 0; }
.flow-hl-label {
  font: 800 .56rem/1.1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.flow-hl-val {
  font: italic 900 clamp(.86rem, 2.8vw, 1.05rem)/1.12 var(--heading);
  color: #fffbed; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flow-highlights[data-max-level="3"] .flow-hl-stat:first-child .flow-hl-val,
.flow-highlights[data-max-level="4"] .flow-hl-stat:first-child .flow-hl-val,
.flow-highlights[data-max-level="5"] .flow-hl-stat:first-child .flow-hl-val { color: var(--gold); }
.flow-hl-sub {
  font: 650 .66rem/1.2 system-ui, sans-serif; color: #b9c9bc;
  overflow-wrap: break-word;
}
/* Clean 2-column grid for secondary tools on the Result card */
.actions.result-tools {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; align-items: stretch;
}
.actions.result-tools > button { min-width: 0; min-height: 44px; padding: .42rem .55rem; font-size: .82rem; line-height: 1.15; text-align: center; }
.actions.result-tools > #result-video,
.actions.result-tools > #friend-link,
.actions.result-tools > #parts-combo-result,
.actions.result-tools > .studio-soon { grid-column: 1 / -1; }
.actions.result-tools > [hidden] { display: none; }
.flow-hl-hook {
  margin: .42rem 0 0 !important; padding-top: .36rem;
  border-top: 1px solid #ffffff1a;
  font: 800 .78rem/1.25 system-ui, sans-serif; color: #eef7e8;
}
.flow-hl-hook[data-tone="record"] { color: #d8ff45; }
.flow-hl-hook[data-tone="close"] { color: var(--gold); }

/* Energized "Mais uma!" CTA momentum feel */
#again[data-momentum] {
  background: linear-gradient(180deg, #ffd875, #f5b93b);
  border-color: #ffe8a3; color: #19160b;
  box-shadow: 0 2px 12px #ffcc6240;
}
#again[data-momentum] kbd { border-color: #19160b66; color: #19160b; opacity: .85; }
@media (hover: hover) {
  #again[data-momentum]:hover { filter: brightness(1.07); }
}

@media (prefers-reduced-motion: reduce) {
  .flow-speed-lines { display: none; }
  .flow-pips i { transition: none; }
}

/* ==========================================================================
   Gameplay Dopamine & Flow Link Layer
   Pure GPU opacity/transform only — ZERO backdrop-filter, ZERO root :has().
   ========================================================================== */

/* Tiered floating score popups (#score-gain) */
#score-gain { white-space: nowrap; will-change: transform, opacity; }
#score-gain[data-tier="2"] { border-left-color: #d8ff45; color: #f1ffb8; }
#score-gain[data-tier="3"] { border-left-color: var(--gold); background: #29220ef0; color: #ffe68e; }
#score-gain[data-tier="4"],
#score-gain[data-tier="combo"] {
  border-left-color: #ff9c42; background: linear-gradient(100deg, #3a1d0af5, #21160cf0); color: #ffd48a;
  font-size: 1rem;
}
#score-gain[data-tier="5"],
#score-gain[data-tier="link"] {
  border-left-color: #d8ff45; background: linear-gradient(100deg, #1b3112f5, #2d290cf2); color: #e8ff7a;
  font-size: 1.02rem;
}
#score-gain[data-tier="record"] {
  border-left-color: #162414; background: linear-gradient(100deg, #ffe26a, #c8f98a); color: #122112;
  font-size: 1.04rem;
}

/* Escalating in-air trick credit chips (#trick-credits) */
#trick-credits span[data-tier="2"] { border-left-color: #d8ff45; color: #f2ffbf; }
#trick-credits span[data-tier="3"] {
  border-left-color: var(--gold); color: #fff1bc;
  background: linear-gradient(105deg, #2d250ef2, #172318eb);
}
#trick-credits span[data-tier="4"] {
  border-left-color: #ff9c42; color: #ffe4b5;
  background: linear-gradient(105deg, #3b1e0af5, #1f2214ee);
}

/* Live distance-to-next-medal / record pill inside #flow-hud */
.flow-goal {
  display: inline-flex; align-items: center; gap: .32rem;
  padding: .2rem .46rem; border-radius: .35rem;
  background: #0e1b18e8; border: 1px solid #8eb89455;
  box-shadow: 0 2px 10px #00000055; white-space: nowrap;
  will-change: transform; contain: layout style;
}
.flow-goal[hidden] { display: none; }
.flow-goal-label {
  font: 800 .62rem/1 system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase;
  font-variant-numeric: tabular-nums; color: #e9f5e6;
}
.flow-goal-track {
  position: relative; width: 42px; height: 5px; border-radius: 999px;
  background: #ffffff24; overflow: hidden; flex: none;
}
.flow-goal-fill {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, #c5f49b, #ffe26a);
  transform-origin: left center; transform: scaleX(0); will-change: transform;
}
.flow-goal[data-tone="bronze"] { border-color: #d99b6688; }
.flow-goal[data-tone="bronze"] .flow-goal-label { color: #f5c396; }
.flow-goal[data-tone="bronze"] .flow-goal-fill { background: #e6a870; }
.flow-goal[data-tone="silver"] { border-color: #c5d7e888; }
.flow-goal[data-tone="silver"] .flow-goal-label { color: #e2effa; }
.flow-goal[data-tone="silver"] .flow-goal-fill { background: #d0e4f5; }
.flow-goal[data-tone="gold"] { border-color: #ffcc6299; background: #1e1c0feb; }
.flow-goal[data-tone="gold"] .flow-goal-label { color: var(--gold); }
.flow-goal[data-tone="gold"] .flow-goal-fill { background: linear-gradient(90deg, #ffbe4f, #ffe680); }
.flow-goal[data-tone="record"],
.flow-goal[data-tone="max"] {
  border-color: #d8ff45aa; background: linear-gradient(100deg, #1b2c13f0, #28240eef);
}
.flow-goal[data-tone="record"] .flow-goal-label,
.flow-goal[data-tone="max"] .flow-goal-label { color: #e2ff75; }
.flow-goal[data-tone="record"] .flow-goal-fill,
.flow-goal[data-tone="max"] .flow-goal-fill { background: linear-gradient(90deg, #d8ff45, #ffe26a); }

/* Lightweight GPU-only dopamine celebration ribbon (top edge, never blocks rider) */
.flow-celebrate {
  position: absolute; left: 50%; top: calc(max(.65rem, env(safe-area-inset-top)) + 2.5rem);
  transform: translateX(-50%); z-index: 8; pointer-events: none; contain: layout style;
  display: inline-flex; flex-direction: column; align-items: center; gap: .08rem;
  padding: .28rem .78rem; border-radius: .42rem;
  background: linear-gradient(100deg, #2b220df5, #172716f2);
  border: 1.5px solid var(--gold); box-shadow: 0 4px 18px #00000070;
  white-space: nowrap; will-change: transform, opacity;
}
.game[data-paredao="1"] .flow-celebrate {
  top: calc(max(.55rem, env(safe-area-inset-top)) + 9.5rem);
}
.flow-celebrate[hidden] { display: none; }
.game:not([data-mode=ride]) .flow-celebrate { display: none; }
.flow-celebrate-title {
  font: italic 950 clamp(.92rem, 2.3vw, 1.18rem)/1.05 var(--heading);
  letter-spacing: -.01em; color: #ffe573; text-shadow: none;
}
.flow-celebrate-sub {
  font: 800 .62rem/1.05 system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase;
  color: #eef7e8; opacity: .92;
}
.flow-celebrate[data-tone="fire"] {
  border-color: #ff9c42; background: linear-gradient(100deg, #3c1c0af5, #22190df2);
}
.flow-celebrate[data-tone="fire"] .flow-celebrate-title { color: #ffc56b; }
.flow-celebrate[data-tone="link"] {
  border-color: #d8ff45; background: linear-gradient(100deg, #1b3112f6, #2b270cf2);
}
.flow-celebrate[data-tone="link"] .flow-celebrate-title { color: #e6ff6b; }
.flow-celebrate[data-tone="record"],
.flow-celebrate[data-tone="max"] {
  border-color: #152414; background: linear-gradient(100deg, #ffe26a, #c8f98a);
}
.flow-celebrate[data-tone="record"] .flow-celebrate-title,
.flow-celebrate[data-tone="max"] .flow-celebrate-title { color: #122112; }
.flow-celebrate[data-tone="record"] .flow-celebrate-sub,
.flow-celebrate[data-tone="max"] .flow-celebrate-sub { color: #1d321c; }

/* In-air combo opportunity / golden catch / paredão link chip inside #air */
.flow-air-cue {
  display: inline-block; width: max-content; margin-bottom: .18rem;
  padding: .14rem .46rem; border-radius: .28rem;
  font: italic 900 .72rem/1.1 var(--heading); letter-spacing: .02em;
  text-transform: uppercase; text-shadow: none; white-space: nowrap;
  will-change: transform, opacity;
}
.flow-air-cue[hidden] { display: none; }
.flow-air-cue[data-mode="catch"] {
  background: linear-gradient(100deg, #ffe26a, #ffc44d); color: #17150a;
  box-shadow: 0 2px 10px #ffcc6255;
}
.flow-air-cue[data-mode="more"] {
  background: #142c21f0; border: 1px solid #c5f49b99; color: #d8ff7a;
}
.flow-air-cue[data-mode="link"] {
  background: linear-gradient(100deg, #273612f2, #182716ee); border: 1px solid #d8ff45aa; color: #e2ff75;
}

@media (max-width: 660px) {
  .flow-hud { flex-wrap: wrap; row-gap: .22rem; }
  .flow-goal { padding: .15rem .34rem; gap: .22rem; }
  .flow-goal-label { font-size: .56rem; letter-spacing: .02em; }
  .flow-goal-track { width: 24px; height: 4px; }
  /* Keep .air cleanly below #flow-hud (even when #flow-split wraps onto row 2) on mobile portrait */
  .game[data-mode=ride] .stage:not(.boost-flight) > .air {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 110px);
  }
  .game[data-mode=ride][data-jump-nums="1"] .stage:not(.boost-flight) > .air {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 138px);
  }
  .flow-celebrate {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 236px);
    padding: .24rem .64rem;
  }
  .game[data-paredao="1"] .flow-celebrate {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 188px);
  }
  .game[data-jump-nums="1"] .flow-celebrate {
    top: calc(max(.55rem, env(safe-area-inset-top)) + 258px);
  }
  .flow-celebrate-title { font-size: .88rem; }
  .flow-celebrate-sub { font-size: .56rem; }
  .flow-air-cue { font-size: .64rem; padding: .12rem .36rem; margin-bottom: .14rem; }
}
@media (orientation: landscape) and (max-height: 470px) {
  .flow-goal-track { width: 28px; }
  .flow-celebrate { top: calc(max(.45rem, env(safe-area-inset-top)) + 72px); padding: .18rem .52rem; }
  .flow-celebrate-title { font-size: .82rem; }
}
