/* あそびプリント (/asobi/) — 迷路・まちがいさがし。scripts/asobi/build.py が生成するページ用。
   問題の紙 (.sheet) は印刷物なので、ダークモードでも白い紙のまま (色は変数にせず固定する)。
   印刷は A4 たて 1 枚。こたえは「こたえも いっしょに」を選んだときだけ 2 枚目に出す */

.asobi .brand-sub { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--soft); }

/* ---- いちらん ---- */
.asobi-hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px; padding-block: 32px 48px; }
.asobi-hero h1 { margin: 6px 0 14px; font-size: clamp(34px, 5vw, 58px); line-height: 1.2; letter-spacing: -.02em; }
.asobi-hero h1 span { color: var(--accent-text); }
.asobi-hero .lead { color: var(--soft); font-size: 16px; max-width: 34em; }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.asobi .btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; background: var(--sun); color: var(--on-sun); font-weight: 800; text-decoration: none; box-shadow: 0 6px 16px rgb(var(--sun-shadow-rgb) / 35%); }
.asobi .btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.hero-art { position: relative; aspect-ratio: 1.15; }
.hero-art img { position: absolute; height: auto; filter: drop-shadow(0 8px 10px rgb(var(--shadow-rgb) / 12%)); }
.hero-art .h-map { width: 48%; left: 4%; bottom: 4%; }
.hero-art .h-mag { width: 42%; right: 6%; top: 2%; }
.hero-art .h-mii { width: 20%; right: 10%; bottom: 6%; }
.hero-art .h-piyo { width: 12%; left: 50%; bottom: 8%; }

.asobi-list { padding-block: 28px; }
.asobi-list h2 { margin: 0 0 4px; font-size: 32px; }
.list-lead { margin: 0 0 8px; color: var(--soft); }
.level-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; font-size: 18px; }
.level-head span { color: #E0A93A; letter-spacing: .1em; }
.level-head small { color: var(--soft); font-size: 13px; font-weight: 700; }

.puzzle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.puzzle-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 16px; border-radius: 20px; background: var(--card); color: var(--ink); text-decoration: none; box-shadow: 0 1px 0 var(--line), 0 10px 24px rgb(var(--shadow-rgb) / 8%); transition: transform .2s ease, box-shadow .2s ease; }
.puzzle-card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 var(--line), 0 16px 30px rgb(var(--shadow-rgb) / 14%); }
.puzzle-card img { width: 100%; height: auto; aspect-ratio: 480 / 340; object-fit: cover; object-position: top; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.puzzle-card strong { font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif; font-size: 17px; line-height: 1.4; }
.card-level { align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--chip-mint-bg); color: var(--chip-mint-text); }
.card-level.l2 { background: var(--chip-yellow-bg); color: var(--chip-yellow-text); }
.card-level.l3 { background: var(--sakura); color: #7A3036; }
.card-story { color: var(--soft); font-size: 13px; line-height: 1.6; }

.asobi-faq { padding-block: 28px 56px; }
.asobi-faq h2 { font-size: 26px; }
.asobi-faq details { padding: 14px 0; border-bottom: 1px solid var(--line); }
.asobi-faq summary { cursor: pointer; font-weight: 700; }
.asobi-faq p { margin: 8px 0 0; color: var(--soft); }

/* ---- 1 枚のページ ---- */
.asobi-page { padding-block: 8px 48px; }
.crumbs { margin: 0 0 12px; font-size: 13px; color: var(--soft); }
.crumbs a { color: var(--soft); }

.sheet { max-width: 820px; margin: 0 auto; padding: 28px 30px 18px; border-radius: 6px; background: #fff; color: #5C4633;
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 18px 40px rgb(var(--shadow-rgb) / 14%); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 10px; }
.sheet-kind { margin: 0; font-size: 13px; font-weight: 700; color: #8B6B4F; }
.sheet-kind .stars { color: #E0A93A; letter-spacing: .08em; }
.sheet h1 { margin: 2px 0 4px; font-size: 26px; line-height: 1.3; color: #5C4633; }
.sheet-story { margin: 0; font-size: 15px; color: #5C4633; }
.sheet-name { flex: none; display: flex; align-items: flex-end; gap: 6px; margin: 4px 0 0; font-size: 13px; font-weight: 700; color: #8B6B4F; }
.sheet-name span { display: inline-block; width: 150px; border-bottom: 1.5px solid #8B6B4F; height: 26px; }
.sheet-art { display: block; width: 100%; height: auto; }
.sheet-art .lbl { font: 800 4.2px "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif; fill: #5C4633; text-anchor: middle; }
.panel { margin: 0 0 8px; }
.panel figcaption { margin: 0 0 3px; font-size: 12px; font-weight: 800; color: #8B6B4F; }
.tally { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; font-size: 13px; font-weight: 800; color: #8B6B4F; }
.tally span:first-child { margin-right: 4px; }
.tally-dot { width: 20px; height: 20px; border: 1.8px solid #C9B49C; border-radius: 50%; }
.sheet-foot { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 0; padding-top: 8px; border-top: 1px dashed #E3D3BD; font-size: 11px; color: #A08870; }

.answer-sheet { display: none; margin-top: 24px; }
.show-answer .answer-sheet { display: block; }

.sheet-tools { max-width: 820px; margin: 18px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.sheet-tools button { min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px; font: inherit; font-weight: 800; cursor: pointer; }
.btn-pdf, .btn-sub { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 800; text-decoration: none; line-height: 1.2; }
.btn-pdf { background: var(--sun); color: var(--on-sun); box-shadow: 0 6px 16px rgb(var(--sun-shadow-rgb) / 35%); }
.btn-pdf small { font-size: 11px; font-weight: 700; }
.btn-sub { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--sun); }
.btn-print, .btn-answer { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.with-answer { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--soft); cursor: pointer; }
.tools-note { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--soft); }

.related { max-width: 820px; margin: 44px auto 0; }
.related h2 { font-size: 22px; }
.related .more { margin-top: 14px; }
.asobi-apps { max-width: 820px; margin: 40px auto 0; display: flex; align-items: center; gap: 20px; padding: 20px 24px; border-radius: 24px; background: var(--blush); }
.asobi-apps img { width: 110px; height: auto; flex: none; }
.asobi-apps h2 { margin: 0 0 6px; font-size: 20px; }
.asobi-apps p { margin: 0 0 6px; color: var(--soft); font-size: 14px; }

@media (max-width: 760px) {
  .asobi-hero { grid-template-columns: 1fr; padding-top: 12px; }
  .hero-art { max-width: 420px; width: 100%; margin: 0 auto; }
  .sheet { padding: 16px 14px 12px; }
  .sheet h1 { font-size: 21px; }
  .sheet-head { flex-direction: column; gap: 6px; }
  .sheet-name span { width: 120px; }
  .asobi-apps { flex-direction: column; text-align: center; }
  /* スマホは PDF が主役。2 つの PDF を横いっぱいに並べ、ブラウザの印刷はその下へ */
  .sheet-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sheet-tools .btn-pdf, .sheet-tools .btn-sub, .sheet-tools button { width: 100%; padding: 0 10px; }
  .with-answer, .tools-note { grid-column: 1 / -1; }
}

/* ---- 印刷 ---- */
@page { size: A4 portrait; margin: 10mm; }
@media print {
  html, body { background: #fff !important; }
  body.asobi { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .asobi .page-shell > :not(main), .asobi .no-print, .asobi .guide, .asobi .family-strip { display: none !important; }
  .asobi-page { width: auto; padding: 0; }
  .sheet { max-width: none; margin: 0; padding: 0; border-radius: 0; box-shadow: none; break-inside: avoid; }
  /* 印刷の幅 (約 720px) はスマホ向けの段組みに入ってしまうので、見出しは横並びに戻す */
  .sheet-head { flex-direction: row; gap: 12px; margin-bottom: 6px; }
  .sheet h1 { font-size: 19pt; }
  .sheet-story { font-size: 10.5pt; }
  .sheet-art { max-height: 218mm; width: auto; max-width: 100%; margin: 0 auto; }
  .panel { margin-bottom: 3mm; }
  .panel .sheet-art { max-height: 101mm; }
  .tally { margin-top: 2mm; }
  .sheet-foot { margin-top: 3mm; padding-top: 2mm; }
  .answer-sheet { display: none !important; }
  .print-answer .answer-sheet { display: block !important; break-before: page; margin-top: 0; }
}

/* ---- なぜ紙とえんぴつ? / おでかけセット / おうちの方へ ---- */
.asobi-hero .lead strong { color: var(--ink); }
.asobi-why { padding-block: 40px 24px; text-align: center; }
.asobi-why h2 { margin: 6px 0 14px; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.35; }
.why-lead { max-width: 40em; margin: 0 auto 28px; color: var(--soft); font-size: 16px; }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; }
.why-card { padding: 22px 22px 20px; border-radius: 24px; background: var(--card); box-shadow: 0 1px 0 var(--line), 0 10px 24px rgb(var(--shadow-rgb) / 7%); }
.why-card img { width: 72px; height: 72px; object-fit: contain; }
.why-card h3 { margin: 8px 0 6px; font-size: 19px; }
.why-card p { margin: 0; color: var(--soft); font-size: 14px; line-height: 1.75; }

.asobi-sets { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; align-items: center; margin-block: 28px; padding: 26px 28px; border-radius: 28px; background: var(--blush); }
.asobi-sets h2 { margin: 0 0 6px; font-size: 26px; }
.asobi-sets p { margin: 0; color: var(--soft); }
.sets-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.set-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 2px var(--sun); }
.set-link span { color: #E0A93A; font-size: 13px; letter-spacing: .08em; }
.set-link strong { font-size: 16px; }
.set-link small { color: var(--soft); font-size: 12px; }
.set-link p { display: flex; gap: 12px; margin: 4px 0 0; font-size: 13px; font-weight: 700; }
.set-link p a { color: var(--accent-text); }

.asobi-tips { padding-block: 28px 8px; }
.asobi-tips h2 { font-size: 24px; }
.tips-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tips-cols h3 { margin: 0 0 6px; font-size: 16px; }
.tips-cols ul, .parent-note ul { margin: 0; padding-left: 1.2em; color: var(--soft); font-size: 14px; }
.tips-cols li, .parent-note li { margin-bottom: 6px; }

.parent-note { max-width: 820px; margin: 28px auto 0; padding: 20px 24px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); }
.parent-note h2 { margin: 0 0 8px; font-size: 18px; }
.parent-note p { margin: 8px 0 0; font-size: 13px; color: var(--soft); }

@media (max-width: 860px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .asobi-sets { grid-template-columns: 1fr; }
  .tips-cols { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 560px) {
  .why-grid { grid-template-columns: 1fr; gap: 12px; }
  .why-card { display: grid; grid-template-columns: 56px 1fr; column-gap: 14px; padding: 16px; }
  .why-card img { width: 56px; height: 56px; grid-row: span 2; }
  .why-card h3 { margin: 0 0 4px; font-size: 17px; }
  .asobi-sets { padding: 20px 16px; }
}
