/* ============ VIBECODE GP — UI ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --neon: #39c0ff;
  --accent: #ff4d5a;
  --pink: #ff3d8b;        /* rosa do logo Laura's Racer */
  --gold: #ffb030;
  --bg-glass: rgba(10, 14, 22, 0.82);
  --border-glass: rgba(120, 200, 255, 0.25);
  --fun: 'Fredoka', 'Inter', system-ui, sans-serif;   /* fonte descontraída */
}

html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0e16; }
body { font-family: 'Inter', system-ui, sans-serif; color: #eaf2fa; }

/* ====== ANTI-SELEÇÃO GLOBAL ======================================================
   Apertar/tocar vários botões no HUD ou na tela do jogo NÃO pode pintar a "película
   azul" de seleção de texto sobre a tela inteira. `user-select` é herdado → setar em
   html/body propaga p/ tudo; `::selection` transparente é o cinto-de-segurança caso
   alguma seleção ainda escape; `tap-highlight` transparente mata o flash ao tocar.
   Só os CAMPOS DE TEXTO voltam a permitir selecionar/digitar.                       */
html, body {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;   /* sem flash cinza/azul ao tocar botão */
  -webkit-touch-callout: none;                 /* sem menu copiar/traduzir no long-press */
}
* { -webkit-tap-highlight-color: transparent; }
::selection   { background: transparent; }
::-moz-selection { background: transparent; }
/* exceção: digitar/selecionar nos inputs do formulário (nome, código da sala) */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text;
  -webkit-touch-callout: default;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

kbd {
  display: inline-block; padding: 2px 8px; margin: 0 2px;
  background: #1c2433; border: 1px solid #3a4a64; border-bottom-width: 3px;
  border-radius: 6px; font-family: 'Orbitron', monospace; font-size: 11px; color: #bfe3ff;
}

/* ============ BOOT SCREEN ============ */
#boot {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: safe center; justify-content: center;
  overflow-y: auto;
  /* folga embaixo p/ o card não ficar atrás do rodapé fixo (#boot-credit) */
  padding: 18px 18px calc(64px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 61, 139, .22), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(57, 192, 255, .14), transparent 60%),
    #0a0e16;
}
/* vídeo de fundo (sem som) + overlay p/ legibilidade do card */
#bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
#bg-overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, rgba(8,11,18,.5), rgba(8,11,18,.88) 78%); }
.boot-screen { position: relative; z-index: 2; }

/* DESKTOP: card à esquerda (~22%), vídeo visível nos ~78% à direita */
@media (min-width: 900px) {
  body:not(.touch) #boot { justify-content: flex-start; }
  body:not(.touch) .boot-screen { width: auto; margin: auto 0 auto 5vw; align-items: flex-start; }
  body:not(.touch) .boot-card { width: 400px; max-width: 34vw; }
  /* escurece os DOIS lados (cards esquerdo/direito legíveis) e deixa o CENTRO do vídeo claro */
  body:not(.touch) #bg-overlay {
    background: linear-gradient(90deg, rgba(8,11,18,.95) 0%, rgba(8,11,18,.74) 18%, rgba(8,11,18,.12) 40%,
      rgba(8,11,18,.12) 60%, rgba(8,11,18,.74) 82%, rgba(8,11,18,.95) 100%);
  }
  /* o card do menu NÃO fica colado à esquerda demais (deixa o vídeo respirar no centro) */
  body:not(.touch) .boot-card { width: 360px; max-width: 30vw; }
}

/* rodapé de crédito na tela de entrada — FIXO no rodapé da viewport (não rola junto
   com o card; antes era position:absolute dentro do #boot que rola → "flutuava" no meio) */
#boot-credit {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap;
  font-family: var(--fun); font-size: 12.5px; color: #9fb4cc; pointer-events: none;
  padding: 12px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(8,11,18,.95) 35%, rgba(8,11,18,0));
}
#boot-credit b { color: #fff; }
#boot-credit a { color: #8fcdf7; text-decoration: none; pointer-events: auto; }
#boot-credit a:hover { text-decoration: underline; }
#boot-credit .zap { display: inline-flex; align-items: center; gap: 6px; color: #fff; background: #25d366;
  padding: 4px 11px; border-radius: 999px; font-weight: 600; box-shadow: 0 4px 14px rgba(37,211,102,.35); }
#boot-credit .zap:hover { background: #20bd5a; text-decoration: none; }
/* landscape curto (jogando deitado) é apertado → esconde; no resto fica fixo no rodapé */
@media (orientation: landscape) and (max-height: 500px) { #boot-credit { display: none; } }
@media (max-width: 560px) { #boot-credit { font-size: 11px; gap: 6px 12px; } }   /* compacto no celular */

/* instruções de jogo (desktop) */
.how-to { margin-top: 14px; text-align: left; font-size: 12.5px; line-height: 1.5; color: #b8c6da;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 11px 14px; }
.ht-title { font-weight: 700; color: #fff; margin-bottom: 6px; font-size: 13px; }
.how-to ul { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.how-to b { color: #ffd23f; }
.how-to p { margin: 0; color: #9fb4cc; }
body.touch .how-to { display: none; }   /* mobile já tem os controles na tela */

.boot-card {
  max-width: 540px; width: 100%; text-align: center; margin: auto;
  padding: 30px 34px; border-radius: 26px; font-family: var(--fun);
  background: var(--bg-glass); border: 1px solid rgba(255, 61, 139, .3);
  backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(255,61,139,.12), inset 0 1px 0 rgba(255,255,255,.06);
}
#boot-logo {
  width: 250px; max-width: 70%; height: auto; display: block; margin: 0 auto 10px;
  filter: drop-shadow(0 6px 30px rgba(255, 61, 139, .5));
  animation: logoFloat 3.4s ease-in-out infinite;
}
@keyframes logoFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-7px) scale(1.015); } }
@keyframes wave { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* ---- responsivo: telas estreitas (mobile retrato) — #boot p/ vencer a cascata ---- */
@media (max-width: 560px) {
  #boot .boot-card { padding: 22px 18px; }
  #boot #boot-logo { width: 180px; }
  #boot .tagline { font-size: 12px; margin-bottom: 16px; }
  #boot #form-name { padding: 12px 16px; font-size: 14px; margin-bottom: 14px; }
  #boot #color-row { margin-bottom: 14px; padding: 8px 12px; }
  #boot .color-label { font-size: 12px; }
  #boot .controls-grid { font-size: 11px; padding: 10px 14px; gap: 5px 10px; margin-bottom: 16px; }
  #boot #start-btn { padding: 14px 28px; font-size: 15px; width: 100%; }
  #boot .boot-hint { font-size: 11px; margin-top: 12px; }
}
/* ---- responsivo: telas baixas (mobile paisagem) ---- */
@media (orientation: landscape) and (max-height: 500px) {
  #boot { align-items: flex-start; padding: 10px; }
  #boot .boot-card { padding: 12px 16px; margin: 0 auto; }
  #boot #boot-logo { width: 80px; margin-bottom: 2px; }
  #boot .tagline { font-size: 10px; line-height: 1.3; margin-bottom: 7px; }
  #boot .controls-grid { display: none; }      /* economiza altura no landscape curto */
  #boot #form-name { margin-bottom: 7px; padding: 9px 14px; font-size: 13px; }
  #boot #color-row { margin-bottom: 7px; padding: 5px 10px; }
  #boot .swatch { width: 20px; height: 20px; }
  #boot #start-btn { padding: 10px 22px; font-size: 13px; }
  #boot .boot-hint { display: none; }
}
#boot h1 {
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 46px;
  letter-spacing: 4px; margin: 10px 0 6px;
  background: linear-gradient(180deg, #fff, #9fd4ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
#boot h1 span { -webkit-text-fill-color: var(--accent); }
.tagline { color: #9fb4cc; font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.tagline b { color: #dff0ff; }
#form-name, #form-email {
  width: 100%; margin-bottom: 10px; padding: 15px 20px;
  font-family: var(--fun); font-weight: 500; font-size: 17px; text-align: center;
  color: #fff; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,61,139,.3); border-radius: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#form-email { font-size: 14.5px; margin-bottom: 6px; border-color: rgba(127,224,255,.3); }
#form-name::placeholder, #form-email::placeholder { color: #8a93a8; font-weight: 400; }
#form-name:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,61,139,.22); }
#form-email:focus { border-color: #7fe0ff; box-shadow: 0 0 0 3px rgba(127,224,255,.22); }
#email-note { font-size: 10.5px; line-height: 1.4; color: #8fa6c0; margin: 0 4px 16px; text-align: left; }
#email-note b { color: #cfe3f5; }

/* ===== RANKING GLOBAL — SIDEBAR À DIREITA (menu à esquerda · vídeo no centro) ===== */
#leaderboard-side {
  position: fixed; z-index: 4; top: 50%; right: 3vw; transform: translateY(-50%);
  width: 312px; max-width: 32vw; max-height: 80vh; display: flex; flex-direction: column;
  font-family: var(--fun); padding: 16px 14px 12px; border-radius: 20px;
  background: var(--bg-glass); border: 1px solid rgba(255,176,48,.32); backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 50px rgba(255,176,48,.10), inset 0 1px 0 rgba(255,255,255,.05);
}
.lb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 4px; }
.lb-trophy { font-size: 28px; filter: drop-shadow(0 2px 8px rgba(255,176,48,.5)); }
.lb-h1 { font-weight: 700; font-size: 17px; color: #ffd98a; line-height: 1.1; }
.lb-h2 { font-size: 11px; color: #9fb4cc; }
.lb-list { list-style: none; margin: 0; padding: 4px; display: flex; flex-direction: column; gap: 5px;
  overflow-y: auto; flex: 1 1 auto; scrollbar-width: thin; scrollbar-color: rgba(255,176,48,.4) transparent; }
.lb-list::-webkit-scrollbar { width: 7px; }
.lb-list::-webkit-scrollbar-thumb { background: rgba(255,176,48,.35); border-radius: 4px; }
.lb-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #e6eef8;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.05); border-radius: 11px; padding: 8px 10px; }
.lb-list li.lb-top { background: rgba(255,176,48,.12); border-color: rgba(255,176,48,.3); }
.lb-rk { flex: 0 0 30px; text-align: center; font-weight: 800; color: #ffd98a; font-size: 13px; }
.lb-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.lb-nm { flex: 1 1 auto; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-best { flex: 0 0 auto; font-weight: 800; color: #fff; }
.lb-best small, .lb-mt small { font-weight: 600; font-size: 9px; opacity: .55; margin-left: 2px; }
.lb-mt { flex: 0 0 auto; color: #9fb4cc; font-size: 11.5px; min-width: 48px; text-align: right; }
.lb-empty { justify-content: center; color: #9fb4cc !important; font-style: italic; text-align: center; }
.lb-foot { margin-top: 10px; font-size: 10.5px; line-height: 1.35; color: #8fa6c0; text-align: center; }
.lb-foot b { color: #ffd98a; }

/* mobile / telas estreitas: a sidebar vira um painel no fluxo, abaixo do card (sem fixar na lateral) */
@media (max-width: 899px), (pointer: coarse) {
  #leaderboard-side {
    position: static; transform: none; width: 100%; max-width: 540px; max-height: 46vh;
    margin: 14px auto 0; right: auto;
  }
}
/* (paisagem: o ranking NÃO some mais — vira 3ª coluna rolável; ver bloco no fim do arquivo) */

/* sala privada por CÓDIGO de 4 dígitos (entrada manual — funciona no PWA, onde o link não troca de app) */
#room-code-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px; padding: 10px 16px; border-radius: 14px;
  background: rgba(127,224,255,.07); border: 1px solid rgba(127,224,255,.24);
}
#form-code {
  width: 130px; padding: 10px 12px; font-family: var(--fun); font-weight: 700;
  font-size: 26px; letter-spacing: 8px; text-align: center; color: #eaf7ff;
  background: rgba(255,255,255,.06); border: 1px solid rgba(127,224,255,.4);
  border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
#form-code::placeholder { color: #5d748c; letter-spacing: 8px; }
#form-code:focus { border-color: #7fe0ff; box-shadow: 0 0 0 3px rgba(127,224,255,.22); }
#form-code.invalid { border-color: #ff5a6a; box-shadow: 0 0 0 3px rgba(255,90,106,.28); animation: code-shake .35s; }
@keyframes code-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

#color-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px; padding: 10px 16px; border-radius: 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
}
.color-label { font-size: 13px; color: #b9cde4; white-space: nowrap; }
#color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,.25); transition: transform .12s, border-color .12s;
}
.swatch:hover { transform: scale(1.15); }
.swatch.sel { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 3px rgba(255,255,255,.25); }

.controls-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px;
  text-align: left; font-size: 13px; color: #b9cde4;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 26px;
}
#start-btn {
  font-family: var(--fun); font-weight: 700; font-size: 20px;
  letter-spacing: 0.5px; color: #fff; cursor: pointer;
  padding: 16px 44px; border: none; border-radius: 16px;
  background: linear-gradient(180deg, #ff7aae, #e6457f);
  box-shadow: 0 10px 28px rgba(255,61,139,.5), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .15s, box-shadow .15s;
}
#start-btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 40px rgba(255,61,139,.66); }
#start-btn:active { transform: translateY(1px); }
.tagline { font-weight: 500; }
.boot-hint { margin-top: 18px; font-size: 12.5px; color: #8090a6; }

/* ---- telas do boot (loading / menu / form) ---- */
.boot-screen { width: 100%; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.boot-screen.hidden { display: none; }

#screen-loading { gap: 22px; }
.load-logo { width: 200px; max-width: 60%; filter: drop-shadow(0 6px 30px rgba(255,61,139,.5)); animation: loadPulse 1.6s ease-in-out infinite; }
@keyframes loadPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.loader-bar { width: 220px; max-width: 70%; height: 8px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.loader-fill { height: 100%; width: 30%; border-radius: 6px; background: linear-gradient(90deg, #ff7aae, #e6457f); animation: loadSlide 1.1s ease-in-out infinite; }
@keyframes loadSlide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.load-text { font-family: var(--fun); color: #cdd9e8; font-size: 14px; letter-spacing: 1px; }

.mini-logo { width: 130px; margin: 0 auto 8px; display: block; filter: drop-shadow(0 4px 18px rgba(255,61,139,.4)); }
#form-title { font-family: var(--fun); font-weight: 700; font-size: 24px; color: #fff; margin-bottom: 16px; }

.menu-btn {
  display: block; width: 100%; margin: 8px 0; padding: 16px 22px; border: none; border-radius: 16px;
  font-family: var(--fun); font-weight: 700; font-size: 19px; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #ff7aae, #e6457f); box-shadow: 0 8px 24px rgba(255,61,139,.45);
  transition: transform .12s, box-shadow .12s;
}
.menu-btn.alt { background: linear-gradient(180deg, #6fd6ff, #1ea8e8); box-shadow: 0 8px 24px rgba(57,192,255,.4); }
.menu-btn.install { background: linear-gradient(180deg, #59e6a7, #18b877); box-shadow: 0 8px 24px rgba(31,200,130,.4); animation: install-pulse 2s ease-in-out infinite; }
.menu-btn:hover { transform: translateY(-2px); }
@keyframes install-pulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.ios-hint { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.45; color: #8fe6c0; background: rgba(31,200,130,.12); border: 1px solid rgba(31,200,130,.3); border-radius: 12px; padding: 10px 12px; }
.ios-hint b { color: #d6fff0; }

/* ===== GATE DE INSTALAÇÃO iOS (overlay forte: "salve na Tela de Início") ===== */
#ios-gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: safe center; justify-content: center;
  overflow-y: auto; padding: 18px; font-family: var(--fun);
  background:
    radial-gradient(ellipse at 50% 6%, rgba(31,200,130,.22), transparent 55%),
    rgba(6, 10, 16, .94);
  backdrop-filter: blur(6px);
}
.ios-gate-card {
  max-width: 420px; width: 100%; text-align: center; margin: auto;
  padding: 26px 24px 22px; border-radius: 24px;
  background: var(--bg-glass); border: 1px solid rgba(31,200,130,.4);
  box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 60px rgba(31,200,130,.14);
}
.ios-gate-logo { width: 150px; max-width: 60%; height: auto; margin: 0 auto 6px; display: block;
  filter: drop-shadow(0 6px 22px rgba(255,61,139,.45)); }
.ios-gate-badge { display: inline-block; margin-bottom: 10px; padding: 5px 14px; border-radius: 999px;
  font-weight: 700; font-size: 13px; color: #08251a; background: linear-gradient(180deg, #59e6a7, #18b877);
  box-shadow: 0 6px 16px rgba(31,200,130,.4); }
.ios-gate-card h2 { font-size: 20px; line-height: 1.25; color: #fff; margin-bottom: 8px; }
.ios-gate-card h2 b { color: #6cf0b6; }
.ios-gate-sub { font-size: 13px; line-height: 1.5; color: #b8c6da; margin-bottom: 14px; }
.ios-gate-sub b { color: #fff; }
.ios-steps { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 10px;
  margin: 0 0 14px; padding: 0; }
.ios-steps li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.35;
  color: #dce8f5; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px; padding: 10px 12px; }
.ios-steps b { color: #fff; }
.ios-steps .step-n { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
  color: #08251a; background: linear-gradient(180deg, #59e6a7, #18b877); }
.ios-share-ico { color: #6cf0b6; vertical-align: middle; }
.ios-gate-arrow { font-size: 12.5px; color: #8fe6c0; margin-bottom: 14px; animation: gate-bob 1.4s ease-in-out infinite; }
.ios-gate-arrow b { color: #d6fff0; }
@keyframes gate-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.ios-gate-skip { background: none; border: 1px solid rgba(255,255,255,.18); color: #9fb4cc;
  font-family: var(--fun); font-size: 13px; padding: 9px 16px; border-radius: 12px; cursor: pointer;
  transition: color .12s, border-color .12s; }
.ios-gate-skip:hover { color: #fff; border-color: rgba(255,255,255,.4); }
@media (orientation: landscape) and (max-height: 500px) {
  .ios-gate-card { padding: 16px 18px; }
  .ios-gate-logo { width: 90px; }
  .ios-gate-card h2 { font-size: 16px; }
  .ios-steps li { padding: 7px 10px; font-size: 12px; }
}

/* ===== botões do MENU = imagens neon (Criar Sala / Sala Pública / Instalar). Escopo
   em #screen-menu p/ NÃO afetar o botão do formulário (#form-go, que segue de texto). ===== */
#screen-menu .menu-btn {
  width: 100%; max-width: 400px; margin: 5px auto; padding: 0; border: 0; box-shadow: none;
  /* props individuais (NÃO o shorthand 'background', que zeraria a background-image dos #id abaixo) */
  background-color: transparent; background-repeat: no-repeat; background-position: center; background-size: contain;
  color: transparent; font-size: 0; aspect-ratio: 760 / 217; cursor: pointer; animation: none;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.45));
  transition: transform .12s, filter .12s;
}
#screen-menu .menu-btn:hover { transform: translateY(-3px) scale(1.02); filter: drop-shadow(0 12px 22px rgba(255,61,139,.35)); }
#screen-menu .menu-btn:active { transform: translateY(0) scale(.99); }
#menu-create  { background-image: url('../icons/btn-criar.png'); }
#menu-join    { background-image: url('../icons/btn-publica.png'); }
#menu-install { background-image: url('../icons/btn-instalar.png'); }
/* "Entrar com Código" não tem imagem neon → renderiza como botão de TEXTO (override do tratamento de imagem) */
#screen-menu #menu-private {
  aspect-ratio: auto; max-width: 400px; margin: 6px auto; padding: 13px 20px;
  font-size: 17px; font-weight: 800; color: #08263a; letter-spacing: .2px;
  background: linear-gradient(180deg, #ffe08a, #f5b32e);
  border-radius: 16px; box-shadow: 0 8px 22px rgba(245,179,46,.42); filter: none;
}
#screen-menu #menu-private:hover { transform: translateY(-2px) scale(1.01); filter: none; box-shadow: 0 12px 26px rgba(245,179,46,.52); }
/* wrappers do menu: invisíveis p/ layout no desktop/retrato (a card fica igual) */
.menu-left, .menu-right { display: contents; }
/* paisagem curta (celular deitado): card vira 2 COLUNAS equilibradas — logo+resumo
   à esquerda, botões à direita, divisor sutil, TUDO cabendo sem rolagem/corte.
   Dicas de teclado/instalação saem (irrelevantes aqui e estouravam a altura). */
@media (orientation: landscape) and (max-height: 500px) {
  #boot { align-items: center; padding: 8px; }
  #boot #screen-menu .boot-card {
    display: flex; align-items: center; gap: 0;
    width: min(94vw, 620px); max-width: none; padding: 14px 20px;
  }
  #boot .menu-left {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 0 0 37%; min-width: 0; padding-right: 18px;
  }
  #boot .menu-right {
    display: flex; flex-direction: column; align-items: stretch; justify-content: center;
    flex: 1 1 auto; min-width: 0;
    border-left: 1px solid rgba(255,255,255,.08); padding-left: 18px;
  }
  #boot #screen-menu #boot-logo { width: min(128px, 88%); margin: 0 0 8px; }
  #boot #screen-menu .tagline { font-size: 9.5px; line-height: 1.45; margin: 0; }
  #boot #screen-menu .menu-btn { max-width: 250px; margin: 3px auto; width: 100%; }
  #boot #screen-menu #menu-private { font-size: 12.5px; padding: 9px 12px; margin: 5px auto 0; }
  #boot #screen-menu .ios-hint,
  #boot #screen-menu .how-to,
  #boot #screen-menu .boot-hint,
  #boot-credit { display: none; }
}

#form-privacy { display: flex; gap: 12px; margin: 4px 0 16px; }
.priv-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 8px; border-radius: 14px; cursor: pointer; font-family: var(--fun); font-weight: 600; font-size: 14px;
  color: #cdd9e8; background: rgba(255,255,255,.04); border: 2px solid rgba(255,255,255,.1); transition: all .12s;
}
.priv-opt small { font-size: 10.5px; color: #8fa6c0; font-weight: 400; }
.priv-opt.sel { border-color: var(--pink); background: rgba(255,61,139,.14); color: #fff; }
.priv-opt.sel small { color: #ffc0d8; }

.back-btn { margin-top: 12px; background: none; border: none; color: #8fa6c0; font-family: var(--fun); font-size: 13px; cursor: pointer; }
.back-btn:hover { color: #fff; }

/* ============ HUD ============ */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

#brand {
  position: absolute; top: 18px; left: 22px;
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 18px;
  letter-spacing: 3px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6);
}
#brand span { color: var(--accent); }

#speedo {
  position: absolute; left: 26px; bottom: 24px;
  font-family: 'Orbitron', sans-serif; color: #fff;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 18px; padding: 14px 24px 12px; min-width: 150px; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
#speed-value { font-size: 44px; font-weight: 900; line-height: 1; }
#speedo small { display: block; font-size: 11px; letter-spacing: 3px; color: #7fc6f5; margin-top: 2px; }
#drift-badge {
  position: absolute; top: -14px; right: -10px; transform: rotate(8deg);
  background: var(--gold); color: #20160a; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 8px; letter-spacing: 1px;
  animation: pulse .4s ease-in-out infinite alternate;
}
@keyframes pulse { from { transform: rotate(8deg) scale(1); } to { transform: rotate(8deg) scale(1.12); } }

#score {
  position: absolute; right: 26px; bottom: 24px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 16px; padding: 14px 20px; font-size: 14px; color: #c9def2;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
#score b { color: #fff; font-family: 'Orbitron', sans-serif; margin-left: 6px; }

#minimap {
  position: absolute; top: 18px; right: 22px;
  border-radius: 16px; border: 1px solid var(--border-glass);
  background: rgba(8, 12, 20, .55);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}

#prompt {
  position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 14px; padding: 14px 26px; font-size: 15px; font-weight: 600;
  color: #eaf6ff; white-space: nowrap;
  box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 0 30px rgba(57,192,255,.2);
  animation: float 1.6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }

/* aviso discreto: só texto branco com contorno preto (sem caixa/fundo) */
#toast {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif; font-size: 16px; font-weight: 700; text-align: center;
  color: #fff; line-height: 1.35; padding: 0 14px; max-width: 92%; pointer-events: none;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 5px rgba(0,0,0,.8);
  animation: toastIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
#toast b { color: #ffe27a; }
body.touch #toast { font-size: 11.5px; top: 19%; }
@keyframes toastIn { from { transform: translate(-50%, 30px) scale(.8); opacity: 0; } }

/* ============ MODAL ============ */
#modal {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 14, .72); backdrop-filter: blur(6px);
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
#modal-panel {
  position: relative; width: min(720px, calc(100% - 36px)); max-height: 84vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #121a28, #0c1320);
  border: 1px solid var(--border-glass); border-radius: 22px;
  box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 60px rgba(57,192,255,.12);
  animation: panelIn .35s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes panelIn { from { transform: translateY(40px) scale(.95); opacity: 0; } }
#modal-body { overflow-y: auto; padding: 34px 38px 20px; }
#modal-body::-webkit-scrollbar { width: 8px; }
#modal-body::-webkit-scrollbar-thumb { background: #2a3a52; border-radius: 4px; }
#modal-footer {
  padding: 12px; text-align: center; font-size: 12px; color: #6e84a0;
  border-top: 1px solid rgba(255,255,255,.06);
}
#modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #3a4a64;
  background: #1c2433; color: #bfe3ff; font-size: 15px; cursor: pointer;
  transition: background .15s, transform .15s;
}
#modal-close:hover { background: var(--accent); color: #fff; transform: scale(1.1); }

/* ---- Conteúdo do modal ---- */
.m-header { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.m-icon {
  width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1d2a40, #15203244); border: 1px solid var(--border-glass);
}
.m-header h2 { font-family: 'Orbitron', sans-serif; font-size: 22px; letter-spacing: 1px; }
.m-header p { color: #8fa6c0; font-size: 13px; margin-top: 4px; }

.m-section-title {
  font-family: 'Orbitron', sans-serif; font-size: 13px; letter-spacing: 2px;
  color: var(--neon); margin: 26px 0 14px; text-transform: uppercase;
}

.avatar-row { display: flex; gap: 20px; align-items: center; margin-bottom: 8px; }
.avatar {
  width: 84px; height: 84px; flex: 0 0 84px; border-radius: 50%; font-size: 42px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, #2a4a72, #131e30);
  border: 2px solid var(--neon); box-shadow: 0 0 24px rgba(57,192,255,.35);
}
.bio { font-size: 14px; line-height: 1.7; color: #c5d6e8; }
.bio b { color: #fff; }

.timeline { border-left: 2px solid #2a3a52; margin-left: 8px; padding-left: 22px; }
.t-item { position: relative; padding-bottom: 18px; }
.t-item::before {
  content: ''; position: absolute; left: -28px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--neon); box-shadow: 0 0 10px var(--neon);
}
.t-item .t-year { font-family: 'Orbitron', sans-serif; font-size: 12px; color: var(--gold); }
.t-item h4 { font-size: 14px; margin: 3px 0; }
.t-item p { font-size: 13px; color: #8fa6c0; line-height: 1.5; }

.skill { margin-bottom: 12px; }
.skill .s-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; color: #c5d6e8; }
.s-bar { height: 8px; border-radius: 4px; background: #1a2438; overflow: hidden; }
.s-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--neon), #7be0ff);
  box-shadow: 0 0 12px rgba(57,192,255,.5);
  animation: grow 1s cubic-bezier(.2, .8, .3, 1);
}
@keyframes grow { from { width: 0 !important; } }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card {
  border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden;
  background: rgba(255,255,255,.025); transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--neon); }
.card .thumb { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.thumb-1 { background: linear-gradient(135deg, #ff9a62, #ff4d8d); }
.thumb-2 { background: linear-gradient(135deg, #36d1dc, #5b86e5); }
.thumb-3 { background: linear-gradient(135deg, #a8e063, #38a169); }
.thumb-4 { background: linear-gradient(135deg, #c084fc, #6d28d9); }
.card .c-body { padding: 14px 16px 16px; }
.card h4 { font-size: 15px; margin-bottom: 5px; }
.card p { font-size: 12.5px; color: #8fa6c0; line-height: 1.5; margin-bottom: 10px; }
.card .metric { font-size: 12px; color: var(--gold); font-weight: 600; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  font-size: 10.5px; padding: 3px 9px; border-radius: 20px;
  background: rgba(57,192,255,.12); color: #7fc6f5; border: 1px solid rgba(57,192,255,.25);
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat {
  text-align: center; padding: 14px 8px; border-radius: 14px;
  background: rgba(57,192,255,.07); border: 1px solid rgba(57,192,255,.18);
}
.stat b { display: block; font-family: 'Orbitron', sans-serif; font-size: 20px; color: #fff; }
.stat small { font-size: 11px; color: #8fa6c0; }

.feature-list { list-style: none; }
.feature-list li { font-size: 13.5px; color: #c5d6e8; padding: 6px 0 6px 26px; position: relative; line-height: 1.5; }
.feature-list li::before { content: '⚡'; position: absolute; left: 0; }

.browser-mock { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); margin: 14px 0; }
.browser-bar { background: #1a2334; padding: 8px 14px; display: flex; gap: 6px; align-items: center; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.browser-bar .url { font-size: 11px; color: #6e84a0; background: #0e1522; border-radius: 6px; padding: 3px 12px; margin-left: 10px; }
.browser-screen { height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #1e3a8a, #0ea5e9); font-family: 'Orbitron', sans-serif; }
.browser-screen b { font-size: 20px; color: #fff; letter-spacing: 2px; }
.browser-screen small { font-size: 11px; color: rgba(255,255,255,.75); font-family: 'Inter', sans-serif; }

.quote {
  background: rgba(255,255,255,.03); border-left: 3px solid var(--gold);
  border-radius: 0 14px 14px 0; padding: 16px 20px; margin-bottom: 14px;
}
.quote p { font-size: 14px; font-style: italic; color: #d7e4f2; line-height: 1.65; }
.quote footer { margin-top: 10px; font-size: 12.5px; color: var(--gold); font-weight: 600; }
.quote footer small { color: #8fa6c0; font-weight: 400; display: block; margin-top: 2px; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-btn {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  border-radius: 14px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09); text-decoration: none; color: #eaf2fa;
  transition: transform .15s, border-color .15s, background .15s;
}
.contact-btn:hover { transform: translateY(-2px); border-color: var(--neon); background: rgba(57,192,255,.08); }
.contact-btn .ico { font-size: 24px; }
.contact-btn b { display: block; font-size: 13.5px; }
.contact-btn small { font-size: 11.5px; color: #8fa6c0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-size: 12px; padding: 6px 14px; border-radius: 20px;
  background: rgba(255,176,48,.1); color: #ffd28a; border: 1px solid rgba(255,176,48,.3);
}

/* ============ MULTIPLAYER HUD ============ */
/* timer sobre a placa metálica (icons/hud-timer-centro.png) — só o número centralizado */
#timer {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 176px; height: 53px; padding: 0; border: 0; box-shadow: none; background: transparent;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background-image: url('../icons/hud-timer-centro.png?v=2153'); background-size: 100% 100%; background-repeat: no-repeat;
}
#timer small { display: none; }   /* a placa já é a moldura; sem o rótulo "TEMPO" */
#timer-value { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 26px; color: #fff; line-height: 1; letter-spacing: 1px; text-shadow: 0 0 9px rgba(255,60,40,.55), 0 2px 3px rgba(0,0,0,.7); }
#timer.urgent #timer-value { color: var(--accent); animation: pulse .5s ease-in-out infinite alternate; }

#scoreboard {
  position: absolute; top: 78px; left: 22px; width: 210px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 14px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.sb-title { font-family: 'Orbitron', sans-serif; font-size: 12px; letter-spacing: 2px; color: #9fd4ff; margin-bottom: 8px; }
#sb-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
#sb-list li {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.03);
}
#sb-list li.me { background: rgba(57,192,255,.16); border: 1px solid rgba(57,192,255,.3); }
#sb-list li.dead { opacity: .45; }
#sb-list .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
#sb-list .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e8f2fb; }
#sb-list .pts { font-family: 'Orbitron', sans-serif; font-weight: 700; color: #ffd23f; min-width: 22px; text-align: right; }
#sb-list .dia { font-size: 11px; color: #4cd6ff; }
#sb-list .skull { font-size: 11px; }

#net-status {
  position: absolute; top: 46px; left: 22px; font-size: 11px; color: #7fc6f5;
  background: rgba(10,14,22,.6); border-radius: 8px; padding: 4px 10px; max-width: 230px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#net-status.host { color: #ffd23f; }
#net-status.solo { color: #9fb4cc; }
#net-status.err { color: var(--accent); }

#mute-btn {
  position: absolute; top: 14px; right: 210px; width: 40px; height: 40px;
  border-radius: 12px; border: 1px solid var(--border-glass); background: var(--bg-glass);
  font-size: 18px; cursor: pointer; pointer-events: auto; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#mute-btn:hover { background: rgba(57,192,255,.18); }

#music-btn {
  position: absolute; top: 14px; right: 258px; width: 40px; height: 40px;
  border-radius: 12px; border: 1px solid var(--border-glass); background: var(--bg-glass);
  font-size: 18px; cursor: pointer; pointer-events: auto; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); transition: opacity .15s;
}
#music-btn:hover { background: rgba(57,192,255,.18); }
#music-btn.off { opacity: 0.4; }
#music-btn.off::after {
  content: ''; position: absolute; inset: 6px; border-radius: 8px;
  background: linear-gradient(135deg, transparent 44%, #ff4d5a 46%, #ff4d5a 54%, transparent 56%);
}
#fs-btn {
  position: absolute; top: 14px; right: 306px; width: 40px; height: 40px;
  border-radius: 12px; border: 1px solid var(--border-glass); background: var(--bg-glass);
  font-size: 19px; cursor: pointer; pointer-events: auto; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#fs-btn:hover { background: rgba(57,192,255,.18); }
#leave-btn {
  position: absolute; top: 14px; right: 354px; width: 40px; height: 40px;
  border-radius: 12px; border: 1px solid var(--border-glass); background: var(--bg-glass);
  font-size: 18px; cursor: pointer; pointer-events: auto; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#leave-btn:hover { background: rgba(255,90,100,.28); }
@media (max-width: 640px) {
  #mute-btn { right: 14px; top: 58px; }
  #music-btn { right: 60px; top: 58px; }
  #fs-btn { right: 106px; top: 58px; }
}

/* pop-out de VOLUME (slider) — abre ao tocar no botão de áudio */
#volume-pop {
  position: absolute; top: 62px; right: 150px; z-index: 12;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 14px;
  background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); pointer-events: auto;
}
#volume-pop.hidden { display: none; }
.vol-row { display: flex; align-items: center; gap: 8px; }
#vol-ico, #mus-ico { font-size: 16px; width: 20px; text-align: center; }
#volume-slider, #music-slider {
  -webkit-appearance: none; appearance: none; width: 132px; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, #6fd6ff, #1ea8e8); outline: none; cursor: pointer;
}
#volume-slider::-webkit-slider-thumb, #music-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); cursor: pointer; border: 2px solid #1ea8e8;
}
#volume-slider::-moz-range-thumb, #music-slider::-moz-range-thumb {
  width: 20px; height: 20px; border: 2px solid #1ea8e8; border-radius: 50%; background: #fff; cursor: pointer;
}
/* rosa = música, azul = efeitos: dá pra saber qual slider é qual de relance */
#music-slider { background: linear-gradient(90deg, #ffa8d0, #e6457f); }
#music-slider::-webkit-slider-thumb { border-color: #e6457f; }
#music-slider::-moz-range-thumb { border-color: #e6457f; }
body.touch #volume-pop { top: 52px; left: 50%; right: auto; transform: translateX(-50%); padding: 10px 14px; }
body.touch #volume-slider, body.touch #music-slider { width: 150px; height: 10px; }
body.touch #volume-slider::-webkit-slider-thumb,
body.touch #music-slider::-webkit-slider-thumb { width: 24px; height: 24px; }

#invite-btn {
  position: absolute; top: 208px; right: 22px; height: 38px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border-glass);
  background: linear-gradient(180deg, #ff7aa8, #e6457f);
  font-family: 'Orbitron', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: #fff; cursor: pointer; pointer-events: auto;
  box-shadow: 0 8px 22px rgba(230,69,127,.45);
  animation: invitePulse 2s ease-in-out infinite;
}
#invite-btn:hover { transform: translateY(-2px); }
#invite-btn .ico { margin-right: 6px; }
@keyframes invitePulse { 0%,100% { box-shadow: 0 8px 22px rgba(230,69,127,.4); } 50% { box-shadow: 0 8px 30px rgba(230,69,127,.75); } }
@media (max-width: 640px) { #invite-btn { top: 146px; right: 14px; height: 32px; padding: 0 10px; font-size: 11px; } }

#killfeed {
  position: absolute; top: 64px; right: 22px; width: 240px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end; text-align: right;
}
.kf-item {
  font-size: 12.5px; color: #eaf2fa; background: rgba(10,14,22,.78);
  border: 1px solid var(--border-glass); border-radius: 8px; padding: 5px 11px;
  animation: kfIn .3s ease; max-width: 100%;
}
.kf-item b { color: #ffd23f; }
@keyframes kfIn { from { transform: translateX(20px); opacity: 0; } }

#hpbar {
  position: absolute; left: 26px; bottom: 108px; width: 174px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 12px; padding: 9px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.hp-label { font-family: 'Orbitron', sans-serif; font-size: 10px; letter-spacing: 2px; color: #7fc6f5; margin-bottom: 5px; }
.hp-track { height: 11px; border-radius: 6px; background: #1a2438; overflow: hidden; }
#hp-fill {
  height: 100%; width: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #2ee27a, #7be0ff);
  transition: width .2s ease, background .2s ease;
}

#death-overlay, #gameover-overlay, #lobby-overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
}
#gameover-overlay, #lobby-overlay { background: rgba(4, 8, 14, .55); backdrop-filter: blur(3px); }
#lobby-overlay { z-index: 22; pointer-events: none; }
#gameover-overlay { pointer-events: auto; }   /* o HUD é pointer-events:none → o modal precisa reativar p/ clicar nos botões */
/* "Você foi destruído": MINIMALISTA — só texto, sem overlay/blur/caixa (não tampa o jogo) */
#death-overlay { background: none; backdrop-filter: none; pointer-events: none; align-items: flex-start; padding-top: 22vh; }
.lobby-card {
  pointer-events: auto; text-align: center; min-width: 320px; max-width: 92%;
  padding: 28px 36px; border-radius: 24px; font-family: var(--fun);
  background: var(--bg-glass); border: 1px solid rgba(255,61,139,.32);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 50px rgba(255,61,139,.14);
}
.lobby-flag { font-size: 46px; animation: wave 2.2s ease-in-out infinite; }
.lobby-card h2 { font-weight: 700; font-size: 26px; letter-spacing: 1px; margin: 4px 0; color: #fff; }
.lobby-room { color: #9fb4cc; font-size: 14px; margin-bottom: 16px; }
.lobby-room b { color: var(--pink); font-size: 18px; letter-spacing: 2px; }
.lobby-players { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; }
.lp-title { font-size: 12px; letter-spacing: 1px; color: #9fd4ff; margin-bottom: 8px; }
#lobby-list { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
#lobby-list li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #e8f2fb; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.03); transition: background .2s; }
#lobby-list li.ready { background: rgba(46,226,122,.14); border: 1px solid rgba(46,226,122,.3); }
#lobby-list .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
#lobby-list .lp-name { flex: 1; text-align: left; }
#lobby-list .lp-ok { font-size: 13px; }
#lobby-list .lp-wait { font-size: 12px; opacity: .55; }
#lobby-confirm { background: linear-gradient(180deg, #4fe39a, #1fbf6e) !important; box-shadow: 0 8px 22px rgba(46,226,122,.45) !important; display: block; width: 100%; margin-top: 8px !important; }
#lobby-invite, #lobby-start, #lobby-confirm {
  font-family: var(--fun); font-weight: 700; cursor: pointer; border: none; border-radius: 14px;
  padding: 13px 26px; margin: 4px 6px; font-size: 15px; color: #fff; transition: transform .12s;
}
#lobby-invite:hover, #lobby-confirm:hover { transform: translateY(-2px); }
#lobby-invite { background: rgba(57,192,255,.18); border: 1px solid var(--border-glass); }
#lobby-start { font-size: 18px; background: linear-gradient(180deg, #ff7aae, #e6457f); box-shadow: 0 8px 22px rgba(255,61,139,.5); display: block; width: 100%; margin-top: 10px; }
#lobby-invite:hover, #lobby-start:hover { transform: translateY(-2px); }
#lobby-wait { color: var(--gold); font-size: 15px; font-weight: 600; margin-top: 10px; }
.lobby-hint { color: #7e8ba0; font-size: 11.5px; margin-top: 12px; }
.gameover-card {
  text-align: center; padding: 34px 48px; border-radius: 22px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
/* card de morte SEM caixa: texto com contorno preto, compacto */
.death-card { text-align: center; background: none; border: none; box-shadow: none; padding: 0;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 6px rgba(0,0,0,.7); }
.death-icon { font-size: 26px; animation: none; }
.death-card h2 { font-family: 'Orbitron', sans-serif; color: var(--accent); margin: 1px 0; letter-spacing: 1px; font-size: 19px; }
.death-card p { color: #eaf2fa; margin: 1px 0; font-size: 13px; }
#death-by { color: #ffd23f; font-size: 14px; }
body.touch .death-icon { font-size: 22px; }
body.touch .death-card h2 { font-size: 15px; }
body.touch .death-card p { font-size: 11.5px; }
#death-by b { color: #fff; }

#attack-warn {
  position: absolute; left: 50%; top: 110px; transform: translateX(-50%);
  background: rgba(120, 20, 28, 0.85); border: 1px solid rgba(255, 90, 100, 0.5);
  color: #ffe1e3; font-size: 14px; font-weight: 600; padding: 8px 18px; border-radius: 10px;
  white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: warnPulse .6s ease-in-out infinite alternate;
}
#attack-warn b { color: #fff; }
@keyframes warnPulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.04); } }
.gameover-card { min-width: 320px; }
.trophy { font-size: 60px; }
.gameover-card h2 { font-family: 'Orbitron', sans-serif; color: var(--gold); margin: 6px 0 16px; }
#final-ranking { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
#final-ranking li {
  display: flex; align-items: center; gap: 10px; font-size: 15px; color: #e8f2fb;
  padding: 8px 16px; border-radius: 10px; background: rgba(255,255,255,.04);
}
#final-ranking li:first-child { background: rgba(255,210,63,.16); border: 1px solid rgba(255,210,63,.4); }
#final-ranking .rk { font-family: 'Orbitron', sans-serif; color: #9fd4ff; width: 26px; }
#final-ranking .nm { flex: 1; text-align: left; }
#final-ranking .pts { font-family: 'Orbitron', sans-serif; color: #ffd23f; }
.gameover-btns { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.gameover-btns button {
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 1px;
  cursor: pointer; padding: 12px 22px; border-radius: 12px; border: none; color: #08101c;
  background: linear-gradient(180deg, #6fd6ff, #1ea8e8); box-shadow: 0 6px 18px rgba(57,192,255,.4);
  transition: transform .12s;
}
.gameover-btns button:hover { transform: translateY(-2px); }
.gameover-btns #btn-quit { background: linear-gradient(180deg, #ff8a9b, #e6455a); color: #fff; box-shadow: 0 6px 18px rgba(230,69,90,.4); }
.next-match { color: #8fa6c0; font-size: 12px; }

@media (max-width: 640px) {
  #scoreboard { width: 150px; top: 60px; }
  #killfeed { width: 160px; }
  #hpbar { width: 130px; bottom: 96px; }
}

/* ============ ARMA ATUAL — só o ícone (sem caixa nem texto) + badge de munição ============ */
#weapon {
  position: absolute; right: 24px; bottom: 22px;
  width: 78px; height: 78px; display: flex; align-items: center; justify-content: center;
}
#weapon.empty { opacity: .5; }
#weapon-icon { width: 78px; height: 78px; flex: 0 0 78px; display: flex; align-items: center; justify-content: center; }
#weapon-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
#weapon.empty #weapon-icon img { opacity: .55; filter: grayscale(.3); }
#weapon:not(.empty) #weapon-icon { animation: weaponPop .35s cubic-bezier(.2,1.5,.4,1); }
#weapon:not(.empty) #weapon-img { filter: drop-shadow(0 0 8px rgba(255,210,63,.55)); }
@keyframes weaponPop { from { transform: scale(.5); } }
.weapon-info { display: none; }   /* sem texto: o ícone já ilustra a arma */
/* badge de munição (desktop + mobile) */
#weapon-count { display: none; }
#weapon:not(.empty) #weapon-count {
  display: flex; position: absolute; right: -2px; bottom: -2px; min-width: 23px; height: 23px; padding: 0 5px;
  align-items: center; justify-content: center; border-radius: 999px;
  background: var(--pink); color: #fff; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 12px;
  border: 2px solid rgba(9,16,30,.92); box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

/* ============ CONTROLES TOUCH (estilo Smash Karts, transparentes) ============ */
#touch-controls { display: none; }
body.touch #touch-controls { display: block; }

/* mobile: segurar a tela/controles não seleciona texto nem abre callout (copiar/traduzir) */
body.touch #hud, body.touch #hud * {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.touch-btn { -webkit-touch-callout: none; }

/* ===== HUD MOBILE minimalista: só o essencial no topo; controles é o que importa ===== */
body.touch #brand, body.touch #speedo, body.touch #net-status, body.touch #killfeed { display: none; }

/* TOPO-CENTRO: [❤ vida] [⏱ tempo] [🔊 volume] [🎵 música] numa linha só */
body.touch #timer {
  top: 7px; left: 50%; right: auto; transform: translateX(-50%);
  width: 122px; height: 37px; padding: 0; border: 0; border-radius: 0; opacity: 1; box-shadow: none;
  background: url('../icons/hud-timer-centro.png?v=2153') center / 100% 100% no-repeat;
}
body.touch #timer small { display: none; }
body.touch #timer-value { font-size: 17px; }
body.touch #timer::before { content: none; }   /* sem ⏱: a placa já é a moldura */

body.touch #hpbar {
  display: block; top: 10px; bottom: auto; left: auto; right: calc(50% + 64px); width: 104px;
  padding: 5px 11px 5px 28px; border-radius: 999px; opacity: .92;
  border: 2px solid rgba(110,175,255,.45); background: rgba(9,16,30,.72);
}
body.touch #hpbar .hp-label { display: none; }
body.touch #hpbar .hp-track { height: 11px; border-radius: 999px; }
body.touch #hpbar::before {
  content: '❤'; position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: #ff4d6a;
}
/* áudio: junto do relógio (centro), não mais na borda direita */
body.touch #mute-btn, body.touch #music-btn {
  top: 8px; width: 38px; height: 38px; padding: 0; border-radius: 50%; opacity: .92;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  border: 2px solid rgba(110,175,255,.45); background: rgba(9,16,30,.72); animation: none;
}
body.touch #mute-btn { left: calc(50% + 64px); right: auto; }
body.touch #music-btn { left: calc(50% + 108px); right: auto; }

/* botão SAIR no canto superior-esquerdo (mobile) */
body.touch #leave-btn {
  top: 8px; left: 8px; right: auto; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  border: 2px solid rgba(255,120,130,.55); background: rgba(34,12,16,.78);
}
/* RANKING: abaixo do botão sair — DELICADO no mobile (fonte menor, painel translúcido,
   bolinha/pontos compactos → o NOME ganha espaço e dá pra ler sem atrapalhar os controles) */
body.touch #scoreboard { width: 118px; top: 50px; left: 8px; padding: 5px 7px; border-radius: 10px; opacity: .72; box-shadow: none; }
body.touch .sb-title { font-size: 8px; letter-spacing: 1px; margin-bottom: 4px; }
body.touch #sb-list { gap: 2px; }
body.touch #sb-list li { font-size: 9px; padding: 2px 4px; gap: 4px; border-radius: 5px; }
body.touch #sb-list .dot { width: 6px; height: 6px; flex: 0 0 6px; }
body.touch #sb-list .nm { letter-spacing: -.2px; }
body.touch #sb-list .pts { min-width: 13px; font-size: 9px; }
body.touch #sb-list .dia, body.touch #sb-list .skull { font-size: 8px; }

/* TOPO-DIREITA: minimapa + (convidar/tela cheia) discretos */
body.touch #minimap { width: 76px; height: 76px; top: 8px; right: 8px; opacity: .82; }
body.touch #fs-btn, body.touch #invite-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; opacity: .9;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  border: 2px solid rgba(110,175,255,.45); background: rgba(9,16,30,.72); animation: none;
}
body.touch #invite-btn { top: 8px; right: 92px; border-color: rgba(255,150,185,.6); background: linear-gradient(180deg,#ff7aa8,#e6457f); box-shadow: none; }
body.touch #fs-btn { top: 52px; right: 92px; }
body.touch #invite-btn .lbl { display: none; }
body.touch #invite-btn .ico { font-size: 16px; margin-right: 0; }

/* ARMA ATUAL: só o ícone (moldura própria) na DIREITA, acima do botão de atirar */
body.touch #weapon {
  top: 92px; right: 10px; bottom: auto; transform: none;
  width: 62px; height: 62px; min-width: 0; padding: 0; gap: 0; opacity: .98;
  justify-content: center; border: none; background: none;
}
body.touch #weapon-icon { width: 100%; height: 100%; }
body.touch #weapon:not(.empty) #weapon-count {
  right: -3px; bottom: -3px; min-width: 21px; height: 21px; font-size: 11px;
  border: 2px solid rgba(9,16,30,.9);
}

/* ===== CONTROLES TOUCH: botões grandes arredondados nas beiradas ===== */
/* (v2.16.4) clusters AFASTADOS da lateral (a mão que segura o celular tampa o canto) + botões maiores */
.touch-col { position: absolute; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.touch-col.edge-left { left: 30px; }
/* lado direito = cluster de 2 colunas: [🔥 drift / ◀◀ ré] + [💥 atirar / ▶ virar] */
.touch-cluster { position: absolute; bottom: 22px; right: 30px; display: flex; align-items: flex-end; gap: 18px; }
.touch-stack { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.touch-btn.rev { font-size: 26px; background: rgba(55,95,150,.26); }
.touch-btn {
  position: relative;   /* CRÍTICO: ancora o ::before (imagem) NO botão, não na coluna/cluster (senão a imagem estoura e sobrepõe) */
  border-radius: 26px; border: 2px solid rgba(255,255,255,.38); color: rgba(255,255,255,.92);
  background: rgba(20,32,52,.22); -webkit-user-select: none; user-select: none; touch-action: none;  /* ~30% mais transparente */
  pointer-events: auto; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px); cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.22);
}
.touch-btn:active { transform: scale(0.93); background: rgba(90,170,255,.42); }
/* tamanhos PADRONIZADOS (circulares como as imagens). (v2.16.4) setas (steer) BEM maiores p/ achar fácil com o polegar */
.touch-btn.steer { width: 108px; height: 108px; font-size: 48px; border-radius: 50%; }   /* virar (era 88) */
.touch-btn.big { width: 84px; height: 84px; font-size: 34px; border-radius: 50%; background: rgba(165,55,72,.32); }   /* atirar (era 76) */
.touch-btn.small { width: 80px; height: 80px; font-size: 30px; border-radius: 50%; }   /* ré/freio */

/* botões touch com IMAGENS metálicas (faint ~20%, destacam ao pressionar) */
#btn-left, #btn-right, #btn-brake, #btn-fire {
  background: none; border: none; box-shadow: none; font-size: 0; backdrop-filter: none;
}
#btn-left::before, #btn-right::before, #btn-brake::before, #btn-fire::before {
  content: ''; position: absolute; inset: 0;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  opacity: .2; pointer-events: none; transition: opacity .1s;
}
#btn-left:active::before, #btn-right:active::before, #btn-brake:active::before { opacity: .6; }
#btn-left::before  { background-image: url('../controls/esquerda.png'); }
#btn-right::before { background-image: url('../controls/direita.png'); }
#btn-brake::before { background-image: url('../controls/re.png'); }
/* botão de DISPARO (ação principal) — mira metálica; um pouco mais visível que os demais */
#btn-fire::before { background-image: url('../controls/atirar.png'); opacity: .55; }
#btn-fire:active::before { opacity: .95; }

/* ===== botões do HUD (sair / fullscreen / música / volume) = imagens metálicas.
   Escopo #hud #id (2 ids) p/ vencer as regras :hover e body.touch e manter posição/tamanho. ===== */
#hud #leave-btn, #hud #fs-btn, #hud #music-btn, #hud #mute-btn {
  background-color: transparent; background-repeat: no-repeat; background-position: center; background-size: contain;
  border: none; box-shadow: none; color: transparent; font-size: 0; backdrop-filter: none; animation: none;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.45)); transition: transform .12s, filter .12s;
}
#hud #leave-btn { background-image: url('../icons/hud-sair.png'); }
#hud #fs-btn    { background-image: url('../icons/hud-fullscreen.png'); }
#hud #music-btn { background-image: url('../icons/hud-musica.png'); }
#hud #mute-btn  { background-image: url('../icons/hud-volume.png'); }
#hud #leave-btn:hover, #hud #fs-btn:hover, #hud #music-btn:hover, #hud #mute-btn:hover { transform: scale(1.08); filter: drop-shadow(0 5px 12px rgba(255,80,80,.4)) brightness(1.12); }
#hud #music-btn.off { opacity: 0.45; }     /* música desligada → escurece (sem o risco vermelho) */
#hud #music-btn.off::after { display: none; }

/* tela inicial do FORM em 2 colunas no mobile deitado (logo | campos) — facilita digitar */
@media (orientation: landscape) {
  body.touch #screen-form .boot-card.form-card {
    display: flex; flex-direction: row; align-items: center; gap: 16px;
    max-width: 640px; width: 92%; text-align: left;
  }
  body.touch #screen-form .form-col-logo {
    flex: 0 0 38%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-right: 1px solid rgba(255,255,255,.1); padding-right: 14px;
  }
  body.touch #screen-form .form-col-fields { flex: 1; min-width: 0; }
  body.touch #screen-form .mini-logo { margin: 0 0 6px; width: 118px; }
  body.touch #screen-form #form-title { text-align: center; margin-bottom: 0; }
  body.touch #screen-form #form-name { margin-top: 0; }
}

/* =========================================================================
   CELULAR DEITADO — telas de navegação (menu, formulário, lobby, fim de jogo)
   Antes isto era um punhado de remendos `max-height: 460px` / `470px` (dois
   breakpoints diferentes, brigando entre si) cuja estratégia era ESCONDER coisa.
   Três problemas de verdade que ficavam:
   1. `max-height` pega janela de desktop baixa também — não é "celular deitado".
   2. `safe-area-inset-left/right` NUNCA era usado: no iPhone deitado o notch fica
      na LATERAL e comia o conteúdo (o viewport-fit=cover já estava ligado à toa).
   3. O lobby não tinha NENHUMA regra de paisagem: a bandeira de 46px + título de
      26px + lista + 3 botões estouravam a altura da tela.
   ========================================================================= */
@media (orientation: landscape) and (max-height: 500px) {
  /* o notch fica na lateral quando o aparelho está deitado */
  #boot {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  #hud, #lobby-overlay, #gameover-overlay, #death-overlay {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* LOBBY em 2 colunas: identidade à esquerda, pilotos + ações à direita.
     A lista rola sozinha — com a sala cheia ela crescia e empurrava os botões p/ fora. */
  #lobby-overlay .lobby-card {
    display: grid; grid-template-columns: 0.8fr 1.2fr; align-items: center;
    gap: 0 18px; width: min(96vw, 620px); max-width: none; padding: 12px 18px;
    max-height: 92vh;
  }
  .lobby-card .lobby-flag { font-size: 30px; grid-column: 1; margin: 0; }
  .lobby-card h2 { font-size: 17px; grid-column: 1; margin: 2px 0 3px; }
  .lobby-card .lobby-room { grid-column: 1; font-size: 12px; margin: 0; }
  .lobby-card .lobby-room b { font-size: 15px; }
  .lobby-card .lobby-players {
    grid-column: 2; grid-row: 1 / span 4; margin: 0 0 8px;
    max-height: 40vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .lobby-card #lobby-invite,
  .lobby-card #lobby-confirm,
  .lobby-card #lobby-start { grid-column: 2; margin: 3px 0; padding: 9px 14px; font-size: 13px; }
  .lobby-card .lobby-hint,
  .lobby-card #lobby-wait { grid-column: 1 / -1; font-size: 10.5px; margin-top: 4px; }

  /* FIM DE JOGO: a lista do ranking rola em vez de estourar a tela */
  #gameover-overlay .go-card { max-height: 92vh; padding: 12px 18px; }
  #final-ranking { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* RANKING GLOBAL: era `display:none` — o jogador PERDIA o ranking no celular deitado.
     Não vira 3ª coluna (não cabe): entra no FLUXO abaixo do card, compacto, e o #boot
     rola. A regra de `position: static` p/ pointer:coarse já existe lá em cima — aqui só
     desfazemos o `display:none` e encolhemos. Rolar a tela é gesto natural no celular. */
  #screen-menu #leaderboard-side {
    display: block;
    width: min(94vw, 560px); max-height: none;
    margin: 10px auto 0; padding: 8px 12px; font-size: 11.5px;
  }
  #screen-menu .lb-trophy { font-size: 16px; }
  #screen-menu .lb-h1 { font-size: 12px; }
  #screen-menu .lb-h2, #screen-menu .lb-foot { display: none; }
  #boot { align-items: flex-start; overflow-y: auto; }   /* card alto → rola, não corta */
}

/* dica de girar o celular (só em retrato no mobile) */
#rotate-hint { display: none; }
@media (orientation: portrait) {
  body.touch #rotate-hint {
    display: flex; position: fixed; inset: 0; z-index: 70; padding: 30px;
    flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center;
    background: #0a0e16; color: #eaf2fa;
  }
  body.touch #rotate-hint .ico { font-size: 70px; animation: rotate-wiggle 1.6s ease-in-out infinite; }
  body.touch #rotate-hint h2 { font-family: 'Orbitron', sans-serif; }
}
@keyframes rotate-wiggle { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(80deg); } }

/* ============ FALLBACK ============ */
#no-webgl {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  background: #0a0e16; padding: 30px;
}
#no-webgl h2 { font-family: 'Orbitron', sans-serif; }
#no-webgl p { color: #8fa6c0; line-height: 1.7; }

/* ===== retrovisor (câmera traseira): botão no centro-inferior; a janela renderiza
   no canvas via scissor — o frame só desenha a borda e captura o clique de fechar ===== */
/* pointer-events: auto é OBRIGATÓRIO — o #hud é pointer-events:none, então sem isto o
   toque ATRAVESSA o botão. Era por isso que o retrovisor não abria no celular: no PC o
   botão é display:none (usa-se a tecla C), então o bug só aparecia no touch. */
#mirror-btn {
  position: absolute; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translateX(-50%);
  width: 42px; height: 42px; border-radius: 50%; z-index: 12; cursor: pointer;
  pointer-events: auto;
  border: 1px solid var(--border-glass); background: var(--bg-glass);
  font-size: 19px; line-height: 1; color: #fff; opacity: .85;
}
#mirror-btn:hover { opacity: 1; }
#mirror-btn:active { transform: translateX(-50%) scale(.92); opacity: 1; }
#mirror-btn.hidden { display: none; }
/* alvo de toque ≥44px (mínimo confortável no dedo) — era 38px e ainda menor que o do PC */
body.touch #mirror-btn { width: 46px; height: 46px; font-size: 20px; opacity: .95; }
#mirror-frame {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 11; cursor: pointer;
  pointer-events: auto;
  border: 2px solid rgba(255,255,255,.45); border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,.55);
}
#mirror-frame.hidden { display: none; }
/* PC tem a tecla C p/ o retrovisor → o botão na tela é só do touch */
body:not(.touch) #mirror-btn { display: none; }

/* ===== placar final animado: vencedor em dourado; restos de pontos em cinza;
   faixa pulsante de novo recorde ===== */
#final-ranking li.go-winner {
  background: linear-gradient(90deg, rgba(255,210,63,.24), rgba(255,210,63,.05));
  border: 1px solid rgba(255,210,63,.5); transform: scale(1.045);
  font-weight: 800;
}
#final-ranking li.go-winner .pts { color: #ffd23f; font-size: 1.18em; }
#final-ranking .go-rest { color: #9fb4cc; font-weight: 600; font-size: 11px; }
.go-record {
  display: block; color: #ffd23f; font-size: 14px; letter-spacing: 1.5px; margin-top: 5px;
  text-shadow: 0 0 12px rgba(255,210,63,.6);
  animation: pulse .55s ease-in-out infinite alternate;
}


/* ---------- convidado: salvar e-mail no fim de jogo ---------- */
/* O campeão da partida ficava FORA do ranking por ter jogado sem e-mail, e nunca ficava
   sabendo o porquê. Agora ele descobre na hora — e conserta na hora. */
#guest-save {
  margin: 14px 0 4px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 176, 32, .10); border: 1px solid rgba(255, 176, 32, .45);
  text-align: left;
}
#guest-save.hidden { display: none; }
#guest-save p { margin: 0 0 9px; font-size: 14px; line-height: 1.35; }
.guest-row { display: flex; gap: 8px; }
#guest-email {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-glass); background: rgba(0,0,0,.35); color: #fff; font-size: 15px;
}
#guest-save-btn {
  padding: 10px 14px; border-radius: 10px; border: 0; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, #ffc74d, #e8951b); color: #241a04; font-weight: 700;
}
#guest-save-btn:disabled { opacity: .55; cursor: default; }
#guest-msg { display: block; margin-top: 7px; font-size: 11.5px; opacity: .75; }
/* deitado no celular a tela é baixa: o bloco não pode empurrar os botões pra fora */
@media (orientation: landscape) and (max-height: 500px) {
  #guest-save { margin: 8px 0 2px; padding: 8px 10px; }
  #guest-save p { font-size: 12px; margin-bottom: 6px; }
  #guest-msg { display: none; }
}

/* ---------- seletor de arena no menu (com contagem ao vivo) ---------- */
#arena-pick { margin-bottom: 14px; }
.arena-pick-title { font-size: 13px; opacity: .8; margin-bottom: 7px; letter-spacing: .3px; }
.arena-cards { display: flex; gap: 10px; }
.arena-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 8px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--border-glass); background: rgba(255,255,255,.04); color: #fff;
  transition: border-color .15s, background .15s, transform .1s;
}
.arena-card:hover { transform: translateY(-2px); }
.arena-card.sel { border-color: #ff5aa8; background: rgba(255,90,168,.14); }
.arena-emoji { font-size: 26px; line-height: 1; }
.arena-name { font-weight: 700; font-size: 14px; }
.arena-count {
  font-size: 12px; opacity: .85; padding: 1px 9px; border-radius: 999px;
  background: rgba(0,0,0,.3); min-height: 17px;
}
.arena-count.tem { background: rgba(90,224,140,.22); color: #7dffb0; }
/* deitado no celular: cards mais baixos p/ caber com os botões */
@media (orientation: landscape) and (max-height: 500px) {
  #arena-pick { margin-bottom: 8px; }
  .arena-card { padding: 7px 6px; }
  .arena-emoji { font-size: 20px; }
}
