/* Battle of the Believers: mobile game-show control panel.
   Dark navy + gold. Light text weights (400/500); size carries the hierarchy. */
:root {
  --bg: #0a1028; --bg2: #101a3d; --panel: #141f47; --panel2: #1b2858; --line: rgba(255,255,255,.09);
  --text: #eef1fb; --muted: #9aa5c9; --gold: #f2c14e; --gold2: #ffe08a;
  --t1: #4c8dff; --t2: #ff8a3d; --ok: #22c55e; --bad: #ef4444; --warn: #f59e0b;
  --r: 16px; --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; color: var(--text); font: 400 16px/1.45 var(--font);
  background: radial-gradient(120% 60% at 50% -10%, #1d2b63 0%, var(--bg) 60%) fixed;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 500; margin: 0; }
b, strong { font-weight: 600; }
small { font-size: .8em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.ok-t { color: var(--ok); }

.wrap { max-width: 560px; margin: 0 auto; padding: 14px 14px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  background: rgba(10,16,40,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-title { flex: 1; min-width: 0; text-align: center; }
.top-title .t1 { font-weight: 500; font-size: 1.02rem; color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title .t2 { font-size: .8rem; color: var(--muted); }
.top-btn { min-width: 48px; height: 44px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; font-size: 1.15rem; padding: 0 10px; }
.top-btn.menu { font-size: .92rem; font-weight: 500; }
.paused-bar { position: sticky; top: calc(61px + env(safe-area-inset-top)); z-index: 19; width: 100%; border: 0; padding: 12px; background: var(--warn); color: #1a1200; font-weight: 600; letter-spacing: .04em; }

/* Buttons */
.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 52px; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); font-weight: 500; font-size: 1rem; text-align: center; cursor: pointer;
  transition: transform .06s ease, filter .15s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.btn:active { transform: scale(.97); filter: brightness(1.15); }
.btn small { font-weight: 400; opacity: .9; font-size: .82rem; }
.btn.big { min-height: 64px; font-size: 1.15rem; }
.btn.xl { min-height: 96px; font-size: 1.35rem; }
.btn.small { min-height: 44px; font-size: .9rem; padding: 8px 12px; }
.btn.primary { background: linear-gradient(180deg, #3d6dff, #2a52d6); border-color: transparent; }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #241a00; border-color: transparent; }
.btn.good { background: linear-gradient(180deg, #2fd16b, #17a34a); border-color: transparent; color: #04170b; }
.btn.bad { background: linear-gradient(180deg, #f86060, #d62f2f); border-color: transparent; color: #fff; }
.btn.danger { background: #7f1d1d; border-color: #b91c1c; }
.btn.warn { color: var(--warn); }
.btn.ghost { background: transparent; }
.btn.warn-text { color: #fca5a5; }
.btn.disabled { opacity: .45; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-pair { gap: 12px; }

/* Cards & text blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card h3 { font-size: 1.02rem; margin-bottom: 8px; color: var(--gold2); }
.card p { margin: 0 0 6px; }
.card ol, .card ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.note { color: var(--muted); font-size: .92rem; padding: 2px 4px; }
.lead { font-size: 1.05rem; color: #cfd6f0; margin: 6px 0 0; }
.instr { position: relative; background: rgba(242,193,78,.1); border: 1px solid rgba(242,193,78,.45); border-radius: var(--r); padding: 22px 14px 12px; font-size: 1.05rem; }
.instr-tag { position: absolute; top: -9px; left: 12px; background: var(--gold); color: #241a00; font-size: .68rem; font-weight: 600; letter-spacing: .12em; padding: 2px 8px; border-radius: 6px; }
.warn-box { background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.6); border-radius: var(--r); padding: 12px 14px; font-size: 1.02rem; }
.result { text-align: center; font-size: 1.2rem; padding: 16px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); }
.result.good { background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.5); }
.banner { text-align: center; font-size: 1.3rem; font-weight: 500; padding: 14px; border-radius: var(--r); background: var(--panel2); }
.banner.t1 { background: rgba(76,141,255,.22); border: 1px solid var(--t1); }
.banner.t2 { background: rgba(255,138,61,.2); border: 1px solid var(--t2); }

/* Chips & pills */
.chip { font-size: .74rem; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); white-space: nowrap; }
.chip.live { background: rgba(76,141,255,.2); color: #a9c6ff; }
.chip.ok { background: rgba(34,197,94,.18); color: #86efac; }
.chip.skip { background: rgba(245,158,11,.18); color: #fcd34d; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 8px 12px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: .92rem; }
.pill.on { border-color: var(--gold); color: var(--gold2); }
button.pill { min-height: 44px; }

/* Home */
.brand { text-align: center; padding: 18px 0 4px; }
.brand-mark { font-size: 2rem; color: var(--gold); line-height: 1; }
.brand h1 { font-size: 2rem; line-height: 1.1; letter-spacing: .02em; margin: 6px 0; font-weight: 400; text-transform: uppercase; }
.brand h1 span { color: var(--gold); font-weight: 600; letter-spacing: .06em; }
.hero-card { background: linear-gradient(160deg, #22327a, #141f47); border: 1px solid rgba(242,193,78,.35); border-radius: 20px; padding: 16px; display: grid; gap: 8px; }
.hero-name { font-size: 1.5rem; font-weight: 500; }
.mini-boards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 4px; }
.mini-row { display: flex; align-items: center; gap: 6px; }
.mini-row b { margin-left: auto; font-size: 1.15rem; }
.mini-link { font-size: .8rem; color: var(--muted); }
.tdot { width: 9px; height: 9px; border-radius: 50%; }
.tdot.t1 { background: var(--t1); } .tdot.t2 { background: var(--t2); }
.section { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.game-list { display: grid; gap: 8px; }
.game-row { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; min-height: 62px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.game-row.is-next { border-color: rgba(242,193,78,.55); }
.gnum { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--panel2); color: var(--gold); font-weight: 600; }
.ginfo { flex: 1; display: grid; }
.ginfo b { font-weight: 500; }
.ginfo small { color: var(--muted); }
.schedule { display: grid; gap: 6px; padding: 10px 14px; }
.sch-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; font-size: .92rem; }

/* Intro */
.intro-head { padding: 6px 2px; }
.intro-head h1 { font-size: 1.8rem; color: var(--gold2); }
.teams2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.team-box { border-radius: 12px; padding: 10px; display: grid; gap: 2px; }
.team-box.t1 { background: rgba(76,141,255,.14); border: 1px solid rgba(76,141,255,.5); }
.team-box.t2 { background: rgba(255,138,61,.12); border: 1px solid rgba(255,138,61,.5); }
.pts { width: 100%; border-collapse: collapse; }
.pts td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.pts td:last-child { text-align: right; font-weight: 600; color: var(--gold2); }
.op { border-color: rgba(242,193,78,.4); }
.rule-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-chips span { font-size: .78rem; padding: 4px 9px; border-radius: 99px; background: rgba(239,68,68,.14); color: #fecaca; border: 1px solid rgba(239,68,68,.35); }

/* Team score strip */
.strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.strip-team { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; border-radius: 14px; }
.strip-team span { font-size: .95rem; }
.strip-team b { font-size: 1.45rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.strip-team.t1 { background: rgba(76,141,255,.18); border: 1px solid rgba(76,141,255,.55); }
.strip-team.t2 { background: rgba(255,138,61,.16); border: 1px solid rgba(255,138,61,.55); }
.strip.big .strip-team b { font-size: 2.4rem; }
.turns-row { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); }
.turns-row .t1 { color: #a9c6ff; } .turns-row .t2 { color: #ffc29b; }

/* Question card */
.qcard { background: linear-gradient(170deg, #1b2a66, #121b42); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 16px; }
.qmeta { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.qmeta span:first-child { color: var(--gold); font-weight: 500; }
.qtext { font-size: 1.45rem; line-height: 1.3; font-weight: 400; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 1.25rem; }
.opt b { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold); color: #241a00; font-size: 1.3rem; }

/* Show-answer (host only) */
.peek-btn { width: 100%; min-height: 52px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.3); background: transparent; color: var(--muted); font-size: .98rem; }
.peek { border: 1px solid rgba(242,193,78,.5); background: rgba(242,193,78,.08); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.answer b { display: block; font-size: 1.3rem; font-weight: 500; color: var(--gold2); }
.answer small { color: var(--muted); }

/* Buzzers */
.buzzers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.buzz { min-height: 190px; border-radius: 22px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); }
.buzz span { font-size: 1.05rem; }
.buzz b { font-size: 2rem; letter-spacing: .08em; }
.buzz.t1 { background: radial-gradient(circle at 50% 35%, #78a9ff, #2f6ee8); }
.buzz.t2 { background: radial-gradient(circle at 50% 35%, #ffad73, #e8641a); }
.buzz:active { transform: scale(.96); }

/* Timer ring */
.timer { display: grid; place-items: center; padding: 4px 0; --p: 1; --c: var(--gold); }
.ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 360deg), rgba(255,255,255,.08) 0); transition: background .1s linear; }
.ring-in { width: 124px; height: 124px; border-radius: 50%; background: var(--bg2); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer .num { font-size: 3.4rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.timer .sub { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.timer.huge .ring { width: 210px; height: 210px; }
.timer.huge .ring-in { width: 178px; height: 178px; }
.timer.huge .num { font-size: 5rem; }
.timer.low { --c: var(--bad); }
.timer.low .num { color: #fca5a5; }
.timer.done { --c: var(--bad); }
.timer.done .num { color: var(--bad); }
.timer.done .sub { color: var(--bad); font-weight: 600; }
.timer.held .sub { color: var(--warn); font-weight: 600; }
.timer.idle .num { color: var(--muted); }

/* Banner + small timer on one row (timed steps) */
.act-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); }
.act-row.t1 { background: rgba(76,141,255,.2); border-color: var(--t1); }
.act-row.t2 { background: rgba(255,138,61,.18); border-color: var(--t2); }
.act-text { font-size: 1.25rem; line-height: 1.25; display: grid; gap: 2px; }
.act-text small { font-size: .85rem; color: var(--muted); }
.act-cat { font-size: 1.05rem; color: var(--gold2); }
.act-text .count { font-size: 2.4rem; margin-top: 2px; }
.timer.mini { padding: 0; }
.timer.mini .ring { width: 104px; height: 104px; }
.timer.mini .ring-in { width: 84px; height: 84px; }
.timer.mini .num { font-size: 2.5rem; }
.timer.mini .sub { font-size: .56rem; letter-spacing: .1em; margin-top: 2px; }
.qcard.compact { padding: 12px 14px; opacity: .9; }
.qcard.compact .qtext { font-size: 1.05rem; }

/* Turn / name cards */
.turn-card, .celebrate, .gap { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.big-name { font-size: 2rem; font-weight: 500; color: var(--gold2); line-height: 1.15; margin: 2px 0 4px; }
.cat-name { font-size: 1.4rem; margin: 6px 0 2px; }
.plus { font-size: 1.6rem; color: var(--ok); font-weight: 600; margin-top: 6px; }
.secret { text-align: center; background: linear-gradient(170deg, #2b1f5e, #17123a); border: 1px solid rgba(242,193,78,.5); border-radius: 20px; padding: 22px 16px; }
.secret-text { font-size: 2rem; font-weight: 500; color: var(--gold2); line-height: 1.2; margin: 6px 0 10px; }

/* Who Am I card */
.char-name { font-size: 1.6rem; color: var(--gold2); font-weight: 500; }
.char p { margin: 4px 0; }
.facts { width: 100%; border-collapse: collapse; font-size: .92rem; }
.facts td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts td:last-child { text-align: right; padding-left: 10px; }
.facts .y { color: var(--ok); } .facts .n { color: #fca5a5; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row.cur { background: rgba(242,193,78,.1); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--panel2); font-size: .8rem; margin-right: 8px; color: var(--gold); }

/* 30 seconds */
.counter { text-align: center; }
.count { font-size: 3.6rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.count small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.count-btns { display: grid; grid-template-columns: 90px 1fr; gap: 10px; }
.count-btns .btn.bad { min-height: 96px; font-size: 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tick { min-height: 42px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: .9rem; touch-action: manipulation; }
.tick.on { background: var(--ok); color: #04170b; border-color: transparent; font-weight: 500; }

/* Ultimate answer entry */
.sheet-grid { display: grid; gap: 8px; }
.sg-row { display: grid; grid-template-columns: 36px 1fr 1fr 1fr; gap: 8px; align-items: center; }
.sg-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); color: var(--gold); font-size: .9rem; flex: none; }
.sg-b { min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 1.2rem; font-weight: 500; touch-action: manipulation; }
.sg-b.on { background: var(--gold); color: #241a00; border-color: transparent; }
.sg-b:disabled { opacity: .7; }
.key-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .94rem; }

/* Leaderboards */
.board { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.board-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; font-size: 1.05rem; font-weight: 500; }
.board-head small { color: rgba(255,255,255,.75); font-weight: 400; }
.team-board .board-head { background: linear-gradient(90deg, #2f6ee8, #e8641a); }
.ind-board .board-head { background: linear-gradient(90deg, #b8860b, var(--gold)); color: #241a00; }
.ind-board .board-head small { color: rgba(36,26,0,.75); }
.board table { width: 100%; border-collapse: collapse; background: var(--panel); }
.board th { font-size: .7rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 6px; text-align: center; line-height: 1.2; }
.board th:nth-child(1), .board th:nth-child(2) { text-align: left; }
.team-board th:nth-child(2) { text-align: center; }
.board td { padding: 11px 6px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.board td:first-child { padding-left: 12px; }
.board td:nth-child(2) { text-align: left; }
.team-board td:nth-child(2) { text-align: center; }
.team-board td:first-child { text-align: left; }
.board td small { display: block; color: var(--muted); font-size: .74rem; }
.board td.tot { font-size: 1.25rem; font-weight: 600; color: var(--gold2); }
.board tr.lead td { background: rgba(242,193,78,.08); }
.team-board tr.t1 td:first-child { border-left: 4px solid var(--t1); }
.team-board tr.t2 td:first-child { border-left: 4px solid var(--t2); }

/* Corrections */
.adj { display: flex; align-items: center; gap: 10px; }
.adj .btn { width: 46px; min-height: 42px; padding: 0; font-size: 1.3rem; }
.adj b { min-width: 30px; text-align: center; font-size: 1.15rem; }
.adj-note { display: block; text-align: right; }
.tname.t1 { color: #a9c6ff; } .tname.t2 { color: #ffc29b; }

/* Awards */
.award { position: relative; }
.award-card { position: relative; text-align: center; padding: 30px 16px; border-radius: 24px; background: linear-gradient(160deg, #22327a, #141f47); border: 1px solid rgba(242,193,78,.5); animation: pop .6s ease-out; }
.award-card.gold { background: linear-gradient(160deg, #4a3a0c, #1d1a33); }
.award-title { font-size: 1rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.award-card .big-name { font-size: 2.4rem; }
.team-win.t1 { color: #a9c6ff; } .team-win.t2 { color: #ffc29b; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -20px; left: calc(var(--x) * 1%); width: 8px; height: 14px; border-radius: 2px; background: hsl(var(--h), 90%, 60%);
  animation: fall 3.2s linear var(--d) 2 forwards; opacity: 0; }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(105vh) rotate(540deg); opacity: .8; } }

/* Setup */
.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field span { font-size: .8rem; color: var(--muted); }
.field input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); padding: 0 12px; font: 400 1rem var(--font); }
.team-edit.t1 { border-color: rgba(76,141,255,.5); } .team-edit.t2 { border-color: rgba(255,138,61,.5); }
.danger-zone { border-color: rgba(239,68,68,.35); margin-top: 18px; }

/* Overlay: menu, modal, toast */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(3,6,18,.7); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--bg2); border-radius: 22px 22px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 8px; border-top: 1px solid var(--line); animation: up .18s ease-out; }
.sheet-head { text-align: center; color: var(--gold2); font-weight: 500; padding: 4px 0 6px; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal { margin: auto 16px; max-width: 460px; width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 18px; align-self: center; }
.modal h3 { color: var(--gold2); margin-bottom: 8px; }
.modal p { color: #cfd6f0; margin: 0 0 16px; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: #fff; color: #0a1028; padding: 10px 16px; border-radius: 99px; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 90vw; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
