:root {
  --bg: #0d1524; --bg2: #111c30; --panel: #16223a; --panel2: #1c2a46; --line: #2a3b5e;
  --ink: #eef2f8; --muted: #9fb0cc; --gold: #f2c14e; --gold2: #ffdd85; --red: #ff6363; --green: #3ddc97;
  --blue: #6cb4ff; --purple: #b98cff; --orange: #ff9f43;
  --ride: #3ddc97; --form: #f2c14e; --instr: #ff6b6b;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
  --r: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 20px/1.45 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; min-height: 100vh;
  background: radial-gradient(1200px 600px at 70% -10%, #1d2f55 0%, transparent 60%), var(--bg); }
a { color: var(--blue); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0 0 10px; line-height: 1.2; }
h1 { font-size: 34px; } h2 { font-size: 27px; } h3 { font-size: 22px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 17px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: rgba(13,21,36,.85); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); }
.brand { color: var(--gold); text-decoration: none; font: 800 26px/1 Georgia, serif; letter-spacing: 1px; display: flex; align-items: baseline; gap: 10px; }
.brand small { font: 400 16px "Segoe UI", system-ui, sans-serif; color: var(--muted); letter-spacing: 0; }
.gavel { font-size: 24px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--muted); }
.who b { color: var(--ink); }
.rankchip { border: 1px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 2px 10px; font-size: 15px; white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 90px; }

/* ---------- generic */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.btn { border: 0; border-radius: 14px; padding: 13px 22px; font-weight: 700; font-size: 20px; background: var(--gold); color: #1a1405; box-shadow: 0 3px 0 #a47d1c; transition: transform .06s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #a47d1c; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.btn.blue { background: var(--blue); color: #06162c; box-shadow: 0 3px 0 #2f6fb6; }
.btn.small { padding: 8px 14px; font-size: 17px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 16px; color: var(--muted); }
.pill.gold { border-color: var(--gold); color: var(--gold); }
.pill.red { border-color: var(--red); color: var(--red); }
.pill.green { border-color: var(--green); color: var(--green); }
input[type=text], input[type=search], select { font: inherit; background: var(--bg2); color: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px; }
input[type=text]:focus { outline: none; border-color: var(--gold); }
.plus { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 2px 10px; font-size: 16px; }
.more { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--blue); background: var(--bg2); border-radius: 8px; font-size: 18px; color: var(--muted); }

/* ---------- home */
.hero { text-align: center; padding: 14px 0 6px; }
.hero h1 { font-size: 44px; color: var(--gold); letter-spacing: 2px; }
.hero p { color: var(--muted); max-width: 760px; margin: 6px auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin-top: 18px; }
.tile { text-align: left; background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.tile .ico { font-size: 34px; }
.tile h3 { margin: 6px 0 4px; }
.tile p { color: var(--muted); font-size: 18px; margin: 0; }
.tile .tag { position: absolute; top: 12px; right: 12px; font-size: 14px; background: var(--gold); color: #1a1405; padding: 2px 9px; border-radius: 999px; font-weight: 700; }
.tile.star { border: 2px solid var(--gold); }

/* ---------- meters */
.meters { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 17px; }
.meter { display: flex; align-items: center; gap: 8px; }
.bar { display: inline-block; vertical-align: middle; width: 160px; height: 14px; background: #0a1020; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
#qArea, #bSide, #dSide, #fmSide, #cdSide { scroll-margin-top: 70px; }
.bar > i { display: block; height: 100%; background: var(--green); transition: width .4s; }
.bar.red > i { background: var(--red); } .bar.gold > i { background: var(--gold); } .bar.blue > i { background: var(--blue); }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 14px; height: 14px; border-radius: 50%; background: #0a1020; border: 1px solid var(--line); display: inline-block; }
.pips i.on { background: var(--gold); border-color: var(--gold); }
.pips.green i.on { background: var(--green); border-color: var(--green); }
.pips.blue i.on { background: var(--blue); border-color: var(--blue); }

/* ---------- the question / call area */
.stage { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.stage > * { min-width: 0; }
@media (max-width: 900px) { .stage { grid-template-columns: minmax(0,1fr); } }
.videobox { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow); }
.videobox video { width: 100%; height: 100%; display: block; background: #000; }
.vover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; background: rgba(5,10,20,.55); text-align: center; padding: 16px; }
.vover .big { font: 800 30px Georgia, serif; color: var(--gold); }
.frozen { position: absolute; left: 12px; top: 12px; background: var(--red); color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 8px; font-size: 17px; letter-spacing: 1px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.spinner { width: 46px; height: 46px; border: 5px solid rgba(255,255,255,.2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.transcript { background: #f6f1e4; color: #222; border-radius: 12px; padding: 14px 16px; font: 20px/1.5 "Courier New", Courier, monospace; box-shadow: var(--shadow); }
.transcript .ln { display: grid; grid-template-columns: 34px 1fr; gap: 6px; }
.transcript .ln b { color: #6b5a2a; }
.transcript .ctx { color: #6d6d6d; }
.transcript .cur { background: #fff3b0; border-radius: 6px; }
.timer { height: 10px; background: #0a1020; border-radius: 999px; overflow: hidden; margin: 12px 0; border: 1px solid var(--line); }
.timer > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold), var(--red)); width: 100%; transform-origin: left; }
.calls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.call { border: 0; border-radius: 16px; padding: 16px 12px; font-weight: 800; font-size: 21px; line-height: 1.15; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.call small { display: block; font-weight: 500; font-size: 15px; margin-top: 4px; opacity: .85; }
.call:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.call.ride { background: var(--ride); color: #052414; }
.call.form { background: var(--form); color: #1f1603; }
.call.instr { background: var(--instr); color: #2a0606; grid-column: 1 / -1; }
.call.g { background: #ffb3b3; color: #2a0606; font-size: 18px; }
.call:disabled { opacity: .4; }
.grounds { display: grid; grid-template-columns: 1fr; gap: 8px; grid-column: 1 / -1; }
.calls.phone { grid-template-columns: 1fr; }

/* ---------- reveal */
.stamp { display: inline-block; font: 900 30px Georgia, serif; letter-spacing: 2px; padding: 6px 16px; border: 4px solid currentColor; border-radius: 10px; transform: rotate(-4deg); animation: stamp .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes stamp { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
.stamp.good { color: var(--green); } .stamp.bad { color: var(--red); } .stamp.mid { color: var(--gold); } .stamp.win { color: var(--gold2); text-shadow: 0 0 18px rgba(242,193,78,.7); }
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.vcard { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.vcard .who2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.vcard .what { font-weight: 700; }
.ok { color: var(--green); } .no { color: var(--red); } .mid { color: var(--gold); }
.why { font-size: 20px; margin: 10px 0; }
.scorepop { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); font: 900 54px Georgia, serif; color: var(--gold); pointer-events: none; z-index: 60; animation: pop 1.1s ease-out forwards; text-shadow: 0 4px 18px rgba(0,0,0,.6); }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -110%) scale(1); } }
.vs { display: flex; gap: 8px; align-items: center; font-weight: 800; }
.vs .you { color: var(--green); } .vs .them { color: var(--red); }

/* ---------- tapes / lists */
.list { display: grid; gap: 10px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; width: 100%; }
.item:hover { border-color: var(--gold); }
.item .t { font-weight: 700; }
.item .s { color: var(--muted); font-size: 17px; }
table.lb { width: 100%; border-collapse: collapse; font-size: 18px; }
table.lb td, table.lb th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.lb tr.me td { color: var(--gold); font-weight: 700; }
.share { width: 100%; min-height: 110px; font: 18px/1.4 ui-monospace, Consolas, monospace; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

/* ---------- docket */
.hud { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 17px; }
.hud .hv { font-weight: 800; }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.door { text-align: left; background: linear-gradient(170deg, var(--panel2), var(--panel)); border: 2px solid var(--line); border-radius: 18px; padding: 16px; min-height: 170px; }
.door:hover { border-color: var(--gold); transform: translateY(-3px); }
.door .ico { font-size: 38px; }
.door h3 { margin: 4px 0; }
.door p { color: var(--muted); font-size: 17px; margin: 4px 0; }
.door.elite { border-color: #7a2f2f; } .door.boss { border-color: var(--gold); }
.floorline { display: flex; gap: 6px; align-items: center; margin: 8px 0 0; flex-wrap: wrap; }
.floorline i { width: 30px; height: 8px; border-radius: 4px; background: var(--line); }
.floorline i.done { background: var(--gold); } .floorline i.now { background: var(--blue); }
.foe { display: flex; gap: 14px; align-items: center; }
.foe .face { font-size: 46px; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; background: var(--bg2); border-radius: 50%; border: 2px solid var(--line); }
.foe.hit .face { animation: shake .35s; border-color: var(--gold); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.trait { font-size: 16px; color: var(--muted); }
.hand { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; min-height: 150px; }
.card { width: 150px; min-height: 196px; background: linear-gradient(170deg, #22345a, #172540); border: 2px solid #3a5285; border-radius: 14px; padding: 10px 10px 8px; position: relative; text-align: left; box-shadow: 0 6px 14px rgba(0,0,0,.35); transition: transform .12s; display: flex; flex-direction: column; }
.card:hover:not(:disabled) { transform: translateY(-8px); }
.card:disabled { opacity: .5; cursor: not-allowed; }
.card .cost { position: absolute; top: -10px; left: -10px; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #06162c; font-weight: 900; display: flex; align-items: center; justify-content: center; border: 2px solid #0d1524; font-size: 19px; }
.card .nm { font-weight: 800; font-size: 17px; line-height: 1.15; margin: 6px 0 4px; padding-left: 14px; }
.card .ty { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.card .tx { font-size: 15px; line-height: 1.3; margin-top: 4px; flex: 1; }
.card .lx { font-size: 13px; color: var(--gold2); margin-top: 6px; font-style: italic; }
.card.prep { border-color: #3d8f6d; background: linear-gradient(170deg, #1d4a3c, #14302a); }
.card.tactic { border-color: #3a5285; }
.card.temptation { border-color: #a14a4a; background: linear-gradient(170deg, #4a2228, #2b161b); }
.card.curse { border-color: #555; background: linear-gradient(170deg, #2b2b2b, #1a1a1a); }
.card.scout { border-color: var(--purple); background: linear-gradient(170deg, #3a2a5c, #221a3a); }
.card.rare { box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0,0,0,.35); }
.card.up .nm::after { content: " +"; color: var(--green); }
.card.big { width: 200px; min-height: 250px; }
.card.big .tx { font-size: 17px; }
.relics { display: flex; gap: 8px; flex-wrap: wrap; }
.relic { font-size: 16px; border: 1px solid var(--gold); color: var(--gold2); border-radius: 999px; padding: 2px 10px; background: rgba(242,193,78,.08); }
.ledger { max-height: 260px; overflow: auto; font-size: 17px; background: var(--bg2); border-radius: 12px; padding: 8px 12px; border: 1px solid var(--line); }
.ledger div { padding: 3px 0; border-bottom: 1px dashed #24324f; }
.dmg { color: var(--red); font-weight: 800; } .heal { color: var(--green); font-weight: 800; }

/* ---------- live / bingo */
.code { font: 900 92px/1 Georgia, serif; letter-spacing: 12px; color: var(--gold); text-align: center; }
.joinurl { text-align: center; font-size: 26px; }
.roster { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.roster span { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; }
.roster span.gone { opacity: .45; }
.bingo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.bingo button { min-width: 0; min-height: 74px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg2); font-size: 15px; line-height: 1.15; padding: 5px 4px; color: var(--muted); overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 420px) { .bingo button { font-size: 13px; min-height: 68px; } }
.bingo button.lit { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 12px rgba(242,193,78,.55); animation: pulse 1.2s infinite; }
.bingo button.mark { background: var(--gold); color: #1a1405; border-color: var(--gold); font-weight: 800; animation: none; }
.dist { display: grid; gap: 6px; margin: 10px 0; }
.dist .r { display: grid; grid-template-columns: 220px 1fr 60px; gap: 10px; align-items: center; }
.dist .r .bar { width: 100%; }
.bigq { font: 700 30px/1.35 Georgia, serif; }
.phonewrap { max-width: 560px; margin: 0 auto; }

/* ---------- toast + modal */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--gold); border-radius: 14px; padding: 12px 18px; z-index: 80; box-shadow: var(--shadow); max-width: 92vw; }
.modal { position: fixed; inset: 0; background: rgba(4,8,16,.72); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--gold); border-radius: 18px; padding: 20px; max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ach div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 17px; }
.ach div.got { border-color: var(--gold); }
.ach div b { display: block; }

@media (max-width: 600px) {
  body { font-size: 19px; }
  .brand { font-size: 22px; } .brand small { display: none; }
  .hero h1 { font-size: 36px; }
  .calls { grid-template-columns: 1fr; }
  .verdicts { grid-template-columns: 1fr; }
  .card { width: calc(50% - 6px); }
  .code { font-size: 64px; }
  .dist .r { grid-template-columns: 120px 1fr 44px; }
  .bigq { font-size: 24px; }
  .bar { width: 110px; }
  .foe .face { width: 50px; height: 50px; font-size: 30px; }
  .trait { display: none; }
  .panel { padding: 14px; }
  .transcript { font-size: 18px; }
}
