/*
 * 学科クイズゲーム — 見た目（第3弾で全面的に作り直し）。
 * スマホの縦画面が基本。iPad（横幅 820px 以上）では2列にする。
 * 色はすべて下の「色の決まり」（:root の変数）から使う。暗い画面（ダークモード）は同じ変数を入れ替えるだけ。
 * KDS のオレンジ（教習車の色）と紺が軸。○は青、×は赤（試験の答案と同じ）。
 */

/* ===== 色と形の決まり ===== */
:root {
  color-scheme: light;
  --brand: #f26a2e;
  --brand-2: #ff8a3d;
  --brand-ink: #c4481a;
  --brand-soft: #ffeadf;
  --navy: #172a4f;
  --navy-2: #24407a;
  --bg: #f7f3ee;
  --bg-2: #fdebdc;
  --surface: #ffffff;
  --surface-2: #f6f1eb;
  --surface-3: #ece5dc;
  --ink: #14223f;
  --text: #1c2333;
  --text-2: #5c6577;
  --text-3: #8b92a1;
  --line: #e8dfd5;
  --line-2: #d9cfc3;
  --maru: #2f7cf6;
  --maru-d: #1d58c0;
  --maru-soft: #e4eeff;
  --batsu: #ef4b4b;
  --batsu-d: #b92f2f;
  --batsu-soft: #fde4e4;
  --ok: #16a35a;
  --ok-d: #0f7a41;
  --ok-soft: #dcf5e7;
  --ng: #e0393e;
  --gold: #ffc23a;
  --gold-d: #c98a0a;
  --gold-soft: #fff3cf;
  --purple: #7c5cf0;
  --purple-soft: #eee8ff;
  --boss-1: #2b1840;
  --boss-2: #43206a;
  --bar-1: #172a4f;
  --bar-2: #1f3766;
  --road: #59627a;
  --road-edge: #c9ced8;
  --scrim: rgba(10, 20, 40, .55);
  --shadow-1: 0 1px 2px rgba(20, 34, 63, .06), 0 2px 8px rgba(20, 34, 63, .06);
  --shadow-2: 0 2px 4px rgba(20, 34, 63, .06), 0 10px 28px rgba(20, 34, 63, .10);
  --shadow-3: 0 6px 16px rgba(20, 34, 63, .12), 0 24px 48px rgba(20, 34, 63, .14);
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 24px;
  --r-xl: 30px;
  --round: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "M PLUS Rounded 1c", "Yu Gothic UI", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  /* 絵（ホームの景色）の色 */
  --sky-1: #8fd0ff;
  --sky-2: #fff1df;
  --hill-1: #9fdc8f;
  --hill-2: #6cc47a;
  --hill-3: #4fae6a;
  --sun: #ffd25a;
  --cloud: #ffffff;
  --town: #c8d7ea;
  --star: transparent;
}

/* 暗い画面（端末の設定に合わせる・または設定で選ぶ） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand-soft: #3a2216;
    --bg: #0b1222;
    --bg-2: #101a31;
    --surface: #141d33;
    --surface-2: #1a2540;
    --surface-3: #22304f;
    --ink: #eef2fb;
    --text: #e2e7f2;
    --text-2: #a3adc3;
    --text-3: #77829b;
    --line: #253150;
    --line-2: #2f3c5e;
    --maru-soft: #16274a;
    --batsu-soft: #3a1a1e;
    --ok-soft: #12321f;
    --gold-soft: #3a2f12;
    --purple-soft: #261d48;
    --bar-1: #0d1730;
    --bar-2: #12204a;
    --road: #3a4560;
    --road-edge: #56627f;
    --scrim: rgba(0, 0, 0, .65);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
    --shadow-3: 0 8px 20px rgba(0, 0, 0, .4), 0 24px 48px rgba(0, 0, 0, .35);
    --sky-1: #0f1b3d;
    --sky-2: #2a3466;
    --hill-1: #1f3b4a;
    --hill-2: #183142;
    --hill-3: #122737;
    --sun: #f4f1d2;
    --cloud: #3b4677;
    --town: #2b3a63;
    --star: #ffffff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-soft: #3a2216;
  --bg: #0b1222;
  --bg-2: #101a31;
  --surface: #141d33;
  --surface-2: #1a2540;
  --surface-3: #22304f;
  --ink: #eef2fb;
  --text: #e2e7f2;
  --text-2: #a3adc3;
  --text-3: #77829b;
  --line: #253150;
  --line-2: #2f3c5e;
  --maru-soft: #16274a;
  --batsu-soft: #3a1a1e;
  --ok-soft: #12321f;
  --gold-soft: #3a2f12;
  --purple-soft: #261d48;
  --bar-1: #0d1730;
  --bar-2: #12204a;
  --road: #3a4560;
  --road-edge: #56627f;
  --scrim: rgba(0, 0, 0, .65);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
  --shadow-3: 0 8px 20px rgba(0, 0, 0, .4), 0 24px 48px rgba(0, 0, 0, .35);
  --sky-1: #0f1b3d;
  --sky-2: #2a3466;
  --hill-1: #1f3b4a;
  --hill-2: #183142;
  --hill-3: #122737;
  --sun: #f4f1d2;
  --cloud: #3b4677;
  --town: #2b3a63;
  --star: #ffffff;
}

/* ===== 土台 ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  background:
    radial-gradient(1200px 380px at 50% -120px, var(--bg-2), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
  font-feature-settings: "palt" 1;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
a { color: inherit; }
img { max-width: 100%; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--maru); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.coin-ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.num { font-family: var(--round); font-variant-numeric: tabular-nums; }

/* ===== 上の帯 ===== */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, var(--bar-1), var(--bar-2));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 16px rgba(10, 20, 40, .22);
}
.bar-back, .bar-btn {
  flex: none; border: 0; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 12px;
  background: rgba(255, 255, 255, .12); color: #fff;
  transition: background .15s, transform .08s;
}
.bar-back:active, .bar-btn:active { transform: scale(.94); background: rgba(255, 255, 255, .2); }
.bar-back .ic, .bar-btn .ic { width: 20px; height: 20px; }
.bar-title { display: flex; align-items: center; gap: 7px; text-decoration: none; flex: none; }
.logo {
  font-family: var(--round); font-weight: 900; font-size: 12px; letter-spacing: .08em;
  background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; border-radius: 8px; padding: 3px 7px 2px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.bar-name { font-family: var(--round); font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.bar-sub { flex: 1; min-width: 0; font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.coin-pill { flex: none; display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 4px 10px 4px 6px; font-size: 13px; }
.coin-pill b { font-family: var(--round); color: var(--gold); font-variant-numeric: tabular-nums; }
.guest-pill { flex: none; font-size: 11px; font-weight: 800; background: var(--gold); color: #3b2300; border-radius: 99px; padding: 2px 8px; }

main {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 14px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  flex: 1; display: flex; flex-direction: column; gap: 14px;
}
main:focus { outline: none; }
.loading, .error { text-align: center; color: var(--text-2); margin-top: 40px; }
h2.section {
  font-family: var(--round); font-size: 15px; letter-spacing: .02em; margin: 10px 2px -4px; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
h2.section .ic { color: var(--brand); }
h2.section > span:first-child { display: flex; align-items: center; gap: 6px; }
.note { font-size: 11px; color: var(--text-3); text-align: center; margin: 6px 8px 0; }
.hint { font-size: 13px; color: var(--text-2); margin: 0 4px; }
.center { text-align: center; }
.card { background: var(--surface); border-radius: var(--r-l); padding: 16px; box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.link { color: var(--maru); font-weight: 800; font-size: 14px; text-decoration: none; }
.text-btn { border: 0; background: none; color: var(--text-2); font-weight: 800; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 6px 8px; }

/* ===== ボタン ===== */
.primary, .secondary, .ghost {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-radius: var(--r-m); padding: 14px 16px; text-align: center; text-decoration: none;
  font-family: var(--round); font-size: 17px; font-weight: 800; min-height: 56px; letter-spacing: .02em;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.primary { background: linear-gradient(180deg, #2d4f8f, var(--navy)); color: #fff; box-shadow: 0 4px 0 #0c1830, 0 10px 20px rgba(23, 42, 79, .22); }
:root[data-theme="dark"] .primary { background: linear-gradient(180deg, #3a63b0, #284b8c); box-shadow: 0 4px 0 #13284f, 0 10px 20px rgba(0, 0, 0, .3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .primary { background: linear-gradient(180deg, #3a63b0, #284b8c); box-shadow: 0 4px 0 #13284f, 0 10px 20px rgba(0, 0, 0, .3); } }
.primary.big { font-size: 20px; min-height: 64px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); box-shadow: 0 5px 0 var(--brand-ink), 0 12px 24px rgba(242, 106, 46, .32); }
.primary.buy { background: linear-gradient(180deg, #ffd65a, #f5a623); color: #4a2e00; box-shadow: 0 4px 0 #b87200; }
.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.primary:disabled { background: var(--surface-3); box-shadow: none; color: var(--text-3); }
.secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-2); }
.secondary:active { transform: translateY(2px); }
.ghost { background: var(--surface-2); color: var(--ink); min-height: 48px; font-size: 15px; }

/* ===== 相棒・ふきだし ===== */
.partner { display: block; width: 120px; height: auto; overflow: visible; }
.partner.small { width: 76px; flex: none; }
.partner.big { width: 190px; }
.partner.tiny { width: 64px; }
.bob { animation: bob 2.8s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.jump { animation: jump .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jump { 0% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-16px) scale(.95, 1.06); } 60% { transform: translateY(0) scale(1.06, .94); } 100% { transform: none; } }
.shake { animation: shake .5s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px) rotate(-3deg); } 40%, 80% { transform: translateX(5px) rotate(3deg); } }
.grow { animation: grow .9s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes grow { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.12) rotate(3deg); opacity: 1; } 100% { transform: none; } }
.bubble {
  position: relative; background: var(--surface); color: var(--text); border-radius: 16px; padding: 8px 12px;
  font-size: 13px; font-weight: 700; line-height: 1.5; box-shadow: var(--shadow-1); border: 1px solid var(--line);
}
.bubble.left::before { content: ""; position: absolute; left: -7px; top: 18px; border: 7px solid transparent; border-right-color: var(--surface); border-left: 0; }

/* ===== ホーム：景色の中の相棒 ===== */
.home { display: contents; }
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); min-height: 236px;
  box-shadow: var(--shadow-2); isolation: isolate; color: var(--ink);
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.sc-sky1 { stop-color: var(--sky-1); }
.sc-sky2 { stop-color: var(--sky-2); }
.sc-sun { fill: var(--sun); }
.sc-cloud { fill: var(--cloud); opacity: .9; }
.sc-town { fill: var(--town); }
.sc-hill1 { fill: var(--hill-1); }
.sc-hill2 { fill: var(--hill-2); }
.sc-hill3 { fill: var(--hill-3); }
.sc-road { fill: var(--road); }
.sc-line { stroke: #fff; opacity: .85; }
.sc-star { fill: var(--star); }
.sc-cloudmove { animation: drift 40s linear infinite; }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(60px); } }
.hero-top { display: flex; align-items: flex-start; gap: 8px; padding: 14px 14px 0; }
.hero-name { flex: 1; min-width: 0; font-family: var(--round); font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lv-badge { background: linear-gradient(180deg, var(--gold), #f5a623); color: #4a2e00; border-radius: 99px; padding: 1px 9px; font-size: 13px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); font-variant-numeric: tabular-nums; }
.form-name { background: rgba(255, 255, 255, .78); border-radius: 99px; padding: 1px 9px; font-size: 13px; color: #14223f; }
.hero-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hchip {
  display: flex; align-items: center; gap: 4px; text-decoration: none;
  background: rgba(255, 255, 255, .86); color: #14223f; border-radius: 99px; padding: 3px 10px 3px 7px;
  font-size: 12px; font-weight: 800; box-shadow: 0 1px 4px rgba(10, 20, 40, .12); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hchip .ic { width: 16px; height: 16px; }
.hchip.flame .ic { color: #ff6a1a; }
.hchip.flame.off .ic { color: #a8afbd; }
.hchip.exam .ic { color: var(--maru); }
.hchip.exam.soon { background: #fff2e8; color: var(--brand-ink); }
.hero-stage { position: relative; display: flex; align-items: flex-end; gap: 6px; padding: 0 12px 12px; margin-top: 4px; }
.hero-partner { position: relative; flex: none; text-decoration: none; display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; }
.hero-partner .partner { width: 132px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .18)); }
.closet-tag { display: flex; align-items: center; gap: 4px; margin-top: -4px; font-size: 11px; font-weight: 800; background: var(--navy); color: #fff; border-radius: 99px; padding: 2px 10px 2px 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.closet-tag .ic { width: 13px; height: 13px; }
.hero-talk { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.hero-talk .bubble { background: rgba(255, 255, 255, .94); color: #1c2333; border-color: transparent; }
.hero-talk .bubble.left::before { border-right-color: rgba(255, 255, 255, .94); }
.xp-wrap { background: rgba(255, 255, 255, .86); border-radius: 14px; padding: 6px 10px 7px; box-shadow: 0 1px 4px rgba(10, 20, 40, .1); }
.xpbar { height: 10px; background: #e7e2dc; border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); }
.xpbar > span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--brand-2)); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.xptext { font-size: 11px; color: #3b4660; font-weight: 700; margin-top: 3px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px 4px 8px; text-align: center; box-shadow: var(--shadow-1); }
.stat b { display: block; font-family: var(--round); font-size: 24px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--text-2); font-weight: 700; }
.stat.hot b { color: var(--ok); }

.cta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--r-l); text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 60%, #e85a20);
  box-shadow: 0 5px 0 var(--brand-ink), 0 14px 28px rgba(242, 106, 46, .32);
  margin-bottom: 4px;
}
.cta::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent); transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 0%, 62% { left: -60%; } 100% { left: 130%; } }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--brand-ink), 0 6px 14px rgba(242, 106, 46, .28); }
.cta-play { flex: none; width: 50px; height: 50px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0, 0, 0, .15); }
.cta-play .ic { width: 24px; height: 24px; margin-left: 3px; }
.cta-text { flex: 1; min-width: 0; font-family: var(--round); font-weight: 800; font-size: 17px; line-height: 1.35; }
.cta-text small { display: block; font-size: 12px; font-weight: 700; opacity: .92; }
.cta-note { position: absolute; right: 12px; top: 9px; font-size: 10px; font-weight: 800; background: #fff; color: var(--ok); border-radius: 99px; padding: 1px 8px; }

/* 今日のミッション */
.missions { display: flex; flex-direction: column; gap: 10px; }
.missions-head { display: flex; align-items: center; gap: 8px; font-family: var(--round); font-weight: 800; color: var(--ink); }
.missions-head .ic { color: var(--brand); width: 20px; height: 20px; }
.missions-head small { margin-left: auto; font-family: var(--sans); font-size: 11px; color: var(--text-2); font-weight: 700; }
.mission { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; }
.mission-check { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); border: 2px solid var(--line-2); }
.mission-check .ic { width: 16px; height: 16px; }
.mission.done .mission-check { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .4s cubic-bezier(.2, 1.8, .4, 1); }
.mission-body { min-width: 0; }
.mission-body b { display: block; font-size: 13px; font-weight: 800; color: var(--ink); line-height: 1.4; }
.mission.done .mission-body b { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--ok); }
.mission-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.mission-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 99px; }
.mission.done .mission-bar span { background: var(--ok); }
.mission-reward { font-size: 11px; font-weight: 800; color: var(--text-2); display: flex; align-items: center; gap: 3px; white-space: nowrap; }

/* 苦手な分野 */
.weakcat { display: flex; align-items: center; gap: 12px; text-decoration: none; background: linear-gradient(135deg, var(--surface), var(--batsu-soft)); }
.weakcat-ring { flex: none; width: 56px; height: 56px; }
.weakcat-ring circle { fill: none; stroke-width: 7; }
.weakcat-ring .bg { stroke: var(--surface-3); }
.weakcat-ring .fg { stroke: var(--batsu); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.weakcat-ring text { font-family: var(--round); font-weight: 900; font-size: 15px; fill: var(--ink); }
.weakcat-text { flex: 1; min-width: 0; }
.weakcat-text small { display: block; font-size: 11px; font-weight: 800; color: var(--batsu-d); }
.weakcat-text b { display: block; font-family: var(--round); font-size: 16px; color: var(--ink); }
.weakcat-text span { font-size: 12px; color: var(--text-2); }
.weakcat .go { color: var(--text-3); }

/* あそびモード */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  --c: var(--maru); --c-soft: var(--maru-soft);
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 12px; min-height: 108px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); text-decoration: none; box-shadow: var(--shadow-1);
  transition: transform .08s;
}
.tile:active { transform: scale(.98); }
.tile.red { --c: var(--batsu); --c-soft: var(--batsu-soft); }
.tile.blue { --c: var(--maru); --c-soft: var(--maru-soft); }
.tile.green { --c: var(--ok); --c-soft: var(--ok-soft); }
.tile.purple { --c: var(--purple); --c-soft: var(--purple-soft); }
.tile.gold { --c: var(--gold-d); --c-soft: var(--gold-soft); }
.tile.navy { --c: var(--navy-2); --c-soft: var(--maru-soft); }
.tile-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--c); background: var(--c-soft); margin-bottom: 6px; }
.tile-icon .ic { width: 22px; height: 22px; }
.tile b { font-family: var(--round); font-size: 15px; color: var(--ink); line-height: 1.35; }
.tile small { font-size: 11px; color: var(--text-2); line-height: 1.45; }
.tile.off { opacity: .5; box-shadow: none; }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; min-height: 0; }
.tile.wide .tile-icon { margin: 0; flex: none; }
.tile > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.tile .badge { position: absolute; right: 10px; top: 10px; font-size: 10px; font-weight: 900; background: var(--c); color: #fff; border-radius: 99px; padding: 1px 7px; }

/* ===== コースマップ ===== */
.course { display: flex; flex-direction: column; gap: 10px; }
.course-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x proximity; }
.course-tabs::-webkit-scrollbar { display: none; }
.ctab {
  flex: none; scroll-snap-align: start; display: flex; align-items: center; gap: 8px;
  border: 0; border-radius: 99px; padding: 6px 14px 6px 6px; background: var(--surface); color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; font-size: 13px; white-space: nowrap;
}
.ctab.on { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(23, 42, 79, .25); }
.ctab-ring { width: 28px; height: 28px; flex: none; }
.ctab-ring circle { fill: none; stroke-width: 4; }
.ctab-ring .bg { stroke: var(--surface-3); }
.ctab.on .ctab-ring .bg { stroke: rgba(255, 255, 255, .22); }
.ctab-ring .fg { stroke: var(--brand); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ctab-ring text { font-size: 10px; font-weight: 900; fill: currentColor; font-family: var(--round); }
.course-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.course-head b { font-family: var(--round); color: var(--ink); font-size: 17px; }
.course-head small { font-size: 12px; color: var(--text-2); font-weight: 700; }
.map { position: relative; }
.map-road { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.map-road .edge { fill: none; stroke: var(--road-edge); stroke-width: 44; stroke-linecap: round; }
.map-road .asphalt { fill: none; stroke: var(--road); stroke-width: 36; stroke-linecap: round; }
.map-road .dash { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 12 12; opacity: .75; }
.map-road .done { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; opacity: .9; }
.stop { position: absolute; display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; width: 74%; }
.stop.left { flex-direction: row; }
.stop.right { flex-direction: row-reverse; text-align: right; }
.node {
  flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--round); font-weight: 900; font-size: 22px; color: #fff;
  background: linear-gradient(180deg, #5b8def, var(--maru)); border: 4px solid #fff; box-shadow: 0 4px 0 var(--maru-d), 0 8px 16px rgba(0, 0, 0, .22);
}
.node .ic { width: 24px; height: 24px; }
.stop-card { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 9px 12px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 1px; }
.stop.right .stop-card { align-items: flex-end; }
.stop-head { font-size: 11px; font-weight: 800; color: var(--text-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.stop-name { font-family: var(--round); font-weight: 800; font-size: 14px; color: var(--ink); line-height: 1.35; }
.stop-sub { font-size: 11px; color: var(--text-2); }
.boss-tag { display: inline-flex; align-items: center; gap: 2px; background: var(--boss-1); color: var(--gold); border-radius: 6px; padding: 0 5px; font-size: 9px; letter-spacing: .05em; }
.boss-tag .ic { width: 10px; height: 10px; }
.stop.done .node { background: linear-gradient(180deg, #3fd18a, var(--ok)); box-shadow: 0 4px 0 var(--ok-d), 0 8px 16px rgba(0, 0, 0, .22); }
.stop.next .node { background: linear-gradient(180deg, var(--brand-2), var(--brand)); box-shadow: 0 4px 0 var(--brand-ink), 0 0 0 8px rgba(242, 106, 46, .22); animation: pulse 1.8s ease-in-out infinite; }
.stop.next .stop-card { box-shadow: 0 0 0 2px var(--brand), var(--shadow-2); }
@keyframes pulse { 50% { box-shadow: 0 4px 0 var(--brand-ink), 0 0 0 14px rgba(242, 106, 46, .06); } }
.stop.locked .node { background: #b9c0cc; box-shadow: 0 4px 0 #8b93a3; }
.stop.locked .stop-card { background: var(--surface-2); box-shadow: none; }
.stop.locked .stop-name { color: var(--text-3); }
.goal { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; font-family: var(--round); font-weight: 800; font-size: 13px; border-radius: 99px; padding: 6px 16px; box-shadow: var(--shadow-2); white-space: nowrap; }
.goal .ic { width: 16px; height: 16px; color: var(--gold); }
.stars { display: inline-flex; gap: 1px; color: var(--surface-3); }
.stars .ic { width: 15px; height: 15px; }
.stars .on { color: var(--gold); }

/* ===== 問題 ===== */
.play-head { display: flex; align-items: center; gap: 10px; }
.road-progress { position: relative; flex: 1; height: 28px; }
.road-track { position: absolute; left: 0; right: 0; top: 11px; height: 10px; border-radius: 99px; background: var(--road); overflow: hidden; }
.road-track::after { content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 2px; background: repeating-linear-gradient(90deg, #fff 0 8px, transparent 8px 14px); opacity: .75; }
.road-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--gold), var(--brand-2)); transition: width .4s; z-index: 1; }
.road-car { position: absolute; top: -2px; left: 0; width: 44px; height: auto; transition: left .4s; z-index: 2; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.count { font-family: var(--round); font-weight: 800; color: var(--ink); font-size: 14px; flex: none; font-variant-numeric: tabular-nums; }
.combo-badge { flex: none; display: flex; align-items: center; gap: 2px; font-family: var(--round); font-weight: 900; color: #fff; background: linear-gradient(180deg, #ff8a3d, #e5331a); border-radius: 99px; padding: 1px 10px 1px 7px; font-size: 14px; box-shadow: 0 2px 0 #a3210f; }
.combo-badge .ic { width: 15px; height: 15px; }
.combo-badge.pop { animation: pop .5s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

.card-stage { perspective: 800px; }
.qcard {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 16px 18px 22px;
  box-shadow: 0 4px 0 var(--line), var(--shadow-2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transition: transform .25s, opacity .25s;
  animation: enter .35s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes enter { from { transform: translateY(18px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.qcard.dragging { transition: none; }
.qcard.fly-right { transform: translateX(130%) rotate(18deg) !important; opacity: 0; }
.qcard.fly-left { transform: translateX(-130%) rotate(-18deg) !important; opacity: 0; }
.qcard.boss { background: linear-gradient(180deg, var(--boss-1), var(--boss-2)); color: #fff; border-color: transparent; box-shadow: 0 4px 0 #170b24, 0 0 0 3px var(--gold), 0 14px 34px rgba(124, 92, 240, .45); }
.qcard.boss .sign { background: radial-gradient(circle, rgba(255, 201, 60, .35), transparent 70%); }
.qcard.flash-ok { box-shadow: 0 0 0 4px var(--ok), 0 14px 30px rgba(24, 160, 88, .3); }
.qcard.flash-ng { box-shadow: 0 0 0 4px var(--ng), 0 14px 30px rgba(224, 57, 62, .3); animation: shake .4s; }
.swipe-mark { position: absolute; top: 14px; font-family: var(--round); font-weight: 900; font-size: 54px; line-height: 1; opacity: 0; pointer-events: none; }
.swipe-mark.maru { right: 18px; color: var(--maru); }
.swipe-mark.batsu { left: 18px; color: var(--batsu); }
.tags { align-self: stretch; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; border-radius: 99px; padding: 2px 10px; font-weight: 800; }
.tag .ic { width: 13px; height: 13px; }
.tag.draft { background: var(--gold-soft); color: #7a5a00; font-weight: 700; }
.tag.review { background: var(--ok-soft); color: var(--ok-d); }
.tag.weak { background: var(--batsu-soft); color: var(--batsu-d); }
.tag.boss { background: var(--gold); color: #3b2300; }
.tag.cat { background: var(--surface-2); color: var(--text-2); }
:root[data-theme="dark"] .tag.draft, :root[data-theme="dark"] .tag.review, :root[data-theme="dark"] .tag.weak { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.draft, :root:not([data-theme="light"]) .tag.review, :root:not([data-theme="light"]) .tag.weak { color: var(--text); } }
.sign { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 24px; background: radial-gradient(circle, var(--surface-2) 40%, transparent 72%); }
.sign img { width: 150px; height: 150px; object-fit: contain; pointer-events: none; }
.sign.wide img { width: 230px; height: 140px; }
.sign.small { padding: 0; background: none; }
.sign.small img { width: 52px; height: 52px; }
.sign.small.wide img { width: 68px; height: 42px; }
.plate { border: 2px solid #333; background: #fff; color: #1b2333; border-radius: 4px; padding: 0 10px; font-weight: 800; font-size: 14px; min-width: 88px; text-align: center; }
.plate.arrow { color: var(--ng); font-size: 22px; line-height: 1.25; }
.sign.small .plate { display: none; }
/* 絵の無い問題は、分野の印を大きく出す */
.topic { width: 92px; height: 92px; border-radius: 28px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); }
.topic .ic { width: 48px; height: 48px; }
.topic.small { width: 44px; height: 44px; border-radius: 14px; }
.topic.small .ic { width: 24px; height: 24px; }
.qcard.boss .topic { background: rgba(255, 201, 60, .18); color: var(--gold); }
.qtext { font-family: var(--round); font-size: 19px; font-weight: 700; line-height: 1.75; width: 100%; margin: 0; letter-spacing: .01em; }
.swipe-hint { text-align: center; font-size: 11px; color: var(--text-3); margin: -6px 0 -4px; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: auto; position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); }
.ans {
  border: 0; border-radius: var(--r-l); color: #fff; min-height: 104px;
  font-family: var(--round); font-size: 58px; font-weight: 900; line-height: 1;
  touch-action: manipulation; transition: transform .08s;
}
.ans small { display: block; font-size: 13px; font-weight: 800; margin-top: 6px; opacity: .92; }
.ans.maru { background: linear-gradient(180deg, #5b9bff, var(--maru)); box-shadow: 0 6px 0 var(--maru-d), 0 12px 22px rgba(47, 124, 246, .32); }
.ans.batsu { background: linear-gradient(180deg, #ff7676, var(--batsu)); box-shadow: 0 6px 0 var(--batsu-d), 0 12px 22px rgba(239, 75, 75, .3); }
.ans:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }

.burst { position: fixed; left: 50%; top: 42%; z-index: 50; font-family: var(--round); font-weight: 900; font-size: 210px; line-height: 1; pointer-events: none; transform: translate(-50%, -50%); animation: burst .65s cubic-bezier(.2, 1.4, .4, 1) forwards; text-shadow: 0 8px 30px rgba(0, 0, 0, .2); }
.burst.ok { color: var(--maru); -webkit-text-stroke: 6px #fff; }
.burst.ng { color: var(--batsu); -webkit-text-stroke: 6px #fff; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 35% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; } }

.boss-intro { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(20, 8, 34, .84); animation: fade .2s; }
.boss-flash { position: absolute; inset: 0; background: url("assets/fx-up.webp") center / cover; opacity: .55; mix-blend-mode: screen; animation: flicker 1.8s; }
.boss-text { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; font-family: var(--round); font-weight: 900; font-size: 40px; text-shadow: 0 4px 0 #6b2a00, 0 0 24px rgba(255, 201, 60, .8); animation: slam .5s cubic-bezier(.2, 1.6, .4, 1); }
.boss-text .ic { width: 64px; height: 64px; color: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 201, 60, .8)); }
.boss-text small, .boss-text span { display: block; font-size: 14px; font-weight: 800; text-shadow: none; }
.boss-text span { color: var(--gold); margin-top: 6px; }
@keyframes slam { 0% { transform: scale(3); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes flicker { 0% { opacity: 0; } 15% { opacity: .9; } 30% { opacity: .3; } 45% { opacity: .7; } 100% { opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

/* 解説 */
.judge { display: flex; align-items: center; gap: 12px; border-radius: var(--r-l); padding: 12px 16px; color: #fff; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.judge.ok { background: linear-gradient(135deg, #2fc77a, var(--ok)); box-shadow: 0 5px 0 var(--ok-d); }
.judge.ng { background: linear-gradient(135deg, #ff6b6b, var(--ng)); box-shadow: 0 5px 0 #a3262a; }
.judge-mark { font-family: var(--round); font-size: 50px; font-weight: 900; line-height: 1; width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; flex: none; }
.judge-text { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; }
.judge-text b { font-family: var(--round); font-size: 26px; line-height: 1.2; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 3px 12px; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.chip .ic { width: 14px; height: 14px; }
.chip:nth-child(2) { animation-delay: .06s; } .chip:nth-child(3) { animation-delay: .12s; } .chip:nth-child(4) { animation-delay: .18s; } .chip:nth-child(5) { animation-delay: .24s; }
.chip.xp .ic { color: var(--gold-d); }
.chip.combo .ic { color: #e5331a; }
.chip.boss { background: var(--boss-1); color: var(--gold); border-color: transparent; }
.chip.card .ic { color: var(--purple); }
.chip.grad .ic, .chip.review .ic { color: var(--ok); }
.chip.miss .ic { color: var(--batsu); }
.react { display: flex; align-items: center; gap: 10px; }
.react .bubble { flex: 1; }
.explain h3, .comment h3 { font-family: var(--round); font-size: 14px; color: var(--ink); margin: 12px 0 4px; display: flex; align-items: center; gap: 6px; }
.explain h3 .ic { color: var(--maru); }
.comment h3 .ic { color: var(--gold-d); }
.explain p { margin: 0; font-size: 15px; }
.explain-q { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-2); }
.explain-q p { font-size: 13px !important; color: var(--text-2); }
.comment { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, var(--surface), var(--brand-soft)); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.comment h3 { margin-top: 0; }
.comment p { margin: 0; font-size: 14px; }
.avatar { width: 44px; height: 44px; flex: none; }
.tb { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--navy-2); background: var(--maru-soft); border-radius: 99px; padding: 1px 9px; }
:root[data-theme="dark"] .tb { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tb { color: var(--text); } }
.explain .text-btn.report { display: flex; align-items: center; gap: 4px; margin: 12px auto 0; color: var(--text-3); font-size: 12px; text-decoration: none; }
.explain .text-btn.report .ic { width: 14px; height: 14px; }
/* 動く図 */
.diagram { margin: 12px 0 2px; border-radius: var(--r-m); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { font-size: 12px; color: var(--text-2); padding: 6px 10px 8px; font-weight: 700; }
.dg-road { fill: var(--road); }
.dg-line { stroke: #fff; }
.dg-text { font-family: var(--round); font-weight: 800; fill: var(--ink); }
.dg-soft { fill: var(--surface); }
.dg-blue { fill: var(--maru); }
.dg-red { fill: var(--ng); }
.dg-gold { fill: var(--gold-d); }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.actions.sticky { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); }

/* ===== モードの説明・タイムアタック・4択・模擬試験 ===== */
.mode-hero { position: relative; overflow: hidden; text-align: center; color: #fff; border-radius: var(--r-xl); padding: 24px 18px; background: linear-gradient(160deg, #3d7ef5, #1d4fb8); box-shadow: var(--shadow-2); }
.mode-hero.exam { background: linear-gradient(160deg, #24407a, #121f3d); }
.mode-hero.practice { background: linear-gradient(160deg, #ef6b4b, #b93a2f); }
.mode-hero::before { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.mode-hero h1 { font-family: var(--round); margin: 6px 0; font-size: 25px; }
.mode-hero p { margin: 0 0 12px; font-size: 14px; opacity: .95; }
.mode-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.mode-icon .ic { width: 36px; height: 36px; }
.best { display: inline-flex; align-items: baseline; gap: 6px; background: rgba(255, 255, 255, .16); border-radius: 99px; padding: 4px 16px; font-weight: 700; }
.best b { font-family: var(--round); color: var(--gold); font-size: 20px; }
.rules { margin: 0; padding: 14px 16px 14px 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); font-size: 14px; }
.rules li { margin: 4px 0; }
.countdown { flex: 1; display: grid; place-items: center; align-content: center; gap: 8px; min-height: 60vh; }
.countdown-num { font-family: var(--round); font-size: 140px; font-weight: 900; color: var(--brand); line-height: 1; text-shadow: 0 8px 0 var(--brand-ink); animation: pop .5s cubic-bezier(.2, 1.8, .4, 1); }
.countdown-num.pop { animation: pop .5s cubic-bezier(.2, 1.8, .4, 1); }
.countdown p { font-family: var(--round); font-weight: 800; color: var(--ink); margin: 0; }
.ta-head { display: flex; flex-direction: column; gap: 6px; }
.timer { height: 14px; border-radius: 99px; background: var(--surface-3); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12); }
.timer > span { display: block; height: 100%; background: linear-gradient(90deg, #2fc77a, #9be15d); border-radius: 99px; transition: width .1s linear; }
.timer > span.hurry { background: linear-gradient(90deg, #ff6b6b, #ffb347); animation: blink .5s infinite alternate; }
@keyframes blink { to { opacity: .6; } }
.ta-stats { display: flex; gap: 14px; align-items: center; font-weight: 700; color: var(--ink); }
.ta-stats > span { display: flex; align-items: center; gap: 4px; }
.ta-stats b { font-family: var(--round); font-size: 20px; font-variant-numeric: tabular-nums; }
.qcard.ta { animation-duration: .2s; }
.q4-prompt { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; box-shadow: var(--shadow-1); }
.q4-prompt small { display: block; font-weight: 700; color: var(--text-2); }
.q4-prompt b { font-family: var(--round); font-size: 22px; color: var(--ink); line-height: 1.4; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { position: relative; border: 1px solid var(--line); background: #fff; border-radius: var(--r-l); padding: 12px; aspect-ratio: 1; display: grid; place-items: center; box-shadow: 0 5px 0 var(--line-2), var(--shadow-1); transition: transform .08s; }
.choice img { width: 82%; height: 82%; object-fit: contain; pointer-events: none; }
.choice:active { transform: translateY(4px); }
.choice.right { box-shadow: 0 0 0 5px var(--ok), 0 5px 0 var(--ok-d); animation: pop .4s; }
.choice.right::after { content: "○"; position: absolute; top: 4px; right: 12px; font-family: var(--round); font-weight: 900; font-size: 34px; color: var(--ok); }
.choice.wrong { box-shadow: 0 0 0 5px var(--ng); animation: shake .4s; }
.choice.wrong::after { content: "×"; position: absolute; top: 4px; right: 12px; font-family: var(--round); font-weight: 900; font-size: 34px; color: var(--ng); }
.choice:disabled:not(.right):not(.wrong) { opacity: .5; }
.plate.mini { position: absolute; bottom: 8px; font-size: 10px; min-width: 0; padding: 0 4px; }
.exam-head { display: flex; align-items: center; gap: 10px; }
.exam-clock { display: flex; align-items: center; gap: 4px; font-family: var(--round); font-weight: 900; font-size: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; font-variant-numeric: tabular-nums; }
.exam-clock.hurry { color: var(--ng); border-color: var(--ng); }
.exam-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.exam-bar span { display: block; height: 100%; background: var(--navy-2); transition: width .3s; }
.history { display: flex; flex-direction: column; gap: 6px; }
.history-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.history-row .hbar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.history-row .hbar span { display: block; height: 100%; background: var(--batsu); }
.history-row.pass .hbar span { background: var(--ok); }
.history-row .hbar i { position: absolute; top: -2px; bottom: -2px; left: 90%; width: 2px; background: var(--ink); opacity: .5; }
.history-row b { font-family: var(--round); font-variant-numeric: tabular-nums; }
.pass-mark { display: inline-block; font-family: var(--round); font-weight: 900; font-size: 28px; border: 4px solid currentColor; border-radius: 12px; padding: 2px 16px; transform: rotate(-6deg); margin-top: 8px; animation: slam .5s cubic-bezier(.2, 1.6, .4, 1) .3s both; }
.pass-mark.ok { color: #fff; background: rgba(22, 163, 90, .55); }
.pass-mark.ng { color: #fff; background: rgba(224, 57, 62, .5); }

/* 分野の成績 */
.catlist { display: flex; flex-direction: column; gap: 10px; }
.catrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-decoration: none; }
.catrow b { font-size: 13px; color: var(--ink); }
.catrow small { font-size: 11px; color: var(--text-2); font-weight: 700; text-align: right; }
.catrow .cbar { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.catrow .cbar span { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.catrow.mid .cbar span { background: var(--gold); }
.catrow.low .cbar span { background: var(--batsu); }
.catrow.none .cbar span { background: transparent; }

/* ===== 結果 ===== */
.result-head { position: relative; overflow: hidden; text-align: center; border-radius: var(--r-xl); padding: 24px 16px 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.result-head.win { color: #fff; border-color: transparent; background: linear-gradient(180deg, rgba(23, 42, 79, .35), rgba(23, 42, 79, .72)), url("assets/fx-victory.webp") center / cover; }
.result-score { font-family: var(--round); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.big-num { font-size: 76px; }
.result-score small { font-size: 22px; opacity: .8; margin-left: 4px; }
.result-stars { display: flex; justify-content: center; gap: 8px; margin-top: 8px; color: var(--surface-3); }
.result-stars .ic { width: 44px; height: 44px; }
.result-head.win .result-stars { color: rgba(255, 255, 255, .25); }
.result-stars span { display: inline-flex; animation: pop .5s cubic-bezier(.2, 1.8, .4, 1) both; }
.result-stars span:nth-child(2) { animation-delay: .15s; } .result-stars span:nth-child(3) { animation-delay: .3s; }
.result-stars .on { color: var(--gold); filter: drop-shadow(0 0 10px rgba(255, 201, 60, .7)); }
.result-msg { font-family: var(--round); font-weight: 800; font-size: 20px; margin-top: 8px; }
.result-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 13px; font-weight: 700; margin-top: 6px; opacity: .92; }
.result-sub span { display: inline-flex; align-items: center; gap: 4px; }
.result-sub .ic { width: 15px; height: 15px; }
.gains { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.gain { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: var(--r-s); background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); }
.gain span { display: flex; align-items: center; gap: 4px; }
.gain b { font-family: var(--round); font-size: 24px; color: var(--brand); font-variant-numeric: tabular-nums; }
.levelup { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: linear-gradient(180deg, var(--gold-soft), var(--surface)); border: 2px solid var(--gold); }
.levelup b { font-family: var(--round); font-size: 18px; color: var(--ink); }
.levelup span { font-size: 13px; color: var(--text-2); }
.levelup.evolved { background: linear-gradient(180deg, rgba(255, 248, 221, .85), var(--surface)), url("assets/fx-up.webp") center / cover; }
.levelup .partner { width: 130px; }
.chara-get { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: linear-gradient(180deg, var(--brand-soft), var(--surface)); border: 2px solid var(--brand); }
.chara-get b { font-family: var(--round); color: var(--brand-ink); display: flex; align-items: center; gap: 6px; }
.chara-get small { font-size: 12px; color: var(--text-2); font-weight: 700; }
.unlocked { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-weight: 800; color: var(--navy-2); background: var(--maru-soft); }
:root[data-theme="dark"] .unlocked { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .unlocked { color: var(--text); } }
.mission-get { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--surface), var(--ok-soft)); }
.mission-get .ic { width: 28px; height: 28px; color: var(--ok); flex: none; }
.mission-get b { font-family: var(--round); color: var(--ink); display: block; }
.mission-get small { font-size: 12px; color: var(--text-2); }
h3.sub { display: flex; align-items: center; gap: 6px; font-family: var(--round); font-size: 14px; margin: 0 0 8px; color: var(--ink); }
h3.sub .ic { color: var(--brand); }
.mini-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-cards img, .mini-cards .topic { width: 50px; height: 50px; object-fit: contain; background: var(--purple-soft); border-radius: 12px; padding: 4px; animation: pop .4s both; }
.missed { display: flex; flex-direction: column; gap: 6px; }
.missed-item { background: var(--batsu-soft); border-radius: var(--r-s); padding: 8px 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
details.missed-item { display: block; }
details.missed-item summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
details.missed-item summary::-webkit-details-marker { display: none; }
details.missed-item p { margin: 6px 0 2px; font-size: 13px; color: var(--text-2); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 110%; transform: translateX(30px) rotate(540deg); } }

/* ===== 図鑑 ===== */
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-3); border-radius: var(--r-m); padding: 4px; gap: 4px; }
.tabs.three { grid-template-columns: repeat(3, 1fr); }
.tabs a { display: flex; align-items: center; justify-content: center; gap: 5px; text-align: center; text-decoration: none; padding: 10px 4px; border-radius: 13px; font-weight: 800; font-size: 13px; color: var(--text-2); }
.tabs a .ic { width: 16px; height: 16px; }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.zukan-stage h2.section { margin-bottom: 8px; }
.zukan-stage .count { font-size: 13px; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qcard-mini {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 10px; min-height: 130px;
  background: linear-gradient(180deg, var(--surface), var(--purple-soft)); border: 2px solid color-mix(in srgb, var(--purple) 30%, transparent); border-radius: var(--r-m); box-shadow: 0 3px 0 color-mix(in srgb, var(--purple) 30%, transparent);
}
.qcard-mini img { width: 64px; height: 64px; object-fit: contain; }
.qcard-mini .topic { width: 64px; height: 64px; border-radius: 18px; }
.qcard-mini .topic .ic { width: 32px; height: 32px; }
.qcard-mini .no { font-size: 10px; color: var(--purple); font-weight: 800; align-self: flex-start; padding-left: 4px; }
.qcard-mini .name { font-size: 11px; font-weight: 800; line-height: 1.35; text-align: center; overflow-wrap: anywhere; color: var(--ink); }
.qcard-mini.boss { border-color: var(--gold); box-shadow: 0 3px 0 var(--gold-d); background: linear-gradient(180deg, var(--surface), var(--gold-soft)); }
.qcard-mini.locked { background: var(--surface-2); border-color: var(--line); box-shadow: none; color: var(--text-3); }
.qcard-mini.locked .no { color: var(--text-3); }
.qcard-mini .hatena { font-family: var(--round); font-size: 34px; font-weight: 900; line-height: 64px; height: 64px; }
.chara-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chara-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; font-weight: 800; font-size: 11px; color: var(--ink); }
.chara-card img { width: 100%; height: auto; aspect-ratio: 868 / 1213; border-radius: 8px; box-shadow: 0 4px 12px rgba(23, 42, 79, .2); }
.chara-card.locked img { filter: grayscale(.6) brightness(.85); opacity: .7; }
.chara-card.locked span { color: var(--text-3); font-weight: 600; font-size: 11px; text-align: center; }
.chara-card.riding img { box-shadow: 0 0 0 3px var(--brand), 0 4px 12px rgba(23, 42, 79, .2); }
.chara-card span { display: inline-flex; align-items: center; gap: 2px; }
.chara-card span .ic { width: 12px; height: 12px; color: var(--brand); }
.pack-box { display: flex; flex-direction: column; gap: 6px; }
.pack-title { display: flex; align-items: center; gap: 6px; font-family: var(--round); font-weight: 900; font-size: 18px; color: var(--brand-ink); }
.flip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.flip { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; padding: 0; border: 0; background: none; perspective: 900px; }
.flip.big { width: 210px; }
.flip-inner { position: relative; display: block; width: 100%; aspect-ratio: 868 / 1213; transform-style: preserve-3d; transform: rotateY(180deg); animation: flipIn .8s cubic-bezier(.3, 1.3, .5, 1) both; }
.flip-inner img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px; -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.flip-front { transform: rotateY(180deg); }
@keyframes flipIn { 0% { transform: rotateY(0) scale(.85); } 55% { transform: rotateY(200deg) scale(1.06); } 100% { transform: rotateY(180deg) scale(1); } }
.flip-name { font-size: 12px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.flip.big .flip-name { display: none; }
.new { background: #ff3b5c; color: #fff; border-radius: 6px; padding: 0 5px; font-size: 9px; font-weight: 900; }

/* 下から出る詳しい表示 */
dialog.sheet {
  border: 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; max-height: 88dvh;
  margin: auto auto 0; border-radius: 26px 26px 0 0; background: var(--surface); color: var(--text);
  display: flex; flex-direction: column; gap: 12px; animation: up .3s cubic-bezier(.2, 1, .3, 1);
  box-shadow: var(--shadow-3);
}
dialog.sheet::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: -6px 0 -4px; }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: var(--scrim); }
.sheet-body { overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sheet-no { font-size: 12px; color: var(--purple); font-weight: 800; }
.sheet-name { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-family: var(--round); font-size: 20px; text-align: center; color: var(--ink); }
.sheet-name .ic { color: var(--brand); }
.sheet-answer { margin: 0; font-weight: 700; }
.sheet-answer b { font-family: var(--round); font-size: 24px; }
.explain-text { margin: 0; font-size: 15px; background: var(--surface-2); border-radius: var(--r-s); padding: 10px 12px; width: 100%; }
.mini-q { margin: 0; font-size: 14px; color: var(--text-2); }
.chara-big { width: 260px; max-width: 80vw; height: auto; border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }

/* ===== 着せ替え・運転席・はじめの画面 ===== */
.closet-stage { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px 14px; border-radius: var(--r-xl); background: radial-gradient(circle at 50% 62%, rgba(255, 255, 255, .9) 0 28%, transparent 29%), linear-gradient(180deg, var(--sky-1), var(--sky-2)); box-shadow: var(--shadow-2); }
.closet-name { font-family: var(--round); font-weight: 800; font-size: 18px; color: var(--ink); }
.closet-coins { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.closet-coins b { font-family: var(--round); color: var(--brand-ink); font-size: 16px; }
.closet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.closet-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2px solid transparent; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1); }
.closet-item.sel { border-color: var(--brand); }
.closet-item.on { background: var(--brand-soft); }
.ci-name { font-size: 11px; font-weight: 800; color: var(--ink); }
.ci-price { display: flex; align-items: center; gap: 2px; font-size: 11px; color: var(--text-2); font-weight: 700; }
.ci-price .ic, .ci-price .coin-ic { width: 12px; height: 12px; }
.face-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.face-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 6px; border: 0; border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1); font-size: 11px; font-weight: 800; color: var(--ink); }
.face-item img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--line-2); }
.face-item.sel { background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand), var(--shadow-1); }
.face-item.sel img { box-shadow: 0 0 0 3px var(--brand); }
.face-none { border: 0; border-radius: var(--r-s); padding: 10px; background: var(--surface); box-shadow: var(--shadow-1); font-weight: 800; color: var(--text-2); }
.face-none.sel { box-shadow: 0 0 0 3px var(--brand), var(--shadow-1); color: var(--ink); }
.start-hero { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px 14px 16px; border-radius: var(--r-xl); box-shadow: var(--shadow-2); color: #14223f; }
.start-hero h1 { margin: 0; font-family: var(--round); font-size: 22px; }
.start-hero p { margin: 0; font-size: 13px; font-weight: 700; }
.start-hero .partner { width: 170px; }
.start-hero .text-btn { color: #24407a; }
.start-hero .bubble { background: rgba(255, 255, 255, .94); color: #1c2333; border-color: transparent; }
:root[data-theme="dark"] .start-hero { color: #eef2fb; }
:root[data-theme="dark"] .start-hero .text-btn { color: #c9d6f5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .start-hero { color: #eef2fb; }
  :root:not([data-theme="light"]) .start-hero .text-btn { color: #c9d6f5; }
}

/* はじめに（使い方と同意） */
.welcome { display: flex; flex-direction: column; gap: 12px; }
.welcome-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-xl); padding: 24px 18px 16px; text-align: center; box-shadow: var(--shadow-2); color: #14223f; }
.welcome-hero h1 { margin: 0 0 4px; font-family: var(--round); font-size: 24px; }
.welcome-hero p { margin: 0; font-weight: 700; font-size: 14px; }
.welcome-hero .partner { width: 150px; margin: 6px auto 0; }
:root[data-theme="dark"] .welcome-hero { color: #eef2fb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .welcome-hero { color: #eef2fb; } }
.points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.points li { display: flex; gap: 12px; align-items: flex-start; }
.points .pi { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.points .pi .ic { width: 20px; height: 20px; }
.points b { display: block; font-size: 14px; color: var(--ink); }
.points small { display: block; font-size: 12px; color: var(--text-2); line-height: 1.55; }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 700; padding: 12px; border-radius: var(--r-m); background: var(--surface-2); cursor: pointer; }
.agree input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }

/* ===== 設定 ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.settings { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border-radius: var(--r-m); padding: 10px 12px; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.set-row b { display: flex; align-items: center; gap: 6px; font-family: var(--round); color: var(--ink); font-size: 15px; }
.set-row b .ic { color: var(--brand); width: 18px; height: 18px; }
.set-row small { display: block; font-size: 12px; color: var(--text-2); line-height: 1.5; }
.switch { flex: none; width: 52px; height: 32px; border-radius: 99px; border: 0; background: var(--line-2); position: relative; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .2s; }
.switch.on { background: var(--ok); }
.switch.on span { left: 23px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface-3); border-radius: var(--r-s); padding: 4px; }
.seg.wrap { grid-template-columns: repeat(2, 1fr); }
.seg button { border: 0; background: none; border-radius: 9px; padding: 8px 4px; font-weight: 800; font-size: 13px; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.two .primary, .two .secondary { font-size: 15px; min-height: 48px; padding: 10px; }
.field { width: 100%; border: 2px solid var(--line-2); border-radius: var(--r-s); padding: 10px; background: var(--surface); min-height: 46px; }
.code-box { width: 100%; border: 2px solid var(--line-2); border-radius: var(--r-s); padding: 10px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; background: var(--surface); color: var(--text); }
textarea.code-box:not([readonly]) { font-family: inherit; font-size: 15px; }
.ask { display: flex; flex-direction: column; gap: 6px; border: 1px solid color-mix(in srgb, var(--maru) 35%, transparent); background: linear-gradient(135deg, var(--surface), var(--maru-soft)); }
.ask b { display: flex; align-items: center; gap: 6px; font-family: var(--round); color: var(--ink); }
.ask b .ic { color: var(--maru); }
.ask small { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.ask .text-btn { align-self: flex-end; }

/* 小さなお知らせ（ミッション達成など） */
.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  background: var(--navy); color: #fff; border-radius: 99px; padding: 8px 16px 8px 10px; box-shadow: var(--shadow-3);
  font-size: 13px; font-weight: 800; animation: toast 2.8s cubic-bezier(.2, 1, .3, 1) forwards; pointer-events: none;
}
.toast .ic { width: 22px; height: 22px; color: var(--gold); flex: none; }
@keyframes toast { 0% { transform: translate(-50%, -24px); opacity: 0; } 10%, 85% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -12px); opacity: 0; } }

.skeleton { display: flex; flex-direction: column; gap: 14px; }
.skeleton i { display: block; height: 120px; border-radius: var(--r-l); background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton i:nth-child(1) { height: 236px; } .skeleton i:nth-child(2) { height: 64px; } .skeleton i:nth-child(3) { height: 80px; } .skeleton i:nth-child(4) { height: 220px; }
@keyframes shimmer { to { background-position: -200% 0; } }

main.enter > * { animation: rise .32s cubic-bezier(.2, .9, .3, 1) both; }
main.enter > *:nth-child(2) { animation-delay: .03s; } main.enter > *:nth-child(3) { animation-delay: .06s; }
main.enter > *:nth-child(4) { animation-delay: .09s; } main.enter > *:nth-child(5) { animation-delay: .12s; }
main.enter > *:nth-child(n+6) { animation-delay: .15s; }
main.enter > .answers, main.enter > .actions.sticky { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ===== 文字の大きさ・ふりがな ===== */
html[data-font="large"] main { zoom: 1.12; }
html[data-font="xlarge"] main { zoom: 1.25; }
html[data-font="large"] dialog.sheet, html[data-font="xlarge"] dialog.sheet { font-size: 17px; }
rt { font-size: .48em; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
html[data-ruby="on"] .qtext { line-height: 2.15; }
html[data-ruby="on"] .explain p, html[data-ruby="on"] .comment p, html[data-ruby="on"] .explain-text { line-height: 2.05; }
.qcard.boss rt { color: #d9c9ff; }

/* ===== iPad など広い画面：ホームは2列、問題は真ん中に ===== */
@media (min-width: 820px) {
  main { max-width: 1080px; padding-top: 22px; gap: 16px; }
  main.wide-off { max-width: 640px; }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
  .home-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .home-col.right { position: sticky; top: 76px; }
  .hero { min-height: 270px; }
  .hero-partner .partner { width: 160px; }
  .course-tabs { margin: 0; padding: 2px 0 6px; flex-wrap: wrap; }
  .card-grid { grid-template-columns: repeat(5, 1fr); }
  .chara-grid { grid-template-columns: repeat(6, 1fr); }
  .face-grid { grid-template-columns: repeat(6, 1fr); }
  .closet-grid { grid-template-columns: repeat(6, 1fr); }
  .ans { min-height: 120px; }
  dialog.sheet { border-radius: 26px; margin: auto; }
}
@media (max-width: 819px) {
  .home-grid, .home-col { display: contents; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
