/* ==========================================================
   無課金ゼミナール — 学びのポータル
   柔らかい面＋1pxの境界線。黒い縁とベタ影は使わない。
   配色は data-theme で切替（zunda=既定 / metan）
   ========================================================== */

@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("MPLUSRounded1c-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("MPLUSRounded1c-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("MPLUSRounded1c-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("MPLUSRounded1c-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  /* --- ずんだもん（既定） --- */
  --accent: #35762C;
  --accent-2: #5CB44E;
  --accent-ink: #1F4F19;
  --accent-soft: #DDF0D5;
  --accent-tint: #E9F2E0;
  --on-accent: #FFFFFF;
  --on-light: #1A1D16;

  --bg: #EFF1EA;
  --surface: #FFFFFF;
  --surface-2: #F8F9F4;
  --ink: #1A1D16;
  --ink-2: #4C5245;
  --ink-3: #656C5C;
  --line: rgba(22, 26, 18, .13);
  --line-soft: rgba(22, 26, 18, .07);

  --cyan: #1E93A8;   --cyan-soft: #DBF1F5;
  --yellow: #F0B84D; --yellow-soft: #FFF1CC;
  --pink: #C42F63;   --pink-soft: #FBDCE7;
  --purple: #6B4BD6; --purple-soft: #E8E2FB;
  --orange: #C9741F; --orange-soft: #FBE7D4;
  --green: #3E8E34;  --green-soft: #DDF0D5;

  /* ヒーロー看板（明るい写真の上でも沈む） */
  --board-bg: #FFFCF3;
  --board-ink: #221F17;
  --board-sub: #746146;
  --veil-top: rgba(20, 28, 24, .10);
  --veil-bottom: rgba(12, 18, 15, .78);

  --r-lg: 24px;
  --r: 16px;
  --r-sm: 10px;

  --sh-sm: 0 1px 2px rgba(18, 22, 14, .07), 0 2px 5px rgba(18, 22, 14, .05);
  --sh-md: 0 2px 4px rgba(18, 22, 14, .08), 0 6px 14px rgba(18, 22, 14, .07);
  --sh-lg: 0 4px 8px rgba(18, 22, 14, .08), 0 16px 32px rgba(18, 22, 14, .10);

  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  /* 文字の基準。本文・見出し・注記をここから派生させる。 */
  --fs-hero: clamp(28px, 3.6vw, 40px);
  --fs-h2: clamp(24px, 2.8vw, 32px);
  --fs-h3: 24px;
  --fs-body: 18px;
  --fs-lead: 16px;
  --fs-small: 15px;
  --fs-label: 14px;
  --fs-caption: 14px;
  --lh-body: 1.95;
  --header-h: 66px;
}

[data-theme="metan"] {
  --accent: #B82A5B;
  --accent-2: #FF7FA8;
  --accent-ink: #741A3E;
  --accent-soft: #FBDCE7;
  --accent-tint: #F9E6EE;
  --on-accent: #FFFFFF;

  --bg: #F4EEF1;
  --surface-2: #FAF6F8;
  --ink: #1F1A1D;
  --ink-2: #554A50;
  --ink-3: #6E5D65;
  --line: rgba(34, 20, 26, .13);
  --line-soft: rgba(34, 20, 26, .07);

  --board-bg: #FFF9F2;
  --board-ink: #241B1F;
  --board-sub: #755A63;
  --veil-top: rgba(36, 24, 30, .10);
  --veil-bottom: rgba(28, 16, 22, .78);
}


* { box-sizing: border-box; }

/* テーマ切替の瞬間に、背景だけ先に変わって文字が読めなくなるのを防ぐ */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
svg { display: block; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.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;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* 押せるものは必ずポインタ＋押下感 */
a, button, .tab, .state-btn, .tsw { cursor: pointer; }
a:active, button:active { transform: scale(.99); }
.crumbs a:hover, .foot-cols a:hover, .section-head .more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(1560px, 100% - 48px);
  margin-inline: auto;
  display: flex; align-items: center; gap: 22px;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; object-fit: cover;
  box-shadow: 0 2px 8px rgba(27, 26, 33, .12);
}
.brand-text {
  display: flex; flex-direction: column;
  font-weight: 800; font-size: 17px; line-height: 1.15; letter-spacing: .01em;
}
.brand-text small { font-size: 10px; font-weight: 700; color: var(--ink-3); letter-spacing: .18em; }

.primary-nav { display: flex; gap: 2px; }
.primary-nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  transition: background .16s, color .16s;
}
.primary-nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.primary-nav a:hover { background: var(--accent-tint); color: var(--ink); }
.primary-nav a.is-active { background: var(--accent); color: var(--on-accent); }

.search {
  cursor: text;
  margin-left: auto;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 8px 7px 14px;
  width: min(330px, 100%);
  box-shadow: var(--sh-sm);
  transition: border-color .16s, box-shadow .16s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2.1; stroke-linecap: round; }
.search input {
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  width: 100%; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); font-weight: 500; }
.search kbd {
  flex: none; font-family: inherit; font-size: 10.5px; font-weight: 800;
  color: var(--ink-3); background: var(--surface-2);
  border-radius: 6px; padding: 1px 7px; line-height: 1.6;
}

.theme-switch { display: flex; gap: 6px; flex: none; }
.tsw {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; padding: 0;
  transition: transform .15s, border-color .15s;
}
.tsw[data-theme="zunda"] { background: linear-gradient(135deg, #8BD968, #56B94B); }
.tsw[data-theme="metan"] { background: linear-gradient(135deg, #FF8FBA, #FF5F97); }
.tsw:hover { transform: scale(1.12); }
.tsw.is-active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* ---------------- shell ---------------- */
.shell {
  width: min(1560px, 100% - 48px);
  margin: 24px auto 0;
}
.main { min-width: 0; padding-bottom: 40px; }

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--sh-lg);
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(95deg,
    color-mix(in srgb, var(--bg) 96%, transparent) 0%,
    color-mix(in srgb, var(--bg) 86%, transparent) 38%,
    color-mix(in srgb, var(--bg) 12%, transparent) 72%,
    transparent 100%);
}
.hero-body { padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.page-hero { min-height: 250px; margin-bottom: 18px; }
.page-hero .hero-body { min-height: 250px; justify-content: center; padding-block: 30px; }
.page-hero .hero-bg { object-position: center 52%; }
.page-hero .chalk { max-width: 580px; }
.page-hero .chalk h1 { font-size: clamp(26px, 3vw, 38px); }
.course-hero { min-height: 250px; }
.course-hero .hero-body { min-height: 250px; justify-content: center; }
.course-hero .hero-bg { object-position: center 50%; }
.course-hero .hero-shade {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--bg) 44%, transparent) 0%,
    color-mix(in srgb, var(--bg) 16%, transparent) 38%,
    transparent 66%);
}
.progress-hero .hero-bg { object-position: center 56%; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px;
  padding: 3px 13px;
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
}
.chalk {
  max-width: 600px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 20px;
  box-shadow: var(--sh-lg);
  padding: 24px 26px 26px;
}
.chalk h1 { margin: 12px 0 10px; font-size: clamp(26px, 3.2vw, 40px); font-weight: 800; line-height: 1.24; letter-spacing: .01em; }
.chalk h1 em { font-style: normal; color: var(--accent-ink); background: linear-gradient(transparent 66%, var(--accent-soft) 66%); }
.chalk p { margin: 0; color: var(--ink-2); font-size: 14px; }

.hero-gate {
  position: relative;
  min-height: 600px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #2A2A35;
}
.hero-gate .hero-bg { object-position: center 42%; }
.hero-veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, var(--veil-top) 0%, transparent 30%),
    linear-gradient(180deg, transparent 40%, var(--veil-bottom) 100%);
}
.gate-top { position: relative; z-index: 3; padding: 20px 20px 0; display: grid; justify-items: center; }

.board {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 58%),
    var(--board-bg);
  border: 2px solid #FFFFFF;
  border-radius: 22px;
  padding: 14px 30px 14px 18px;
  box-shadow:
    0 0 0 7px color-mix(in srgb, #FFFFFF 45%, transparent),
    0 18px 44px rgba(52, 38, 20, .30);
  color: var(--board-ink);
}
.board::after {
  content: "完全無料";
  position: absolute; top: -14px; right: 20px;
  background: var(--pink); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  padding: 3px 13px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  transform: rotate(5deg);
  white-space: nowrap;
}
.board-wide { width: min(96%, 1000px); justify-content: center; gap: 20px; padding: 16px 40px; }
.board-logo { border-radius: 50%; background: #fff; flex: none; }
.board-txt { text-align: left; }
.board-name {
  margin: 0; white-space: nowrap; font-size: clamp(26px, 4vw, 44px); font-weight: 800; line-height: 1.15; letter-spacing: .03em;
  background-image: linear-gradient(transparent 72%, color-mix(in srgb, var(--accent) 28%, transparent) 72%);
  background-repeat: no-repeat; background-size: 100% 100%;
  display: inline-block;
}
.board-sub { margin: 6px 0 0; font-size: 10.5px; font-weight: 800; letter-spacing: .2em; color: var(--board-sub); }
.board-wide .board-name { font-size: clamp(22px, 4.4vw, 50px); }
.board-wide .board-sub { font-size: 11px; letter-spacing: .24em; }
.board-wide .board-logo { width: 84px; height: 84px; }

.hero-content {
  position: relative; z-index: 2;
  display: grid; justify-items: center; gap: 14px;
  padding: 0 24px 30px; text-align: center;
}
.hero-copy {
  margin: 10px 0 0; color: #fff;
  font-size: clamp(13px, 1.5vw, 15px); font-weight: 700; line-height: 1.75;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}
.hero-copy em { font-style: normal; color: #FFE27A; font-size: 1.14em; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.hero-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.stat {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 6px 14px;
  text-align: center; min-width: 82px;
  backdrop-filter: blur(8px);
  pointer-events: none; cursor: default;
}
.stat b { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.stat span { font-size: 10px; font-weight: 800; color: var(--ink-2); letter-spacing: .06em; }

/* キャラクター */
.hero-cast { position: absolute; inset: auto 0 0 0; height: 0; z-index: 1; pointer-events: none; }
.cast {
  position: absolute; bottom: -4px;
  height: clamp(130px, 19vw, 230px); width: auto;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .3));
  animation: bob 7s ease-in-out infinite;
  will-change: transform;
}
.cast-zun { left: 1.5%; animation-duration: 6.4s; animation-delay: -1.6s; }
.cast-metan { right: 1.5%; height: clamp(117px, 17.1vw, 207px); animation-duration: 8.2s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-.7deg); }
  50% { transform: translateY(-12px) rotate(.7deg); }
}

/* 桜の花びら */
.petals { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.petals span {
  position: absolute; top: -24px;
  background: color-mix(in srgb, var(--pink) 42%, transparent);
  border-radius: 62% 38% 58% 42%;
  opacity: .85;
  animation-name: petal-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes petal-fall {
  0% { transform: translate3d(0, -24px, 0) rotate(0deg); }
  100% { transform: translate3d(46px, 680px, 0) rotate(420deg); }
}

/* スクロールでふわっと */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .75, .3, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- buttons / chips ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14px; font-weight: 800; letter-spacing: .01em;
  background: var(--accent-soft); color: var(--accent-ink);
  box-shadow: 0 2px 4px rgba(20, 24, 18, .08), 0 8px 18px rgba(20, 24, 18, .10);
  cursor: pointer;
  transition: transform .14s, box-shadow .14s, background .16s, border-color .16s;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--accent));
  box-shadow: 0 4px 8px rgba(20,24,18,.12), 0 14px 28px rgba(20,24,18,.16);
  border-color: var(--accent);
}
.btn:active { transform: translateY(0); box-shadow: var(--sh-sm); }
.btn.primary, .btn.play {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  box-shadow: 0 3px 6px color-mix(in srgb, var(--accent) 35%, transparent), 0 10px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn.primary:hover, .btn.play:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-light { background: #fff; border-color: #fff; color: var(--on-light); }
.btn-light:hover { background: #fff; border-color: var(--accent); color: var(--on-light); }

/* 押せないものはボタンに見せない（ラベルとして扱う） */
.chip-soon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border-radius: 0;
  font-size: 11.5px; font-weight: 700;
  color: var(--ink-3); background: none;
  pointer-events: none; cursor: default;
}
.chip-soon::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor; opacity: .8;
}

/* ---------------- section head ---------------- */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .01em; }
.section-head .note { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.section-head .more { margin-left: auto; font-size: 12.5px; font-weight: 800; color: var(--accent-ink); }
.section-head .more:hover { text-decoration: underline; }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px; font-weight: 800;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.tab:hover { border-color: var(--accent); color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab .count { font-size: 11px; color: var(--ink-3); margin-left: 6px; font-weight: 800; }
.tab[aria-pressed="true"] .count { color: var(--on-accent); }
.tab-sm { padding: 5px 12px; font-size: 12px; }
.tabs-sub { margin-top: 8px; }

.group-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.group-head h2, .group-head h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.group-head .note { font-size: 11px; font-weight: 700; color: var(--ink-3); }

/* 中身が無いものは押せない（見た目で分かるように） */
.is-empty { cursor: default; }

.card.is-empty {
  background: var(--surface-2);
  border-style: dashed;
  box-shadow: none;
}
.card.is-empty .card-thumb img { filter: grayscale(1); opacity: .4; }
.card.is-empty .card-title { color: var(--ink-2); }
.card.is-empty .card-meta .bar { opacity: .35; }

.unit-row.is-empty {
  background: var(--surface-2);
  border-style: dashed;
  box-shadow: none;
}
.unit-row.is-empty .unit-no {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-3);
}
.unit-row.is-empty .unit-title { color: var(--ink-2); }

.badge-soon {
  flex: none;
  font-size: 10px; font-weight: 800; color: var(--ink-3);
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: 999px; padding: 2px 9px;
  white-space: nowrap;
}
.card > .badge-soon { position: absolute; top: 10px; right: 10px; }

/* ---------------- course grid ---------------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--accent); }
a.card:hover .card-title { color: var(--accent-ink); }
.card-thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a.card:hover .card-thumb img { transform: scale(1.04); }
.noimg {
  background: repeating-linear-gradient(135deg,
    var(--surface) 0 12px, var(--surface-2) 12px 24px);
  position: relative;
}
.noimg::after {
  content: "準備中"; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--ink-2); letter-spacing: .12em;
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.4; }
.card-meta { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; color: var(--ink-3); }
a.card .card-meta::after {
  content: "›";
  margin-left: 2px;
  font-size: 17px; line-height: 1;
  color: var(--accent);
  transition: transform .15s;
}
a.card:hover .card-meta::after { transform: translateX(3px); }

.bar { height: 7px; border-radius: 999px; background: var(--line-soft); overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }

/* ---------------- unit list ---------------- */
.unit-list { display: flex; flex-direction: column; gap: 8px; }
.unit-row {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px 11px 11px;
  background: var(--surface-2);
  transition: background .16s, border-color .16s, box-shadow .16s, transform .16s;
}
a.unit-row { background: var(--surface); box-shadow: var(--sh-sm); }
a.unit-row:hover { border-color: var(--accent); box-shadow: var(--sh-md); transform: translateY(-1px); }
.unit-no {
  flex: none; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 800; font-size: 12.5px;
}
.unit-main { flex: 1; min-width: 0; }
.unit-title { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.unit-sub { display: block; font-size: 11px; color: var(--ink-3); font-weight: 700; }
.unit-tags { display: flex; gap: 6px; flex: none; align-items: center; }
.chev { flex: none; color: var(--ink-3); font-size: 20px; line-height: 1; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  padding: 0; background: none; border: 0; border-radius: 0;
  color: var(--ink-3);
  white-space: nowrap;
}
.tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .45;
}
.tag.on { color: var(--accent-ink); }
.tag.on::before { background: var(--accent); opacity: 1; }
.tag.tag-soon { color: var(--ink-3); }
.tag.tag-soon::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .55; }
.tag em { font-style: normal; font-size: 9px; font-weight: 800; color: var(--ink-3); }

/* 区分の色（進捗の見出しなど） */
.cat-U { background: var(--cyan-soft); color: var(--ink); }
.cat-T { background: var(--yellow-soft); color: var(--ink); }
.cat-K { background: var(--green-soft); color: var(--ink); }
.cat-C { background: var(--pink-soft); color: var(--ink); }
.cat-S { background: var(--purple-soft); color: var(--ink); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------------- unit detail ---------------- */
.crumbs { font-size: 12.5px; font-weight: 700; color: var(--ink-3); margin: 0 0 14px; }
.crumbs a:hover { color: var(--accent-ink); }
.unit-hero {
  display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 24px; align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: 20px;
}
.unit-hero .thumb { border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; background: var(--surface-2); }
.unit-h1 { margin: 4px 0 10px; font-size: clamp(21px, 2.6vw, 28px); font-weight: 800; line-height: 1.35; }
.unit-code { font-size: 11px; font-weight: 800; letter-spacing: .09em; color: var(--ink-3); }
/* 学習状態: セグメントコントロール（明確に操作部品） */
.state-row {
  display: inline-flex; gap: 2px; padding: 3px;
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.state-btn {
  border: 0; border-radius: 999px;
  background: transparent; padding: 6px 15px;
  font-size: 12.5px; font-weight: 800; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.state-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.state-btn[aria-pressed="true"] {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* 教材3点 */
.materials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mat {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}
.mat-head { display: flex; align-items: center; gap: 9px; }
.mat-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.mat-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.mat-ico svg { width: 17px; height: 17px; fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.mat-ico-video { background: var(--yellow-soft); }
.mat-ico-doc { background: var(--cyan-soft); }
.mat-ico-quiz { background: var(--pink-soft); }
.mat p { margin: 0; font-size: 12.5px; color: var(--ink-2); flex: 1; line-height: 1.6; }
.mat .btn, .mat .chip-soon { align-self: flex-start; }
.mat.has { background: var(--surface); box-shadow: var(--sh-sm); }
.mat.is-empty { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.mat.is-empty .mat-head h3 { color: var(--ink-2); }

/* ---------------- panels ---------------- */
.panel {
  margin-top: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.panel h2 { margin: 0 0 5px; font-size: 17px; font-weight: 800; }
.panel > p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

.soon {
  display: grid; place-items: center; gap: 9px;
  text-align: center; padding: 26px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.soon-mark {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 800; font-size: 11px;
}
.soon h3 { margin: 0; font-size: 15px; font-weight: 800; }
.soon p { margin: 0; max-width: 440px; font-size: 12.5px; color: var(--ink-2); }

/* ---------------- progress ---------------- */
.kpi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi .box {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px; text-align: center;
}
.kpi b { display: block; font-size: 26px; font-weight: 800; line-height: 1.2; }
.kpi span { font-size: 11.5px; font-weight: 800; color: var(--ink-3); }

.empty { text-align: center; color: var(--ink-3); padding: 38px 0; font-weight: 700; }

/* ---------------- footer ---------------- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface); }

.foot-cols {
  width: min(1220px, 100% - 48px); margin-inline: auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: 26px;
  padding: 32px 0 12px;
}
.foot-cols > div { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.foot-cols a:hover { color: var(--accent-ink); }
.foot-brand { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); }
.foot-head { margin: 0 0 3px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--ink-3); }
.muted { color: var(--ink-3); font-weight: 500; }
.copyright { margin: 0; padding: 0 0 28px; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); }

/* ---------------- mobile tabbar ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: none;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 800; color: var(--ink-3);
  padding: 4px 0; border-radius: 10px;
}
.tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.is-active { color: var(--accent-ink); }

/* ---------------- quiz ---------------- */
.quiz-bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.quiz-progress { flex: 1; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.quiz-progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.quiz-count { font-size: 12px; font-weight: 800; color: var(--ink-3); }

.qpanel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-md);
  padding: 26px 28px 28px;
}
.q-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.q-chapter { font-size: 10.5px; font-weight: 800; color: var(--accent-ink); letter-spacing: .08em; }
.q-level { font-size: 10px; font-weight: 800; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.q-text { margin: 0 0 20px; font-size: clamp(18px, 2.2vw, 23px); font-weight: 800; line-height: 1.5; }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 15px; font-weight: 700; color: var(--ink);
  cursor: pointer; transition: border-color .14s, background .14s, transform .1s;
}
.choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-tint); }
.choice:disabled { cursor: default; }
.choice-no {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; font-weight: 800;
}
.choice.is-correct { border-color: var(--accent); background: var(--accent-soft); }
.choice.is-correct .choice-no { background: var(--accent); color: var(--on-accent); }
.choice.is-wrong { border-color: var(--pink); background: var(--pink-soft); }
.choice.is-wrong .choice-no { background: var(--pink); color: #fff; }

.fb { margin-top: 18px; border-radius: var(--r); padding: 18px 20px; }
.fb-ok { background: var(--accent-soft); }
.fb-ng { background: var(--pink-soft); }
.fb-head { margin: 0 0 8px; font-size: 15px; font-weight: 800; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fb-head span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.fb-why { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.fb-lead { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.fb-steps { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.fb-steps li { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.fb-steps b { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 10.5px; }
.fb-pit { margin: 0; font-size: 13px; font-weight: 800; color: var(--ink); border-left: 3px solid var(--accent); padding-left: 10px; }

.result {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-md); padding: 34px 28px; text-align: center;
}
.result-label { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--ink-3); }
.result-score { margin: 0 0 10px; font-size: 18px; font-weight: 800; color: var(--ink-2); }
.result-score b { font-size: 56px; color: var(--ink); line-height: 1; }
.result-score span { margin-left: 12px; font-size: 20px; color: var(--accent); }
.result-msg { margin: 0 0 20px; font-size: 13.5px; color: var(--ink-2); }
.result .actions { justify-content: center; }

.wrong-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.wrong-list li { font-size: 13px; line-height: 1.6; }
.wrong-list b { display: block; color: var(--accent-ink); font-size: 13px; }

/* メダル */
.medal {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.medal-gold { background: linear-gradient(135deg, #FFD76A, #D99B12); color: #4A3400; }
.medal-silver { background: linear-gradient(135deg, #EDF0F4, #A7AFBA); color: #2A2F38; }
.medal-bronze { background: linear-gradient(135deg, #E3AC7F, #9C6535); color: #2E1A08; }
.medal-none { background: var(--surface-2); color: var(--ink-3); box-shadow: none; font-size: 14px; }

.medal-big {
  width: 92px; height: 92px; border-radius: 50%;
  margin: 6px auto 14px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(0,0,0,.16), inset 0 -4px 10px rgba(0,0,0,.12);
}
.medal-big.medal-gold { background: linear-gradient(135deg, #FFE08A, #D99B12); color: #4A3400; }
.medal-big.medal-silver { background: linear-gradient(135deg, #F4F6F9, #A7AFBA); color: #2A2F38; }
.medal-big.medal-bronze { background: linear-gradient(135deg, #EAB98D, #9C6535); color: #2E1A08; }
.medal-big.medal-none { background: var(--surface-2); color: var(--ink-3); box-shadow: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
  .shell { width: calc(100% - 32px); }
  .primary-nav { display: none; }
  .materials { grid-template-columns: 1fr; }
  .hero-shade {
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 94%, transparent) 0%,
      color-mix(in srgb, var(--bg) 72%, transparent) 60%,
      color-mix(in srgb, var(--bg) 40%, transparent) 100%);
  }
}

@media (max-width: 760px) {
  .header-inner, .shell { width: calc(100% - 24px); }
  .shell { margin-top: 12px; }
  .header-inner { gap: 8px; }
  .brand-text { font-size: 15px; }
  .brand-text small { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .search { width: 40px; padding: 7px 10px; overflow: hidden; transition: width .2s ease; }
  .search input, .search kbd { width: 0; opacity: 0; padding: 0; }
  .search svg { margin: 0 auto; }
  .search:focus-within {
    position: absolute; left: 12px; right: 12px; top: 50%; z-index: 5;
    width: auto; transform: translateY(-50%);
  }
  .search:focus-within input { width: 100%; opacity: 1; }

  /* ヒーローは画面端まで */
  .hero-gate { margin-inline: -12px; border-radius: 0 0 22px 22px; min-height: 520px; }
  .gate-top { padding: 14px 10px 0; }
  .board-wide { width: 100%; padding: 12px 16px; gap: 12px; }
  .board-wide .board-name { font-size: clamp(20px, 6.8vw, 34px); }
  .board-wide .board-logo { width: 56px; height: 56px; }
  .board-sub { font-size: 9px; letter-spacing: .12em; }
  .board::after { top: -11px; right: 12px; font-size: 10px; padding: 2px 10px; }
  .cast { height: 122px; }
  .cast-zun { left: 0; }
  .cast-metan { right: 0; height: 110px; }
  .hero-content { padding-bottom: 112px; }

  /* タブは横スクロール */
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; }

  .unit-hero { grid-template-columns: 1fr; gap: 16px; }
  .unit-tags { display: none; }
  .foot-cols { grid-template-columns: 1fr 1fr; width: calc(100% - 32px); }
  .tabbar { display: flex; }
  body { padding-bottom: 70px; }

  /* タップ領域を広げる */
  .unit-row { padding: 12px; }
  .state-btn { padding: 9px 16px; }
  .btn { padding: 11px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* V2: プレイリスト内のブロック一覧 */
.block-list { display: flex; flex-direction: column; gap: 8px; }
.block-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 16px;
  box-shadow: var(--sh-sm);
}
.block-row.is-done { border-color: var(--accent-2); background: var(--accent-tint); }
a.block-row { color: inherit; }
a.block-row:hover { border-color: var(--accent); box-shadow: var(--sh-md); }
.block-no {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2);
  font-weight: 800; font-size: 12px;
}
.block-row.is-done .block-no { background: var(--accent); color: var(--on-accent); }
.block-main { flex: 1; min-width: 0; }
.block-title { display: block; font-weight: 700; color: var(--ink); }
.block-sub { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.block-row .tag { flex: none; }
.block-mats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mat-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 11px; font-weight: 700; text-decoration: none;
  white-space: nowrap;
}
.mat-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.mat-link:hover { border-color: var(--accent); color: var(--ink); box-shadow: var(--sh-sm); }
.mat-link.video { background: var(--yellow-soft); }
.mat-link.doc { background: var(--cyan-soft); }
.mat-link.quiz { background: var(--pink-soft); }
.mat-link.is-empty { opacity: .55; border-style: dashed; }
.unit-mat-note { margin: -4px 0 10px; color: var(--ink-3); font-size: 12px; }
@media (max-width: 640px) {
  .block-row { align-items: flex-start; padding: 12px; }
  .block-row .tag { font-size: 11px; }
  .block-mats { width: 100%; justify-content: flex-start; margin-top: 4px; }
}

/* V2: Webテキスト */
.text-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
  grid-template-areas: "toc body info";
  gap: 24px; align-items: start;
}
.text-toc {
  grid-area: toc;
  position: sticky; top: calc(var(--header-h) + 18px);
  max-height: calc(100vh - var(--header-h) - 36px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; box-shadow: var(--sh-sm);
}
.text-toc-title { margin: 0 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--ink-3); }
.text-toc-group { margin-bottom: 10px; }
.text-toc button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 8px;
  padding: 7px 9px; font-family: inherit; font-size: 13.5px;
  font-weight: 800; color: var(--ink-2); cursor: pointer;
}
.text-toc button:hover { background: var(--accent-tint); color: var(--ink); }
.text-toc-sub { padding-left: 18px !important; font-size: 12.5px !important; font-weight: 600 !important; color: var(--ink-3) !important; }
.text-toc-actions { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.text-toc-actions a { font-size: 12px; font-weight: 800; color: var(--accent-ink); }

.text-body { grid-area: body; min-width: 0; max-width: none; }
.text-info { grid-area: info; min-width: 0; }
.text-info .text-hero {
  margin-bottom: 16px; padding: 20px;
}
.text-info .text-hero h1 { font-size: clamp(22px, 2.2vw, 30px); }
.text-info .text-lead { font-size: 14px; }
.text-info .text-section { margin: 0; padding: 18px; }
.text-info .text-section h3 { font-size: 18px; }
.text-hero {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--sh-sm);
  margin-bottom: 22px;
}
.text-hero h1 { margin: 6px 0 8px; font-size: clamp(26px, 3vw, 38px); line-height: 1.3; }
.text-lead { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.9; }
.text-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; color: var(--ink-3); font-size: 12.5px; font-weight: 800; }
.text-chapter {
  margin: 44px 0 20px;
  padding: 26px 28px 22px;
  background: linear-gradient(135deg, var(--accent-tint) 0%, var(--surface) 58%);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.text-chapter:first-of-type { margin-top: 8px; }
.text-chapter, .text-topic, .text-section, .text-chapter-end, .text-memorize {
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.chapter-head { display: flex; align-items: center; gap: 18px; }
.chapter-head-main { min-width: 0; }
.chapter-no {
  flex: none;
  color: var(--accent);
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  opacity: .38;
}
.text-chapter .text-kicker {
  margin: 0 0 2px;
  font-size: 13px;
  letter-spacing: .14em;
}
.text-chapter h2 {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.2;
  letter-spacing: .01em;
}
.text-chapter .text-lead {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.95;
}
.text-kicker { margin: 0 0 4px; color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
@media (max-width: 600px) {
  .text-chapter { margin: 30px 0 16px; padding: 20px 18px 18px; }
  .chapter-head { gap: 12px; }
  .text-chapter h2 { font-size: 28px; }
  .text-chapter .text-lead { font-size: 15px; }
}
.text-section, .text-example {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px 22px; margin: 14px 0;
}
.text-section h2, .text-section h3, .text-example h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.45; }
.text-bullets { margin: 12px 0 0; padding-left: 1.4em; }
.text-bullets li { margin: 6px 0; line-height: 1.8; }
.text-figure {
  margin: 16px 0 0; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.text-figure svg { display: block; width: 100%; height: auto; max-height: 420px; }
.text-figure svg text, .quiz-figure svg text { font-family: var(--font); }
.text-topic { margin: 28px 0; padding: 24px 26px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.text-topic h3 { margin: 0 0 10px; font-size: 24px; }
.text-chapter-end { margin: 30px 0; padding: 24px 26px; background: #f7faf6; border: 1px solid var(--line); border-radius: 16px; }
.text-goals { margin: 12px 0; padding: 12px 16px; background: var(--accent-tint); border-radius: 12px; }
.text-goals > span { display: block; font-size: 12px; font-weight: 800; color: var(--accent-ink); letter-spacing: .08em; }
.text-goals ul { margin: 6px 0 0; padding-left: 1.2em; }
.text-why { margin: 10px 0; padding: 10px 14px; background: #fff8dc; border-left: 4px solid #f6d55c; border-radius: 0 10px 10px 0; }
.text-connection { margin: 10px 0; color: var(--ink-2); font-size: 14px; }
.text-terms { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.text-term { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 13px; background: #eef6ff; border: 1px solid #cfe3f5; border-radius: 999px; font-size: 14px; }
.text-term b { color: #1d4f73; }
.text-term small { color: var(--ink-2); }
.text-term em { color: #6b5a8a; font-style: normal; font-size: 11px; }
.text-term span { color: var(--ink-2); font-size: 12px; }
.topic-point { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; padding: 14px 18px; background: #e7f2e9; border-left: 5px solid #2f7d4f; border-radius: 0 12px 12px 0; }
.topic-point > div { min-width: 0; }
.topic-point b { display: block; color: #1f5d39; margin-bottom: 4px; }
.assistant-icon { flex: none; width: 46px; height: 46px; object-fit: contain; }
.assistant-label { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--ink-2); font-size: 12px; font-weight: 800; }
.assistant-label img { width: 34px; height: 34px; object-fit: contain; }
.assistant-card { margin-top: 16px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.assistant-card p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.85; }
.assistant-lines { display: grid; gap: 8px; margin: 14px 0; }
.assistant-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: #e7f2e9; border: 1px solid #cfe3d3; }
.assistant-line.metan { background: #fbeaf1; border-color: #f0cfdd; }
.assistant-line img { flex: none; width: 52px; height: 52px; object-fit: contain; }
.assistant-line span { font-size: 15px; line-height: 1.8; }
.assistant-line b { display: inline-block; margin-right: 6px; color: #1f5d39; }
.assistant-line.metan b { color: #a33c6c; }
.assistant-faces { display: flex; align-items: flex-end; gap: 4px; }
.assistant-faces img { width: 58px; height: 58px; object-fit: contain; }
.quiz-reaction { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; font-weight: 700; }
.quiz-reaction img { width: 48px; height: 48px; object-fit: contain; }
.result-assist { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 700; }
.result-assist img { width: 56px; height: 56px; object-fit: contain; }

/* ==== Typography scale（本文・見出し・注記を統一する） ==== */
.text-hero h1, .text-info .text-hero h1 { font-size: var(--fs-hero); line-height: 1.3; }
.text-chapter h2 { font-size: var(--fs-h2); line-height: 1.35; }
.text-section h2, .text-section h3, .text-example h3,
.text-topic h3, .text-memorize h3, .text-chapter-end h3 { font-size: var(--fs-h3); line-height: 1.45; }
.text-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.text-lead { font-size: var(--fs-lead); line-height: 1.9; }
.text-info .text-lead { font-size: var(--fs-small); }
.text-meta, .text-kicker, .text-toc-title, .text-term em, .text-note,
.text-practice-hint, .text-practice-a small, .text-read,
.text-toc button, .text-toc-actions a, .text-callout, .text-table,
.text-minihead, .text-chip, .text-step b, .text-step strong, .text-step span {
  font-size: var(--fs-label);
}
.text-toc button { font-size: var(--fs-small); }
.text-toc-sub { font-size: var(--fs-label) !important; }
.text-term, .memorize-item, .topic-idea, .topic-point, .assistant-line span,
.assistant-card p, .quiz-reaction, .hint-btn, .hint-box, .fb-head span,
.fb-lead, .fb-pit, .wrong-list li { font-size: var(--fs-small); }
.text-question, .topic-example .text-question { font-size: 20px; }
.text-practice-q, .text-practice-a, .text-answer { font-size: 17px; }
.text-table { font-size: var(--fs-small); }
.q-text { font-size: clamp(22px, 2.6vw, 28px); }
.choice { font-size: 17px; }
.fb-head { font-size: 17px; }
.result-label { font-size: var(--fs-label); }
.result-score { font-size: 22px; }
.result-msg { font-size: 16px; }
.q-chapter, .q-level, .quiz-count, .eyebrow, .unit-code { font-size: var(--fs-label); }
.tag { font-size: 13px; }
.fb-text-link { font-size: var(--fs-label); }
.text-goals > span { font-size: var(--fs-label); }
.text-term em, .text-term span, .assistant-label { font-size: var(--fs-label); }
.quiz-figure figcaption { font-size: var(--fs-label); }
.text-pitfall p { font-size: 16px; line-height: 1.8; }
.text-pitfall-wrong { font-size: 19px; }
.text-pitfall-fix { font-size: 16px; }
.text-credit { font-size: var(--fs-label); }
.crumbs { font-size: var(--fs-label); }
.foot-cols > div { font-size: var(--fs-label); }
.foot-head, .copyright { font-size: 13px; }
.brand-text small { font-size: 12px; }

/* テストも本文と同じ基準にする。 */
.q-text { font-size: clamp(24px, 2.8vw, 30px); line-height: 1.5; }
.choice { font-size: 19px; line-height: 1.7; }
.choice-no { font-size: 14px; }
.q-chapter, .q-level, .quiz-count { font-size: 15px; }
.hint-btn { font-size: 16px; }
.hint-box { font-size: 17px; line-height: 1.9; }
.hint-lead { font-size: 15px; }
.fb-head { font-size: 19px; }
.fb-head span, .fb-why, .fb-lead, .fb-pit, .quiz-reaction { font-size: 17px; line-height: 1.8; }
.fb-steps li { font-size: 16px; }
.result-score { font-size: 24px; }
.result-msg { font-size: 17px; line-height: 1.8; }
.wrong-list li, .wrong-list b { font-size: 16px; }

/* 図は文字を小さくせず、レスポンシブに収める。 */
.text-figure, .quiz-figure { overflow-x: visible; }
.text-figure img, .quiz-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto;
  border-radius: 12px;
}
.figure-credit {
  margin: 0.35rem 0 0;
  color: var(--ink-3);
  font-size: var(--fs-label);
  text-align: center;
}
.topic-point code { display: block; margin-top: 8px; font-size: 18px; font-weight: 800; color: #1A1D16; background: #fff; padding: 8px 12px; border-radius: 8px; }
.text-memorize { margin: 28px 0; padding: 24px 26px; background: #fff8dc; border: 2px solid #f6d55c; border-radius: 16px; }
.text-memorize h3 { margin: 0 0 8px; font-size: 24px; }
.memorize-items { display: grid; gap: 8px; margin: 12px 0; }
.memorize-item { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; background: #fff; border: 1px solid #eadb9b; border-radius: 10px; }
.memorize-item b { flex: none; min-width: 7em; color: #8a6d00; }
.memorize-item span { font-weight: 700; }
.topic-example { margin: 18px 0; padding: 16px 18px; background: #fbfdf9; border: 1px solid var(--line); border-radius: 14px; }
.topic-example .text-question { font-weight: 800; font-size: 18px; margin: 4px 0 10px; }
.topic-idea, .topic-point-text { margin: 8px 0; font-size: 14px; color: var(--ink-2); }
.topic-idea b, .topic-point-text b { display: inline-block; margin-right: 8px; color: #2f7d4f; }
.topic-practice { margin: 18px 0 0; }
.topic-practice h4 { margin: 0 0 8px; font-size: 16px; }
.text-practice-hint { display: block; margin-top: 5px; font-size: 14px; color: var(--ink-2); }
.text-practice-a small { display: block; margin-top: 5px; color: var(--ink-2); font-size: 14px; }
.quiz-figure { margin: 14px 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.quiz-figure svg { display: block; width: 100%; height: auto; max-height: 360px; }
.quiz-figure figcaption { margin-top: 6px; font-size: 12px; color: var(--ink-2); text-align: center; }
.quiz-hints { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.hint-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cfe3d3; background: #e7f2e9; color: #1f5d39; border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 15px; cursor: pointer; }
.hint-btn img { width: 26px; height: 26px; object-fit: contain; }
.hint-btn.metan { border-color: #f0cfdd; background: #fbeaf1; color: #a33c6c; }
.hint-box { display: none; margin: 8px 0; padding: 10px 14px; background: #f1f7f2; border-left: 4px solid #2f7d4f; border-radius: 0 10px 10px 0; font-size: 16px; }
.hint-box.metan { background: #fdf2f7; border-left-color: #c95b8c; }
.hint-box.show { display: block; }
.hint-who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 14px; font-weight: 800; color: #1f5d39; }
.hint-box.metan .hint-who { color: #a33c6c; }
.hint-who img { width: 34px; height: 34px; object-fit: contain; }
.hint-box p { margin: 0; }
.hint-lead { margin-bottom: 2px !important; font-size: var(--fs-label); color: var(--ink-2); }
.text-core { margin: 16px 0 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--accent-tint); border-radius: 0 10px 10px 0; color: var(--accent-ink); font-weight: 800; }
.text-steps { display: flex; flex-direction: column; gap: 8px; }
.text-step { display: flex; gap: 10px; align-items: flex-start; }
.text-step b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 11px; }
.text-step strong { display: block; font-size: 13px; }
.text-step span { display: block; font-size: 12px; color: var(--ink-2); }
.text-minihead { margin: 18px 0 6px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--ink-3); }
.text-map { display: flex; flex-wrap: wrap; gap: 6px; }
.text-chip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 11px; color: var(--ink-2); }
.text-question { margin: 12px 0; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-weight: 700; line-height: 1.7; }
.text-steps-list { padding-left: 1.4em; }
.text-steps-list li { margin: 5px 0; line-height: 1.7; }
.text-answer { margin: 12px 0; padding-left: 12px; border-left: 3px solid var(--accent); color: var(--accent-ink); font-weight: 800; }
.text-note { margin: 10px 0 0; color: var(--ink-3); font-size: 14px; }
.text-body { margin: 10px 0 0; color: var(--ink-2); line-height: 2.0; font-size: 18px; }
.text-read { margin: 2px 0 0; color: var(--ink-3); font-size: 12px; }
.text-callout {
  margin: 14px 0 0; padding: 10px 14px;
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; color: var(--ink-2); font-size: 13px; line-height: 1.8;
}
.text-callout.metan { border-left-color: var(--purple); }
.text-summary { margin: 10px 0 0; padding-left: 1.3em; }
.text-summary li { margin: 8px 0; line-height: 1.8; }
.text-table-wrap { overflow-x: auto; }
.text-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.text-table th, .text-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.text-table th { color: var(--ink-3); font-size: 11px; }
.text-pitfalls { display: flex; flex-direction: column; gap: 10px; }
.text-pitfall { padding: 10px 14px; background: var(--pink-soft); border-left: 3px solid var(--pink); border-radius: 0 10px 10px 0; }
.text-pitfall p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.7; }
.text-pitfall-wrong { color: var(--ink) !important; font-weight: 800; }
.text-pitfall-fix { color: var(--accent-ink) !important; font-weight: 800; }
.text-formulas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.text-formula-card { padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }
.text-formula-card code { display: block; color: var(--ink); font-family: var(--font); font-size: 15px; font-weight: 800; }
.text-formula-card span { font-size: 11px; color: var(--ink-3); }
.text-practice { list-style: none; margin: 0; padding: 0; }
.text-practice-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.text-practice-no { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 800; }
.text-practice-q { flex: 1; min-width: 200px; font-weight: 700; }
.text-level { flex: none; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-3); font-size: 10px; font-weight: 800; }
.text-practice-item details { width: 100%; margin-left: 32px; }
.text-practice-item summary { cursor: pointer; color: var(--accent-ink); font-size: 12px; font-weight: 800; }
.text-practice-a { margin-top: 6px; padding: 8px 12px; background: var(--accent-tint); border-radius: 8px; color: var(--ink); font-weight: 700; }
.text-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.text-next-card { padding: 12px; background: var(--surface-2); border-radius: 10px; }
.text-next-card strong { display: block; margin-bottom: 4px; }
.text-next-card span { font-size: 12px; color: var(--ink-2); }
.text-credit { margin-top: 16px; text-align: right; font-size: 10px; color: var(--ink-3); }
.text-final { margin: 30px 0 0; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.text-final h2 { margin: 0 0 16px; font-size: var(--fs-h3); }
.final-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.final-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); transition: transform .14s, box-shadow .14s, border-color .14s; }
.final-card:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); border-color: var(--accent); }
.final-card.test { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.final-card.test:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.final-label { font-size: var(--fs-label); font-weight: 800; letter-spacing: .06em; opacity: .8; }
.final-card strong { font-size: 20px; line-height: 1.3; }
.final-card > span:last-child { font-size: var(--fs-small); opacity: .8; }
.final-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; font-size: var(--fs-small); font-weight: 800; color: var(--accent-ink); }
.final-sub a { border-bottom: 1px solid currentColor; }
.final-read { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
@media (max-width: 640px) { .final-grid { grid-template-columns: 1fr; } }
.text-readbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 28px 0 10px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.fb-text-link-wrap { margin: 12px 0 0; }
.fb-text-link { color: var(--accent-ink); font-size: 12px; font-weight: 800; border-bottom: 1px solid currentColor; }
@media (max-width: 1180px) {
  .text-layout { grid-template-columns: 210px minmax(0, 1fr) 270px; gap: 18px; }
}
@media (max-width: 900px) {
  .text-layout { grid-template-columns: 1fr; grid-template-areas: "info" "body"; }
  .text-toc { display: none; }
  .text-toc-group { display: none; }
  .text-toc-title { margin-bottom: 8px; }
  .text-toc-actions { flex-direction: row; flex-wrap: wrap; border-top: 0; padding-top: 0; }
  .text-body { max-width: none; }
}

/* V2: ずんだ餅・購買部・部屋・アプリ */
.wallet-chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--accent-tint); color: var(--accent-ink);
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
.wallet-chip b { font-size: 14px; }
body[data-route="shop"] .wallet-chip { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 100;
  transform: translate(-50%, 10px); opacity: 0;
  padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-size: 13px; font-weight: 800; box-shadow: var(--sh-lg);
  pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }

.shop-hero, .app-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--sh-sm);
}
.shop-hero h1, .app-hero h1 { margin: 8px 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.3; }
.shop-hero p, .app-hero p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.wallet-card {
  flex: none; min-width: 150px; padding: 14px 18px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent-ink);
}
.wallet-card span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.wallet-card b { display: block; font-size: 34px; line-height: 1.2; }

/* 購買部: 春の学校（みんちりえ） */
.shop-hero {
  position: relative; overflow: hidden; min-height: 260px;
  color: #fff; background: #203027;
}
.shop-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center 52%;
}
.shop-hero-shade {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--bg) 38%, transparent) 0%,
    color-mix(in srgb, var(--bg) 12%, transparent) 42%,
    transparent 64%);
}
.shop-hero-copy, .shop-hero .wallet-card { position: relative; z-index: 1; }
.shop-hero-copy {
  max-width: 620px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  box-shadow: var(--sh-lg);
  backdrop-filter: blur(10px);
}
.shop-hero-copy h1 { color: var(--ink); text-shadow: none; }
.shop-hero-copy p { color: var(--ink-2); text-shadow: none; }
.shop-hero-copy .eyebrow {
  padding: 4px 14px;
  border: 1px solid #FFE27A;
  background: #FFE27A;
  color: #203027;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.shop-hero .wallet-card {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .92);
  color: #1B2F22;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  backdrop-filter: blur(6px);
}
.shop-hero .wallet-card span { color: #3C5A45; }
.goods-grid, .app-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.goods-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.goods-card, .app-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; box-shadow: var(--sh-sm);
}
.goods-icon { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); font-size: 28px; }
.goods-card.has-img { flex-direction: column; gap: 10px; padding: 12px; }
.goods-thumb { width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.goods-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.goods-card.has-img .goods-body { width: 100%; }
.goods-body .goods-price { margin: 0 0 10px; color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.goods-body h3, .app-card h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.4; }
.goods-body p, .app-card p { margin: 0 0 10px; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.shop-note { margin: 10px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.7; }
.shop-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.room-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; box-shadow: var(--sh-sm);
}
.room-controls { display: flex; gap: 6px; margin-top: 12px; }
.room-card p { margin: 10px 0 0; color: var(--ink-3); font-size: 11px; line-height: 1.6; }
.room-panel {
  display: flex; gap: 22px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px; box-shadow: var(--sh-sm);
}
.room-panel > .room-stage { width: 320px; flex: none; }
.room-panel-text { flex: 1; }
.room-panel-text p { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.room-stage {
  position: relative; width: 100%; aspect-ratio: 3 / 2;
  overflow: hidden; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface-2);
}
.room-wall {
  position: absolute; inset: 0 0 35% 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent-tint) 70%, var(--surface-2)),
    var(--surface-2));
}
.room-floor {
  position: absolute; inset: 65% 0 0 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 65%, var(--accent-soft)), var(--surface-2)),
    repeating-linear-gradient(90deg, transparent 0 48px, var(--line-soft) 48px 49px);
}
.room-avatar {
  position: absolute; left: 50%; bottom: 5%; z-index: 2;
  height: 76%; width: auto; transform: translateX(-50%);
  object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .18));
}
.room-item { position: absolute; z-index: 3; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .16)); line-height: 1; }
.room-chair { left: 5%; bottom: 7%; font-size: 38px; z-index: 1; }
.room-plant { right: 4%; bottom: 5%; font-size: 42px; }
.room-shelf { left: 3%; top: 27%; font-size: 40px; }
.room-lamp { right: 5%; top: 8%; font-size: 38px; }
.room-poster { left: 50%; top: 3%; transform: translateX(-50%); font-size: 40px; }
.room-cushion { left: 50%; bottom: 1%; transform: translateX(-50%); font-size: 38px; z-index: 4; }
.room-window { right: 24%; top: 4%; font-size: 42px; }
.room-clock { left: 24%; top: 4%; font-size: 30px; }
.shop-items { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px;
}
.shop-item.is-owned { border-color: var(--accent-2); }
.shop-item-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); font-size: 23px; }
.shop-item-main { flex: 1; min-width: 0; }
.shop-item-main h3 { margin: 0 0 2px; font-size: 13.5px; }
.shop-item-main p { margin: 0; color: var(--ink-3); font-size: 11px; font-weight: 700; }
.shop-item .btn { flex: none; padding: 8px 13px; font-size: 12px; }
.shop-item .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.app-card { display: block; }
.app-card p { margin-bottom: 0; }
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .room-panel { flex-direction: column; align-items: stretch; }
  .room-panel > .room-stage { width: 100%; }
}
@media (max-width: 640px) {
  .brand-text { display: none; }
  .shop-hero, .app-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .shop-hero { min-height: 340px; }
  .shop-hero-shade {
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 30%, transparent) 0%,
      color-mix(in srgb, var(--bg) 48%, transparent) 100%);
  }
  .wallet-card { width: 100%; }
  .wallet-chip { padding: 4px 7px; font-size: 11px; }
  .wallet-chip b { font-size: 12px; }
  .toast { bottom: 78px; max-width: calc(100% - 32px); }
}

/* ---------------- page characters ---------------- */
.page-cast {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
}
.page-char {
  position: absolute; bottom: -6px;
  height: clamp(110px, 15vw, 185px); width: auto;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .2));
}
.courses-cast .page-zun { left: 54%; }
.courses-cast .page-metan { right: 1.5%; }
.shop-cast .page-zun { left: 55%; }
.shop-cast .page-metan { right: 1.5%; }
.report-cast .page-zun { left: 52%; }
.report-cast .page-metan { right: 1.5%; }
.courses-cast .page-zun { animation: page-bob 5.4s ease-in-out infinite; }
.courses-cast .page-metan { animation: page-sway 6.6s ease-in-out infinite; animation-delay: -1.8s; }
.shop-cast .page-zun { animation: page-hop 3.8s ease-in-out infinite; }
.shop-cast .page-metan { animation: page-bob 4.8s ease-in-out infinite; animation-delay: -1.4s; }
.report-cast .page-zun { animation: page-sway 6.2s ease-in-out infinite; }
.report-cast .page-metan { animation: page-nod 5.6s ease-in-out infinite; animation-delay: -2s; }
@keyframes page-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
@keyframes page-sway {
  0%, 100% { transform: translateX(-3px) rotate(-1.4deg); }
  50% { transform: translateX(4px) rotate(1.4deg); }
}
@keyframes page-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-13px) scale(1.02); }
  62% { transform: translateY(-5px) scale(1.01); }
}
@keyframes page-nod {
  0%, 100% { transform: translateY(0) rotate(-.8deg); }
  50% { transform: translateY(-5px) rotate(1.6deg); }
}
.page-hero .hero-body, .course-hero .hero-body { position: relative; z-index: 2; }
.shop-hero-copy { z-index: 2; }

@media (max-width: 640px) {
  .course-hero, .progress-hero { min-height: 360px; }
  .page-hero .hero-body, .course-hero .hero-body { justify-content: flex-start; }
  .page-char { height: 100px; }
  .courses-cast .page-zun, .shop-cast .page-zun, .report-cast .page-zun { left: 7%; }
  .courses-cast .page-metan, .shop-cast .page-metan, .report-cast .page-metan { right: 4%; }
}

/* 最終上書き: テストの文字を本文と揃える */
.q-text { font-size: clamp(24px, 2.8vw, 30px); line-height: 1.5; }
.choice { font-size: 19px; line-height: 1.7; }
.choice-no { font-size: 14px; }
.q-chapter, .q-level, .quiz-count { font-size: 15px; }
.hint-btn { font-size: 16px; }
.hint-box { font-size: 17px; line-height: 1.9; }
.hint-lead { font-size: 15px; }
.fb-head { font-size: 19px; }
.fb-head span, .fb-why, .fb-lead, .fb-pit, .quiz-reaction { font-size: 17px; line-height: 1.8; }
.fb-steps li { font-size: 16px; }
.result-score { font-size: 24px; }
.result-msg { font-size: 17px; line-height: 1.8; }
.wrong-list li, .wrong-list b { font-size: 16px; }
