:root { --ink: #f4f1e8; --dim: #b9c2c9; --bg: #10151b; --accent: #ffb22e; --ok: #63d471; --bad: #ff5d5d; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; font: 600 16px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* HUD: time top centre, attempts top right; the top-left corner stays free for the site's way-out mark (ANY-APP §17) */
#hud { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: calc(96px + env(safe-area-inset-left)); right: calc(14px + env(safe-area-inset-right)); display: flex; justify-content: center; pointer-events: none; text-shadow: 0 1px 2px #000, 0 0 10px #000b; }
#hudC { text-align: center; } #hudR { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
html:not(.bt-ride) #hud, html:not(.bt-ride) #prog, html:not(.bt-ride) #keys, html:not(.bt-ride) #touch, html:not(.bt-ride) #viewBtn { display: none !important; }
#prog { position: fixed; top: calc(62px + env(safe-area-inset-top)); left: 50%; width: min(46vw, 360px); height: 6px; transform: translateX(-50%); border-radius: 3px; background: #0b101677; border: 1px solid #ffffff2a; pointer-events: none; overflow: hidden; }
#progFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffd23f); }
#viewBtn { position: fixed; right: calc(14px + env(safe-area-inset-right)); top: calc(70px + env(safe-area-inset-top)); min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid #ffffff3a; background: #0b101699; color: var(--ink); font: 700 13px system-ui; }
body.touch #viewBtn { top: calc(130px + env(safe-area-inset-top)); }
#viewName { position: fixed; left: 50%; top: 26%; transform: translateX(-50%); padding: 6px 14px; border-radius: 10px; background: #0b1016cc; font-size: 16px; pointer-events: none; }
/* while riding, hide site chrome so nothing covers the track (time-chip / pills / nav) */
html.bt-playing #aeParentNav, html.bt-playing #aeAetherPill, html.bt-playing #aeBayPill { visibility: hidden; }
body.touch-swap .tb.l1 { left: auto; right: calc(116px + env(safe-area-inset-right)); } body.touch-swap .tb.l2 { left: auto; right: calc(14px + env(safe-area-inset-right)); }
body.touch-swap .tb.r1 { right: auto; left: calc(116px + env(safe-area-inset-left)); } body.touch-swap .tb.r2 { right: auto; left: calc(14px + env(safe-area-inset-left)); }
.tb.top2 { right: calc(80px + env(safe-area-inset-right)); top: calc(64px + env(safe-area-inset-top)); width: 56px; height: 56px; font-size: 20px; }
@media (min-width: 1px) { html, body { touch-action: none; -webkit-touch-callout: none; } }
#hud span { display: block; }
#hTime { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
#hBest, #hFault { color: #e3e9ee; font-size: 14px; }
/* soft dark backing so the HUD reads on bright skies (snow, dawn haze) */
#hudC, #hudR { padding: 2px 12px 4px; border-radius: 14px; background: radial-gradient(closest-side, #0b101670, #0b101600); }
#keys { transition: opacity .6s; } html.bt-keys-dim #keys { opacity: .38; }
#hudR { text-align: right; } #hTry { font-size: 18px; } #hBest { display: block; }
#hint { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); max-width: min(88vw, 560px); padding: 10px 16px; border-radius: 12px; background: #0b1016cc; border: 1px solid #ffffff22; font-size: 18px; text-align: center; pointer-events: none; }
#hint b { color: var(--accent); }
#go { position: fixed; left: 50%; bottom: calc(22% + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 20px; border-radius: 999px; background: #0b1016d9; border: 1px solid #ffffff2e; font-size: 20px; text-align: center; pointer-events: none; animation: bt-go 1.4s ease-in-out infinite; }
#go b { color: var(--accent); } #go.rev { animation: none; color: #ffd36b; }
@keyframes bt-go { 50% { transform: translateX(-50%) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { #go { animation: none; } }
#msg { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 16px 26px; border-radius: 16px; background: #0b1016e6; border: 1px solid #ffffff2e; text-align: center; font-size: 20px; pointer-events: none; }
/* coach tip: under the HUD, out of the bike's way */
#coach { position: fixed; left: 50%; top: calc(88px + env(safe-area-inset-top)); transform: translateX(-50%); width: min(92vw, 560px); padding: 14px 20px; border-radius: 16px; background: #0b1016e8; border: 2px solid var(--accent); box-shadow: 0 10px 40px #0008; text-align: center; pointer-events: none; z-index: 5; animation: coIn .35s cubic-bezier(.2,1.4,.4,1); }
html:not(.bt-ride) #coach { display: none !important; }
#coach .co-tag { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
#coach .co-title { display: block; font-size: 24px; margin: 2px 0 6px; }
#coach .co-body { display: block; font-size: 17px; line-height: 1.45; color: #e8eef0; }
#coach kbd { display: inline-block; min-width: 24px; padding: 1px 7px; margin: 0 2px; border-radius: 6px; background: #ffb22e; color: #14202a; font: 800 15px/1.4 system-ui; text-align: center; }
#coach.compact { padding: 8px 14px; border-width: 1px; } #coach.compact .co-tag { display: none; } #coach.compact .co-title { font-size: 17px; margin: 0; display: inline; } #coach.compact .co-body { display: inline; font-size: 15px; margin-left: 8px; }
#coach.nice { border-color: #57d68d; padding: 8px 16px; } #coach.nice .co-title { color: #8ff0b6; font-size: 19px; margin: 0; }
@keyframes coIn { from { opacity: 0; transform: translate(-50%, -10px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { #coach { animation: none; } }
#msg .big { font-size: 34px; display: block; margin-bottom: 6px; } #msg .sub { color: var(--dim); font-size: 15px; display: block; margin-top: 8px; }
#keys { position: fixed; left: calc(14px + env(safe-area-inset-left)); bottom: calc(60px + env(safe-area-inset-bottom)); font-size: 13px; color: var(--dim); line-height: 1.55; pointer-events: none; text-shadow: 0 1px 4px #000; }
#keys kbd { display: inline-block; min-width: 20px; padding: 1px 5px; margin: 0 2px; border-radius: 5px; background: #ffffff1c; border: 1px solid #ffffff2a; color: var(--ink); font: inherit; text-align: center; }
#touch { display: none; }
body.touch #touch { display: block; } body.touch #keys { display: none; }
.tb { position: fixed; width: 92px; height: 76px; border-radius: 18px; border: 2px solid #ffffff40; background: #0b101688; color: var(--ink); font: 700 15px system-ui; touch-action: none; }
.tb.on { background: #ffb22e55; border-color: var(--accent); }
.tb.l1 { left: calc(14px + env(safe-area-inset-left)); bottom: calc(64px + env(safe-area-inset-bottom)); }
.tb.l2 { left: calc(116px + env(safe-area-inset-left)); bottom: calc(64px + env(safe-area-inset-bottom)); }
.tb.r1 { right: calc(14px + env(safe-area-inset-right)); bottom: calc(64px + env(safe-area-inset-bottom)); height: 96px; }
.tb.r2 { right: calc(116px + env(safe-area-inset-right)); bottom: calc(64px + env(safe-area-inset-bottom)); }
.tb.u1, .tb.u2 { width: 64px; height: 56px; font-size: 20px; bottom: calc(152px + env(safe-area-inset-bottom)); }
.tb.u1 { left: calc(14px + env(safe-area-inset-left)); } .tb.u2 { left: calc(86px + env(safe-area-inset-left)); }
body.touch-swap .tb.u1 { left: auto; right: calc(86px + env(safe-area-inset-right)); } body.touch-swap .tb.u2 { left: auto; right: calc(14px + env(safe-area-inset-right)); }
/* trackpad test stick: where the finger "is", and how to grab / let go */
#tpad { position: fixed; right: calc(14px + env(safe-area-inset-right)); bottom: calc(60px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; pointer-events: none; font-size: 13px; color: var(--dim); text-shadow: 0 1px 4px #000; }
html:not(.bt-ride) #tpad { display: none !important; }
#tpad .tp-box { position: relative; width: 64px; height: 64px; border-radius: 12px; border: 1px solid #ffffff3a; background: #0b101699; }
#tpad .tp-box::before, #tpad .tp-box::after { content: ''; position: absolute; background: #ffffff22; }
#tpad .tp-box::before { left: 50%; top: 6px; bottom: 6px; width: 1px; } #tpad .tp-box::after { top: 50%; left: 6px; right: 6px; height: 1px; }
#tpad .tp-dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--dim); transition: background .15s; }
#tpad.live .tp-dot { background: var(--accent); } #tpad.press .tp-dot { box-shadow: 0 0 0 4px #ffb22e66; } #tpad.press2 .tp-dot { box-shadow: 0 0 0 4px #ff5a4e88; }
#tpad .tp-say { max-width: 190px; line-height: 1.35; }
.tb.top { right: calc(14px + env(safe-area-inset-right)); top: calc(64px + env(safe-area-inset-top)); width: 56px; height: 56px; font-size: 24px; }
/* version tag (menus only) + update bar */
#ver { position: fixed; right: calc(10px + env(safe-area-inset-right)); bottom: calc(6px + env(safe-area-inset-bottom)); font: 600 11px system-ui; color: #ffffff80; pointer-events: none; z-index: 2147481000; }
html.bt-ride #ver { display: none; }
#upd { position: fixed; left: 50%; bottom: calc(70px + env(safe-area-inset-bottom)); transform: translateX(-50%); min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid #ffd23f; background: #0b1016ee; color: var(--ink); font: 700 14px system-ui; z-index: 50; }
/* MX jump callouts stay clear of the rider and never intercept controls. */
#jump { position:fixed; left:0; right:0; margin:0 auto; width:max-content; top:calc(84px + env(safe-area-inset-top)); padding:10px 18px; max-width:min(320px, calc(100vw - 32px)); border-radius:14px; background:#10151be8; border:1px solid #f4f1e850; box-shadow:0 6px 20px #0004; pointer-events:none; text-align:center; }
body.touch #jump { top:calc(120px + env(safe-area-inset-top)); }
#easeCue { position:fixed; left:0; right:0; margin:0 auto; width:max-content; top:calc(150px + env(safe-area-inset-top)); padding:8px 16px; border-radius:12px; background:#20190feb; border:2px solid #ffce69; color:#ffce69; font:900 22px/1.1 system-ui; letter-spacing:.06em; pointer-events:none; box-shadow:0 6px 20px #0005; }
#easeCue small { font:700 12px system-ui; letter-spacing:0; color:#f4f1e8; margin-left:6px; }
body.touch #easeCue { top:calc(184px + env(safe-area-inset-top)); }
#jump b { display:block; font:900 23px/1.2 system-ui; color:#ffce69; }
#jump span { display:block; margin-top:4px; font-size:13px; color:#f4f1e8; }
#jump[data-tone="perfect"] b { color:#8ff0b6; }
#jump[data-tone="sketchy"] b { color:#ffbe8a; }
#jump[data-tone="perfect"] { animation:mx-pop .22s ease-out; }
@keyframes mx-pop { from { transform:scale(.94); } to { transform:scale(1); } }
.mx-reduced #jump { animation:none; }
@media (prefers-reduced-motion:reduce) { #jump { animation:none; } }
html:not(.bt-ride) #jump { display:none!important; }
body:not(.touch-advanced) #touch [data-act="up"], body:not(.touch-advanced) #touch [data-act="down"] { display:none; }
#keys { pointer-events:auto; padding:8px 12px; border-radius:12px; background:#10151bca; max-height:55vh; overflow:auto; }
#keys p { max-width:260px; margin:6px 0; }
.mx-more summary { min-height:44px; display:flex; align-items:center; cursor:pointer; color:#ffce69; }
.mx-more summary::before { content:'▸'; margin-right:8px; }
.mx-more[open] summary::before { content:'▾'; }
@media (max-width:600px) { #jump { top:32%; right:10px; max-width:210px; } #jump b { font-size:19px; } }

#jump[data-tone="bottomed-out"] b { color:#ff6842; }
#jump[data-tone="bottomed-out"] { border-color:#ff6842; }
