/* 原田英語の 英語語源辞典 — 共通スタイル
   方針：古い辞書・博物館の落ち着き × 今っぽいカード。スラング辞典よりきらびやかさを抑え、色は「インク紺・生成り・テラコッタ・青緑・黄土」に絞る。
   パーツの色：接頭辞＝青緑（--pre）／語根＝テラコッタ（--root）／接尾辞＝藍（--suf）／元の語＝黄土（--base） */

:root {
  --bg: #f4efe4;
  --bg-2: #ece5d6;
  --paper: #fffdf8;
  --paper-2: #faf6ec;
  --ink: #1f2a44;
  --ink-2: #48526b;
  --ink-3: #7a8197;
  --line: #1f2a44;
  --line-soft: #d9d0bd;
  --pre: #2a7f7a;
  --pre-bg: #e2f1ef;
  --root: #c8553d;
  --root-bg: #f8e6df;
  --suf: #4b5ba6;
  --suf-bg: #e6e9f6;
  --base: #a8841f;
  --base-bg: #f6efd8;
  --gold: #c9a227;
  --ok: #2f8a5b;
  --ng: #c2413b;
  --shadow: 3px 3px 0 var(--line);
  --shadow-lg: 5px 5px 0 var(--line);
  --r: 14px;
  --r-lg: 20px;
  --font: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  --serif: 'Fraunces', 'Georgia', 'Times New Roman', serif;
  --w: 1120px;
  --head-h: 64px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #121722;
  --bg-2: #0d111a;
  --paper: #1a2131;
  --paper-2: #1f2739;
  --ink: #ede6d6;
  --ink-2: #c4bfb2;
  --ink-3: #8f93a3;
  --line: #3a4560;
  --line-soft: #2c3449;
  --pre: #5cc0b8;
  --pre-bg: #173533;
  --root: #ec8a72;
  --root-bg: #3a2420;
  --suf: #97a5f0;
  --suf-bg: #23294a;
  --base: #e0bf5c;
  --base-bg: #3a321a;
  --gold: #e0bf5c;
  --shadow: 3px 3px 0 #0a0d14;
  --shadow-lg: 5px 5px 0 #0a0d14;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121722;
    --bg-2: #0d111a;
    --paper: #1a2131;
    --paper-2: #1f2739;
    --ink: #ede6d6;
    --ink-2: #c4bfb2;
    --ink-3: #8f93a3;
    --line: #3a4560;
    --line-soft: #2c3449;
    --pre: #5cc0b8;
    --pre-bg: #173533;
    --root: #ec8a72;
    --root-bg: #3a2420;
    --suf: #97a5f0;
    --suf-bg: #23294a;
    --base: #e0bf5c;
    --base-bg: #3a321a;
    --gold: #e0bf5c;
    --shadow: 3px 3px 0 #0a0d14;
    --shadow-lg: 5px 5px 0 #0a0d14;
    color-scheme: dark;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--paper); padding: 6px 10px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.en, .serif { font-family: var(--serif); }
.hidden, [hidden] { display: none !important; }

/* ---------- ヘッダー ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.head-in { max-width: var(--w); margin: 0 auto; height: var(--head-h); display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.logo-mark svg { width: 38px; height: 38px; display: block; }
.logo-txt { display: flex; flex-direction: column; line-height: 1.1; }
.logo-txt small { font-size: 0.66rem; color: var(--ink-3); font-weight: 700; letter-spacing: 0.06em; }
.logo-txt b { font-size: 1.05rem; font-weight: 900; letter-spacing: 0.02em; }
.head-search { position: relative; flex: 1; max-width: 440px; display: flex; align-items: center; }
.head-search > .ic { position: absolute; left: 12px; color: var(--ink-3); }
.head-search input {
  width: 100%;
  height: 42px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 0 14px 0 38px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
}
.head-search input::placeholder { color: var(--ink-3); }
.head-nav { display: flex; gap: 2px; margin-left: auto; }
.head-nav a { text-decoration: none; font-weight: 700; font-size: 0.86rem; padding: 7px 10px; border-radius: 9px; white-space: nowrap; }
.head-nav a:hover, .head-nav a[aria-current] { background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:active { transform: translate(1px, 1px); }

/* 検索の候補 */
.sugg {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  max-height: min(70vh, 460px);
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.sugg a, .sugg .sg-note { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
.sugg a:hover, .sugg a.on { background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--line-soft); }
.sugg .sg-w { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.sugg .sg-m { color: var(--ink-2); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.sugg .sg-k { font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1.5px solid currentColor; flex: none; }
.sg-k.k-root { color: var(--root); }
.sg-k.k-pre { color: var(--pre); }
.sg-k.k-suf { color: var(--suf); }
.sugg .sg-note { display: block; font-size: 0.84rem; color: var(--ink-2); line-height: 1.6; }
.sugg .sg-more { justify-content: center; font-weight: 700; font-size: 0.86rem; color: var(--root); }

/* ---------- 下のタブ（スマホ） ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .head-nav { display: none; }
  .head-in { gap: 10px; padding: 0 12px; }
  .logo-txt small { display: none; }
  .logo-txt b { font-size: 0.92rem; }
  .head-search { max-width: none; }
  .head-search input { height: 40px; font-size: 16px; }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    background: var(--paper);
    border-top: 2px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; text-decoration: none; font-size: 0.66rem; font-weight: 700; padding: 5px 0; border-radius: 10px; color: var(--ink-2); }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a[aria-current] { color: var(--root); background: var(--root-bg); }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .logo-txt { display: none; }
}

/* ---------- 本文 ---------- */
main { max-width: var(--w); margin: 0 auto; padding: 14px 16px 40px; }
.crumbs { font-size: 0.78rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 12px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a::after, .crumbs span::before { content: ''; }
.crumbs > * + *::before { content: '›'; margin-right: 4px; color: var(--ink-3); }
.page-h1 { font-size: clamp(1.45rem, 4.4vw, 2.1rem); line-height: 1.35; margin: 4px 0 10px; font-weight: 900; letter-spacing: 0.01em; }
.lead { color: var(--ink-2); margin: 0 0 18px; font-size: 0.97rem; }
h2, h3 { line-height: 1.4; }

.card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.blk {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  margin: 0 0 18px;
}
.blk-h { display: flex; align-items: center; gap: 8px; font-size: 1.08rem; font-weight: 900; margin: 0 0 12px; }
.blk-h .ic { width: 22px; height: 22px; color: var(--root); }
.blk-sub { font-size: 0.8rem; color: var(--ink-3); font-weight: 700; margin-left: auto; }
@media (max-width: 600px) {
  .blk { padding: 15px 15px 17px; border-radius: 16px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.93rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn.primary { background: var(--ink); color: var(--bg); }
:root[data-theme='dark'] .btn.primary { background: var(--gold); color: #1a1a1a; }
.btn.accent { background: var(--root); color: #fff; }
.btn.small { min-height: 36px; padding: 5px 13px; font-size: 0.84rem; }
.btn.ghost { box-shadow: none; }
.btn[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row.center { justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; font-weight: 700; border: 1.5px solid var(--line-soft); background: var(--paper-2); border-radius: 999px; padding: 2px 10px; white-space: nowrap; text-decoration: none; color: var(--ink-2); }
a.chip:hover { border-color: var(--line); color: var(--ink); }
.lv { display: inline-block; font-family: var(--serif); font-weight: 800; font-size: 0.74rem; color: #fff; border-radius: 6px; padding: 0 7px; line-height: 1.65; letter-spacing: 0.02em; }
.lv-A1 { background: #5f9a5c; }
.lv-A2 { background: #3f8f84; }
.lv-B1 { background: #4373ad; }
.lv-B2 { background: #6556a8; }
.lv-C1 { background: #b05f45; }
.lv-C2 { background: #8a3a48; }

/* ---------- トップ ---------- */
.hero {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--ink);
  color: #f7f1e3;
  margin-bottom: 22px;
  min-height: 420px;
  display: grid;
  align-items: end;
}
.hero-art { position: absolute; inset: 0; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18, 23, 34, 0.92) 0%, rgba(18, 23, 34, 0.72) 42%, rgba(18, 23, 34, 0.05) 75%); }
.hero-in { position: relative; padding: 34px 34px 30px; max-width: 620px; }
.hero-kicker { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--gold); letter-spacing: 0.04em; margin: 0 0 6px; }
.hero h1 { font-size: clamp(1.9rem, 5.4vw, 3rem); line-height: 1.22; margin: 0 0 12px; font-weight: 900; letter-spacing: 0.01em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.hero-lead { margin: 0 0 18px; font-size: 0.98rem; color: #e9e2d0; max-width: 34em; }
.hero-search { position: relative; display: flex; gap: 8px; max-width: 540px; }
.hero-search input { flex: 1; min-width: 0; height: 54px; border-radius: 16px; border: 2px solid #f7f1e3; background: #fffdf8; color: #1f2a44; font: inherit; font-size: 1.02rem; padding: 0 16px 0 46px; }
.hero-search > .ic { position: absolute; left: 15px; top: 17px; color: #7a8197; width: 20px; height: 20px; }
.hero-search button { height: 54px; border-radius: 16px; border: 2px solid #f7f1e3; background: var(--root); color: #fff; font-weight: 900; padding: 0 20px; cursor: pointer; }
.hero-search .sugg { color: var(--ink); }
.hero-try { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 0.8rem; align-items: center; color: #d8d0bc; }
.hero-try a { color: #fff; text-decoration: none; border: 1.5px solid rgba(255, 255, 255, 0.45); border-radius: 999px; padding: 1px 10px; font-family: var(--serif); }
.hero-try a:hover { background: rgba(255, 255, 255, 0.12); }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.hero-stats div { line-height: 1.2; }
.hero-stats b { font-family: var(--serif); font-size: 1.6rem; font-weight: 800; color: #fff; display: block; }
.hero-stats span { font-size: 0.72rem; color: #cfc7b3; font-weight: 700; }
@media (max-width: 700px) {
  .hero { min-height: 0; border-radius: 20px; }
  .hero-art { position: relative; height: 190px; }
  .hero-art::after { background: linear-gradient(180deg, rgba(18, 23, 34, 0) 40%, rgba(18, 23, 34, 1) 100%); }
  .hero-in { padding: 4px 18px 22px; }
  .hero-search input, .hero-search button { height: 50px; }
  .hero-search > .ic { top: 15px; }
  .hero-stats { gap: 16px; }
  .hero-stats b { font-size: 1.3rem; }
}

.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.sec-h h2 { font-size: 1.3rem; font-weight: 900; margin: 0; }
.sec-h .en { font-style: italic; color: var(--ink-3); font-size: 0.9rem; }
.sec-h a { margin-left: auto; font-size: 0.86rem; font-weight: 700; text-decoration: none; color: var(--root); white-space: nowrap; }

/* 今日の語源 */
.today {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  overflow: hidden;
}
.today-l { padding: 22px 24px; border-right: 2px solid var(--line); }
.today-r { padding: 22px 24px; background: var(--paper-2); }
.today-tag { display: flex; gap: 6px; align-items: center; font-size: 0.76rem; font-weight: 900; color: var(--root); letter-spacing: 0.04em; }
.today-w { font-family: var(--serif); font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 800; line-height: 1.05; margin: 6px 0 2px; text-decoration: none; display: inline-block; }
.today-m { font-weight: 700; margin: 4px 0 12px; }
.today-core { font-size: 0.86rem; color: var(--ink-2); }
.today-r p { margin: 0 0 12px; font-size: 0.93rem; color: var(--ink-2); }
@media (max-width: 760px) {
  .today { grid-template-columns: 1fr; }
  .today-l { border-right: 0; border-bottom: 2px solid var(--line); padding: 18px; }
  .today-r { padding: 16px 18px; }
}

/* タイル（入口） */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; transition: transform 0.15s, box-shadow 0.15s; }
.tile:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.tile img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.tile b { font-size: 1rem; font-weight: 900; }
.tile span { font-size: 0.8rem; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; } .tile { padding: 12px; } .tile img { width: 52px; height: 52px; } }

/* 語根カードの並び */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.rcard { display: flex; flex-direction: column; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.rcard:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.rcard .rc-img { aspect-ratio: 16/10; background: var(--paper-2); overflow: hidden; border-bottom: 2px solid var(--line); }
.rcard .rc-img img { width: 100%; height: 100%; object-fit: cover; }
.rcard .rc-b { padding: 9px 12px 11px; }
.rcard .rc-r { font-family: var(--serif); font-weight: 800; font-size: 1.25rem; color: var(--root); line-height: 1.2; }
.rcard .rc-m { font-size: 0.82rem; font-weight: 700; line-height: 1.45; }
.rcard .rc-n { font-size: 0.72rem; color: var(--ink-3); }
@media (max-width: 520px) { .rgrid { grid-template-columns: repeat(2, 1fr); gap: 9px; } .rcard .rc-r { font-size: 1.1rem; } }

/* 単語の一覧（コンパクト） */
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.wrow { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 9px 12px; border: 2px solid var(--line-soft); background: var(--paper); border-radius: 12px; min-width: 0; transition: border-color 0.12s, transform 0.12s; }
.wrow:hover { border-color: var(--line); transform: translateY(-1px); }
.wrow .wr-w { font-family: var(--serif); font-weight: 700; font-size: 1.06rem; flex: none; }
.wrow .wr-m { font-size: 0.8rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.wrow .lv { flex: none; }
.more-wrap { text-align: center; margin-top: 12px; }

/* ゲームのカード */
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gcard { display: flex; flex-direction: column; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.gcard:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.gcard .gc-img { aspect-ratio: 3/2; overflow: hidden; border-bottom: 2px solid var(--line); background: var(--paper-2); }
.gcard .gc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gcard:hover .gc-img img { transform: scale(1.04); }
.gcard .gc-b { padding: 11px 14px 13px; }
.gcard .gc-t { font-weight: 900; font-size: 1.02rem; }
.gcard .gc-s { font-size: 0.8rem; color: var(--ink-2); }
.gcard .gc-type { font-size: 0.68rem; font-weight: 900; color: var(--pre); letter-spacing: 0.06em; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding: 2px 4px 10px 2px; scroll-snap-type: x mandatory; }
.hscroll > * { scroll-snap-align: start; }
@media (max-width: 600px) { .hscroll { grid-auto-columns: 72%; } }

/* ランキング */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank li a { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; transition: transform 0.12s, box-shadow 0.12s; }
.rank li a:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.rank .rk-n { font-family: var(--serif); font-weight: 800; font-size: 1.6rem; color: var(--root); text-align: center; line-height: 1.1; }
.rank .rk-w { font-family: var(--serif); font-weight: 800; font-size: 1.25rem; }
.rank .rk-m { font-size: 0.82rem; color: var(--ink-2); margin-left: 6px; }
.rank .rk-c { font-size: 0.88rem; font-weight: 700; color: var(--ink); }
.rank .rk-s { font-size: 0.84rem; color: var(--ink-2); line-height: 1.65; margin-top: 2px; }

/* ---------- 単語ページ ---------- */
.w-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.w-side { position: sticky; top: calc(var(--head-h) + 14px); display: grid; gap: 14px; }
@media (max-width: 960px) { .w-layout { grid-template-columns: 1fr; } .w-side { position: static; } }

.w-hero { padding: 22px 24px 20px; margin-bottom: 18px; position: relative; overflow: hidden; }
.w-hero::before { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, var(--root-bg), transparent 70%); pointer-events: none; }
.w-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.w-word { font-family: var(--serif); font-weight: 800; font-size: clamp(2.6rem, 10vw, 4.4rem); line-height: 1.02; margin: 4px 0 6px; letter-spacing: -0.01em; word-break: break-word; }
.w-pron { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--ink-2); font-size: 0.95rem; }
.w-pron .ipa { font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', var(--serif); }
.w-mean { font-size: clamp(1.15rem, 3.6vw, 1.4rem); font-weight: 900; margin: 12px 0 4px; line-height: 1.5; }
.w-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); font-weight: 700; font-size: 0.86rem; cursor: pointer; }
.sbtn.play { background: var(--ink); color: var(--bg); }
:root[data-theme='dark'] .sbtn.play { background: var(--gold); color: #1a1a1a; }
.sbtn[aria-pressed='true'] { background: var(--gold); color: #1a1a1a; }
.sbtn.playing { animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 40%, transparent); } }

/* パーツ分解 */
.parts { display: flex; flex-wrap: wrap; gap: 0; justify-content: center; margin: 6px 0 4px; }
.part { display: flex; flex-direction: column; align-items: stretch; min-width: 74px; }
.part > a { display: flex; flex-direction: column; align-items: stretch; }
.part-f { text-align: center; }
.part-k, .part-m, .part-o { text-align: center; align-self: center; }
.part-f { font-family: var(--serif); font-weight: 800; font-size: clamp(1.5rem, 6vw, 2.3rem); padding: 4px 16px; border: 2.5px solid var(--line); background: var(--paper); line-height: 1.3; position: relative; }
.part + .part .part-f { border-left-width: 0; }
.part:first-child .part-f { border-radius: 14px 0 0 14px; }
.part:last-child .part-f { border-radius: 0 14px 14px 0; }
.part:only-child .part-f { border-radius: 14px; }
.part.k-pre .part-f { background: var(--pre-bg); color: var(--pre); }
.part.k-root .part-f { background: var(--root-bg); color: var(--root); }
.part.k-suf .part-f { background: var(--suf-bg); color: var(--suf); }
.part.k-base .part-f { background: var(--base-bg); color: var(--base); }
.part.k-link .part-f { background: var(--paper-2); color: var(--ink-3); font-size: 1.2rem; padding: 4px 6px; align-self: stretch; display: flex; align-items: center; }
.part.k-link { min-width: 0; }
.part-k { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.08em; margin-top: 7px; }
.part.k-pre .part-k { color: var(--pre); }
.part.k-root .part-k { color: var(--root); }
.part.k-suf .part-k { color: var(--suf); }
.part.k-base .part-k { color: var(--base); }
.part.k-link .part-k { color: var(--ink-3); }
.part-m { font-size: 0.86rem; font-weight: 700; text-align: center; max-width: 9.5em; line-height: 1.4; padding: 0 4px; }
.part-o { font-size: 0.7rem; color: var(--ink-3); text-align: center; max-width: 11em; line-height: 1.4; padding: 0 4px; margin-top: 2px; }
.part-i { display: block; width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 14px; border: 2px solid var(--line-soft); object-fit: cover; background: var(--paper-2); }
.part-i-empty { border-color: transparent; background: none; }
.part a { color: inherit; text-decoration: none; }
.part a:hover .part-f { text-decoration: underline; text-underline-offset: 4px; }
.formula { margin: 16px auto 0; max-width: 640px; text-align: center; background: var(--paper-2); border: 2px dashed var(--line-soft); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 0.98rem; }
.formula .arrow { color: var(--root); font-weight: 900; }
.core { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.core img { width: 84px; height: 84px; border-radius: 16px; border: 2px solid var(--line); object-fit: cover; flex: none; }
.core-t { font-size: 0.72rem; font-weight: 900; color: var(--root); letter-spacing: 0.08em; }
.core-b { font-size: 1.12rem; font-weight: 900; line-height: 1.45; }
@media (max-width: 520px) {
  .part { min-width: 0; }
  .part-f { padding: 3px 10px; }
  .part-m { font-size: 0.78rem; }
}

/* 語源ストーリー */
.story { font-size: 1.02rem; line-height: 2; margin: 0; }
.story p { margin: 0 0 0.6em; }
.story p { border-left: 4px solid var(--root-bg); padding-left: 14px; }

/* ことばの旅 */
.journey { list-style: none; margin: 4px 0 0; padding: 0; position: relative; display: grid; gap: 0; }
.journey::before { content: ''; position: absolute; left: 15px; top: 14px; bottom: 14px; width: 3px; background: repeating-linear-gradient(180deg, var(--line-soft) 0 6px, transparent 6px 11px); }
.journey li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 6px 0; position: relative; }
.journey .jdot { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--line); background: var(--paper); display: grid; place-items: center; font-size: 0.72rem; font-weight: 900; z-index: 1; }
.journey li:last-child .jdot { background: var(--root); color: #fff; }
.journey .jl { font-size: 0.74rem; font-weight: 900; color: var(--ink-3); letter-spacing: 0.04em; }
.journey .jf { font-family: var(--serif); font-weight: 800; font-size: 1.22rem; line-height: 1.3; }
.journey .jm { font-size: 0.86rem; color: var(--ink-2); }
.journey .jy { font-size: 0.72rem; font-weight: 700; color: var(--pre); border: 1.5px solid currentColor; border-radius: 999px; padding: 0 8px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }

/* 例文 */
.ex { border-left: 4px solid var(--pre); padding: 4px 0 4px 14px; }
.ex-en { font-family: var(--serif); font-size: 1.14rem; line-height: 1.65; font-weight: 500; }
.ex-en b { color: var(--root); font-weight: 800; }
.ex-ja { color: var(--ink-2); font-size: 0.92rem; margin-top: 4px; }
.colloc { margin-top: 12px; font-size: 0.92rem; }
.colloc b { font-family: var(--serif); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.two > .blk { margin: 0; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.note-blk { border-style: dashed; box-shadow: none; background: var(--paper-2); }
.hack-b { font-size: 1rem; font-weight: 700; line-height: 1.75; }
.tip-b { font-size: 0.95rem; line-height: 1.8; }

/* 仲間の単語 */
.cousins { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cousin { display: block; text-decoration: none; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line-soft); background: var(--paper); }
a.cousin:hover { border-color: var(--line); }
.cousin b { font-family: var(--serif); font-size: 1.05rem; display: block; line-height: 1.3; }
a.cousin b { color: var(--root); }
.cousin span { font-size: 0.8rem; color: var(--ink-2); line-height: 1.5; display: block; }
.siblings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sib { border: 2px solid var(--line-soft); border-radius: 12px; padding: 6px 12px; background: var(--paper-2); }
.sib small { display: block; font-size: 0.68rem; font-weight: 900; color: var(--ink-3); }
.sib b { font-family: var(--serif); font-size: 1.05rem; }
.sib span { font-size: 0.78rem; color: var(--ink-2); margin-left: 4px; }
.trivia { display: flex; gap: 12px; align-items: flex-start; background: var(--base-bg); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 0 0 18px; }
.trivia .ic { color: var(--base); width: 26px; height: 26px; margin-top: 2px; }
.trivia b { display: block; font-size: 0.76rem; letter-spacing: 0.08em; color: var(--base); }

/* ミニクイズ */
.mq-q { font-weight: 900; margin-bottom: 10px; }
.mq-q .en { font-size: 1.3rem; color: var(--root); }
.mq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mq-opts button { text-align: left; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 700; font-size: 0.9rem; min-height: 48px; }
.mq-opts button:hover:not(:disabled) { background: var(--paper-2); }
.mq-opts button.ok { background: color-mix(in srgb, var(--ok) 18%, var(--paper)); border-color: var(--ok); }
.mq-opts button.ng { background: color-mix(in srgb, var(--ng) 14%, var(--paper)); border-color: var(--ng); }
.mq-res { margin-top: 10px; font-size: 0.9rem; min-height: 1.5em; }
@media (max-width: 520px) {
  .cousins { grid-template-columns: 1fr 1fr; gap: 6px; }
  .cousin { padding: 7px 9px; }
  .journey li { padding: 3px 0; }
  .journey .jf { font-size: 1.08rem; }
  .w-acts .sbtn { height: 38px; padding: 0 11px; font-size: 0.8rem; }
}

/* よくある質問 */
.faq details { border-top: 1.5px solid var(--line-soft); padding: 10px 2px; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; gap: 8px; }
.faq summary::before { content: 'Q'; font-family: var(--serif); font-weight: 800; color: var(--root); }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 6px 0 0 20px; color: var(--ink-2); font-size: 0.93rem; }

/* サイドの小さな箱 */
.side-box { padding: 14px 16px; }
.side-box h3 { font-size: 0.86rem; font-weight: 900; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.side-root { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.side-root img { width: 64px; height: 64px; border-radius: 12px; border: 2px solid var(--line); }
.side-root b { font-family: var(--serif); font-size: 1.3rem; color: var(--root); display: block; line-height: 1.2; }
.side-root span { font-size: 0.8rem; color: var(--ink-2); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 18px; }
.pn a { display: block; text-decoration: none; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); }
.pn a small { display: block; font-size: 0.7rem; color: var(--ink-3); font-weight: 700; }
.pn a b { font-family: var(--serif); font-size: 1.1rem; }
.pn a:last-child { text-align: right; }

/* ---------- 語根ページ ---------- */
.r-hero { display: grid; grid-template-columns: 260px 1fr; gap: 0; overflow: hidden; margin-bottom: 18px; }
.r-hero .r-img { border-right: 2px solid var(--line); background: var(--paper-2); }
.r-hero .r-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.r-hero .r-b { padding: 20px 24px; }
.r-kind { font-size: 0.74rem; font-weight: 900; letter-spacing: 0.08em; color: var(--root); }
.r-name { font-family: var(--serif); font-weight: 800; font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1.05; margin: 2px 0 4px; color: var(--root); }
.r-hero.k-pre .r-kind, .r-hero.k-pre .r-name { color: var(--pre); }
.r-hero.k-suf .r-kind, .r-hero.k-suf .r-name { color: var(--suf); }
.r-var { font-size: 0.86rem; color: var(--ink-2); }
.r-mean { font-size: 1.3rem; font-weight: 900; margin: 8px 0 6px; }
.r-origin { font-size: 0.9rem; color: var(--ink-2); }
.r-count { display: inline-flex; gap: 6px; align-items: baseline; margin-top: 10px; font-weight: 700; }
.r-count b { font-family: var(--serif); font-size: 1.8rem; color: var(--root); }
@media (max-width: 700px) {
  .r-hero { grid-template-columns: 1fr; }
  .r-hero .r-img { border-right: 0; border-bottom: 2px solid var(--line); }
  .r-hero .r-img img { aspect-ratio: 16/9; }
  .r-hero .r-b { padding: 16px 18px; }
}
/* 語根の家系図（放射状） */
.tree-wrap { position: relative; max-width: 640px; margin: 0 auto; }
.tree-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.tree-wrap .t-line { stroke: var(--line-soft); stroke-width: 2; }
.tree-wrap .t-center circle { fill: var(--root); stroke: var(--line); stroke-width: 2.5; }
.tree-wrap .t-center text { fill: #fff; font-family: var(--serif); font-weight: 800; font-size: 26px; }
.tree-wrap .t-node rect { fill: var(--paper); stroke: var(--line); stroke-width: 2; }
.tree-wrap .t-node.in rect { fill: var(--root-bg); }
.tree-wrap .t-node text { fill: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 15px; }
.tree-wrap .t-node a:hover rect { stroke: var(--root); stroke-width: 3; }

/* 文字の索引 */
.abc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.abc a { width: 38px; height: 38px; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; text-decoration: none; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); text-transform: uppercase; }
.abc a[aria-current] { background: var(--ink); color: var(--bg); }

/* タブ（レベルなど） */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tabs a, .tabs button { text-decoration: none; padding: 6px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: 700; font-size: 0.86rem; cursor: pointer; }
.tabs a[aria-current], .tabs button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }

/* 説明の文章（about など） */
.prose { font-size: 1rem; line-height: 1.95; }
.prose h2 { font-size: 1.25rem; font-weight: 900; margin: 26px 0 10px; padding-left: 12px; border-left: 5px solid var(--root); }
.prose h3 { font-size: 1.05rem; font-weight: 900; margin: 18px 0 6px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin: 10px 0 16px; }
.prose th, .prose td { border: 1.5px solid var(--line-soft); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper-2); }

/* フッター */
.site-foot { border-top: 2px solid var(--line); background: var(--ink); color: #e9e2d0; margin-top: 30px; }
:root[data-theme='dark'] .site-foot { background: #0b0f17; }
.foot-in { max-width: var(--w); margin: 0 auto; padding: 30px 16px 26px; }
.foot-name { font-weight: 900; font-size: 1.1rem; margin: 0 0 4px; color: #fff; }
.foot-desc { font-size: 0.86rem; color: #cfc7b3; margin: 0 0 18px; max-width: 46em; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.foot-cols a { display: block; color: #e9e2d0; text-decoration: none; font-size: 0.86rem; padding: 3px 0; }
.foot-cols a:hover { color: var(--gold); }
.foot-h { font-size: 0.74rem; letter-spacing: 0.1em; color: var(--gold); font-weight: 900; margin: 0 0 6px; }
.foot-owner { font-size: 0.78rem; color: #b8b09c; margin: 22px 0 6px; }
.foot-owner a { color: #fff; }
.foot-copy { font-size: 0.74rem; color: #8f8878; margin: 0; }
@media (max-width: 700px) { .foot-cols { grid-template-columns: 1fr 1fr; } .foot-cols > div:last-child { grid-column: 1 / -1; } }

/* お知らせ（トースト） */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 0.88rem; z-index: 99; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }

/* 動き（JS が動くときだけ最初に隠す。JS が無ければ最初から見える） */
html.js [data-reveal] { opacity: 0; }
html.js.no-motion [data-reveal] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; }
  * { animation: none !important; transition: none !important; }
}

/* 見つからなかった語 */
.miss-box { text-align: center; padding: 26px 18px; }
.miss-box .big { font-family: var(--serif); font-size: 2.2rem; font-weight: 800; }
.miss-box p { color: var(--ink-2); }

/* 印刷 */
@media print {
  .site-head, .tabbar, .site-foot, .w-acts, .mq, .w-side { display: none !important; }
  body { background: #fff; }
  .blk, .card { box-shadow: none; }
}

/* ---------- 追加の部品 ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.w-word { display: block; }
.stars { color: var(--gold); font-size: 0.72rem; letter-spacing: -1px; margin-left: 6px; white-space: nowrap; }
.stars.dim { color: var(--line-soft); }

/* 参考書風の一覧表 */
.tbl-wrap { overflow-x: auto; }
.ltable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ltable th { text-align: left; font-size: 0.74rem; color: var(--ink-3); font-weight: 900; padding: 6px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.ltable td { padding: 8px; border-bottom: 1.5px solid var(--line-soft); vertical-align: top; line-height: 1.55; }
.ltable tr:nth-child(even) td { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.ltable .c-chk { width: 34px; text-align: center; }
.ltable .c-chk input { width: 20px; height: 20px; accent-color: var(--root); cursor: pointer; }
.ltable .c-f { font-family: var(--serif); font-weight: 800; font-size: 1.08rem; white-space: nowrap; }
.ltable .c-f a { color: var(--root); text-decoration: none; }
.ltable .c-f small { display: block; font-family: var(--font); font-weight: 500; font-size: 0.7rem; color: var(--ink-3); white-space: normal; }
.ltable .c-m { font-weight: 700; }
.ltable .c-m small.pos { display: block; font-weight: 500; color: var(--pre); font-size: 0.76rem; }
.ltable .c-ex { font-family: var(--serif); font-size: 0.92rem; color: var(--ink-2); }
.ltable .c-ex a { color: var(--ink); }
@media (max-width: 600px) {
  .ltable { font-size: 0.84rem; }
  .ltable td { padding: 7px 5px; }
  .ltable .c-ex { display: none; }
  .ltable th:last-child { display: none; }
}
tr:has(input:checked) td { opacity: 0.55; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.catcard { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; text-align: center; padding: 10px 6px; border: 2px solid var(--line-soft); border-radius: 14px; background: var(--paper); }
.catcard:hover { border-color: var(--line); }
.catcard img { width: 72px; height: 72px; border-radius: 14px; }
.catcard b { font-size: 0.8rem; line-height: 1.35; }
.catcard span { font-size: 0.7rem; color: var(--ink-3); }
.cat-ic { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); }
details.blk > summary { cursor: pointer; list-style: none; margin: 0; }
details.blk > summary::-webkit-details-marker { display: none; }
details.blk > summary::after { content: '+'; margin-left: 10px; font-weight: 900; font-size: 1.3rem; color: var(--root); }
details.blk[open] > summary::after { content: '−'; }
details.blk[open] > summary { margin-bottom: 12px; }
details.blk > summary .blk-sub { margin-left: auto; }

.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mcard { display: flex; flex-direction: column; gap: 4px; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); transition: transform 0.15s; }
.mcard:hover { transform: translate(-2px, -2px); }
.mcard b { font-size: 1rem; font-weight: 900; }
.mcard span { font-size: 0.82rem; color: var(--ink-2); line-height: 1.6; }
.mcard small { font-size: 0.72rem; color: var(--root); font-weight: 900; }

/* 読みもの（記憶術・ミニ知識） */
.mtech { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 10px; }
.mt-card { padding: 16px 18px; position: relative; }
.mt-card h3 { font-size: 1.04rem; font-weight: 900; margin: 0 0 6px; padding-right: 36px; }
.mt-card p { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.85; }
.mt-n { position: absolute; right: 14px; top: 10px; font-family: var(--serif); font-weight: 800; font-size: 1.3rem; color: var(--line-soft); }
.mt-nick { display: inline-block; font-size: 0.74rem !important; font-weight: 900; color: var(--root); border: 1.5px solid currentColor; border-radius: 999px; padding: 0 10px; }
.mt-steps { margin: 0 0 8px; padding-left: 1.4em; font-size: 0.88rem; }
.mt-steps li { margin: 2px 0; }
.mt-ex { font-family: var(--serif); font-size: 0.95rem !important; background: var(--paper-2); border-radius: 10px; padding: 6px 10px; }
.mt-in { font-size: 0.84rem !important; color: var(--pre); font-weight: 700; }
.mt-src { font-size: 0.74rem !important; color: var(--ink-3); }
.plan { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.plan li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; font-size: 0.92rem; }
.plan b { color: var(--root); }

/* アクセントの法則 */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-bottom: 8px; }
.acc-card { padding: 16px 18px; }
.acc-top h3 { font-size: 1.05rem; font-weight: 900; margin: 2px 0 6px; }
.acc-nick { display: inline-block; font-size: 0.72rem; font-weight: 900; color: #fff; background: var(--root); border-radius: 999px; padding: 1px 10px; }
.acc-rule { font-weight: 700; margin: 0 0 10px; font-size: 0.94rem; }
.acc-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.acc-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-ex { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line-soft); background: var(--paper); border-radius: 12px; padding: 4px 10px; cursor: pointer; }
.acc-ex:hover { border-color: var(--line); }
.acc-ex .ic { color: var(--ink-3); width: 16px; height: 16px; }
.syl { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; letter-spacing: 0.01em; }
.syl i { font-style: normal; color: var(--ink-3); margin: 0 1px; }
.syl .st { color: var(--root); font-weight: 900; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.acc-ex .ipa { font-size: 0.8rem; color: var(--ink-3); }
.acc-m { font-size: 0.84rem; color: var(--ink-2); }
.acc-m small { display: block; font-size: 0.74rem; color: var(--ink-3); }
.acc-exh { font-size: 0.74rem; font-weight: 900; color: var(--ng); margin: 6px 0 4px; }
.acc-why { font-size: 0.88rem; background: var(--base-bg); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.acc-why .ic { color: var(--base); }
.acc-exam { font-size: 0.86rem; margin: 6px 0; }
.acc-exam b { display: inline-block; background: var(--ink); color: var(--bg); border-radius: 6px; padding: 0 7px; margin-right: 8px; font-size: 0.72rem; }
@media (max-width: 520px) { .acc-grid, .mtech { grid-template-columns: 1fr; } }

/* 単語帳 */
.mb-stats { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; margin-bottom: 18px; overflow: hidden; }
.mb-stats > div { padding: 14px 16px; border-left: 2px solid var(--line-soft); display: flex; flex-direction: column; }
.mb-stats > div:first-child { border-left: 0; background: var(--ink); color: var(--bg); }
.mb-stats small { font-size: 0.72rem; font-weight: 900; opacity: 0.7; }
.mb-stats b { font-family: var(--serif); font-size: 1.7rem; line-height: 1.2; }
.mb-stats > div:first-child b { font-family: var(--font); font-size: 1.3rem; color: var(--gold); }
.mb-stats span { font-size: 0.74rem; opacity: 0.8; }
@media (max-width: 600px) { .mb-stats { grid-template-columns: 1fr 1fr; } .mb-stats > div:first-child { grid-column: 1 / -1; } .mb-stats > div:nth-child(2) { border-left: 0; } }
.rv-card { max-width: 520px; margin: 14px auto 0; padding: 22px; text-align: center; }
.rv-n { font-size: 0.78rem; color: var(--ink-3); font-weight: 700; }
.rv-w { font-family: var(--serif); font-size: 2.6rem; font-weight: 800; margin: 4px 0 8px; }
.rv-m { font-size: 1.15rem; font-weight: 900; margin: 12px 0 4px; }
.rv-e { color: var(--ink-2); font-size: 0.9rem; }
.rv-btns { margin-top: 16px; }

/* ゲームの枠（共通） */
.game-head { margin-bottom: 12px; }
.game-stage { max-width: 760px; margin: 0 auto; padding: 20px; min-height: 360px; position: relative; }
.game-loading { text-align: center; color: var(--ink-3); padding: 60px 0; }

/* 絵で分かる語源 */
.w-art { margin: 0 0 16px; position: relative; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper-2); }
.w-art img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.w-art figcaption { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); background: rgba(31, 42, 68, 0.88); color: #fff; font-weight: 900; font-size: 0.98rem; padding: 6px 14px; border-radius: 999px; }
.rank li a.has-img { grid-template-columns: 44px 150px 1fr; }
.rank .rk-img { width: 150px; height: 100px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); }
@media (max-width: 600px) {
  .rank li a.has-img { grid-template-columns: 34px 96px 1fr; gap: 9px; }
  .rank .rk-img { width: 96px; height: 64px; }
  .rank .rk-n { font-size: 1.3rem; }
}
@media (max-width: 520px) {
  .w-hero { padding: 16px 16px 14px; }
  .w-acts { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 44px; gap: 6px; }
  .w-acts .sbtn { justify-content: center; padding: 0 4px; gap: 4px; font-size: 0.76rem; height: 40px; }
  .w-mean { margin-top: 8px; }
}

/* ---------- トップ：入口はシンプルに ---------- */
.hero-simple { min-height: 340px; }
.hero-simple h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); }
.door { margin: 26px 0; }
.door-h { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.door-n { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 1.3rem; }
.door-h h2 { margin: 0; font-size: 1.4rem; font-weight: 900; }
.door-h p { margin: 2px 0 0; color: var(--ink-2); font-size: 0.92rem; }
.lvgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.lvbtn { position: relative; display: flex; flex-direction: column; gap: 2px; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 14px 16px; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.lvbtn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.lvbtn b { font-family: var(--serif); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.lvbtn span { font-size: 0.8rem; font-weight: 700; line-height: 1.4; }
.lvbtn small { font-size: 0.74rem; color: var(--ink-3); }
.lvbtn .lvbar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--paper-2); }
.lvbtn .lvbar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.6s; }
.lvb-A1 b { color: #5f9a5c; } .lvb-A2 b { color: #3f8f84; } .lvb-B1 b { color: #4373ad; } .lvb-B2 b { color: #6556a8; } .lvb-C1 b { color: #b05f45; } .lvb-C2 b { color: #8a3a48; }
:root[data-theme='dark'] .lvbtn b { filter: brightness(1.5); }
.door-more { font-size: 0.86rem; color: var(--ink-2); margin: 12px 0 0; }
.door-more a { color: var(--root); font-weight: 700; }
.door3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.d3 { display: grid; grid-template-columns: 84px 1fr; grid-template-rows: auto auto 1fr; column-gap: 14px; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; transition: transform 0.15s, box-shadow 0.15s; align-items: start; }
.d3:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }
.d3 img { grid-row: 1 / 4; width: 84px; height: 84px; border-radius: 14px; }
.d3 b { font-size: 1.12rem; font-weight: 900; }
.d3 span { font-size: 0.84rem; font-weight: 700; color: var(--root); }
.d3 small { font-size: 0.8rem; color: var(--ink-2); font-family: var(--serif); }
.smalls { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 26px 0 8px; }
.smalls a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; text-align: center; font-size: 0.8rem; font-weight: 700; padding: 12px 6px; border: 2px solid var(--line-soft); background: var(--paper); border-radius: 14px; line-height: 1.4; }
.smalls a:hover { border-color: var(--line); }
.smalls img { width: 40px; height: 40px; border-radius: 10px; }
.smalls .ic { width: 30px; height: 30px; color: var(--root); }
.top-about { margin-top: 26px; font-size: 0.9rem; color: var(--ink-2); }
.top-about h2 { font-size: 1.05rem; }
@media (max-width: 860px) {
  .lvgrid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .door3 { grid-template-columns: 1fr; gap: 10px; }
  .d3 { grid-template-columns: 64px 1fr; padding: 12px; }
  .d3 img { width: 64px; height: 64px; }
  .smalls { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) {
  .lvbtn { padding: 10px 10px 14px; border-radius: 14px; }
  .lvbtn b { font-size: 1.6rem; }
  .lvbtn span { font-size: 0.72rem; }
  .door-h h2 { font-size: 1.2rem; }
}

/* ---------- 単語帳 ---------- */
.tango { padding: 16px 18px 18px; margin-bottom: 18px; }
.tg-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.tg-prog { flex: 1; min-width: 200px; }
.tg-prog span { font-size: 0.86rem; font-weight: 700; }
.tg-prog b { font-family: var(--serif); font-size: 1.2rem; color: var(--ok); }
.tg-bar { display: block; height: 10px; border-radius: 99px; background: var(--paper-2); border: 1.5px solid var(--line-soft); overflow: hidden; margin-top: 4px; }
.tg-bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.5s; }
.tg-ctl { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0 4px; }
.tg-ctl .tabs { margin: 0; }
.tg-ctl .tabs button { font-size: 0.8rem; padding: 5px 12px; }
.tg-note { font-size: 0.8rem; color: var(--ink-3); margin: 6px 0 10px; }
.tg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tw { border-bottom: 1.5px solid var(--line-soft); display: grid; grid-template-columns: 1fr 40px; align-items: stretch; }
.tw-h { display: grid; grid-template-columns: minmax(90px, auto) auto 1fr 26px; align-items: center; gap: 12px; text-align: left; background: none; border: 0; padding: 11px 4px; cursor: pointer; min-width: 0; }
.tw-h:hover { background: var(--paper-2); }
.tw-w { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; }
.tw-p { font-family: var(--serif); font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.tw-p i { font-style: normal; color: var(--ink-3); margin: 0 1px; }
.tw-p .k-pre { color: var(--pre); } .tw-p .k-root { color: var(--root); } .tw-p .k-suf { color: var(--suf); } .tw-p .k-base { color: var(--base); } .tw-p .k-link { color: var(--ink-3); }
.tw-m { font-size: 0.86rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tw-ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-soft); }
.tw.done .tw-ck { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--paper); }
.tw.done .tw-w { color: var(--ok); }
.tw-go { display: grid; place-items: center; text-decoration: none; font-size: 1.5rem; color: var(--ink-3); border-left: 1.5px solid var(--line-soft); }
.tw-go:hover { color: var(--root); background: var(--paper-2); }
.tw-h[aria-expanded='true'] { background: var(--root-bg); }
.tw-d { grid-column: 1 / -1; padding: 14px 6px 18px; border-top: 1.5px dashed var(--line-soft); }
.tw-load { color: var(--ink-3); font-size: 0.86rem; }
.tw-art { margin: 0 auto 12px; max-width: 520px; position: relative; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.tw-art img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.tw-art figcaption { position: absolute; left: 10px; bottom: 10px; background: rgba(31, 42, 68, 0.88); color: #fff; font-weight: 900; font-size: 0.88rem; padding: 4px 12px; border-radius: 999px; }
.tw-parts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; align-items: center; }
.tw-parts > i { font-style: normal; font-weight: 900; color: var(--ink-3); }
.tw-part { display: inline-flex; flex-direction: column; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 4px 12px; background: var(--paper); min-width: 64px; }
.tw-part b { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; }
.tw-part small { font-size: 0.62rem; font-weight: 900; letter-spacing: 0.06em; }
.tw-part span { font-size: 0.78rem; font-weight: 700; }
.tw-part.k-pre { background: var(--pre-bg); color: var(--pre); } .tw-part.k-root { background: var(--root-bg); color: var(--root); } .tw-part.k-suf { background: var(--suf-bg); color: var(--suf); } .tw-part.k-base { background: var(--base-bg); color: var(--base); }
.tw-part span { color: var(--ink); }
.tw-f { text-align: center; font-weight: 700; margin: 10px 0 4px; }
.tw-c { text-align: center; font-size: 0.9rem; margin: 4px 0; }
.tw-mean { text-align: center; font-weight: 900; font-size: 1.05rem; margin: 6px 0; }
.tw-ipa { display: block; font-weight: 500; font-size: 0.82rem; color: var(--ink-3); }
.tw-ex { max-width: 560px; margin: 8px auto; border-left: 4px solid var(--pre); padding-left: 12px; }
.tw-ex p { margin: 2px 0; font-size: 0.88rem; color: var(--ink-2); }
.tw-ex p.en { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.tw-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.tw-acts .sbtn { text-decoration: none; height: 36px; font-size: 0.8rem; }
.tg-group { list-style: none; margin-top: 14px; }
.tg-group a, .tg-other { display: flex; align-items: baseline; gap: 10px; text-decoration: none; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 7px 14px; }
.tg-group b { font-size: 1.3rem; color: var(--gold); }
.tg-group span { font-size: 0.86rem; font-weight: 700; }
.tg-group small { margin-left: auto; font-size: 0.74rem; opacity: 0.8; }
.tg-other { background: var(--paper-2); color: var(--ink-2); font-weight: 700; font-size: 0.86rem; }
.credit { font-size: 0.74rem; color: var(--ink-3); margin-top: 16px; }
@media (max-width: 600px) {
  .tango { padding: 12px 10px 14px; }
  .tw-h { grid-template-columns: auto 1fr 22px; gap: 8px; padding: 10px 2px; }
  .tw-p { display: none; }
  .tw-w { font-size: 1.05rem; }
  .tw { grid-template-columns: 1fr 34px; }
}

/* カードでめくる */
.fc-ov { position: fixed; inset: 0; z-index: 80; background: rgba(13, 17, 26, 0.72); display: grid; place-items: center; padding: 16px; }
.fc-box { width: min(520px, 100%); background: var(--bg); border: 2px solid var(--line); border-radius: 22px; padding: 14px; box-shadow: var(--shadow-lg); }
.fc-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.86rem; margin-bottom: 10px; }
.fc-card { min-height: 300px; background: var(--paper); border: 2.5px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; cursor: pointer; text-align: center; gap: 6px; perspective: 800px; }
.fc-w { font-family: var(--serif); font-size: clamp(2.2rem, 10vw, 3.2rem); font-weight: 800; }
.fc-w.small { font-size: 1.6rem; }
.fc-hint { color: var(--ink-3); font-size: 0.84rem; }
.fc-img { width: 100%; max-width: 380px; aspect-ratio: 3/2; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); }
.fc-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.fc-btns .btn { min-width: 120px; }

/* ---------- メニュー（ハンバーガー） ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; }
.dr-bg { position: absolute; inset: 0; background: rgba(13, 17, 26, 0.55); }
.dr-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: var(--bg); border-left: 2px solid var(--line); overflow-y: auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
.dr-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dr-top b { font-size: 1.05rem; }
.dr-home { display: flex; align-items: center; gap: 8px; font-weight: 900; text-decoration: none; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); }
.dr-h { font-size: 0.72rem; font-weight: 900; color: var(--root); letter-spacing: 0.08em; margin: 16px 0 6px; }
.dr-g { display: grid; gap: 2px; }
.dr-g a { text-decoration: none; font-weight: 700; font-size: 0.95rem; padding: 9px 10px; border-radius: 10px; }
.dr-g a:hover { background: var(--paper); }
.dr-lv { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.dr-lv a { text-align: center; font-size: 0.95rem; padding: 7px 0; text-decoration: none; border-radius: 10px; }
.menu-btn { margin-left: 0; }
/* 上へ戻る */
.to-top { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 44; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.to-top:hover { background: var(--ink); color: var(--bg); }
@media (max-width: 860px) { .to-top { bottom: calc(78px + env(safe-area-inset-bottom)); right: 12px; width: 44px; height: 44px; } }

/* ---------- ヒーローの動き ---------- */
.kenburns { overflow: hidden; }
.kenburns img { animation: kb 26s ease-in-out infinite alternate; transform-origin: 62% 45%; }
@keyframes kb { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
.hero-sparks { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hero-sparks i { position: absolute; bottom: 8%; border-radius: 50%; background: radial-gradient(circle, #fff6c8 0%, #e8c45a 45%, rgba(232, 196, 90, 0) 70%); box-shadow: 0 0 10px 2px rgba(255, 220, 120, 0.55); animation: rise var(--d) linear infinite; opacity: 0; }
.hero-sparks i.leaf { border-radius: 60% 0 60% 0; background: #c8553d; box-shadow: none; }
@keyframes rise { 0% { transform: translate(0, 0) scale(0.6); opacity: 0; } 12% { opacity: 0.95; } 80% { opacity: 0.7; } 100% { transform: translate(var(--x), -360px) scale(1.1) rotate(200deg); opacity: 0; } }
.hero-art::after { z-index: 2; }
.hero h1 .ch { display: inline-block; }
.hero h1 em .ch { background: linear-gradient(100deg, #e7c25a 20%, #fff3c4 45%, #e7c25a 70%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 4.5s ease-in-out infinite; }
@keyframes shine { 0%, 60% { background-position: 120% 0; } 100% { background-position: -100% 0; } }
.hero-ticker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 64px; margin: 0 0 16px; }
.tk-parts { display: inline-flex; align-items: center; gap: 4px; }
.tk-parts > i { font-style: normal; color: #cfc7b3; font-weight: 900; }
.tk-p { display: inline-flex; flex-direction: column; align-items: center; border: 2px solid rgba(255, 255, 255, 0.8); border-radius: 10px; padding: 2px 10px; background: rgba(255, 253, 248, 0.12); backdrop-filter: blur(3px); }
.tk-p b { font-family: var(--serif); font-size: 1.25rem; line-height: 1.2; }
.tk-p small { font-size: 0.68rem; color: #e9e2d0; font-weight: 700; }
.tk-p.k-pre b { color: #8fe0d8; }
.tk-p.k-root b { color: #ffb39f; }
.tk-p.k-suf b { color: #b9c3ff; }
.tk-p.k-base b { color: #f3d98a; }
.tk-eq { font-weight: 900; color: #cfc7b3; font-size: 1.2rem; }
.tk-w { font-family: var(--serif); font-weight: 800; font-size: 1.6rem; color: #fff; text-decoration: none; }
.tk-c { flex-basis: 100%; font-size: 0.82rem; color: #e7c25a; font-weight: 700; }
@media (max-width: 700px) {
  .hero-ticker { min-height: 58px; margin-bottom: 12px; }
  .tk-p b { font-size: 1.05rem; }
  .tk-w { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .kenburns img, .hero-sparks i, .hero h1 em .ch { animation: none !important; }
}
.hero-in { z-index: 4; }

/* ---------- Codex の講評を受けた調整 ---------- */
:root { --ink-3: #626a80; }
:root[data-theme='dark'] { --ink-3: #a3a7b5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --ink-3: #a3a7b5; } }
.btn.primary { background: var(--root); color: #fff; }
:root[data-theme='dark'] .btn.primary { background: var(--root); color: #1a1a1a; }
.lead, .tw-m, .wr-m, .cousin span { color: var(--ink-2); }
/* 単語ページの目次 */
.w-toc { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: -6px 0 12px; scrollbar-width: none; }
.w-toc::-webkit-scrollbar { display: none; }
.w-toc a { flex: none; text-decoration: none; font-size: 0.8rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line-soft); background: var(--paper); white-space: nowrap; }
.w-toc a:hover { border-color: var(--line); }
@media (max-width: 600px) {
  .blk { border-width: 1.5px; box-shadow: 2px 2px 0 var(--line); }
  .w-art img { aspect-ratio: auto; height: 210px; }
  .hero-art { height: 150px; }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
/* アクセント法則：読みやすい1列 */
.acc-grid { grid-template-columns: 1fr; max-width: 880px; margin-left: auto; margin-right: auto; }
.acc-list { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
section > .sec-h { max-width: 880px; margin-left: auto; margin-right: auto; }

/* ---------- 読みものページ：文字の壁にしない ---------- */
.jump { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; font-size: 0.86rem; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); }
.jump a .ic { color: var(--root); }
.pts { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.pts li { font-size: 0.92rem; line-height: 1.75; }
.pts li::marker { color: var(--root); }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; font-weight: 700; font-size: 0.84rem; color: var(--root); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '＋'; font-weight: 900; }
details.more[open] summary::before { content: '－'; }

/* 記憶術 */
.tq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.tq { padding: 18px; }
.tq-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.tq-n { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--ink); color: var(--gold); display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 1.4rem; }
.tq-nick { margin: 0; font-size: 1.15rem; font-weight: 900; color: var(--root); line-height: 1.3; }
.tq h3 { margin: 0; font-size: 0.86rem; font-weight: 700; color: var(--ink-2); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.flow li { position: relative; background: var(--paper-2); border: 1.5px solid var(--line-soft); border-radius: 12px; padding: 8px 12px; font-size: 0.88rem; line-height: 1.65; }
.flow li + li { margin-top: 18px; }
.flow li + li::before { content: '▼'; position: absolute; top: -17px; left: 50%; transform: translateX(-50%); color: var(--root); font-size: 0.7rem; }
.fl-n { display: block; font-size: 0.66rem; font-weight: 900; color: var(--pre); letter-spacing: 0.08em; }
.fam { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.fam-root { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--root); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 1.05rem; text-decoration: none; border: 2px solid var(--line); }
.fam-words { display: flex; flex-wrap: wrap; gap: 5px; }
.fam-words a, .fam-words span { font-family: var(--serif); font-weight: 700; font-size: 0.88rem; padding: 2px 10px; border-radius: 999px; border: 1.5px solid var(--line-soft); background: var(--paper); text-decoration: none; }
.fam-words a:hover { border-color: var(--root); color: var(--root); }
.insite { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 0.84rem; font-weight: 700; color: var(--pre); }
.insite .ic { flex: none; margin-top: 3px; }
.sci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sci { padding: 16px; }
.sci-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--pre-bg); color: var(--pre); display: grid; place-items: center; margin-bottom: 8px; }
.sci-ic .ic { width: 26px; height: 26px; }
.sci h3 { font-size: 1rem; font-weight: 900; margin: 0 0 8px; }
.sci-try { margin: 0; font-size: 0.9rem; background: var(--base-bg); border-radius: 12px; padding: 8px 12px; line-height: 1.7; }
.sci-try b { display: block; font-size: 0.7rem; color: var(--base); letter-spacing: 0.08em; }
.plan-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.plan-tabs button { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 0.86rem; cursor: pointer; }
.plan-tabs button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.plan-card { padding: 16px 18px; }
.plan-who { font-size: 0.86rem; color: var(--ink-2); margin: 0 0 10px; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 33px; top: 8px; bottom: 8px; width: 3px; background: var(--line-soft); }
.tl li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 6px 0; position: relative; }
.tl-d { justify-self: start; z-index: 1; background: var(--root); color: #fff; font-weight: 900; font-size: 0.78rem; border-radius: 999px; padding: 4px 10px; height: fit-content; }
.tl li p { margin: 0; font-size: 0.9rem; line-height: 1.75; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pf { padding: 16px; }
.pf-ng { margin: 0 0 8px; font-weight: 900; color: var(--ng); }
.pf-ok { margin: 0; font-size: 0.9rem; font-weight: 700; color: var(--ok); line-height: 1.7; }

/* 受験ミニ知識 */
.tip-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; }
.tip-bar span { font-weight: 700; font-size: 0.88rem; }
.tip-bar b { font-family: var(--serif); font-size: 1.2rem; color: var(--ok); }
.tip-bar .tg-bar { flex: 1; min-width: 120px; margin: 0; }
.tip-tags button small { margin-left: 4px; font-size: 0.7rem; opacity: 0.7; }
.tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.tip-card { padding: 0; overflow: hidden; }
.tip-card.read { border-color: var(--ok); }
.tip-front { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 16px; cursor: pointer; position: relative; }
.tip-front:hover { background: var(--paper-2); }
.tip-n { position: absolute; right: 14px; top: 10px; font-family: var(--serif); font-weight: 800; font-size: 1.4rem; color: var(--line-soft); }
.tip-card.read .tip-n::after { content: ' ✓'; color: var(--ok); font-size: 1rem; }
.tip-tg { display: flex; gap: 5px; }
.tip-tg i { font-style: normal; font-size: 0.7rem; font-weight: 900; color: var(--pre); border: 1.5px solid currentColor; border-radius: 999px; padding: 0 8px; }
.tip-t { font-weight: 900; font-size: 1.05rem; line-height: 1.5; padding-right: 36px; }
.tip-ex { display: flex; flex-wrap: wrap; gap: 5px; }
.tip-ex span { font-family: var(--serif); font-weight: 700; font-size: 0.95rem; background: var(--root-bg); color: var(--root); border-radius: 8px; padding: 1px 9px; }
.tip-open { font-size: 0.76rem; font-weight: 700; color: var(--ink-3); }
.tip-front[aria-expanded='true'] .tip-open { display: none; }
.tip-back { padding: 0 16px 16px; border-top: 1.5px dashed var(--line-soft); }
.tip-exs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.tex { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; text-decoration: none; padding: 2px 10px; border: 1.5px solid var(--line-soft); border-radius: 10px; background: var(--paper); }
a.tex:hover { border-color: var(--root); }
.tex .acc { color: var(--root); font-weight: 900; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 3px; }

/* 語源とは：円グラフ・年表 */
.donut { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin: 6px 0 18px; }
.donut svg { width: 210px; height: 210px; flex: none; }
.dn-n { font-family: var(--serif); font-weight: 800; font-size: 26px; fill: var(--ink); }
.dn-l { font-size: 12px; fill: var(--ink-3); font-weight: 700; }
.donut ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; flex: 1; min-width: 200px; }
.donut li { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; font-size: 0.92rem; }
.donut li i { width: 16px; height: 16px; border-radius: 4px; }
.donut li span { font-family: var(--serif); font-weight: 800; font-size: 1.1rem; }
.hist { list-style: none; padding: 0; margin: 6px 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.hist li { background: var(--paper-2); border: 2px solid var(--line-soft); border-radius: 14px; padding: 10px 12px; position: relative; }
.hist li::before { content: ''; position: absolute; left: 12px; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--root); border: 2px solid var(--paper); }
.hy { display: inline-block; font-size: 0.72rem; font-weight: 900; color: #fff; background: var(--ink); border-radius: 999px; padding: 1px 10px; }
.hist b { display: block; margin: 6px 0 2px; font-size: 0.95rem; }
.hist p { margin: 0; font-size: 0.82rem; line-height: 1.65; color: var(--ink-2); }
@media (max-width: 520px) {
  .tq-grid, .sci-grid, .pf-grid, .tip-grid { grid-template-columns: 1fr; }
}

/* スマホのはみ出し防止 */
.w-layout { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 960px) { .w-layout { grid-template-columns: minmax(0, 1fr); } }
.w-main, .w-side, .blk, .card { min-width: 0; }
main { overflow-wrap: anywhere; }
.w-word, .r-name { overflow-wrap: anywhere; }

/* 出典の行 */
.srcline { font-size: 0.78rem; color: var(--ink-3); margin: 10px 0 0; line-height: 1.7; }
.srcline a { color: var(--ink-2); }
.srcs { padding-left: 1.2em; }
.srcs li { margin: 0 0 10px; }
.srcs span { font-size: 0.86rem; color: var(--ink-2); }
