/* ════════════════════════════════════════════════════════════
   OVERLAY — lateral (rank + nomes na rodada) + mesa Plinko
   Beto Bet's Games · reforma 30/05/2026 (Beto)
   Fluxo: CAPTURA → board+nomes entrando · SORTEAR → bolinhas caem
          → SORTEADOS → pós: nomes ficam na lateral embaixo do rank
   ════════════════════════════════════════════════════════════ */

/* ─── FUNDO SÓLIDO a prova de OBS (OBS apaga bg do body) ─── */
html, body.overlay-body { background:#0a0a0a !important; }
.overlay-body .overlay-bg {
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(170,255,0,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(170,255,0,0.06) 0%, transparent 60%),
    #0a0a0a !important;
}

/* ─── Visibilidade por fase ─── */
.stage-rest, .stage-live { display:none; }
body[data-phase="rank"]   .stage-rest { display:flex; }
body[data-phase="capta"]  .stage-live,
body[data-phase="plinko"] .stage-live,
body[data-phase="pos"]    .stage-live { display:grid; }
/* na fase POS some a mesa, lateral ocupa centro */
body[data-phase="pos"] .board { display:none; }
body[data-phase="pos"] .stage-live { grid-template-columns:1fr; }
body[data-phase="pos"] .rail { max-width:820px; margin:0 auto; }
/* hint da mesa some quando vai sortear */
body[data-phase="plinko"] .board-hint { display:none; }

/* ═══════════ DESCANSO (rank grande) ═══════════ */
.stage-rest {
  position:absolute; inset:70px 36px 30px; z-index:1;
  flex-direction:column; justify-content:center; align-items:stretch;
}
.stage-rest .rank-title { text-align:center; font-size:32px; margin-bottom:22px; }
.stage-rest .rank-list-big { width:100%; max-width:74%; margin:0 auto; }
.stage-rest .rank-empty-big { text-align:center; }

/* ═══════════ AO VIVO (lateral + mesa) ═══════════ */
.stage-live {
  position:absolute; inset:70px 0 0 0; z-index:1;
  grid-template-columns:430px 1fr;
  height:calc(100vh - 70px);
}

/* ─── LATERAL ─── */
.rail {
  display:flex; flex-direction:column; min-height:0;
  padding:18px 18px 22px; gap:14px;
  background:rgba(12,12,12,0.55);
  border-right:1px solid var(--border);
}
.rail-head {
  font-family:var(--ff-display); font-size:18px; letter-spacing:0.06em;
  color:var(--neon); text-shadow:0 0 12px var(--neon-glow);
  display:flex; align-items:center; gap:10px; margin-bottom:10px;
}
.rail-rank { flex:0 0 auto; }
.rail-rank-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:7px; }
.rail-rank-item {
  display:flex; align-items:center; gap:11px;
  background:rgba(31,31,31,0.6); border:1px solid var(--border);
  border-left:3px solid var(--text-mute); border-radius:var(--radius-sm);
  padding:8px 12px;
}
.rail-rank-item.gold   { border-left-color:var(--gold);   box-shadow:inset 0 0 14px rgba(255,215,0,0.10); }
.rail-rank-item.silver { border-left-color:var(--silver); }
.rail-rank-item.bronze { border-left-color:var(--bronze); }
.rr-medal { font-size:20px; min-width:26px; text-align:center; }
.rr-info { flex:1; min-width:0; }
.rr-user { font-weight:800; font-size:15px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rr-slot { font-family:var(--ff-mono); font-size:10px; color:var(--neon); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rr-val { font-family:var(--ff-display); font-size:15px; color:var(--neon-hi); text-shadow:0 0 10px var(--neon-glow); white-space:nowrap; }

.rail-sep { height:1px; background:var(--border); flex:0 0 auto; }

.rail-parts { flex:1; min-height:0; display:flex; flex-direction:column; }
.rail-parts .rail-head .num-mono { font-size:26px; line-height:1; }
.rail-list {
  flex:1; min-height:0; overflow:hidden;
  display:flex; flex-direction:column; gap:6px; /* novos no topo (JS faz reverse) */
}
.rail-item {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:var(--bg-card); border:1px solid var(--border);
  border-left:3px solid var(--neon-soft); border-radius:var(--radius-sm);
  padding:9px 13px; animation:railIn 0.4s cubic-bezier(.2,.9,.3,1.3);
}
.rail-item.flash { border-left-color:var(--neon); box-shadow:0 0 16px var(--neon-glow);
  background:linear-gradient(90deg, var(--neon-soft), var(--bg-card) 45%); }
.rail-user { font-weight:700; font-size:16px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rail-slot { font-family:var(--ff-mono); font-size:12px; color:var(--neon); white-space:nowrap; }
.rail-empty-sm { font-family:var(--ff-mono); font-size:12px; color:var(--text-dim); padding:14px 4px; letter-spacing:0.5px; }
@keyframes railIn { from{opacity:0; transform:translateX(-18px);} to{opacity:1; transform:translateX(0);} }

/* ─── MESA PLINKO ─── */
.board { position:relative; overflow:hidden;
  background:radial-gradient(circle at 50% 28%, rgba(170,255,0,0.05), rgba(5,5,5,0.4) 65%); }
.plinko-canvas { position:absolute; inset:0; width:100%; height:100%; }
.board-hint {
  position:absolute; bottom:26px; left:0; right:0; text-align:center; z-index:2;
  font-size:18px; color:var(--text-dim);
}
.plinko-reveal {
  position:absolute; inset:0; z-index:3;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  opacity:0; pointer-events:none;
  background:radial-gradient(circle at 50% 58%, rgba(0,0,0,.35), rgba(0,0,0,.85));
  transition:opacity 0.6s ease;
}
.plinko-reveal.show { opacity:1; }
.plinko-reveal-rod { font-family:var(--ff-display); color:var(--text-dim); font-size:20px; letter-spacing:0.12em; }
.plinko-reveal-title { font-family:var(--ff-display); font-size:62px; color:var(--neon);
  text-shadow:0 0 26px var(--neon-glow); margin-bottom:6px; animation:revealPop 0.6s cubic-bezier(.2,.9,.3,1.5); }
.plinko-reveal-hint { margin-top:14px; color:var(--text-dim); font-size:16px; }
@keyframes revealPop { from{opacity:0; transform:scale(.7);} to{opacity:1; transform:scale(1);} }

/* ─── 4K ─── */
@media (min-width:2560px){
  .stage-live { grid-template-columns:660px 1fr; }
  .rail-head { font-size:28px; }
  .rr-medal { font-size:30px; min-width:40px; }
  .rr-user { font-size:23px; } .rr-slot { font-size:15px; } .rr-val { font-size:23px; }
  .rail-parts .rail-head .num-mono { font-size:40px; }
  .rail-user { font-size:24px; } .rail-slot { font-size:17px; }
  .board-hint { font-size:27px; }
  .plinko-reveal-title { font-size:96px; }
}
