/* Trivia Showdown — shared styles. The game is always presented on a dark "studio" stage. */
:root {
  --bg: #04060f;
  --bg-2: #0a0f24;
  --panel: #111833;
  --panel-2: #18214a;
  --line: #2a3566;
  --text: #f4f6ff;
  --muted: #9aa5d1;
  --gold: #f6b62b;
  --gold-2: #ffd56a;
  --tile-hi: #2346f0;
  --tile: #0d22b3;
  --tile-lo: #06127a;
  --red: #e3262f;
  --red-hi: #ff5a5f;
  --green: #22c55e;
  --danger: #ef4444;
  --radius: 14px;
  --font-display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--gold-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.neg { color: var(--red-hi) !important; }
.display { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .02em; }

/* ---------- generic controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.2em; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-weight: 600; text-decoration: none;
  transition: transform .06s ease, filter .15s ease, background .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.primary { background: linear-gradient(180deg, #ffcf5a, #e9a313); color: #1a1200; border-color: #c88a07; }
.btn.blue { background: linear-gradient(180deg, var(--tile-hi), var(--tile-lo)); border-color: #3756ff; }
.btn.danger { background: #3a0d12; border-color: #7f1d1d; color: #fecaca; }
.btn.ghost { background: transparent; }
.btn.small { padding: .4em .75em; font-size: .9em; border-radius: 8px; }
.btn.big { padding: 1em 1.4em; font-size: 1.2em; border-radius: 14px; }
.btn.block { width: 100%; }

input[type=text], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: .65em .8em; border-radius: 10px; border: 1px solid var(--line);
  background: #0b1130; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,182,43,.2); }
label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 .35em; font-weight: 600; }
.field { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.badge { display: inline-block; padding: .15em .55em; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); }
.badge.gold { background: rgba(246,182,43,.15); border-color: rgba(246,182,43,.5); color: var(--gold-2); }

#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: min(92vw, 420px); }
.toast { background: #1d2550; border: 1px solid var(--line); padding: .75em 1em; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .2s ease; }
.toast.error { background: #3a0d12; border-color: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.conn { position: fixed; top: 10px; right: 12px; font-size: .75rem; padding: .25em .7em; border-radius: 999px; background: rgba(0,0,0,.5); border: 1px solid var(--line); z-index: 50; }
.conn::before { content: '●'; margin-right: .4em; }
.conn.online::before { color: var(--green); }
.conn.offline::before, .conn.connecting::before { color: var(--gold); }
.conn.failed::before { color: var(--danger); }
body.phone .conn { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); right: auto; left: 12px; }
body.phone .conn.online { opacity: .6; }

/* ======================================================================
   BOARD (projector) — blue tile grid, gold values, lit stage frame
   ====================================================================== */
body.board-page { overflow: hidden; background: radial-gradient(ellipse at 50% 120%, #0b1a6a 0%, #04060f 55%); }
.stage { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 1.2vh 1.2vw 1vh; gap: 1vh; }
.stage-lights { display: grid; gap: .8vh; padding: 0 2vw; }
.stage-lights span {
  height: .8vh; border-radius: 99px;
  background: linear-gradient(90deg, rgba(246,182,43,.2), var(--gold-2) 20%, #fff2c4 50%, var(--gold-2) 80%, rgba(246,182,43,.2));
  box-shadow: 0 0 1.2vh rgba(255,200,80,.8), 0 0 3vh rgba(255,170,40,.35);
}
.stage-body { display: grid; grid-template-columns: 2.6vw 1fr 2.6vw; gap: 1.2vw; min-height: 0; }
.pillar {
  border-radius: .6vw; border: .25vw solid #0b0f22; background-color: #0a1240;
  background-image: repeating-linear-gradient(180deg, #3a5cff 0 5.6vh, #0a1240 5.6vh 6.6vh);
  box-shadow: inset 0 0 1.2vw rgba(0,0,0,.6), 0 0 2vw rgba(40,80,255,.35);
  opacity: .75; transition: filter .3s, opacity .3s;
}
body.armed .pillar {
  opacity: 1;
  background-image: repeating-linear-gradient(180deg, #e8eeff 0 5.6vh, #0a1240 5.6vh 6.6vh);
  box-shadow: inset 0 0 1.2vw rgba(0,0,0,.4), 0 0 3vw rgba(200,220,255,.9);
  animation: pillarPulse .9s ease-in-out infinite;
}
@keyframes pillarPulse { 50% { filter: brightness(1.35); } }

.screen {
  position: relative; min-height: 0; border-radius: 1vw; padding: 1vw;
  background: #05070f; border: .35vw solid #11173a;
  box-shadow: inset 0 0 2vw rgba(0,0,0,.9), 0 0 4vw rgba(30,60,255,.25);
  display: flex; flex-direction: column;
}

.grid { flex: 1; display: grid; gap: .55vw; min-height: 0; }
.tile {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(ellipse at 50% 35%, var(--tile-hi) 0%, var(--tile) 55%, var(--tile-lo) 100%);
  border: 1px solid #02062e; border-radius: .35vw;
  box-shadow: inset 0 0 1.5vw rgba(0,0,30,.55), inset 0 1px 0 rgba(255,255,255,.12);
  font-family: var(--font-display); text-transform: uppercase; overflow: hidden; padding: .4vw;
  transition: box-shadow .15s, transform .15s;
}
.tile.cat { color: #fff; font-weight: 700; font-size: clamp(14px, 2.1vw, 44px); line-height: 1.02; letter-spacing: .01em; text-shadow: .15vw .15vw 0 #000; }
.tile.val { color: var(--gold); font-weight: 700; font-size: clamp(20px, 4.6vw, 104px); text-shadow: .25vw .25vw 0 #000, 0 0 1vw rgba(0,0,0,.4); }
.tile.used { color: transparent; text-shadow: none; background: radial-gradient(ellipse at 50% 35%, #0c1c95 0%, #061071 100%); }
.tile.cursor {
  z-index: 2; outline: .3vw solid #fff; outline-offset: -.15vw;
  box-shadow: 0 0 1.6vw #fff, 0 0 3.5vw rgba(160,190,255,.9), inset 0 0 1.5vw rgba(255,255,255,.35);
  transform: scale(1.03);
}
.tile.cursor.used { outline-color: rgba(255,255,255,.45); box-shadow: 0 0 1vw rgba(255,255,255,.4); }
.tile.picked { animation: tileFlash .5s ease 2; }
@keyframes tileFlash { 50% { filter: brightness(2); } }

/* clue screen */
.clue {
  flex: 1; display: flex; flex-direction: column; gap: 1.5vh; min-height: 0;
  background: radial-gradient(ellipse at 50% 30%, var(--tile-hi) 0%, var(--tile) 50%, var(--tile-lo) 100%);
  border-radius: .5vw; padding: 2.2vh 3vw; border: 1px solid #02062e;
  box-shadow: inset 0 0 4vw rgba(0,0,30,.6);
}
.clue-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-display); text-transform: uppercase; }
.clue-head .cat { font-size: clamp(16px, 2.2vw, 46px); font-weight: 600; color: #dbe3ff; text-shadow: .15vw .15vw 0 #000; }
.clue-head .val { font-size: clamp(20px, 3.2vw, 70px); font-weight: 700; color: var(--gold); text-shadow: .2vw .2vw 0 #000; }
.clue-q {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--font-display); text-transform: uppercase; font-weight: 600; color: #fff;
  font-size: clamp(22px, 4.1vw, 92px); line-height: 1.12; text-shadow: .25vw .25vw 0 #000; min-height: 0;
}
.clue.has-choices .clue-q { font-size: clamp(20px, 3.2vw, 70px); flex: 0 1 auto; padding-top: 1vh; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vh 1.5vw; }
.choices.tf { grid-template-columns: 1fr 1fr; }
.choice {
  display: flex; align-items: center; gap: 1vw; padding: 1.4vh 1.4vw; border-radius: .5vw;
  background: rgba(0,0,40,.45); border: .2vw solid rgba(255,255,255,.25);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(16px, 2.3vw, 50px); text-transform: uppercase; color: #fff;
  text-shadow: .12vw .12vw 0 #000; transition: all .25s;
}
.choice .letter { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--gold); color: #1b1300; text-shadow: none; font-weight: 700; }
.choice.out { opacity: .35; text-decoration: line-through; }
.choice.correct { background: rgba(34,197,94,.35); border-color: #4ade80; box-shadow: 0 0 2vw rgba(74,222,128,.7); }
.choice.wrongpick { background: rgba(239,68,68,.3); border-color: #f87171; }
.clue-foot { min-height: 9vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; }
.banner {
  font-family: var(--font-display); text-transform: uppercase; font-weight: 700; text-align: center;
  font-size: clamp(18px, 2.8vw, 60px); color: #fff; text-shadow: .2vw .2vw 0 #000;
}
.banner.gold { color: var(--gold); }
.banner.good { color: #86efac; }
.banner.bad { color: #fca5a5; }
.reading-hint { font-family: var(--font-display); text-transform: uppercase; color: #b9c6ff; font-size: clamp(14px, 1.6vw, 32px); letter-spacing: .1em; }
.explain { font-size: clamp(14px, 1.5vw, 30px); color: #e6ebff; text-align: center; max-width: 80%; }

/* segmented countdown lights */
.timer { display: flex; gap: .5vw; justify-content: center; width: 70%; }
.timer i { flex: 1; height: 1.6vh; border-radius: 99px; background: #ff4a3d; box-shadow: 0 0 1vw rgba(255,80,60,.8); transition: opacity .15s; }
.timer i.off { opacity: .12; box-shadow: none; }
.timer.buzz i { background: #fff; box-shadow: 0 0 1vw rgba(255,255,255,.8); }

/* scores */
.scores { display: flex; gap: 1.2vw; justify-content: center; padding: 0 3.8vw; }
.podium {
  flex: 1; max-width: 24vw; text-align: center; border-radius: .6vw; padding: .8vh .8vw;
  background: linear-gradient(180deg, #121a46, #070b22); border: .2vw solid #1e2b6e; position: relative;
  transition: all .25s;
}
.podium .name { font-family: var(--font-display); text-transform: uppercase; font-weight: 600; font-size: clamp(14px, 1.6vw, 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .score { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: clamp(18px, 2.6vw, 58px); text-shadow: .15vw .15vw 0 #000; }
.podium .tag { position: absolute; top: -1.4vh; left: 50%; transform: translateX(-50%); font-size: clamp(10px, .9vw, 18px); font-weight: 800; letter-spacing: .08em; padding: .2vh .7vw; border-radius: 99px; background: var(--gold); color: #1b1300; white-space: nowrap; }
.podium.control { border-color: var(--gold); box-shadow: 0 0 1.4vw rgba(246,182,43,.45); }
.podium.buzzed { border-color: #fff; background: linear-gradient(180deg, #e3262f, #7a0d12); box-shadow: 0 0 2.5vw rgba(255,80,80,.9); transform: translateY(-.6vh); }
.podium.out { opacity: .45; }

/* lobby */
.lobby { flex: 1; display: grid; grid-template-rows: auto 1fr auto; gap: 2vh; min-height: 0; padding: 1vh 1vw; }
.lobby h1 { margin: 0; text-align: center; font-family: var(--font-display); text-transform: uppercase; font-size: clamp(26px, 4.2vw, 90px); color: var(--gold); text-shadow: .25vw .25vw 0 #000; }
.lobby .sub { text-align: center; color: var(--muted); font-size: clamp(12px, 1.2vw, 24px); margin-top: .3vh; }
.join-grid { display: grid; gap: 1.2vw; min-height: 0; }
.join-card { background: radial-gradient(ellipse at 50% 20%, #1a34d6, #08167f); border-radius: .8vw; padding: 1.2vh 1vw; display: flex; flex-direction: column; align-items: center; gap: .8vh; min-height: 0; border: 1px solid #02062e; }
.join-card h2 { margin: 0; font-family: var(--font-display); text-transform: uppercase; font-size: clamp(16px, 2vw, 44px); text-shadow: .15vw .15vw 0 #000; text-align: center; }
.qr { background: #fff; border-radius: .6vw; padding: .5vw; width: min(15vw, 24vh); aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; display: block; }
.players { display: flex; flex-wrap: wrap; gap: .4vw; justify-content: center; max-height: 12vh; overflow: hidden; }
.chip { background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.2); padding: .2vh .6vw; border-radius: 99px; font-size: clamp(10px, 1vw, 20px); }
.chip.captain { border-color: var(--gold); color: var(--gold-2); }
.host-step { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; min-height: 0; }
.host-step .qr.big { width: min(26vw, 42vh); padding: 1vw; box-shadow: 0 0 4vw rgba(246,182,43,.35); }
.step-tag { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; background: var(--gold); color: #1b1300; padding: .5vh 1.4vw; border-radius: 99px; font-weight: 700; font-size: clamp(12px, 1.3vw, 26px); }
.host-strip { display: flex; align-items: center; justify-content: center; gap: 1.5vw; }
.host-strip .qr { width: min(9vw, 15vh); }
.host-strip .txt { font-size: clamp(12px, 1.3vw, 26px); }

.final { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.final h1 { margin: 0; font-family: var(--font-display); text-transform: uppercase; font-size: clamp(28px, 5vw, 110px); color: var(--gold); text-shadow: .3vw .3vw 0 #000; text-align: center; }
.final .rank { display: grid; grid-template-columns: auto 1fr auto; gap: 1vh 2vw; font-family: var(--font-display); text-transform: uppercase; font-size: clamp(18px, 2.6vw, 56px); min-width: 50vw; }
.final .rank .score { color: var(--gold); text-align: right; }

.corner-tools { position: fixed; bottom: 8px; right: 10px; display: flex; gap: 6px; opacity: .25; transition: opacity .2s; z-index: 60; }
.corner-tools:hover { opacity: 1; }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(2,4,12,.85); z-index: 100; }

/* ======================================================================
   PHONE PAGES (host + clicker)
   ====================================================================== */
body.phone { min-height: 100dvh; background: radial-gradient(ellipse at 50% -10%, #142170 0%, #04060f 60%); overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
.phone-wrap { max-width: 560px; margin: 0 auto; padding: 14px 16px 28px; min-height: 100dvh; display: flex; flex-direction: column; gap: 14px; }
.phone-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phone-head .team { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; font-size: 1.7rem; line-height: 1.05; }
.phone-head .me { font-size: .85rem; color: var(--muted); }
.phone-head .pts { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 1.6rem; }
.phone-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.status { font-family: var(--font-display); text-transform: uppercase; font-size: 1.35rem; letter-spacing: .03em; }
.status.small { font-size: 1rem; color: var(--muted); font-family: var(--font-ui); text-transform: none; letter-spacing: 0; }

/* big red buzzer */
.buzzer {
  width: min(78vw, 58dvh, 420px); aspect-ratio: 1; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 50% 35%, #ff6b6b 0%, var(--red) 45%, #8b0a10 100%);
  box-shadow: 0 1.4vh 0 #5a0408, 0 1.8vh 3vh rgba(0,0,0,.6), inset 0 -1vh 2vh rgba(0,0,0,.35), inset 0 1vh 2vh rgba(255,255,255,.25);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 11vw, 4rem); text-transform: uppercase; text-shadow: 0 3px 0 rgba(0,0,0,.4);
  transition: transform .05s, filter .2s, box-shadow .05s;
}
.buzzer:active, .buzzer.pressed { transform: translateY(1.2vh); box-shadow: 0 .2vh 0 #5a0408, 0 .5vh 1vh rgba(0,0,0,.6), inset 0 -1vh 2vh rgba(0,0,0,.35); }
.buzzer.idle { filter: saturate(.35) brightness(.55); }
.buzzer.live { animation: buzzerPulse .8s ease-in-out infinite; }
.buzzer.locked { filter: grayscale(1) brightness(.4); }
@keyframes buzzerPulse { 50% { box-shadow: 0 1.4vh 0 #5a0408, 0 0 6vh rgba(255,60,60,.95), inset 0 1vh 2vh rgba(255,255,255,.35); filter: brightness(1.15); } }

/* answer buttons */
.answers { width: 100%; display: grid; gap: 12px; }
.answer {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 18px 16px; border-radius: 14px; border: 2px solid rgba(255,255,255,.25);
  background: radial-gradient(ellipse at 50% 30%, var(--tile-hi), var(--tile-lo)); color: #fff; font-weight: 700; font-size: 1.15rem;
}
.answer .letter { flex: none; display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 50%; background: var(--gold); color: #1b1300; font-family: var(--font-display); font-size: 1.1em; }
.answer:disabled { opacity: .3; text-decoration: line-through; }
.answer:active:not(:disabled) { transform: scale(.98); }

/* d-pad */
.dpad { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 10px; width: min(84vw, 340px); aspect-ratio: 1; }
.dpad button {
  border: 0; border-radius: 18px; font-size: 2.2rem; color: #fff;
  background: radial-gradient(ellipse at 50% 30%, var(--tile-hi), var(--tile-lo));
  box-shadow: 0 6px 0 #030a4a, 0 10px 18px rgba(0,0,0,.5); transition: transform .05s, box-shadow .05s;
}
.dpad button:active { transform: translateY(5px); box-shadow: 0 1px 0 #030a4a; }
.dpad .up { grid-area: 1 / 2; } .dpad .left { grid-area: 2 / 1; } .dpad .right { grid-area: 2 / 3; } .dpad .down { grid-area: 3 / 2; }
.dpad .select {
  grid-area: 2 / 2; border-radius: 50%; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: .05em;
  background: radial-gradient(circle at 50% 35%, #ffe08a, var(--gold) 55%, #b07a05); color: #1b1300; box-shadow: 0 6px 0 #6b4a02, 0 10px 18px rgba(0,0,0,.5);
}
.dpad .select:active { box-shadow: 0 1px 0 #6b4a02; }
.minimap { display: grid; gap: 3px; width: min(84vw, 340px); }
.minimap .m { height: 22px; border-radius: 3px; background: var(--tile); font-size: .65rem; display: grid; place-items: center; color: var(--gold); font-weight: 700; font-family: var(--font-display); }
.minimap .m.used { background: #061071; color: transparent; }
.minimap .m.cur { outline: 3px solid #fff; box-shadow: 0 0 10px #fff; }
.minimap .h { font-size: .55rem; text-transform: uppercase; color: #cbd5ff; text-align: center; line-height: 1.05; overflow: hidden; height: 2.2em; font-weight: 700; }

.countdown { width: 100%; height: 10px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.countdown > div { height: 100%; background: linear-gradient(90deg, #ff4a3d, var(--gold)); border-radius: 99px; transition: width .1s linear; }
.big-num { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--gold); }

/* host */
.host-q { font-family: var(--font-display); text-transform: uppercase; font-size: 1.35rem; line-height: 1.2; text-align: left; }
.host-choices { display: grid; gap: 6px; width: 100%; text-align: left; }
.host-choices div { padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.host-choices div.ok { border-color: #4ade80; background: rgba(34,197,94,.18); }
.host-choices div.out { opacity: .4; text-decoration: line-through; }
.host-grid { display: grid; gap: 4px; width: 100%; }
.host-grid button { border: 0; border-radius: 6px; padding: 10px 0; background: var(--tile); color: var(--gold); font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.host-grid button:disabled { background: #081266; color: transparent; }
.host-grid button.cur { outline: 2px solid #fff; }
.host-grid .h { font-size: .6rem; text-transform: uppercase; color: #cbd5ff; text-align: center; font-weight: 700; line-height: 1.1; align-self: end; padding-bottom: 2px; }
.team-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.team-row.control { border-color: var(--gold); }
.team-row .nm { flex: 1; font-weight: 700; text-align: left; }
.team-row .sc { font-family: var(--font-display); color: var(--gold); font-size: 1.2rem; min-width: 5ch; text-align: right; }
.stack { display: grid; gap: 8px; width: 100%; }
details.panel { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; }
details.panel summary { cursor: pointer; font-weight: 700; }

/* ======================================================================
   ADMIN / SETUP
   ====================================================================== */
body.admin { background: linear-gradient(180deg, #070b1d, #04060f); }
.admin-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: rgba(7,11,29,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; font-size: 1.4rem; color: var(--gold); letter-spacing: .03em; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: transparent; border: 0; padding: .55em 1em; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs button.active { background: var(--panel-2); color: var(--text); }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-main h2 { margin: 0 0 1rem; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .03em; }
.two-col { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } .admin-top { flex-wrap: wrap; } }
.bank-list { display: grid; gap: 8px; }
.bank-item { text-align: left; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.bank-item.active { border-color: var(--gold); background: var(--panel-2); }
.bank-item .t { font-weight: 700; }
.bank-item .s { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.cat-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.cat-pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #0b1130; cursor: pointer; color: var(--text); font-size: .95rem; margin: 0; }
.cat-pick input { margin-top: 3px; }
.cat-pick small { display: block; color: var(--muted); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: .55em 1.1em; color: var(--muted); font-weight: 700; }
.seg button.active { background: var(--gold); color: #1b1300; }
.qtable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.qtable th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 60px; background: var(--panel); }
.qtable td { padding: 8px; border-bottom: 1px solid rgba(42,53,102,.5); vertical-align: top; }
.qtable td.q { width: 55%; }
.qtable .ans { color: #86efac; font-size: .85rem; }
.diff { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; font-weight: 800; font-size: .8rem; color: #0b0f22; }
.diff.d1 { background: #86efac; } .diff.d2 { background: #bef264; } .diff.d3 { background: #fde047; } .diff.d4 { background: #fdba74; } .diff.d5 { background: #fca5a5; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: .5rem 0 1rem; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(680px, 94vw); }
dialog::backdrop { background: rgba(0,0,0,.65); }
dialog form { padding: 20px; }
.choice-inputs { display: grid; gap: 8px; }
.choice-inputs .ci { display: flex; gap: 8px; align-items: center; }
.choice-inputs .ci b { width: 1.6em; text-align: center; color: var(--gold); }
.recent { display: grid; gap: 8px; }
.recent a { text-decoration: none; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

/* landing */
.landing { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; background: radial-gradient(ellipse at 50% 0%, #1a2a8a, #04060f 65%); }
.landing h1 { font-family: var(--font-display); text-transform: uppercase; color: var(--gold); font-size: clamp(2.4rem, 9vw, 5.5rem); margin: 0; text-shadow: 4px 4px 0 #000; }
.mini-board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; width: min(560px, 92vw); margin: 28px auto; }
.mini-board div { aspect-ratio: 1.5; display: grid; place-items: center; border-radius: 4px; background: radial-gradient(ellipse at 50% 35%, var(--tile-hi), var(--tile-lo)); color: var(--gold); font-family: var(--font-display); font-weight: 700; font-size: clamp(.7rem, 2.6vw, 1.15rem); text-shadow: 2px 2px 0 #000; }
