:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #1b2130;
  --muted: #5d6679;
  --border: #dde2ec;
  --accent: #2f5bd3;
  --accent-soft: #e4ebfd;
  --gold: #b8860b;
  --ok: #1f8a4c;
  --ok-soft: #e1f5e9;
  --ng: #c23a3a;
  --ng-soft: #fbe6e6;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .05);
  --l600: #4a9b6e;
  --l730: #2f7fc1;
  --l860: #8a5bd1;
  --l990: #c0782a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141b; --surface: #1a1e28; --surface-2: #232837; --text: #e8ebf2; --muted: #9aa3b5;
    --border: #2e3446; --accent: #7c9cf5; --accent-soft: #24304f; --gold: #e0b450;
    --ok: #4cc583; --ok-soft: #173326; --ng: #ef7676; --ng-soft: #3a1d1f;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #11141b; --surface: #1a1e28; --surface-2: #232837; --text: #e8ebf2; --muted: #9aa3b5;
  --border: #2e3446; --accent: #7c9cf5; --accent-soft: #24304f; --gold: #e0b450;
  --ok: #4cc583; --ok-soft: #173326; --ng: #ef7676; --ng-soft: #3a1d1f;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif; line-height: 1.7; font-size: 16px;
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { background: var(--gold); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 13px; margin-right: 4px; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 14px; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; width: 36px; height: 32px; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }

h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 10px; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ng { background: var(--ng); color: #fff; border-color: var(--ng); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar select, .toolbar input[type=search] {
  font: inherit; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.toolbar input[type=search] { flex: 1; min-width: 160px; }
.toolbar select { max-width: 100%; min-width: 0; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.lv { color: #fff; font-weight: 600; }
.lv-600 { background: var(--l600); } .lv-730 { background: var(--l730); } .lv-860 { background: var(--l860); } .lv-990 { background: var(--l990); }

.stat { font-size: 28px; font-weight: 700; }
.stat small { font-size: 14px; color: var(--muted); font-weight: 400; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* vocab */
.vocab-list { display: grid; gap: 10px; }
.vitem { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.vitem.known { opacity: .6; }
.vhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.vword { font-size: 19px; font-weight: 700; }
.vmeaning { font-weight: 500; }
.vphrase { margin-top: 4px; }
.vphrase b { color: var(--accent); }
.vphrase .ja { color: var(--muted); font-size: 14px; margin-left: 6px; }
.vmore { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 14px; }
.vmore .ja, .muted { color: var(--muted); }
.vactions { margin-left: auto; display: flex; gap: 6px; }
.ipa { color: var(--muted); font-family: "Lucida Sans Unicode", "Segoe UI", "Arial Unicode MS", sans-serif; font-size: 14px; }
.winfo { margin-top: 6px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.wtag { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 0 6px; flex-shrink: 0; }
.wtag.warn { color: var(--ng); background: var(--ng-soft); }
.wl b { font-weight: 600; }
.icon-btn {border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 2px 8px; font-size: 13px; }
.icon-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }

/* flashcard */
.flash { max-width: 560px; margin: 0 auto; text-align: center; }
.fcard { min-height: 280px; display: flex; flex-direction: column; justify-content: center; gap: 10px; cursor: pointer; padding: 28px 20px; }
.fcard .fja { font-size: 18px; color: var(--muted); }
.fcard .fen { font-size: 24px; font-weight: 600; }
.fcard .blank { color: var(--accent); letter-spacing: 2px; }
.fcard .answer { font-size: 30px; font-weight: 700; color: var(--accent); }
.progress-text { color: var(--muted); font-size: 14px; margin: 10px 0; }

/* questions */
.qcard { margin-bottom: 16px; }
.qsentence { font-size: 18px; margin-bottom: 14px; }
.qsentence .gap { display: inline-block; min-width: 80px; border-bottom: 2px solid var(--accent); }
.choices { display: grid; gap: 8px; }
.choice {
  text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.choice:disabled { cursor: default; }
.choice.correct { background: var(--ok-soft); border-color: var(--ok); }
.choice.wrong { background: var(--ng-soft); border-color: var(--ng); }
.choice .lbl { font-weight: 700; margin-right: 8px; color: var(--muted); }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.feedback .verdict { font-weight: 700; }
.feedback .verdict.ok { color: var(--ok); } .feedback .verdict.ng { color: var(--ng); }
.qmeta { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin-bottom: 8px; }

.passage { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; font-size: 15px; line-height: 1.8; margin-bottom: 14px; }
.passage .plabel { display: block; font-weight: 700; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.passage .blank-mark { background: var(--accent-soft); color: var(--accent); font-weight: 700; padding: 0 6px; border-radius: 4px; }
.translation { white-space: pre-wrap; font-size: 14px; color: var(--muted); }
details summary { cursor: pointer; color: var(--accent); margin: 8px 0; }

.topic-card { cursor: pointer; transition: border-color .15s; text-decoration: none; color: inherit; display: block; }
.topic-card:hover { border-color: var(--accent); }
.points li { margin-bottom: 4px; }
.example { padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); margin: 8px 0; border-radius: 0 8px 8px 0; }
.tip { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin-top: 12px; }
.score-big { font-size: 48px; font-weight: 700; color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 学習記録 */
.week-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 14px; padding: 14px 18px 10px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wk-bar { width: 100%; max-width: 32px; height: 90px; background: var(--surface-2); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.wk-bar span { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; }
.wk-val { font-size: 12px; color: var(--muted); min-height: 16px; }
.wk-day { font-size: 12px; font-weight: 600; }
.daily-check { cursor: pointer; }
.daily-check input { margin-right: 4px; }
.daily-check.is-done { opacity: .6; }
.daily-check.is-done > div:last-child { text-decoration: line-through; }

/* ドリル */
.ps-senses { margin: 8px 0 0; padding-left: 22px; }
.ps-senses li { margin-bottom: 8px; }
.ps-ex { font-size: 14px; margin-top: 2px; }
.ps-ex b, .qsentence b { color: var(--accent); }
.pat-ex { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px dashed var(--border); }
.pat-ok { font-weight: 800; font-size: 18px; line-height: 1.4; }
.pat-ok.ok { color: var(--ok); }
.pat-ok.ng { color: var(--ng); }
.pat-hidden { color: transparent; background: var(--surface-2); border-radius: 6px; cursor: pointer; user-select: none; }
.pat-hidden::after { content: "タップで英文を表示"; color: var(--muted); font-size: 12px; margin-left: 6px; }

/* クラウド保存（合言葉） */
.sync-card { margin-bottom: 12px; }
.sync-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: 1px; word-break: break-all;
  background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 4px 0 8px; user-select: all; }
.sync-input { font: inherit; flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.sync-alert { border-left: 4px solid #f0a500; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.sync-hist .row { padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }

/* 書き出し・復習キュー・誤りの印 */
.backup.warn { border-color: var(--ng); }
.rq-note { margin-top: 8px; font-size: 13px; }
.rq-banner { display: flex; flex-direction: column; gap: 2px; margin: 14px 0; border-left: 5px solid var(--accent); }
.rq-banner .muted { font-size: 13px; }
.suspect-btn { margin-top: 10px; border: 1px dashed var(--border); background: transparent; color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.suspect-btn.on { border-style: solid; border-color: #f0a500; color: #b77d00; background: rgba(240, 165, 0, .12); }
.icon-btn.warn-on { background: #f0a500; border-color: #f0a500; color: #fff; }
.suspect-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.suspect-row:first-child { border-top: 0; }

/* ミスの原因分類 */
.miss-picker { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.miss-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.miss-chip.on { background: var(--ng); border-color: var(--ng); color: #fff; }
.miss-row { padding: 8px 0; border-top: 1px solid var(--border); }
.miss-row:first-child { border-top: 0; }
.miss-row-head { display: flex; justify-content: space-between; }
.miss-row .bar > span { background: var(--ng); }

/* Part 6/7 ストップウォッチ */
.stopwatch { position: sticky; top: 58px; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; font-size: 14px; }
.stopwatch.over { border-color: var(--ng); }
.stopwatch.over b, .stopwatch.over .sw-done { color: var(--ng); }
.stopwatch.over .bar > span { background: var(--ng); }
.sw-done { font-weight: 600; color: var(--ok); margin-top: 4px; }

/* リスニング */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.tab { flex: 1; min-width: 92px; text-align: center; padding: 8px 6px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; background: var(--surface); font-weight: 600; }
.tab small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.tab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.l-scene { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.l-graphic { margin: 8px 0 12px; }
.l-graphic-title { font-weight: 700; font-size: 14px; }
.l-script { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 15px; }
.l-line { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.l-letters { margin: 8px 0; }
.l-letter { min-width: 64px; font-size: 18px; font-weight: 700; }
.l-letter.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.l-letter.ng { background: var(--ng); border-color: var(--ng); color: #fff; }
.l-hidden { display: none; }
.l-q { margin-top: 12px; }

/* 模試 */
.mock-bar { position: sticky; top: 58px; z-index: 6; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  background: var(--g-head, #24324f); color: #fff; border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; font-size: 14px; }
.mock-bar .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
.mock-bar .btn.primary { background: var(--accent); border-color: var(--accent); }
.m-warn b { color: #ffb4a8; }
.choice.m-sel { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.m-flag.on { background: #f0a500; border-color: #f0a500; color: #fff; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; margin-bottom: 14px; }
.m-grid[hidden] { display: none; }
.m-cell { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 4px 0; font-size: 12px; }
.m-cell.done { background: var(--accent-soft); border-color: var(--accent); }
.m-cell.flag { background: #f0a500; border-color: #f0a500; color: #fff; }
.m-cell.cur { outline: 2px solid var(--text); }
.m-over { color: var(--ng); font-weight: 700; }
.m-ans { margin: 6px 0; font-size: 15px; }
.est-box { border: 2px dashed var(--accent); border-radius: 10px; padding: 10px 14px; margin: 12px auto 4px; max-width: 460px; }
.est-head { font-size: 13px; font-weight: 700; color: var(--accent); }
.est-total { font-size: 30px; font-weight: 800; }
.est-total small { font-size: 14px; font-weight: 400; color: var(--muted); }
.ng-text { color: var(--ng); }
.ok-text { color: var(--ok); font-weight: 600; }

@media (max-width: 640px) {
  .stopwatch, .mock-bar { top: 96px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .theme-btn { margin-left: auto; }
  h1 { font-size: 22px; }
  .qsentence { font-size: 16px; }
  .fcard .fen { font-size: 20px; }
}

/* デイリー5・連続日数 */
.d5-cta { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: #fff; background: var(--accent); border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.d5-cta b { font-size: 19px; }
.d5-cta span { font-size: 13px; opacity: .9; }
.d5-cta.done { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
.welcome { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; border-left: 5px solid var(--ok); text-decoration: none; color: inherit; }
.welcome .muted { font-size: 13px; }
.freeze-row { font-size: 15px; }
.freeze-row .muted { font-size: 12px; }
.wk-d5 { color: var(--ok); margin-left: 2px; font-size: 10px; }
.d5-week { display: flex; gap: 8px; margin-bottom: 14px; }
.d5-opt { display: block; font-size: 14px; margin: -6px 0 14px; }
.d5-day { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; max-width: 48px; }
.d5-day small { font-size: 11px; color: var(--muted); }
.d5-day.today small { color: var(--accent); font-weight: 700; }
.d5-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); }
.d5-dot.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.d5-dot.frozen { background: var(--accent-soft); border-color: var(--accent); }
.d5-bar { margin: 0 0 12px; }
.d5-result { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.d5-done { font-weight: 700; color: var(--ok); }
.d5-streak { font-size: 44px; font-weight: 800; }
.d5-streak small { font-size: 16px; font-weight: 400; color: var(--muted); }
.d5-ms { font-weight: 700; color: var(--gold); }
.d5-goal { background: var(--accent-soft); border-radius: 10px; padding: 6px 12px; }
.d5-ctas { justify-content: center; margin-top: 8px; }
.d5-ctas a.btn { text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); pointer-events: none; }

/* コンボ演出（固定配置なのでレイアウトに影響しない） */
.fx-pop { position: fixed; z-index: 40; pointer-events: none; font-family: Inter, sans-serif; font-weight: 800; font-size: 15px; color: var(--accent);
  background: var(--surface); border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px; white-space: nowrap;
  animation: fx-float .6s ease-out forwards; }
.fx-pop.big { font-size: 20px; padding: 4px 14px; box-shadow: 0 0 0 4px var(--accent-soft); }
.fx-pop.crit { color: #fff; background: var(--gold); border-color: var(--gold); }
@keyframes fx-float { 0% { opacity: 0; transform: translateY(6px) scale(.9); } 20% { opacity: 1; transform: translateY(0) scale(1.05); } 100% { opacity: 0; transform: translateY(-18px) scale(1); } }
.fx-gold { animation: fx-gold .6s ease-out; }
@keyframes fx-gold { 0% { box-shadow: 0 0 0 0 rgba(224, 180, 80, .9); } 100% { box-shadow: 0 0 0 10px rgba(224, 180, 80, 0); } }
.fx-text { font-size: 13px; color: var(--accent); margin-left: 6px; }
.fx-text.crit { color: var(--gold); }
@media (prefers-reduced-motion: reduce) {
  .fx-pop, .fx-gold { animation: none; }
}

/* 3つのリング */
.rings-card { margin-bottom: 14px; }
.rings-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.rings-card.rest .rings { opacity: .75; }
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.ring-dial { position: relative; width: 72px; height: 72px; margin: 0 auto; }
.ring-dial svg { display: block; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.ring-fg { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .9s ease-out; }
.no-motion .ring-fg { transition: none; }
.ring-vocab .ring-fg { stroke: var(--accent); }
.ring-q .ring-fg { stroke: var(--ok); }
.ring-rev .ring-fg { stroke: var(--gold); }
.ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.ring-num small { font-size: 11px; color: var(--muted); font-weight: 400; }
.ring.closed .ring-num { font-size: 22px; color: var(--ok); }
.ring-label { font-weight: 600; font-size: 14px; margin-top: 2px; }
.ring-sub { font-size: 12px; color: var(--muted); min-height: 36px; line-height: 1.4; }
.ring-spurt { color: var(--text); border-bottom: 2px solid var(--gold); }
.ring-week { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font-size: 14px; }
.ring-week .muted { font-size: 12px; }
.ring-week-note { margin-top: 8px; font-size: 13px; color: var(--ok); font-weight: 600; }
.ring-pips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; }
.ring-pip { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ring-pip span { width: 100%; max-width: 28px; height: 18px; border-radius: 5px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.ring-pip i { display: block; width: 100%; background: var(--ok); }
.ring-pip small { font-size: 11px; color: var(--muted); }
.ring-pip.today small { color: var(--accent); font-weight: 700; }
.ring-pip.rest span { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 3px, transparent 3px, transparent 6px); }
.rings-ctas { margin-top: 10px; }
.rings-ctas a.btn { text-decoration: none; }
.rings-ctas .btn, .bonus-offer .btn { min-height: 40px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; }
.bonus-offer { position: fixed; right: 16px; bottom: 72px; z-index: 45; display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--accent);
  border-radius: 12px; padding: 8px 10px 8px 14px; box-shadow: var(--shadow); font-weight: 600; max-width: calc(100vw - 32px); }
.bonus-offer a.btn { text-decoration: none; }

/* 花火（固定配置・クリックを邪魔しない） */
.fw-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fw-layer i { position: absolute; width: 7px; height: 7px; border-radius: 50%; opacity: 0; animation: fw-burst 1.1s ease-out forwards; }
@keyframes fw-burst { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 30px)) scale(.4); } }

/* 復習モンスター */
.mon-banner { border-left-color: var(--gold); }
.mon-card { text-align: center; }
.mon-stage { margin-bottom: 12px; }
.mon-face { font-size: 72px; line-height: 1.1; display: inline-block; }
.mon-face.calm { font-size: 56px; }
.mon-name { font-weight: 700; }
.mon-hp { display: flex; align-items: center; gap: 10px; max-width: 360px; margin: 6px auto 0; font-size: 14px; font-weight: 600; }
.mon-hp-bar { flex: 1; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.mon-hp-bar span { display: block; height: 100%; background: var(--ng); transition: width .4s ease-out; }
.no-motion .mon-hp-bar span { transition: none; }
.mon-card .qsentence, .mon-card .choices, .mon-card .feedback, .mon-card .qmeta { text-align: left; }
.mon-card .qmeta { flex-wrap: wrap; gap: 4px 8px; }
.mon-hit { animation: mon-hit .4s ease-out; }
@keyframes mon-hit { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px) rotate(-6deg); filter: brightness(1.6); } 40% { transform: translateX(8px) rotate(4deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.mon-defeat { animation: mon-defeat .9s ease-in forwards; }
@keyframes mon-defeat { 0% { transform: scale(1); opacity: 1; } 30% { transform: scale(1.2) rotate(-10deg); } 100% { transform: scale(0) rotate(360deg); opacity: 0; } }
.mon-win { font-size: 20px; font-weight: 800; color: var(--gold); }
.mon-next { display: inline-block; text-align: left; margin: 8px auto; padding-left: 20px; }
.mon-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.mon-rest { font-size: 12px; }
.mon-result { display: flex; flex-direction: column; gap: 4px; align-items: center; }

/* 自己ベスト＋ゴースト */
.pb-stats, .pb-res-row { display: flex; gap: 24px; }
.pb-stats small, .pb-res-row small { display: block; font-size: 12px; color: var(--muted); }
.pb-stats b { font-size: 20px; }
.pb-res-row { justify-content: center; }
.pb-res-row b { font-size: 30px; }
.pb-hist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pb-nc { opacity: .6; }
.pb-hud { position: sticky; top: 58px; z-index: 5; margin-bottom: 12px; padding: 10px 16px; }
.pb-time b { font-size: 22px; font-variant-numeric: tabular-nums; }
.pb-track { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; }
.pb-lbl { width: 54px; flex-shrink: 0; color: var(--muted); }
.pb-lane { flex: 1; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.pb-me, .pb-ghost { display: block; height: 100%; width: 0; transition: width .1s linear; }
.pb-me { background: var(--accent); }
.pb-ghost { background: var(--muted); opacity: .8; }
.pb-result { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pb-new { font-size: 30px; font-weight: 800; color: var(--gold); letter-spacing: 1px; }
.pb-msg { font-weight: 600; }
.pb-break { font-size: 13px; }
@media (max-width: 640px) {
  .pb-hud { top: 96px; padding: 6px 12px; }
  .pb-time b { font-size: 16px; }
  .pb-track { margin-top: 2px; font-size: 12px; }
  .pb-lane { height: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ring-fg, .mon-hp-bar span, .pb-me, .pb-ghost { transition: none; }
  .mon-hit, .mon-defeat, .fw-layer i { animation: none; }
}

/* テーマ別単語図鑑 */
.zk-total { font-size: 13px; margin: -8px 0 12px; }
.zk-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.zk-card { display: flex; gap: 10px; align-items: center; padding: 12px 14px; }
.zk-card.done { border-color: var(--gold); }
.zk-emoji { font-size: 30px; line-height: 1; flex-shrink: 0; }
.zk-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.zk-left { font-size: 13px; }
.zk-card.done .zk-left { color: var(--gold); font-weight: 600; }
.zk-mini { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.zk-mini span { display: block; height: 100%; background: var(--accent); }
.zk-card.done .zk-mini span { background: var(--gold); }
.zk-words { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 10px; }
.zk-word { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.zk-word.got { border-color: var(--accent); background: var(--accent-soft); }
.zk-word.got .zk-w b { color: var(--accent); font-size: 16px; overflow-wrap: anywhere; }
.zk-m { font-size: 13px; }
.zk-word.sil { background: var(--surface-2); border-style: dashed; color: var(--muted); }
.zk-word.sil .zk-w { font-weight: 700; letter-spacing: 2px; filter: blur(.3px); }
.zk-meta { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.zk-days { font-size: 13px; color: var(--gold); letter-spacing: 1px; margin-left: auto; }
.zk-days .zk-off { color: var(--muted); }
.zk-note { width: 100%; font-size: 13px; color: var(--muted); }
.zk-note.got { color: var(--accent); font-weight: 700; }
.zk-result { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.zk-fin { background: var(--gold); color: var(--bg); }

/* 成長レポート */
.grow-card { margin-bottom: 14px; border-left: 5px solid var(--ok); }
.grow-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#growClose { min-width: 36px; min-height: 36px; }
.grow-list { list-style: none; margin: 8px 0; padding: 0; }
.grow-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; padding: 6px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.grow-list li:first-child { border-top: 0; }
.grow-list b { color: var(--ok); }
.grow-hist { padding: 6px 0; border-top: 1px solid var(--border); }
.grow-hist:first-child { border-top: 0; }

/* 学習プラン */
.plan-card { margin: 14px 0; }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.plan-sentence { font-size: 17px; font-weight: 700; margin: 6px 0; }
.plan-form { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 6px 0; }
.plan-form label[hidden] { display: none; }
.plan-form .plan-wide { grid-column: 1 / -1; }
.plan-form label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.plan-form select, .plan-form input { font-size: 15px; min-height: 36px; max-width: 100%; }
.plan-meter { margin-top: 12px; font-size: 14px; }
.plan-meter .bar > span { background: var(--ok); }

/* 弱点ボス戦 */
.boss-banner { border-left-color: var(--gold); }
.boss-rate { font-size: 16px; }
.boss-rate b { color: var(--accent); }
.ok-chip { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
