/* ===========================================================================
   style.css — broadcast-friendly UI for "Who Wants To Be A Pumpionaire?"
   =========================================================================== */
:root {
  --bg0: #050a1f;
  --bg1: #0b1437;
  --bg2: #1a0f3a;
  --gold: #ffd24a;
  --gold-deep: #b8860b;
  --green: #2bff88;
  --red: #ff3b5c;
  --blue: #1b3aa0;
  --blue-light: #2f6bff;
  --ink: #f5f8ff;
  --muted: #9fb0d8;
  --panel: rgba(10, 20, 55, 0.78);
  --line: rgba(120, 150, 230, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Segoe UI", "Inter", system-ui, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #21276b 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 110%, #3a1060 0%, transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 55%, var(--bg2));
  overflow: hidden;
}

.stage {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  padding: 26px 30px;
}
.stage.no-ladder { grid-template-columns: 1fr; }

/* ---------- Title / brand ---------- */
.brand {
  text-align: center;
  letter-spacing: 1px;
}
.brand h1 {
  font-size: clamp(28px, 4.2vw, 60px);
  font-weight: 900;
  line-height: 1.02;
  background: linear-gradient(180deg, #fff 0%, var(--gold) 55%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(255, 210, 74, 0.25);
}
.brand .sub { color: var(--muted); margin-top: 8px; font-size: clamp(13px, 1.4vw, 20px); }

/* ---------- Main column ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.guest-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 18px; font-weight: 700;
}
.guest-chip .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.jackpot-box {
  text-align: right;
}
.jackpot-box .lbl { color: var(--gold); font-size: 12px; letter-spacing: 3px; font-weight: 800; }
.jackpot-box .amt { font-size: clamp(20px, 2.6vw, 38px); font-weight: 900; color: #fff; text-shadow: 0 0 24px rgba(255,210,74,.4); }

/* category + timer row */
.qmeta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.category {
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border: 1px solid var(--line);
  padding: 8px 20px; border-radius: 10px;
  font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  font-size: clamp(12px, 1.4vw, 18px);
}

/* timer ring */
.timer {
  position: relative; width: 92px; height: 92px; flex: 0 0 auto;
}
.timer svg { transform: rotate(-90deg); }
.timer .track { stroke: rgba(255,255,255,.12); }
.timer .fill { stroke: var(--green); transition: stroke-dashoffset .95s linear, stroke .3s; stroke-linecap: round; }
.timer.low .fill { stroke: var(--red); }
.timer .num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 900;
}

/* question */
.question {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 34px;
  font-size: clamp(22px, 3.2vw, 46px);
  font-weight: 800;
  line-height: 1.18;
  min-height: 0;
}
.question.placeholder { color: var(--muted); font-weight: 600; font-size: clamp(18px,2.2vw,30px); }

/* answers grid */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.answer {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, rgba(20,32,80,.9), rgba(10,18,50,.9));
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px 22px;
  font-size: clamp(16px, 2vw, 28px);
  font-weight: 700;
  transition: transform .12s, border-color .2s, background .2s, opacity .25s;
}
.answer .key {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  border: 2px solid var(--gold);
  color: var(--gold); font-weight: 900;
}
.answer.locked { border-color: var(--gold); background: linear-gradient(180deg, #4a3a08, #2a2000); box-shadow: 0 0 26px rgba(255,210,74,.5); }
.answer.correct { border-color: var(--green); background: linear-gradient(180deg, #06401f, #032a14); box-shadow: 0 0 30px rgba(43,255,136,.55); }
.answer.wrong { border-color: var(--red); background: linear-gradient(180deg, #45040f, #2a0209); box-shadow: 0 0 30px rgba(255,59,92,.5); }
.answer.hidden { opacity: .12; filter: grayscale(1); }
.answer.hostkey { outline: 2px dashed var(--green); outline-offset: 3px; }

/* poll bars under an answer */
.poll-wrap { margin-top: 4px; }
.poll-bar { height: 8px; border-radius: 5px; background: var(--blue-light); margin-top: 6px; transition: width .6s; }
.poll-pct { font-size: 14px; color: var(--muted); margin-left: auto; font-weight: 800; }

/* ---------- Ladder ---------- */
.ladder {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.ladder h3 { text-align: center; color: var(--gold); letter-spacing: 3px; font-size: 13px; margin-bottom: 6px; }
.rung {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border-radius: 9px;
  color: var(--muted); font-weight: 800;
  border: 1px solid transparent;
}
.rung .rung-num { width: 26px; color: var(--gold-deep); }
.rung .rung-amt { margin-left: auto; font-size: 16px; }
.rung.safe { color: #fff; }
.rung.safe .rung-num { color: var(--gold); }
.rung.passed { color: var(--green); opacity: .8; }
.rung.current {
  background: linear-gradient(90deg, var(--gold), #ffaf3a);
  color: #1a1200; border-color: #fff;
  box-shadow: 0 0 22px rgba(255,210,74,.6);
}
.rung.current .rung-num, .rung.current .rung-amt { color: #1a1200; }
.jackpot-rung { color: var(--gold); text-shadow: 0 0 12px rgba(255,210,74,.7); }
.rung.current .jackpot-rung { color: #1a1200; text-shadow: none; }

/* ---------- Safe-haven deal banner ---------- */
.deal-banner {
  margin-top: 16px; text-align: center;
  background: linear-gradient(90deg, rgba(255,210,74,.18), rgba(255,175,58,.28), rgba(255,210,74,.18));
  border: 2px solid var(--gold); border-radius: 14px;
  padding: 14px 20px; font-size: clamp(16px, 2vw, 26px); font-weight: 800; color: #fff;
  box-shadow: 0 0 26px rgba(255,210,74,.4);
  animation: pulse 1.4s infinite;
}
.deal-banner b { color: var(--gold); }

/* ---------- Lifelines ---------- */
.lifelines { display: flex; gap: 12px; margin-top: 16px; justify-content: center; }
.lifeline {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 92px; padding: 10px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  font-weight: 800; font-size: 12px; letter-spacing: 1px;
}
.lifeline .ico { font-size: 26px; }
.lifeline.used { opacity: .3; text-decoration: line-through; }
.lifeline.active { border-color: var(--green); box-shadow: 0 0 18px rgba(43,255,136,.5); }

/* ---------- Phone-a-Friend overlay ---------- */
.phone-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(2,6,20,.86);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
}
.phone-overlay .ring { font-size: 90px; animation: shake .5s infinite; }
.phone-overlay h2 { font-size: clamp(28px,4vw,54px); color: var(--gold); }
.phone-overlay p { color: var(--muted); font-size: clamp(16px,2vw,26px); max-width: 760px; }
@keyframes shake { 0%,100%{transform:rotate(-12deg)} 50%{transform:rotate(12deg)} }

/* ---------- Elimination roster ---------- */
.roster { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-top: 18px; }
.player {
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px;
  padding: 16px; text-align: center; font-weight: 800; font-size: 20px;
  transition: opacity .4s, transform .4s, border-color .3s;
}
.player .status { font-size: 13px; letter-spacing: 2px; margin-top: 6px; color: var(--green); }
.player.out { opacity: .3; border-color: var(--red); transform: scale(.96); }
.player.out .status { color: var(--red); }
.player.winner-card { border-color: var(--gold); box-shadow: 0 0 30px rgba(255,210,74,.6); }

/* ---------- Game over / Winner ---------- */
.center-screen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 40px;
}
.center-screen h1 { font-size: clamp(40px, 7vw, 110px); font-weight: 900; }
.center-screen .big-amt {
  font-size: clamp(40px, 8vw, 120px); font-weight: 900;
  background: linear-gradient(180deg,#fff,var(--gold) 60%,var(--gold-deep));
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
}
.center-screen p { font-size: clamp(18px,2.4vw,32px); color: var(--muted); }
.win h1 { color: var(--gold); text-shadow: 0 0 40px rgba(255,210,74,.6); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; }

/* ---------- Full-screen flash ---------- */
.flash {
  position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: 0;
}
.flash.go { animation: flashAnim .8s ease-out; }
.flash.correct { background: radial-gradient(circle, rgba(43,255,136,.55), transparent 70%); }
.flash.wrong { background: radial-gradient(circle, rgba(255,59,92,.55), transparent 70%); }
.flash.final { background: radial-gradient(circle, rgba(255,210,74,.5), transparent 70%); }
@keyframes flashAnim { 0%{opacity:.9} 100%{opacity:0} }

/* =====================================================================
   CONTROL PANEL specific
   ===================================================================== */
.ctrl-body {
  overflow: auto; height: 100vh; padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.ctrl-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.ctrl-head h1 { font-size: 22px; }
.ctrl-head .badge { background: var(--red); color:#fff; padding:4px 12px; border-radius:999px; font-weight:800; font-size:12px; letter-spacing:2px; }
.ctrl-grid { display:grid; grid-template-columns: 1fr 360px; gap:16px; align-items:start; }
.card { background: var(--panel); border:1px solid var(--line); border-radius:14px; padding:16px; }
.card h2 { font-size:13px; letter-spacing:2px; color:var(--gold); margin-bottom:12px; text-transform:uppercase; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:10px; }
label.field { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); font-weight:700; }
input, select {
  background:#0a1340; border:1px solid var(--line); color:var(--ink);
  border-radius:9px; padding:10px 12px; font-size:15px; font-weight:600; min-width:120px;
}
input:focus, select:focus { outline:2px solid var(--blue-light); }
.btn {
  background: linear-gradient(180deg, var(--blue-light), var(--blue));
  border:1px solid var(--line); color:#fff; font-weight:800; font-size:14px;
  padding:11px 16px; border-radius:10px; cursor:pointer; transition:transform .1s, filter .15s;
  display:inline-flex; align-items:center; gap:8px;
}
.btn:hover { filter:brightness(1.15); }
.btn:active { transform:translateY(1px); }
.btn:disabled { opacity:.35; cursor:not-allowed; }
.btn.gold { background: linear-gradient(180deg,#ffcf4a,#c9920a); color:#1a1200; }
.btn.green { background: linear-gradient(180deg,#2bff88,#0c9c4c); color:#042a14; }
.btn.red { background: linear-gradient(180deg,#ff5c78,#b3142c); }
.btn.ghost { background: rgba(255,255,255,.06); }
.btn.wide { width:100%; justify-content:center; }
.btn .k { background: rgba(0,0,0,.3); border-radius:5px; padding:1px 7px; font-size:11px; opacity:.85; }
.hostq { font-size:20px; font-weight:800; line-height:1.3; margin-bottom:10px; }
.hostopt { display:flex; gap:10px; align-items:center; padding:9px 12px; border-radius:9px; border:1px solid var(--line); margin-bottom:8px; font-weight:700; }
.hostopt.ans { border-color:var(--green); background:rgba(43,255,136,.12); }
.hostopt.ans::after { content:"✓ correct"; margin-left:auto; color:var(--green); font-size:12px; font-weight:800; }
.hostopt.lock { box-shadow:0 0 0 2px var(--gold) inset; }
.kbd-hint { font-size:12px; color:var(--muted); line-height:1.7; }
.kbd-hint b { color:var(--gold); }
.statics { display:flex; gap:18px; flex-wrap:wrap; }
.stat { font-size:12px; color:var(--muted); }
.stat b { display:block; font-size:20px; color:#fff; }
.elim-mark { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.elim-mark .nm { font-weight:800; min-width:120px; }
.preview-link { color: var(--blue-light); font-weight:800; text-decoration:none; }

/* ---------- Question Bank viewer (host only) ---------- */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  background: linear-gradient(180deg,#ffcf4a,#c9920a); color:#1a1200;
  border:1px solid var(--line); font-weight:900; font-size:15px;
  padding:14px 20px; border-radius:999px; cursor:pointer;
  box-shadow:0 6px 24px rgba(0,0,0,.5);
}
.fab:hover { filter:brightness(1.08); }
.modal {
  position: fixed; inset:0; z-index:90; display:none;
  background: rgba(2,6,20,.9); padding:30px;
}
.modal.open { display:flex; flex-direction:column; }
.modal-head { display:flex; align-items:center; gap:14px; margin-bottom:14px; flex-wrap:wrap; }
.modal-head h2 { font-size:22px; color:var(--gold); }
.modal-head input { flex:1; min-width:200px; }
.modal-body { flex:1; overflow:auto; padding-right:8px; }
.modal-body h3 { margin:14px 0 8px; letter-spacing:2px; font-size:14px; }
.bank-cols { columns: 2 420px; column-gap: 18px; }
.bq {
  break-inside: avoid; background:var(--panel); border:1px solid var(--line);
  border-radius:12px; padding:12px 14px; margin-bottom:12px;
}
.bq-head { display:flex; gap:8px; align-items:center; margin-bottom:6px; }
.bq-cat { font-size:11px; letter-spacing:1px; color:var(--blue-light); font-weight:800; text-transform:uppercase; }
.bq-diff { font-size:10px; padding:2px 8px; border-radius:999px; font-weight:800; letter-spacing:1px; }
.bq-diff.easy { background:rgba(43,255,136,.18); color:var(--green); }
.bq-diff.medium { background:rgba(47,107,255,.22); color:#8fb3ff; }
.bq-diff.hard { background:rgba(255,59,92,.2); color:#ff8aa0; }
.bq-q { font-weight:800; font-size:15px; margin-bottom:8px; line-height:1.3; }
.bopt { font-size:13px; color:var(--muted); padding:4px 8px; border-radius:7px; margin-bottom:3px; }
.bopt b { color:#fff; margin-right:4px; }
.bopt.ok { background:rgba(43,255,136,.14); color:#cfffe4; }
.bopt.ok b { color:var(--green); }

/* ---------- Launcher (index.html) ---------- */
.launcher { height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:34px; text-align:center; padding:30px; }
.launch-btns { display:flex; gap:26px; flex-wrap:wrap; justify-content:center; }
.launch-card {
  width:320px; padding:30px; border-radius:18px; text-decoration:none;
  background:var(--panel); border:1px solid var(--line); color:var(--ink);
  transition:transform .15s, border-color .2s; display:flex; flex-direction:column; gap:10px; align-items:center;
}
.launch-card:hover { transform:translateY(-4px); border-color:var(--gold); }
.launch-card .ico { font-size:56px; }
.launch-card h2 { font-size:24px; }
.launch-card p { color:var(--muted); font-size:14px; }
.launch-card.primary { border-color:var(--gold); box-shadow:0 0 30px rgba(255,210,74,.2); }
