/* ============================================================================
   Brasil Sobrevivente — visual "urna eletrônica encontra comício".
   Paleta: vermelho petista, verde-amarelo bolsonarista, cinza do Centrão,
   plástico bege de urna. Fonte pixel: VT323 (terminal/LCD, acentos decentes).
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --vermelho: #d42a2a;
  --verde: #1e9e4e;
  --verde-tecla: #12813a;
  --amarelo: #f7d117;
  --cinza: #7f8c8d;
  --fundo: #0d0d12;
  --painel: #15151d;
  --painel-borda: #26262f;
  --ink: #ecebf0;
  --muted: #a9a9b8;
  --urna-bege: #d8d3c8;
  --urna-borda: #b3ab9c;
  --lcd-fundo: #142016;
  --lcd-texto: #a8ecb4;
  --pixel: 'VT323', 'Courier New', monospace;
}

/* trava total: nada de scroll na janela; quem rola é o .stage de cada tela */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; width: 100%; }
body {
  background: var(--fundo);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", sans-serif;
  user-select: none;
}

.screen { position: fixed; inset: 0; display: none; overflow: hidden; }
.screen.active { display: flex; }

/* ---------------------------------------------------------------- palco
   Fundo das telas de menu/lobby: faixas diagonais das duas torcidas com o
   Centrão no meio + scanlines de CRT (clima de transmissão da apuração). */
#screen-menu::before, #screen-lobby::before {
  content: '';
  position: absolute; inset: -80% -60%;
  background: repeating-linear-gradient(135deg,
    rgba(212, 42, 42, .07) 0 180px,
    rgba(127, 140, 141, .05) 180px 360px,
    rgba(30, 158, 78, .07) 360px 540px);
  animation: faixas 60s linear infinite;
  pointer-events: none;
}
#screen-menu::after, #screen-lobby::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(247, 209, 23, .05), transparent 55%),
    radial-gradient(ellipse 130% 110% at 50% 50%, transparent 60%, rgba(0, 0, 0, .5)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
@keyframes faixas { to { transform: translateX(509px); } }

.stage {
  position: relative; z-index: 1;
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(20px, 4vh, 44px) clamp(14px, 3vw, 40px) 16px;
  scrollbar-width: thin;
  scrollbar-color: #33333f transparent;
}

/* ------------------------------------------------------------- cabeçalho */
.masthead { text-align: center; max-width: 1100px; flex-shrink: 0; }

.aovivo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--pixel); font-size: 1.05rem; letter-spacing: 2px;
  color: #ff8577; margin-bottom: 14px;
}
.aovivo .dot {
  width: 9px; height: 9px; background: var(--vermelho);
  box-shadow: 0 0 8px var(--vermelho);
  animation: pisca 1.1s steps(2, jump-none) infinite;
}
@keyframes pisca { 50% { opacity: .2; } }

/* bandeira pixel-art (nada de emoji) */
.pixel-flag {
  display: block; margin: 0 auto 12px;
  width: 64px; height: 44px;
  image-rendering: pixelated;
  background-size: 100% 100%;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 11" shape-rendering="crispEdges"><rect width="16" height="11" fill="%231e9e4e"/><g fill="%23f7d117"><rect x="6" y="1" width="4" height="1"/><rect x="5" y="2" width="6" height="1"/><rect x="4" y="3" width="8" height="1"/><rect x="3" y="4" width="10" height="1"/><rect x="2" y="5" width="12" height="1"/><rect x="3" y="6" width="10" height="1"/><rect x="4" y="7" width="8" height="1"/><rect x="5" y="8" width="6" height="1"/><rect x="6" y="9" width="4" height="1"/></g><g fill="%2316324a"><rect x="7" y="4" width="2" height="1"/><rect x="6" y="5" width="4" height="1"/><rect x="7" y="6" width="2" height="1"/></g></svg>');
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .45));
  animation: logo-in .5s steps(5) both;
}

.logo {
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(2.8rem, 6.5vw, 4.8rem);
  line-height: 1.1;
  letter-spacing: 1px;
  color: var(--amarelo);
  text-shadow: 0 .07em 0 var(--verde), 0 .14em 0 rgba(0, 0, 0, .55);
  text-wrap: balance;
  animation: logo-in .5s steps(5) both;
}
.logo-menor { font-size: clamp(2rem, 4.4vw, 3.2rem); }
@keyframes logo-in { from { transform: translateY(-28px); opacity: 0; } }

.tarja {
  display: inline-block;
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  letter-spacing: 6px;
  color: #fff;
  background: var(--vermelho);
  padding: 6px 18px 5px;
  margin-top: clamp(12px, 2vh, 20px);
  transform: rotate(-1.2deg);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .45);
  animation: logo-in .5s steps(5) .12s both;
}

.tagline {
  color: var(--muted); font-size: .9rem;
  margin-top: clamp(10px, 1.8vh, 18px);
  animation: sobe .4s ease-out .25s both;
}
@keyframes sobe { from { transform: translateY(10px); opacity: 0; } }

/* ----------------------------------------------------------- duas colunas */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(16px, 2.5vw, 32px);
  width: min(1160px, 100%);
  margin-top: clamp(18px, 3vh, 36px);
  align-items: start;
  animation: sobe .45s ease-out .32s both;
}
.cols-lobby { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 1000px; }

.secao-titulo {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-family: var(--pixel); font-weight: 400;
  font-size: 1.3rem; letter-spacing: 1px;
  color: var(--amarelo);
  margin-bottom: 10px;
}
.secao-titulo small { font-family: system-ui, sans-serif; font-size: .74rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
section .secao-titulo:not(:first-child), aside .secao-titulo:not(:first-child) { margin-top: 18px; }

/* ------------------------------------------------- santinhos (candidatos) */
.char-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.char-grid.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.santinho {
  background: var(--painel);
  border: 2px solid var(--painel-borda);
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .08s, border-color .08s;
}
.santinho:hover, .santinho:focus-visible { transform: translateY(-2px); border-color: #4a4a58; }
.santinho:focus-visible { outline: 2px solid var(--amarelo); outline-offset: 2px; }
.santinho.sel { border-color: var(--amarelo); background: #1b1b25; }

/* palco da miniatura: o canvas do AttackPreview demonstra a arma inicial */
.santinho .palco { display: block; background: #08080c; }
.santinho .palco canvas.atk-prev {
  display: block; width: 100%;
  image-rendering: pixelated;
}

.santinho .ficha { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.santinho .linha-nome { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.santinho .numero {
  font-family: var(--pixel); font-size: 1.25rem; line-height: 1;
  color: #111; background: var(--amarelo);
  padding: 3px 7px 4px;
  flex-shrink: 0;
}
.santinho.sel .numero { background: var(--verde); color: #fff; }
.santinho .nome { font-size: .8rem; font-weight: 700; line-height: 1.25; }
/* bonequinho andando pra baixo, encostado na direita da linha do nome */
.santinho .linha-nome .pix-sheet, .santinho .linha-nome img.pix { margin-left: auto; flex-shrink: 0; }
.santinho .desc { font-size: .7rem; color: var(--muted); line-height: 1.35; }
/* selo de voto: espaço sempre reservado pro card não mudar de tamanho */
.santinho .voto {
  font-family: var(--pixel); font-size: 1.05rem; color: #56c97e;
  letter-spacing: 1px; margin-top: auto; padding-top: 4px;
  visibility: hidden;
}
.santinho.sel .voto { visibility: visible; }

/* versão compacta (lobby): só retrato + nome */
.santinho.compacto { flex-direction: row; align-items: center; gap: 8px; padding: 6px 10px; }
.santinho.compacto .nome { font-size: .68rem; }

/* --------------------------------------------------- urna (painel do menu) */
.urna-painel {
  background: var(--urna-bege);
  border: 3px solid var(--urna-borda);
  border-radius: 10px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 14px 40px rgba(0, 0, 0, .55);
  padding: 16px 16px 12px;
  color: #26241f;
}
.urna-cabecalho {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: .62rem; color: #5c5648; letter-spacing: 1px;
  margin-bottom: 10px;
}
.urna-cabecalho b { font-family: var(--pixel); font-size: 1.05rem; letter-spacing: 0; color: #4c473d; }

.lcd {
  background: var(--lcd-fundo);
  border: 3px solid #3b352c;
  border-radius: 4px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .6);
  padding: 12px 14px;
}
.lcd label {
  display: block;
  font-family: var(--pixel); font-size: 1.05rem;
  color: #7fc08c; letter-spacing: 2px;
  margin-bottom: 6px;
}
.lcd input {
  width: 100%;
  background: transparent; border: none; outline: none;
  font-family: var(--pixel); font-size: 1.4rem;
  color: var(--lcd-texto);
  caret-color: var(--lcd-texto);
  padding: 2px 0;
}
.lcd input::placeholder { color: #6f9c79; }

/* display de código do lobby: mesmo LCD, dígitos gigantes */
.lcd-codigo { text-align: center; margin-bottom: 16px; }
.lcd-codigo strong {
  display: block;
  font-family: var(--pixel); font-weight: 400;
  font-size: 3rem; letter-spacing: 12px; line-height: 1.2;
  color: var(--lcd-texto);
  text-indent: 12px; /* compensa o letter-spacing do último dígito */
}
.lcd-codigo small { display: block; color: #6f9c79; font-size: .72rem; margin-top: 4px; }

.teclado { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.tecla {
  font-family: var(--pixel);
  border: none; cursor: pointer;
  border-radius: 6px;
  padding: 13px 12px 11px;
  letter-spacing: 2px;
  transition: transform .06s, filter .06s;
}
.tecla:hover { filter: brightness(1.08); }
.tecla:active { transform: translateY(3px); box-shadow: none !important; }
.tecla:focus-visible { outline: 3px solid #16324a; outline-offset: 2px; }
.tecla-confirma {
  font-size: 1.5rem;
  color: #fff;
  background: var(--verde-tecla);
  box-shadow: 0 4px 0 #0a4c21, inset 0 2px 0 rgba(255, 255, 255, .25);
}
.tecla-confirma small {
  display: block; font-family: system-ui, sans-serif; font-size: .7rem;
  letter-spacing: 0; font-weight: 400; color: #cdeed6; margin-top: 4px;
}
.tecla-confirma.ready-on { background: var(--vermelho); box-shadow: 0 4px 0 #6d1414, inset 0 2px 0 rgba(255, 255, 255, .25); }
.tecla-branco {
  font-size: 1.2rem;
  color: #26241f;
  background: #f4f1ea;
  box-shadow: 0 4px 0 #9c9482, inset 0 2px 0 #fff;
}

.entrar-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.campo-codigo {
  width: 100%;
  font-family: var(--pixel); font-size: 1.35rem;
  text-align: center; text-transform: uppercase; letter-spacing: 6px;
  background: #efece4;
  color: #26241f;
  border: 2px solid var(--urna-borda);
  border-radius: 6px;
  outline: none;
  padding: 10px 4px 9px;
}
.campo-codigo:focus { border-color: var(--verde-tecla); }
.campo-codigo::placeholder { color: #6b6455; letter-spacing: 3px; }

.fim-urna { text-align: center; font-size: .62rem; color: #5c5648; letter-spacing: 1px; margin-top: 10px; }

/* --------------------------------- zonas eleitorais abertas (mural de salas) */
.zonas {
  width: min(1160px, 100%);
  margin-top: clamp(20px, 3vh, 34px);
  animation: sobe .45s ease-out .4s both;
}
.zona-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-height: 236px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #33333f transparent;
  padding-right: 2px;
}
.zona-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--painel);
  border: 1px solid var(--painel-borda);
  padding: 9px 12px;
  font-size: .8rem;
}
.zona-card .codigo { font-family: var(--pixel); font-size: 1.15rem; color: var(--amarelo); letter-spacing: 2px; }
.zona-card .host { color: var(--muted); font-size: .74rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zona-card .vagas { color: #56c97e; font-weight: 700; font-size: .78rem; font-variant-numeric: tabular-nums; }
.tecla-mini {
  font-family: var(--pixel); font-size: 1.05rem; letter-spacing: 1px;
  background: var(--amarelo); color: #111;
  border: none; cursor: pointer;
  padding: 6px 10px 5px;
  box-shadow: 0 2px 0 #a08908;
  flex-shrink: 0;
}
.tecla-mini:hover { filter: brightness(1.08); }
.tecla-mini:active { transform: translateY(2px); box-shadow: none; }
.tecla-mini:focus-visible { outline: 2px solid var(--amarelo); outline-offset: 2px; }
.zona-vazia { color: #7c7c8a; font-size: .78rem; padding: 8px 2px; grid-column: 1 / -1; }
.error { color: #ff6b6b; font-size: .8rem; min-height: 1.2em; margin-top: 10px; }
/* a linha de erro do menu mora dentro do plástico bege da urna */
.urna-painel .error { color: #a11212; margin-top: 8px; margin-bottom: -2px; text-align: center; }

/* ---------------------------------------------------------------- rodapé */
.rodape {
  margin-top: auto;
  padding-top: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  flex-shrink: 0;
}
.controles { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: .74rem; }
.controles kbd {
  font-family: var(--pixel); font-size: .95rem;
  background: #1d1d26; border: 1px solid #33333f; border-bottom-width: 3px;
  border-radius: 4px; padding: 1px 6px; color: var(--ink);
  margin-right: 2px;
}
.disclaimer { color: #80808e; font-size: .72rem; max-width: 68ch; }

/* ------------------------------------------------------------------ lobby */
.lobby-players { display: flex; flex-direction: column; gap: 6px; }
.lobby-player {
  display: flex; align-items: center; gap: 10px;
  background: var(--painel); border: 1px solid var(--painel-borda);
  padding: 8px 12px; font-size: .88rem;
}
.lobby-player .cand { color: var(--muted); font-size: .74rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-player .st {
  font-family: var(--pixel); font-size: 1rem; letter-spacing: 1px;
  padding: 2px 8px; border: 1px solid currentColor; flex-shrink: 0;
}
.lobby-player .st.ok { color: #56c97e; }
.lobby-player .st.wait { color: var(--amarelo); }
.lobby-player .st.chefe { color: var(--amarelo); background: rgba(247, 209, 23, .12); }
.lobby-player .st.off { color: #ff6b6b; }

.dica { color: var(--muted); font-size: .8rem; margin-top: 10px; }

/* Seletor de dificuldade (só o chefe da chapa clica; o resto assiste) */
.diff-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.diff-card {
  background: var(--painel); border: 2px solid var(--painel-borda);
  padding: 10px 6px 8px; text-align: center;
  transition: transform .08s, border-color .08s;
}
.diff-card.clickable { cursor: pointer; }
.diff-card.clickable:hover { transform: translateY(-2px); border-color: #4a4a58; }
.diff-card.sel { border-color: var(--amarelo); background: #1b1b25; }
/* nível de barbárie: quadradinhos acesos no lugar de emoji */
.diff-card .nivel { display: flex; justify-content: center; gap: 3px; margin-bottom: 6px; }
.diff-card .nivel i { width: 8px; height: 8px; background: #2c2c38; }
.diff-card .nivel i.on { background: var(--amarelo); }
.diff-card.sel .nivel i.on { background: var(--verde); }
.diff-card .nome { font-family: var(--pixel); font-size: 1.15rem; color: var(--ink); }
.diff-desc { color: var(--muted); font-size: .74rem; min-height: 2.4em; margin: 8px 0 0; line-height: 1.3; }

/* --------------------------------------------------------- responsividade */
@media (max-width: 1020px) {
  .cols, .cols-lobby { grid-template-columns: 1fr; }
  .cols > aside { order: -1; max-width: 460px; width: 100%; margin: 0 auto; }
  .cols-lobby > aside { order: 0; margin: 0; max-width: none; }
  .char-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .char-grid { grid-template-columns: 1fr; }
  .char-grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  #screen-menu::before, #screen-lobby::before, .aovivo .dot { animation: none; }
  .logo, .pixel-flag, .tarja, .tagline, .cols, .zonas { animation: none; }
}

/* caixa genérica dos overlays de fim de jogo */
.menu-box {
  background: var(--painel);
  border: 2px solid #333;
  border-radius: 14px;
  padding: 28px 34px;
  width: min(680px, 94vw);
  max-height: 94vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 0 60px rgba(0,0,0,.7);
}
.subtitle { font-family: var(--pixel); font-size: 1.9rem; letter-spacing: 2px; line-height: 1.4; color: var(--vermelho); }

.btn {
  padding: 12px 18px; border: none; border-radius: 8px; font-size: 1rem;
  font-weight: bold; letter-spacing: 1px; cursor: pointer; color: #111;
  transition: transform .08s, filter .08s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn-green { background: var(--verde); color: #fff; }
.btn-yellow { background: var(--amarelo); }
.btn-mini { padding: 6px 12px; font-size: .72rem; }

/* ======================= JOGO / HUD ======================= */
#screen-game { background: #000; }
#game-canvas, #game-canvas canvas { position: absolute; inset: 0; }

#hud { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; }
#hud-top { display: flex; justify-content: space-between; padding: 10px 14px; align-items: flex-start; }
#hud-center { text-align: center; flex: 1; }
#hud-timer { font-family: var(--pixel); font-size: 2.4rem; color: #fff; text-shadow: 3px 3px 0 #000; font-variant-numeric: tabular-nums; }
.urna-title { font-family: var(--pixel); font-size: 1.25rem; }
.pause-title { font-family: var(--pixel); font-size: 1.5rem; }

#hud-boss { width: min(480px, 50vw); margin: 4px auto 0; }
#hud-boss-name { font-size: .8rem; color: var(--amarelo); text-shadow: 0 1px 3px #000; margin-bottom: 2px; }
.bossbar { height: 12px; background: #000a; border: 1px solid #a00; border-radius: 6px; overflow: hidden; }
#hud-boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #d42a2a, #ff7b3b); transition: width .2s; }

#hud-party { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.party-row { background: #000a; border-radius: 6px; padding: 4px 8px; font-size: .74rem; }
.party-row .php { height: 5px; border-radius: 3px; background: #400; margin-top: 3px; overflow: hidden; }
.party-row .php > div { height: 100%; background: var(--verde); }
.party-row.downed { outline: 1px solid var(--vermelho); }

#hud-feed { min-width: 220px; max-width: 300px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.feed-item { background: #000c; border-left: 3px solid var(--amarelo); padding: 4px 8px; font-size: .72rem; border-radius: 4px; animation: feedin .2s; max-width: 100%; }
.feed-item.boss { border-left-color: var(--vermelho); font-weight: bold; }
@keyframes feedin { from { transform: translateX(20px); opacity: 0; } }

#hud-bottom { display: flex; align-items: flex-end; gap: 14px; padding: 12px 70px 12px 16px; }
#hud-weapons { display: flex; gap: 6px; }
.wslot { width: 44px; height: 44px; background: #000a; border: 1px solid #444; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; position: relative; }
.wslot small { position: absolute; bottom: 0; right: 2px; font-size: .6rem; color: var(--amarelo); font-weight: bold; }

#hud-bars { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.hpbar, .xpbar { position: relative; height: 18px; background: #000a; border-radius: 9px; overflow: hidden; border: 1px solid #333; }
.hpbar span, .xpbar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: bold; text-shadow: 0 1px 2px #000; }
#hud-hp-fill { height: 100%; background: linear-gradient(90deg, #1e9e4e, #6fdf7f); transition: width .15s; }
.xpbar { height: 12px; }
#hud-xp-fill { height: 100%; background: linear-gradient(90deg, #f7d117, #ffef7a); transition: width .15s; }

#hud-level { font-family: var(--pixel); font-size: 1.55rem; color: var(--amarelo); text-shadow: 0 2px 4px #000; }

/* Minimapa: o tabuleiro inteiro no canto inferior direito (bosses + chapa) */
#hud-minimap {
  position: absolute; right: 12px; bottom: 84px;
  width: 180px; height: 180px;
  background: rgba(8, 10, 8, .68);
  border: 2px solid #444; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}

#hurt-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 120px 40px rgba(212,42,42,.0); transition: box-shadow .25s; }
#hurt-vignette.on { box-shadow: inset 0 0 120px 40px rgba(212,42,42,.55); transition: none; }

#frozen-overlay {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%);
  background: #123a5acc; border: 2px solid #4aa3df; padding: 10px 18px; border-radius: 10px;
  font-weight: bold; display: none;
}

/* Pausa democrática: alguém está na urna, o mundo espera */
#pause-overlay {
  position: absolute; inset: 0; background: rgba(8, 8, 14, .55);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.pause-box {
  background: var(--painel); border: 2px solid var(--amarelo); border-radius: 14px;
  padding: 22px 34px; text-align: center; font-size: 1rem;
  box-shadow: 0 12px 60px #000; animation: feedin .2s;
}
.pause-title { font-weight: 700; letter-spacing: 3px; color: var(--amarelo); margin-bottom: 8px; }
.pause-timer { color: #aaa; font-size: .8rem; margin-top: 8px; }
.pause-timer span { color: var(--vermelho); font-weight: 900; font-size: 1rem; }
.pause-quit { margin-top: 14px; background: var(--vermelho); color: #fff; }

.urna-timer { margin-left: 12px; font-weight: 900; color: #16324a; }
.urna-timer.urgente { color: #c1272d; animation: piscar .4s infinite; }
@keyframes piscar { 50% { opacity: .3; } }

/* Pixel art nítida em qualquer <img> de sprite */
img.pix { image-rendering: pixelated; vertical-align: middle; }
.party-row img.pix { margin-right: 2px; }

/* Retrato via sprite sheet (personagens com atlas): recorte CSS do PNG.
   Com .walk anima o ciclo frontal (cols 0-2 da linha 0 do atlas) */
.pix-sheet {
  display: inline-block;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  vertical-align: middle;
}
.party-row .pix-sheet { margin-right: 2px; }
.pix-sheet.walk { animation: walk-down 0.55s steps(3) infinite; }
@keyframes walk-down {
  from { background-position-x: 0; }
  to { background-position-x: calc(var(--cell) * -3); }
}

/* Placar da CPI (segure TAB) */
#stats-overlay {
  position: absolute; inset: 0; background: rgba(8, 8, 14, .72);
  display: flex; align-items: center; justify-content: center; z-index: 9;
  backdrop-filter: blur(2px);
}
.stats-box {
  background: var(--painel); border: 2px solid var(--amarelo); border-radius: 14px;
  padding: 20px 26px; width: min(560px, 92vw); max-height: 86vh; overflow-y: auto;
  box-shadow: 0 12px 60px #000; animation: feedin .15s;
}
.stats-title { font-family: var(--pixel); font-size: 1.35rem; color: var(--amarelo); text-align: center; margin-bottom: 14px; letter-spacing: 2px; }
.stats-hint { color: #888; font-size: .7rem; text-align: center; margin-top: 12px; }
.stats-ping { font-family: var(--pixel); font-size: 1.1rem; letter-spacing: 1px; margin-left: 8px; }

/* Medidor de FPS: canto superior direito, sobre o canvas mas sob os overlays */
#perf-hud {
  position: absolute; top: 6px; right: 8px; z-index: 8;
  font-family: var(--pixel); font-size: 1.05rem; letter-spacing: 1px;
  color: #2ecc71; background: rgba(0,0,0,.45); border-radius: 6px;
  padding: 3px 8px; pointer-events: none; user-select: none;
}
.stats-player { background: #0c0c10; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.stats-player.me { outline: 1px solid var(--amarelo); }
.stats-player-head { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.stats-total { margin-left: auto; color: var(--vermelho); font-weight: bold; font-size: .8rem; }
.stats-weapons { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.stats-weapon { display: flex; align-items: center; gap: 8px; font-size: .78rem; background: #14141c; border-radius: 6px; padding: 4px 10px; }
.stats-weapon .sw-emoji { font-size: 1rem; }
.stats-weapon .sw-nome { flex: 1; color: #ccc; text-align: left; }
.stats-weapon .sw-lvl { color: var(--amarelo); font-weight: bold; }
.stats-weapon .sw-kills { color: var(--vermelho); font-weight: bold; min-width: 52px; text-align: right; }

/* ======================= URNA ======================= */
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 10; pointer-events: all; }

.urna-box {
  background: #d8d3c8; /* aquele plástico bege oficial */
  border-radius: 12px; padding: 16px; width: min(760px, 94vw);
  border: 4px solid #b9b2a4; box-shadow: 0 20px 80px #000;
  color: #222;
}
.urna-header { text-align: center; margin-bottom: 12px; }
.urna-title { display: block; font-weight: 900; letter-spacing: 2px; color: #16324a; }
.urna-sub { display: block; font-size: .7rem; color: #555; }
.urna-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.urna-choice {
  background: #16324a; color: #eee; border-radius: 8px; padding: 14px 10px;
  cursor: pointer; text-align: center; border: 3px solid transparent;
  transition: transform .08s, border-color .08s; min-height: 170px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.urna-choice:hover { transform: translateY(-3px); border-color: var(--amarelo); }
.urna-choice .num { background: var(--amarelo); color: #111; font-weight: 900; width: 26px; height: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.urna-choice .emoji { font-size: 2rem; }
.urna-choice .nome { font-weight: bold; font-size: .85rem; }
.urna-choice .desc { font-size: .68rem; color: #bcd; line-height: 1.3; }
.urna-footer { text-align: center; font-size: .72rem; color: #555; margin-top: 10px; }

/* ======================= CASSINO DA MALETA (CPI da BET) ======================= */
.casino-box {
  background: radial-gradient(ellipse at top, #14532d, #052012); /* feltro de mesa de jogo */
  border: 6px solid #d4a017;
  border-radius: 18px; padding: 22px 30px; width: min(520px, 92vw);
  text-align: center; animation: casino-glow .5s infinite alternate;
}
@keyframes casino-glow {
  from { box-shadow: 0 0 40px #d4a01755, 0 20px 80px #000; border-color: #d4a017; }
  to   { box-shadow: 0 0 100px #ffd75088, 0 20px 80px #000; border-color: #ffe14d; }
}
.casino-title { font-family: var(--pixel); font-size: 1.45rem; color: #ffe14d; text-shadow: 2px 2px 0 #000; letter-spacing: 2px; }
.casino-sub { font-size: .68rem; color: #9fd4a8; letter-spacing: 3px; margin: 6px 0 16px; }
.casino-slot {
  background: #0c0c10; border: 3px solid #d4a017; border-radius: 12px;
  min-height: 190px; padding: 18px 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.casino-emoji { font-size: 3.4rem; line-height: 1; }
.casino-nome { font-family: var(--pixel); font-size: 1.2rem; color: #fff; letter-spacing: 1px; }
.casino-desc { font-size: .78rem; color: #bbb; line-height: 1.35; min-height: 2.6em; max-width: 380px; }
.casino-slot.landed { animation: casino-land .35s; }
.casino-slot.landed.good { border-color: #2ecc71; box-shadow: inset 0 0 30px #2ecc7188; }
.casino-slot.landed.bad { border-color: #d42a2a; box-shadow: inset 0 0 30px #d42a2a88; }
@keyframes casino-land { 0% { transform: scale(1.08); } 100% { transform: scale(1); } }
.casino-player { margin-top: 12px; font-size: .74rem; color: #d8d3c8; letter-spacing: 1px; }

.go-frase { font-size: 1.1rem; color: var(--amarelo); margin: 14px 0; }
#go-stats { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.go-row { display: flex; justify-content: space-between; background: #0c0c10; padding: 8px 14px; border-radius: 8px; font-size: .85rem; }

#btn-mute { position: fixed; bottom: 10px; right: 10px; z-index: 50; background: #0008; border: 1px solid #444; border-radius: 8px; font-size: 1.1rem; padding: 6px 10px; cursor: pointer; }
