* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #8fd0ff;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Roboto, "Segoe UI", system-ui, sans-serif;   /* Roboto = Android; spec 009 */
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud, .overlay, #pedais { height: 100vh; height: 100dvh; bottom: auto; }
.hidden { display: none !important; }

/* ---------- Tela inicial ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(255,214,236,.25), rgba(255,79,163,.3)); }
.card { background: #fff; border-radius: 28px; padding: 20px 22px; text-align: center; max-width: 420px; width: 100%;
  max-height: 100%; overflow: auto; touch-action: pan-y; border: 5px solid #ff4fa3; box-shadow: 0 10px 30px rgba(194,24,91,.35);
  background-image: repeating-linear-gradient(45deg, #fff 0 14px, #fff5fa 14px 28px); }
.bigIcon { font-size: 64px; line-height: 1.1; }
h1 { margin: 8px 0 4px; font-size: 36px; color: #ff2d8f; text-shadow: 0 3px 0 #ffd1e6; }
.sub { margin: 0 0 16px; color: #8a4a6a; font-weight: 700; font-size: 17px; line-height: 1.4; }
.hint { color: #8a4a6a; font-size: 14px; margin: 14px 0 0; line-height: 1.5; }
button { font: inherit; font-size: 26px; font-weight: 900; color: #fff; background: linear-gradient(#ff6fb5, #ff2d8f);
  border: none; border-radius: 40px; padding: 14px 36px; box-shadow: 0 5px 0 #b3125f; cursor: pointer; }
button:active { transform: translateY(3px); box-shadow: 0 2px 0 #b3125f; }
.mute { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 16px; font-weight: 800; font-size: 14px;
  color: #8a4a6a; border: 2px solid #ffc1de; cursor: pointer; background: #fff; }
#fps { position: fixed; bottom: 4px; right: 6px; color: #fff; font: 700 12px monospace; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 8px; pointer-events: none; }

/* ---------- flash do radar e estrelinhas voando ---------- */
#flash { position: fixed; inset: 0; background: #fff; pointer-events: none; opacity: 0; }
#flash.pisca { animation: flash .55s ease-out; }
@keyframes flash { 0% { opacity: .95 } 100% { opacity: 0 } }
#voo { position: fixed; inset: 0; pointer-events: none; }
.voa.perde { color: #ff3b3b; text-shadow: 0 2px 0 #fff, 0 0 8px rgba(0,0,0,.45); }
.voa { position: fixed; transform: translate(0, 0); margin: -16px 0 0 -70px; width: 140px; white-space: nowrap; text-align: center; font-size: 28px; font-weight: 900;
  color: #ffd84d; text-shadow: 0 2px 0 #c2185b, 0 0 8px rgba(0,0,0,.4); transition: transform 1.1s cubic-bezier(.5,-0.3,.6,1), opacity 1.1s ease-in; }

/* ---------- relatório da viagem ---------- */
#relatorio { z-index: 5; background: rgba(255,79,163,.35); }
.card.rel { padding: 14px 16px 16px; text-align: left; }
.relTopo { display: flex; align-items: center; gap: 10px; }
.relTopo .bigIcon { font-size: 46px; }
.relTopo h2 { margin: 0; font-size: 24px; color: #ff2d8f; }
.relTopo .sub { margin: 2px 0 0; font-size: 15px; }
.relEstrelas { text-align: center; font-size: 40px; font-weight: 900; color: #ffb400; margin: 6px 0 4px; text-shadow: 0 2px 0 #ffe6a0; }
#relLista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
#relLista li { border-radius: 14px; padding: 6px 10px; font-weight: 800; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
#relLista li b { margin-left: auto; white-space: nowrap; }
#relLista li small.lin { flex-basis: auto; order: 0; font-size: 13px; }
#relLista li small { flex-basis: 100%; order: 3; font-weight: 700; color: #8a4a6a; font-size: 13px; }
#relLista li.ok { background: #e8fbe9; color: #1f7a35; }
#relLista li.multa, #relLista li.bat { background: #ffe8e8; color: #b3121b; }
.relTotal { margin-top: 10px; text-align: center; font-size: 21px; font-weight: 900; color: #b3121b; background: #fff0f0; border-radius: 16px; padding: 8px; border: 3px solid #ffc1c1; }
#relatorio.semMulta .relTotal { color: #1f7a35; background: #e8fbe9; border-color: #b8ecc0; }
.relTotal b { font-size: 25px; white-space: nowrap; }
.relCnh { text-align: center; margin: 8px 0 12px; font-weight: 800; color: #5a3a4a; font-size: 16px; line-height: 1.5; }
#relSusp.ruim { color: #b3121b; } #relSusp.bom { color: #1f7a35; }
.card.rel button { display: block; margin: 0 auto; font-size: 22px; padding: 12px 26px; }
.missao { margin: 0 0 8px; color: #e0157a; font-size: 18px; font-weight: 800; }

/* ---------- Pedais (spec 005): acelerador deslizante à direita, freio à esquerda ---------- */
#pedais { --f: 0; --lim: .57; --v: 0; --pad: 14px; position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.pedal .sola { position: relative; border-radius: 30px; transition: transform .07s ease-out, box-shadow .07s ease-out, filter .07s; }
.pedal .sola::after { content: ''; position: absolute; inset: 0; border: 4px solid #fff; border-radius: inherit; pointer-events: none; }
.pedal .nerv { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(to top, transparent 0 15px, rgba(120,0,60,.13) 15px 19px); }

/* acelerador */
#acelTrilho { position: absolute; inset: 0; background: linear-gradient(90deg, #fff0f7, #ffd9ea 55%, #ffc4df);
  box-shadow: 0 7px 0 #b3125f, 0 10px 18px rgba(0,0,0,.28); }
#acelFill { position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(to top, #ffa6d2 0, #ff3d9a calc(var(--pad) + var(--lim) * (100% - 2 * var(--pad))),
    #ff6060 calc(var(--pad) + var(--lim) * (100% - 2 * var(--pad))), #e8262f 100%);
  clip-path: inset(calc(var(--pad) + (1 - var(--f)) * (100% - 2 * var(--pad))) 0 0 0 round 16px 16px 30px 30px); }
#acelFaixa { position: absolute; left: -2px; right: -2px; height: 9px; transform: translateY(50%); border-radius: 5px;
  bottom: calc(var(--pad) + var(--lim) * (100% - 2 * var(--pad))); transition: bottom .35s ease-out;
  background: linear-gradient(#fff3a6, #ffcc1f 45%, #e6a300); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.3); z-index: 2; }
#acelLim { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); background: #ffd23f; color: #6b4200;
  font-weight: 900; font-size: 15px; line-height: 1; padding: 5px 8px; border-radius: 12px; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); text-shadow: none; }
#acelLim::after { content: ''; position: absolute; left: 100%; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left-color: #fff; }
#acelVel { position: absolute; left: 12px; right: 12px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.9);
  bottom: calc(var(--pad) + var(--v) * (100% - 2 * var(--pad))); transform: translateY(50%); box-shadow: 0 0 0 1px rgba(160,0,80,.35); z-index: 1; }
#acelPe { position: absolute; left: 50%; width: 62px; height: 62px; margin-left: -31px; z-index: 3;
  bottom: calc(var(--pad) + var(--f) * (100% - 2 * var(--pad))); transform: translateY(50%) scale(.8); opacity: 0;
  transition: opacity .1s, transform .1s; filter: drop-shadow(0 3px 3px rgba(120,0,60,.4)); }
#acelPe svg { width: 100%; height: 100%; display: block; }
#acelDica { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; color: #c2185b; font-weight: 900; font-size: 15px;
  line-height: 1.15; text-shadow: 0 1px 0 #fff; animation: dica 1.4s ease-in-out infinite; }
@keyframes dica { 0%, 100% { transform: translateY(6px) } 50% { transform: translateY(-10px) } }
#acelRot { position: absolute; left: 50%; top: -13px; transform: translateX(-50%) rotate(-3deg); background: #ff2d8f; color: #fff;
  font-weight: 900; font-size: 13px; letter-spacing: 1px; padding: 2px 9px; border-radius: 10px; border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.25); text-shadow: none; z-index: 4; white-space: nowrap; transition: transform .07s; }
/* afunda ao toque */
#acel.apertado #acelTrilho { transform: translateY(5px) scaleX(.95);
  box-shadow: 0 2px 0 #b3125f, 0 4px 8px rgba(0,0,0,.25), 0 0 18px 4px rgba(255,79,163,.45); }
#acel.apertado #acelRot { transform: translateX(-50%) translateY(5px) rotate(-3deg); }
#acel.apertado #acelPe { opacity: 1; transform: translateY(50%) scale(1); }
#acel.apertado #acelDica, #acel.usado #acelDica { display: none; }
#acel.acima #acelPe path { fill: #ffe1e1; stroke: #e8262f; }
#acel.acima #acelTrilho::after { border-color: #ffd0d0; animation: alerta .5s ease-in-out infinite alternate; }
@keyframes alerta { from { box-shadow: 0 0 0 0 rgba(232,38,47,.0) } to { box-shadow: 0 0 0 5px rgba(232,38,47,.55) } }

/* freio */
#freio .sola { position: absolute; inset: 0; background: radial-gradient(circle at 35% 25%, #ff9aa6, #ff4a5c 55%, #d81b2c);
  box-shadow: 0 7px 0 #8f0f1c, 0 10px 18px rgba(0,0,0,.28); }
#freio .nerv { background: repeating-linear-gradient(to top, transparent 0 13px, rgba(90,0,10,.14) 13px 17px); }
#freio .rot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #fff; text-shadow: 0 2px 0 #9b1020; }
#freio .ico { font-size: 38px; line-height: 1; text-shadow: none; filter: drop-shadow(0 2px 0 rgba(120,0,20,.45)); }
#freio b { font-size: 21px; font-weight: 900; letter-spacing: 1.5px; }
#freio.apertado .sola { transform: perspective(500px) rotateX(10deg) translateY(6px) scale(.95); filter: brightness(.9) saturate(1.15);
  box-shadow: 0 1px 0 #8f0f1c, 0 3px 6px rgba(0,0,0,.25), 0 0 0 7px rgba(255,90,110,.45), 0 0 22px 6px rgba(255,60,80,.5); }
#freio.apertado .sola::after { border-color: #ffe1e5; }
#freio.apertado .ico { animation: aperta .25s ease-out; }
@keyframes aperta { 0% { transform: scale(1) } 40% { transform: scale(1.25, .8) } 100% { transform: scale(1) } }

/* escolha do controle no menu */
.modo { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: #ffe3f0; border-radius: 22px; border: 2px solid #ffc1de; }
.modo span { padding: 7px 14px; border-radius: 18px; font-weight: 900; font-size: 17px; color: #8a4a6a; cursor: pointer; }
.modo span.on { background: linear-gradient(#ff6fb5, #ff2d8f); color: #fff; box-shadow: 0 3px 0 #b3125f; }

.setaBtn { pointer-events: auto; width: 46px; height: 46px; padding: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #ffd98a, #f5a623 60%, #d98400); border: 3px solid #fff;
  box-shadow: 0 4px 0 #9a5800, 0 6px 10px rgba(0,0,0,.25); filter: saturate(.75) brightness(.95); touch-action: none; }
.setaBtn svg { width: 27px; height: 27px; display: block; }
.setaBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #9a5800, 0 4px 8px rgba(0,0,0,.25); }
.setaBtn.ligada { filter: none; border-color: #fff3c4; }
.setaBtn.ligada.aceso { background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd000 55%, #ffae00);
  box-shadow: 0 5px 0 #9a5800, 0 0 0 5px rgba(255,200,0,.55), 0 0 22px 8px rgba(255,190,0,.75); }

/* =====================================================================================================================
   spec 008 — interface em 3 faixas: TOPO (placar + barra de GPS, ≤ 22% da altura) · MEIO livre (22–68%) · PAINEL (≥ 70%)
   Os avisos temporários (multa, dica, boas-vindas, indicadores do PARE) entram só no alto do meio (22% a 37%).
   ===================================================================================================================== */
:root { --sb: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-top, 0px); --m: 10px; --pedalW: clamp(66px, 20vw, 80px);
  --volW: min(146px, 37vw, 21dvh); --volPedW: clamp(60px, 17vw, 72px); --painelBase: calc(var(--sb) + 10px);
  --freioW: clamp(60px, 17vw, 72px); --freioH: clamp(96px, 15dvh, 120px); --vao: 12px; --setaT: 52px; }

/* ---------- topo: 1 linha fina ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; color: #fff; text-shadow: 0 2px 0 #c2185b, 0 0 6px rgba(0,0,0,.35); }
#topo { position: absolute; top: calc(var(--st) + 6px); left: 6px; right: 6px; display: flex; justify-content: center; align-items: center; gap: 5px; }
#missaoTxt { display: none; }
#placar { display: flex; gap: 5px; }
#placar span, #rumo { background: rgba(255,255,255,.92); color: #8a2a5a; text-shadow: none; font-weight: 900; font-size: 15px; line-height: 1;
  padding: 5px 8px; border-radius: 13px; box-shadow: 0 2px 5px rgba(0,0,0,.18); white-space: nowrap; transition: transform .15s; }
#placar span.pula { animation: pula .45s ease-out; }
#placar span.treme { animation: tremePlacar .5s ease-in-out; background: #ffe1e1; }
@keyframes tremePlacar { 0%, 100% { transform: translateX(0) } 20% { transform: translateX(-5px) rotate(-4deg) } 40% { transform: translateX(5px) rotate(4deg) }
  60% { transform: translateX(-4px) rotate(-2deg) } 80% { transform: translateX(3px) } }
@keyframes pula { 0% { transform: scale(1) } 35% { transform: scale(1.35) } 100% { transform: scale(1) } }
#rumo { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; }
#rumo small { font-size: 12px; }
#seta { position: relative; width: 21px; height: 21px; border-radius: 50%; background: #ff4fa3; flex: none; }
#seta svg { width: 100%; height: 100%; display: block; }
@media (max-width: 370px) { #placar span, #rumo { font-size: 13px; padding: 5px 6px; } #rumo { padding: 2px 6px 2px 3px; } #topo, #placar { gap: 4px; } }

/* ---------- barra única de GPS: conversão + próximo sinal + "curva!" (substitui balão, chips e o chip do pedal) ---------- */
#barra { position: absolute; top: calc(var(--st) + 40px); left: 6px; right: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 5px; }
#gps { background: #1a73e8; color: #fff; text-shadow: none; border: 2px solid #fff; border-radius: 14px; padding: 4px 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); font-weight: 900; font-size: 15px; line-height: 1.15; white-space: nowrap; max-width: 100%; animation: popB .35s ease-out; }
#gpsSub { color: #ffd23f; font-size: 14px; }
#gpsSub::before { content: '· '; color: #fff; }
#gps.ok { background: #1f9d55; }
#gps.ok #gpsSub { color: #fff; }
#proximo { display: flex; gap: 5px; }
.chip { background: rgba(255,255,255,.95); color: #5a2a4a; text-shadow: none; font-weight: 900; font-size: 15px; line-height: 1.15; padding: 4px 9px; border-radius: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,.2); border: 2px solid #8a909c; white-space: nowrap; }
.chip.vermelho { border-color: #e8262f; background: #ffe3e3; color: #a0101a; }
.chip.amarelo { border-color: #f2b705; background: #fff6d6; color: #7a5a00; }
.chip.verde { border-color: #1fae4b; background: #e3fbe8; color: #11672c; }
.chip.pare { border-color: #e8262f; }
#acelCurva { background: #fff; color: #c2185b; border: 2px solid #ff4fa3; font-weight: 900; font-size: 15px; line-height: 1.15; padding: 4px 9px; border-radius: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,.2); text-shadow: none; white-space: nowrap; animation: popB .3s ease-out; }
#acelCurva:not(.on) { display: none; }
@keyframes popB { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@media (max-width: 370px) { #gps, .chip, #acelCurva { font-size: 14px; padding: 3px 7px; } #gpsSub { font-size: 13px; } }

/* ---------- avisos temporários: só no alto do meio (de 22% a 37% da altura) ---------- */
#aviso, #dica { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); width: min(94vw, 440px); background: rgba(255,255,255,.96); color: #3a1028;
  text-shadow: none; border: 3px solid #e8262f; border-radius: 16px; padding: 5px 10px 6px; box-shadow: 0 5px 14px rgba(0,0,0,.28); animation: pop .45s ease-out; text-align: center; }
#dica { border-color: #ff9f1c; }
#avisoTitulo { font-weight: 900; font-size: 21px; line-height: 1.15; color: #d0121b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#avisoLinha .nw { white-space: nowrap; }
#avisoLinha { font-weight: 900; font-size: 16px; line-height: 1.2; margin-top: 2px; white-space: nowrap; letter-spacing: -.3px; }
#avisoExplica { font-weight: 800; font-size: 16px; color: #6a2a4a; margin-top: 2px; line-height: 1.2; }
#dicaTxt { font-weight: 900; font-size: 20px; line-height: 1.15; }
#dicaSub { font-weight: 800; font-size: 15px; color: #6a2a4a; margin-top: 2px; line-height: 1.2; }
@media (max-width: 370px) { #aviso, #dica { width: 97vw; padding: 4px 6px 5px; } #avisoLinha { font-size: 15px; letter-spacing: -.5px; } #avisoTitulo { font-size: 20px; } #avisoExplica, #dicaSub { font-size: 15px; } }
/* boas-vindas / acertos: pílula de 1 linha no alto do meio */
#msg { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-size: 17px; font-weight: 900; line-height: 1.15;
  background: rgba(255,79,163,.9); border: 2px solid #fff; border-radius: 15px; padding: 3px 12px 4px; box-shadow: 0 3px 8px rgba(0,0,0,.2); text-shadow: 0 1px 0 #b3125f;
  text-align: center; width: max-content; max-width: 92vw; white-space: pre-line; animation: pop .5s ease-out; }
@keyframes pop { from { transform: translateX(-50%) scale(.3); opacity: 0 } to { transform: translateX(-50%) scale(1); opacity: 1 } }
/* indicadores do PARE: pequenos, nas bordas, logo abaixo da linha das boas-vindas */
.lado { position: absolute; top: calc(22% + 34px); font-weight: 900; font-size: 14px; line-height: 1.1; padding: 4px 9px; border-radius: 13px; text-shadow: none;
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.3); white-space: nowrap; }
#ladoEsq { left: max(6px, env(safe-area-inset-left)); }
#ladoDir { right: max(6px, env(safe-area-inset-right)); }
.lado.vem { background: #e8262f; color: #fff; animation: piscaLado .5s ease-in-out infinite alternate; }
.lado.livre { background: #1fae4b; color: #fff; }
@keyframes piscaLado { from { transform: scale(1) } to { transform: scale(1.07) } }
#hud.cartao .lado { visibility: hidden; }      /* o cartão de multa/dica (4 s) ocupa o lugar; os indicadores voltam depois */

/* ---------- painel embaixo (≥ 70% da altura): velocímetro no centro, setas dos lados ---------- */
#velBox { position: absolute; left: 50%; margin-left: -45px; width: 90px; height: 54px; bottom: calc(var(--painelBase) + 12px);
  display: flex; align-items: center; justify-content: center; gap: 4px; background: rgba(255,255,255,.88); color: #333; text-shadow: none;
  padding: 0 5px 0 4px; border-radius: 18px; box-shadow: 0 3px 8px rgba(0,0,0,.25); border: 3px solid #ff4fa3; }
#velNum { display: flex; flex-direction: column; align-items: center; line-height: 1; min-width: 36px; }
#velTxt { font-size: 27px; font-weight: 900; line-height: 1; }
#velNum small { font-size: 10px; font-weight: 800; color: #777; margin-top: 1px; }
#limPlaca { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 4px solid #e8262f; flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; color: #111; }
#velBox.acima { background: #ffe1e1; border-color: #e8262f; animation: treme .35s ease-in-out infinite alternate; }
#velBox.acima #velTxt { color: #e8262f; }
@keyframes treme { from { transform: rotate(-2deg) } to { transform: rotate(2deg) } }
#setas { position: fixed; left: 50%; width: 192px; margin-left: -96px; bottom: calc(var(--painelBase) + 16px); display: flex; justify-content: space-between;
  z-index: 3; pointer-events: none; }

/* spec 009 — pedais (modo padrão): freio À ESQUERDA do acelerador, na mesma base, os dois no polegar direito (como o pé no carro).
   O polegar esquerdo fica com a seta ⬅️ ➡️ (embaixo à esquerda) e o velocímetro em cima dela. */
#acel { position: absolute; right: max(var(--m), env(safe-area-inset-right)); bottom: var(--painelBase); width: var(--pedalW); height: calc(30vh - 32px); height: calc(30dvh - 32px); }
#freio { position: absolute; right: calc(max(var(--m), env(safe-area-inset-right)) + var(--pedalW) + var(--vao)); bottom: var(--painelBase); width: var(--freioW); height: var(--freioH); }
.pedal { opacity: .75; transition: opacity .12s; }
.pedal.apertado { opacity: 1; }
#freio .ico { font-size: 26px; }
#freio b { font-size: 14px; letter-spacing: .5px; }
#freio .sola { border-radius: 24px; }
#acelLim { display: none; }               /* o limite aparece 1× só, no velocímetro; no pedal fica a faixa dourada */
#acelDica { font-size: 13px; }
#acelPe { width: 46px; height: 46px; margin-left: -23px; }
#acelRot { font-size: 11px; top: -11px; padding: 1px 7px; }
.setaBtn { width: var(--setaT); height: var(--setaT); }
.setaBtn svg { width: 30px; height: 30px; }
body.modo-pedais #setas { left: max(var(--m), env(safe-area-inset-left)); margin-left: 0; width: calc(2 * var(--setaT) + 12px); bottom: var(--painelBase); }
body.modo-pedais #velBox { left: calc(max(var(--m), env(safe-area-inset-left)) + var(--setaT) + 6px - 45px); margin-left: 0;
  bottom: calc(var(--painelBase) + var(--setaT) + 10px); }

/* ---------- modo volante (2 polegares): volante à esquerda com a seta em cima (como a alavanca do carro) · freio ao lado do acelerador à direita ---------- */
#thumb { position: fixed; left: max(var(--m), env(safe-area-inset-left)); bottom: var(--painelBase); width: var(--volW); height: var(--volW); pointer-events: none; z-index: 2; }
#stick { position: absolute; inset: 0; }
#wheel { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); will-change: transform; opacity: .9; }
#thumb.active #wheel { opacity: 1; }
.wheel svg { width: 100%; height: 100%; display: block; }
#wheel svg .hz { transform-box: fill-box; transform-origin: center; }
#wheel.honk svg .hz { animation: squish .38s ease-out; }
@keyframes squish { 0% { transform: scale(1) } 25% { transform: scale(1.22, .78) } 55% { transform: scale(.92, 1.1) } 80% { transform: scale(1.04, .97) } 100% { transform: scale(1) } }
body.modo-volante { --setaT: 48px; --direita: calc(max(var(--m), env(safe-area-inset-right)) + var(--volPedW) + var(--vao) + var(--freioW));
  --centroX: calc((max(var(--m), env(safe-area-inset-left)) + var(--volW) + 100vw - var(--direita)) / 2); }
body.modo-volante #acel { width: var(--volPedW); }
body.modo-volante #freio { right: calc(max(var(--m), env(safe-area-inset-right)) + var(--volPedW) + var(--vao)); }
body.modo-volante #setas { left: max(var(--m), env(safe-area-inset-left)); margin-left: 0; width: var(--volW); bottom: calc(var(--painelBase) + var(--volW) + 8px); }
body.modo-volante #velBox { left: var(--centroX); width: 56px; margin-left: -28px; height: auto; bottom: var(--painelBase);
  flex-direction: column; gap: 3px; padding: 5px 0 6px; border-radius: 16px; }
body.modo-volante #velTxt { font-size: 24px; }
body.modo-volante #limPlaca { width: 32px; height: 32px; font-size: 14px; border-width: 3px; }

/* ---------- spec 009 — computador (teclado): sem pedal, volante nem botão de seta; painel de teclas embaixo à esquerda ---------- */
#pcPainel { display: none; }
body.aparelho-pc #acel, body.aparelho-pc #freio, body.aparelho-pc #thumb, body.aparelho-pc #setas { display: none !important; }
body.aparelho-pc #pcPainel { display: flex; flex-direction: column; gap: 7px; position: absolute; left: 14px; bottom: 14px; padding: 10px 12px;
  background: rgba(255,255,255,.88); border-radius: 18px; box-shadow: 0 3px 10px rgba(0,0,0,.22); border: 3px solid var(--tema, #ff4fa3);
  color: #5a2a4a; font-weight: 800; font-size: 14px; text-shadow: none; pointer-events: none; }
.pcLinha { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.pcLinha span { margin-right: 6px; }
.pcLinha .soVolante { display: inline-flex; align-items: center; gap: 5px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px;
  font: 900 15px/1 system-ui, sans-serif; color: #333; background: linear-gradient(#fff, #e9e9ef); border: 2px solid #c9c9d4; box-shadow: 0 3px 0 #a9a9b6;
  transition: transform .05s, background .05s; }
kbd.largo { min-width: 58px; font-size: 12px; }
kbd.on { transform: translateY(3px); box-shadow: 0 0 0 #a9a9b6; background: linear-gradient(#ffe36b, #ffc81e); border-color: #e0a800; }
.pcBarra { position: relative; height: 12px; border-radius: 6px; background: #eee; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.2); }
.pcFill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--f) * 100%); background: var(--tema, #ff4fa3); transition: width .08s; }
.pcLim { position: absolute; top: -2px; bottom: -2px; width: 5px; margin-left: -2px; left: calc(var(--lim) * 100%); background: #ffcc1f; box-shadow: 0 0 0 1px #fff; }
body.aparelho-pc:not(.modo-volante) .soVolante, #menu:not(.volante) .soVolante { display: none; }
body.aparelho-pc #velBox { left: 50%; margin-left: -60px; width: 120px; height: 66px; bottom: 16px; flex-direction: row; gap: 6px; padding: 0 6px; }
body.aparelho-pc #velTxt { font-size: 34px; }

/* ---------- deitado (celular/tablet na horizontal): só não quebrar — pedais mais baixos ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --freioH: clamp(70px, 24dvh, 96px); --volW: min(146px, 34dvh); }
  #acel { height: calc(42dvh - 20px); }
  /* o carro fica no centro de baixo: o velocímetro compacto vai para o lado do volante, não por cima do carro */
  body.modo-volante #velBox { left: calc(max(var(--m), env(safe-area-inset-left)) + var(--volW) + 14px); margin-left: 0; }
}

/* =====================================================================================================================
   spec 009 — versão "Meninos" (só visual): azul + amarelo no lugar do rosa. A lei e a pontuação são as mesmas.
   ===================================================================================================================== */
body { --tema: #ff4fa3; }
body.tema-meninos { --tema: #1e88ff; }
body.tema-meninos .overlay { background: radial-gradient(circle at 50% 30%, rgba(214,236,255,.25), rgba(30,136,255,.3)); }
body.tema-meninos .card { border-color: #1e88ff; box-shadow: 0 10px 30px rgba(11,92,196,.35);
  background-image: repeating-linear-gradient(45deg, #fff 0 14px, #f2f8ff 14px 28px); }
body.tema-meninos h1 { color: #0b6ee8; text-shadow: 0 3px 0 #cfe6ff; }
body.tema-meninos .sub, body.tema-meninos .hint { color: #2f557f; }
body.tema-meninos .missao { color: #0b5cc4; }
body.tema-meninos button:not(.setaBtn) { background: linear-gradient(#4aa6ff, #1272e6); box-shadow: 0 5px 0 #08408a; }
body.tema-meninos button:not(.setaBtn):active { box-shadow: 0 2px 0 #08408a; }
body.tema-meninos .mute { color: #2f557f; border-color: #bcdcff; }
body.tema-meninos .modo { background: #e3f1ff; border-color: #bcdcff; }
body.tema-meninos .modo span { color: #2f557f; }
body.tema-meninos .modo span.on { background: linear-gradient(#4aa6ff, #1272e6); box-shadow: 0 3px 0 #08408a; color: #fff; }
.modo.tema span[data-tema="meninas"].on { background: linear-gradient(#ff6fb5, #ff2d8f); box-shadow: 0 3px 0 #b3125f; color: #fff; }
.modo.tema span[data-tema="meninos"].on { background: linear-gradient(#4aa6ff, #1272e6); box-shadow: 0 3px 0 #08408a; color: #fff; }
body.tema-meninos #relatorio { background: rgba(30,136,255,.35); }
body.tema-meninos .relTopo h2 { color: #0b6ee8; }
body.tema-meninos #hud { text-shadow: 0 2px 0 #0b5cc4, 0 0 6px rgba(0,0,0,.35); }
body.tema-meninos #placar span, body.tema-meninos #rumo { color: #1d4f8a; }
body.tema-meninos #seta { background: #1e88ff; }
body.tema-meninos #msg { background: rgba(30,136,255,.92); text-shadow: 0 1px 0 #08408a; }
body.tema-meninos #velBox { border-color: #1e88ff; }
body.tema-meninos #velBox.acima { border-color: #e8262f; }
body.tema-meninos #acelCurva { color: #0b5cc4; border-color: #1e88ff; }
body.tema-meninos .voa { text-shadow: 0 2px 0 #0b5cc4, 0 0 8px rgba(0,0,0,.4); }
body.tema-meninos #acelTrilho { background: linear-gradient(90deg, #f0f7ff, #d6eaff 55%, #bcdcff); box-shadow: 0 7px 0 #08408a, 0 10px 18px rgba(0,0,0,.28); }
body.tema-meninos #acelFill { background: linear-gradient(to top, #8cc6ff 0, #1e88ff calc(var(--pad) + var(--lim) * (100% - 2 * var(--pad))),
    #ff6060 calc(var(--pad) + var(--lim) * (100% - 2 * var(--pad))), #e8262f 100%); }
body.tema-meninos .pedal .nerv { background: repeating-linear-gradient(to top, transparent 0 15px, rgba(0,40,110,.13) 15px 19px); }
body.tema-meninos #freio .nerv { background: repeating-linear-gradient(to top, transparent 0 13px, rgba(90,0,10,.14) 13px 17px); }
body.tema-meninos #acelPe path { stroke: #1272e6; }
body.tema-meninos #acelDica { color: #0b5cc4; }
body.tema-meninos #acelRot { background: #1272e6; }
body.tema-meninos #acel.apertado #acelTrilho { box-shadow: 0 2px 0 #08408a, 0 4px 8px rgba(0,0,0,.25), 0 0 18px 4px rgba(30,136,255,.45); }
body.tema-meninos #pcPainel { color: #1d4f8a; }
