/* しのびの てらこや — 入口ページと単元ページの見た目。ゲームと同じ 紙・墨・金の色 */
:root {
  --ink: #2a1f2d; --paper: #fbf5ea; --paper2: #f3e8d4; --gold: #e8b84a; --gold-d: #b8862a;
  --red: #c9322c; --green: #2f8f5b; --muted: #6e6474; --line: #2a1f2d; --night: #2c2347;
  --font: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper2); color: var(--ink); font-family: var(--font); font-weight: 500; line-height: 1.6;
  background-image: radial-gradient(rgba(42,31,45,.05) 1px, transparent 1px); background-size: 14px 14px; }
a { color: inherit; }
ruby rt { font-size: .5em; font-weight: 700; letter-spacing: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }

/* ---------- 上の帯 ---------- */
.top { background: var(--night); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.top a.home { text-decoration: none; display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; letter-spacing: .04em; }
.top .tag { margin-left: auto; font-size: 12px; font-weight: 700; color: #d9cfe6; text-align: right; line-height: 1.35; }
.emblem { width: 30px; height: 30px; flex: none; }

/* ---------- 入口: はじめの大きな帯 ---------- */
.hero { background: linear-gradient(180deg, #2c2347 0%, #4a3a6b 55%, #c98a6b 100%); color: #fff; padding: 28px 0 40px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 26px; background: var(--paper2);
  clip-path: polygon(0 100%, 0 40%, 12% 70%, 24% 30%, 38% 75%, 52% 35%, 66% 70%, 80% 25%, 92% 65%, 100% 40%, 100% 100%); }
.hero h1 { margin: 0; font-size: clamp(30px, 7vw, 52px); font-weight: 900; letter-spacing: .06em; line-height: 1.2; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.hero h1 small { display: inline-block; margin-left: 10px; font-size: 14px; letter-spacing: 0; vertical-align: middle; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 2px 10px; text-shadow: none; }
.hero p.lead { margin: 10px 0 0; font-size: clamp(15px, 3.6vw, 19px); font-weight: 700; max-width: 40em; }
/* ほかと ちがう ところ（まちがえた 問題 → 動画の その場面）を 金の 帯で 目立たせる。2行に なっても 行ごとに 角を まるくする */
.hero p.lead mark { display: inline; background: var(--gold); color: var(--ink); font-weight: 900; border-radius: 8px; padding: 1px 8px; line-height: 1.9;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* 上の帯の絵（3人と はらぺこ鬼・video/common/hero_still.py で描いた）: 広い画面は 右がわ、せまい画面は 説明と 3つの段の あいだ */
.herogrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); column-gap: 20px;
  grid-template-areas: "h img" "l img" "s img"; align-items: start; }
.herogrid h1 { grid-area: h; } .herogrid .lead { grid-area: l; } .herogrid .steps3 { grid-area: s; }
.heroimg { grid-area: img; align-self: end; display: block; width: 100%; height: auto; margin-bottom: -30px; position: relative; z-index: 1;
  filter: drop-shadow(0 6px 0 rgba(20, 12, 34, .28)); }
@media (max-width: 900px) {
  .herogrid { grid-template-columns: 1fr; grid-template-areas: "h" "l" "img" "s"; }
  .heroimg { width: min(100%, 420px); justify-self: center; margin: 14px 0 -4px; }
}
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; max-width: 760px; }
.steps3 div { background: rgba(251,245,234,.96); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.steps3 b { display: block; font-size: clamp(16px, 3.8vw, 21px); font-weight: 900; }
.steps3 span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; line-height: 1.4; }
/* 3つの段の 小さな絵（実際の画面）。広い画面は 上に、せまい画面は 右に */
.steps3 .shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; border: 2px solid var(--ink); margin: 0 0 8px; background: var(--night); }
/* 子どもの字は 分かち書きの すきまで 折り返す（ことばの とちゅうで 割らない）。親向けの文は ふつうに 折り返す */
body { word-break: keep-all; overflow-wrap: anywhere; }
.parent, footer.foot { word-break: normal; }
.steps3 i { font-style: normal; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ink); margin-right: 6px; font-weight: 900; }
.notice { margin-top: 14px; font-size: 13px; color: #f1e6ff; font-weight: 700; }

/* ---------- つづきから ---------- */
.cont { margin: -12px 0 18px; position: relative; z-index: 2; }
.cont a { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r);
  padding: 12px 16px; box-shadow: 0 6px 0 var(--gold-d); }
.cont a:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--gold-d); }
.cont .k { font-size: 12px; font-weight: 900; color: var(--muted); }
.cont .t { font-size: clamp(16px, 4vw, 20px); font-weight: 900; line-height: 1.35; }
.cont .n { font-size: 14px; font-weight: 700; color: var(--red); }
.cont .go { margin-left: auto; flex: none; font-size: 26px; font-weight: 900; }

/* ---------- 教科のカード ---------- */
h2.sec { font-size: clamp(19px, 4.6vw, 24px); font-weight: 900; margin: 26px 0 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
h2.sec small { font-size: 13px; color: var(--muted); font-weight: 700; }
/* いま あそべる 単元の 数（「じゅんび中」が 多くても、あそべる 教科は 1つずつ 通せると 分かるように） */
.ready5 { margin: -2px 0 12px; font-size: 14px; font-weight: 700; line-height: 1.7; }
.ready5 b { display: inline-block; background: var(--red); color: #fff; border-radius: 999px; padding: 1px 10px; margin-right: 8px; font-size: 13px; font-weight: 900; }
/* 札の いみ（カードの「いまごろ」「ふくしゅう」） */
.ready5 .legend { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.ready5 .legend .badge { font-size: 11.5px; padding: 0 8px; }
.ready5 .legend .li { white-space: nowrap; margin-right: 12px; }  /* 札と その いみは 1かたまりで 折り返す */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chips a { text-decoration: none; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: 15px; background: var(--paper); min-height: 40px; display: inline-flex; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.subj { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r); overflow: hidden; box-shadow: 0 6px 0 rgba(42,31,45,.18); scroll-margin-top: 12px; }
.subj header { padding: 12px 16px 10px; color: #fff; display: flex; align-items: center; gap: 10px; }
.subj header .nm { font-size: 26px; font-weight: 900; letter-spacing: .06em; line-height: 1.1; }
.subj header .kj { font-size: 13px; font-weight: 700; opacity: .92; }
.subj header .mk { margin-left: auto; font-size: 12px; font-weight: 900; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.55); border-radius: 999px; padding: 2px 10px; }
.feat { display: block; margin: 12px; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 14px; text-decoration: none; background: #fff; position: relative; }
.feat:active { transform: translateY(2px); }
.feat .thumb { display: block; position: relative; margin: -12px -14px 10px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 11px 11px 0 0; border-bottom: 3px solid var(--ink); background: var(--night); }
.feat .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feat .thumb .play { position: absolute; left: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.94); border: 3px solid var(--ink);
  display: grid; place-items: center; font-style: normal; font-size: 15px; color: var(--ink); padding-left: 3px; box-sizing: border-box; box-shadow: 0 3px 0 rgba(42,31,45,.35); }
.feat .when { font-size: 12px; font-weight: 900; color: var(--muted); }
.feat .ttl { font-size: clamp(17px, 4.2vw, 20px); font-weight: 900; line-height: 1.35; margin: 2px 0 6px; }
.feat .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feat .btn { margin-left: auto; background: var(--gold); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: inline-grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 900; background: #eee5d6; color: var(--muted); }
.dots i.on { background: var(--gold); color: var(--ink); }
.dots i.star { background: #ffe066; color: var(--red); }
.badge { display: inline-block; font-size: 12px; font-weight: 900; border-radius: 999px; padding: 2px 9px; border: 2px solid var(--ink); background: #fff; }
.badge.now { background: var(--red); color: #fff; border-color: var(--red); }
.badge.soon { background: #e9e2d6; border-color: #b9ae9c; color: #6e6474; }
.badge.rev { background: #dfe9f7; }
.list { list-style: none; margin: 0; padding: 0 12px 12px; }
.list li { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 4px; padding: 8px 4px; border-top: 1px dashed rgba(42,31,45,.25); font-size: 15px; font-weight: 700; }
.list li .m { flex: none; width: 56px; font-size: 12px; color: var(--muted); font-weight: 900; }
.list li .t { flex: 1 1 calc(100% - 64px); min-width: 0; color: #5a5060; }
.list li.now .t { color: var(--ink); }
/* しるし（いまごろ・じゅんび中）は 名前の 下の行へ。名前を 細く つぶさない（カードは 横長の 画面でも 330px ほど） */
.list li .bs { flex: none; display: flex; gap: 6px; margin-left: 64px; }
.list .cap { font-size: 12px; font-weight: 900; color: var(--muted); padding: 0 4px 2px; border: 0; }
.list .cap .badge { font-size: 11px; padding: 0 8px; }
.list li.more { display: none; }
.subj.open .list li.more { display: flex; }
.list li.morebtn { padding: 8px 4px 2px; }
.list li.morebtn button { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 900; cursor: pointer; box-shadow: 0 2px 0 var(--ink); }
.list li.morebtn button:active { transform: translateY(2px); box-shadow: none; }

/* ---------- おうちの方へ ---------- */
.parent { margin: 34px 0 0; background: #fff; border: 2px solid rgba(42,31,45,.35); border-radius: var(--r); padding: 16px 18px; font-size: 14px; line-height: 1.75; }
.parent h2 { font-size: 17px; margin: 0 0 6px; }
.parent ul { margin: 6px 0; padding-left: 1.2em; }
.parent .small { font-size: 12px; color: var(--muted); }
.parent button.reset { margin-top: 8px; border: 2px solid #b9ae9c; background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
footer.foot { margin: 22px 0 40px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }

/* ---------- 単元ページ ---------- */
.uhead { padding: 18px 0 6px; }
.uhead .crumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 900; }
.uhead .crumb a.back { text-decoration: none; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 4px 12px; min-height: 40px; display: inline-flex; align-items: center; }
.uhead .sj { color: #fff; border-radius: 999px; padding: 4px 12px; }
.uhead h1 { margin: 10px 0 2px; font-size: clamp(24px, 6vw, 36px); font-weight: 900; line-height: 1.3; }
.uhead .meta { font-size: 13px; font-weight: 700; color: var(--muted); }
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.flow a { text-decoration: none; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); padding: 8px 10px; display: block; min-height: 64px; }
.flow a b { display: block; font-size: clamp(14px, 3.6vw, 17px); font-weight: 900; line-height: 1.3; }
.flow a span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.35; }
.flow a.done { background: #fff6d9; }
.flow a.done b::after { content: ' ✓'; color: var(--green); }
.flow a.next { background: var(--gold); box-shadow: 0 4px 0 var(--ink); }
.learn { background: #fff; border: 3px solid var(--ink); border-radius: var(--r); padding: 12px 16px; margin: 12px 0 0; }
.learn h2 { margin: 0 0 4px; font-size: 16px; font-weight: 900; }
.learn ul { margin: 0; padding-left: 1.2em; font-size: 15px; font-weight: 700; }
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r); margin: 18px 0 0; overflow: hidden; scroll-margin-top: 10px; }
.card > h2 { margin: 0; padding: 10px 16px; font-size: clamp(18px, 4.4vw, 22px); font-weight: 900; border-bottom: 3px solid var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card > h2 .no { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ink); flex: none; }
.card > h2 small { font-size: 13px; color: var(--muted); font-weight: 700; }
.card .body { padding: 14px 16px 16px; }
.vid { background: #000; border-radius: 12px; overflow: hidden; border: 2px solid var(--ink); aspect-ratio: 16 / 9; }
.vid video { display: block; width: 100%; height: 100%; background: #000; }
.vid .none { color: #fff; display: grid; place-items: center; height: 100%; font-weight: 900; padding: 16px; text-align: center; }
.chap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chap button { border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 40px; }
.chap button.on { background: var(--gold); }
.chap button small { color: var(--muted); margin-left: 4px; font-size: 12px; }
.seen { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--green); }
.play { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; background: var(--red); color: #fff; border: 3px solid var(--ink);
  border-radius: 16px; padding: 14px 18px; font-size: clamp(18px, 4.6vw, 22px); font-weight: 900; box-shadow: 0 6px 0 var(--ink); }
.play:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--ink); }
.play.sub { background: var(--gold); color: var(--ink); font-size: 17px; margin-top: 12px; }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.scores div { background: #fff; border: 2px solid rgba(42,31,45,.35); border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 700; }
.scores b { display: block; font-size: 20px; font-weight: 900; }
.note { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 8px; }
.mist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mist li { background: #fff; border: 2px solid var(--ink); border-left: 8px solid var(--red); border-radius: 12px; padding: 10px 12px; }
.mist .q { font-weight: 900; font-size: 16px; }
.mist .a { font-size: 14px; font-weight: 700; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.mist .a .pic { vertical-align: middle; }
.mist .h { font-size: 14px; color: #4f4556; margin-top: 4px; }
.mist button.see { margin-top: 8px; border: 2px solid var(--ink); background: var(--gold); border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: 15px; cursor: pointer; min-height: 42px; }
.mist .nosee { margin-top: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.empty { font-size: 15px; font-weight: 700; color: #4f4556; }
.pic { display: inline-block; vertical-align: middle; }

@media (max-width: 560px) {
  .steps3 { grid-template-columns: 1fr; gap: 8px; }
  .steps3 div { padding: 8px 10px 8px 12px; display: grid; grid-template-columns: minmax(0, 1fr) 104px; grid-template-areas: "b img" "s img"; column-gap: 10px; align-items: center; }
  .steps3 b { grid-area: b; } .steps3 span { grid-area: s; }
  .steps3 .shot { grid-area: img; width: 104px; margin: 0; border-radius: 8px; }
  .grid { grid-template-columns: 1fr; }
  .scores { grid-template-columns: 1fr; }
  .flow a { padding: 6px 8px; } .flow a span { display: none; }
  /* せまい画面: 題字は1行のまま。注意書きは入らなければ 下の行へ（右よせのまま） */
  .top .wrap { flex-wrap: wrap; row-gap: 0; padding-top: 6px; padding-bottom: 6px; }
  .top a.home { white-space: nowrap; }
  .top .tag { font-size: 11px; }
  .top .tag br { display: none; }
}
