/* 瞬間英作文1000。色は動画シリーズの紺＋金に合わせる */
:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #eceff7;
  --text: #151c33;
  --muted: #5a6480;
  --line: #d8deea;
  --primary: #1f2d6b;
  --primary-ink: #ffffff;
  --gold: #c98a12;
  --r0: #cf3b3b;  --r0-bg: #fbe7e7;
  --r1: #c27a0e;  --r1-bg: #fcefd9;
  --r2: #1a8a4c;  --r2-bg: #e2f4e9;
  --none: #c9d0de;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .07);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1220;
    --surface: #171d31;
    --surface-2: #20283f;
    --text: #e7ebf6;
    --muted: #9ba5c0;
    --line: #2c3551;
    --primary: #8ea4ff;
    --primary-ink: #0b1020;
    --gold: #f0be46;
    --r0: #f07474;  --r0-bg: #3a1d22;
    --r1: #eeac4a;  --r1-bg: #3a2c16;
    --r2: #4cc585;  --r2-bg: #163326;
    --none: #3a4461;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd {
  font-family: inherit; font-size: .8em;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 .4em; background: var(--surface); color: var(--muted);
}

.screen { max-width: 640px; margin: 0 auto; padding: 16px 16px 24px; }

/* ---- ボタン ---- */
.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 14px; font-weight: 700; transition: transform .06s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.big { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn.small { padding: 6px 10px; font-size: .9rem; }

/* ---- ホーム ---- */
.hero { text-align: center; padding: 8px 0 12px; }
.hero-sub { margin: 0; color: var(--muted); font-size: .9rem; }
.hero h1 { margin: 2px 0 4px; font-size: 1.9rem; letter-spacing: .04em; color: var(--primary); }
.hero h1 span { color: var(--gold); margin-left: .15em; }
.today { color: var(--muted); font-size: .9rem; min-height: 1.4em; }
.today b { color: var(--text); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.sum-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--none); }
.sum-bar i, .gbar i { display: block; height: 100%; }
.c0 { background: var(--r0); } .c1 { background: var(--r1); } .c2 { background: var(--r2); }
.sum-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
.sum-legend li::before { content: ""; display: inline-block; width: .7em; height: .7em; border-radius: 3px; margin-right: .35em; background: var(--none); vertical-align: -.05em; }
.sum-legend li.l0::before { background: var(--r0); }
.sum-legend li.l1::before { background: var(--r1); }
.sum-legend li.l2::before { background: var(--r2); }
.sum-legend b { color: var(--text); }

.sec { font-size: .95rem; color: var(--muted); margin: 20px 2px 8px; font-weight: 700; }

.genres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.genre {
  text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.genre.all { grid-column: 1 / -1; }
.genre[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent); }
.genre .gname { font-weight: 700; font-size: .88rem; line-height: 1.3; }
.genre .gbar { margin-top: auto; }
.genre .gname small { color: var(--gold); margin-right: .35em; font-weight: 800; }
.gbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--none); }
.genre .gstat { font-size: .78rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: .92rem; font-weight: 700;
}
.chip small { font-weight: 400; color: var(--muted); margin-left: .3em; }
.chip[aria-checked="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.chip[aria-checked="true"] small { color: inherit; opacity: .8; }

.setting { display: flex; flex-direction: column; gap: 10px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--none); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch:checked { background: var(--r2); }
.switch:checked::after { left: 23px; }
.setting .chips.off { opacity: .45; }
.switch-row small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }

.howto { margin-top: 20px; color: var(--muted); font-size: .9rem; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto ol { padding-left: 1.3em; margin: 8px 0; }
.note { margin: 6px 0; }

.start-wrap { position: sticky; bottom: 0; padding: 16px 0 4px; background: linear-gradient(to bottom, transparent, var(--bg) 35%); margin-top: 8px; }

/* ---- 出題 ---- */
#quiz { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.qbar { display: flex; align-items: center; gap: 8px; }
.qprog { flex: 1; text-align: center; font-size: .85rem; color: var(--muted); font-weight: 700; }
.track { height: 5px; background: var(--none); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.track div { height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.icon { font-size: 1.25rem; min-width: 44px; }

.card {
  margin-top: 14px; flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; cursor: pointer;
  -webkit-user-select: none; user-select: none; outline: none;
}
.card.open { cursor: default; -webkit-user-select: text; user-select: text; }
.card:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent); }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; }
.meta span { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.meta .prev.p0 { background: var(--r0-bg); color: var(--r0); }
.meta .prev.p1 { background: var(--r1-bg); color: var(--r1); }
.meta .prev.p2 { background: var(--r2-bg); color: var(--r2); }
.ja { font-size: 1.45rem; font-weight: 700; line-height: 1.55; margin: auto 0 0; padding: 20px 0 4px; text-align: center; }
.card.open .ja { font-size: 1.05rem; color: var(--muted); margin: 14px 0 0; padding: 0; text-align: left; font-weight: 500; }
.answer { margin: auto 0; padding: 16px 0 4px; }
.en { font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1.45; margin: 0 0 8px; color: var(--primary); }
.play { padding-left: 0; color: var(--primary); }
.play-ja { align-self: center; margin-bottom: auto; color: var(--muted); }   /* 日本語のすぐ下。2つまとめて縦中央 */
.card.open .play-ja { display: none; }
.point { margin: 12px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: .95rem; }
.point::before { content: "ポイント"; display: block; font-size: .75rem; font-weight: 800; color: var(--gold); }
.tap-hint { text-align: center; color: var(--muted); font-size: .85rem; margin: 0; }
.card.open .tap-hint { display: none; }

.actions { padding-top: 14px; }
.rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate { padding: 16px 4px; font-size: 1rem; border-width: 2px; }
.rate.r0 { color: var(--r0); border-color: var(--r0); background: var(--r0-bg); }
.rate.r1 { color: var(--r1); border-color: var(--r1); background: var(--r1-bg); }
.rate.r2 { color: #fff; border-color: var(--r2); background: var(--r2); }

/* ---- 結果 ---- */
.res-title { text-align: center; margin: 20px 0 4px; color: var(--primary); }
.res-sub { text-align: center; color: var(--muted); margin: 0 0 16px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { border-radius: 12px; padding: 12px 6px; text-align: center; font-weight: 700; }
.tile b { display: block; font-size: 1.8rem; line-height: 1.2; }
.tile.t0 { background: var(--r0-bg); color: var(--r0); }
.tile.t1 { background: var(--r1-bg); color: var(--r1); }
.tile.t2 { background: var(--r2-bg); color: var(--r2); }
.res-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.res-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.res-list li { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--r1); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.res-list li.x0 { border-left-color: var(--r0); }
.res-list .rj { font-size: .9rem; color: var(--muted); }
.res-list .re { font-weight: 700; color: var(--primary); font-family: "Segoe UI", Roboto, Arial, sans-serif; }
.res-list .re::after { content: " 🔊"; font-size: .85em; }

@media (max-width: 360px) {
  .genres { grid-template-columns: 1fr; }
  .ja { font-size: 1.3rem; }
  .en { font-size: 1.3rem; }
}

/* ---- もっと学ぶ（書籍・動画・サイトへの入口） ---- */
.promo { margin-top: 8px; display: grid; gap: 8px; }
.promo .sec { margin-bottom: 0; }
.promo-card {
  display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none;
}
a.promo-card:hover { border-color: var(--primary); }
.promo-card.book { align-items: flex-start; }
.promo-cover { flex: none; width: 72px; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
.promo-body { flex: 1; min-width: 0; display: block; }
.promo-title { display: block; font-weight: 700; }
.promo-text { display: block; margin: 2px 0 0; font-size: .82rem; color: var(--muted); line-height: 1.5; }
.promo-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.promo-links .btn { text-decoration: none; color: var(--primary); }
.promo-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); font-size: 18px; color: var(--primary);
}
.r-promo { text-align: center; font-size: .9rem; color: var(--muted); margin: 14px 0 0; }
.r-promo a { color: var(--primary); font-weight: 700; }

/* ---- 広告を消す（Android アプリだけ。promo.js） ---- */
.adfree { margin-top: 12px; }
.adfree-text { margin: 0 0 10px; font-size: .9rem; }
.adfree-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.linklike { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--muted); font-size: .75rem; text-decoration: underline; cursor: pointer; }

/* ---- 正解音（♫）・メモリスト（2026-10-07） ---- */
.sfx { font-size: 1.1rem; color: var(--gold); }
.sfx.off { color: var(--muted); opacity: .45; text-decoration: line-through; }
.ans-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.memo-btn { border-color: var(--gold); color: var(--gold); background: transparent; }
.memo-btn[aria-pressed="true"] { background: var(--gold); color: #fff; }
.meta .memo-mark { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.genre.memo { border-style: dashed; }
.genre.memo[aria-checked="true"] { border-style: solid; }
.memo-open { margin-top: 8px; }

.res-list li { display: flex; align-items: center; gap: 8px; }
.row-text { flex: 1; min-width: 0; }
.star, .trash {
  flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.star { color: var(--gold); }
.star[aria-pressed="true"] { background: var(--gold); color: #fff; border-color: var(--gold); }

.memo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.memo-head h2 { margin: 0; font-size: 1.2rem; color: var(--primary); }
.memo-empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; }
.memo-note { color: var(--muted); font-size: .82rem; margin: 10px 2px 8px; }
.memo-list li { border-left-color: var(--gold); }
.memo-list .rmeta { font-size: .72rem; color: var(--muted); font-weight: 700; }
.memo-list .rp { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.undo-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: calc(100% - 32px); max-width: 608px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--text); color: var(--bg); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); z-index: 10;
}
.undo-bar .btn { background: transparent; color: var(--bg); border-color: var(--bg); }

/* ---- 英文一覧・検索（list.js、2026-10-13） ---- */
.list-open { margin-top: 8px; }
.list-q {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 1rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); outline: none;
}
.list-q:focus { border-color: var(--primary); }
.list-filter { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: start; margin-top: 10px; }
.lf-label { font-size: .78rem; font-weight: 700; color: var(--muted); padding-top: 7px; white-space: nowrap; }
.list-filter .chips { margin-bottom: 0; }
.list-filter .chip { padding: 5px 11px; font-size: .85rem; }
.list-count { color: var(--muted); font-size: .85rem; margin: 12px 2px 8px; }
.sent-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.sl-row {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 10px 10px 8px; cursor: pointer;
}
.sl-row .row-text > span { display: block; }
.sl-row .rmeta { font-size: .72rem; color: var(--muted); font-weight: 700; }
.sl-row .rj { font-size: .92rem; }
.sl-en { font-weight: 700; color: var(--primary); font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: .95rem; margin-top: 2px; }
.sl-mark { flex: none; width: 1.6em; text-align: center; font-weight: 800; font-size: 1.05rem; color: var(--none); }
.sl-row.s0 .sl-mark { color: var(--r0); }
.sl-row.s1 .sl-mark { color: var(--r1); }
.sl-row.s2 .sl-mark { color: var(--r2); }
.sl-play {
  flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.sv-pos { margin-left: auto; color: var(--muted); font-size: .9rem; font-weight: 700; }
.sv-card { cursor: default; }
.card.open.sv-card .ja { font-size: 1.15rem; color: var(--text); margin: 14px 0 6px; padding: 0; text-align: left; font-weight: 700; }
.sv-card .en { margin-top: 6px; }
.sv-status { margin: 12px 0 0; font-size: .82rem; color: var(--muted); }
.sv-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
