/* Página ao vivo: pensada para o telão (TV/projetor) e também para o celular. */
.live-wrap {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}

.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.live-title { font-size: clamp(30px, 6vw, 56px); margin: 0; flex: 1; text-align: center; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px;
  background: rgba(179, 0, 27, .25); border: 1px solid #ff3040; font-weight: 800; letter-spacing: 2px; font-size: 14px;
}
.rec { width: 10px; height: 10px; border-radius: 50%; background: #ff3040; box-shadow: 0 0 10px #ff3040; animation: recPulse 1.2s infinite; }
@keyframes recPulse { 50% { opacity: .25; } }
.sound-btn {
  padding: 8px 14px; border-radius: 99px; font: 800 14px 'Nunito', sans-serif; cursor: pointer;
  color: var(--text); background: rgba(20, 8, 35, .7); border: 1px solid rgba(255,255,255,.2);
}
.sound-btn.on { border-color: var(--green); color: var(--green); }

/* --------------------------------------------------------------- números */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat {
  text-align: center; padding: 10px 6px; border-radius: 14px;
  background: rgba(20, 8, 35, .7); border: 1px solid rgba(255,255,255,.1);
}
.stat b { display: block; font-size: clamp(22px, 5vw, 34px); color: var(--orange-2); }
.stat span { font-size: 13px; color: var(--muted); }

/* ----------------------------------------------------------------- palco */
.stage {
  position: relative; min-height: 340px; padding: 26px 18px; border-radius: 24px; text-align: center;
  background: linear-gradient(160deg, rgba(107, 47, 179, .35), rgba(20, 8, 35, .9));
  border: 1px solid rgba(180, 120, 255, .3);
  box-shadow: 0 20px 50px rgba(0,0,0,.5), inset 0 0 40px rgba(107, 47, 179, .25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  overflow: hidden;
}
.stage-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.stage .enter { animation: screenIn .6s cubic-bezier(.2, .9, .3, 1.2); }
.stage-label { margin: 0; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--orange-2); font-size: 14px; }
.stage-title { font-family: 'Creepster', cursive; font-weight: 400; margin: 0; font-size: clamp(32px, 7vw, 64px); color: var(--orange); text-shadow: 0 0 14px rgba(255,117,24,.5); line-height: 1.05; }
.stage-text { margin: 0; font-size: clamp(17px, 3vw, 24px); line-height: 1.35; }
.stage-text b { color: var(--orange-2); }
.stage .big-emoji { font-size: clamp(64px, 12vw, 110px); }

.duel { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 40px); width: 100%; }
.who { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; flex: 1; max-width: 260px; }
.who small { font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-size: 12px; }
.who .ph {
  width: clamp(90px, 22vw, 180px); aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--orange); box-shadow: 0 0 30px rgba(255, 117, 24, .45); background: #222;
}
.who.target .ph { border-color: #b37bff; box-shadow: 0 0 30px rgba(179, 123, 255, .45); filter: grayscale(.6) sepia(.3); }
.who .nm { font-family: 'Creepster', cursive; font-size: clamp(24px, 5vw, 44px); letter-spacing: 1px; overflow-wrap: anywhere; }
.duel .arrow { font-size: clamp(30px, 6vw, 56px); animation: bob 1.6s ease-in-out infinite; }

/* sorteio: "rolos" girando */
.reel .ph, .reel .nm { transition: none; }
.reel.spinning .ph { filter: blur(2px); }
.reel.landed { animation: pop .5s; }

.qdots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.qdots span {
  width: clamp(42px, 8vw, 60px); height: clamp(42px, 8vw, 60px); display: grid; place-items: center;
  font-size: clamp(22px, 4vw, 32px); border-radius: 50%;
  background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.15);
}
.qdots span.now { border-color: var(--orange); box-shadow: 0 0 16px rgba(255,117,24,.6); animation: heartbeat 1.2s infinite; }
.qdots span.ok { border-color: var(--green); animation: pop .5s; }
.qdots span.bad { border-color: #ff3040; animation: shake .45s; }

.clock { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--muted); }

.verdict { font-family: 'Creepster', cursive; font-size: clamp(38px, 9vw, 80px); margin: 0; line-height: 1; }
.verdict.win { color: var(--green); text-shadow: 0 0 18px rgba(124,255,107,.6); }
.verdict.lose { color: #ff3040; text-shadow: 0 0 18px rgba(255,0,30,.6); animation: flickerAnim 2.5s infinite; }
.stage .prenda-card { max-width: 640px; }

/* pergunta ao vivo */
.duel.compact { gap: 12px; }
.duel.compact .who { flex: 0 1 auto; flex-direction: row; max-width: none; gap: 10px; }
.duel.compact .ph { width: clamp(44px, 7vw, 64px); border-width: 3px; }
.duel.compact small { display: none; }
.duel.compact .nm { font-size: clamp(20px, 3.5vw, 30px); }
.duel.compact .arrow { font-size: clamp(22px, 4vw, 32px); }

.lv-question {
  width: 100%; max-width: 860px; padding: 16px 18px; border-radius: 18px;
  background: rgba(10, 4, 20, .55); border: 1px solid rgba(255,255,255,.12);
}
.lv-question .q-count { margin: 0 0 6px; }
.lv-question h3 { margin: 0; font-size: clamp(20px, 3.6vw, 34px); line-height: 1.25; }

.lv-options { width: 100%; max-width: 860px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv-opt {
  position: relative; text-align: left; padding: 14px 14px 14px 56px; border-radius: 14px;
  font-size: clamp(16px, 2.6vw, 24px); font-weight: 800;
  background: rgba(30, 14, 50, .85); border: 2px solid rgba(255,255,255,.12);
  opacity: 0; animation: optIn .4s forwards;
  transition: opacity .3s, border-color .3s, background .3s;
}
.lv-opt .letter {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 117, 24, .18); color: var(--orange-2); font-size: 16px;
}
.lv-opt.right { border-color: var(--green); background: rgba(40, 120, 40, .5); box-shadow: 0 0 20px rgba(124,255,107,.4); }
.lv-opt.right .letter { background: var(--green); color: #052; }
.lv-opt.wrong { border-color: #ff3040; background: rgba(150, 0, 20, .5); animation: optIn .01s forwards, shake .45s; }
.lv-opt.wrong .letter { background: #ff3040; color: #fff; }
.lv-opt.dim { opacity: .35 !important; animation: none; }
.lv-opt.chosen::after {
  content: '👉 escolheu'; position: absolute; right: 10px; top: -10px;
  padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--orange); color: #1a0700;
}

.qtimer {
  position: relative; width: 100%; max-width: 860px; height: 26px; border-radius: 99px; overflow: hidden;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
}
.qtimer i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, var(--green), var(--orange-2)); transition: width .2s linear; }
.qtimer.danger i { background: #ff3040; }
.qtimer.danger { animation: heartbeat .8s infinite; }
.qtimer span { position: relative; display: block; text-align: center; line-height: 24px; font-weight: 800; font-size: 14px; }
.lv-feedback { margin: 0; font-family: 'Creepster', cursive; font-size: clamp(28px, 5vw, 44px); animation: pop .5s; }
.lv-feedback.ok { color: var(--green); }
.lv-feedback.bad { color: #ff3040; }

/* ranking */
.ranking { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 8px; }
.ranking li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; text-align: left;
  background: rgba(10, 4, 20, .55); border: 1px solid rgba(255,255,255,.1);
  opacity: 0; animation: optIn .45s forwards;
}
.ranking li:nth-child(1) { border-color: #ffd34d; box-shadow: 0 0 18px rgba(255, 211, 77, .3); }
.ranking li.me { border-color: var(--orange); background: rgba(255, 117, 24, .15); }
.ranking .pos { width: 42px; text-align: center; font-size: 26px; font-weight: 800; flex-shrink: 0; }
.ranking .rk-ph { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #333; }
.ranking .rk-name { flex: 1; min-width: 0; font-weight: 800; font-size: clamp(17px, 2.6vw, 22px); }
.ranking small { display: block; font-weight: 600; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .rk-score { text-align: right; font-weight: 800; font-size: clamp(18px, 3vw, 26px); color: var(--orange-2); }

/* ------------------------------------------------------------- controles */
.controls { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 14px; }
.controls .tiny { grid-column: 1 / -1; text-align: center; }
.controls .btn-ghost { margin-top: 0; }

/* ------------------------------------------------------ histórico/pessoas */
.live-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 18px; }
.panel-live { padding: 16px; border-radius: 18px; background: rgba(20, 8, 35, .7); border: 1px solid rgba(255,255,255,.1); min-width: 0; }
.panel-live h2 { margin: 0 0 10px; font-size: 18px; color: var(--orange); }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history li { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); border-left: 4px solid var(--green); line-height: 1.4; }
.history li.bad { border-left-color: #ff3040; }
.history li.new { animation: optIn .5s; }
.history li small { color: var(--muted); display: block; }
.history .empty { border: none; color: var(--muted); background: none; padding: 0; }

.people { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 99px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); font-weight: 700; font-size: 14px;
}
.chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #333; }
.chip.done { opacity: .55; }
.chip.now { border-color: var(--orange); box-shadow: 0 0 10px rgba(255,117,24,.5); }
.chip .ic { font-size: 13px; }

.conn { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; min-height: 1em; }

@media (max-width: 720px) {
  .live-grid { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr; }
  .live-title { order: 3; flex-basis: 100%; }
  .stage { min-height: 300px; padding: 20px 12px; }
  .lv-options { grid-template-columns: 1fr; }
  .duel.compact .nm { font-size: 18px; }
  .ranking li { gap: 8px; padding: 8px 10px; }
  .ranking .pos { width: 30px; font-size: 20px; }
}
