/* Taxi Express 2 — marcador y pantallas. Claro, colorido y legible sobre la ciudad; botones sólidos (sin degradados). */
@font-face { font-family: 'Lilita One'; src: url('/games/_vendor/fonts/lilita-one-latin.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Lilita One'; src: url('/games/_vendor/fonts/lilita-one-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F; font-display: block; }
@font-face { font-family: 'Inter'; src: url('/games/_vendor/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #1b2140; --paper: #fffdf8; --taxi: #ffc21a; --pink: #ff4d8d; --mint: #2ed39a; --sky: #2fb8ff; --violet: #8c6cf0; --orange: #ff8a3d; --red: #ff4d5e;
  --soft: #8a7f86; --show: 'Lilita One', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --lift: 0 6px 18px rgba(30, 16, 60, .28);
  --sb: max(14px, env(safe-area-inset-bottom)); --st: max(12px, env(safe-area-inset-top)); --sx: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ffb27a; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
body { font-family: 'Inter', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif; color: var(--ink); }
button { font: inherit; color: inherit; }
svg { display: block; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }

/* ---------------------------------------------------------------- Marcador */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; transition: opacity .25s; }
.hud.hide { opacity: 0; visibility: hidden; }
.hud.hide * { pointer-events: none !important; }
.layer { position: absolute; inset: 0; overflow: hidden; }
.top { position: absolute; top: var(--st); left: var(--sx); right: var(--sx); display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; }
.pill { background: var(--paper); border-radius: 18px; padding: 8px 14px 9px; box-shadow: var(--lift); min-width: 104px; }
.pill small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.pill b { display: block; font-family: var(--show); font-weight: 400; font-size: 30px; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill.score { justify-self: start; }
.pill.score b::before { content: ''; display: inline-block; width: 22px; height: 22px; margin-right: 6px; vertical-align: -2px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0 0 18%, #ffcf3a 19% 60%, #f29f05 61%); box-shadow: inset 0 -2px 0 #c97a00; }
.pill.streak { justify-self: end; text-align: right; position: relative; }
.pill.streak b { color: var(--violet); }
.pill.streak[data-hot="1"] b { color: var(--orange); }
.pill.streak[data-hot="2"] b { color: var(--pink); }
.pill.streak[data-hot="3"] { background: var(--pink); }
.pill.streak[data-hot="3"] b, .pill.streak[data-hot="3"] small { color: #fff; }
.pips { display: flex; justify-content: flex-end; gap: 3px; margin-top: 4px; }
.pips i { width: 15px; height: 5px; border-radius: 5px; background: rgba(27, 33, 64, .14); transition: background-color .2s; }
.pips i.on { background: var(--violet); }
[data-hot="1"] .pips i.on { background: var(--orange); }
[data-hot="2"] .pips i.on { background: var(--pink); }
[data-hot="3"] .pips i.on { background: #fff; }
.mid { position: relative; }
.pill.time { min-width: 108px; text-align: center; padding: 6px 16px 8px; }
.pill.time b { font-size: 38px; }
.pill.time.hot { background: var(--red); color: #fff; animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.06); } }

/* Los números cambian mucho: cada parte del marcador se coloca aparte, sin recolocar el resto de la página. */
.pill, .nav, .gauge, .kmh b, .seat, .seat .info, .pad, .tag .in, .helper, .receipt { contain: layout style; }
.kmh b, .nav b { contain: strict; }
.kmh b { height: 1em; }

/* Próxima parada */
.nav { --c: var(--taxi); position: absolute; left: 50%; top: calc(100% + 8px); display: flex; align-items: center; gap: 7px; background: var(--ink); color: #fff; border-radius: 14px; padding: 5px 7px 5px 10px; box-shadow: var(--lift); opacity: 0; transform: translate(-50%, -6px); transition: opacity .2s, transform .2s; white-space: nowrap; }
.nav.on { opacity: 1; transform: translateX(-50%); }
.nav svg { width: 18px; height: 18px; }
.nav .go { color: var(--c); }
.nav .what { font-size: 13px; font-weight: 700; }
.nav b { font-family: var(--show); font-weight: 400; font-size: 19px; width: 62px; height: 24px; line-height: 24px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav .side { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--c); color: var(--ink); }
.nav[data-side="l"] .side { order: -1; }
.nav[data-side="l"] { padding: 5px 12px 5px 7px; }
.nav.hot .side { animation: nudgeR .4s ease-in-out infinite alternate; }
.nav.hot[data-side="l"] .side { animation-name: nudgeL; }
@keyframes nudgeR { to { transform: translateX(5px) scale(1.08); } }
@keyframes nudgeL { to { transform: translateX(-5px) scale(1.08); } }

.corner { pointer-events: auto; position: absolute; top: calc(var(--st) + 88px); right: var(--sx); width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: var(--lift); display: grid; place-items: center; cursor: pointer; }
.corner svg { width: 22px; height: 22px; }
.corner:active { transform: scale(.94); }

/* Nombre de la zona */
.banner { --c: var(--sky); position: absolute; left: 50%; top: calc(var(--st) + 116px); padding: 7px 20px 8px; border-radius: 14px; background: var(--c); color: #fff; font-family: var(--show); font-size: 22px; letter-spacing: .02em; white-space: nowrap; box-shadow: var(--lift); opacity: 0; transform: translateX(-50%); }

/* ---------------------------------------------------------------- Abajo: velocímetro, asientos y pedales */
.dock { position: absolute; left: var(--sx); right: var(--sx); bottom: var(--sb); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 14px; }
.gauge { justify-self: start; position: relative; width: 168px; aspect-ratio: 120 / 108; }
.gauge::before { content: ''; position: absolute; left: 6.67%; right: 6.67%; top: 1.85%; aspect-ratio: 1; border-radius: 50%; background: rgba(27, 33, 64, .9); box-shadow: var(--lift); }
.gauge > svg { position: relative; width: 100%; height: 100%; }
.gauge > svg path { fill: none; stroke-linecap: butt; stroke-width: 9; }
.gauge > svg .g0 { stroke: #55608c; }
.gauge > svg .g2 { stroke: #a87700; }
.gauge > svg .g3 { stroke: #a3235b; }
.gauge > svg .gv { stroke: #fff; stroke-width: 9; }
.gauge[data-x="2"] > svg .gv { stroke: var(--taxi); }
.gauge[data-x="3"] > svg .gv { stroke: var(--pink); }
.kmh { position: absolute; left: 0; right: 0; top: 28%; text-align: center; color: #fff; }
.kmh b { display: block; font-family: var(--show); font-weight: 400; font-size: 42px; line-height: 1; font-variant-numeric: tabular-nums; }
.kmh small { font-size: 11px; font-weight: 700; color: #b9c2ea; }
.mult { position: absolute; left: 50%; bottom: 0; margin-left: -32px; width: 64px; text-align: center; border-radius: 13px; padding: 2px 0 3px; background: #55608c; color: #fff; font-family: var(--show); font-size: 25px; line-height: 1.15; }
.gauge[data-x="2"] .mult { background: var(--taxi); color: var(--ink); }
.gauge[data-x="3"] .mult { background: var(--pink); }
.dmg { position: absolute; left: 100%; bottom: 4px; margin-left: -8px; display: flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 12px; background: var(--red); color: #fff; box-shadow: var(--lift); transition: opacity .2s; }
.dmg[data-n="0"] { opacity: 0; }
.dmg[data-n="3"] { animation: pulse .25s ease-in-out infinite alternate; }
.dmg svg { width: 17px; height: 17px; }
.dmg i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.dmg i.on { background: #fff; }

.seats { display: flex; gap: 8px; justify-content: center; }
.seat { --c: var(--mint); position: relative; width: 158px; height: 66px; background: var(--paper); border-radius: 18px; box-shadow: var(--lift), inset 0 0 0 3px var(--c); padding: 8px 10px 8px 9px; display: flex; align-items: center; gap: 8px; }
.seat.new { animation: seatIn .35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes seatIn { from { transform: translateY(24px) scale(.8); opacity: 0; } }
.seat.wide { width: 324px; }
.seat.free { width: 66px; justify-content: center; background: rgba(27, 33, 64, .55); box-shadow: none; color: rgba(255, 255, 255, .8); }
.seat.free svg { width: 26px; height: 26px; }
.seat.free.gone { display: none; }
.seat .face { width: 46px; height: 46px; border-radius: 13px; flex: none; background: #ffe7b0 center / cover no-repeat; }
.seat .info { min-width: 0; flex: 1; }
.seat .who { font-size: 11px; font-weight: 700; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .dist { display: flex; align-items: center; gap: 4px; font-family: var(--show); font-size: 20px; line-height: 1.15; white-space: nowrap; }
.seat .dist b { font-weight: 400; font-variant-numeric: tabular-nums; }
.seat .dist i { color: var(--c); }
.seat .dist svg { width: 18px; height: 18px; }
.seat .dist i:empty { display: none; }
.seat.msg .dist { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 13px; color: #138a63; padding: 3px 0; }
.seat.close:not(.msg) { animation: pulse .4s ease-in-out 6 alternate; }
.seat .tipbar { height: 7px; border-radius: 9px; background: #ece4df; margin-top: 3px; overflow: hidden; }
.seat .tipbar i { display: block; height: 100%; transform: scaleX(.5); transform-origin: 0 50%; background: var(--mint); }
.seat .fare { position: absolute; left: 32px; bottom: 4px; transform: translateX(-50%); padding: 1px 6px 2px; border-radius: 8px; background: var(--ink); color: #fff; font-family: var(--show); font-size: 13px; line-height: 1.15; }
.seat.vip { background: #fff3cf; }
.seat.half .who { color: var(--red); }
.seat.half .tipbar { visibility: hidden; }

/* Pedales */
.pads { justify-self: end; display: flex; align-items: flex-end; gap: 10px; }
.pad { pointer-events: auto; position: relative; width: 78px; height: 78px; border-radius: 24px; border: 0; display: grid; place-items: center; align-content: center; gap: 2px; color: #fff; cursor: pointer; touch-action: none; background: var(--k); box-shadow: 0 7px 0 var(--kd), var(--lift); transition: transform .07s, box-shadow .07s; }
.pad svg { width: 32px; height: 32px; }
.pad em { font-style: normal; font-family: var(--show); font-size: 14px; line-height: 1; }
.pad kbd { position: absolute; right: -5px; top: -8px; min-width: 23px; height: 23px; border-radius: 7px; background: var(--paper); color: var(--ink); font: 800 13px/23px 'Inter', sans-serif; text-align: center; box-shadow: 0 2px 6px rgba(30, 16, 60, .35); }
.pad kbd svg { width: 23px; height: 23px; padding: 3px; }
.pad.on, .pad:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--kd), 0 4px 10px rgba(30, 16, 60, .3); }
.pad.gas { --k: #22b573; --kd: #137549; }
.pad.gas.on { --k: #38d98f; }
.pad.brake { --k: var(--red); --kd: #a81b2d; }
.pad.brake.on { --k: #ff7683; }
.pad.turbo { --k: #55608c; --kd: #37406a; border-radius: 50%; }
.pad.turbo .ring { --p: inherit; position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(var(--sky) var(--p, 0%), rgba(27, 33, 64, .55) 0); -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(closest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.pad.turbo.ready { --k: var(--orange); --kd: #b8500f; animation: pulse .45s ease-in-out 8 alternate; }
.pad.turbo.on { --k: var(--pink); --kd: #a3235b; }
.hud.auto .pad.gas { display: none; }

/* ---------------------------------------------------------------- Mensajes */
.pops { position: absolute; left: 0; right: 0; top: max(24%, calc(var(--st) + 162px)); display: grid; justify-items: center; gap: 8px; }
.pop { font-family: var(--show); font-size: clamp(30px, 6.4vmin, 58px); line-height: 1; color: #fff; text-align: center; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; animation: popIn 1.1s cubic-bezier(.2, 1.4, .4, 1) forwards; max-width: 94vw; }
.pop span { margin-left: .3em; color: var(--taxi); }
.pop.gold { color: var(--taxi); } .pop.mint { color: #5df0b8; } .pop.pink { color: #ff7fb0; } .pop.sky { color: #6fd3ff; } .pop.violet { color: #c3afff; } .pop.red { color: #ff7683; }
.pop.small { font-size: clamp(21px, 4.2vmin, 36px); -webkit-text-stroke-width: 6px; }
@keyframes popIn { 0% { transform: scale(.3) translateY(20px); opacity: 0; } 14% { transform: scale(1.14); opacity: 1; } 24% { transform: scale(1); } 78% { opacity: 1; transform: translateY(-6px); } 100% { opacity: 0; transform: translateY(-28px) scale(.96); } }
.receipt { position: absolute; left: 50%; top: 33%; transform: translateX(-50%); text-align: center; opacity: 0; width: max-content; max-width: 94vw; }
.receipt b { font-family: var(--show); font-weight: 400; font-size: clamp(46px, 10vmin, 86px); line-height: 1; color: var(--taxi); -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; }
.receipt em { display: block; font-style: normal; font-family: var(--show); font-size: clamp(22px, 4.6vmin, 40px); line-height: 1.1; color: #5df0b8; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.receipt p { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 6px 0 0; }
.receipt span { background: var(--paper); border-radius: 10px; padding: 4px 9px; font-size: 13px; font-weight: 700; }
.receipt span.x { background: var(--violet); color: #fff; }
.float { position: absolute; transform: translate(-50%, -50%); font-family: var(--show); font-size: clamp(19px, 3.6vmin, 30px); color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; white-space: nowrap; animation: floatUp .9s ease-out forwards; }
.float.gold { color: var(--taxi); } .float.sky { color: #6fd3ff; } .float.mint { color: #5df0b8; } .float.pink { color: #ff7fb0; font-size: clamp(22px, 4.4vmin, 38px); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); } 15% { opacity: 1; transform: translate(-50%, -50%); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, calc(-50% - 74px)); } }
.vignette { position: absolute; inset: 0; transition: box-shadow .3s; }
.vignette.hot { box-shadow: inset 0 0 90px 12px rgba(255, 60, 80, .5); }
.hurt { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 60, 80, 0) 35%, rgba(255, 45, 70, .75)); }
.hurt.good { background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 40%, rgba(255, 226, 122, .7)); }
.hurt.boost { background: radial-gradient(ellipse at center, rgba(80, 200, 255, 0) 45%, rgba(80, 200, 255, .6)); }

.helper { position: absolute; left: 50%; top: 46%; transform: translate(-50%, 8px); opacity: 0; transition: opacity .2s, transform .2s; font-family: var(--show); font-size: 23px; line-height: 1.15; color: #fff; padding: 9px 20px 10px; border-radius: 16px; background: var(--ink); text-align: center; width: max-content; max-width: 92vw; }
.helper.on { opacity: 1; transform: translate(-50%, 0); }
.helper.red { background: var(--red); }
.helper.gold { background: var(--taxi); color: var(--ink); }
.helper.sky { background: var(--sky); color: var(--ink); }

.steer { position: absolute; left: var(--x0); top: var(--y); width: 0; height: 0; opacity: 0; transition: opacity .15s; }
.steer.on { opacity: .85; }
.steer i { position: absolute; left: -84px; top: -5px; width: 168px; height: 10px; border-radius: 10px; background: rgba(255, 255, 255, .45); }
.steer b { position: absolute; left: -23px; top: -23px; width: 46px; height: 46px; border-radius: 50%; background: #fff; box-shadow: var(--lift); transform: translateX(var(--dx, 0)); }

/* Etiquetas y globos en la calle */
.tag { --c: var(--taxi); position: absolute; left: 0; top: 0; width: 0; height: 0; transition: opacity .2s; will-change: transform; }
.tag .in { position: absolute; left: 0; bottom: 7px; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; width: max-content; font-family: var(--show); font-size: 19px; line-height: 1.1; color: var(--ink); background: var(--c); border-radius: 13px; padding: 5px 11px 6px; box-shadow: var(--lift); }
.tag::after { content: ''; position: absolute; left: -7px; bottom: 0; border: 7px solid transparent; border-bottom: 0; border-top-color: var(--c); }
.tag i { display: flex; }
.tag b { font-weight: 400; font-variant-numeric: tabular-nums; }
.tag b:empty { display: none; }
.tag svg { width: 18px; height: 18px; }
.tag.full { opacity: .6; }
.tag.ped .in { padding: 6px 7px; }
.tag.ped svg { width: 26px; height: 26px; }
.bubble { background: #fff; color: var(--ink); border-radius: 15px; padding: 7px 12px 8px; font-size: 14.5px; line-height: 1.2; font-weight: 700; box-shadow: var(--lift); text-align: center; width: max-content; max-width: 210px; text-wrap: balance; }
.bubble { position: absolute; left: 0; top: 0; translate: -50% calc(-100% - 12px); animation: sayIn .25s cubic-bezier(.3, 1.6, .5, 1); }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #fff; }
.crew { position: relative; }
.speech { --c: var(--mint); position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 2; display: flex; align-items: center; gap: 8px; width: max-content; max-width: min(88vw, 330px); padding: 5px 14px 5px 5px; border-radius: 18px; background: #fff; box-shadow: var(--lift), inset 0 0 0 3px var(--c); font-size: 15px; line-height: 1.2; font-weight: 700; opacity: 0; }
.speech i { flex: none; width: 38px; height: 38px; border-radius: 14px; background: #ffe7b0 center / cover no-repeat; }
@keyframes sayIn { from { opacity: 0; scale: .5; } }

/* ---------------------------------------------------------------- Pantallas */
.screen { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); transition: opacity .3s, visibility .3s; overflow: auto; touch-action: pan-y; }
.screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.screen.veil { background: rgba(27, 33, 64, .62); z-index: 12; }
.count-screen { pointer-events: none; overflow: hidden; }
.card { width: min(460px, 100%); background: var(--paper); border-radius: 28px; padding: 22px 20px 20px; text-align: center; box-shadow: 0 24px 60px rgba(30, 16, 60, .45); animation: cardIn .45s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes cardIn { from { transform: translateY(30px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 18px; padding: 14px 28px 15px; font-family: var(--show); font-size: 24px; line-height: 1.1; color: var(--ink); background: var(--taxi); box-shadow: 0 7px 0 #c98f00; cursor: pointer; transition: transform .08s, box-shadow .08s; min-width: 200px; }
.btn:hover { background: #ffcd42; }
.btn:active { transform: translateY(5px); box-shadow: 0 2px 0 #c98f00; }
.btn.alt { background: #e9e0da; box-shadow: 0 7px 0 #c5b8af; min-width: 0; }
.btn.alt:active { box-shadow: 0 2px 0 #c5b8af; }
.round { flex: none; width: 58px; height: 58px; border: 0; border-radius: 18px; background: #e9e0da; color: var(--ink); box-shadow: 0 7px 0 #c5b8af; display: grid; place-items: center; cursor: pointer; }
.round:active { transform: translateY(5px); box-shadow: 0 2px 0 #c5b8af; }
.round svg { width: 30px; height: 30px; }
.btn:focus-visible, .round:focus-visible, .opts button:focus-visible, .corner:focus-visible { outline: 4px solid var(--sky); outline-offset: 3px; }
.play-row { display: flex; gap: 12px; padding-bottom: 7px; }
.play-row .btn { flex: 1; min-width: 0; font-size: 28px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.how div { background: #fff1d6; border-radius: 16px; padding: 10px 8px 11px; }
.how svg { width: 30px; height: 30px; margin: 0 auto 4px; color: #e09b00; }
.how div:nth-child(2) svg { color: #1aa87a; }
.how div:nth-child(3) svg { color: var(--pink); }
.how b { display: block; font-family: var(--show); font-weight: 400; font-size: 16px; line-height: 1.1; text-wrap: balance; }
.how p { margin: 5px 0 0; font-size: 12px; line-height: 1.32; color: #5f5562; text-wrap: pretty; }
.hint { font-size: 12.5px; line-height: 1.35; color: #6f6470; margin-top: 12px; text-wrap: balance; }
.count { font-family: var(--show); font-size: clamp(110px, 30vmin, 230px); line-height: 1; color: #fff; -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill; animation: countIn .9s cubic-bezier(.2, 1.4, .4, 1); }
.count.go { color: var(--taxi); }
@keyframes countIn { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }

.title-screen { display: flex; flex-direction: column; justify-content: space-between; align-items: center; }
.title-screen .logo-wrap { animation: cardIn .6s cubic-bezier(.2, 1.3, .4, 1); }
.title-screen .panel { padding: 16px 16px 14px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) and (min-height: 521px) {
  .title-screen { align-items: flex-start; justify-content: center; gap: 4vh; padding-left: 6vw; }
  .title-screen .logo-wrap { width: 460px; display: grid; justify-items: center; }
  .logo-img { width: min(440px, 50vh); }
  .results-screen { justify-items: start; padding-left: 6vw; }
}
.logo-img { display: block; width: min(84vw, 500px, 62vh); height: auto; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .4)); animation: logoFloat 3.4s ease-in-out infinite; }
.screen.hide .logo-img { animation: none; }         /* escondido, seguía moviéndose durante toda la partida */
@keyframes logoFloat { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }

.opts { display: grid; gap: 8px; margin: 14px 0 4px; }
.opts button { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 14px; background: #f3ece6; padding: 10px 12px 10px 16px; font-size: 16px; font-weight: 700; text-align: left; cursor: pointer; }
.opts i { flex: none; position: relative; width: 50px; height: 28px; border-radius: 28px; background: #bdb3c0; transition: background-color .2s; }
.opts i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.opts [aria-checked="true"] i { background: #22b573; }
.opts [aria-checked="true"] i::after { transform: translateX(22px); }
.row { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 16px; padding-bottom: 7px; }
.row .btn { min-width: 0; flex: 0 1 240px; padding-left: 14px; padding-right: 14px; font-size: clamp(19px, 5.8vw, 24px); }
.row .btn.alt { flex: 0 1 auto; }

.res-title { font-family: var(--show); font-size: 27px; line-height: 1.1; color: #e0316f; }
.big { font-family: var(--show); font-size: clamp(56px, 13vmin, 84px); line-height: 1; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.best { font-size: 14px; font-weight: 600; color: #6f6470; }
.best.new { color: #138a63; font-weight: 800; }
.rank { display: inline-flex; align-items: center; gap: 9px; margin: 2px 0 6px; padding: 6px 14px 7px; border-radius: 14px; background: #e6edf7; }
.rank[data-rank="1"] { background: #ffe3c4; } .rank[data-rank="2"] { background: #ffe79a; } .rank[data-rank="3"] { background: #e3d6ff; }
.rank span { display: flex; gap: 2px; }
.rank i { width: 20px; height: 20px; background: rgba(27, 33, 64, .18); clip-path: polygon(50% 2%, 63% 36%, 98% 38%, 70% 60%, 80% 95%, 50% 75%, 20% 95%, 30% 60%, 2% 38%, 37% 36%); }
.rank i.on { background: #f0930a; }
.rank[data-rank="3"] i.on { background: #7a4fe8; }
.rank b { font-family: var(--show); font-weight: 400; font-size: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 14px 0 0; }
.stats div { background: #fff1d6; border-radius: 14px; padding: 8px 4px 9px; }
.stats b { display: block; font-family: var(--show); font-weight: 400; font-size: 22px; line-height: 1.1; }
.stats em { font: 700 11px 'Inter', sans-serif; margin-left: 3px; }
.stats small { display: block; font-size: 11.5px; line-height: 1.2; color: #6f6470; font-weight: 700; text-wrap: balance; }

/* Duelo: puntaje comprobado por el servidor */
.verify { display: inline-flex; align-items: center; gap: 8px; margin: 2px auto 4px; font-size: 14px; font-weight: 700; color: #6f6470; }
.verify i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #e6dcd4; border-top-color: var(--violet); animation: verifySpin .8s linear infinite; flex: none; }
.verify.ok { color: #138a63; }
.verify.ok i { border: 0; animation: none; background: var(--mint); box-shadow: inset 0 0 0 3px #fff; }
.verify.bad { color: #d22a3d; }
.verify.bad i { border: 0; animation: none; background: var(--red); }
.duel-status { min-height: 1.3em; margin: 2px 4px 0; font-size: 15px; font-weight: 800; }
.duel-status.win { color: #138a63; } .duel-status.lose { color: #6f6470; } .duel-status.wait { color: #6b48d8; } .duel-status.bad { color: #d22a3d; }
@keyframes verifySpin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Pantallas estrechas (celular en vertical) */
@media (max-width: 760px) {
  .pill { min-width: 88px; padding: 6px 11px 8px; border-radius: 16px; }
  .pill b { font-size: 25px; }
  .pill.score b::before { width: 18px; height: 18px; margin-right: 5px; }
  .pill.time { min-width: 88px; padding: 5px 12px 7px; }
  .pill.time b { font-size: 31px; }
  .corner { top: calc(var(--st) + 78px); }
  .banner { top: calc(var(--st) + 104px); font-size: 19px; }
  .dock { grid-template-columns: 1fr auto; grid-template-areas: 'seats seats' 'gauge pads'; gap: 12px 8px; }
  .gauge { grid-area: gauge; width: 112px; }
  .kmh { top: 24%; }
  .kmh b { font-size: 27px; }
  .kmh small { font-size: 10px; line-height: 1; display: block; }
  .mult { width: 46px; margin-left: -23px; font-size: 18px; border-radius: 10px; }
  .gauge .dmg { left: 2px; bottom: 100%; margin: 0 0 6px; }
  .crew { grid-area: seats; }
  .seats { gap: 6px; }
  .seat { flex: 1 1 0; width: auto; max-width: 150px; height: 56px; padding: 6px 8px 6px 7px; gap: 6px; border-radius: 15px; }
  .seat.wide { flex: 2 1 0; width: auto; max-width: 306px; }
  .seat.free { flex: 0 1 56px; width: 56px; }
  .seat .face { width: 36px; height: 36px; border-radius: 10px; }
  .seat .who { display: none; }
  .seat.half .who { display: block; font-size: 10px; }
  .seat { min-width: 0; }
  .seat .dist { font-size: 17px; }
  .seat .dist i { position: absolute; right: -5px; top: -9px; padding: 3px; border-radius: 9px; background: var(--c); color: #fff; }
  .seat .dist svg { width: 16px; height: 16px; }
  .seat .fare { left: 25px; bottom: 2px; font-size: 11px; padding: 0 5px 1px; }
  .seat.msg .dist { font-size: 11px; white-space: normal; line-height: 1.05; }
  .pads { grid-area: pads; display: grid; grid-template-columns: auto auto; grid-template-areas: '. turbo' 'brake gas'; gap: 12px 10px; }
  .pad.turbo { grid-area: turbo; justify-self: end; width: 70px; height: 70px; margin-right: 5px; }
  .pad.brake { grid-area: brake; align-self: end; width: 76px; height: 76px; }
  .pad.gas { grid-area: gas; width: 84px; height: 92px; }
  .hud.auto .pad.brake { grid-area: gas; width: 88px; height: 92px; }
  .dock { align-items: end; }
  .seats { margin-right: 0; }
  .helper { font-size: 19px; top: 43%; }
  .receipt { top: 31%; }
  .how p { font-size: 11.5px; }
}
/* Los asientos no pueden quedar bajo el botón de turbo: van por encima de los pedales. */
@media (max-width: 360px) {
  .pill { min-width: 78px; padding: 6px 9px 7px; }
  .pill b { font-size: 22px; }
  .pill.time { min-width: 76px; }
  .pill.time b { font-size: 27px; }
  .nav .what { display: none; }
  .gauge { width: 98px; }
  .kmh b { font-size: 24px; }
  .pad.gas { width: 76px; }
  .pad.brake { width: 70px; }
  .nav b { width: 54px; font-size: 17px; }
  .seat { padding: 5px 6px 5px 5px; gap: 5px; }
  .seat .face { width: 30px; height: 30px; }
  .seat .fare { left: 20px; font-size: 10px; padding: 0 4px 1px; }
  .seat .dist { font-size: 15px; }
  .seat.half .who { font-size: 9px; }
  .how { gap: 6px; }
  .how b { font-size: 14px; }
  .how p { font-size: 11px; }
  .how div { padding: 8px 6px 9px; }
}
/* Celular en horizontal: todo más pequeño y en una fila */
@media (max-height: 520px) and (min-width: 560px) {
  .pill small { display: none; }
  .pill { padding: 5px 12px 6px; min-width: 84px; }
  .pill b { font-size: 24px; }
  .pill.time b { font-size: 26px; }
  .pill.time { padding: 4px 12px 5px; min-width: 84px; }
  .corner { top: calc(var(--st) + 58px); width: 40px; height: 40px; }
  .banner { display: none; }
  .dock { grid-template-columns: 1fr auto 1fr; grid-template-areas: 'gauge seats pads'; gap: 10px; }
  .crew { grid-area: seats; }
  .speech { padding: 3px 12px 3px 4px; font-size: 13px; }
  .speech i { width: 30px; height: 30px; border-radius: 11px; }
  .gauge { width: 112px; }
  .kmh { top: 24%; }
  .kmh b { font-size: 27px; }
  .kmh small { font-size: 10px; line-height: 1; display: block; }
  .mult { width: 46px; margin-left: -23px; font-size: 18px; }
  .seat { width: 112px; flex: none; height: 54px; padding: 6px 8px 6px 7px; gap: 6px; }
  .seat.wide { width: 230px; }
  .seat.free { width: 46px; }
  .seat .face { width: 36px; height: 36px; }
  .seat .who { display: none; }
  .seat .fare { left: 25px; bottom: 2px; font-size: 11px; padding: 0 5px 1px; }
  .seat .dist { font-size: 17px; }
  .seat .dist i { position: absolute; right: -5px; top: -9px; padding: 3px; border-radius: 9px; background: var(--c); color: #fff; }
  .seat .dist svg { width: 16px; height: 16px; }
  .pads { display: flex; gap: 10px; }
  .pad.turbo, .pad.brake, .pad.gas, .hud.auto .pad.brake { width: 66px; height: 66px; margin: 0; }
  .pad svg { width: 25px; height: 25px; }
  .pad em { font-size: 12px; }
  .pops { top: 24%; }
  .title-screen { align-items: flex-start; justify-content: center; gap: 8px; padding-left: max(28px, env(safe-area-inset-left)); }
  .title-screen .logo-wrap { width: min(380px, 48vw); display: grid; justify-items: center; }
  .logo-img { width: min(230px, 40vh); }
  .title-screen .panel { width: min(380px, 48vw); padding: 10px 12px; border-radius: 22px; }
  .how { margin-top: 10px; }
  .how div { padding: 6px; }
  .how svg { width: 24px; height: 24px; margin-bottom: 2px; }
  .how b { font-size: 14px; }
  .how p { display: none; }
  .hint { margin-top: 8px; font-size: 11.5px; }
  .play-row .btn { padding: 10px 20px 11px; font-size: 24px; }
  .round { width: 50px; height: 50px; }
  .card.res, .menu-card { padding: 12px 16px; width: min(640px, 100%); }
  .opts { grid-template-columns: 1fr 1fr; margin: 8px 0 0; }
  .opts button { padding: 7px 10px 7px 14px; font-size: 14px; }
  .screen { padding-top: 8px; padding-bottom: 8px; }
  .stats { grid-template-columns: repeat(5, 1fr); margin-top: 6px; gap: 5px; }
  .stats div { padding: 5px 4px 6px; }
  .stats b { font-size: 19px; }
  .big { font-size: 40px; margin: 0; }
  .row { margin-top: 10px; }
  .btn { font-size: 20px; padding: 10px 22px 11px; }
  .res-title { font-size: 21px; }
}
@media (max-height: 600px) and (max-width: 559px) {
  .menu-card { padding: 14px 16px 12px; }
  .opts { gap: 6px; margin-top: 10px; }
  .opts button { padding: 8px 10px 8px 14px; font-size: 15px; }
}
@media (max-height: 700px) and (max-width: 559px) {
  .logo-img { width: min(66vw, 300px); }
  .how p { display: none; }
  .stats small { font-size: 10.5px; }
  .big { font-size: 50px; }
}

@media (min-width: 1600px) and (min-height: 850px) {
  .top, .dock, .corner, .banner, .receipt, .pops, .helper, .card, .title-screen .logo-wrap { zoom: 1.25; }
  .tag .in { font-size: 23px; }
  .bubble { font-size: 18px; max-width: 260px; }
}
@media (min-width: 2400px) and (min-height: 1200px) {
  .top, .dock, .corner, .banner, .receipt, .pops, .helper, .card, .title-screen .logo-wrap { zoom: 1.6; }
  .tag .in { font-size: 30px; }
  .bubble { font-size: 23px; max-width: 340px; }
}

.calm .pop, .calm .count, .calm .card, .calm .float { animation-timing-function: ease-out; }
.calm .logo-img, .calm .pad.turbo.ready, .calm .seat.close:not(.msg), .calm .nav.hot .side, .calm .pill.time.hot { animation: none; }
