:root {
  --bg: #130b26;
  --bg-soft: #1d1238;
  --panel: #211540;
  --panel-2: #2a1b50;
  --line: rgba(255, 255, 255, 0.12);
  --ink: #f8f6ff;
  --muted: #b7aed4;
  --gold: #fdcd53;
  --orange: #ff8a2b;
  --purple: #9d7bff;
  --blue: #38bdf8;
  --rose: #fb7185;
  --green: #4ade80;
  --ui: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  --round: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(circle at 15% 0%, #341f64 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--ink);
  font: 14px/1.55 var(--ui);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font-weight: 700;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: #362466; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--gold), #ffb32e); color: #20123a; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.accent { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; border-color: transparent; }
.btn.danger { background: rgba(251, 113, 133, 0.16); border-color: rgba(251, 113, 133, 0.45); color: #fecdd3; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ===== Operator Shell ===== */
.op-shell {
  max-width: 1460px; margin: 0 auto;
  padding: 14px max(14px, env(safe-area-inset-right, 0px)) 40px max(14px, env(safe-area-inset-left, 0px));
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 12px 16px; border-radius: 16px;
  background: rgba(33, 21, 64, 0.85); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 28px; line-height: 1; }
.brand h1 { margin: 0; font-size: 18px; font-family: var(--round); font-weight: 800; letter-spacing: .02em; }
.brand-sub { margin: 0; font-size: 12px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.sync-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--muted);
}
.sync-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-badge.ok { color: #bbf7d0; border-color: rgba(74, 222, 128, 0.35); }
.sync-badge.ok i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sync-badge.err { color: #fecdd3; border-color: rgba(251, 113, 133, 0.45); }
.sync-badge.err i { background: var(--rose); }

.btn-lock {
  padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); color: var(--ink);
}
.btn-lock.unlocked {
  background: rgba(74, 222, 128, 0.14); border-color: rgba(74, 222, 128, 0.45); color: #bbf7d0;
}
.btn-screen {
  text-decoration: none; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), #ff9f2e); color: #1b0f30;
}

.tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.tab {
  flex: 1 1 140px; padding: 11px 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  font-weight: 700; font-size: 14px; text-align: center;
}
.tab.on {
  background: linear-gradient(135deg, rgba(253, 205, 83, 0.2), rgba(157, 123, 255, 0.22));
  border-color: var(--gold); color: var(--gold);
}

.grid-op { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr); gap: 14px; }
@media (max-width: 960px) { .grid-op { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0;
}
.card h2 {
  margin: 0 0 12px; font-size: 13px; letter-spacing: .06em; color: var(--gold);
  text-transform: uppercase; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Preview box */
.pv {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px;
  overflow: hidden; background: #0c0718; border: 1px solid rgba(253, 205, 83, 0.35);
}
.pv .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }

.scene-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
@media (max-width: 640px) { .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scene-btn {
  position: relative; text-align: left; padding: 12px 12px 26px; border-radius: 12px;
  background: var(--panel-2); border: 2px solid var(--line); color: var(--ink);
}
.scene-btn b { display: block; font-size: 14px; font-family: var(--round); }
.scene-btn span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.scene-btn.on { background: rgba(255, 138, 43, 0.16); border-color: var(--orange); }
.scene-btn.on::after {
  content: "ON AIR"; position: absolute; right: 8px; bottom: 7px;
  font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px;
  background: var(--orange); color: #1b0f30;
}

.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-soft); }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--purple); color: #fff; }

.field-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input, .select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--ink);
}
.label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
.label:first-child { margin-top: 0; }

/* Teams & Rounds */
.round-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.round-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.round-pill {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted); font-weight: 700;
}
.round-pill.on { background: var(--gold); color: #1f1137; border-color: transparent; }

.rooms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 12px; }
.room-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.room-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.room-head h3 { margin: 0; font-size: 15px; font-family: var(--round); color: var(--gold); }
.room-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team-box {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 110px;
}
.team-box.teamA { border-top: 3px solid var(--blue); }
.team-box.teamB { border-top: 3px solid var(--orange); }
.team-title {
  display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; margin-bottom: 6px;
}
.teamA .team-title { color: var(--blue); }
.teamB .team-title { color: var(--orange); }
.player-chips { display: flex; flex-direction: column; gap: 4px; }
.pchip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 5px 8px; border-radius: 7px; font-size: 13px; font-weight: 700; text-align: left;
  background: rgba(255,255,255,0.05); border: 1px solid transparent; width: 100%;
}
.pchip:hover { background: rgba(255,255,255,0.1); }
.pchip.selected { border-color: var(--gold); background: rgba(253, 205, 83, 0.18); }
.pchip-tags { display: inline-flex; gap: 4px; flex-shrink: 0; }
.tag {
  font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 800;
  background: rgba(255,255,255,0.1); color: var(--muted);
}
.tag.kid { background: rgba(253, 205, 83, 0.18); color: var(--gold); }
.tag.online { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.tag.leader { background: rgba(74, 222, 128, 0.2); color: #86efac; }

.match-results {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.match-row { background: var(--bg-soft); border-radius: 8px; padding: 6px 8px; }
.match-row span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.win-btns { display: flex; gap: 4px; }
.win-btns button {
  flex: 1; padding: 6px 4px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel-2); font-size: 12px; font-weight: 800;
}
.win-btns button.winA { background: var(--blue); color: #081826; border-color: transparent; }
.win-btns button.winB { background: var(--orange); color: #241002; border-color: transparent; }

.bench-box {
  margin-top: 12px; background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; padding: 12px;
}
.bench-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bench-list .pchip { width: auto; }

/* Standings */
.standings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings-table th, .standings-table td {
  padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left;
}
.standings-table th { color: var(--muted); font-size: 11px; }
.rank-num { font-weight: 800; color: var(--gold); width: 42px; }
.win-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 800; font-size: 12px;
  background: rgba(253, 205, 83, 0.16); color: var(--gold);
}

/* Quiz operator */
.quiz-teams-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.qteam-card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  border-top: 4px solid var(--team-color, var(--gold));
}
.qteam-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.qteam-name { font-weight: 800; font-size: 13px; }
.qteam-score { font-size: 24px; font-weight: 800; font-family: var(--round); color: var(--gold); }
.qteam-controls { display: flex; gap: 5px; margin-top: 8px; align-items: center; }
.qteam-members { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }

.timer-panel {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 12px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); margin-bottom: 12px;
}
.timer-readout {
  font-family: var(--round); font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--gold); min-width: 82px;
}
.timer-readout.warn { color: var(--orange); }
.timer-readout.danger { color: var(--rose); }

.q-list { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.q-item {
  text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-soft); display: flex; flex-direction: column; gap: 4px;
}
.q-item.on { border-color: var(--gold); background: rgba(253, 205, 83, 0.12); }
.q-item.used { opacity: 0.62; }
.q-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.q-no { font-weight: 800; color: var(--gold); }

/* Roster table */
.roster-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fpill {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--muted); font-size: 12px; font-weight: 700;
}
.fpill.on { background: var(--gold); color: #1e1135; border-color: transparent; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.player-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line);
}
.player-card.absent { opacity: 0.48; }
.player-info { min-width: 0; }
.player-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.player-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ===== Screen Mode (#screen) ===== */
body.screen { background: #000; overflow: hidden; }
body.screen .op-shell { display: none; }
.scr-shell { display: none; position: fixed; inset: 0; background: #000; }
body.screen .scr-shell { display: block; }
.scr-mount { position: absolute; inset: 0; }
.scr-mount .stage { position: absolute; left: 50%; top: 50%; transform-origin: center center; }
.scr-shell.idle { cursor: none; }
.scr-controls {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; display: flex; gap: 8px;
  transition: opacity .35s ease;
}
.scr-shell.idle .scr-controls, :fullscreen .scr-controls { opacity: 0; pointer-events: none; }
.scr-btn {
  padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.28);
  background: rgba(14, 9, 28, 0.78); color: #fff; font-weight: 700; font-size: 13px;
}

/* ===== 1920x1080 Fixed Stage ===== */
.stage {
  width: 1920px; height: 1080px; overflow: hidden; position: relative;
  background: radial-gradient(circle at 20% 10%, #3a2370 0%, #241446 45%, #120926 100%);
  font-family: var(--round); color: #fff;
}
.stage * { box-sizing: border-box; }
.stage-bg-stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(253,205,83,0.16) 0, transparent 220px),
    radial-gradient(circle at 88% 80%, rgba(167,139,250,0.18) 0, transparent 280px);
}
.stage-inner { position: relative; z-index: 2; width: 100%; height: 100%; padding: 48px 64px; display: flex; flex-direction: column; }
.stage-hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 28px; flex-shrink: 0;
}
.stage-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 24px; border-radius: 999px;
  background: rgba(253, 205, 83, 0.16); border: 2px solid rgba(253, 205, 83, 0.55);
  color: #fdcd53; font-size: 30px; font-weight: 800;
}
.stage-title { margin: 0; font-size: 56px; font-weight: 800; letter-spacing: .02em; text-shadow: 0 4px 18px rgba(0,0,0,0.45); }
.stage-sub { font-size: 28px; color: #d6cef0; font-weight: 700; }

/* Scene: Title */
.sc-title { position: relative; width: 100%; height: 100%; }
.sc-title-kv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-title-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,8,34,0.18) 0%, rgba(16,8,34,0.12) 58%, rgba(16,8,34,0.86) 100%);
}
.sc-title-bar {
  position: absolute; left: 56px; right: 56px; bottom: 40px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.sc-title-meta {
  background: rgba(20, 11, 42, 0.85); border: 2px solid rgba(253, 205, 83, 0.6);
  border-radius: 24px; padding: 20px 32px; backdrop-filter: blur(8px);
}
.sc-title-meta h2 { margin: 0; font-size: 42px; color: #fdcd53; }
.sc-title-meta p { margin: 6px 0 0; font-size: 26px; color: #f3effd; font-weight: 700; }
.sc-title-pill {
  background: #fdcd53; color: #1b0f30; font-size: 34px; font-weight: 800;
  padding: 18px 34px; border-radius: 22px; box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

/* Scene: Rules */
.rules-grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; flex: 1; }
.rule-card {
  background: rgba(255,255,255,0.08); border: 2px solid rgba(253,205,83,0.35);
  border-radius: 28px; padding: 30px 34px; display: flex; flex-direction: column; justify-content: center;
}
.rule-card .r-tag { font-size: 24px; font-weight: 800; color: #fdcd53; margin-bottom: 8px; }
.rule-card h3 { margin: 0 0 12px; font-size: 42px; color: #fff; }
.rule-card p { margin: 0; font-size: 28px; color: #e2dbf7; line-height: 1.5; }
.rule-footer {
  margin-top: 22px; text-align: center; font-size: 32px; font-weight: 800;
  color: #1b0f30; background: #fdcd53; padding: 16px 28px; border-radius: 20px;
}
.rules-8-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; flex: 1; }
.rule8-item {
  display: flex; align-items: center; gap: 20px; padding: 20px 26px; border-radius: 22px;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.16);
}
.rule8-num {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #fdcd53; color: #1b0f30; font-size: 34px; font-weight: 800;
}
.rule8-txt { font-size: 31px; font-weight: 700; line-height: 1.35; }

/* Scene: Teams / Match */
.sc-rooms {
  display: grid; gap: 22px; flex: 1; align-content: stretch;
}
.sc-rooms.cols-2 { grid-template-columns: repeat(2, 1fr); }
.sc-rooms.cols-3 { grid-template-columns: repeat(3, 1fr); }
.sc-room {
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.16);
  border-radius: 24px; padding: 20px 22px; display: flex; flex-direction: column;
}
.sc-room-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.sc-room-title { font-size: 30px; font-weight: 800; color: #fdcd53; }
.sc-room-scores { display: flex; gap: 10px; font-size: 20px; font-weight: 800; }
.sc-res-pill { padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,0.12); color: #e2dbf7; }
.sc-res-pill.winA { background: #38bdf8; color: #081b29; }
.sc-res-pill.winB { background: #ff8a2b; color: #241002; }
.sc-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1; }
.sc-team {
  background: rgba(16, 9, 34, 0.72); border-radius: 18px; padding: 14px 16px;
  border-top: 6px solid #38bdf8; display: flex; flex-direction: column; gap: 8px;
}
.sc-team.b { border-top-color: #ff8a2b; }
.sc-team-lbl { font-size: 22px; font-weight: 800; color: #7dd3fc; }
.sc-team.b .sc-team-lbl { color: #fdba74; }
.sc-pname {
  font-size: 27px; font-weight: 800; color: #fff; line-height: 1.25;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sc-pname small {
  font-size: 16px; padding: 2px 9px; border-radius: 999px;
  background: rgba(56, 189, 248, 0.24); color: #bae6fd;
}

/* Scene: Break */
.sc-break {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 28px;
}
.sc-break-emoji { font-size: 128px; line-height: 1; }
.sc-break h2 { margin: 0; font-size: 96px; color: #fdcd53; text-shadow: 0 6px 24px rgba(0,0,0,0.45); }
.sc-break-note {
  font-size: 48px; font-weight: 800; color: #1b0f30; background: #fdcd53;
  padding: 20px 48px; border-radius: 999px;
}

/* Scene: Quiz */
.sc-quiz-top {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px;
}
.sc-quiz-badges { display: flex; align-items: center; gap: 14px; }
.sc-qno {
  font-size: 38px; font-weight: 800; padding: 10px 26px; border-radius: 18px;
  background: #fdcd53; color: #1b0f30;
}
.sc-qcat {
  font-size: 28px; font-weight: 800; padding: 10px 22px; border-radius: 18px;
  background: rgba(255,255,255,0.12); color: #e9e3fa;
}
.sc-double-pill {
  font-size: 30px; font-weight: 800; padding: 10px 24px; border-radius: 18px;
  background: linear-gradient(135deg, #ff5f6d, #ff9966); color: #fff;
  box-shadow: 0 6px 20px rgba(255,95,109,0.45);
}
.sc-timer-box {
  display: flex; align-items: center; gap: 18px; padding: 10px 26px; border-radius: 22px;
  background: rgba(16, 9, 34, 0.8); border: 3px solid rgba(253, 205, 83, 0.65);
  min-width: 310px;
}
.sc-timer-box.warn { border-color: #ff8a2b; }
.sc-timer-box.danger { border-color: #fb7185; background: rgba(127, 29, 29, 0.55); }
.sc-timer-num { font-size: 54px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fdcd53; min-width: 110px; text-align: right; }
.sc-timer-box.danger .sc-timer-num { color: #fda4af; }
.sc-timer-bar-wrap { flex: 1; height: 18px; border-radius: 999px; background: rgba(255,255,255,0.14); overflow: hidden; }
.sc-timer-bar { height: 100%; background: linear-gradient(90deg, #4ade80, #fdcd53); transition: width .2s linear; }
.sc-timer-box.warn .sc-timer-bar { background: linear-gradient(90deg, #ff8a2b, #fdcd53); }
.sc-timer-box.danger .sc-timer-bar { background: #fb7185; }

.sc-qbox {
  flex: 1; background: rgba(255,255,255,0.96); color: #191033; border-radius: 32px;
  padding: 36px 46px; display: flex; flex-direction: column; justify-content: center; gap: 26px;
  box-shadow: 0 18px 46px rgba(0,0,0,0.42);
}
.sc-qtext { font-size: 46px; font-weight: 800; line-height: 1.38; }
.sc-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sc-choice {
  background: #f2eefb; border: 4px solid #d9d0f2; border-radius: 22px;
  padding: 24px 22px; font-size: 34px; font-weight: 800; color: #201342;
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 132px;
}
.sc-choice.correct {
  background: #dcfce7; border-color: #16a34a; color: #14532d; transform: scale(1.03);
  box-shadow: 0 10px 28px rgba(22, 163, 74, 0.35);
}
.sc-choice.dim { opacity: 0.42; }
.sc-qnote {
  background: #fef3c7; border-left: 8px solid #f59e0b; border-radius: 14px;
  padding: 14px 22px; font-size: 28px; font-weight: 700; color: #78350f;
}
.sc-qstandby {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 18px;
}
.sc-qstandby h2 { margin: 0; font-size: 72px; color: #fdcd53; }
.sc-qstandby p { margin: 0; font-size: 34px; color: #e2dbf7; }

.sc-qteams {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 22px; flex-shrink: 0;
}
.sc-qteam {
  background: rgba(16, 9, 34, 0.84); border-radius: 20px; padding: 14px 16px;
  border: 2px solid rgba(255,255,255,0.16); border-top: 7px solid var(--tc, #fdcd53);
  text-align: center; position: relative;
}
.sc-qteam.buzzed { box-shadow: 0 0 0 4px #fdcd53; background: rgba(253, 205, 83, 0.16); }
.sc-qteam-name { font-size: 22px; font-weight: 800; color: #f3effd; }
.sc-qteam-score { font-size: 52px; font-weight: 800; color: #fdcd53; line-height: 1.1; margin-top: 4px; }

/* Scene: Award */
.sc-award-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; flex: 1; align-items: stretch; }
.sc-award-card {
  background: rgba(255,255,255,0.09); border: 3px solid rgba(253,205,83,0.65);
  border-radius: 34px; padding: 40px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 18px;
}
.sc-award-icon { font-size: 86px; line-height: 1; }
.sc-award-lbl { font-size: 32px; font-weight: 800; color: #fdcd53; }
.sc-award-winner { font-size: 68px; font-weight: 800; color: #fff; line-height: 1.2; }
.sc-award-detail { font-size: 32px; color: #dcd5f5; font-weight: 700; }

/* Scene: QR */
.sc-qr-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 60px;
}
.sc-qr-card {
  background: #fff; padding: 28px; border-radius: 32px; box-shadow: 0 18px 46px rgba(0,0,0,0.45);
}
.sc-qr-card img { width: 420px; height: 420px; display: block; image-rendering: pixelated; }
.sc-qr-text h2 { margin: 0 0 18px; font-size: 62px; color: #fdcd53; }
.sc-qr-text p { margin: 0 0 14px; font-size: 34px; line-height: 1.5; color: #f3effd; }
.sc-qr-url {
  display: inline-block; margin-top: 10px; padding: 12px 22px; border-radius: 14px;
  background: rgba(255,255,255,0.12); font-size: 28px; font-weight: 700; color: #fdcd53;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(8, 4, 18, 0.76);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--gold);
  border-radius: 18px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-card h2 { margin: 0 0 8px; font-size: 18px; color: var(--gold); font-family: var(--round); }
.modal-card p { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.modal-card input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--ink); font-size: 16px;
}
.modal-error { margin-top: 8px; color: #fda4af; font-size: 13px; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70;
  padding: 10px 18px; border-radius: 999px; background: #1d1238; color: #fdcd53;
  border: 1px solid rgba(253, 205, 83, 0.6); font-weight: 800; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}
.toast[hidden] { display: none; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
