:root {
  --bg: #0a1230;
  --bg2: #0d1838;
  --panel: #14225a;
  --panel2: #1b2c6e;
  --gold: #ffd23f;
  --gold-d: #e3b21c;
  --blue: #3aa0ff;
  --chaser: #ff3b5c;
  --chaser-d: #c81e3e;
  --win: #2bd576;
  --lose: #ff5660;
  --ink: #eef3ff;
  --muted: #9fb0d8;
  --line: #2a3a78;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --r: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 800px at 50% -10%, #1a2a66 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: ui-rounded, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -0.02em; }

.brand {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 0.9;
}
.brand .a { color: var(--ink); }
.brand .b { color: var(--gold); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}
button:active { transform: translateY(1px) scale(0.99); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn {
  background: var(--panel2);
  color: var(--ink);
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  border: 1px solid var(--line);
}
.btn.primary { background: linear-gradient(180deg, var(--blue), #1f74cc); border: none; color: #fff; }
.btn.gold { background: linear-gradient(180deg, #ffe07a, var(--gold)); color: #2a1d00; border: none; }
.btn.chaser { background: linear-gradient(180deg, var(--chaser), var(--chaser-d)); color: #fff; border: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- timer bar ---------- */
.timer { height: 12px; border-radius: 999px; background: var(--panel2); overflow: hidden; }
.timer > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--win), var(--gold) 55%, var(--chaser));
  width: 100%; transform-origin: left center;
}

/* ---------- options ---------- */
.options, .answers { display: grid; gap: 0.7rem; }
.opt {
  display: flex; align-items: center; gap: 0.9rem;
  text-align: left; width: 100%;
  background: var(--panel2);
  border: 2px solid var(--line);
  color: var(--ink);
  padding: 1rem 1.1rem;
  border-radius: 14px;
  font-size: 1.05rem; font-weight: 700;
}
.opt .key {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 900;
}
.opt.correct { border-color: var(--win); background: rgba(43, 213, 118, 0.18); }
.opt.correct .key { background: var(--win); color: #043618; }
.opt.wrong { border-color: var(--lose); background: rgba(255, 86, 96, 0.16); }
.opt.wrong .key { background: var(--lose); }
.opt .who { margin-left: auto; font-size: 0.85rem; font-weight: 800; color: var(--muted); }

/* ---------- pills & tags ---------- */
.pill {
  display: inline-block; padding: 0.25rem 0.7rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 800; background: var(--panel2); color: var(--muted);
}
.pill.live { background: var(--chaser); color: #fff; }
.pill.gold { background: var(--gold); color: #2a1d00; }

/* ---------- money ---------- */
.money { color: var(--gold); font-weight: 900; }
.bank { font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 900; color: var(--gold); line-height: 1; }

/* ---------- contestant roster ---------- */
.roster { display: grid; gap: 0.5rem; }
.ros-row {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.55rem 0.8rem;
}
.ros-row .nm { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ros-row .st { font-size: 0.78rem; font-weight: 800; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.ros-row .st.through { background: rgba(43, 213, 118, 0.2); color: var(--win); }
.ros-row .st.out { background: rgba(255, 86, 96, 0.18); color: var(--lose); }
.ros-row .st.playing { background: var(--gold); color: #2a1d00; }
.ros-row.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.35) inset; }
.ros-row.chaser { border-color: var(--chaser); }
.ros-row.elim { opacity: 0.45; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--win); }
.dot.bot { background: var(--gold); }

/* ---------- the money ladder (head-to-head) ---------- */
.ladder { display: flex; flex-direction: column; gap: 4px; }
.rung {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.35rem 0.7rem; min-height: 2.4rem;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--muted); font-weight: 800;
}
.rung .lbl { font-size: 0.85rem; }
.rung.home { background: linear-gradient(180deg, rgba(43,213,118,0.25), rgba(43,213,118,0.08)); border-color: var(--win); color: var(--win); }
.rung .tok { font-size: 1.3rem; line-height: 1; }
.rung .tok.c { color: var(--gold); }
.rung .tok.x { color: var(--chaser); }
.rung.hasC { border-color: var(--gold); background: rgba(255,210,63,0.14); color: var(--ink); }
.rung.hasX { border-color: var(--chaser); background: rgba(255,59,92,0.16); color: var(--ink); }

/* ---------- offers ---------- */
.offers { display: grid; gap: 0.7rem; }
.offer {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.9rem 1.1rem; border-radius: 14px;
  border: 2px solid var(--line); background: var(--panel2); width: 100%; text-align: left;
}
.offer .amt { font-size: 1.5rem; font-weight: 900; color: var(--gold); }
.offer .knd { font-size: 0.8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.offer.low { border-color: var(--win); }
.offer.high { border-color: var(--chaser); }
.offer .sub { font-size: 0.8rem; color: var(--muted); }

/* ---------- final chase track ---------- */
.track { display: flex; flex-direction: column; gap: 0.6rem; }
.track .nums { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; }
.track .nums .big { font-size: clamp(2rem, 6vw, 3.4rem); }
.track .bar { height: 26px; border-radius: 999px; background: var(--panel2); overflow: hidden; position: relative; border: 1px solid var(--line); }
.track .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--chaser-d), var(--chaser)); transition: width 0.4s ease; }
.track .goal { color: var(--win); }
.track .chasenum { color: var(--chaser); }

/* pips for the build / chase step counts */
.pips { display: flex; flex-wrap: wrap; gap: 5px; }
.pip { width: 18px; height: 18px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--line); }
.pip.team { background: var(--gold); border-color: var(--gold-d); }
.pip.chase { background: var(--chaser); border-color: var(--chaser-d); }

@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: pop 0.25s ease; }
