:root {
  --ink: #1d2340; --ink2: #2c3563; --orange: #ff7a3d; --orange2: #d9551d; --yellow: #ffd23f; --yellow2: #d9a400;
  --cyan: #34d6ff; --cyan2: #1797c4; --pink: #ff5fa2; --green: #33c27f; --green2: #1f9a5e; --red: #ff4b4b;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --cbtn: clamp(60px, min(20vw, 22vh), 104px);
  --dbtn: clamp(84px, min(26vw, 30vh), 128px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2a5c; overscroll-behavior: none; }
body { font-family: Nunito, ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #fff; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#app { position: fixed; inset: 0; touch-action: none; }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 58%, rgba(15,10,45,.34) 100%); }
#speedfx { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 55%, rgba(255,255,255,0) 52%, rgba(255,255,255,.22) 100%); transition: opacity .2s; }
#flash { position: absolute; inset: 0; pointer-events: none; background: #fff; opacity: 0; transition: opacity .4s; }
#flash.red { background: #ff3048; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui button { pointer-events: auto; font-family: inherit; }

/* loader */
#loader { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: radial-gradient(circle at 50% 40%, #3b5bd6, #1d2a5c 72%); z-index: 50; transition: opacity .5s; }
#loader.hide { opacity: 0; pointer-events: none; }
.ld-logo, .logo { display: flex; flex-direction: column; align-items: center; font-weight: 900; font-style: italic; line-height: .9; letter-spacing: 1px; transform: skewX(-8deg); }
.ld-logo span, .logo span { display: block; font-size: 54px; background: linear-gradient(#fff36b, #ffb21f 60%, #ff7a1f); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 0; filter: drop-shadow(0 4px 0 #b03a12) drop-shadow(0 8px 14px rgba(0,0,0,.35)); }
.ld-logo span + span, .logo span + span { background: linear-gradient(#ffffff, #8fe8ff 55%, #34b8ff); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 4px 0 #1a4fa8) drop-shadow(0 8px 14px rgba(0,0,0,.35)); margin-top: 2px; }
.ld-bar { width: 190px; height: 12px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--yellow), var(--orange)); transition: width .2s; }
.ld-err { max-width: 280px; text-align: center; font-weight: 800; }

/* shared */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 6px; border-radius: 99px; background: rgba(20,24,52,.6); font-weight: 900; font-size: 18px; backdrop-filter: blur(4px); box-shadow: inset 0 -3px 0 rgba(0,0,0,.22); white-space: nowrap; }
.pill svg { width: 28px; height: 28px; flex: none; }
.btn { border: 0; font-weight: 900; cursor: pointer; color: #fff; border-radius: 18px; transition: transform .08s, filter .15s; touch-action: manipulation; }
.btn:active { transform: translateY(3px) scale(.98); }
.btn[disabled] { filter: grayscale(.7) brightness(.8); cursor: default; }
.screen { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; pointer-events: none; }
.screen.on { opacity: 1; visibility: visible; transition: opacity .3s; }
.screen.on button, .screen.on .tap { pointer-events: auto; }
.screen:not(.on) * { pointer-events: none !important; }
.outline { text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 4px 0 var(--ink), 0 6px 12px rgba(0,0,0,.3); }

/* title */
.topbar { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); display: flex; gap: 8px; align-items: center; }
#title .logo { position: absolute; left: 50%; top: calc(7% + var(--sat)); transform: translateX(-50%) skewX(-8deg); animation: logoIn .7s cubic-bezier(.2,1.6,.4,1) both; }
#title .logo span { font-size: clamp(48px, min(15vw, 13vh), 92px); }
@keyframes logoIn { from { transform: translateX(-50%) skewX(-8deg) scale(.5) rotate(-6deg); opacity: 0; } to { transform: translateX(-50%) skewX(-8deg) scale(1); opacity: 1; } }
#title .bottom { position: absolute; left: 0; right: 0; bottom: calc(16px + var(--sab)); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.play { min-width: 240px; height: 76px; font-size: 32px; padding: 0 26px; background: linear-gradient(#ffa25e, var(--orange)); box-shadow: 0 7px 0 var(--orange2), 0 14px 26px rgba(0,0,0,.3); text-shadow: 0 3px 0 rgba(150,50,0,.45); display: flex; align-items: center; justify-content: center; gap: 12px; animation: pulse 1.5s ease-in-out infinite; }
.play svg { width: 30px; height: 30px; flex: none; }
.play small { display: block; font-size: 14px; opacity: .95; margin-top: 3px; text-shadow: none; line-height: 1; }
.play .pl { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.play .pt { line-height: 1; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.rounds { display: flex; gap: 14px; }
.round { position: relative; width: 84px; display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: 0; color: #fff; font-weight: 900; font-size: 13px; cursor: pointer; padding: 0; }
.round .ic { width: 62px; height: 62px; border-radius: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 rgba(0,0,0,.28), inset 0 -4px 0 rgba(0,0,0,.15); transition: transform .08s; }
.round:active .ic { transform: translateY(3px); }
.round .ic svg { width: 36px; height: 36px; }
.round span { text-shadow: 0 2px 0 var(--ink), 0 0 6px rgba(0,0,0,.45); line-height: 1.1; text-align: center; }
:lang(ja) .round span { white-space: nowrap; }
.dot { position: absolute; top: -5px; right: 6px; min-width: 22px; height: 22px; border-radius: 99px; background: #ff3048; border: 3px solid #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* sheets (levels, garage) */
.sheet-head { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); right: calc(64px + var(--sar)); display: flex; align-items: center; gap: 10px; }
.back { width: 48px; height: 48px; border-radius: 16px; background: rgba(20,24,52,.65); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); flex: none; }
.back svg { width: 26px; height: 26px; }
.sheet-title { font-weight: 900; font-size: 24px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-wrap { position: absolute; top: calc(70px + var(--sat)); bottom: calc(10px + var(--sab)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.lv-wrap * { touch-action: pan-y; }
.lv-zone { font-weight: 900; font-size: 15px; opacity: .9; margin: 6px 4px 8px; text-transform: uppercase; letter-spacing: .5px; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; padding-bottom: 14px; max-width: 900px; margin: 0 auto; }
.lv { position: relative; aspect-ratio: 1 / 1.08; border-radius: 20px; border: 0; background: linear-gradient(#fff, #e9edfb); color: var(--ink); box-shadow: 0 5px 0 #b7bfdc, 0 10px 18px rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 6px 2px; }
.lv:active { transform: translateY(3px); box-shadow: 0 2px 0 #b7bfdc; }
.lv .n { font-size: 26px; font-weight: 900; line-height: 1; }
.lv .ty { width: 36px; height: 36px; }
.lv .ty svg { width: 100%; height: 100%; }
.lv .st { display: flex; gap: 1px; }
.lv .st svg { width: 18px; height: 18px; }
.lv.locked { background: linear-gradient(#8a93b8, #6f789e); box-shadow: 0 5px 0 #4e5679; color: #dfe3f5; }
.lv.locked .lk { width: 30px; height: 30px; }
.lv.next { outline: 4px solid var(--yellow); animation: pulse 1.4s ease-in-out infinite; }
.lv.sunset { background: linear-gradient(#fff4ea, #ffd9c2); box-shadow: 0 5px 0 #e1a98a, 0 10px 18px rgba(0,0,0,.2); }

/* garage */
#garage .panel { position: absolute; left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); bottom: calc(10px + var(--sab)); max-height: 54%; overflow-y: auto; overscroll-behavior: contain; background: rgba(255,255,255,.96); color: var(--ink); border-radius: 22px; padding: 12px 14px 14px; box-shadow: 0 14px 36px rgba(0,0,0,.3); touch-action: pan-y; }
#garage .panel * { touch-action: pan-y; }
.g-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.g-name b { font-size: 22px; font-weight: 900; }
.g-arrow { width: 48px; height: 48px; border-radius: 16px; background: #eef1fb; box-shadow: 0 4px 0 #cfd5ea; display: flex; align-items: center; justify-content: center; color: var(--ink); flex: none; }
.g-arrow svg { width: 24px; height: 24px; }
.g-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin: 10px 0 8px; font-weight: 800; font-size: 13px; }
.bar { height: 10px; border-radius: 99px; background: #e3e7f5; overflow: hidden; position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #34b8ff, #34d6ff); transition: width .3s; }
.bar i.up { background: linear-gradient(90deg, #ffb21f, #ffd23f); }
.g-main { width: 100%; height: 54px; font-size: 20px; margin: 4px 0 10px; display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(#ffa25e, var(--orange)); box-shadow: 0 5px 0 var(--orange2); }
.g-main.ok { background: linear-gradient(#5ee39e, var(--green)); box-shadow: 0 5px 0 var(--green2); }
.g-main svg { width: 26px; height: 26px; }
.g-sec { font-weight: 900; font-size: 13px; text-transform: uppercase; color: #6a7193; margin: 6px 0 6px; letter-spacing: .4px; }
.upg { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.upg .nm { font-weight: 900; font-size: 14px; width: 88px; flex: none; overflow: hidden; text-overflow: ellipsis; }
.pips { display: flex; gap: 4px; flex: 1; }
.pips i { flex: 1; height: 12px; border-radius: 4px; background: #e3e7f5; max-width: 26px; }
.pips i.on { background: linear-gradient(#ffd23f, #ffb21f); }
.upg button { min-width: 92px; height: 44px; border-radius: 14px; background: linear-gradient(#5ab8ff, #2f8fff); box-shadow: 0 4px 0 #1f64c4; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; flex: none; }
.upg button svg { width: 20px; height: 20px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #cfd5ea, 0 3px 6px rgba(0,0,0,.15); position: relative; cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 3px var(--ink), 0 3px 6px rgba(0,0,0,.2); }
.sw .pr { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; border-radius: 99px; padding: 1px 5px; display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.sw .pr svg { width: 10px; height: 10px; }
@media (orientation: landscape) and (min-width: 560px) {
  #garage .panel { left: auto; width: min(400px, 46vw); top: calc(68px + var(--sat)); bottom: auto; max-height: calc(100% - 80px - var(--sat) - var(--sab)); }
}

/* HUD */
#hud .tl { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); width: min(300px, calc(100% - 84px - var(--sal) - var(--sar))); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#hud .goal { width: 100%; background: rgba(20,24,52,.62); backdrop-filter: blur(4px); border-radius: 18px; padding: 8px 12px 10px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.goal .row { display: flex; align-items: center; gap: 8px; }
.goal .gi { width: 26px; height: 26px; flex: none; }
.goal .gi svg { width: 100%; height: 100%; }
.goal .gt { font-weight: 900; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal .tm { font-weight: 900; font-size: 22px; font-variant-numeric: tabular-nums; flex: none; }
.goal .tm.low { color: #ff6b6b; animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.goal .pb { position: relative; height: 10px; border-radius: 99px; background: rgba(255,255,255,.2); margin-top: 7px; }
.goal .pb i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, var(--yellow), var(--orange)); transition: width .2s; }
.goal .pb .tick { position: absolute; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); }
.goal .pb .tick svg { width: 100%; height: 100%; }
.hud-coins { height: 32px; font-size: 16px; }
.hud-coins svg { width: 24px; height: 24px; }
.speedo { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--sab)); font-weight: 900; font-size: 30px; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.speedo small { display: block; font-size: 12px; opacity: .85; }
.combo { position: absolute; left: 50%; top: 22%; transform: translate(-50%, 0); text-align: center; pointer-events: none; transition: opacity .2s; opacity: 0; white-space: nowrap; }
.combo.on { opacity: 1; }
.combo .cp { font-weight: 900; font-size: clamp(30px, 8vmin, 54px); line-height: 1; font-variant-numeric: tabular-nums; }
.combo .cm { display: inline-block; margin-top: 4px; font-weight: 900; font-size: 20px; padding: 2px 12px; border-radius: 99px; background: var(--yellow); color: var(--ink); box-shadow: 0 3px 0 var(--yellow2); transition: transform .15s; }
.combo .cm.bump { transform: scale(1.35); }
.combo .cbar { height: 6px; width: 120px; margin: 6px auto 0; border-radius: 99px; background: rgba(255,255,255,.3); overflow: hidden; }
.combo .cbar i { display: block; height: 100%; width: 0%; background: #fff; border-radius: 99px; }
.combo.lost .cp { color: #ff6b6b; }
.pops { position: absolute; left: 0; right: 0; top: 46%; height: 0; pointer-events: none; }
.pop { position: absolute; left: 50%; transform: translate(-50%, 0); width: max-content; max-width: calc(100vw - 32px); text-align: center; line-height: 1.1; font-weight: 900; font-size: 26px; animation: popUp 1.1s ease-out forwards; }
.pop.big { font-size: clamp(28px, 8.4vw, 36px); color: var(--yellow); }
.pop.bad { color: #ff6b6b; }
.pop.cyan { color: #7fe6ff; }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 30% { transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
.banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-weight: 900; font-style: italic; font-size: clamp(48px, 15vmin, 110px); pointer-events: none; white-space: nowrap; opacity: 0; }
.banner.show { animation: bannerIn .8s cubic-bezier(.2,1.4,.4,1) forwards; }
.banner.go { color: var(--yellow); }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.8); } }
.roam-score { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* touch controls */
/* classic: four buttons on a thumb arc (the inner button of each pair sits higher), slightly see-through */
.ctl { position: absolute; bottom: calc(14px + var(--sab)); display: flex; gap: 14px; align-items: flex-end; pointer-events: auto; touch-action: none; }
.ctl.l { left: calc(14px + var(--sal)); }
.ctl.r { right: calc(14px + var(--sar)); }
.cb { width: var(--cbtn); height: var(--cbtn); border-radius: 28px; background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 0 rgba(0,0,0,.2); transition: transform .06s, background .06s, opacity .1s; touch-action: none; opacity: .88; }
.cb svg { width: 46%; height: 46%; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); }
.cb.down { transform: translateY(4px) scale(.95); background: rgba(255,255,255,.45); box-shadow: 0 2px 0 rgba(0,0,0,.25); opacity: 1; }
.ctl.l .sr, .ctl.r .brake { margin-bottom: calc(var(--cbtn) * .3); }
.cb.gas { height: calc(var(--cbtn) * 1.3); background: rgba(70,220,140,.38); border-color: rgba(190,255,215,.75); }
.cb.gas.down { background: rgba(70,220,140,.7); }
.cb.brake { background: rgba(255,90,90,.34); border-color: rgba(255,200,200,.75); }
.cb.brake.down { background: rgba(255,90,90,.65); }
.ctl.hidden, .ez.hidden { display: none; }
/* easy / tilt: the whole screen is the steering surface; only subtle side arrows and the DRIFT button show */
.ez { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
.ez-zone { position: absolute; top: 0; bottom: 0; width: 50%; opacity: 0; transition: opacity .12s; pointer-events: none; }
.ez-zone.l { left: 0; background: linear-gradient(90deg, rgba(255,255,255,.2), rgba(255,255,255,0) 45%); }
.ez-zone.r { right: 0; background: linear-gradient(270deg, rgba(255,255,255,.2), rgba(255,255,255,0) 45%); }
.ez-zone.on { opacity: 1; }
.ez-zone.l.brk { background: linear-gradient(90deg, rgba(255,70,70,.28), rgba(255,70,70,0) 45%); }
.ez-zone.r.brk { background: linear-gradient(270deg, rgba(255,70,70,.28), rgba(255,70,70,0) 45%); }
.ez-side { position: absolute; bottom: calc(var(--dbtn) + 46px + var(--sab)); width: 40px; height: 64px; border-radius: 20px; background: rgba(20,24,52,.28); display: flex; align-items: center; justify-content: center; opacity: .4; transition: opacity .1s, transform .1s; pointer-events: none; }
.ez-side svg { width: 26px; height: 26px; }
.ez-side.l { left: calc(8px + var(--sal)); }
.ez-side.r { right: calc(8px + var(--sar)); }
.ez-side.on { opacity: 1; transform: scale(1.12); }
.ez-btn { position: absolute; bottom: calc(16px + var(--sab)); border-radius: 50%; display: flex; align-items: center; justify-content: center; pointer-events: none; transition: transform .06s, background .06s, opacity .1s; opacity: .9; }
.ez-drift { right: calc(16px + var(--sar)); width: var(--dbtn); height: var(--dbtn); background: radial-gradient(circle at 50% 32%, rgba(255,160,80,.62), rgba(255,95,40,.42)); border: 3px solid rgba(255,225,195,.85); box-shadow: 0 6px 0 rgba(120,40,0,.3); }
.ez-drift span { font-weight: 900; font-style: italic; font-size: calc(var(--dbtn) * .2); letter-spacing: .5px; color: #fff; text-shadow: 0 2px 0 rgba(120,40,0,.55); max-width: 92%; overflow: hidden; white-space: nowrap; }
:lang(es) .ez-drift span { font-size: calc(var(--dbtn) * .15); }
.ez-drift.down { transform: translateY(4px) scale(.94); background: radial-gradient(circle at 50% 32%, rgba(255,175,95,.9), rgba(255,105,45,.75)); box-shadow: 0 2px 0 rgba(120,40,0,.3); opacity: 1; }
.ez-brake { display: none; left: calc(16px + var(--sal)); width: var(--cbtn); height: var(--cbtn); background: rgba(255,90,90,.34); border: 3px solid rgba(255,200,200,.75); box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.ez-brake svg { width: 46%; height: 46%; }
.ez-brake.down { transform: translateY(4px) scale(.95); background: rgba(255,90,90,.65); opacity: 1; }
.ez.tilt .ez-brake { display: flex; }
.ez.tilt .ez-zone { display: none; }
.ez.tilt .ez-side { opacity: .35; }

/* tutorial */
.tut { position: absolute; inset: 0; pointer-events: none; }
.tut .line { position: absolute; left: 50%; bottom: calc(var(--cbtn) * 1.3 + 40px + var(--sab)); transform: translateX(-50%); max-width: calc(100% - 24px); background: rgba(20,24,52,.78); padding: 9px 18px; border-radius: 99px; font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: fadeUp .35s ease-out; }
.tut .hand { position: absolute; width: 64px; height: 64px; margin: -6px 0 0 -18px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); transition: left .35s ease, top .35s ease; }
.tut .hand.press { animation: press 1s ease-in-out infinite; }
.tut .hand.hold { animation: hold 1.4s ease-in-out infinite; }
/* easy / tilt: the line sits above the side arrows and the DRIFT button */
#ui[data-scheme="easy"] .tut .line, #ui[data-scheme="tilt"] .tut .line { bottom: calc(var(--dbtn) + 124px + var(--sab)); }
.tut .hand.h2 { animation-delay: .35s; }
.tut .tilt-ic { position: absolute; left: 50%; top: 52%; width: 84px; height: 84px; margin: -42px 0 0 -42px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); animation: tiltRock 1.8s ease-in-out infinite; }
@keyframes tiltRock { 0%, 100% { transform: rotate(-22deg); } 50% { transform: rotate(22deg); } }
@keyframes press { 0%, 100% { transform: translateY(-14px) scale(1); } 40%, 60% { transform: translateY(0) scale(.92); } }
@keyframes hold { 0% { transform: translateY(-14px); } 25%, 85% { transform: translateY(0) scale(.92); } 100% { transform: translateY(-14px); } }
.tut .keys { position: absolute; left: 50%; bottom: calc(76px + var(--sab)); transform: translateX(-50%); display: flex; gap: 8px; align-items: flex-end; }
.key { min-width: 48px; height: 48px; padding: 0 10px; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 900; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 #b7bfdc; }
.key.hl { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow2); animation: keyPress 0.9s ease-in-out infinite; }
.key.wide { min-width: 130px; }
@keyframes keyPress { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); box-shadow: 0 1px 0 var(--yellow2); } }
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tut.desk .line { bottom: calc(140px + var(--sab)); }

/* result extras inside the SDK card */
.rx { margin-top: 2px; }
.rx-stars { display: flex; justify-content: center; gap: 6px; margin: 2px 0 8px; }
.rx-stars svg { width: 46px; height: 46px; opacity: 0; transform: scale(.3); }
.rx-stars svg.in { animation: starIn .45s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes starIn { to { opacity: 1; transform: scale(1); } }
.rx-coins { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 900; font-size: 20px; color: #1d2340; }
.rx-coins svg { width: 26px; height: 26px; }
.rx-ad { display: flex; align-items: center; justify-content: center; gap: 8px; }
.rx-ad svg { width: 22px; height: 22px; }

/* compact phones and short landscape */
@media (max-height: 460px) {
  #title .logo { top: calc(4% + var(--sat)); }
  #title .logo span { font-size: clamp(40px, 13vh, 64px); }
  .play { height: 62px; font-size: 26px; min-width: 210px; }
  .round .ic { width: 52px; height: 52px; border-radius: 17px; }
  .round .ic svg { width: 30px; height: 30px; }
  #title .bottom { flex-direction: row; justify-content: center; align-items: flex-end; gap: 22px; }
  .combo { top: 18%; }
  .tut .line, #ui[data-scheme] .tut .line { top: auto; bottom: calc(var(--cbtn) * 1.3 + 30px + var(--sab)); max-width: calc(100% - 120px); font-size: 16px; }
  .tut.desk .line { bottom: auto; top: calc(80px + var(--sat)); }
  .tut .keys { bottom: calc(20px + var(--sab)); }
  #hud .goal { padding: 6px 10px 8px; }
}
@media (max-width: 360px) {
  .play { min-width: 200px; font-size: 26px; height: 66px; }
  .round { width: 74px; font-size: 12px; }
  .goal .gt { font-size: 13px; }
  .goal .tm { font-size: 19px; }
  .pill { font-size: 16px; height: 34px; }
  .pill svg { width: 24px; height: 24px; }
}
.gline { position: absolute; left: 50%; top: calc(40% + clamp(40px, 10vmin, 72px)); transform: translateX(-50%); max-width: calc(100% - 24px); background: rgba(20,24,52,.78); padding: 9px 18px; border-radius: 99px; font-weight: 900; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; }
.gline.show { animation: gline 3.6s ease forwards; }
@keyframes gline { 0% { opacity: 0; transform: translate(-50%, 12px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
.touch .speedo { display: none; }
@media (min-width: 700px) { .touch .speedo { display: block; } }

@media (max-width: 360px) { .sheet-title { font-size: 17px; } .sheet-head .pill { font-size: 15px; padding-right: 10px; } .lv-grid { gap: 8px; } }
@media (max-height: 440px) {
  .rx-stars { margin: 0 0 2px; } .rx-stars svg { width: 30px; height: 30px; }
  .rx-coins { font-size: 17px; } .rx-coins svg { width: 22px; height: 22px; }
  .pops { top: 50%; }
}

@media (max-width: 400px) { .gline { font-size: 15px; padding: 8px 14px; white-space: normal; text-align: center; width: max-content; line-height: 1.2; } .tut .line { font-size: 15px; white-space: normal; text-align: center; width: max-content; line-height: 1.2; border-radius: 18px; } }

@media (max-width: 330px) { .sheet-head .pill svg { display: none; } .sheet-head .pill { padding-left: 10px; } }
@media (max-height: 360px) {
  .rx-card h2 { margin-bottom: 4px; }
  .rx-card .pp-big { font-size: 30px; margin: 0; }
  .rx-card .pp-sub { margin-bottom: 4px; }
  .rx-card.win .pp-b.sec { display: inline-block; width: calc(50% - 4px); vertical-align: top; }
  .rx-card.win .pp-b.sec + .pp-b.sec { margin-left: 8px; }
  .rx-card.win .rx-ad { width: 100%; display: flex; }
}

/* control scheme picker inside the SDK pause card */
.dr-ctl { margin-top: 12px; text-align: left; grid-column: 1 / -1; }
.dr-ctl-h { font-weight: 800; }
.dr-seg { display: flex; gap: 6px; margin-top: 6px; }
.dr-seg button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 4px; border: 0; border-radius: 12px; font: inherit; font-weight: 900; font-size: 15px; cursor: pointer; background: #e3e7f5; color: #59607e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-seg button.on { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange2); }
.dr-ctl-d { margin-top: 6px; font-size: 13px; font-weight: 700; color: #6a7193; line-height: 1.25; }
@media (max-height: 440px) { .dr-ctl { margin-top: 8px; } .dr-ctl-d { margin-top: 4px; } }
/* short landscape: the controls picker sits in the free cell beside Menu, the long description is dropped */
@media (max-height: 440px) and (min-width: 560px) { .dr-ctl { grid-column: auto; margin-top: 6px; } .dr-ctl-h { font-size: 13px; line-height: 1.1; } .dr-seg { margin-top: 3px; } .dr-seg button { font-size: 14px; } .dr-ctl-d { display: none; } }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
