/* 中野市＆長野県 クイズ王！ v0.7 画面デザイン「ポップで、見やすく」
   色・ボタンの土台は ui.css（ワークセット同梱・無改変）。ここで上書きする。
   きまり：
   ・文字はかならず白いカード・ボタンの上にのせる（背景の模様の上に直接のせない。のせる見出しは ふちどり文字）
   ・えらんでいるものは「色がつく＋✓」の2つで見せる
   ・いちばん大事なボタンは1つだけ。スマホでは画面の下の帯に固定
   ・文字が大きい設定の端末（Android の文字サイズ大）でも崩れないように、文字を1行に押しこめない
   重ね順：背景 → 紙吹雪 → 画面（カード・文字） → ひと休み → 通知 */

/* =========================================================
   1. 色・文字の決まり
   ========================================================= */
:root {
  --ink: #1E2B3A;
  --ink-2: #44546A;
  --muted: #5B6878;
  --paper: #FFFFFF;
  --cream: #FFF7E3;
  --soft: #F1F5FA;
  --line: #C4D0DE;
  --sky: #3AA3EE;
  --red: #E5422E;    --red-d: #A82A1A;
  --yellow: #FFCB2E; --yellow-d: #C38E00;
  --blue: #2569CF;   --blue-d: #17448A;
  --green: #17864A;  --green-l: #3CC27A;
  --purple: #7B45D3;
  --lv-easy: #17864A; --lv-normal: #2569CF; --lv-hard: #C9410C; --lv-maniac: #7B45D3;
  --paper-2: #E8EEF5;
  --gold-bg: #FFF3C4;
  /* ラウンドの色：予選＝緑、準決勝＝青、決勝＝赤（どの画面でも同じ） */
  --r1: #17864A; --r2: #2569CF; --r3: #E5422E;
}
.is-r1 { --rc: var(--r1); }
.is-r2 { --rc: var(--r2); }
.is-r3 { --rc: var(--r3); }
.lv-easy { --c: var(--lv-easy); }
.lv-normal { --c: var(--lv-normal); }
.lv-hard { --c: var(--lv-hard); }
.lv-maniac { --c: var(--lv-maniac); }

/* =========================================================
   2. 土台
   ========================================================= */
html, body { margin: 0; }
html { overflow-x: hidden; }
/* body は clip（hidden だと body がスクロール容器になり、下に固定する帯が効かない） */
body.qk { min-height: 100vh; min-height: 100dvh; background: var(--sky); overflow-x: clip; }
.qk {
  line-break: strict;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 18px; line-height: 1.6; color: var(--ink);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
.qk *, .qk *::before, .qk *::after { box-sizing: border-box; }
.qk h1, .qk h2, .qk h3, .qk p, .qk ul, .qk ol, .qk figure, .qk fieldset { margin: 0; }
.qk [hidden] { display: none !important; }
.qk img { max-width: 100%; }
.qk ruby rt { font-size: .5em; font-weight: 700; letter-spacing: 0; }
.qk [tabindex="-1"]:focus { outline: none; }
.qk a { color: var(--blue); }
.qk .num { font-variant-numeric: tabular-nums; }
.qk .small { font-size: 16px; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw { white-space: nowrap; }
/* 句のかたまり：折り返すときは かたまりの間で */
.phr { display: inline-block; }
.noscript { padding: 24px; font-size: 20px; background: #fff; }

/* =========================================================
   3. 背景
   ========================================================= */
.bg { position: fixed; inset: 0; z-index: 0; background: var(--sky) center / cover no-repeat; }
.bg[data-bg="title"] { background-image: url(../assets/web/bg_title.webp); background-position: center bottom; }
/* メニュー：空色の放射線（クイズ番組のセット） */
.bg[data-bg="menu"] {
  background:
    radial-gradient(95% 60% at 50% 0%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 70%),
    radial-gradient(120% 70% at 50% 110%, rgba(16, 70, 140, .35), rgba(16, 70, 140, 0) 70%),
    repeating-conic-gradient(from 0deg at 50% 6%, #45AEF5 0deg 7.5deg, #37A1EE 7.5deg 15deg);
}
/* お祝い：金色の放射線 */
.bg[data-bg="gold"] {
  background:
    radial-gradient(85% 55% at 50% 18%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 70%),
    repeating-conic-gradient(from 0deg at 50% 20%, #FFD24A 0deg 7.5deg, #FFBE2E 7.5deg 15deg);
}
/* クイズ：夜のスタジオ */
.bg[data-bg="studio"] {
  background-image:
    radial-gradient(40% 60% at 18% -8%, rgba(255, 236, 170, .22), transparent 70%),
    radial-gradient(40% 60% at 82% -8%, rgba(255, 236, 170, .22), transparent 70%),
    linear-gradient(180deg, #1B5A86 0%, #133F61 55%, #0D2C45 100%);
}
@media (max-width: 760px) { .bg[data-bg="title"] { background-image: url(../assets/web/bg_title_960.webp); } }

.app {
  --pad-t: max(10px, env(safe-area-inset-top));
  --pad-r: max(16px, env(safe-area-inset-right));
  --pad-b: max(14px, env(safe-area-inset-bottom));
  --pad-l: max(16px, env(safe-area-inset-left));
  position: relative; z-index: 1;
  max-width: 1280px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: var(--pad-t) var(--pad-r) var(--pad-b) var(--pad-l);
  display: flex; flex-direction: column;
}
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
/* ふりがな（ruby）の入った文は、ブラウザが最小の幅を大きく見つもるので、画面の部品は かならず画面の幅までにする */
.screen > * { min-width: 0; max-width: 100%; }
.screen > .action-bar { max-width: none; }
.menu-screen { width: 100%; max-width: 760px; margin: 0 auto; word-break: keep-all; overflow-wrap: anywhere; }
/* 問題・解説は ふつうの折り返し（分かち書きでない文なので） */
.menu-screen .rv-q, .menu-screen .rv-exp, .menu-screen .rv-correct, .menu-screen .rv-source { word-break: normal; }

/* =========================================================
   4. 共通の部品
   ========================================================= */
.qk button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; line-height: 1.3; font-family: inherit; }
.qk .chev { width: .5em; height: .5em; border-right: .17em solid currentColor; border-top: .17em solid currentColor; transform: rotate(45deg); margin-left: .05em; flex: none; }
.qk .icon { width: 30px; height: 30px; flex: none; display: block; }

/* 上の帯：もどる・開発版・音 */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.topbar-mid { flex: 1; min-width: 0; display: flex; align-items: center; }
.qk .icon-btn { flex: none; min-width: 56px; min-height: 56px; height: 56px; padding: 0 16px; gap: 8px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); font-size: 17px; font-weight: 900; box-shadow: 0 4px 0 var(--ink); }
.qk .icon-btn .icon { width: 28px; height: 28px; }
.qk .icon-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.dev-chip { display: inline-block; min-width: 0; font-size: 13px; font-weight: 900; line-height: 1.35; color: var(--ink); background: #fff; border: 2px dashed var(--ink); border-radius: 10px; padding: 3px 10px; }
.note-chip { align-self: center; font-size: 16px; font-weight: 800; line-height: 1.5; color: var(--red); background: #fff; border: 2px solid var(--red); border-radius: 12px; padding: 6px 12px; }

/* ボタン：ポップな立体（押すと沈む） */
.qk .primary, .qk .secondary {
  min-height: 60px; padding: 10px 26px; border: 3px solid var(--ink); border-radius: 999px;
  font-size: 20px; font-weight: 900; letter-spacing: .03em; text-align: center;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.qk .primary { background: linear-gradient(180deg, #F25A45 0%, var(--red) 55%); color: #fff; border-color: var(--ink); }
.qk .secondary { background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
.qk .primary:active:not(:disabled), .qk .secondary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.qk button.big { min-height: 68px; padding: 10px 30px; font-size: 22px; }
.qk .quiet { min-height: 56px; padding: 6px 20px; background: rgba(255, 255, 255, .92); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; font-size: 17px; font-weight: 800; text-decoration: none; }
.qk .quiet .icon { width: 24px; height: 24px; }
@media (hover: hover) {
  .qk .primary:hover:not(:disabled) { filter: brightness(1.06); }
  .qk .secondary:hover:not(:disabled), .qk .quiet:hover:not(:disabled), .qk .icon-btn:hover:not(:disabled) { background: #FFF8DF; }
}
.qk .primary:focus-visible, .qk .secondary:focus-visible, .qk .quiet:focus-visible, .qk .icon-btn:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; }

/* カード */
.card { background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 5px 0 rgba(30, 43, 58, .9); }

/* 見出し：リボン */
.ribbon {
  position: relative; align-self: center; max-width: calc(100% - 48px); margin: 2px 0 6px;
  padding: 6px 20px 7px; font-size: clamp(20px, 6vw, 28px); font-weight: 900; line-height: 1.3; letter-spacing: .04em;
  color: #fff; text-align: center; background: var(--red); border: 3px solid var(--ink); border-radius: 10px;
  box-shadow: 0 5px 0 var(--ink); word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance;
}
.ribbon::before, .ribbon::after { content: ""; position: absolute; z-index: -1; top: 12px; width: 32px; height: calc(100% - 2px); background: var(--red-d); border: 3px solid var(--ink); }
.ribbon::before { left: -24px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 42% 50%); }
.ribbon::after { right: -24px; clip-path: polygon(0 0, 100% 0, 58% 50%, 100% 100%, 0 100%); }
/* 見出し：ふちどり文字（背景の上に直接のせる大きな文字） */
.pop-h {
  color: #fff; font-weight: 900; letter-spacing: .04em; line-height: 1.2; text-align: center;
  word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 7px 0 var(--ink);
}
.pop-h rt { text-shadow: 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 1px 0 var(--ink), 0 -1px 0 var(--ink); }

/* チップ（小さな札） */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 12px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font-size: 16px; font-weight: 900; line-height: 1.5; }
.chip-green { background: var(--green); color: #fff; }
.chip-gray { background: var(--paper-2); color: var(--muted); border-color: #9AA8B8; }
.lv-chip { background: var(--c, var(--blue)); color: #fff; }
.stars { letter-spacing: .06em; white-space: nowrap; }
.lv-chip .stars { color: #FFE27A; }
.level-chip { color: var(--c, var(--ink)); border-color: var(--c, var(--ink)); }
.level-chip .stars { color: #B8860B; }
.lock-chip { gap: 6px; background: #fff; color: var(--ink-2); border: 2px solid #9AA8B8; }
.lock-chip.lv-easy, .lock-chip.lv-normal, .lock-chip.lv-hard, .lock-chip.lv-maniac { color: var(--c); }
.lock-chip .icon { width: 18px; height: 18px; opacity: .7; }
.lock-chip .stars { color: #B8860B; }
.len-n { margin-left: 6px; font-size: .9em; color: var(--ink-2); }

/* 顔・キャラ・王冠 */
.face { width: 40px; height: 40px; border-radius: 50%; background: #CFE9F7; border: 2px solid var(--ink); flex: none; object-fit: cover; display: block; }
.face-unknown { display: grid; place-items: center; background: var(--paper-2); color: var(--muted); font-weight: 900; font-size: 20px; border-style: dashed; }
.fig { position: relative; }
.char { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; transform-origin: 50% 92%; user-select: none; -webkit-user-drag: none; }
.crown-on { position: absolute; left: var(--cx); top: var(--cy); width: 34%; height: auto; transform: translate(-50%, -85%) rotate(-8deg); pointer-events: none; }
.bob { animation: qk-idle 2.6s ease-in-out infinite; }
.bob-late { animation-delay: -1.3s; }
@keyframes qk-idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.char.react-happy { animation: qk-hop .45s ease-out 2; }
.char.react-sad { animation: qk-tilt .25s ease-out 1; }
@keyframes qk-tilt { 0%, 100% { transform: rotate(0); } 45% { transform: rotate(-7deg); } }
/* 席の色（クイズの解答台・ステージ紹介の台） */
[data-id="traveler"] { --seat: #F0B323; --seat-d: #B57A06; }
[data-id="apple"] { --seat: #D8452F; --seat-d: #8E2318; }
[data-id="enoki"] { --seat: #3F8ACB; --seat-d: #1F5584; }
[data-id="oyaki"] { --seat: #34A06A; --seat-d: #1B5C3C; }
[data-id="mountain"] { --seat: #7647AE; --seat-d: #43246C; }

/* ふきだし */
.bubble { position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 6px 12px; font-weight: 800; line-height: 1.6; font-size: 18px; max-width: 280px; }
.bubble::after { content: ""; position: absolute; bottom: -9px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.bubble.pop, .pop { animation: qk-pop .26s ease-out; }
@keyframes qk-pop { from { scale: .6; opacity: 0; } to { scale: 1; opacity: 1; } }

/* 司会者の帯 */
.host-strip { align-self: center; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 16px 6px 6px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); font-weight: 900; font-size: 18px; line-height: 1.55; }
.host-strip .face { width: 48px; height: 48px; }
.host-strip > span { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
/* 話している人：顔は外、文字は しっぽつきの吹き出し（ただのお知らせカードと 見分ける） */
.say { align-self: stretch; display: flex; align-items: center; gap: 14px; padding: 0; background: none; border: 0; box-shadow: none; font-weight: 800; font-size: 18px; line-height: 1.55; }
.say > .face { width: 52px; height: 52px; border-width: 3px; box-shadow: 0 3px 0 var(--ink); }
.say > span { position: relative; flex: 1; min-width: 0; padding: 8px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.say > span::before { content: ""; position: absolute; left: -12px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right: 12px solid var(--ink); border-left: 0; }
.say > span::after { content: ""; position: absolute; left: -7px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-right: 8px solid #fff; border-left: 0; }

/* 下の帯：いちばん大事なボタンを、画面の下に固定（スタジオの床の電球つき） */
.action-bar {
  position: sticky; bottom: 0; z-index: 8;
  margin-top: auto; margin-bottom: calc(-1 * var(--pad-b));
  padding: 16px 14px calc(var(--pad-b) + 2px);
  background:
    radial-gradient(circle, #FFE7A0 0 2.4px, rgba(255, 231, 160, .28) 3.2px, transparent 4.4px) 7px 3px / 18px 10px repeat-x,
    linear-gradient(180deg, #16609F 0%, #0E4377 100%);
  border-top: 3px solid var(--ink);
  box-shadow: 0 -6px 18px rgba(10, 40, 80, .22);
}
.action-inner { width: min(100%, 520px); margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.action-inner > button { width: 100%; }
@media (max-width: 799px) {
  .action-bar { margin-left: calc(-1 * var(--pad-l)); margin-right: calc(-1 * var(--pad-r)); padding-left: var(--pad-l); padding-right: var(--pad-r); }
}
@media (min-width: 800px) {
  .action-bar { border: 3px solid var(--ink); border-bottom: 0; border-radius: 24px 24px 0 0; }
}
.sub-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; }
.sub-actions > button { flex: 1 1 200px; max-width: 360px; }

/* =========================================================
   5. タイトル
   ========================================================= */
.title-screen { position: relative; }
.title-main { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-bottom: 6px; }
.logo-h { line-height: 0; }
.logo { width: min(620px, 94vw); max-height: 34vh; height: auto; object-fit: contain; filter: drop-shadow(0 5px 0 rgba(30, 43, 58, .28)); }
.title-goal { max-width: 100%; font-size: 18px; font-weight: 900; line-height: 1.6; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 6px 18px; box-shadow: 0 4px 0 var(--ink); }
.title-actions { display: grid; gap: 14px; width: min(460px, 100%); }
.title-actions .start-btn { min-height: 78px; font-size: 24px; }
.start-text { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.25; min-width: 0; }
.start-main { display: block; }
.start-sub { font-size: 15px; font-weight: 800; opacity: .95; }
.title-status { width: min(520px, 100%); padding: 12px 14px 14px; display: grid; gap: 10px; text-align: left; }
.ts-h { font-size: 17px; font-weight: 900; color: var(--ink-2); }
.crown-row { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.crown-slot-ic { position: relative; display: block; }
.crown-slot-ic .crown-slot-n { position: absolute; right: -14px; top: -6px; font-size: 13px; line-height: 1.4; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 0 5px; }
.crown-slot .stars { font-size: 14px; color: var(--c); letter-spacing: 0; }
.crown-slot { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 0; padding: 6px 4px; border-radius: 14px; background: var(--soft); border: 2px solid var(--line); font-weight: 900; line-height: 1.3; text-align: center; }
.crown-slot .icon { width: 30px; height: 30px; filter: grayscale(1); opacity: .35; }
.crown-slot-label { font-size: 15px; color: var(--ink-2); line-height: 1.3; }
.crown-slot.is-got { background: var(--gold-bg); border-color: var(--yellow-d); }
.crown-slot.is-got .icon { filter: none; opacity: 1; }

.card-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding-top: 10px; border-top: 2px dashed var(--line); }
.card-faces { display: flex; gap: 6px; }
.mini-card .face { width: 38px; height: 38px; filter: grayscale(1) opacity(.4); }
.mini-card.is-got .face { filter: none; }
.card-count { font-size: 16px; font-weight: 900; }
/* キャラ：広い画面は 左右の下すみ、せまい画面は 記録のカードの下に ならべる（カードに かくれない） */
.title-chars { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; margin: -6px calc(-1 * var(--pad-r)) calc(-1 * var(--pad-b)) calc(-1 * var(--pad-l)); pointer-events: none; }
.tc { width: clamp(96px, 26vw, 160px); }
.tc .fig { margin-bottom: -8%; }
@media (min-width: 900px) {
  .title-chars { position: absolute; inset: auto 0 0 0; height: 0; margin: 0; display: block; }
  .tc { position: absolute; bottom: calc(-1 * var(--pad-b)); width: clamp(160px, 19vw, 270px); }
  .tc-left { left: calc(-1 * var(--pad-l) + 6px); }
  .tc-right { right: calc(-1 * var(--pad-r) + 6px); }
}

/* =========================================================
   6. 勝ち上がり表・大会の せってい
   ========================================================= */
.road-layout { display: grid; gap: 14px; }
.road-main { display: grid; gap: 14px; align-content: start; }
/* 進み具合：予選 → 準決勝 → 決勝 → クイズ王 */
.road { list-style: none; margin: 0; padding: 6px 6px 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.road-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding-top: 24px; text-align: center; }
.road-step::before { content: ""; position: absolute; z-index: 0; top: 44px; right: 50%; width: 100%; height: 8px; border-radius: 4px; background: #D5DEEA; }
.road-step:first-child::before { display: none; }
.road-step.is-done::before, .road-step.is-here::before { background: var(--green-l); }
.rs-dot { position: relative; z-index: 1; width: 40px; height: 40px; margin: 4px 0; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 900; line-height: 1; color: var(--muted); background: #fff; border: 3px solid var(--line); }
.rs-dot img { width: 26px; height: 26px; }
.road-step.is-done .rs-dot { background: var(--green); border-color: var(--ink); color: #fff; }
.road-step.is-here .rs-dot { width: 48px; height: 48px; margin: 0; background: var(--rc, var(--red)); border-color: var(--ink); color: #fff; font-size: 24px; box-shadow: 0 0 0 5px rgba(30, 43, 58, .16); }
.road-goal .rs-dot { background: var(--gold-bg); border-color: var(--yellow-d); }
.road-goal.is-here .rs-dot { background: var(--yellow); box-shadow: 0 0 0 5px rgba(255, 203, 46, .35); }
.rs-label { font-size: 16px; font-weight: 900; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.road-step.is-ahead .rs-label { color: var(--muted); }
.road-step.is-here .rs-label { color: var(--rc, var(--red)); }
.rs-crown { position: absolute; z-index: 2; top: 14px; left: calc(50% + 6px); width: 26px; height: auto; rotate: 14deg; pointer-events: none; }
.rs-here { position: absolute; z-index: 3; top: -2px; left: 50%; translate: -50% 0; white-space: nowrap; font-size: 13px; font-weight: 900; line-height: 1.55; color: #fff; background: var(--ink); border-radius: 999px; padding: 0 8px; }
.rs-here::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.rs-here.is-arrived { animation: qk-arrive .5s ease-out both; }
@keyframes qk-arrive { from { transform: translateY(-14px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.just-cleared .rs-dot { animation: qk-stamp .32s ease-out both; }

@media (max-width: 899px) {
  .road-layout.is-setup .road-main { display: contents; }
  .road-layout.is-setup .road { order: 1; }
  .road-layout.is-setup .road-settings { order: 2; }
  .road-layout.is-setup .stage-card { order: 3; }
}

/* いまのステージ */
.stage-card { padding: 14px 16px 16px; display: grid; gap: 12px; }
.sc-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }
.sc-round { font-size: 30px; font-weight: 900; line-height: 1.2; color: var(--rc, var(--blue)); }
.sc-name { font-size: 17px; font-weight: 900; color: var(--ink-2); }
.sc-faces { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sc-face { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; }
.sc-face .face { width: 54px; height: 54px; border-width: 3px; }
.sc-face.is-me .face { border-color: var(--ink); box-shadow: 0 0 0 4px var(--yellow); }
.sc-face.is-champ .face { box-shadow: 0 0 0 4px var(--purple); }
.sc-face-name { font-size: 15px; font-weight: 900; line-height: 1.3; }
.sc-rule { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 12px; font-size: 19px; font-weight: 900; line-height: 1.45; background: #FFF6D6; border: 2px solid #E9C85A; border-radius: 14px; }
.sc-target { font-size: 30px; line-height: 1.1; color: var(--red); }
.sc-slots { margin-left: auto; font-size: 15px; font-weight: 900; color: var(--ink-2); background: #fff; border: 2px solid #E9C85A; border-radius: 999px; padding: 0 10px; }
.sc-champ { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 900; color: var(--purple); line-height: 1.45; }
.sc-champ .icon { width: 30px; height: 30px; }
.stage-card.is-goal { justify-items: center; text-align: center; padding: 18px 16px; background: var(--gold-bg); }
.goal-crown { width: 72px; height: auto; }
.sc-goal { font-size: 26px; font-weight: 900; color: var(--red); line-height: 1.35; }
.sc-goal-sub { font-size: 18px; font-weight: 900; }

/* 大会の せってい */
.road-settings { padding: 14px 14px 16px; display: grid; gap: 16px; }
.set-h { font-size: 20px; font-weight: 900; line-height: 1.3; }
.seg-field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.seg-legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 6px; font-size: 17px; font-weight: 900; color: var(--ink); }
.seg-legend::before { content: ""; flex: none; width: 7px; height: 22px; border-radius: 4px; background: var(--red); }
.seg-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seg-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg-option {
  --c: var(--blue);
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; min-height: 74px; padding: 8px 10px; text-align: center; line-height: 1.3;
  background: #fff; color: var(--ink); border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 4px 0 var(--line);
  cursor: pointer; transition: transform .08s, box-shadow .08s, background-color .12s;
}
.seg-option:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.seg-label { font-size: 20px; font-weight: 900; word-break: keep-all; overflow-wrap: anywhere; }
.seg-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 6px; font-size: 15px; font-weight: 800; color: var(--muted); }
.seg-option .stars { color: var(--c); font-size: 15px; }
.seg-crown { display: inline-flex; align-items: center; gap: 1px; color: var(--ink); }
.seg-crown .icon { width: 18px; height: 18px; }
/* えらんでいるタイルだけ、右上の角に ✓ のバッジ（文字の場所をとらない） */
.seg-check { display: none; position: absolute; z-index: 2; top: -9px; right: -7px; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink); background: var(--yellow); }
.seg-option:has(.seg-input:checked) { background: var(--c); border-color: var(--ink); color: #fff; box-shadow: 0 4px 0 var(--ink); }
.seg-option:has(.seg-input:checked) .seg-sub, .seg-option:has(.seg-input:checked) .stars, .seg-option:has(.seg-input:checked) .seg-crown { color: #fff; }
.seg-option:has(.seg-input:checked) .seg-check { display: block; }
.seg-option:has(.seg-input:checked) .seg-check::after { content: ""; position: absolute; left: 8px; top: 3px; width: 8px; height: 14px; border: solid var(--ink); border-width: 0 4px 4px 0; transform: rotate(45deg); }
.seg-option:has(.seg-input:focus-visible) { outline: 4px solid var(--yellow); outline-offset: 3px; }
.seg-desc { font-size: 16px; font-weight: 800; line-height: 1.5; color: var(--ink-2); background: var(--soft); border-radius: 12px; padding: 6px 12px; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.seg-desc:empty { display: none; }
/* 大会のとちゅう：えらんだものだけ */
.lock-summary { display: grid; gap: 8px; justify-items: start; padding: 10px 12px; background: var(--soft); border: 2px dashed #9FB1C6; border-radius: 14px; }
.lock-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lock-chips .chip { font-size: 17px; padding: 3px 12px; }
.lock-note { display: flex; align-items: flex-start; gap: 6px; font-size: 15px; font-weight: 800; line-height: 1.5; color: var(--ink-2); }
.lock-note .icon { width: 20px; height: 20px; margin-top: 2px; }
.qk .restart-level { min-height: 56px; font-size: 16px; padding: 4px 16px; }

/* =========================================================
   7. ステージ紹介
   ========================================================= */
.stage-screen { gap: 12px; }
.stage-title { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 2px; }
.st-round { font-size: clamp(42px, 12vw, 66px); }
.stage-screen.is-king .st-round { color: #FFD43B; }
.st-name { font-size: 18px; font-weight: 900; line-height: 1.4; color: #fff; background: var(--rc, var(--blue)); border: 3px solid var(--ink); border-radius: 999px; padding: 2px 16px; box-shadow: 0 4px 0 var(--ink); text-align: center; }
.stage-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* 出場者：クイズ画面と同じ色の台のうしろに立つ */
.lineup { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: clamp(8px, 2vw, 18px); align-items: end; width: min(100%, 680px); margin: 0 auto; padding-top: 4px; }
.lineup-seat { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ls-fig { width: min(100%, 150px); }
.ls-fig .fig { width: 100%; }
.ls-desk { position: relative; z-index: 1; width: 100%; margin-top: -24%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; background: linear-gradient(180deg, var(--seat, #8A8478) 0%, var(--seat-d, #55504A) 100%); border: 3px solid var(--ink); border-radius: 12px 12px 4px 4px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 5px 0 rgba(0, 0, 0, .3); }
.ls-name { max-width: 100%; font-size: 16px; font-weight: 900; line-height: 1.35; color: var(--ink); background: #fff; border-radius: 6px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-style { max-width: 100%; font-size: 13px; font-weight: 900; line-height: 1.3; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lineup-say { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); font-size: 18px; font-weight: 800; line-height: 1.55; }
.lineup-say .face { width: 44px; height: 44px; }
.lineup-say > span { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.stage-goal { align-self: center; display: flex; align-items: flex-start; gap: 10px; max-width: 100%; padding: 8px 16px; font-size: 19px; font-weight: 900; line-height: 1.5; background: #FFF6D6; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); }
.stage-goal > span:last-child { min-width: 0; }
.vs-rules { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 8px; }
.vs-rules li { display: flex; align-items: flex-start; gap: 10px; font-size: 18px; font-weight: 800; line-height: 1.55; }
.vs-rules li > span:last-child { min-width: 0; }
.rule-goal { font-weight: 900; }
.rule-ic { flex: none; width: 30px; height: 30px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 900; line-height: 1; color: #fff; background: var(--yellow-d); border: 2px solid var(--ink); }
.rule-ic.is-buzz { background: radial-gradient(circle at 40% 35%, #FFB3A6 0 22%, var(--red) 24%); }
.rule-ic.is-ng { background: var(--blue); }

/* =========================================================
   8. クイズ（スタジオ）
   上から：HUD → 解答台の列 → 問題モニター → 答え（読みあげ中は大きな早押しボタン）→ 下の段（時間・2択）
   ========================================================= */
.qs { display: flex; flex-direction: column; gap: 10px; }
.hud { display: flex; align-items: center; gap: 8px; }
.hud-sound { display: flex; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 4px 14px; font-weight: 900; font-size: 18px; white-space: nowrap; position: relative; }
.round-pill { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; min-width: 0; overflow: hidden; line-height: 1.25; }
.round-name { font-size: 18px; font-weight: 900; color: var(--rc, var(--red)); }
.round-q { font-size: 18px; font-weight: 800; }
.round-stars { font-size: 14px; letter-spacing: .06em; color: #B8860B; }
.hud-dev { font-size: 13px; font-weight: 800; color: #FFF8E8; border: 1.5px dashed rgba(255, 248, 232, .7); border-radius: 8px; padding: 1px 8px; white-space: nowrap; }
.qs-dev { display: none; margin: 0; text-align: center; font-size: 13px; font-weight: 800; color: rgba(255, 248, 232, .8); }
.studio-sign { display: none; flex: 1; text-align: center; margin: 0; font-weight: 900; font-size: 24px; letter-spacing: .12em; color: #FFE14D;
  text-shadow: 2px 2px 0 #202B32, -2px 2px 0 #202B32, 2px -2px 0 #202B32, -2px -2px 0 #202B32, 0 0 14px rgba(255, 210, 80, .55); }

/* 解答台の列（クイズ番組の席） */
.studio { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(6px, 1.6vw, 18px); align-items: end; width: min(100%, 920px); margin: 0 auto; padding: 6px 0 18px; }
.studio::after { content: ""; position: absolute; z-index: 0; left: -14px; right: -14px; bottom: 0; height: 18px; border-top: 2px solid rgba(255, 255, 255, .18);
  background: radial-gradient(circle, #FFE7A0 0 2.6px, rgba(255, 231, 160, .22) 3.4px, transparent 4.5px) 4px 50% / 18px 18px repeat-x, linear-gradient(#0B2539, #061826); }
.podium { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pd-fig { position: relative; width: min(100%, 150px); aspect-ratio: 1 / .64; overflow: hidden; transition: transform .15s; }
.pd-fig .fig { width: 100%; }
.pd-fig .char { transform-origin: 50% 40%; }
.pd-desk { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 13px 4px 6px; background: linear-gradient(180deg, var(--seat, #8A8478) 0%, var(--seat-d, #55504A) 100%); border: 3px solid var(--ink); border-radius: 12px 12px 4px 4px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), 0 6px 0 rgba(0, 0, 0, .35); }
.pd-name { max-width: 100%; font-size: clamp(15px, 1.7vw, 20px); font-weight: 900; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); background: #fff; border-radius: 6px; padding: 0 6px; }
.pd-score { display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; padding: 1px 6px; background: #14181C; border: 2px solid rgba(0, 0, 0, .55); border-radius: 6px; }
.pd-num { color: #FFD84A; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.05; text-shadow: 0 0 6px rgba(255, 200, 60, .55); }
.pd-pips { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 64px; }
.pd-pips i { width: 8px; height: 8px; border-radius: 50%; background: #3A4148; }
.pd-pips i.on { background: #FFD84A; box-shadow: 0 0 4px rgba(255, 216, 74, .8); }
.pd-badge { position: absolute; left: 50%; bottom: calc(100% - 4px); translate: -50% 0; z-index: 2; font-size: 12px; font-weight: 900; line-height: 1.4; padding: 0 6px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.pd-badge:empty { display: none; }
/* 早押しランプ（台の上の丸いランプ） */
.pd-lamp { position: absolute; top: -14px; left: 50%; translate: -50% 0; z-index: 2; width: 32px; height: 16px; border-radius: 16px 16px 3px 3px; background: radial-gradient(circle at 50% 85%, #9B9487, #5E594F); border: 2px solid var(--ink); }
.podium.is-buzz .pd-desk { border-color: #FFD84A; }
.podium.is-buzz .pd-fig { transform: translateY(-4px); }
.podium.is-buzz .pd-fig::before { content: ""; position: absolute; inset: -20% -10% 0; background: radial-gradient(closest-side, rgba(255, 220, 120, .55), transparent 75%); }
.podium.is-buzz .pd-lamp { background: radial-gradient(circle at 50% 75%, #FFF6C4 0 16%, #FF5A3C 48%, #C3200A 100%); box-shadow: 0 0 14px 5px rgba(255, 90, 60, .9), 0 0 34px 12px rgba(255, 190, 80, .45); }
.pd-lamp.lamp-pop { animation: qk-lamp .38s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes qk-lamp { 0% { transform: scale(.6) translateY(5px); } 60% { transform: scale(1.4) translateY(-3px); } 100% { transform: none; } }
.podium.is-reach .pd-badge { background: var(--yellow); color: var(--ink); }
.podium.is-locked .pd-fig { opacity: .45; }
.podium.is-locked .pd-badge { background: var(--ink); color: #fff; }
.podium.is-locked .pd-lamp { background: #3D3A35; }
.podium.is-locked .pd-desk { filter: saturate(.35) brightness(.8); }
.podium.is-through .pd-desk { --seat: #44BE7C; --seat-d: #1E7A4C; }
.podium.is-through .pd-badge { background: var(--green); color: #fff; }
.podium.bump .pd-pips { animation: qk-bump .32s ease-out; }
@keyframes qk-bump { 50% { scale: 1.08; } }
.float-pts { position: absolute; z-index: 7; top: -4%; left: 50%; translate: -50% 0; font-size: 24px; font-weight: 900; color: #FFE14D; pointer-events: none; animation: qk-float 1s ease-out forwards;
  text-shadow: 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 3px 0 var(--ink); }
@keyframes qk-float { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-30px); } }
.pd-bubble { position: absolute; top: -6px; left: 50%; translate: -50% 0; z-index: 4; width: max-content; max-width: 160%; font-size: 15px; padding: 2px 10px; }
.pd-bubble.is-line { display: none; }
/* ピコーン！（マンガの効果音のような文字） */
.pd-burst { position: absolute; top: 4%; left: 50%; translate: -50% 0; rotate: -8deg; z-index: 6; font-weight: 900; font-size: clamp(16px, 1.9vw, 26px); line-height: 1; letter-spacing: .02em; color: #FFE14D; white-space: nowrap; pointer-events: none;
  text-shadow: 2px 2px 0 #202B32, -2px 2px 0 #202B32, 2px -2px 0 #202B32, -2px -2px 0 #202B32, 0 3px 0 #202B32, 3px 0 0 #202B32, -3px 0 0 #202B32, 0 -3px 0 #202B32, 0 6px 0 rgba(0, 0, 0, .35); }
.pd-burst.burst-in { animation: qk-burst .42s cubic-bezier(.2, .9, .3, 1.5) both; }
@keyframes qk-burst { 0% { opacity: 0; scale: .3; } 70% { opacity: 1; scale: 1.25; } 100% { scale: 1; } }

/* 問題モニター */
.hy-stage { position: relative; }
.q-panel { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 0; min-height: 118px; padding: 22px clamp(14px, 2.4vw, 30px) 14px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
.qk .question { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; line-height: 1.6; overflow-wrap: anywhere; text-wrap: pretty; }
/* 文の さいごの行が1〜2文字だけに ならないように（対応しているブラウザだけ） */
.fb-explain p, .fb-answer, .rv-q, .rv-exp, .cert-body, .encourage, .lineup-say > span, .host-strip > span, .seg-desc, .vs-rules li > span:last-child { text-wrap: pretty; }
.qtext .u { visibility: hidden; }
.qtext .u.on { visibility: visible; }
.buzz-banner { position: absolute; top: -23px; left: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 1px 14px 1px 2px; background: var(--red); color: #fff; border: 2px solid var(--ink); border-radius: 999px; font-weight: 900; font-size: 17px; }
.buzz-banner .face { width: 28px; height: 28px; }
/* テロップ（第N問・勝ち抜け） */
.caption { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 5; width: min(780px, 96%); pointer-events: none; word-break: keep-all; overflow-wrap: anywhere; }
.caption-inner { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 26px; border: 4px solid var(--ink); border-radius: 20px; text-align: center; box-shadow: 0 6px 0 rgba(0, 0, 0, .3); }
.cap-text { min-width: 0; }
.cap-main { font-size: clamp(38px, 5.4vw, 68px); font-weight: 900; line-height: 1.3; letter-spacing: .06em; }
.cap-sub { font-size: clamp(18px, 2vw, 25px); font-weight: 800; line-height: 1.6; margin-top: 2px; }
.cap-stars { margin: 2px 0 0; font-size: clamp(18px, 2vw, 24px); font-weight: 900; letter-spacing: .1em; color: #8A5A00; }
.cap-stars.is-maniac { color: var(--lv-maniac); letter-spacing: .04em; }
.cap-yellow .caption-inner { background: var(--yellow); }
.cap-red .caption-inner { background: var(--red); color: #fff; }
.cap-red .cap-stars { color: #FFE27A; }
.cap-ink .caption-inner { background: var(--ink); color: #fff; }
.caption .face { width: 70px; height: 70px; }
.caption.cap-in { animation: qk-cap .36s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes qk-cap { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
/* ○ ✕（テレビの「ピンポーン」「ブブー」） */
.judge-mark { position: absolute; left: 50%; top: 50%; z-index: 7; width: min(40vw, 190px); aspect-ratio: 1; translate: -50% -50%; pointer-events: none; animation: qk-mark 1s ease-out both; }
.judge-mark.is-ok { border-radius: 50%; border: clamp(16px, 3.2vw, 26px) solid #E0301E; box-shadow: 0 0 0 4px #fff, inset 0 0 0 4px #fff; }
.judge-mark.is-ng::before, .judge-mark.is-ng::after { content: ""; position: absolute; left: 50%; top: 50%; width: 112%; height: clamp(18px, 3.6vw, 28px); background: #1E5FA8; border-radius: 8px; box-shadow: 0 0 0 4px #fff; translate: -50% -50%; rotate: 45deg; }
.judge-mark.is-ng::after { rotate: -45deg; }
@keyframes qk-mark { 0% { opacity: 0; scale: .4; } 22% { opacity: 1; scale: 1.1; } 38% { scale: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }

/* 答えの場所：読みあげ中は大きな早押しボタン、押されたら答え、きまったら解説 */
.play { display: flex; flex-direction: column; gap: 8px; }
.slot { position: relative; }
.qs .answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.answers.is-hidden { visibility: hidden; }
.play[data-phase="done"] .answers { display: none; }
.play.is-answering .answer:not(:disabled) { border-color: var(--ink); box-shadow: 0 0 0 4px var(--yellow), 0 4px 0 rgba(0, 0, 0, .3); }
.qk .answer { position: relative; justify-content: flex-start; gap: 10px; min-height: 76px; padding: 8px 12px; font-size: clamp(19px, 1.9vw, 24px); font-weight: 800; line-height: 1.45; text-align: left; overflow-wrap: anywhere; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); transition: opacity .2s, background-color .2s; }
@media (hover: hover) { .qk .answer:hover:not(:disabled) { background: #FFFBEA; } }
.qk .answer .badge { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 900; line-height: 1; border: 2px solid var(--ink); }
.qk .badge-0 { background: var(--red); }
.qk .badge-1 { background: var(--blue); }
.qk .badge-2 { background: var(--green); }
.qk .answer-text { flex: 1; min-width: 0; }
.qk .answer.is-correct { border-color: var(--green); background: #E3F5EA; box-shadow: 0 0 0 3px var(--green-l), 0 4px 0 rgba(0, 0, 0, .3); }
.qk .answer.is-wrong { border-color: var(--red); background: #FDE8E4; }
.qk .answer.is-picked { background: var(--gold-bg); box-shadow: inset 0 0 0 3px var(--yellow); }
.qk .answer.is-dim { opacity: .6 !important; }
.qk .answer.is-removed { opacity: .45; border-style: dashed; }
.qk .answer.is-removed .answer-text { text-decoration: line-through; text-decoration-thickness: 3px; }
.answer-tags { position: absolute; top: -15px; right: 10px; display: flex; gap: 6px; pointer-events: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; font-size: 16px; font-weight: 900; line-height: 1.2; white-space: nowrap; animation: qk-pop .22s ease-out; }
.tag-ok { background: var(--green); color: #fff; }
.tag-you { background: var(--ink); color: #fff; }
.tag-cpu .face { width: 22px; height: 22px; border-width: 1px; }
.tag-removed { color: var(--muted); border-style: dashed; }
.stamp { position: absolute; left: 8px; top: 50%; width: 64px; height: 64px; margin-top: -32px; padding: 4px; border-radius: 50%; background: #fff; border: 3px solid currentColor; pointer-events: none; animation: qk-stamp .24s ease-out both; }
.stamp-correct { color: var(--green); }
.stamp-incorrect { color: var(--red); }
.stamp .icon { width: 100%; height: 100%; }
@keyframes qk-stamp { from { opacity: 0; scale: 1.8; } to { opacity: 1; scale: 1; } }
.slot > .buzzer { position: absolute; inset: 0 0 auto 0; z-index: 3; width: 100%; height: min(100%, 176px); min-height: 0; border-radius: 22px; }
.qs .buzzer { display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 0 18px; background: var(--red); color: #fff; border: 4px solid var(--ink); font-weight: 900; font-size: clamp(30px, 3.4vw, 40px); letter-spacing: .06em; box-shadow: 0 7px 0 var(--ink); }
.qs .buzzer:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.qs .buzzer:disabled { opacity: 1; background: #9C968A; color: rgba(255, 255, 255, .9); box-shadow: 0 7px 0 rgba(0, 0, 0, .35); }
.buzzer-cap { flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, rgba(255, 255, 255, .55) 19% 40%, rgba(255, 255, 255, .25) 41%); border: 3px solid rgba(0, 0, 0, .25); }
.buzzer-label { line-height: 1.3; }
/* 文字が大きい端末では、時間と早押しボタンを2段に（時間の文字が かくれないように） */
.play-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 56px; }
.play-foot > .buzzer { flex: 1 0 auto; }
/* 時間の文字の幅より せまくしない（せまいときは 2択ボタンが 次の行へ） */
.play-foot > .timer { flex: 999 0 auto; min-width: 0; }
.play[data-phase="done"] .play-foot { display: none; }
.play-foot .buzzer { min-height: 56px; border-radius: 999px; font-size: 22px; padding: 0 22px; gap: 8px; box-shadow: 0 5px 0 var(--ink); }
.play-foot .buzzer .buzzer-cap { width: 1.3em; height: 1.3em; }
.timer { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.timer-track { flex: 1; height: 16px; background: #E6EBF1; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--yellow); transform-origin: left center; }
.timer-label { font-size: 19px; font-weight: 900; min-width: 0; text-align: right; background: #fff; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.timer.is-low .timer-fill { background: var(--red); }
.timer.is-low .timer-label { color: var(--red); }
.timer.is-answer .timer-fill { background: var(--blue); }
.timer.is-answer .timer-label { color: var(--blue); }
.qs .buzz-hint { flex: 1; min-width: 0; margin: 0; color: #fff; font-size: 17px; font-weight: 800; text-align: center; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); word-break: keep-all; overflow-wrap: anywhere; }
.qs .buzz-hint:empty { display: none; }
.qs .timer:not([hidden]) ~ .buzz-hint { display: none; }
.qk .help { border-radius: 999px; gap: 8px; }
.qs .help-remove { min-height: 56px; padding: 4px 16px 4px 6px; font-size: 18px; white-space: nowrap; background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.qs .help-remove .help-icon { background: var(--gold-bg); }
.help-icon { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.help-icon .icon { width: 28px; height: 28px; }
.help-left { font-size: 15px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .55); }
/* 解説（答えの場所に出す） */
.feedback { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 16px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); animation: qk-enter .22s ease-out; scroll-margin-bottom: 16px; }
@keyframes qk-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.feedback.is-ok { border-color: var(--green); }
.feedback.is-ng { border-color: var(--red); }
.feedback.is-other { border-color: var(--ink); }
.fb-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.fb-head { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.fb-head h3 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 900; display: flex; align-items: center; gap: 8px; word-break: keep-all; overflow-wrap: anywhere; }
.fb-head h3 > span { min-width: 0; }
.fb-head h3 .face { width: 38px; height: 38px; }
.is-ok .fb-head h3 { color: var(--green); }
.is-ng .fb-head h3 { color: var(--red); }
.fb-points { font-size: 22px; font-weight: 900; }
.fb-maniac { margin: 0; font-size: 18px; font-weight: 900; color: #fff; background: var(--lv-maniac); border-radius: 999px; padding: 0 12px; align-self: flex-start; }
.fb-answer { font-size: 19px; font-weight: 700; }
.fb-explain { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.fb-explain .face { width: 40px; height: 40px; }
.fb-explain p { flex: 1 1 auto; min-width: 0; font-size: 18px; line-height: 1.65; font-weight: 600; }
.qk .next-btn { min-width: 220px; min-height: 64px; font-size: 22px; }

/* =========================================================
   9. 順位発表
   ========================================================= */
.result-screen { gap: 12px; }
.result-round { align-self: center; font-size: 17px; font-weight: 900; line-height: 1.4; color: #fff; background: var(--rc, var(--blue)); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 14px; text-align: center; }
.result-h { align-self: center; font-size: clamp(46px, 13vw, 80px); }
.result-h.is-win { color: var(--red); }
.result-h.is-lose { color: #fff; }
.result-reason { align-self: center; max-width: 100%; text-align: center; font-size: 19px; font-weight: 900; line-height: 1.55; background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 4px 16px; box-shadow: 0 4px 0 var(--ink); }
.result-card { width: min(640px, 100%); align-self: center; padding: 10px 12px 14px; display: grid; gap: 12px; }
.score-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.score-table td, .score-table th { padding: 6px 8px; background: var(--soft); vertical-align: middle; text-align: left; }
.score-table tr > :first-child { border-radius: 14px 0 0 14px; width: 1%; white-space: nowrap; padding-left: 10px; }
.score-table tr > :last-child { border-radius: 0 14px 14px 0; width: 1%; white-space: nowrap; text-align: right; padding-right: 12px; }
.score-table tr.is-me > * { background: var(--gold-bg); }
.score-table tr.is-out .who-name { color: var(--ink-2); }
.rank-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 17px; font-weight: 900; line-height: 1; border: 2px solid var(--ink); background: #fff; }
.rank-badge.r1 { background: var(--yellow); }
.rank-badge.r2 { background: #D8DEE6; }
.rank-badge.r3 { background: #EBB582; }
.rank-i { font-size: 14px; font-weight: 900; margin-left: 2px; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 900; }
.who .face { width: 38px; height: 38px; }
.who-text { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.who-name { font-size: 18px; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.who .chip { font-size: 14px; padding: 1px 8px; }
.pts { font-size: 26px; font-weight: 900; line-height: 1; }
.pts-u { font-size: 13px; font-weight: 900; margin-left: 2px; color: var(--ink-2); }
.card-get { display: grid; gap: 8px; padding: 10px 12px; border: 2px dashed var(--yellow-d); border-radius: 14px; background: #FFF8DC; }
.card-get-h { font-weight: 900; font-size: 19px; color: var(--red); }
.card-get-list { display: flex; flex-wrap: wrap; gap: 10px; }
.rival-card-mini { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; font-weight: 900; font-size: 15px; line-height: 1.5; rotate: -4deg; animation: qk-flip .6s ease-out both; }
.rival-card-mini .face-xl { width: 60px; height: 60px; }
@keyframes qk-flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
.next-rival { display: grid; gap: 6px; padding-top: 10px; border-top: 2px dashed var(--line); }
.next-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-weight: 900; font-size: 18px; }
.next-stage { font-size: 16px; font-weight: 800; color: var(--ink-2); }
.next-faces { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 900; }
.next-face { display: inline-flex; align-items: center; gap: 6px; }
.next-face .face { width: 34px; height: 34px; }
.encourage { font-weight: 800; line-height: 1.7; }
.result-card > .review-btn { justify-self: center; width: min(100%, 360px); }

/* =========================================================
   10. 戴冠式・認定証
   ========================================================= */
.crown-screen { align-items: stretch; }
.crown-screen > .host-strip, .crown-screen > .crown-h, .crown-screen > .crown-note { align-self: center; position: relative; z-index: 3; }
.crown-stage { position: relative; flex: 1; width: min(760px, 100%); margin: 0 auto; min-height: 230px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); align-items: end; }
.crown-hero { grid-column: 2; justify-self: center; width: min(290px, 56vw, 36vh); position: relative; z-index: 2; }
.crown-old { grid-column: 3; justify-self: start; max-width: 100%; width: min(190px, 28vw, 27vh); position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.crown-old .bubble { font-size: 16px; }
.rays { position: absolute; left: 50%; bottom: 6%; width: min(620px, 100%); aspect-ratio: 1; translate: -50% 0; z-index: 1; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 255, 255, .7) 0 9deg, transparent 9deg 22deg); -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 68%); mask-image: radial-gradient(circle, #000 30%, transparent 68%); animation: qk-spin 32s linear infinite; }
@keyframes qk-spin { to { rotate: 360deg; } }
.flying-crown { position: absolute; z-index: 4; height: auto; rotate: -8deg; pointer-events: none; }
.flying-crown.is-flying { transition: left 1.1s cubic-bezier(.45, -0.3, .35, 1.05), top 1.1s cubic-bezier(.3, -0.7, .5, 1.15); }
.crown-h { font-size: clamp(30px, 8vw, 60px); color: var(--red); opacity: 0; scale: .7; transition: opacity .3s, scale .38s cubic-bezier(.2, .9, .3, 1.3); }
.crown-h.is-shown { opacity: 1; scale: 1; }
.crown-note { align-self: center; max-width: 100%; padding: 10px 18px; text-align: center; font-size: 19px; font-weight: 900; line-height: 1.7; }
.crown-note b { color: var(--red); font-size: 1.2em; }

.cert-screen { gap: 12px; }
.cert-layout { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cert { position: relative; display: grid; gap: 10px; padding: 32px 24px 24px; text-align: center; background: #FFFDF5; border: 3px solid var(--ink); border-radius: 10px; outline: 6px solid var(--yellow); outline-offset: -16px; box-shadow: 0 6px 0 var(--ink); }
.cert-crown { width: 72px; height: auto; margin: -6px auto 0; }
.cert-title { font-size: clamp(26px, 7vw, 40px); font-weight: 900; letter-spacing: .12em; line-height: 1.35; color: var(--red); word-break: keep-all; overflow-wrap: anywhere; }
.cert-level { font-weight: 900; font-size: 18px; color: var(--c, var(--ink-2)); }
.cert-level .stars { color: #B8860B; }
.cert-name { width: fit-content; max-width: 100%; margin: 0 auto; padding: 0 18px; font-size: clamp(24px, 6.4vw, 32px); font-weight: 900; border-bottom: 2px solid var(--ink); overflow-wrap: anywhere; }
.cert-body { text-align: left; font-size: 18px; line-height: 1.9; font-weight: 700; }
.cert-score { font-weight: 900; }
.cert-date { font-weight: 900; }
.cert-rivals { display: flex; justify-content: center; gap: 8px; }
.cert-rivals .face { width: 44px; height: 44px; }
.cert-sign { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-weight: 900; }
.cert-sign .face { width: 44px; height: 44px; }
.cert-side { padding: 14px; display: grid; gap: 10px; justify-items: center; text-align: center; min-width: 0; }
.cert-input { width: 100%; display: grid; gap: 6px; font-weight: 900; }
.cert-input input { font: inherit; font-size: 20px; font-weight: 700; min-height: 56px; width: 100%; min-width: 0; padding: 8px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; }
.cert-input input:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }

/* =========================================================
   11. ふりかえり・エラー・ひと休み・通知・紙吹雪
   ========================================================= */
.review-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.review-item { min-width: 0; padding: 12px 16px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.rv-num { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 900; }
.rv-no { color: #fff; background: var(--ink); border-radius: 999px; padding: 0 12px; }
.rv-num .stars { color: #B8860B; }
.rv-q { font-size: 21px; font-weight: 900; line-height: 1.7; min-width: 0; }
.rv-correct { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 19px; font-weight: 700; }
.rv-ans-label { font-size: 15px; font-weight: 900; color: #fff; background: var(--green); border-radius: 999px; padding: 0 10px; }
.rv-events { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 700; }
.rv-ev { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; border: 2px solid var(--ink); border-radius: 999px; font-size: 16px; font-weight: 900; }
.rv-ev .face { width: 26px; height: 26px; }
.rv-ev { padding-right: 4px; }
.rv-ev-mark { margin-left: 2px; padding: 0 8px; border-radius: 999px; color: #fff; font-size: 14px; }
.rv-ev.is-ok { border-color: var(--green); }
.rv-ev.is-ok .rv-ev-mark { background: var(--green); }
.rv-ev.is-ng { border-color: var(--red); }
.rv-ev.is-ng .rv-ev-mark { background: var(--red); }
.rv-none { font-size: 16px; color: var(--muted); }
.rv-exp { line-height: 1.75; }
.rv-source { font-size: 16px; color: var(--muted); overflow-wrap: anywhere; border-top: 2px dashed var(--paper-2); padding-top: 6px; }
.error-card { align-self: center; max-width: 640px; padding: 24px; display: grid; gap: 14px; text-align: center; }
.error-h { font-size: 28px; font-weight: 900; }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(14, 35, 60, .72); }
.dialog { width: min(440px, 100%); display: grid; gap: 14px; padding: 26px 22px 22px; text-align: center; background: #fff; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); }
.dialog-ic { width: 60px; height: 60px; margin: -4px auto 0; padding: 12px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); }
.dialog h2 { font-size: 28px; font-weight: 900; }
.dialog p { font-weight: 800; }
.toast-root { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(560px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 18px; font-weight: 800; text-align: center; }
/* 紙吹雪：画面の部品より うしろ（z-index 0。背景よりは前） */
.confetti { position: fixed; top: -24px; z-index: 0; pointer-events: none; border-radius: 2px; animation: qk-fall 1.6s cubic-bezier(.25, .6, .45, 1) both; }
@keyframes qk-fall { to { transform: translate(var(--dx), 112vh) rotate(var(--rot)); } }

/* =========================================================
   12. 画面サイズ別
   ========================================================= */
/* PC・タブレット横：勝ち上がり表は 2段組 */
@media (min-width: 900px) {
  .road-screen { max-width: 1080px; }
  .road-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 18px; }
  .cert-screen { max-width: 1000px; }
  .cert-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); align-items: start; gap: 20px; }
  .studio-sign { display: block; }
  .qs .hud-sound { margin-left: 0; }
  .pd-bubble.is-line { display: block; }
}
@media (min-width: 641px) {
  .qk .icon-btn .icon-label { display: inline; }
}
@media (min-width: 901px) and (min-height: 640px) {
  .studio { width: min(100%, 1040px); }
  .pd-fig { width: min(100%, 196px); }
  .pd-desk { padding: 11px 6px 8px; }
  .q-panel { min-height: 150px; }
  .qs .question { font-size: clamp(28px, 2.7vw, 38px); }
  .qk .answer { min-height: 92px; }
  .slot { min-height: 112px; }
  .slot > .buzzer { left: 50%; right: auto; width: min(100%, 620px); height: min(100%, 150px); translate: -50% 0; }
}

/* スマホ（縦・〜640px） */
@media (max-width: 640px) {
  .app { --pad-r: max(12px, env(safe-area-inset-right)); --pad-l: max(12px, env(safe-area-inset-left)); }
  .screen { gap: 12px; }
  .qk .icon-btn { width: 56px; padding: 0; }
  .qk .icon-btn .icon-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .qk button.big { padding-left: 18px; padding-right: 18px; }
  .title-main { gap: 12px; }
  .title-actions .start-btn { font-size: 22px; min-height: 74px; }
  .crown-slot { padding: 6px 2px 4px; }
  .stage-card { padding: 12px 12px 14px; gap: 10px; }
  .sc-round { font-size: 28px; }
  .sc-rule { padding: 6px 10px; }
  .road-settings { padding: 12px 12px 14px; gap: 14px; }
  .seg-option { min-height: 70px; }
  .lineup { gap: 6px; width: min(100%, 330px); }
  .stage-chips .chip { font-size: 14px; padding: 1px 10px; }
  .st-round { font-size: 42px; }
  .ls-name { font-size: 15px; padding: 0 4px; }
  .ls-desk { padding: 6px 2px 5px; border-width: 2px; }
  .vs-rules { padding: 10px 12px; }
  .result-card { padding: 8px 8px 12px; }
  .score-table td, .score-table th { padding: 6px 6px; }
  .who .face { width: 34px; height: 34px; }
  .cert { padding: 24px 16px 18px; gap: 6px; outline-offset: -12px; }
  .cert-crown { width: 56px; }
  .cert-body { line-height: 1.7; }
  .cert-rivals .face, .cert-sign .face { width: 36px; height: 36px; }
  .crown-old .bubble { display: none; }
  .crown-stage { grid-template-columns: minmax(0, .2fr) minmax(0, 2fr) minmax(0, 1fr); }
  .logo { max-height: 29vh; }
  .title-goal { font-size: 17px; padding: 4px 14px; }

  /* クイズ */
  .qs { gap: 8px; }
  .qs .round-pill { padding: 2px 12px; gap: 6px; }
  .qs .round-name, .qs .round-q { font-size: 17px; }
  .round-stars { font-size: 14px; }
  .hud-dev { display: none; }
  .qs-dev { display: block; }
  .studio { gap: 6px; padding: 2px 0 10px; }
  .studio::after { height: 10px; left: -10px; right: -10px; background-size: 14px 10px, auto; }
  .pd-desk { padding: 10px 2px 3px; gap: 3px; border-width: 2px; border-radius: 8px 8px 5px 5px; }
  .pd-lamp { top: -11px; width: 26px; height: 13px; }
  .pd-name { font-size: 14px; line-height: 1.25; }
  .pd-num { font-size: 18px; }
  .pd-score { padding: 0 5px; }
  .pd-pips i { width: 7px; height: 7px; }
  .pd-badge { font-size: 12px; }
  .pd-burst { font-size: 15px; top: 2%; }
  .pd-bubble { font-size: 14px; padding: 1px 8px; top: -4px; }
  .pd-bubble::after { display: none; }
  .q-panel { min-height: 96px; padding: 20px 12px 10px; }
  .qs .question { font-size: 24px; line-height: 1.55; }
  .cap-main { font-size: 40px; }
  .caption-inner { padding: 12px 14px; gap: 10px; }
  .caption .face { width: 52px; height: 52px; }
  .qs .answers { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .qk .answer { min-height: 56px; padding: 6px 10px; font-size: 19px; line-height: 1.35; }
  .qk .answer .badge { width: 38px; height: 38px; font-size: 21px; }
  .answer-tags { top: -12px; }
  .tag { font-size: 14px; padding: 1px 8px; }
  .stamp { width: 48px; height: 48px; margin-top: -24px; left: 6px; }
  .slot > .buzzer { height: min(100%, 144px); }
  .pd-fig { aspect-ratio: 1 / .6; }
  .qs .buzzer { font-size: 34px; }
  .play-foot .buzzer { font-size: 20px; padding: 0 16px; }
  .qs .help-remove { font-size: 17px; padding: 4px 12px 4px 4px; }
  .qs .help-remove .help-left { display: none; }
  .timer-label { font-size: 17px; }
  .feedback { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; gap: 8px; }
  .fb-head h3 { font-size: 22px; }
  .fb-head h3 .face { width: 32px; height: 32px; }
  .fb-answer { font-size: 18px; }
  .fb-actions .next-btn { width: 100%; min-height: 60px; font-size: 22px; }
}
/* 低いスマホ：タイトルのキャラ（記録のカードにかくれてしまう）と、ステージ紹介の司会者の帯は省く */

@media (max-width: 640px) and (max-height: 759px) {
  .stage-screen .host-strip { display: none; }
}
/* 横向きスマホ */
@media (orientation: landscape) and (max-height: 620px) {
  .app { --pad-t: max(8px, env(safe-area-inset-top)); --pad-b: max(8px, env(safe-area-inset-bottom)); }
  .screen { gap: 8px; }
  .qk .icon-btn .icon-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .qk .icon-btn { width: 56px; padding: 0; }
  .logo { max-height: 30vh; }
  .tc { width: clamp(110px, 15vw, 180px); }
  .road-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .stage-screen .host-strip { display: none; }
  .lineup { width: min(100%, 560px); }
  .ls-fig { width: min(100%, 110px); }
  .crown-stage { min-height: 200px; }
  .action-bar { padding-top: 12px; }
  /* クイズ：左に問題と答え、右に解答台（2×2） */
  .qs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 24%); grid-template-areas: "hud hud" "stage studio" "play studio" "dev dev"; align-content: start; gap: 8px 12px; }
  .qs .qs-dev { grid-area: dev; }
  .qs .hud { grid-area: hud; }
  .qs .hy-stage { grid-area: stage; }
  .qs .play { grid-area: play; }
  .qs .studio { grid-area: studio; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 6px; width: 100%; padding-top: 0; }
  .qs .pd-fig { width: min(100%, 92px); }
  .q-panel { min-height: 84px; padding: 20px 14px 8px; }
  .qs .question { font-size: 24px; line-height: 1.5; }
  .qk .answer { min-height: 56px; padding: 4px 8px; gap: 8px; font-size: 19px; }
  .qk .answer .badge { width: 36px; height: 36px; font-size: 20px; }
  .qs .buzzer { font-size: 30px; }
  .qs .next-btn { min-width: 0; min-height: 56px; font-size: 20px; padding: 6px 18px; }
}

/* ステージ紹介：横に広く 高さの低い画面（PC・横向きスマホ）は 2段組（出場者｜ルール）にして、ルールを1画面に入れる */
@media (min-width: 900px) and (max-height: 820px), (orientation: landscape) and (max-height: 620px) {
  .stage-screen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto auto auto auto 1fr auto;
    grid-template-areas: "top top" "title title" "chips chips" "goal goal" "host host" "lineup say" "lineup rules" ". ." "bar bar"; align-content: stretch; column-gap: 18px; row-gap: 10px; }
  .stage-screen > .stage-goal { grid-area: goal; }
  .stage-screen > .topbar { grid-area: top; }
  .stage-screen > .stage-title { grid-area: title; }
  .stage-screen > .stage-chips { grid-area: chips; }
  .stage-screen > .host-strip { grid-area: host; }
  .stage-screen > .lineup { grid-area: lineup; align-self: start; width: 100%; }
  .stage-screen > .lineup-say { grid-area: say; align-self: start; }
  .stage-screen > .vs-rules { grid-area: rules; align-self: start; }
  .stage-screen > .action-bar { grid-area: bar; }
  .stage-screen .ls-fig { width: min(100%, 130px); }
  .stage-title { flex-direction: row; justify-content: center; align-items: center; gap: 14px; }
  .st-round { font-size: 48px; }
}
@media (min-width: 900px) and (max-height: 820px) {
  .crown-hero { width: min(250px, 30vh); }
  .crown-old { width: min(170px, 22vh); }
}
/* 横向きスマホ：下の帯を うすく、見出しを小さく */
@media (orientation: landscape) and (max-height: 620px) {
  .action-bar { padding-top: 12px; padding-bottom: calc(var(--pad-b) + 2px); }
  .action-bar .qk button.big, .action-inner > button.big { min-height: 56px; font-size: 20px; }
  .ribbon { font-size: 20px; margin: 0 0 4px; padding: 3px 18px 4px; }
  .st-round { font-size: 36px; }
  .result-h { font-size: 44px; }
  .crown-h { font-size: 32px; }
  .crown-stage { min-height: 150px; }
  .crown-hero { width: min(170px, 34vh); }
  .crown-old { width: min(120px, 24vh); }
  .crown-old .bubble { display: none; }
}

/* 日本語を「ことばの まとまり」で折り返す（Chrome 119 以降・lang="ja"）。ほかのブラウザは 上の keep-all／ふつうの折り返し */
@supports (word-break: auto-phrase) {
  .qk, .qk *, .qk .menu-screen .rv-q, .qk .menu-screen .rv-exp, .qk .menu-screen .rv-correct, .qk .menu-screen .rv-source { word-break: auto-phrase; }
}

/* =========================================================
   13. 動きを減らす設定
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .bob, .char.react-happy, .char.react-sad, .feedback, .stamp, .podium.bump .pd-pips, .float-pts, .tag, .pop, .bubble.pop, .caption.cap-in,
  .rays, .rs-here.is-arrived, .just-cleared .rs-dot, .rival-card-mini, .judge-mark, .pd-burst.burst-in, .pd-lamp.lamp-pop { animation: none !important; }
  .crown-h, .pd-fig, .qk .primary, .qk .secondary, .seg-option { transition: none; }
}
