/* 卓球ナビ — 卓球台の青・白線・ボールのオレンジを基調にした配色 */
:root {
  --table: #1c4b6b;       /* 卓球台の青 */
  --table-deep: #143a54;
  --line: #ffffff;        /* 台の白線 */
  --ball: #f5a524;        /* ボールのオレンジ（装飾用。文字色には使わない） */
  --paper: #f3f6f5;       /* 背景 */
  --surface: #ffffff;
  --ink: #1d2b33;         /* 本文 */
  --muted: #4b5b63;       /* 補足文（背景に対して 4.5:1 以上） */
  --rule: #cdd8dc;
  --ours: #eef4ee;        /* サイト独自の提案の背景 */
  --ours-rule: #5d7f5f;
  --focus: #b25e00;

  --font-body: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-head: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "HG丸ｺﾞｼｯｸM-PRO", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 1.875rem;
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.8;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.45;
  letter-spacing: 0.03em;
  margin: 0;
}
h1 { font-size: var(--step-3); font-weight: 700; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
h4 { font-size: var(--step-0); font-weight: 700; }
p { margin: 0; }

a { color: var(--table); text-underline-offset: 0.2em; }
a:hover { color: var(--table-deep); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
h1:focus { outline: none; }

.skip {
  position: absolute; left: 0.5rem; top: -4rem;
  background: var(--surface); color: var(--ink);
  padding: 0.75rem 1rem; z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* ---------- 開発用サンプルの注意帯 ---------- */
.sample-banner {
  background: repeating-linear-gradient(135deg, #fff3cd 0 14px, #ffe69c 14px 28px);
  color: #3d2e00;
  font-weight: 700;
  text-align: center;
  padding: 0.6rem 1rem;
  border-bottom: 2px solid #8a6d00;
}

/* ---------- ヘッダー（台の縁のような帯） ---------- */
.bar {
  background: var(--table);
  border-bottom: 4px solid var(--line);
}
.bar-inner {
  max-width: 48rem; margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.25rem 1rem;
}
.brand {
  color: var(--line); text-decoration: none;
  font-family: var(--font-head); font-weight: 700; font-size: var(--step-1);
  padding: 0.5rem 0;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.brand::before {
  content: ""; width: 0.85rem; height: 0.85rem; border-radius: 50%;
  background: var(--ball);
}
.brand:hover { color: var(--line); }
.bar nav { display: flex; gap: 0.25rem; }
.bar nav a {
  color: var(--line); text-decoration: none;
  font-size: var(--step--1);
  padding: 0.65rem 0.6rem; min-height: 44px;
  display: inline-flex; align-items: center;
  border-radius: 6px;
}
.bar nav a:hover { background: var(--table-deep); color: var(--line); }

/* ---------- ページ枠 ---------- */
.page {
  max-width: 48rem; margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.page > * + * { margin-top: 2.25rem; }
.lead { color: var(--muted); max-width: var(--measure); margin-top: 0.5rem; }
.loading { color: var(--muted); }

/* ---------- トップ：上から見た卓球台 ---------- */
.hero {
  position: relative;
  background: var(--table);
  color: var(--line);
  border: 5px solid var(--line);
  outline: 2px solid var(--table);
  padding: 1.75rem 1.25rem 2rem;
  isolation: isolate;
}
/* センターライン */
.hero::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 0; bottom: 0; width: 2px;
  background: rgba(255, 255, 255, 0.55);
}
/* ネット（見出しと説明文のあいだ） */
.hero-net {
  display: block;
  margin: 1.25rem -1.25rem 1.1rem;
  height: 8px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.9) 0 3px, rgba(255,255,255,0.25) 3px 7px);
  border-top: 2px solid var(--line);
}
.hero h1 {
  font-size: clamp(1.9rem, 8vw, 2.75rem);
  letter-spacing: 0.06em;
  max-width: 12em;
}
.hero p {
  max-width: 24em;
  font-size: var(--step-0);
  line-height: 1.9;
  position: relative;
  background: var(--table);
  padding-right: 0.25em;
}
.hero-ball {
  position: absolute; right: 1.25rem; top: 1.25rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--ball);
  box-shadow: inset -0.25rem -0.25rem 0 rgba(0,0,0,0.12);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-ball { animation: bounce 1.6s ease-in-out 0.2s 2; }
  @keyframes bounce {
    0%, 100% { transform: translateY(0); }
    45% { transform: translateY(2.2rem); }
  }
}

/* ---------- セクション見出し ---------- */
.section-head { margin-bottom: 0.75rem; }
.section-head p { color: var(--muted); margin-top: 0.25rem; font-size: var(--step--1); }

/* ---------- 選択肢（困りごと・質問の回答） ---------- */
.choices { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.choices li { border-bottom: 1px solid var(--rule); }
.choice {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 3.5rem;
  padding: 0.85rem 0.5rem 0.85rem 0.25rem;
  color: var(--ink); text-decoration: none;
  font-weight: 700;
  background: transparent;
}
.choice::after {
  content: ""; flex: none;
  width: 0.6rem; height: 0.6rem;
  border-right: 2px solid var(--table); border-bottom: 2px solid var(--table);
  transform: rotate(-45deg);
}
.choice:hover { background: var(--surface); color: var(--table-deep); }
.choice .count { font-weight: 400; color: var(--muted); font-size: var(--step--1); margin-left: auto; white-space: nowrap; }
.choice.unknown { font-weight: 400; color: var(--muted); }

/* 質問画面 */
.progress { font-size: var(--step--1); color: var(--muted); }
.question h1 { font-size: var(--step-2); margin-top: 0.25rem; }
.back { display: inline-flex; align-items: center; min-height: 44px; }

/* 選んだ内容のまとめ */
.picked {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; align-items: center;
  margin-top: 0.75rem; font-size: var(--step--1);
}
.chip {
  display: inline-block;
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 999px; padding: 0.15rem 0.75rem;
}

/* ---------- 動画 ---------- */
.video {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.1rem;
}
.video + .video { margin-top: 1rem; }
.video.primary { border-left: 6px solid var(--table); }
.video h3 { font-size: var(--step-1); }
.video .channel { color: var(--muted); font-size: var(--step--1); margin-top: 0.15rem; }
.video .why { margin-top: 0.75rem; }
.video .why strong { display: block; font-size: var(--step--1); color: var(--muted); font-weight: 700; }

.facts { margin: 0.9rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.9rem; font-size: var(--step--1); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.block { margin-top: 1rem; padding: 0.9rem 1rem; }
.block h4 { font-size: var(--step--1); }
.block p + p, .block h5 + p { margin-top: 0.35rem; }
.block h5 { font-size: var(--step--1); margin: 0.75rem 0 0; font-family: var(--font-head); }
.from-video { border: 2px solid var(--table); }
.ours { background: var(--ours); border-left: 4px solid var(--ours-rule); }
.ours .note { font-size: var(--step--1); color: var(--muted); }

.times { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.times li + li { margin-top: 0.25rem; }
.times a { display: inline-flex; min-height: 44px; align-items: center; gap: 0.5rem; }
.times .t { font-variant-numeric: tabular-nums; font-weight: 700; }

.actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.6rem 1.25rem;
  background: var(--table); color: var(--line);
  border: 2px solid var(--table); border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.btn:hover { background: var(--table-deep); border-color: var(--table-deep); color: var(--line); }
.btn.disabled { background: transparent; color: var(--muted); border-color: var(--rule); border-style: dashed; }
.reviewed { font-size: var(--step--1); color: var(--muted); }

.badge-sample {
  display: inline-block; margin-bottom: 0.5rem;
  background: #fff3cd; color: #3d2e00; border: 1px dashed #8a6d00;
  font-size: var(--step--1); font-weight: 700; padding: 0.1rem 0.6rem;
}

details.more { margin-top: 0.75rem; }
details.more summary {
  cursor: pointer; min-height: 44px; display: flex; align-items: center;
  color: var(--table); font-weight: 700;
}

/* ---------- まず試す練習（動画なしでもできる） ---------- */
.first-step { background: var(--ours); border-left: 4px solid var(--ours-rule); padding: 1.1rem 1rem; }
.first-step h2 { font-size: var(--step-1); }
.first-step .note { font-size: var(--step--1); color: var(--muted); margin-top: 0.25rem; }
.first-step p + p, .first-step h3 + p { margin-top: 0.5rem; }
.first-step h3 { font-size: var(--step-0); margin-top: 0.9rem; }

.empty { background: var(--surface); border: 1px dashed var(--rule); padding: 1.1rem 1rem; }
.empty p + p { margin-top: 0.5rem; }

/* 用語 */
.term { background: var(--surface); border-left: 4px solid var(--ball); padding: 0.75rem 1rem; max-width: var(--measure); }

/* 保護者向け・サイト説明 */
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-1); margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin-top: 0.6rem; }
.prose ul { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.4rem; }

.parents-teaser { border-top: 4px solid var(--table); padding-top: 1rem; }
.parents-teaser ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.parents-teaser li + li { margin-top: 0.25rem; }
.parents-teaser a { display: inline-flex; min-height: 44px; align-items: center; margin-top: 0.25rem; }

/* ---------- フッター ---------- */
.foot { border-top: 1px solid var(--rule); background: var(--surface); }
.foot-inner { max-width: 48rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; font-size: var(--step--1); color: var(--muted); }
.foot-inner p + p { margin-top: 0.5rem; }
.foot a { display: inline-flex; min-height: 44px; align-items: center; }

@media (min-width: 40rem) {
  .page { padding-top: 2rem; }
  .hero { padding: 2.5rem 2rem 2.25rem; }
  .hero-net { margin-left: -2rem; margin-right: -2rem; }
  .video { padding: 1.5rem 1.5rem; }
}

.visually-hidden-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.times .t { margin-right: 0.5rem; }
.picked a { display: inline-flex; min-height: 44px; align-items: center; }

/* ---------- トップの短い補足 ---------- */
.page > .about-note {
  margin-top: 0.75rem;
  font-size: var(--step--1);
  color: var(--muted);
  max-width: var(--measure);
  line-height: 1.7;
}

/* ---------- 動画リンク（紹介つき動画より簡潔に） ---------- */
.ref-list { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--rule); }
.ref { padding: 0.9rem 0.25rem 1rem; border-bottom: 1px dashed var(--rule); }
.ref h3 { font-size: var(--step-0); margin-top: 0.35rem; }
.ref .channel { color: var(--muted); font-size: var(--step--1); margin-top: 0.15rem; }
.ref-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ref-tags .badge-sample { margin-bottom: 0; }
.ref-link {
  display: inline-flex; align-items: center; min-height: 44px;
  margin-top: 0.35rem; font-weight: 700;
}
.ref-link.disabled { color: var(--muted); font-weight: 400; }

/* 開発用サンプルは実在リンクと見分けられるよう、点線の注意枠で囲む */
.ref.is-sample {
  border: 2px dashed #8a6d00; background: #fffbea;
  padding-left: 0.75rem; padding-right: 0.75rem; margin-top: 0.5rem;
}
