/* 交通ルール判定クイズ 練習問題 — チャンネルの見た目（紺の札・クリームのカード・赤い大文字・丸い太字）に合わせる */
:root {
  --navy: #24386b;
  --navy-d: #1a2a52;
  --cream: #fffdf5;
  --bg: #eef1f4;
  --ink: #212638;
  --sub: #5d6375;
  --line: #d6dae3;
  --asphalt: #3d424c;
  --asphalt-d: #30343c;
  --red: #e02e29;
  --blue: #1f5fc8;
  --yellow: #fac21a;
  --ok: #1f9e4d;
  --ng: #e02e29;
  --btn: #ffffff;
  --quote: #ffffff;
  --shadow: 0 4px 0 var(--navy);
  --font: "M PLUS Rounded 1c", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #23283a; --bg: #161a24; --ink: #eef0f6; --sub: #a9afc2; --line: #353b50; --navy: #6d88d4;
    --btn: #2c3247; --quote: #1c2131; --shadow: 0 4px 0 #0c0f18;
  }
}
:root[data-theme="dark"] {
  --cream: #23283a; --bg: #161a24; --ink: #eef0f6; --sub: #a9afc2; --line: #353b50; --navy: #6d88d4;
  --btn: #2c3247; --quote: #1c2131; --shadow: 0 4px 0 #0c0f18;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.7; font-weight: 500; }
a { color: var(--blue); }
button { font: inherit; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }

/* ---- 上の帯：アスファルトの道路と白い破線 ---- */
.top {
  padding: 14px 16px 22px; background-color: var(--asphalt);
  background-image: repeating-linear-gradient(90deg, #fff 0 28px, transparent 28px 52px);
  background-size: 100% 4px; background-repeat: no-repeat; background-position: 0 calc(100% - 8px);
  border-bottom: 6px solid var(--asphalt-d);
}
.brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none; max-width: 680px; margin: 0 auto; }
.pill { background: var(--navy-d); color: #fff; font-weight: 900; padding: 6px 16px; border-radius: 999px; border: 2px solid #fff; letter-spacing: .02em; }
.tag { color: #e6e9f0; font-size: 13px; font-weight: 700; }

main { max-width: 680px; margin: 0 auto; padding: 18px 16px 8px; }
h1 { font-size: 24px; line-height: 1.35; margin: 6px 0 14px; font-weight: 900; color: var(--navy); }
h2 { font-size: 17px; margin: 22px 0 10px; font-weight: 800; }
.crumb { margin: 0; font-size: 14px; font-weight: 700; }
.crumb a { text-decoration: none; }
.note { font-size: 14px; color: var(--sub); }
.center { text-align: center; }

/* ---- 最初の画面 ---- */
.kicker { display: inline-block; margin: 4px 0 0; font-size: 13px; font-weight: 800; color: var(--red); letter-spacing: .08em; }
.hero h1 { font-size: 36px; white-space: pre-line; margin: 2px 0 8px; line-height: 1.2; }
.lead { margin: 0 0 14px; color: var(--sub); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.stat { background: var(--cream); border: 2px solid var(--navy); border-radius: 14px; padding: 8px 10px; text-align: center; box-shadow: var(--shadow); }
.stat b { font-size: 26px; font-weight: 900; color: var(--navy); }
.stat span { font-size: 13px; font-weight: 800; margin-left: 2px; }
.stat small { display: block; font-size: 12px; color: var(--sub); margin-top: -4px; font-weight: 700; }

.menu { display: grid; gap: 12px; }
.entry {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--cream);
  border: 3px solid var(--navy); border-radius: 18px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.entry:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--navy); }
.entry:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.entry .txt { flex: 1; min-width: 0; }
.entry .name { display: block; font-weight: 900; font-size: 19px; line-height: 1.3; }
.entry .desc { display: block; font-size: 13px; color: var(--sub); font-weight: 700; }
.entry .go { font-size: 30px; font-weight: 900; color: var(--navy); line-height: 1; }
.entry.off { opacity: .5; cursor: default; }
.entry.off:hover, .entry.off:active { transform: none; box-shadow: var(--shadow); }
.sign { flex: none; width: 50px; height: 50px; display: grid; place-items: center; }
.sign svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); }

/* ---- 一覧 ---- */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list a {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--cream);
  border: 2px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 700;
}
.list a:hover { border-color: var(--navy); }
.list a.off { opacity: .5; cursor: default; }
.list .num { flex: none; font-weight: 900; color: #fff; background: var(--blue); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.list .cat { font-size: 12px; color: var(--sub); margin-left: auto; white-space: nowrap; font-weight: 800; }
.chhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chhead h2 { margin-bottom: 8px; }
.link { background: none; border: 0; color: var(--blue); text-decoration: underline; padding: 4px; font-weight: 700; }

/* 場面のカード（サムネ） */
.sgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.scard { height: 100%; display: flex; flex-direction: column; background: var(--cream); border: 3px solid var(--navy); border-radius: 16px; overflow: hidden; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .12s ease; }
.scard:hover { transform: translateY(-2px); }
.scard .th { position: relative; aspect-ratio: 1 / 1; background: var(--asphalt); overflow: hidden; }
.scard .th img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.play-badge { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 14px; border: 2px solid #fff; }
.scard .ttl { padding: 8px 10px 0; font-weight: 800; font-size: 14px; line-height: 1.4; }
.scard .cat { padding: 2px 10px 10px; font-size: 12px; color: var(--sub); font-weight: 800; margin-top: auto; }

/* ---- 進み具合：道路と車 ---- */
.road { position: relative; height: 34px; margin: 6px 0 14px; background-color: var(--asphalt); border-radius: 10px;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.85) 0 14px, transparent 14px 26px);
  background-size: calc(100% - 60px) 3px; background-repeat: no-repeat; background-position: 12px center; }
.road .car { position: absolute; top: 5px; left: 0; width: 40px; height: 24px; transition: left .5s cubic-bezier(.3,1.4,.5,1); }
.road .car svg { width: 100%; height: 100%; display: block; }
.road .goal { position: absolute; right: 6px; top: 7px; width: 34px; height: 20px; border-radius: 4px; font-size: 0;
  background: repeating-conic-gradient(#fff 0 25%, #232733 0 50%) 0 0 / 10px 10px; }

/* ---- 1 問のカード ---- */
.item { position: relative; background: var(--cream); border: 3px solid var(--navy); border-radius: 20px; padding: 18px 16px 16px; box-shadow: var(--shadow); }
.count { display: inline-block; margin: 0 0 8px; font-size: 13px; font-weight: 900; color: #fff; background: var(--navy); padding: 2px 12px; border-radius: 999px; }
.from { font-size: 13px; color: var(--sub); margin: 0 0 6px; font-weight: 700; }
.stmt { margin: 0 0 16px; font-size: 19px; line-height: 1.65; font-weight: 800; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 8px 8px;
  background: var(--btn); border: 3px solid var(--line); border-radius: 18px; box-shadow: 0 4px 0 var(--line);
  transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease;
}
.choice .mark { font-size: 54px; line-height: 1; font-weight: 900; }
.choice .lbl { font-size: 13px; font-weight: 800; color: var(--sub); }
.mark.o { color: var(--red); }
.mark.x { color: var(--blue); }
.choice.is-o:hover { border-color: var(--red); box-shadow: 0 4px 0 var(--red); }
.choice.is-x:hover { border-color: var(--blue); box-shadow: 0 4px 0 var(--blue); }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.choice:disabled { cursor: default; opacity: .4; }
.choice:disabled:hover { border-color: var(--line); box-shadow: 0 4px 0 var(--line); }
.choice.picked, .choice.picked:disabled, .choice.picked:hover { opacity: 1; border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }

/* ハンコ */
.stamp {
  position: absolute; right: 12px; top: 10px; display: flex; flex-direction: column; align-items: center;
  padding: 6px 14px; border: 4px solid currentColor; border-radius: 14px; background: var(--cream);
  transform: rotate(-8deg); animation: stamp .35s cubic-bezier(.2,1.6,.4,1) both; pointer-events: none;
}
.stamp.ok { color: var(--ok); }
.stamp.ng { color: var(--ng); }
.stamp .big { font-size: 24px; font-weight: 900; line-height: 1.1; }
.stamp .small { font-size: 12px; font-weight: 800; }
.stamp.big { position: static; margin: 10px auto 8px; width: max-content; padding: 10px 28px; animation-name: stamp-big; transform: rotate(-5deg); }
.stamp.big .big { font-size: 44px; }
.stamp.big .small { font-size: 14px; }
@keyframes stamp { from { transform: scale(2.2) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }
@keyframes stamp-big { from { transform: scale(2) rotate(-5deg); opacity: 0; } to { transform: scale(1) rotate(-5deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stamp, .stamp.big { animation: none; } .road .car { transition: none; } }

.res { position: relative; margin-top: 18px; border-top: 2px dashed var(--line); padding-top: 14px; }
.res .stamp { position: static; flex-direction: row; align-items: baseline; gap: 10px; width: max-content; margin: 0 0 10px; transform: rotate(-3deg); animation-name: stamp-in; }
@keyframes stamp-in { from { transform: scale(1.8) rotate(-3deg); opacity: 0; } to { transform: scale(1) rotate(-3deg); opacity: 1; } }
.why { margin: 0; font-weight: 700; }
.facts { margin-top: 10px; background: var(--quote); border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.facts summary { cursor: pointer; font-weight: 800; font-size: 14px; color: var(--navy); }
.fact { border-top: 1px solid var(--line); padding: 10px 0; }
.fact:first-of-type { border-top: 0; }
.fact blockquote { margin: 0; padding-left: 10px; border-left: 4px solid var(--yellow); font-size: 14px; font-weight: 500; }
.fact .src { font-size: 12px; color: var(--sub); margin: 4px 0 0; }

.next, button.next {
  display: inline-block; margin-top: 14px; padding: 12px 22px; border: 0; border-radius: 999px; background: var(--red); color: #fff;
  font-weight: 900; font-size: 16px; text-decoration: none; box-shadow: 0 4px 0 #9e1b17; transition: transform .1s ease, box-shadow .1s ease;
}
.next:active { transform: translateY(3px); box-shadow: 0 1px 0 #9e1b17; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.after { text-align: center; margin-top: 8px; }
.sum { font-weight: 900; font-size: 18px; }

/* ---- 場面の映像 ---- */
.stage { position: relative; margin: 8px auto 12px; max-width: 340px; }
.video { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 62vh; margin: 0 auto; background: var(--asphalt); border-radius: 18px; overflow: hidden; border: 3px solid var(--navy); box-shadow: var(--shadow); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 14px 24px; border: 3px solid #fff; border-radius: 999px; background: var(--red); color: #fff; font-weight: 900; font-size: 17px; box-shadow: 0 4px 0 #9e1b17; white-space: nowrap; }
.scene { background: var(--cream); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.scene p { margin: 0; }
.skip { text-align: center; margin: 10px 0 0; }

/* ---- ランダムの設定 ---- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills .pill { padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--cream); color: var(--ink); font-weight: 800; letter-spacing: 0; }
.pills .pill.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.checks { display: grid; gap: 6px; }
.checks label { font-size: 15px; font-weight: 700; background: var(--cream); border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; }

/* ---- 模擬試験 ---- */
.mockhead { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 2; }
.mockhead .count { margin: 0; }
.time { font-weight: 900; font-variant-numeric: tabular-nums; background: var(--navy); color: #fff; padding: 4px 14px; border-radius: 999px; }
.review { padding-left: 0; list-style: none; display: grid; gap: 12px; margin: 16px 0; text-align: left; }
.review li { background: var(--cream); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.review li.ng { border-left: 8px solid var(--ng); }
.review li.ok { border-left: 8px solid var(--ok); }
.review .stmt { margin: 0 0 4px; font-size: 16px; }
.review .why { font-size: 14px; margin: 0 0 4px; }

/* ---- フッター ---- */
.foot { margin-top: 32px; background: var(--asphalt); color: #d9dde6; border-top: 6px solid var(--asphalt-d); }
.foot-in { max-width: 680px; margin: 0 auto; padding: 18px 16px 26px; font-size: 12px; }
.foot p { margin: 4px 0; }

@media (max-width: 420px) {
  .hero h1 { font-size: 30px; }
  .stmt { font-size: 17px; }
  .choice .mark { font-size: 46px; }
  .stamp .big { font-size: 20px; }
}

/* ひっかけの型 */
.trap { display: inline-block; margin: 8px 0 0; font-size: 12px; font-weight: 800; color: var(--navy); background: color-mix(in srgb, var(--yellow) 30%, transparent); border: 2px solid var(--yellow); border-radius: 999px; padding: 2px 12px; }

/* ---- 書き出したページ（問題ごと・節ごと・このサイトについて） ---- */
h1.stmt { color: var(--ink); font-size: 20px; line-height: 1.65; margin: 0 0 16px; }
.ans-h { font-size: 16px; margin: 0 0 6px; color: var(--navy); }
.res .stamp[hidden] { display: none; }
.scene-link { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px; background: var(--cream); border: 3px solid var(--navy); border-radius: 16px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 800; }
.scene-link img { width: 72px; height: 72px; object-fit: cover; object-position: center 30%; border-radius: 10px; }
.more { margin-top: 18px; font-size: 14px; font-weight: 700; }
.more a { margin-right: 12px; }
.qlist a span:last-child { font-weight: 700; }
.prose h2 { margin-top: 22px; }
.prose ul { padding-left: 1.2em; }
.todo { color: var(--red); font-weight: 800; }
.foot-links a { color: #fff; font-weight: 800; }
.seo-index h1 { margin-top: 0; }

/* ---- 文字のつぶれ対策（2026-12-05 本人「文字が若干つぶれ気味」）----
   M PLUS Rounded は太くすると画数の多い漢字が詰まるので、本文は 700 まで。900 は大きな見出し・数字・ハンコ・札だけ */
body { letter-spacing: .03em; }
.stmt, h1.stmt { font-weight: 700; line-height: 1.8; letter-spacing: .04em; }
.why, .scene, .lead, .entry .desc, .list a, .scard .ttl, .fact blockquote, .checks label { font-weight: 500; }
.list a, .scard .ttl { font-weight: 700; }
h1 { font-weight: 800; letter-spacing: .03em; }
h2, .entry .name, .ans-h, .sum { font-weight: 800; }
.count, .from, .lbl, .cat, .crumb, .trap, .note, .tag, .kicker { font-weight: 700; }
.hero h1 { font-weight: 900; letter-spacing: .02em; }
