/* =====================================================================
   Quiz do Coral Teen — tema "palco" (identidade do Coral Teen CAAR)
   Preto, mostarda e laranja da carteirinha, logo grunge, holofotes e notas.
   ===================================================================== */

@font-face { font-family: "Exo 2"; src: url("fonts/exo2-500.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("fonts/exo2-700.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("fonts/exo2-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("fonts/exo2-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("fonts/exo2-800-italic.woff2") format("woff2"); font-weight: 800 900; font-style: italic; font-display: swap; }

:root {
  --bg: #0b0b0b;
  --surface: rgba(22, 22, 22, 0.9);
  --surface-solid: #161616;
  --field: #0f0f0f;
  --line: #2e2e2e;
  --line-strong: #444;
  --ink: #f4efe4;
  --ink-soft: #a8a196;
  --gold: #e2a922;
  --gold-light: #f2c75a;
  --gold-deep: #b8860f;
  --gold-dim: rgba(226, 169, 34, 0.35);
  --gold-text: linear-gradient(110deg, #b8820f 0%, #e2a922 28%, #fff1c9 45%, #e2a922 62%, #b07a0c 100%);
  --orange: #e8711c;
  --graphite: #5c6067;
  --ok: #2f9e5b;
  --fail: #c2361f;
  --danger-ink: #ff9c8c;
  --radius: 14px;
  --font-ui: "Exo 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -8%, rgba(226, 169, 34, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(232, 113, 28, 0.1), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(232, 113, 28, 0.08), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  min-height: 100vh;
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }
a { color: var(--gold-light); }
.muted { color: var(--ink-soft); }
.error { color: var(--danger-ink); background: rgba(194, 54, 31, 0.14); border: 1px solid rgba(194, 54, 31, 0.5); padding: 8px 12px; border-radius: 10px; margin: 0; }
.error:empty { display: none; }
.notice { background: rgba(226, 169, 34, 0.12); border: 1px solid var(--gold-dim); color: #f6d98f; padding: 10px 14px; border-radius: 10px; }
code { background: #242424; padding: 1px 5px; border-radius: 4px; }

/* ---------- palco (assets/stage.js) ---------- */
.stage, .burst { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.stage { z-index: 0; }
.burst { z-index: 50; }
body > :not(.stage):not(.burst) { position: relative; z-index: 1; }

/* Linha dourada do chão do palco */
.stage::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--orange) 50%, var(--gold) 70%, transparent);
  opacity: 0.55;
}

/* Holofotes: fachos em cone, suaves, balançando devagar */
.spot {
  position: absolute;
  top: -12vh;
  width: 70vw;
  height: 130vh;
  background: conic-gradient(at 50% 0%,
    transparent 166deg, rgba(242, 199, 90, 0.16) 175deg, rgba(255, 241, 201, 0.2) 180deg,
    rgba(242, 199, 90, 0.16) 185deg, transparent 194deg);
  -webkit-mask-image: linear-gradient(#000 10%, transparent 85%);
  mask-image: linear-gradient(#000 10%, transparent 85%);
  transform-origin: 50% 0;
  will-change: transform;
}
.spot-l { left: -30vw; animation: spot-l 11s ease-in-out infinite alternate; }
.spot-r { right: -30vw; animation: spot-r 13s ease-in-out infinite alternate; }
@keyframes spot-l { from { transform: rotate(-32deg); } to { transform: rotate(-14deg); } }
@keyframes spot-r { from { transform: rotate(32deg); } to { transform: rotate(14deg); } }

.dust {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px currentColor;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 0.8; transform: scale(1); }
}

.note {
  position: absolute;
  bottom: -60px;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 12px rgba(226, 169, 34, 0.45);
  animation: note-rise 18s linear infinite;
  will-change: transform, opacity;
}
@keyframes note-rise {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.55; }
  30% { transform: translate(var(--sway), -32vh) rotate(calc(var(--spin) * 0.4)); }
  60% { transform: translate(calc(var(--sway) * -0.6), -66vh) rotate(calc(var(--spin) * -0.3)); opacity: 0.45; }
  100% { transform: translate(var(--sway), -115vh) rotate(var(--spin)); opacity: 0; }
}

.burst span {
  position: absolute;
  line-height: 1;
  animation: burst 1.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  will-change: transform, opacity;
}
.burst .confetti { border-radius: 2px; }
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); opacity: 0; }
}

@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.15); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes opt-in { from { transform: scale(0.88) translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.logo-title, .logo-name, .countdown, .section-title {
  background: var(--gold-text);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

/* ---------- logo ---------- */
.logo {
  margin: 0 0 14px;
  text-align: center;
  font-weight: 400;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo-img {
  display: block;
  width: min(58vw, 230px);
  height: auto;
  filter: drop-shadow(0 0 22px rgba(226, 169, 34, 0.22)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));
  animation: float 6s ease-in-out infinite;
}
.logo-title {
  display: block;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(2.6rem, 13vw, 4rem);
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 0.12em;
  padding: 0 0.1em;
}
.logo-eyebrow {
  display: block;
  font-weight: 700;
  font-size: clamp(0.95rem, 3.6vw, 1.3rem);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
}
.logo-name {
  display: block;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(3rem, 14vw, 5rem);
  text-transform: uppercase;
  line-height: 1.05;
  padding: 0 0.1em;
}
.logo-sub {
  display: block;
  margin-top: 0.35em;
  font-weight: 800;
  font-size: clamp(0.95rem, 4.4vw, 1.35rem);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
}
.logo::after, .section-title::after {
  content: "";
  display: block;
  width: min(280px, 64%);
  height: 0;
  padding-bottom: min(28px, 6.4%);
  margin: 8px auto 0;
  background: url("img/divider.svg") center / contain no-repeat;
  opacity: 0.9;
}

/* ---------- botões e formulários ---------- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f6cf62 0%, var(--gold) 55%, #cf9412 100%);
  color: #161006;
  box-shadow: 0 3px 0 #8a6206, 0 8px 22px rgba(226, 169, 34, 0.25);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.btn-primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #8a6206; }
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 3.6s ease-in-out infinite;
}
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn-ghost { background: rgba(20, 20, 20, 0.85); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-small { padding: 6px 14px; font-size: 0.9rem; font-weight: 700; background: #1d1d1d; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-small:hover { border-color: var(--gold-dim); }
.btn-danger { color: var(--danger-ink); background: rgba(194, 54, 31, 0.12); border-color: rgba(194, 54, 31, 0.5); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}
label, .label { font-weight: 700; margin: 0; color: var(--ink); }

input, textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--field);
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #77716a; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(226, 169, 34, 0.18); }

/* ---------- medalhão com a foto ---------- */
.portrait {
  position: relative;
  margin: 0 auto 14px;
  width: var(--pw, 200px);
  aspect-ratio: 1;
  flex: none;
  animation: float 6s ease-in-out infinite;
}
.portrait-sm { --pw: 120px; }
.portrait-lg { --pw: 26vh; }
.portrait-frame {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #2a2a2a, #111);
  box-shadow:
    0 0 0 calc(var(--pw) * 0.025) var(--bg),
    0 0 0 calc(var(--pw) * 0.05) var(--gold),
    0 0 30px rgba(226, 169, 34, 0.3);
}
.portrait-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- entrada (celular) ---------- */
.join { max-width: 420px; margin: 0 auto; padding: 36px 18px 40px; }
.resume { display: block; margin-bottom: 16px; }

/* ---------- jogo (celular) ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(11, 11, 11, 0.85);
  border-bottom: 2px solid var(--gold);
  backdrop-filter: blur(6px);
  font-weight: 800;
  font-size: 1.1rem;
}
.score { color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }

.play {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 18px 24px;
  min-height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.play section { text-align: center; }
.play section[data-screen="question"] { text-align: left; display: flex; flex-direction: column; gap: 14px; }

.big { font-weight: 800; font-size: 2rem; line-height: 1.15; margin: 0 0 8px; color: var(--ink); }
.countdown {
  font-weight: 900;
  font-style: italic;
  font-size: 7rem;
  line-height: 1.1;
  margin: 0;
  padding: 0 0.1em;
  font-variant-numeric: lining-nums;
  animation: shimmer 6s linear infinite, beat 1s ease-in-out infinite;
}
.rank { font-size: 1.35rem; font-weight: 700; }
.rank strong { color: var(--gold); }
.points { font-size: 1.8rem; font-weight: 900; color: var(--gold); font-variant-numeric: lining-nums; }

.q-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; }

/* Logo pequeno nas telas de pergunta (logo_mark) */
.logo-mark { display: block; width: auto; height: 40px; filter: drop-shadow(0 0 10px rgba(226, 169, 34, 0.25)); }
.q-label { display: flex; align-items: center; gap: 0.7em; }
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team #nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .logo-mark { height: 34px; flex: none; }
.q-text { font-size: 1.45rem; font-weight: 800; line-height: 1.22; margin: 0; color: var(--ink); }

.timer {
  min-width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 900;
  font-variant-numeric: lining-nums tabular-nums;
  background: #111;
  color: var(--gold-light);
  border: 3px solid var(--gold);
  box-shadow: 0 0 18px rgba(226, 169, 34, 0.35);
}
.timer.hurry { background: var(--fail); border-color: var(--orange); color: #fff; box-shadow: 0 0 22px rgba(232, 113, 28, 0.6); }

/* As 4 alternativas nas cores do coral: laranja, mostarda, grafite e creme */
.opt-1 { --fill-tint: rgba(255, 255, 255, 0.26); background: linear-gradient(160deg, #f28c3e, #d65f14); color: #fff; }
.opt-2 { --fill-tint: rgba(0, 0, 0, 0.14); background: linear-gradient(160deg, #f6cf62, #d99a12); color: #1a1306; }
.opt-3 { --fill-tint: rgba(255, 255, 255, 0.2); background: linear-gradient(160deg, #73777f, #474b52); color: #fff; }
.opt-4 { --fill-tint: rgba(0, 0, 0, 0.1); background: linear-gradient(160deg, #fcf7ec, #e2d7bf); color: #1a1306; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  min-height: 112px;
  padding: 12px;
  font: inherit;
  font-weight: 800;
  font-size: 1.02rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.55), 0 10px 22px rgba(0, 0, 0, 0.4);
}
button.opt { cursor: pointer; }
button.opt:active:not(:disabled) { transform: translateY(2px); }
button.opt:disabled { opacity: 0.5; }
.shape { font-size: 1.5rem; line-height: 1; opacity: 0.95; }
section:not([hidden]) .opt { animation: opt-in 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.3) backwards; }
section:not([hidden]) .opt-2 { animation-delay: 0.08s; }
section:not([hidden]) .opt-3 { animation-delay: 0.16s; }
section:not([hidden]) .opt-4 { animation-delay: 0.24s; }

.reveal-box { border-radius: var(--radius); padding: 24px; margin-bottom: 16px; color: #fff; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); border: 2px solid rgba(255, 255, 255, 0.12); }
.reveal-box.ok { background: linear-gradient(160deg, #3dbb6f, var(--ok)); }
.reveal-box.fail { background: linear-gradient(160deg, #de4f33, var(--fail)); }
.reveal-box .big { color: #fff; }
.reveal-box .points { color: #fff; }
.reveal-box .muted { color: rgba(255, 255, 255, 0.92); }

/* ---------- telão ---------- */
.page-host { overflow: hidden; }
.host {
  height: 100vh;
  padding: 4vh 8vw 4vh;
  display: flex;
  flex-direction: column;
}
.host > section { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.host .logo { margin-bottom: 1vh; }
.host .logo-img { width: auto; height: 24vh; }
.host .logo-title { font-size: 4.6vw; }
.host .logo-sub { font-size: 1.7vw; }
.host.crowded section[data-screen="lobby"] .logo-sub { font-size: 1.2vw; }
.host .logo-eyebrow { font-size: 1.5vw; }
.host .logo-name { font-size: 5.6vw; }
.host .logo::after { width: 20vw; padding-bottom: 2vw; margin-top: 0.4vh; }

/* Lobby: logo e QR lado a lado, para sobrar a metade de baixo para as equipes */
.lobby-grid { display: flex; justify-content: center; align-items: center; gap: 6vw; margin-top: 2vh; }
.lobby-grid .logo { margin: 0; }
.qr {
  width: 23vh;
  height: 23vh;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  image-rendering: pixelated;
}
.players-count { text-align: center; font-weight: 700; font-size: 2vw; margin: 4vh 0 2vh; color: var(--ink-soft); }
.players-count strong { color: var(--gold); font-weight: 900; }

.player-chips {
  list-style: none;
  padding: 6px 6vw;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 1.2vh 1vw;
  overflow: auto;
  flex: 1;
}
.player-chips .chip {
  display: inline-block;
  font-size: 1.9vw;
  font-weight: 800;
  padding: 0.5vh 1.4vw;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(22, 22, 22, 0.92);
  color: var(--ink);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: pop 0.3s ease-out;
}
.player-chips .chip::before { content: "♪ "; color: var(--gold); }
.player-chips.many { gap: 6px; }
.player-chips.many .chip { font-size: 1.05vw; padding: 5px 12px; }
.player-chips.crowd .chip { font-size: 1.05vw; padding: 5px 11px; }

.host.crowded section[data-screen="lobby"] .logo-img { height: 15vh; }
.host.crowded section[data-screen="lobby"] .logo-title { font-size: 3vw; }
.host.crowded section[data-screen="lobby"] .logo-name { font-size: 4.2vw; }
.host.crowded section[data-screen="lobby"] .logo-eyebrow { font-size: 1.1vw; }
.host.crowded section[data-screen="lobby"] .logo::after { width: 14vw; padding-bottom: 1.4vw; }
.host.crowded .portrait-lg { --pw: 20vh; }
.host.crowded .players-count { font-size: 1.6vw; margin: 1.5vh 0 1vh; }
.player-chips.many .chip, .player-chips.crowd .chip { font-weight: 700; }

body[data-state="question"] .host, body[data-state="reveal"] .host { padding-left: 10vw; padding-right: 10vw; }
.host .q-head { font-size: 1.7vw; }
.host .timer { width: 9vh; height: 9vh; font-size: 4.2vh; }
.host-q {
  font-weight: 800;
  font-size: clamp(1.6rem, 3.2vw, 3.8rem);
  line-height: 1.18;
  text-align: center;
  margin: 2.5vh 0;
  background: rgba(16, 16, 16, 0.92);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 6px solid var(--gold);
  border-right: 6px solid var(--gold);
  border-radius: var(--radius);
  padding: 3vh 2.5vw;
  box-shadow: 0 0 40px rgba(226, 169, 34, 0.12), 0 18px 40px rgba(0, 0, 0, 0.5);
}
.host .q-label .logo-mark { height: 10vh; }
section[data-screen="prepare"] { justify-content: center; align-items: center; text-align: center; }
.host section[data-screen="prepare"] > .muted { margin: 0 0 1vh; font-size: 1.8vw; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.host .logo-mark-lg { height: 20vh; margin-bottom: 1vh; animation: float 6s ease-in-out infinite; }
.host.has-photo .logo-mark-lg { height: 11vh; }
.host .countdown { font-size: 16vh; }

.host-options { flex: 1; gap: 1.5vh 1.5vw; margin-bottom: 2vh; }
.host-options .opt {
  flex-direction: row;
  justify-content: flex-start;
  font-size: clamp(1.3rem, 2.4vw, 3rem);
  padding: 0 2vw;
  gap: 1.5vw;
  min-height: 0;
}
.host-options .opt-text { flex: 1; text-align: left; position: relative; }
.host-options .shape { font-size: 2.6vw; position: relative; }
.host-options .bar-count { font-size: 3vw; font-weight: 900; position: relative; font-variant-numeric: lining-nums; }
.host-options .opt::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 0%);
  background: var(--fill-tint, rgba(255, 255, 255, 0.24));
  transition: width 0.6s ease-out;
}
.host-options .opt.wrong { opacity: 0.25; filter: saturate(0.4); }
.host-options .opt.correct { outline: 5px solid #fff; animation: correct-pulse 1.3s ease-in-out infinite; }
.host-options .opt.correct .opt-text::after { content: "  ✔"; }
@keyframes correct-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 169, 34, 0); transform: scale(1); }
  50% { box-shadow: 0 0 0 12px rgba(226, 169, 34, 0.45); transform: scale(1.015); }
}

.section-title {
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  font-size: 5.6vw;
  line-height: 1.1;
  margin: 0 0 3vh;
  padding: 0 0.1em;
}
.section-title::after { width: 22vw; padding-bottom: 2.2vw; margin-top: 0.4vh; }

.board {
  list-style: none;
  counter-reset: pos;
  padding: 0;
  margin: 0 auto;
  width: min(900px, 62vw);
  display: flex;
  flex-direction: column;
  gap: 1.4vh;
}
.board li {
  counter-increment: pos;
  display: flex;
  align-items: center;
  gap: 2vw;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.8vh 2vw;
  font-size: 2.2vw;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  animation: pop 0.4s ease-out both;
}
.board li:nth-child(n+4) { border-left-color: var(--graphite); }
.board li::before { content: counter(pos) "º"; color: var(--gold); font-style: italic; font-weight: 900; min-width: 2.6ch; font-variant-numeric: lining-nums; }
.board .b-name { flex: 1; }
.board .b-score { color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
.board .b-delta { font-size: 1.5vw; color: #6fd39a; font-variant-numeric: lining-nums; }
.hint-final { margin: 3vh 0 0; text-align: center; font-weight: 700; font-size: 1.8vw; color: var(--ink-soft); visibility: hidden; }
.podium-done .hint-final { visibility: visible; animation: pop 0.6s ease-out 1.2s both; }

.podium { flex: 1; display: flex; justify-content: center; align-items: stretch; gap: 2vw; min-height: 0; }
/* Cada degrau é uma barra que cresce junto com a pontuação (host.js, animatePodium). */
.step {
  width: 19vw;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 1vh;
  color: var(--ink);
}
.p-bar {
  width: 100%;
  height: 0;
  flex-shrink: 0; /* nunca espremer a barra: a altura vem do host.js */
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 2vh;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 0;
  box-shadow: 0 -10px 40px rgba(226, 169, 34, 0.12);
}
.step-1 .p-bar { background: linear-gradient(180deg, #f6cf62, #c98d0e); }
.step-2 .p-bar { background: linear-gradient(180deg, #e3e6ea, #8e949b); }
.step-3 .p-bar { background: linear-gradient(180deg, #f39a55, #b0500f); }
.p-name {
  font-weight: 800; font-size: 2.4vw; text-align: center; word-break: break-word; line-height: 1.1;
  opacity: 0; transform: translateY(1.5vh) scale(0.85); transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.4);
}
.step.done .p-name { opacity: 1; transform: none; }
.p-score { font-weight: 900; font-size: 2.2vw; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
.step.done .p-score { animation: pop 0.45s ease-out; }
.p-place { font-weight: 900; font-style: italic; font-size: 4.4vw; color: rgba(17, 12, 4, 0.78); line-height: 1; }
.step-1 .p-name::before {
  content: "";
  display: block;
  width: min(5.5vw, 10vh);
  aspect-ratio: 64 / 52;
  margin: 0 auto 0.8vh;
  background: url("img/crown.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 14px rgba(226, 169, 34, 0.55));
}
.step-1.done .p-name::before { animation: crown-drop 1.2s ease-out both; }
@keyframes crown-drop { from { transform: translateY(-60px) scale(0.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }

.host-offline {
  position: fixed;
  left: 50%;
  bottom: 2vh;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.8vh 1.6vw;
  border-radius: 999px;
  background: rgba(194, 54, 31, 0.2);
  border: 1px solid rgba(194, 54, 31, 0.6);
  color: var(--danger-ink);
  font-size: 1.2vw;
  font-weight: 700;
}

/* ---------- painel ---------- */
.admin { max-width: 960px; margin: 0 auto; padding: 40px 18px 48px; }
.admin.narrow { max-width: 560px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-head h1, .card h2 { font-weight: 800; color: var(--ink); }
.admin-head h1 { font-style: italic; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-head small, .card-head small { color: var(--ink-soft); font-weight: 500; font-style: normal; text-transform: none; letter-spacing: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2, .card h2 { margin: 0; }
.q-list { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 10px; }
.q-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.q-list li::marker { color: var(--gold); font-weight: 800; }
.q-list li > div:first-child { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.games { width: 100%; border-collapse: collapse; }
.games th, .games td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.games th { color: var(--ink-soft); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.answer-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.answer-row input[type="radio"] { width: 22px; height: 22px; flex: none; accent-color: currentColor; }
.answer-row .shape { width: 28px; text-align: center; font-size: 1.3rem; cursor: pointer; color: inherit; }
.answer-row input:not([type="radio"]) { border-color: transparent; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 420px) {
  .opt { min-height: 98px; font-size: 0.95rem; }
  .games th:nth-child(5), .games td:nth-child(5) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- trava de entrada (QR code) ---------- */
.gate { text-align: center; align-items: center; }
.gate p { margin: 0; line-height: 1.45; }
.gate .big { margin-top: 4px; }
.gate-icon {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  background: url("img/lock.svg") center / contain no-repeat;
}
.gate-icon-qr { background-image: url("img/qr-scan.svg"); }
.gate-wait { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; background: var(--gold); }
.dots i:nth-child(3) { animation-delay: 0.4s; background: var(--ink); }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-6px); opacity: 1; } }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 1.6vh; }
.qr-frame {
  width: 36vh;
  height: 36vh;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 10px var(--gold), 0 0 50px rgba(226, 169, 34, 0.35);
}
.host:not(.gate-open) .qr-frame { background: #121212; box-shadow: 0 0 0 6px var(--bg), 0 0 0 10px var(--line-strong); }
.qr-frame .qr { width: 100%; height: 100%; padding: 2.2vh; animation: pop 0.5s ease-out; }
.qr-locked { display: flex; flex-direction: column; align-items: center; gap: 1.4vh; font-weight: 800; font-size: 2vw; color: var(--ink-soft); }
.qr-locked .gate-icon { width: 10vh; height: 10vh; }
.qr-caption { margin: 0; font-weight: 700; font-size: 1.7vw; color: var(--ink); text-align: center; }
.host.gate-open .qr-caption { color: var(--gold); }
.host.crowded .qr-frame { width: 30vh; height: 30vh; }
.host.crowded .qr-caption { font-size: 1.3vw; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 800; margin-right: 6px; }
.tag-open { background: rgba(47, 158, 91, 0.2); color: #8fe0ae; }
.tag-locked { background: rgba(226, 169, 34, 0.16); color: var(--gold-light); }
.gate-form { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 0; }
.btn-open { background: linear-gradient(135deg, #f6cf62, var(--gold)); border-color: var(--gold-deep); color: #161006; }

/* ---------- foto da pergunta ---------- */
.q-photo { margin: 0; display: flex; align-items: center; justify-content: center; min-height: 0; }
.q-photo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
  border: 2px solid var(--gold);
  background: #111;
  box-shadow: 0 0 40px rgba(226, 169, 34, 0.18), 0 16px 34px rgba(0, 0, 0, 0.5);
  animation: pop 0.45s ease-out;
}
.q-body { flex: 1; display: flex; min-height: 0; margin-bottom: 2vh; }
.q-body .host-options { flex: 1; margin-bottom: 0; }
.host.has-photo .q-body { gap: 2vw; }
.host.has-photo .q-body .q-photo { flex: 0 0 38%; height: 100%; }
.host.has-photo .q-body .q-photo img { height: auto; width: auto; max-height: 100%; max-width: 100%; }
.host.has-photo .host-options { grid-template-columns: 1fr; gap: 1.2vh; }
.host.has-photo .host-options .opt { font-size: clamp(1.1rem, 2vw, 2.6rem); }
.host.has-photo .host-q { font-size: clamp(1.4rem, 2.7vw, 3.3rem); margin: 1.6vh 0; padding: 2.2vh 2vw; }
.q-photo-prepare { height: 40vh; margin: 0 0 1vh; }
.host.has-photo section[data-screen="prepare"] .countdown { font-size: 11vh; }
.host.has-photo section[data-screen="prepare"] .host-q { margin-bottom: 2vh; }

.q-photo-sm { margin: 0; display: flex; justify-content: center; }
.q-photo-sm img {
  max-width: 100%;
  max-height: 26vh;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid var(--gold);
  background: #111;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.photo-field { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.photo-preview { width: 140px; height: 105px; object-fit: cover; border-radius: 10px; border: 1px solid var(--gold-dim); }
.photo-inputs { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.photo-inputs input[type="file"] { padding: 9px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; accent-color: var(--gold); }
.small { font-size: 0.88rem; margin: 0; }
.tag-photo { background: rgba(232, 113, 28, 0.2); color: #ffb27a; }

/* ---------- controle do jogo (painel) ---------- */
.control { padding-bottom: 120px; }
.control-head { flex-wrap: wrap; gap: 10px; }
.control-head .row-actions { justify-content: flex-end; }
.tag-state { background: #262626; color: var(--ink); }
.ctl-phase { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ctl-phase h2 { font-size: 1.5rem; }
.ctl-meta { display: flex; gap: 18px; flex-wrap: wrap; font-variant-numeric: lining-nums; color: var(--ink-soft); }
.ctl-meta strong { font-size: 1.25rem; color: var(--gold); }
.ctl-timer.hurry strong { color: var(--orange); }
.ctl-q { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.ctl-options { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctl-options li {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
}
.ctl-options li::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 0%);
  background: var(--fill-tint, rgba(255, 255, 255, 0.22));
  transition: width 0.6s ease-out;
}
.ctl-options .opt-text { flex: 1; position: relative; }
.ctl-options .shape, .ctl-options .bar-count { position: relative; }
.ctl-options li.correct { outline: 3px solid #fff; outline-offset: -3px; }
.ctl-options li.correct .opt-text::after { content: "  ✔ certa"; font-size: 0.85em; }
.ctl-options li.wrong { opacity: 0.4; }
.ctl-board { margin: 0; padding-left: 1.6em; display: flex; flex-direction: column; gap: 6px; }
.ctl-board li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.ctl-board li::marker { color: var(--gold); font-weight: 800; }
.ctl-board .b-score { color: var(--gold); font-weight: 800; font-variant-numeric: lining-nums; }
.ctl-players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ctl-players li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #1a1a1a; }
.ctl-players button { border: 0; background: none; color: var(--danger-ink); font: inherit; font-weight: 800; cursor: pointer; padding: 2px 6px; border-radius: 999px; }
.ctl-players button:hover { background: rgba(194, 54, 31, 0.18); }
.ctl-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ctl-qr img { width: 150px; height: 150px; image-rendering: pixelated; background: #fff; padding: 8px; border: 3px solid var(--gold); border-radius: 10px; }
.ctl-qr div { flex: 1; min-width: 200px; }
.ctl-qr p { margin: 0 0 6px; }
.ctl-qr a { word-break: break-all; font-size: 0.9rem; }
.ctl-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: rgba(11, 11, 11, 0.95);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
  z-index: 10;
}
.ctl-bar .btn-primary { flex: 0 1 420px; font-size: 1.1rem; }
@media (max-width: 520px) {
  .ctl-options { grid-template-columns: 1fr; }
  .ctl-bar .btn { padding: 14px 16px; }
}
