:root {
  --bg: #0f1630;
  --bg2: #18214a;
  --card: #1f2a5c;
  --line: #2f3c78;
  --text: #f3f5ff;
  --muted: #a3acd6;
  --accent: #ffc531;
  --ok: #2ecc71;
  --ng: #ff4d5e;
  --c0: #e8414f;
  --c1: #2f80ed;
  --c2: #27ae60;
  --c3: #f2a516;
  --c4: #9b51e0;
  --c5: #16a3b8;
  --radius: 14px;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(circle at 50% -20%, #2a3a8a 0%, var(--bg) 60%) fixed; background-color: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); }
h1, h2 { margin: 0 0 .5em; }
h2 { font-size: 1rem; color: var(--muted); letter-spacing: .05em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hl { color: var(--accent); }
.ok { color: var(--ok); }
.ng { color: var(--ng); }
kbd { background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 0 .4em; }
input, select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: .6em .8em; }
input[type=checkbox], input[type=radio] { width: 1.1em; height: 1.1em; vertical-align: middle; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: .6em 1.2em; background: var(--accent); color: #1a1a1a; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.big { font-size: 1.2rem; padding: .8em 1.6em; }
.btn.small { font-size: .85rem; padding: .4em .8em; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); color: #062; }
.btn.ng { background: var(--ng); color: #fff; }
.mini { font: inherit; font-size: .8rem; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: .1em .5em; cursor: pointer; }
.mini.ok { background: var(--ok); color: #062; }
.mini.ng { background: var(--ng); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2em; }
.pill, .tag { display: inline-block; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: .1em .7em; font-size: .85em; margin-right: .3em; }
.tag.hl { color: #1a1a1a; background: var(--accent); }
.tag.ng { color: #fff; background: var(--ng); border-color: var(--ng); }
.dot { width: .7em; height: .7em; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.off { background: var(--ng); }
.row { display: flex; flex-wrap: wrap; gap: .6em; margin: .6em 0; }
.error { color: var(--ng); font-weight: 700; }

#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(90vw, 480px); }
.toast { background: #000c; border: 1px solid var(--line); padding: .7em 1em; border-radius: 10px; text-align: center; }
.toast.error { border-color: var(--ng); color: #ffd0d5; }

/* ---------------------------------------------------------------- トップ */
.home main { max-width: 760px; margin: 0 auto; padding: 8vh 16px; }
.logo { font-size: 3rem; letter-spacing: .04em; background: linear-gradient(90deg, var(--accent), #ff7a59); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.logo.small { font-size: 1.3rem; font-weight: 800; }
.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 2em; text-align: left; }
.home-cards form { display: grid; gap: .6em; }
.home-cards input { font-size: 1.4rem; text-align: center; letter-spacing: .3em; text-transform: uppercase; }

/* ---------------------------------------------------------------- 投影画面（stage） */
.stage { container-type: inline-size; display: flex; flex-direction: column; gap: 2.5cqw; padding: 3cqw; min-height: 100%; }
.screen { height: 100vh; overflow: hidden; }
.screen .stage { height: 100vh; justify-content: center; }
.stage-head { display: flex; align-items: center; gap: 1cqw; font-size: 1.8cqw; }
.stage-head .timer { margin-left: auto; }
.timer { display: inline-grid; place-items: center; min-width: 2.2em; height: 2.2em; border-radius: 50%; border: 3px solid var(--accent); font-weight: 800; font-size: 1.4em; }
.timer.urgent { border-color: var(--ng); color: var(--ng); animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.stage-question { font-size: 4cqw; font-weight: 800; line-height: 1.35; }
.stage-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5cqw; }
.stage-choices.n3 { grid-template-columns: 1fr 1fr 1fr; }
.stage-choices li { display: flex; align-items: center; gap: 1.2cqw; padding: 1.4cqw 2cqw; border-radius: 1.2cqw; font-size: 2.8cqw; font-weight: 700; transition: opacity .3s, transform .3s; }
.stage-choices li b { display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: #fff3; flex: none; }
.stage-choices li.dim { opacity: .25; }
.stage-choices li.right { outline: .5cqw solid #fff; transform: scale(1.03); }
.c0 { background: var(--c0); } .c1 { background: var(--c1); } .c2 { background: var(--c2); }
.c3 { background: var(--c3); } .c4 { background: var(--c4); } .c5 { background: var(--c5); }
.status { text-align: center; font-size: 3cqw; font-weight: 800; }
.status.open { color: var(--accent); animation: pulse .8s infinite alternate; }
.status .sub, .stage .sub { font-size: 1.8cqw; font-weight: 400; color: var(--muted); animation: none; }
.status .count { color: var(--text); }
.status.buzzed { background: var(--accent); color: #1a1a1a; border-radius: 1.5cqw; padding: 1.5cqw; }
.status.buzzed .sub { color: #333; }
.big-name { font-size: 6cqw; line-height: 1.2; }
.result { text-align: center; display: grid; gap: 1cqw; }
.result .answer { font-size: 3.5cqw; }
.result .answer b { color: var(--accent); }
.result .winners { font-size: 3cqw; font-weight: 800; color: var(--ok); }
.result .winners.none { color: var(--muted); }
.result .explanation { font-size: 2cqw; color: var(--muted); }
.lobby { display: grid; gap: 2cqw; justify-items: center; text-align: center; }
.lobby-join { display: flex; align-items: center; gap: 4cqw; background: var(--card); padding: 3cqw; border-radius: 2cqw; }
.lobby .qr { width: 22cqw; background: #fff; border-radius: 1cqw; padding: 1cqw; }
.room-code { font-size: 10cqw; font-weight: 900; letter-spacing: .15em; color: var(--accent); line-height: 1.1; }
.url { word-break: break-all; }
.lobby-players { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 1cqw; padding: 0; margin: 0; font-size: 2.2cqw; }
.lobby-players li { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: .2em 1em; animation: pop .3s; }
.lobby-players li.off { opacity: .4; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.ranking { width: 100%; max-width: 1000px; margin: 0 auto; }
.ranking h2 { font-size: 4cqw; text-align: center; color: var(--accent); }
.ranking ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .8cqw; }
.ranking li { display: grid; grid-template-columns: 8cqw 1fr auto; align-items: center; background: var(--card); border-radius: 1cqw; padding: .6cqw 2cqw; font-size: 2.4cqw; font-weight: 700; }
.ranking li.rank-1 { background: linear-gradient(90deg, #b8860b, #ffd700); color: #1a1a1a; font-size: 3cqw; }
.ranking li.rank-2 { background: linear-gradient(90deg, #707a8a, #c9d1dc); color: #1a1a1a; }
.ranking li.rank-3 { background: linear-gradient(90deg, #8b4a1c, #cd7f32); }
.ranking .score small { font-size: .6em; margin-left: .2em; }
.sound-hint { position: fixed; top: 10px; right: 10px; z-index: 5; font: inherit; background: #0008; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: .4em .8em; cursor: pointer; }

/* ---------------------------------------------------------------- GM 画面 */
.host-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8em; padding: .6em 1em; background: #0008; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.host-bar .code { font-size: 1.4rem; color: var(--accent); letter-spacing: .1em; }
.host-bar .url { font-size: .85rem; }
.host-grid { display: grid; gap: 12px; padding: 12px; grid-template-columns: minmax(340px, 1.1fr) minmax(360px, 1.3fr) minmax(300px, 1fr); grid-template-areas: "control preview questions" "players settings questions"; align-items: start; }
@media (max-width: 1200px) { .host-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "control preview" "players questions" "settings questions"; } }
@media (max-width: 760px) { .host-grid { grid-template-columns: 1fr; grid-template-areas: "control" "preview" "players" "questions" "settings"; } }
.panel { background: #1b2550cc; border: 1px solid var(--line); border-radius: var(--radius); padding: 1em; min-width: 0; }
.control-panel { grid-area: control; }
.preview-panel { grid-area: preview; position: relative; }
.players-panel { grid-area: players; }
.questions-panel { grid-area: questions; }
.settings-panel { grid-area: settings; }
.preview { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.preview .stage { min-height: 100%; justify-content: center; }
.cq { background: var(--bg2); border-radius: 10px; padding: .8em; }
.cq-text { font-size: 1.15rem; font-weight: 700; margin: .4em 0; }
.cq-answer { color: var(--accent); }
.cq-answer small { color: var(--muted); margin-left: .5em; }
.phase { font-size: 1.05rem; }
.their-answer { font-size: 1.3rem; background: var(--bg2); border-radius: 10px; padding: .5em .8em; }
.hint { font-size: .8rem; margin-left: .6em; padding: .1em .6em; border-radius: 999px; background: var(--bg); }
.hint.ok { color: var(--ok); } .hint.ng { color: var(--ng); }
.judge .btn { flex: 1; font-size: 1.4rem; }
.attempts { display: flex; flex-wrap: wrap; gap: .5em; margin: .6em 0; font-size: .9rem; }
.answers { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5em 0; }
.answers th, .answers td { border-bottom: 1px solid var(--line); padding: .35em .4em; text-align: left; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.players li { display: grid; grid-template-columns: 2em 1fr 3em auto; align-items: center; gap: .4em; background: var(--bg2); border-radius: 8px; padding: .35em .6em; }
.players li.off { opacity: .45; }
.players li.muted { display: block; background: none; }
.players .rank { color: var(--muted); text-align: center; }
.players .score { font-weight: 800; text-align: right; color: var(--accent); }
.players .ops { display: flex; gap: 3px; }
.mode-pick { display: flex; gap: 1em; align-items: center; margin-bottom: .6em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .6em; }
.chip { font: inherit; font-size: .85rem; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .25em .8em; cursor: pointer; }
.chip.on { background: var(--accent); color: #1a1a1a; border-color: var(--accent); }
.chip small { opacity: .7; }
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 70vh; overflow: auto; }
.questions li { display: grid; grid-template-columns: 1fr auto; gap: .2em .6em; background: var(--bg2); border-radius: 8px; padding: .5em .7em; }
.questions li.used { opacity: .45; }
.questions .q-meta, .questions .q-text, .questions .q-ans { grid-column: 1; }
.questions .q-text { font-weight: 700; }
.questions .q-ans { font-size: .8rem; color: var(--muted); }
.questions .btn { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.import { margin-top: .8em; }
.import summary { cursor: pointer; color: var(--muted); }
.import > * { margin: .4em 0; display: block; }
.settings { display: grid; gap: .5em; }
.settings label { display: grid; grid-template-columns: 1fr 6em; align-items: center; gap: .6em; font-size: .9rem; }
.settings label.check { grid-template-columns: auto 1fr; }

/* ---------------------------------------------------------------- 参加者画面 */
.player main { max-width: 560px; margin: 0 auto; padding: 12px; min-height: 100vh; display: flex; flex-direction: column; gap: 12px; }
.player .join { display: grid; gap: 1em; margin-top: 10vh; }
.player .join h1 { text-align: center; color: var(--accent); }
.player .join label { display: grid; gap: .3em; color: var(--muted); }
.player .join input { font-size: 1.3rem; }
.p-head { display: flex; justify-content: space-between; align-items: baseline; padding: .2em .2em .6em; border-bottom: 1px solid var(--line); }
.p-name { font-weight: 800; font-size: 1.1rem; }
.p-score { color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.p-score small { color: var(--muted); font-weight: 400; font-size: .75rem; }
.p-q { background: var(--card); border-radius: var(--radius); padding: .8em 1em; }
.p-q-head { display: flex; justify-content: space-between; align-items: center; }
.p-q-text { font-size: 1.15rem; font-weight: 700; margin-top: .4em; }
.big-msg { font-size: 2rem; font-weight: 900; margin: .2em 0; }
.buzzer { flex: none; border: 0; border-radius: 50%; width: min(80vw, 52vh); height: min(80vw, 52vh); margin: 3vh auto; font: inherit; font-size: 3rem; font-weight: 900; color: #fff; background: radial-gradient(circle at 35% 30%, #ff8a95, var(--c0) 55%, #a01826); box-shadow: 0 12px 0 #6d0f19, 0 20px 40px #0008; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.buzzer:active, .buzzer:disabled { transform: translateY(10px); box-shadow: 0 2px 0 #6d0f19; }
.your-turn { background: var(--accent); color: #1a1a1a; text-align: center; font-weight: 900; font-size: 1.4rem; border-radius: var(--radius); padding: .5em; animation: pulse .5s infinite alternate; }
.p-choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: .8em; font: inherit; font-size: 1.2rem; font-weight: 800; color: #fff; border: 0; border-radius: 12px; padding: 1em; text-align: left; min-height: 64px; cursor: pointer; }
.choice b { display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; background: #fff3; flex: none; }
.choice.selected { outline: 4px solid #fff; }
.text-form { display: grid; gap: 10px; }
.text-form input { font-size: 1.4rem; padding: .7em; }
.sent { text-align: center; color: var(--muted); }
.p-rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.p-rank li { display: grid; grid-template-columns: 2em 1fr auto; padding: .4em .6em; background: var(--bg2); border-radius: 8px; }
.p-rank li.me { outline: 2px solid var(--accent); }
.offline-bar { display: none; position: fixed; top: 0; left: 0; right: 0; background: var(--ng); text-align: center; padding: .3em; z-index: 50; }
body.offline .offline-bar { display: block; }

/* ================================================================ v2（3 形式・管理画面） */
.pad { padding: 8vh 16px; }
.wide { width: 100%; }
.warn { color: var(--c3); }
.notice { background: var(--c3); color: #1a1a1a; border-radius: 10px; padding: .5em .8em; font-weight: 700; }
.help { font-size: .9rem; color: var(--muted); }
.explanation { color: var(--muted); }
.answer b { color: var(--accent); }
.cfg { display: grid; grid-template-columns: auto 1fr; gap: .3em 1em; margin: .8em 0; }
.cfg dt { color: var(--muted); }
.cfg dd { margin: 0; font-weight: 700; }

/* 回答画面 */
.p-code { color: var(--muted); font-size: .85rem; }
.q-head { display: flex; flex-wrap: wrap; gap: .4em; align-items: center; }
.q-head .timer { margin-left: auto; }
.pill.score { color: var(--accent); }
.q-text { font-size: 1.25rem; font-weight: 800; line-height: 1.5; background: var(--card); border-radius: var(--radius); padding: .8em 1em; }
.basis { color: var(--muted); }
.basis b { color: var(--text); }
.choices { display: grid; gap: 10px; }
.choice { position: relative; }
.choice i { margin-left: auto; font-style: normal; font-size: .8rem; background: #fff; color: #1a1a1a; border-radius: 999px; padding: .1em .6em; }
.choice.selected { outline: 4px solid #fff; outline-offset: 2px; }
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: ord; }
.order-list li { display: flex; align-items: center; gap: .5em; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6em .7em; font-weight: 700; }
.order-list .pos { display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--accent); color: #1a1a1a; flex: none; }
.order-list .txt { flex: 1; }
.order-list .mini { min-width: 4.2em; min-height: 40px; }
.order-list.done li { counter-increment: ord; }
.order-list.done li::before { content: counter(ord); display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--bg2); flex: none; }
.timer.inline { display: inline-grid; min-width: 1.8em; height: 1.8em; font-size: 1em; border-width: 2px; vertical-align: middle; }
.timer-row { text-align: center; color: var(--muted); }
.attempts { display: flex; flex-wrap: wrap; gap: .5em; font-size: .9rem; color: var(--muted); }
.reveal-stop { color: var(--accent); margin-left: .2em; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank-list li { display: grid; grid-template-columns: 3.5em 1fr auto; gap: .5em; align-items: center; background: var(--bg2); border-radius: 8px; padding: .4em .7em; }
.rank-list li.me { outline: 2px solid var(--accent); }
.rank-list li.off { opacity: .55; }
.rank-list .rank { color: var(--muted); }
.rank-list .score { font-weight: 800; color: var(--accent); }

/* 投影画面 */
.stage-choices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5cqw; }
.stage-choices li em { margin-left: auto; font-style: normal; font-size: .8em; }
.stage-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.2cqw; font-size: 2.6cqw; font-weight: 700; }
.stage-items li { background: var(--card); border-radius: 1cqw; padding: 1cqw 2cqw; }
.stage .basis { font-size: 2cqw; }
.stage .rank-list { font-size: 1.8cqw; max-width: 60cqw; margin: 0 auto; width: 100%; }
.stage .result .answer { font-size: 3.2cqw; }
.stage .order-list { font-size: 2.2cqw; max-width: 50cqw; margin: .5em auto; }
.ranking .rank-list { font-size: 2.2cqw; }

/* 作成者画面 */
.host-main { padding: 12px; display: grid; gap: 12px; max-width: 1400px; margin: 0 auto; }
.host-main .host-grid { padding: 0; grid-template-columns: 1fr 1fr; grid-template-areas: none; }
@media (max-width: 900px) { .host-main .host-grid { grid-template-columns: 1fr; } }
.setup { display: grid; gap: .8em; }
.setup fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .6em .8em; margin: 0; }
.setup legend { color: var(--muted); padding: 0 .3em; }
.setup label { display: grid; gap: .2em; }
.setup .row label { display: flex; align-items: center; gap: .5em; }
.setup details label { margin: .4em 0; }
.opt { display: grid !important; grid-template-columns: auto 1fr; gap: 0 .6em !important; align-items: start; padding: .4em 0; cursor: pointer; }
.opt small { grid-column: 2; color: var(--muted); }
.chip-check { display: inline-flex; align-items: center; gap: .3em; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: .3em .8em; cursor: pointer; }
.join-box { display: flex; gap: 1em; align-items: center; margin-bottom: .8em; }
.join-box .qr { width: 120px; background: #fff; border-radius: 8px; padding: 4px; }
.room-code-sm { font-size: 2.4rem; font-weight: 900; letter-spacing: .15em; color: var(--accent); }
.host-main .players li { grid-template-columns: 1fr auto; }
.host-main .players { margin: .8em 0; max-height: 360px; }
.control-bar .row { margin: 0; align-items: center; }
.gm-list { margin: .4em 0; }
.gm-answer { background: var(--bg2); border-radius: 10px; padding: .4em .8em; margin: .6em 0; }

/* 管理画面 */
.admin-main { max-width: 1000px; margin: 0 auto; padding: 12px; display: grid; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { font: inherit; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 10px 10px 0 0; padding: .5em 1em; cursor: pointer; }
.tab.on { background: var(--accent); color: #1a1a1a; border-color: var(--accent); }
.tab-body { display: grid; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters input { flex: 1; min-width: 160px; }
.bulk { align-items: center; font-size: .9rem; }
.q-card { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 10px; padding: .6em .9em; margin-bottom: 8px; }
.q-card.status-reviewed { border-left-color: var(--ok); }
.q-card.status-draft { border-left-color: var(--c3); }
.q-card.status-rejected, .q-card.status-archived { opacity: .7; }
.q-card .row { margin: .2em 0; align-items: center; }
.q-title { font-weight: 800; margin: .3em 0; }
.q-card p { margin: .2em 0; }
.editor { display: grid; gap: .6em; background: var(--bg2); border-radius: 10px; padding: .8em; margin-top: .5em; }
.editor label { display: grid; gap: .2em; }
.editor .row label { flex: 1; min-width: 140px; }
.editor textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .5em; }
.editor fieldset { border: 1px solid var(--line); border-radius: 10px; }
.choice-edit { display: grid !important; grid-template-columns: auto auto 1fr; align-items: center; gap: .5em !important; }
.warn-box { border-color: var(--c3); }
.logs { width: 100%; border-collapse: collapse; font-size: .85rem; }
.logs th, .logs td { border-bottom: 1px solid var(--line); padding: .4em; text-align: left; vertical-align: top; }
@media (max-width: 600px) { .stage-choices, .stage-items { grid-template-columns: 1fr; } }

.screen .stage { justify-content: safe center; overflow-y: auto; gap: 1.6cqw; }
.screen .stage .stage-question { font-size: 3.4cqw; }
.text-form input { width: 100%; min-width: 0; }
.gm-list { list-style: none; padding: 0; }
.choices + .btn { margin-top: 10px; }

/* ================================================================ ゲーム演出（fx.js） */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.fx { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.fx-flash { animation: fx-flash .45s ease-out forwards; }
@keyframes fx-flash { from { opacity: 1; } to { opacity: 0; } }

/* 出題のタイトルカード: 横から飛び込んで止まり、拡大して消える */
.fx-title { background: radial-gradient(ellipse at center, rgba(15,22,48,.85) 0%, rgba(15,22,48,0) 70%); animation: fx-fade 1.3s ease forwards; }
.fx-title-main { font-size: clamp(3rem, 12vw, 9rem); font-weight: 900; letter-spacing: .08em; color: var(--accent);
  -webkit-text-stroke: 3px #1a1a1a; paint-order: stroke fill; text-shadow: 0 .08em 0 #b8860b, 0 0 .5em rgba(255,197,49,.6);
  animation: fx-title-in 1.3s cubic-bezier(.2,.9,.2,1.2) forwards; }
.fx-title-sub { font-size: clamp(1.2rem, 4vw, 2.4rem); font-weight: 800; color: #fff; background: var(--c0); padding: .1em 1em; border-radius: 999px;
  transform: skewX(-10deg); animation: fx-title-in 1.3s .08s cubic-bezier(.2,.9,.2,1.2) backwards; }
@keyframes fx-title-in {
  0% { transform: translateX(-60vw) skewX(-20deg); opacity: 0; }
  25% { transform: translateX(0) skewX(-6deg); opacity: 1; }
  75% { transform: scale(1) skewX(-6deg); opacity: 1; }
  100% { transform: scale(1.6) skewX(-6deg); opacity: 0; }
}
@keyframes fx-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* 早押し: 回転する集中線と、弾むように出る名前 */
.fx-buzz { animation: fx-fade 1.1s ease forwards; }
.fx-rays { position: absolute; width: 220vmax; height: 220vmax; left: 50%; top: 50%; translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,197,49,.38) 0deg 4deg, transparent 4deg 12deg);
  mask: radial-gradient(circle, transparent 12%, #000 30%); -webkit-mask: radial-gradient(circle, transparent 12%, #000 30%);
  animation: fx-spin 1.1s linear; }
@keyframes fx-spin { from { rotate: 0deg; } to { rotate: 25deg; } }
.fx-buzz-name { position: relative; font-size: clamp(2.4rem, 10vw, 7rem); font-weight: 900; color: #1a1a1a; background: var(--accent);
  padding: .1em .6em; border-radius: .3em; box-shadow: 0 .12em 0 #b8860b, 0 0 0 .08em #fff; animation: fx-pop .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes fx-pop { from { transform: scale(.2) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-3deg); opacity: 1; } }

/* ⭕ ❌ のスタンプ: 大きく落ちてきて押される */
.fx-stamp { animation: fx-fade 1.4s ease forwards; }
.fx-mark { width: min(60vw, 46vh); aspect-ratio: 1; animation: fx-stamp .45s cubic-bezier(.3,1.5,.5,1) both; filter: drop-shadow(0 .4rem 1.2rem rgba(0,0,0,.5)); }
.fx-mark svg { width: 100%; height: 100%; fill: none; stroke-width: 13; stroke-linecap: round; }
.fx-stamp.ok svg { stroke: #ff3b4e; }
.fx-stamp.ng svg { stroke: #2f80ed; }
.fx-mark circle, .fx-mark path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: fx-draw .35s .1s ease-out forwards; }
@keyframes fx-draw { to { stroke-dashoffset: 0; } }
@keyframes fx-stamp { from { transform: scale(2.6) rotate(-15deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.fx-caption { margin-top: .4em; font-size: clamp(1.4rem, 5vw, 3.2rem); font-weight: 900; color: #fff; -webkit-text-stroke: 2px #1a1a1a; paint-order: stroke fill;
  animation: fx-pop .4s .2s cubic-bezier(.2,1.6,.4,1) both; }

.fx-float { place-items: center; }
.fx-float div { font-size: clamp(2rem, 9vw, 5rem); font-weight: 900; color: var(--accent); -webkit-text-stroke: 2px #1a1a1a; paint-order: stroke fill;
  animation: fx-float 1.4s ease-out forwards; }
@keyframes fx-float { 0% { transform: translateY(20vh) scale(.6); opacity: 0; } 30% { transform: translateY(8vh) scale(1.1); opacity: 1; } 100% { transform: translateY(-14vh) scale(1); opacity: 0; } }
.fx-confetti { position: absolute; inset: 0; width: 100%; height: 100%; }

/* 画面の揺れと、残り 3 秒の赤い縁 */
.fx-shake { animation: fx-shake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes fx-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
body.fx-hurry::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 150; box-shadow: inset 0 0 12vmin rgba(255,40,60,.55); animation: fx-hurry .5s ease-in-out infinite alternate; }
@keyframes fx-hurry { from { opacity: .35; } to { opacity: 1; } }

/* ================================================================ ゲームらしい手ざわり */
.btn { box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .06s, box-shadow .06s, filter .15s; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.choice { box-shadow: 0 6px 0 rgba(0,0,0,.3); transition: transform .08s, box-shadow .08s; animation: fx-rise .35s cubic-bezier(.2,1.2,.4,1) backwards; }
.choice:nth-child(2) { animation-delay: .06s; } .choice:nth-child(3) { animation-delay: .12s; } .choice:nth-child(4) { animation-delay: .18s; }
.choice:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.stage-choices li { animation: fx-rise .45s cubic-bezier(.2,1.2,.4,1) backwards; }
.stage-choices li:nth-child(2) { animation-delay: .08s; } .stage-choices li:nth-child(3) { animation-delay: .16s; } .stage-choices li:nth-child(4) { animation-delay: .24s; }
.stage-items li, .order-list:not(.done) li { animation: fx-rise .4s cubic-bezier(.2,1.2,.4,1) backwards; }
@keyframes fx-rise { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.stage-question, .q-text { animation: fx-in .4s ease-out backwards; }
@keyframes fx-in { from { opacity: 0; transform: translateY(-8px); } }
.buzzer { animation: fx-glow 1.2s ease-in-out infinite alternate; }
@keyframes fx-glow { from { box-shadow: 0 12px 0 #6d0f19, 0 0 0 0 rgba(255,77,94,.55), 0 20px 40px #0008; } to { box-shadow: 0 12px 0 #6d0f19, 0 0 0 22px rgba(255,77,94,0), 0 20px 40px #0008; } }
.stage-choices li.right { animation: fx-win .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes fx-win { from { transform: scale(.9); } 60% { transform: scale(1.08); } to { transform: scale(1.03); } }
.result, .card.center { animation: fx-pop-in .45s cubic-bezier(.2,1.4,.4,1) backwards; }
@keyframes fx-pop-in { from { transform: scale(.85); opacity: 0; } }
.rank-list li { animation: fx-rise .4s cubic-bezier(.2,1.2,.4,1) backwards; }
.rank-list li:nth-child(1) { animation-delay: .5s; } .rank-list li:nth-child(2) { animation-delay: .4s; } .rank-list li:nth-child(3) { animation-delay: .3s; }
.rank-list li:nth-child(n+4) { animation-delay: .15s; }
.ranking .rank-list li:first-child, .rank-list li:first-child { background: linear-gradient(90deg, #b8860b, #ffd700); color: #1a1a1a; }
.rank-list li:first-child .rank, .rank-list li:first-child .score { color: #1a1a1a; }
.rank-list li:first-child .name::before { content: '👑 '; }
.your-turn { box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255,197,49,.8); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* 演出の文字が背景の文字と重なって読みにくくならないよう、中央を暗くする */
.fx-stamp, .fx-title { background: radial-gradient(ellipse at center, rgba(10,14,32,.82) 0%, rgba(10,14,32,.55) 45%, rgba(10,14,32,0) 75%); }
.fx-buzz { background: rgba(10,14,32,.35); }

/* 試遊モード（未確認の問題を含む）の表示 */
.pill.trial, dd.trial { background: #5a3b00; border-color: #f0a500; color: #ffd27a; }
.trial-opt { border-color: #f0a500; }
.credits { font-size: .85em; }
.credits li { margin: .4em 0; }

/* hidden 属性を display 指定より優先する（管理画面のタブ切り替え） */
[hidden] { display: none !important; }
