/* 早押しクイズバトル — dopagaki design（黒地・蛍光色・硬い影・斜め帯・スタンプ・集中線）。ローカルフォントのみ使用 */

:root {
  --ink: #05050a;
  --panel: #12132a;
  --panel-2: #1b1c36;
  --line: #2c2f42;
  --text: #f6f7fb;
  --text-dim: #b1b5c9;
  --yellow: #ffe63b;
  --pink: #ff3f8e;
  --cyan: #19e3ff;
  --lime: #7dff5a;
  --purple: #9a5cff;
  --red: #ff3b30;
  --on-neon: #0a0a10;
  --c0: var(--yellow);
  --c1: var(--pink);
  --c2: var(--cyan);
  --c3: var(--lime);
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
  --font-latin: "Arial Black", "Segoe UI Black", "Helvetica Neue", Arial, var(--font-ja);
  --ease-punch: cubic-bezier(.2, 1.55, .35, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); -webkit-text-size-adjust: 100%; }
body {
  min-width: 300px;
  font-family: var(--font-ja);
  font-weight: 600;
  line-height: 1.55;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
button:disabled { cursor: default; }
input { font: inherit; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hl-y { color: var(--yellow); }
.hl-p { color: var(--pink); }
.tw-hide { visibility: hidden; }
ruby { ruby-position: over; }
rt { font-size: .42em; font-weight: 800; letter-spacing: 0; color: inherit; opacity: .85; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.02; font-size: .78em; margin: 0 .12em; }
.frac .fn { border-bottom: .08em solid currentColor; padding: 0 .12em; }
.frac .fd { padding: 0 .12em; }

/* ---------- 共通部品 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: 8px 20px;
  border: 3px solid var(--on-neon); border-radius: 12px;
  background: #23243a; color: var(--text);
  font-weight: 900; text-decoration: none;
  box-shadow: 5px 5px 0 var(--on-neon);
  transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--on-neon); }
.btn:disabled { opacity: .45; }
.btn--yellow { background: var(--yellow); color: var(--on-neon); }
.btn--cyan { background: var(--cyan); color: var(--on-neon); }
.btn--danger { background: var(--red); color: #fff; }
.btn--ghost { background: transparent; border-color: #4a4d66; box-shadow: none; color: var(--text); }
.btn--big { min-height: 60px; font-size: 20px; width: 100%; }
.link-btn { border: 0; background: none; color: var(--text-dim); text-decoration: underline; padding: 8px; font-weight: 600; }
.tool {
  min-height: 38px; padding: 4px 14px;
  border: 2px solid #4a4d66; border-radius: 999px;
  background: rgba(20, 21, 36, .92); color: var(--text);
  font-size: 15px; font-weight: 800;
}
.tool[aria-pressed="false"] { color: var(--text-dim); border-style: dashed; }
.tool--danger { border-color: var(--red); color: #ff8a80; }
.tool--sm { min-height: 32px; padding: 2px 10px; font-size: 13px; }
.tool:disabled { opacity: .35; }
.conn { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.conn:empty { display: none; }
.conn::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #888; vertical-align: 1px; }
.conn[data-kind="online"]::before { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.conn[data-kind="reconnecting"]::before, .conn[data-kind="connecting"]::before { background: var(--yellow); }
.conn[data-kind="offline"]::before { background: var(--red); }
.form-error { min-height: 1.4em; color: #ff8a80; font-size: 14px; }

.tape {
  position: absolute; left: -5%; right: -5%;
  overflow: hidden; white-space: nowrap;
  background: var(--yellow); color: var(--on-neon);
  font: 900 18px/1 var(--font-latin); letter-spacing: .06em;
  padding: 8px 0; border-block: 3px solid var(--on-neon);
  pointer-events: none;
}
.tape span { display: inline-block; animation: tape 30s linear infinite; }
.tape-top { top: 14px; transform: rotate(-2deg); }
.tape-bottom { bottom: 16px; transform: rotate(1.5deg); background: var(--pink); }
.tape-bottom span { animation-direction: reverse; }
@keyframes tape { to { transform: translateX(-50%); } }

/* 設定の選択（セグメント） */
.opt { display: grid; grid-template-columns: 7.5em 1fr; gap: 6px 10px; align-items: center; margin: 10px 0; }
.opt-l { color: var(--text-dim); font-size: 14px; font-weight: 800; }
.opt-help { grid-column: 2; color: var(--text-dim); font-size: 12px; font-weight: 600; }
.opt-help:empty { display: none; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  min-height: 40px; padding: 4px 12px;
  border: 2px solid #4a4d66; border-radius: 10px;
  background: #15162a; color: var(--text); font-weight: 800; font-size: 15px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
}
.seg button small { font-size: 11px; color: var(--text-dim); font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--yellow); border-color: var(--on-neon); color: var(--on-neon); box-shadow: 3px 3px 0 var(--on-neon); }
.seg button[aria-pressed="true"] small { color: #3d3a10; }
.seg button:disabled { opacity: .35; }
.seg--wrap button { min-width: 4.2em; }
#opt-genres button[aria-pressed="true"] { background: var(--pink); color: #fff; }

/* ---------- タイトル ---------- */
.screen-title {
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  background:
    repeating-conic-gradient(from 0deg at 50% 34%, rgba(255, 230, 59, .07) 0deg 5deg, transparent 5deg 15deg),
    radial-gradient(ellipse at 50% 28%, #2a1a3c 0%, var(--ink) 70%);
}
.title-body {
  position: relative; z-index: 1;
  max-width: 1120px; margin: 0 auto;
  padding: 78px 20px 96px;
  display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center;
}
.back-link { align-self: flex-start; color: var(--text-dim); font-size: 14px; text-decoration: none; border-bottom: 1px dashed; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-kicker { font: 900 clamp(22px, 5vw, 34px)/1 var(--font-latin); color: var(--cyan); transform: rotate(-6deg); text-shadow: 3px 3px 0 var(--on-neon); letter-spacing: .08em; }
.logo-word { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.lw-1 {
  font-size: clamp(66px, 17vw, 160px); font-weight: 900; color: var(--yellow);
  -webkit-text-stroke: 5px var(--on-neon); paint-order: stroke fill;
  text-shadow: 7px 7px 0 var(--pink), 14px 14px 0 var(--on-neon);
  transform: rotate(-3deg);
  animation: logoShake 2.6s ease-in-out infinite;
}
.lw-2 {
  margin-top: 6px; font-size: clamp(34px, 8.4vw, 82px); font-weight: 900; color: #fff;
  -webkit-text-stroke: 3px var(--on-neon); paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--cyan), 9px 9px 0 var(--on-neon);
}
@keyframes logoShake { 0%, 86%, 100% { transform: rotate(-3deg); } 88% { transform: translate(-3px, 2px) rotate(-4deg); } 90% { transform: translate(3px, -2px) rotate(-2deg); } 92% { transform: translate(-2px, 1px) rotate(-3deg); } }
.logo-stamp {
  margin-top: 14px; padding: 4px 16px;
  border: 4px solid var(--lime); color: var(--lime);
  font: 900 clamp(18px, 4vw, 28px)/1.1 var(--font-latin); letter-spacing: .12em;
  transform: rotate(-6deg);
}
.lead { font-size: clamp(16px, 3.6vw, 20px); max-width: 36em; }
.title-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; width: 100%; }
.big-btn, .join-box {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 18px 20px 20px 72px; min-height: 160px;
  border: 4px solid var(--on-neon); border-radius: 18px;
  box-shadow: 8px 8px 0 var(--on-neon);
}
.big-btn--host { background: var(--yellow); color: var(--on-neon); }
.big-btn--host:not(:disabled):hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--on-neon); }
.join-box { background: #1b1c30; border-color: var(--pink); }
.join-box--link { border-color: var(--cyan); }
.bb-no { position: absolute; left: 16px; top: 14px; font: 900 34px/1 var(--font-latin); opacity: .5; }
.bb-name { font-size: 24px; font-weight: 900; }
.bb-sub { font-size: 13px; font-weight: 600; opacity: .85; }
.join-row { display: flex; gap: 8px; width: 100%; margin-top: auto; flex-wrap: wrap; }
.room-input {
  flex: 1 1 7em; min-width: 6em; min-height: 52px; padding: 4px 14px;
  border: 3px solid #4a4d66; border-radius: 12px; background: #0b0c18; color: #fff;
  font: 900 26px/1 var(--font-latin); letter-spacing: .14em; text-align: center;
}
.room-input--sm { flex: 1 1 5em; }
.room-input--code { flex: 2 1 8em; }
.room-input::placeholder { color: #555a78; letter-spacing: .04em; font-size: 18px; }
.title-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; width: 100%; text-align: left; }
.title-modes li { padding: 12px 14px; border: 2px solid #34375a; border-radius: 12px; background: rgba(18, 19, 42, .85); display: flex; flex-direction: column; gap: 2px; }
.title-modes b { font-size: 18px; color: var(--yellow); }
.title-modes li:nth-child(2) b { color: var(--pink); }
.title-modes li:nth-child(3) b { color: var(--cyan); }
.title-modes li:nth-child(4) b { color: var(--lime); }
.title-modes span { font-size: 13px; color: var(--text-dim); }
.title-note { font-size: 13px; color: var(--text-dim); max-width: 40em; }

/* ---------- 大きな画面（舞台） ---------- */
.screen-stage { position: fixed; inset: 0; }
.stage-wrap { position: absolute; inset: 0; overflow: hidden; background: var(--ink); }
.stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; transform: translate(var(--ox, 0), var(--oy, 0)) scale(var(--scale, 1));
  overflow: hidden; font-size: 28px;
  background: var(--ink);
}
.st-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(154, 92, 255, .22) 0%, transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 96px),
    var(--ink);
}
.st-lines {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 4;
  background: repeating-conic-gradient(from 0deg at var(--fx, 50%) var(--fy, 50%), var(--fc, #fff) 0deg .7deg, transparent .7deg 6.5deg);
  -webkit-mask-image: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), transparent 0 14%, #000 48%);
  mask-image: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), transparent 0 14%, #000 48%);
}
.st-lines.on { animation: lines 1.3s ease-out forwards; }
@keyframes lines { 0% { opacity: 0; } 8% { opacity: .55; } 30% { opacity: .4; } 100% { opacity: 0; } }
.st-tape { z-index: 6; }
.stage .tape-top { top: -6px; transform: rotate(-1deg); font-size: 20px; }
.stage .tape-bottom { bottom: -8px; transform: rotate(.8deg); font-size: 20px; }

.st-head {
  position: absolute; left: 40px; right: 40px; top: 38px; height: 58px; z-index: 5;
  display: flex; align-items: center; gap: 24px;
}
.sh-logo { display: flex; align-items: baseline; gap: 8px; font-weight: 900; }
.sh-logo b { font-size: 40px; color: var(--yellow); -webkit-text-stroke: 2px var(--on-neon); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--pink); }
.sh-logo span { font-size: 26px; }
.sh-count { margin-left: 8px; font: 900 34px/1 var(--font-latin); color: #fff; letter-spacing: .02em; }
.sh-chips { margin-left: auto; display: flex; gap: 10px; }
.sh-chips span { padding: 4px 14px; border: 3px solid var(--cyan); border-radius: 999px; font-size: 22px; font-weight: 900; color: var(--cyan); background: rgba(5, 5, 10, .7); }
.sh-chips span:first-child { border-color: var(--pink); color: var(--pink); }
.st-head .conn { font-size: 18px; }
.stage[data-preset="sides5-row"] .st-head { left: 320px; right: 320px; }
.stage[data-cam="on"][data-preset="sides"] .st-head, .stage[data-cam="ids"][data-preset="sides"] .st-head,
.stage[data-cam="on"][data-preset="sides-row"] .st-head, .stage[data-cam="ids"][data-preset="sides-row"] .st-head { left: 372px; right: 372px; }
.stage[data-cam="on"] .st-tape, .stage[data-cam="ids"] .st-tape { display: none; }

.sv { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; z-index: 2; }
.sv.is-on { opacity: 1; visibility: visible; transition: opacity .25s; }
.stage.is-shake > .sv.is-on { animation: shake .42s; }
@keyframes shake { 20% { transform: translate(-14px, 6px) rotate(-.6deg); } 40% { transform: translate(12px, -8px) rotate(.5deg); } 60% { transform: translate(-8px, 4px); } 80% { transform: translate(5px, -3px); } }

/* ロビー */
.sv-lobby { display: grid; grid-template-columns: 560px 1fr; gap: 48px; padding: 130px 72px 150px; }
.lb-qr {
  align-self: start; padding: 26px; border: 6px solid var(--on-neon); border-radius: 26px; background: #fff; color: var(--on-neon);
  box-shadow: 14px 14px 0 var(--pink); text-align: center; transform: rotate(-1.5deg);
}
.qr svg { display: block; width: 100%; height: auto; }
.lb-qr .qr { width: 440px; margin: 0 auto; }
.lb-cap { margin-top: 12px; font-size: 32px; font-weight: 900; }
.lb-url { font-size: 18px; font-weight: 800; color: #444; word-break: break-all; }
.lb-room { margin-top: 6px; font-size: 26px; font-weight: 900; }
.lb-room b { font: 900 76px/1 var(--font-latin); letter-spacing: .12em; display: block; color: var(--on-neon); }
.lb-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lb-logo { display: flex; align-items: flex-end; gap: 22px; line-height: 1; }
.lb-logo .lw-1 { font-size: 150px; animation: none; }
.lb-logo .lw-2 { font-size: 74px; margin-bottom: 14px; }
.lb-entry { display: flex; align-items: baseline; gap: 14px; }
.lb-entry span { font: 900 40px/1 var(--font-latin); color: var(--pink); letter-spacing: .1em; padding: 4px 14px; border: 5px solid var(--pink); transform: rotate(-4deg); }
.lb-entry b { font: 900 92px/1 var(--font-latin); color: #fff; }
.lb-entry small { font-size: 30px; color: var(--text-dim); }
.lb-players { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.lb-p {
  display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 8px 14px;
  border: 4px solid var(--pc, var(--yellow)); border-radius: 14px; background: var(--panel);
  box-shadow: 6px 6px 0 var(--on-neon); animation: popIn .32s var(--ease-punch) both;
}
.lb-p-no { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--pc, var(--yellow)); color: var(--on-neon); font: 900 24px/1 var(--font-latin); }
.lb-p b { font-size: 32px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-p.is-off { opacity: .45; border-style: dashed; }
@keyframes popIn { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.lb-seat-count { display: flex; align-items: baseline; gap: 18px; }
.lb-seat-count span { font-size: 48px; font-weight: 900; color: var(--cyan); }
.lb-seat-count b { font: 900 230px/1 var(--font-latin); color: #fff; -webkit-text-stroke: 6px var(--on-neon); paint-order: stroke fill; text-shadow: 10px 10px 0 var(--cyan); }
.lb-seat-count small { font-size: 52px; font-weight: 900; }
.lb-recent { display: flex; flex-wrap: wrap; gap: 12px; }
.lb-recent li { padding: 6px 18px; border: 3px solid var(--lime); border-radius: 999px; font: 900 30px/1.2 var(--font-latin); color: var(--lime); animation: popIn .3s var(--ease-punch) both; }
.lb-hint { font-size: 32px; font-weight: 900; color: var(--yellow); }
.lb-settings { position: absolute; left: 72px; right: 72px; bottom: 64px; display: flex; gap: 14px; flex-wrap: wrap; }
.lb-settings li, .in-settings li { display: flex; align-items: baseline; gap: 10px; padding: 8px 18px; border: 3px solid #3a3d5c; border-radius: 12px; background: rgba(18, 19, 42, .9); }
.lb-settings small, .in-settings small { font-size: 20px; color: var(--text-dim); }
.lb-settings b, .in-settings b { font-size: 28px; }

/* はじまり */
.sv-intro { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 120px 80px; text-align: center; }
.in-kicker { font: 900 54px/1 var(--font-latin); color: var(--cyan); letter-spacing: .2em; }
.in-title { font-size: 96px; font-weight: 900; line-height: 1.1; color: #fff; -webkit-text-stroke: 4px var(--on-neon); paint-order: stroke fill; text-shadow: 7px 7px 0 var(--pink); transform: rotate(-2deg); }
.in-rule { padding: 26px 40px; border: 6px solid var(--on-neon); border-radius: 22px; background: #fff; color: var(--on-neon); box-shadow: 12px 12px 0 var(--cyan); text-align: left; }
.in-rule-name { font-size: 44px; font-weight: 900; color: var(--pink); }
.in-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.in-steps li { display: flex; align-items: center; gap: 16px; font-size: 38px; font-weight: 900; }
.in-steps span { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); border: 4px solid var(--on-neon); font: 900 30px/1 var(--font-latin); }
.in-settings { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* 出題 */
.q-bignum {
  position: absolute; right: -30px; bottom: -120px; z-index: 0;
  font: 900 700px/1 var(--font-latin); color: transparent; -webkit-text-stroke: 4px rgba(255, 230, 59, .14);
  letter-spacing: -.04em; pointer-events: none;
}
.q-area {
  position: absolute; left: var(--ax, 72px); top: var(--ay, 104px); width: var(--aw, 1776px); height: var(--ah, 900px);
  display: flex; flex-direction: column; gap: 16px; z-index: 2;
}
.q-meta { display: flex; align-items: center; gap: 14px; height: 62px; flex: none; }
.q-no { padding: 2px 18px; background: var(--yellow); color: var(--on-neon); border: 4px solid var(--on-neon); box-shadow: 5px 5px 0 var(--pink); font: 900 40px/1.2 var(--font-latin); transform: rotate(-3deg); }
.q-genre, .q-grade { padding: 2px 16px; border: 4px solid var(--pink); border-radius: 999px; color: var(--pink); font-size: 28px; font-weight: 900; }
.q-grade { border-color: var(--cyan); color: var(--cyan); }
.q-timer { position: relative; flex: 1; height: 30px; border: 4px solid #3a3d5c; border-radius: 999px; overflow: hidden; background: #0b0c18; margin-right: 60px; }
.q-timer span { position: absolute; inset: 0; background: linear-gradient(90deg, var(--lime), var(--yellow)); transform-origin: 0 50%; transform: scaleX(var(--p, 1)); transition: transform .2s linear; }
.q-timer b { position: absolute; right: -58px; top: 50%; transform: translateY(-50%); font: 900 44px/1 var(--font-latin); color: #fff; }
.q-timer { overflow: visible; }
.q-timer.is-hurry span { background: linear-gradient(90deg, var(--red), var(--pink)); }
.q-timer.is-hurry b { color: var(--pink); animation: hurry .5s ease-in-out infinite alternate; }
@keyframes hurry { to { transform: translateY(-50%) scale(1.18); } }

.q-card {
  position: relative; flex: 1 1 0; min-height: 0;
  display: flex; align-items: center; gap: 28px; padding: 22px 36px;
  border: 6px solid var(--on-neon); border-radius: 24px;
  background: linear-gradient(160deg, #1d1e3c, #11122a);
  box-shadow: 0 0 0 4px var(--yellow), 12px 12px 0 4px var(--on-neon);
}
.q-card::before, .q-card::after { content: ""; position: absolute; width: 46px; height: 46px; border: 8px solid var(--pink); }
.q-card::before { left: -16px; top: -16px; border-right: 0; border-bottom: 0; }
.q-card::after { right: -16px; bottom: -16px; border-left: 0; border-top: 0; }
.q-img { flex: 0 0 auto; height: 100%; max-height: 330px; aspect-ratio: 1; display: grid; place-items: center; }
.q-img svg { max-width: 100%; max-height: 100%; }
.q-card.has-img .q-img { width: 38%; aspect-ratio: auto; }
.q-text { flex: 1; font-size: var(--qfs, 60px); font-weight: 900; line-height: 1.45; letter-spacing: .01em; word-break: normal; overflow-wrap: anywhere; line-break: strict; }
.q-text rt { color: var(--yellow); }

.q-choices { flex: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.q-choices[data-n="3"] { grid-template-columns: repeat(3, 1fr); }
.q-choice {
  position: relative; display: flex; align-items: center; gap: 18px; min-height: 104px; padding: 12px 22px 12px 12px;
  border: 5px solid var(--on-neon); border-radius: 18px; background: var(--panel-2);
  box-shadow: 7px 7px 0 var(--on-neon); overflow: hidden;
  animation: choiceIn .32s var(--ease-punch) var(--d, 0ms) both;
  --cc: var(--c0);
}
.q-choice.is-still { animation: none; }
.q-choice[data-i="1"] { --cc: var(--c1); }
.q-choice[data-i="2"] { --cc: var(--c2); }
.q-choice[data-i="3"] { --cc: var(--c3); }
@keyframes choiceIn { from { transform: translateX(-40px) scale(.9); opacity: 0; } }
.qc-letter { flex: none; width: 76px; height: 76px; border-radius: 14px; display: grid; place-items: center; background: var(--cc); color: var(--on-neon); border: 4px solid var(--on-neon); font: 900 46px/1 var(--font-latin); }
.qc-body { flex: 1; min-width: 0; font-size: 44px; font-weight: 900; line-height: 1.3; }
.qc-body rt { color: var(--cc); }
.qc-cap { display: none; }
.qc-dist { display: none; }
.q-choices.is-img .q-choice { flex-direction: column; align-items: stretch; min-height: 0; padding: 10px; }
.q-choices.is-img .qc-letter { position: absolute; left: 10px; top: 10px; width: 58px; height: 58px; font-size: 34px; z-index: 1; }
.q-choices.is-img .qc-body { height: 200px; display: grid; place-items: center; }
.q-choices.is-img .qc-body svg { max-width: 100%; max-height: 100%; }
.q-choices.is-img { grid-template-columns: repeat(var(--cols, 4), 1fr); }
.q-choices.is-img[data-n="2"] { --cols: 2; }
.q-choices.is-img[data-n="3"] { --cols: 3; }
.stage[data-preset="duo"] .q-choices.is-img .qc-body, .stage[data-preset^="sides"] .q-choices.is-img .qc-body { height: 150px; }
.q-choice.is-picked { border-color: var(--yellow); animation: picked .5s ease-in-out infinite alternate; }
@keyframes picked { to { box-shadow: 0 0 0 6px var(--yellow), 7px 7px 0 var(--on-neon); transform: scale(1.02); } }
.q-choice.is-wrong { opacity: .5; }
.q-choice.is-wrong::after { content: "×"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font: 900 90px/1 var(--font-latin); color: var(--red); }
.q-choice.is-correct { border-color: var(--lime); background: #1f3a1b; box-shadow: 0 0 0 6px var(--lime), 0 0 40px rgba(125, 255, 90, .6), 7px 7px 0 var(--on-neon); transform: scale(1.03); z-index: 1; opacity: 1; }
.q-choice.is-correct::before { content: "◯"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 84px; font-weight: 900; color: var(--lime); }
.q-choice.is-dim { opacity: .35; }
.q-choice.is-correct .qc-cap, .q-choice.is-dim .qc-cap { display: block; }
.qc-cap { font-size: 28px; font-weight: 900; text-align: center; }
.q-choice.has-dist { padding-bottom: 46px; }
.q-choice.has-dist .qc-dist { display: block; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 26px; }
.qc-dist i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--cc); border-radius: 6px; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .9s cubic-bezier(.2, .8, .2, 1); opacity: .85; }
.qc-dist b { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 var(--on-neon); }

.q-note {
  flex: none; position: relative; padding: 14px 24px 18px; border: 4px solid var(--cyan); border-radius: 16px; background: rgba(9, 30, 40, .94);
  display: flex; gap: 16px; align-items: baseline; font-size: 30px; font-weight: 800; line-height: 1.45;
  animation: popIn .3s ease-out both;
}
.q-note b { flex: none; padding: 0 12px; background: var(--cyan); color: var(--on-neon); border-radius: 8px; font-size: 26px; }
.q-note::after { content: ""; position: absolute; left: 0; bottom: 0; height: 6px; width: 100%; background: var(--cyan); transform-origin: 0 50%; transform: scaleX(var(--next, 0)); border-radius: 0 0 0 12px; }
.sv-q[data-dummy] { display: none; }
.stage[data-qstage="reveal"] .q-text { font-size: calc(var(--qfs, 60px) * .8); }

/* 一斉回答・席番号モードの集計 */
.q-stats { position: absolute; left: calc(100% + 32px); top: 0; width: 420px; display: flex; flex-direction: column; gap: 18px; }
.stage[data-mode="seat"] .q-area { width: calc(var(--aw, 1776px) - 460px); }
.qs-progress { display: flex; align-items: baseline; gap: 12px; padding: 18px 22px; border: 5px solid var(--on-neon); border-radius: 18px; background: var(--yellow); color: var(--on-neon); box-shadow: 8px 8px 0 var(--pink); }
.qs-progress span { font-size: 30px; font-weight: 900; }
.qs-progress b { font: 900 96px/1 var(--font-latin); }
.qs-progress small { font-size: 30px; font-weight: 900; }
.qs-bar { height: 22px; border: 4px solid #3a3d5c; border-radius: 999px; overflow: hidden; background: #0b0c18; }
.qs-bar span { display: block; height: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .3s; }
.qs-fastest { padding: 16px 18px; border: 5px solid var(--lime); border-radius: 18px; background: rgba(12, 30, 10, .92); }
.qs-title { font-size: 30px; font-weight: 900; color: var(--lime); }
#qs-fast-list li { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 2px dashed rgba(125, 255, 90, .3); animation: popIn .3s var(--ease-punch) var(--d, 0ms) both; }
.qf-rank { font: 900 30px/1 var(--font-latin); color: var(--lime); }
.qf-who { font: 900 34px/1.1 var(--font-latin); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qf-time { font-size: 22px; color: var(--text-dim); }
.qf-pt { font: 900 26px/1 var(--font-latin); color: var(--yellow); }

/* 参加者の枠（名札・カメラ枠） */
.q-panels { position: absolute; inset: 0; z-index: 3; pointer-events: none; display: none; }
.stage[data-mode="named"][data-view="q"] .q-panels,
.stage[data-mode="named"][data-cam="on"] .q-panels, .stage[data-mode="named"][data-cam="ids"] .q-panels { display: block; }
/* カメラ枠：ロビー・はじまり・結果発表も、枠の内側の領域に収める */
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) :is(.sv-lobby, .sv-intro, .sv-final) {
  inset: auto; left: var(--ax); top: var(--ay); width: var(--aw); height: var(--ah); padding: 12px 0;
}
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .sv-lobby { grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .lb-qr { padding: 18px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .lb-qr .qr { width: 300px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .lb-room b { font-size: 60px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .lb-logo { flex-direction: column; align-items: flex-start; gap: 0; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .lb-logo .lw-1 { font-size: 104px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .lb-logo .lw-2 { font-size: 52px; margin: 6px 0 0; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) :is(.lb-players, .lb-settings) { display: none; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .lb-hint { font-size: 28px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .sv-intro { gap: 18px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .in-kicker { font-size: 40px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .in-title { font-size: 64px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .in-rule { padding: 18px 26px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .in-steps li { font-size: 28px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .in-settings li b { font-size: 22px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .sv-final { gap: 14px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .fn-title { font-size: 72px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .fn-name { font-size: 58px; max-width: 700px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .fn-score { font-size: 48px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .fn-ranking { grid-template-columns: 1fr; gap: 8px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) .fn-row { padding: 4px 16px; }
.stage[data-mode="named"]:is([data-cam="on"], [data-cam="ids"]) :is(.fr-who, .fr-rank, .fr-score) { font-size: 30px; }
.pn { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: calc(var(--h) + var(--plate)); --pc: #9aa0bd; transition: transform .2s; }
.pn-frame { position: relative; height: var(--h); }
.pn-no { position: absolute; left: -8px; top: -8px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--pc); color: var(--on-neon); border: 4px solid var(--on-neon); font: 900 22px/1 var(--font-latin); z-index: 2; }
.pn-cam { position: absolute; inset: 0; display: grid; place-items: center; font: 800 20px/1.3 var(--font-latin); color: rgba(255, 255, 255, .45); text-align: center; white-space: pre; }
.pn-status { position: absolute; right: 6px; top: -22px; transform: rotate(-5deg); padding: 0 12px; font-size: 24px; font-weight: 900; border: 4px solid var(--on-neon); white-space: nowrap; z-index: 3; }
.stage[data-preset="plates2"] .pn-status { font-size: 19px; top: -18px; }
.pn-status:empty { display: none; }
.pn-delta { position: absolute; left: 50%; top: 0; transform: translate(-50%, -100%); font: 900 54px/1 var(--font-latin); color: var(--lime); -webkit-text-stroke: 3px var(--on-neon); paint-order: stroke fill; opacity: 0; z-index: 4; }
.pn-delta.is-minus { color: var(--red); }
.pn-delta.is-pop { animation: deltaPop 1.8s ease-out forwards; }
@keyframes deltaPop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -90%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -110%); } }
.pn-plate { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: var(--plate); background: var(--pc); color: var(--on-neon); border: 4px solid var(--on-neon); border-top: 0; }
.pn-name { flex: 1; min-width: 0; font-size: 26px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-score { font: 900 30px/1 var(--font-latin); }
.pn-score::after { content: "点"; font: 900 16px/1 var(--font-ja); margin-left: 2px; }
.pn.is-empty .pn-plate { background: #2a2c44; color: #8c90ab; }
.pn.is-empty .pn-score::after { content: ""; }
.pn.is-off .pn-plate { opacity: .55; }
/* カメラ枠 */
.stage[data-cam="on"] .pn-frame, .stage[data-cam="ids"] .pn-frame { border: 6px solid var(--pc); border-bottom: 0; background: rgba(10, 11, 24, .92); box-shadow: inset 0 0 0 3px var(--on-neon); }
.stage[data-cam="on"] .pn-status, .stage[data-cam="ids"] .pn-status { top: auto; right: auto; left: 50%; bottom: 10px; transform: translateX(-50%) rotate(-4deg); }
body[data-bg="clear"] .stage[data-cam] .pn-frame, body[data-bg="green"] .stage[data-cam] .pn-frame { background: transparent; }
body[data-bg="clear"] .stage[data-cam="off"] .pn-frame, body[data-bg="green"] .stage[data-cam="off"] .pn-frame { background: transparent; }
.stage[data-cam="ids"] .pn-cam { color: #fff; font-size: 22px; background: rgba(255, 63, 142, .25); }
/* 名札（カメラなし）：枠の部分を使わず、名札を大きく */
.stage[data-cam="off"] .pn { height: var(--h); }
.stage[data-cam="off"] .pn-frame { position: absolute; inset: 0; height: auto; background: transparent; }
.stage[data-cam="off"] .pn-plate {
  height: 100%; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; padding: 8px 18px 8px 56px;
  background: var(--panel); color: var(--text); border: 5px solid var(--pc); border-radius: 16px; box-shadow: 7px 7px 0 var(--on-neon);
}
.stage[data-cam="off"] .pn-name { font-size: 34px; width: 100%; flex: none; }
.stage[data-cam="off"] .pn-score { font-size: 48px; color: var(--pc); }
.stage[data-cam="off"][data-preset="plates2"] .pn-name { font-size: 26px; }
.stage[data-cam="off"][data-preset="plates2"] .pn-score { font-size: 34px; }
.stage[data-cam="off"] .pn-no { left: 10px; top: 10px; }
.stage[data-cam="off"] .pn.is-empty { display: none; }
/* 枠の状態 */
.pn.is-buzz { transform: scale(1.08); z-index: 5; }
.pn.is-buzz .pn-frame, .pn.is-buzz .pn-plate { animation: buzzGlow .5s ease-in-out infinite alternate; }
@keyframes buzzGlow { from { box-shadow: 0 0 0 4px var(--pc), 0 0 30px var(--pc); } to { box-shadow: 0 0 0 10px var(--pc), 0 0 70px var(--pc); } }
.pn.is-buzz .pn-status { background: var(--pink); color: #fff; }
.pn.is-locked { filter: grayscale(.85) brightness(.75); }
.pn.is-locked .pn-status { background: var(--red); color: #fff; }
.pn.is-answered .pn-status { background: var(--cyan); color: var(--on-neon); font-size: 24px; }
.pn.is-correct .pn-status { background: var(--lime); color: var(--on-neon); }
.pn.is-miss .pn-status { background: #555a78; color: #fff; font-size: 24px; }

/* 早押しの帯 */
.q-buzz {
  position: absolute; left: 50%; top: 6px; z-index: 7; min-width: 960px; max-width: 1400px; height: 88px;
  transform: translateX(-50%) rotate(-1.5deg);
  display: flex; align-items: center; gap: 22px; padding: 0 30px 10px;
  background: var(--pc, var(--yellow)); color: var(--on-neon); border: 6px solid var(--on-neon); box-shadow: 10px 10px 0 var(--on-neon);
  animation: buzzIn .3s var(--ease-punch) both;
}
@keyframes buzzIn { from { transform: translateX(-50%) rotate(-1.5deg) scale(1.6); opacity: 0; } }
.qb-kicker { font: 900 44px/1 var(--font-latin); letter-spacing: .06em; padding: 2px 12px; background: var(--on-neon); color: var(--pc, var(--yellow)); transform: rotate(-4deg); }
.qb-name { flex: 1; font-size: 56px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-time { font: 900 34px/1 var(--font-latin); }
.qb-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: rgba(0, 0, 0, .3); }
.qb-bar span { position: absolute; inset: 0; background: var(--on-neon); transform-origin: 0 50%; transform: scaleX(var(--p, 1)); }
.stage:has(.q-buzz:not([hidden])) .st-head { visibility: hidden; }

/* 結果発表 */
.sv-final { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 110px 80px 80px; }
.fn-kicker { font: 900 44px/1 var(--font-latin); color: var(--cyan); letter-spacing: .3em; }
.fn-title { font-size: 104px; font-weight: 900; color: var(--yellow); -webkit-text-stroke: 5px var(--on-neon); paint-order: stroke fill; text-shadow: 8px 8px 0 var(--pink); transform: rotate(-2deg); line-height: 1.1; }
.fn-winner { display: flex; align-items: center; gap: 30px; padding: 18px 40px; border: 7px solid var(--on-neon); border-radius: 24px; background: var(--pc, var(--yellow)); color: var(--on-neon); box-shadow: 14px 14px 0 var(--on-neon); transform: rotate(-1.5deg); animation: popIn .45s var(--ease-punch) 1.9s both; }
.fn-crown { font: 900 50px/1 var(--font-latin); padding: 6px 16px; background: var(--on-neon); color: var(--yellow); letter-spacing: .08em; }
.fn-name { font-size: 86px; font-weight: 900; max-width: 1000px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-score { font: 900 70px/1 var(--font-latin); }
.fn-ranking { width: 100%; max-width: 1500px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 30px; }
.fn-ranking.is-seat { grid-template-columns: 1fr; max-width: 1100px; }
.fn-row { display: grid; grid-template-columns: 120px 1fr auto auto; align-items: baseline; gap: 18px; padding: 10px 22px; border: 4px solid var(--pc, #3a3d5c); border-radius: 14px; background: var(--panel); }
.fn-ranking.is-anim .fn-row { animation: rowIn .4s var(--ease-punch) var(--d, 0ms) both; }
@keyframes rowIn { from { transform: translateX(-80px); opacity: 0; } }
.fr-rank { font: 900 40px/1 var(--font-latin); color: var(--text-dim); }
.fn-rank-1 .fr-rank { color: var(--yellow); }
.fn-rank-2 .fr-rank { color: #d8dcef; }
.fn-rank-3 .fr-rank { color: #ffa45c; }
.fr-who { font-size: 40px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-ranking.is-seat .fr-who { font-family: var(--font-latin); font-size: 46px; }
.fr-correct { font-size: 24px; color: var(--text-dim); }
.fr-score { font: 900 40px/1 var(--font-latin); }
.fn-ranking.is-seat .fn-rank-1 { border-color: var(--yellow); background: #3a3410; transform: scale(1.04); }
.fn-perfect { width: 100%; max-width: 1500px; padding: 14px 22px; border: 4px dashed var(--lime); border-radius: 16px; }
.fn-perfect-title { font-size: 32px; font-weight: 900; color: var(--lime); }
#fn-perfect-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; max-height: 120px; overflow: hidden; }
#fn-perfect-list li { padding: 2px 14px; border: 3px solid var(--lime); border-radius: 999px; font: 900 26px/1.3 var(--font-latin); }
.stage.is-final-wait .fn-ranking, .stage.is-final-wait .fn-perfect { visibility: hidden; }

/* 字幕・メッセージ */
.st-caption { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 8; max-width: 1500px; padding: 8px 26px; border-radius: 12px; background: rgba(5, 5, 10, .82); font-size: 30px; font-weight: 800; opacity: 0; transition: opacity .2s; pointer-events: none; text-align: center; }
.st-caption.is-on { opacity: 1; }
.st-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9; max-width: 1400px; padding: 30px 50px; border: 6px solid var(--on-neon); border-radius: 22px; background: var(--yellow); color: var(--on-neon); font-size: 46px; font-weight: 900; text-align: center; box-shadow: 14px 14px 0 var(--pink); }

/* ---------- 演出 ---------- */
.st-fx { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.fx-stamp {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%) rotate(var(--r));
  display: flex; flex-direction: column; align-items: center; padding: 8px 46px 12px;
  border: 12px solid currentColor; background: rgba(5, 5, 10, .55);
  font-weight: 900; line-height: 1; white-space: nowrap;
  animation: stampIn .3s var(--ease-punch) both;
}
.fx-stamp-main { font-size: 1em; -webkit-text-stroke: .04em var(--on-neon); paint-order: stroke fill; }
.fx-stamp-sub { margin-top: 10px; font-size: .32em; color: #fff; }
.fx-stamp--m { font-size: 96px; }
.fx-stamp--l { font-size: 150px; }
.fx-stamp--xl { font-size: 210px; }
.fx-stamp--xxl { font-size: 360px; border-width: 18px; padding: 0 60px 24px; }
.fx-stamp--yellow { color: var(--yellow); }
.fx-stamp--pink { color: var(--pink); }
.fx-stamp--cyan { color: var(--cyan); }
.fx-stamp--lime { color: var(--lime); }
.fx-stamp--red { color: var(--red); }
.fx-stamp.is-out { animation: stampOut .35s ease-in forwards; }
.fx-stamp.is-static { animation: none; }
.fx-stamp.is-static.is-out { animation: none; opacity: 0; }
@keyframes stampIn { 0% { transform: translate(-50%, -50%) rotate(calc(var(--r) - 12deg)) scale(2.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(var(--r)) scale(1); opacity: 1; } }
@keyframes stampOut { to { transform: translate(-50%, -50%) rotate(var(--r)) scale(.85); opacity: 0; } }
.fx-bit { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); background: var(--c); border: 2px solid var(--on-neon); animation: bit .9s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes bit { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
.fx-confetti { position: absolute; top: -40px; left: var(--x); width: 16px; height: 26px; background: var(--c); animation: fall var(--d) linear var(--delay) forwards; }
@keyframes fall { to { transform: translate(var(--sway), 1200px) rotate(900deg); } }
.fx-rim { position: absolute; inset: 0; box-shadow: inset 0 0 0 20px var(--c), inset 0 0 180px var(--c); animation: rim .7s ease-out forwards; }
@keyframes rim { from { opacity: 1; } to { opacity: 0; } }

/* ---------- 表示＋司会の操作 ---------- */
body.is-host[data-view="stage"]:not(.dock-hidden) .stage-wrap { bottom: 78px; }
.dock {
  position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 999px;
  background: rgba(10, 11, 24, .88); border: 2px solid #3a3d5c; transition: opacity .3s;
}
body.is-display.is-idle .dock { opacity: .12; }
.dock-main {
  min-height: 56px; min-width: 220px; padding: 4px 26px; border: 4px solid var(--on-neon); border-radius: 999px;
  background: var(--yellow); color: var(--on-neon); font-size: 24px; font-weight: 900; box-shadow: 5px 5px 0 var(--pink);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.dock-main small { font-size: 11px; font-weight: 700; opacity: .7; }
.dock-main:disabled { opacity: .45; box-shadow: none; }
.dock-tools { display: flex; gap: 6px; }
.stage-tap { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 40; padding: 8px 20px; border-radius: 999px; background: var(--yellow); color: var(--on-neon); font-weight: 900; box-shadow: 4px 4px 0 var(--pink); }
body.is-display.is-idle, body.is-display.is-idle * { cursor: none !important; }

/* ---------- 司会パネル ---------- */
.console { position: relative; z-index: 35; background: #0d0e1c; color: var(--text); }
.console.is-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(560px, 100vw); overflow-y: auto; overscroll-behavior: contain;
  border-left: 5px solid var(--pink); box-shadow: -14px 0 40px rgba(0, 0, 0, .55); padding-bottom: 90px;
}
body[data-view="console"] .console { min-height: 100vh; max-width: 820px; margin: 0 auto; padding-bottom: 40px; }
body[data-view="console"] .screen-stage { position: static; }
.cs-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: #0d0e1c; border-bottom: 3px solid #23253f; }
.cs-room { font-size: 18px; font-weight: 900; }
.cs-room b { font: 900 28px/1 var(--font-latin); color: var(--yellow); letter-spacing: .08em; }
.cs-counts { font-size: 13px; color: var(--text-dim); flex: 1 1 100%; order: 3; }
#cs-close { margin-left: auto; }
.cs-now { margin: 14px 16px; padding: 16px; border: 4px solid var(--on-neon); border-radius: 18px; background: var(--panel); box-shadow: 6px 6px 0 var(--yellow); }
.cs-phase { font-size: 20px; font-weight: 900; }
.cs-q { margin-top: 10px; padding: 12px; border-radius: 12px; background: #0b0c18; }
.cs-qtext { font-size: 17px; font-weight: 800; }
.cs-answer { margin-top: 8px; display: flex; gap: 10px; align-items: baseline; }
.cs-answer span { padding: 0 8px; border-radius: 6px; background: var(--lime); color: var(--on-neon); font-size: 13px; font-weight: 900; }
.cs-answer b { font-size: 20px; color: var(--lime); }
.cs-note { margin-top: 4px; font-size: 14px; color: var(--text-dim); }
.cs-live { margin-top: 6px; font-size: 15px; color: var(--yellow); font-weight: 900; }
.cs-live:empty, .cs-note:empty { display: none; }
.cs-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cs-join { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 10px; border-radius: 12px; background: #fff; color: var(--on-neon); }
.cs-join-text { font-size: 14px; font-weight: 800; word-break: break-all; }
.cs-join-text b { font: 900 28px/1.1 var(--font-latin); letter-spacing: .1em; }
.console.is-drawer .cs-join { display: none; }
.start-btn {
  flex: 1 1 260px; min-height: 64px; padding: 6px 20px; border: 4px solid var(--on-neon); border-radius: 16px;
  background: var(--pink); color: #fff; font-size: 24px; font-weight: 900; box-shadow: 6px 6px 0 var(--on-neon);
}
.start-btn:disabled { opacity: .4; box-shadow: none; }
.start-btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--on-neon); }
.cs-sec { margin: 0 16px 12px; border: 2px solid #2a2c48; border-radius: 14px; background: #121329; }
.cs-sec > summary { cursor: pointer; padding: 12px 16px; font-size: 18px; font-weight: 900; list-style: none; }
.cs-sec > summary::before { content: "▸ "; color: var(--pink); }
.cs-sec[open] > summary::before { content: "▾ "; }
.cs-sec > :not(summary) { margin-left: 16px; margin-right: 16px; }
.cs-sec > :last-child { margin-bottom: 14px; }
.cs-help { font-size: 13px; color: var(--text-dim); font-weight: 600; margin: 4px 0 8px; }
.cs-players { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.csp { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: #0b0c18; border-left: 6px solid var(--pc, #4a4d66); }
.csp.is-off { opacity: .55; }
.csp-slot { flex: none; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; display: grid; place-items: center; background: var(--pc, #4a4d66); color: var(--on-neon); font: 900 15px/1 var(--font-latin); }
.csp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.csp-score { font: 900 15px/1 var(--font-latin); color: var(--yellow); }
.cs-more { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.cs-block { padding: 10px 0 14px; border-top: 2px dashed #2a2c48; }
.cs-block:first-of-type { border-top: 0; }
.cs-h { font-size: 16px; font-weight: 900; color: var(--cyan); }
.cs-code { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.cs-code span { font-size: 13px; color: var(--text-dim); }
.cs-code b { font: 900 34px/1 var(--font-latin); letter-spacing: .14em; color: var(--yellow); }
.cs-urls { display: flex; flex-direction: column; gap: 8px; }
.cs-urls li { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; align-items: center; }
.cs-urls li span { grid-column: 1 / -1; font-size: 13px; color: var(--text-dim); }
.cs-url { min-width: 0; padding: 6px 8px; border: 2px solid #34375a; border-radius: 8px; background: #0b0c18; color: var(--text); font: 600 12px/1.3 ui-monospace, Consolas, monospace; }
.cs-pair { display: flex; align-items: center; gap: 16px; margin-top: 10px; padding: 10px; border-radius: 12px; background: #fff; color: var(--on-neon); }
.cs-pair .cs-code span { color: #555; }
.cs-pair .cs-code b { color: var(--on-neon); }
.qr--sm { width: 150px; flex: none; }
.cs-slots { margin-top: 8px; font: 600 13px/1.6 ui-monospace, Consolas, monospace; color: var(--text-dim); }
.cs-ranking { max-height: 40vh; overflow-y: auto; font-size: 15px; display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.cs-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 16px 16px; }
#cs-quit { margin-left: auto; }

/* ---------- スマホ（参加者） ---------- */
.screen-player {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #241a3c 0%, var(--ink) 60%);
}
.p-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 2px solid #23253f; }
.p-back { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.p-room { margin-left: auto; font-size: 14px; }
.p-room b { font: 900 18px/1 var(--font-latin); color: var(--yellow); letter-spacing: .08em; }
.pview { flex: 1; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 16px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.p-logo { text-align: center; font-size: 34px; font-weight: 900; line-height: 1.1; }
.p-logo span { display: block; font-size: 58px; color: var(--yellow); -webkit-text-stroke: 3px var(--on-neon); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--pink); transform: rotate(-3deg); }
.p-label { font-size: 15px; font-weight: 900; color: var(--text-dim); }
.p-input { width: 100%; min-height: 58px; padding: 6px 14px; border: 3px solid #4a4d66; border-radius: 14px; background: #0b0c18; color: #fff; font-size: 24px; font-weight: 900; }
.p-help { font-size: 13px; color: var(--text-dim); }
.p-card { position: relative; padding: 22px 18px 18px 86px; border: 5px solid var(--pc, var(--yellow)); border-radius: 20px; background: var(--panel); box-shadow: 8px 8px 0 var(--on-neon); }
.pc-slot { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--pc, var(--yellow)); color: var(--on-neon); font: 900 26px/1 var(--font-latin); border: 4px solid var(--on-neon); }
.pc-name { font-size: 32px; font-weight: 900; line-height: 1.2; word-break: break-all; }
.pc-sub { font-size: 13px; color: var(--text-dim); }
.p-status { text-align: center; font-size: 17px; font-weight: 900; color: var(--yellow); }
.p-next { text-align: center; font-size: 14px; color: var(--text-dim); }
.p-rules { padding: 14px 16px; border: 3px dashed #3a3d5c; border-radius: 14px; }
.p-rules-h { font-weight: 900; color: var(--pink); }
.p-rules ol { list-style: decimal; padding-left: 1.4em; font-size: 15px; }
.p-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; }
.pi-kicker, .pf-kicker { text-align: center; font: 900 24px/1 var(--font-latin); color: var(--cyan); letter-spacing: .2em; margin-top: 20px; }
.pi-title { text-align: center; font-size: 40px; font-weight: 900; color: var(--yellow); }

.pview-q { gap: 10px; padding-top: 10px; }
.pq-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.pq-no { font: 900 24px/1 var(--font-latin); padding: 4px 10px; background: var(--yellow); color: var(--on-neon); border: 3px solid var(--on-neon); transform: rotate(-3deg); }
.pq-genre { font-size: 15px; font-weight: 900; color: var(--pink); }
.pq-score { font-size: 13px; color: var(--text-dim); }
.pq-score b { font: 900 22px/1 var(--font-latin); color: #fff; margin: 0 2px; }
.pq-timer { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: #23253f; overflow: hidden; }
.pq-timer span { display: block; height: 100%; background: var(--lime); transform-origin: 0 50%; transform: scaleX(var(--p, 1)); }
.pq-timer.is-off span { transform: scaleX(0); }
.pq-body { padding: 12px 14px; border: 4px solid var(--on-neon); border-radius: 16px; background: var(--panel); box-shadow: 0 0 0 3px var(--yellow); display: flex; flex-direction: column; gap: 8px; }
.pq-img { max-height: 30vh; display: grid; place-items: center; }
.pq-img svg { max-width: 100%; max-height: 30vh; }
.pq-text { font-size: 20px; font-weight: 900; line-height: 1.55; min-height: 3.1em; }
.pq-text rt { color: var(--yellow); }
.pq-choices { display: flex; flex-direction: column; gap: 8px; }
.pq-choices.is-img { display: grid; grid-template-columns: 1fr 1fr; }
.pq-choice {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; text-align: left;
  border: 4px solid var(--on-neon); border-radius: 14px; background: var(--panel-2); color: #fff; box-shadow: 5px 5px 0 var(--on-neon); --cc: var(--c0);
}
.pq-choices li:nth-child(2) .pq-choice { --cc: var(--c1); }
.pq-choices li:nth-child(3) .pq-choice { --cc: var(--c2); }
.pq-choices li:nth-child(4) .pq-choice { --cc: var(--c3); }
.pqc-letter { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--cc); color: var(--on-neon); font: 900 24px/1 var(--font-latin); border: 3px solid var(--on-neon); }
.pqc-body { flex: 1; min-width: 0; font-size: 19px; font-weight: 900; line-height: 1.35; }
.pqc-body rt { color: var(--cc); }
.pq-choices.is-img .pq-choice { flex-direction: column; align-items: stretch; padding: 6px; position: relative; }
.pq-choices.is-img .pqc-letter { position: absolute; left: 6px; top: 6px; }
.pq-choices.is-img .pqc-body { height: 110px; display: grid; place-items: center; }
.pq-choices.is-img .pqc-body svg { max-width: 100%; max-height: 100%; }
.pq-choice:disabled { opacity: .55; }
.pq-choice:not(:disabled) { border-color: var(--cc); }
.pq-choice:not(:disabled):active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--on-neon); }
.pq-choice.is-selected { opacity: 1; background: var(--cc); color: var(--on-neon); }
.pq-choice.is-wrong { text-decoration: line-through; opacity: .35; }
.pq-buzz {
  align-self: center; width: min(68vw, 280px); aspect-ratio: 1; margin: 6px 0; border-radius: 50%;
  border: 8px solid var(--on-neon); background: radial-gradient(circle at 35% 30%, #ff8ab8, var(--pink) 45%, #c4005a);
  box-shadow: 0 12px 0 #7a0038, 0 18px 30px rgba(0, 0, 0, .5); color: #fff; touch-action: none; user-select: none; -webkit-user-select: none;
}
.pqb-label { font-size: 46px; font-weight: 900; -webkit-text-stroke: 2px var(--on-neon); paint-order: stroke fill; }
.pq-buzz:active:not(:disabled) { transform: translateY(8px); box-shadow: 0 4px 0 #7a0038, 0 8px 16px rgba(0, 0, 0, .5); }
.pq-buzz:disabled { filter: grayscale(.8) brightness(.6); }
.pq-buzz.is-pending { animation: pend .4s ease-in-out infinite alternate; filter: none; }
@keyframes pend { to { transform: scale(.94); } }
.pq-msg { min-height: 1.6em; text-align: center; font-size: 18px; font-weight: 900; color: var(--yellow); }
body.is-myturn .screen-player { box-shadow: inset 0 0 0 8px var(--yellow); animation: myturn .5s ease-in-out infinite alternate; }
@keyframes myturn { to { box-shadow: inset 0 0 0 14px var(--pink); } }
body.is-myturn .pq-msg { font-size: 24px; color: #fff; }

.pview-reveal, .pview-final { align-items: center; text-align: center; justify-content: center; }
.pr-stamp { font-size: clamp(40px, 13vw, 60px); font-weight: 900; padding: 4px 24px; border: 8px solid currentColor; transform: rotate(-5deg); white-space: nowrap; }
.pr-stamp.is-good { color: var(--lime); }
.pr-stamp.is-bad { color: var(--red); }
.pr-stamp.is-neutral { color: var(--cyan); }
.pr-stamp.is-pop { animation: stampIn2 .32s var(--ease-punch) both; }
@keyframes stampIn2 { from { transform: rotate(-15deg) scale(2); opacity: 0; } }
.pr-delta { font: 900 44px/1 var(--font-latin); color: var(--yellow); }
.pr-answer { font-size: 20px; font-weight: 900; }
.pr-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.pr-stats div { padding: 12px; border: 3px solid #3a3d5c; border-radius: 14px; background: var(--panel); }
.pr-stats dt { font-size: 13px; color: var(--text-dim); }
.pr-stats dd { font: 900 34px/1.2 var(--font-latin); }
.pf-rank { font: 900 110px/1 var(--font-latin); color: #fff; -webkit-text-stroke: 4px var(--on-neon); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--cyan); }
.pf-rank.is-top { color: var(--yellow); text-shadow: 6px 6px 0 var(--pink); }
.pf-who { font-size: 18px; font-weight: 900; }
.pf-msg { font-size: 24px; font-weight: 900; color: var(--yellow); }
.pview-ended { align-items: center; justify-content: center; text-align: center; }
.pe-msg { font-size: 20px; font-weight: 900; }

/* ---------- ダイアログ・お知らせ ---------- */
.dlg { padding: 0; border: 5px solid var(--on-neon); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 10px 10px 0 var(--yellow); max-width: min(92vw, 520px); }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg-body { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.dlg-title { font-size: 21px; font-weight: 900; }
.dlg-text { font-size: 15px; color: var(--text-dim); }
.dlg-text:empty { display: none; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 640px); padding: 12px 20px; border: 3px solid var(--on-neon); border-radius: 14px; background: var(--yellow); color: var(--on-neon); font-weight: 900; box-shadow: 5px 5px 0 var(--pink); text-align: center; }

/* ---------- 配信用の背景 ---------- */
html[data-bg="clear"], html[data-bg="clear"] body, body[data-bg="clear"] .stage-wrap, body[data-bg="clear"] .stage { background: transparent; }
body[data-bg="clear"] .st-bg, body[data-bg="green"] .st-bg { display: none; }
body[data-bg="green"] .stage-wrap, body[data-bg="green"] .stage { background: #00ff00; }
body[data-bg="clear"] .q-bignum, body[data-bg="green"] .q-bignum { display: none; }
body[data-bg="clear"] .sv-lobby .lb-main, body[data-bg="clear"] .sv-final { text-shadow: 0 0 12px rgba(0, 0, 0, .8); }

/* ---------- 動きを減らす（ページの設定「動き：少なめ」と OS の設定） ---------- */
body.motion-off *, body.motion-off *::before, body.motion-off *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
body.motion-off .tape span { animation: none; }
body.motion-off .st-lines { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tape span { animation: none; }
  .st-lines { display: none; }
}

/* ---------- 画面の幅 ---------- */
@media (max-width: 640px) {
  .title-body { padding: 64px 14px 90px; gap: 18px; }
  .big-btn, .join-box { padding: 16px 16px 18px 60px; min-height: 0; }
  .bb-no { font-size: 26px; left: 12px; }
  .opt { grid-template-columns: 1fr; }
  .opt-help { grid-column: 1; }
}
@media (max-width: 380px) {
  .pq-buzz { width: 62vw; }
  .pqb-label { font-size: 38px; }
  .pq-text { font-size: 18px; }
}
