/* 語根ドリル(/gogen/)のデザイン。デザイン案: products/gogen-drill/design/ */
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --paper: #F7F5F0; --surface: #FFFFFF; --ink: #1C1B19; --body: #3A3833; --muted: #5E5B55;
  --line: #E4E0D8; --line-soft: #EEEAE2; --chip: #D9D4C9;
  --accent: #2F3E9E; --accent-hover: #1F2A73; --accent-soft: #ECEEF8; --on-accent: #FFFFFF;
  --prefix: #8A4B0F; --prefix-label: #7A440E; --prefix-soft: #FBF4EC;
  --ok: #1F6B4A; --ok-soft: #E8F3EC; --ok-ink: #14492F;
  --ng: #A3361F; --ng-soft: #FBEDE8; --ng-ink: #7A2716;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161513; --surface: #201F1C; --ink: #EDEBE6; --body: #D6D3CC; --muted: #A8A49B;
    --line: #36342F; --line-soft: #2C2A26; --chip: #4A4740;
    --accent: #9AA8F0; --accent-hover: #B8C2F5; --accent-soft: #232946; --on-accent: #141413;
    --prefix: #E0A867; --prefix-label: #E0A867; --prefix-soft: #33281A;
    --ok: #6FD3A2; --ok-soft: #173326; --ok-ink: #A8E8C8;
    --ng: #F0947D; --ng-soft: #3A1F18; --ng-ink: #F6BCAE;
  }
}
* { box-sizing: border-box; }
body.gogen { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.7; }
.gogen a { color: var(--accent); }
.gogen a:hover { color: var(--accent-hover); }
.en { font-family: var(--serif); }

/* 部品の色分け: 色だけに頼らず下線の形でも区別する */
.p-prefix { color: var(--prefix); border-bottom: 2px dotted var(--prefix); }
.p-root { color: var(--accent); border-bottom: 4px solid var(--accent); }
.p-suffix { color: var(--muted); border-bottom: 2px solid transparent; }
.word-parts .p-root { font-weight: 600; }

.g-top { border-bottom: 1px solid var(--line); }
.g-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.g-top .g-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.g-brand { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 17px; text-decoration: none; color: var(--ink) !important; }
.g-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.g-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--body); font-size: 14px; }
.crumbs { font-size: 13px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 28px; border-radius: 12px; background: var(--accent); color: var(--on-accent) !important; font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; border: 0; cursor: pointer; }
.btn:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--accent) !important; border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-block { display: flex; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--chip); background: var(--surface); color: var(--body) !important; font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.chip[aria-current="true"], .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent) !important; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { font-size: 12px; color: var(--muted); line-height: 1.8; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* トップ */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 32px; }
.hero-text { flex: 999 1 480px; min-width: 0; }
.hero-kicker { margin: 0 0 12px; font-size: 14px; color: var(--accent); font-weight: 700; }
.hero h1 { margin: 0; font-size: clamp(30px, 5vw, 44px); line-height: 1.35; }
.hero-lead { margin: 20px 0 0; font-size: 17px; line-height: 1.9; color: var(--body); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-card { flex: 1 1 340px; min-width: 0; padding: 28px; }
.big-word { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.hint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.hint { border-radius: 10px; padding: 10px 12px; }
.hint-prefix { background: var(--prefix-soft); }
.hint-root { background: var(--accent-soft); }
.hint-suffix { background: var(--paper); border: 1px solid var(--line); }
.hint-label { font-size: 11px; }
.hint-prefix .hint-label { color: var(--prefix-label); }
.hint-root .hint-label { color: var(--accent); }
.hint-suffix .hint-label { color: var(--muted); }
.hint-body { font-size: 15px; font-weight: 700; }
.root-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.root-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; color: var(--ink) !important; }
.root-card:hover { border-color: var(--accent); }
.root-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.root-card-root { font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--accent); }
.root-card-meaning { font-size: 14px; font-weight: 700; text-align: right; }
.root-card-ex { font-family: var(--serif); font-size: 14px; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.feature { padding: 20px; border-radius: 14px; }
.feature b { display: block; margin-bottom: 6px; }
.feature p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--body); }

/* 語根ページ */
.root-head { display: flex; flex-wrap: wrap; gap: 32px; padding-top: 40px; padding-bottom: 16px; }
.root-head-main { flex: 999 1 560px; min-width: 0; }
.root-h1 { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.root-h1 .en { font-size: clamp(40px, 8vw, 64px); font-weight: 600; color: var(--accent); line-height: 1.05; }
.root-h1 .ja { font-size: clamp(22px, 4vw, 30px); }
.root-text { margin: 20px 0 0; font-size: 16px; line-height: 1.95; color: var(--body); max-width: 40em; }
.root-side { flex: 1 1 300px; min-width: 0; align-self: flex-start; padding: 24px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.table-box { overflow-x: auto; }
.word-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.word-table th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.word-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.word-table th:first-child, .word-table td:first-child { padding-left: 20px; }
.word-table td.w { font-family: var(--serif); font-size: 18px; white-space: nowrap; }
.word-table td.lv { font-size: 13px; color: var(--muted); white-space: nowrap; }
.word-table tr:last-child td { border-bottom: 0; }

/* ドリル */
.drill { max-width: 520px; margin: 0 auto; padding: 8px 20px 40px; }
.drill-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.drill-bar select { font: inherit; font-size: 14px; color: var(--accent); background: var(--surface); border: 1px solid var(--chip); border-radius: 999px; padding: 0 14px; min-height: 44px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > div { height: 6px; background: var(--accent); border-radius: 3px; transition: width .2s; }
.q-card { margin-top: 18px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.q-card-head { display: flex; align-items: center; justify-content: space-between; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--accent); }
.q-word { font-family: var(--serif); font-size: clamp(34px, 10vw, 44px); font-weight: 600; letter-spacing: .3px; line-height: 1.15; overflow-wrap: anywhere; }
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.choice { font: inherit; font-size: 15px; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; border-radius: 12px; cursor: pointer; background: var(--surface); border: 1.5px solid var(--chip); color: var(--ink); text-align: left; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:disabled { cursor: default; }
.choice .badge { flex: none; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--line-soft); color: var(--muted); }
.choice .label { flex: 1; }
.choice .mark { font-size: 13px; font-weight: 700; }
.choice.is-right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-ink); }
.choice.is-right .badge { background: var(--ok); color: var(--on-accent); }
.choice.is-wrong { background: var(--ng-soft); border-color: var(--ng); color: var(--ng-ink); }
.choice.is-wrong .badge { background: var(--ng); color: var(--on-accent); }
.verdict { margin-top: 18px; border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1.5px solid; }
.verdict.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-ink); }
.verdict.ng { background: var(--ng-soft); border-color: var(--ng); color: var(--ng-ink); }
.verdict b { display: block; }
.verdict span { font-size: 13px; }
.explain { margin-top: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.pos { font-size: 12px; color: var(--muted); border: 1px solid var(--chip); border-radius: 6px; padding: 1px 8px; margin-right: 8px; }
.meaning { font-size: 18px; font-weight: 700; }
.explain p { margin: 0; }
.ex-en { font-family: var(--serif); font-size: 17px; line-height: 1.6; }
.ex-ja { font-size: 13px; color: var(--muted); margin-top: 4px !important; }
.family { margin-top: 14px; padding: 16px 20px; }
.family-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.family-row:last-child { border-bottom: 0; }
.family-row .en { font-size: 17px; }
.family-row .ja { font-size: 13px; color: var(--body); text-align: right; }
.sticky-next { margin-top: 18px; }
.summary { margin-top: 24px; padding: 28px 22px; text-align: center; }
.summary .score { font-size: 44px; font-weight: 700; color: var(--accent); }
.hidden { display: none !important; }
footer.g-foot { max-width: 1120px; margin: 0 auto; padding: 32px 24px 40px; color: var(--muted); font-size: 13px; }
footer.g-foot a { color: var(--muted); }
