:root {
  --bg: #0d0a14;
  --bg2: #1a1326;
  --card: #231a33;
  --ink: #f4eee0;
  --muted: #a99fbd;
  --accent: #ff8a1f;
  --accent2: #8a5cf6;
  --ok: #4ade80;
  --no: #f87171;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #2a1747 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; letter-spacing: .5px; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- TV (legível ao fundo da sala) ---------- */
.tv { height: 100vh; display: flex; flex-direction: column; padding: 2.2vw 3vw; overflow: hidden; }
.tv .strip { display: flex; gap: 1.2vw; justify-content: center; flex-wrap: wrap; min-height: 6vw; }
.tv .chip {
  display: flex; align-items: center; gap: .6vw; padding: .5vw 1.4vw; border-radius: 99px;
  background: var(--card); font-size: 2.1vw; color: var(--muted); border: .25vw solid transparent; transition: all .3s;
}
.tv .chip.active { color: var(--ink); border-color: var(--accent); background: #3a2352; transform: scale(1.12); box-shadow: 0 0 2vw #ff8a1f55; }
.tv .chip.done { opacity: .55; }
.tv .stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2vw; }
.tv .title { font-size: 6vw; line-height: 1.1; }
.tv .big-icon { font-size: 12vw; line-height: 1; filter: drop-shadow(0 0 2vw #ff8a1f66); }
.tv .sub { font-size: 2.6vw; color: var(--muted); max-width: 80vw; line-height: 1.35; }
.tv .q { font-size: 4.2vw; max-width: 84vw; line-height: 1.2; }
.tv .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4vw; width: 84vw; }
.tv .opt { background: var(--card); border-radius: var(--radius); padding: 1.6vw 2vw; font-size: 3vw; text-align: left; display: flex; gap: 1.4vw; align-items: center; border: .3vw solid transparent; }
.tv .opt b { color: var(--accent); font-size: 3.4vw; }
.tv .opt.right { border-color: var(--ok); background: #14391f; }
.tv .opt.wrong { border-color: var(--no); background: #3d1717; }
.tv .opt.dim { opacity: .4; }
.tv .verdict { font-size: 4.4vw; font-weight: 700; }
.tv .verdict.ok { color: var(--ok); }
.tv .verdict.no, .tv .verdict.timeout { color: var(--no); }
.tv .verdict.skip, .tv .verdict.part { color: var(--accent); }
.tv .timer { width: 70vw; height: 1.2vw; background: #ffffff1a; border-radius: 99px; overflow: hidden; }
.tv .timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); width: 100%; }
.tv .timer.low i { background: var(--no); }
.tv .count { font-size: 5vw; font-weight: 700; font-variant-numeric: tabular-nums; }
.tv .items { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6vw; max-width: 80vw; }
.tv .item { font-size: 7vw; background: var(--card); border-radius: var(--radius); padding: 1vw 1.8vw; }
.tv .item small { display: block; font-size: 1.8vw; color: var(--muted); }
.tv .item.missed { opacity: .35; }
.tv .item.hit { outline: .3vw solid var(--ok); }
.tv .pref { display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; width: 84vw; }
.tv .pref .opt { font-size: 3.2vw; flex-direction: column; text-align: center; align-items: center; min-height: 14vw; justify-content: center; }
.tv .pref .opt b { font-size: 6vw; }
.tv .pref .who { font-size: 2.6vw; color: var(--muted); }
.tv .recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(22vw, 1fr)); gap: 1.4vw; width: 88vw; }
.tv .recap div { background: var(--card); border-radius: var(--radius); padding: 1.4vw; font-size: 3vw; }
.tv .recap span { display: block; font-size: 2.2vw; color: var(--muted); margin-bottom: .4vw; }
.tv .qr { width: 20vw; background: #fff; padding: .8vw; border-radius: 1vw; }
.tv .charcard { border-radius: 2vw; padding: 2.4vw 3vw; background: var(--card); border: .4vw solid var(--cc, var(--accent)); box-shadow: 0 0 5vw var(--cc, var(--accent)); max-width: 82vw; }
.tv .charcard .name { font-size: 5.4vw; color: var(--cc, var(--accent)); }
.tv .charcard .phrase { font-size: 2.6vw; font-style: italic; margin: 1vw 0; }
.tv .charcard .quals { display: flex; gap: 1vw; justify-content: center; flex-wrap: wrap; margin: 1vw 0; }
.tv .charcard .quals span { background: #ffffff14; padding: .4vw 1.2vw; border-radius: 99px; font-size: 2vw; }
.tv .charcard p { font-size: 2.2vw; line-height: 1.4; margin: .6vw 0 0; color: #e9e2d6; }
.tv .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(26vw, 1fr)); gap: 1.4vw; width: 92vw; }
.tv .grid .charcard { padding: 1.2vw; }
.tv .grid .charcard .name { font-size: 2.4vw; }
.tv .grid .charcard .big { font-size: 5vw; }
.tv .grid .charcard .player { font-size: 2.2vw; margin-bottom: .3vw; }
.tv .heard { position: fixed; right: 1.5vw; bottom: 1vw; font-size: 1.4vw; color: var(--muted); }
.tv .conn { position: fixed; left: 1.5vw; bottom: 1vw; font-size: 1.4vw; color: var(--no); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
.pop { animation: pop .55s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pulse { 50% { transform: scale(1.06); opacity: .85; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pulse, .pop { animation: none; } }

/* ---------- Telemóvel (consola) ---------- */
.host { max-width: 560px; margin: 0 auto; padding: 14px 16px 120px; }
.host header { display: flex; align-items: center; gap: 10px; padding: 8px 0 12px; }
.host header h1 { font-size: 20px; flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--no); }
.dot.on { background: var(--ok); }
.panel { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.panel h2 { font-size: 16px; margin-bottom: 8px; color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }
.secret { border: 2px dashed var(--accent2); }
.secret .val { font-size: 22px; font-weight: 700; margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.row.wrap > * { flex: 1 1 45%; }
input[type=text], select {
  background: #14101e; color: var(--ink); border: 1px solid #3b2f55; border-radius: 12px; padding: 12px; font-size: 16px; flex: 1; min-width: 0;
}
.btn { background: #3a2c55; color: var(--ink); border: 0; border-radius: 14px; padding: 14px 16px; font-size: 17px; font-weight: 600; min-height: 52px; }
.btn.primary { background: var(--accent); color: #1a0f00; }
.btn.good { background: #1d5c33; }
.btn.bad { background: #6a2020; }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .4; }
.mic-wrap { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px 18px; background: linear-gradient(transparent, #0d0a14 30%); display: flex; justify-content: center; gap: 10px; align-items: center; }
.mic { width: 84px; height: 84px; border-radius: 50%; border: 0; font-size: 36px; background: var(--accent2); color: #fff; box-shadow: 0 6px 24px #8a5cf666; }
.mic.on { background: var(--no); animation: pulse 1.2s infinite; }
.heardline { min-height: 22px; font-size: 15px; color: var(--muted); text-align: center; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 4px 3px; text-align: center; border-bottom: 1px solid #ffffff12; }
td:first-child, th:first-child { text-align: left; }
.bar { height: 6px; border-radius: 3px; background: #ffffff14; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; }
.big-name { font-size: 26px; font-family: Georgia, serif; }
label.chk { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 16px; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
