/* ページの骨格。設計案 v5（水色）の構造をそのまま実装する。
   値は tokens.css のトークンで書き、この層では 16 進数を直書きしない。

   担当範囲：
   ・サイト共通の枠（ヘッダー / タイトル行 / フッター）
   ・プレイ区の 3 カラム（シンプル皮膚のときだけ使う）
   ・本文の 2 カラムカード
   レトロ機の筐体は game.css が持つ。あちらは「机の上の物体」の絵なので
   このレイアウト体系の外にある。 */

/* ---------- 共通の器 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 24px; width: 100%; }

/* ---------- ヘッダー ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line-soft); position: relative; z-index: 2; }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 7px 24px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0; white-space: nowrap; }
/* 丸いマスコット枠。ロゴ画像を円に収めることで、文字組みと視覚重量が釣り合う */
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--mascot-bg); object-fit: contain; padding: 3px;
}
.brand-word b { display: block; font-weight: 900; font-size: 19px; letter-spacing: .5px; line-height: 1; color: var(--ink); }
.brand-word .rule { display: none; }
.brand-word em { display: block; font-style: normal; font-size: 9px; letter-spacing: 2.5px; line-height: 1.5; color: var(--muted); }

.site-nav { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: none; border-radius: 999px; padding: 6px 17px;
  font-weight: 700; font-size: 13.5px; color: var(--sub); white-space: nowrap;
}
.site-nav a:hover { background: var(--soft); }
.site-nav a[aria-current="page"] { background: var(--accent); color: var(--surface); }

.header-actions { margin-left: 0; display: flex; gap: 8px; }
.icon-button {
  display: grid; place-items: center; width: 33px; height: 33px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--sub); line-height: 1;
}
.icon-button:hover { border-color: var(--accent); color: var(--accent); }
.color-strip { height: 4px; }

/* ---------- タイトル行 ---------- */
/* 縦は盤の取り分。ここを 1px 削るぶんだけ盤が 0.5px 広くなる（1:2 なので）*/
.title-row { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; padding-top: 7px; margin-bottom: 7px; }
/* 視口の高さで見出しを縮める規則は撤去した。ここが 900px を境に高さを変えると、
   head で初回描画の倍率を見積もるときの定数（舞台の上端 100px）が狂う。
   稼げるのは盤の高さ 3px ほどで、跳ねて見えるのと引き換えにする価値がない */
.title-row h1 {
  margin: 0; font-size: 22px; font-weight: 900; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif;
}
.title-row h1::before { content: ''; display: inline-block; width: 5px; height: 23px; border-radius: 3px; background: var(--accent); }
.title-badges { display: flex; gap: 8px; align-items: center; }
.play-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.play-count b { color: var(--ink); }

/* ---------- プレイ区（シンプル皮膚）---------- */
/* 3 カラムの格子そのものは game.css の [data-skin="plain"] .lcd が持つ
   （同じ DOM を皮膚で組み替えるため）。ここは柱の中身の積み方だけ */
.play-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- 本文カード ---------- */
/* 節は 1 行 1 つ。横に 2 つ並べると、左右で話題が飛んで読み順が壊れる。
   分けられる中身は節の「内側」でカードに割る（下の .sub-grid）*/
.content-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
/* 見出しの標の色は節ごとに変える。全部同じ青だと 8 節が一続きに見えて、
   どこまでが 1 つの話題なのか目で切れない */
.content-section {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius-card); padding: 20px 22px;
  width: auto; margin: 0;
}
.content-section h2 {
  margin: 0 0 10px; padding: 0; border: 0;
  font-size: 16px; font-weight: 900; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif;
}
.content-section h2::before { content: ''; display: inline-block; width: 5px; height: 16px; border-radius: 2px; background: var(--accent); flex: none; }
.content-section:nth-of-type(3n+2) h2::before { background: var(--gold); }
.content-section:nth-of-type(3n) h2::before { background: var(--you); }
.content-section h3 { margin: 14px 0 4px; font-size: 13.5px; color: var(--ink); }
.content-section p { margin: 0 0 10px; color: var(--sub); font-size: 13px; line-height: 2; text-wrap: pretty; }
.content-section p:last-child { margin-bottom: 0; }
.content-section ul { margin: 0; padding-left: 1.2em; }
.content-section li { color: var(--sub); font-size: 13px; line-height: 1.9; margin-bottom: 4px; }


.faq-section details { padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.faq-section details:last-of-type { border-bottom: 0; }
.faq-section summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink); font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif; }
.faq-section details p { margin-top: 6px; }

/* ---------- 関連ゲーム ---------- */
.related { margin-top: 28px; }
.related h2 { margin: 0 0 12px; font-size: 16px; font-weight: 900; color: var(--ink); display: flex; align-items: center; gap: 8px; font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif; }
.related h2::before { content: ''; display: inline-block; width: 5px; height: 16px; border-radius: 2px; background: var(--you); }
/* 設計案は 4 列。ゲームが 4 本に満たないうちは auto-fill で列幅を保つ ——
   auto-fit だと 1 本のとき 1 枚が 1200px に伸びて、カードではなく帯になる */
.game-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin: 0; }
/* 設計案は「アイコン枠 + 名前と説明の縦組み」。名前と説明を横に並べると
   名前側が潰れて 3 行に折れる */
.game-links a {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius-card); padding: 14px;
}
/* アイコン枠。ゲームごとに地色を変えて、一覧の中で見分けがつくようにする */
.game-link-icon {
  flex: none; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 12px; font-size: 26px; line-height: 1;
  background: var(--board-bg); border: 1px solid var(--board-edge);
}
.game-links a[data-game="sand"] .game-link-icon { background: #FBEEDC; border-color: #E8CFA3; }
.game-links .game-link-text { flex: 1; min-width: 0; }
.game-links a:hover { border-color: var(--accent-weak); background: var(--soft); }
.game-links b { display: block; font-size: 14px; font-weight: 900; color: var(--ink); white-space: nowrap; font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif; }
.game-links small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); line-height: 1.7; }

/* ---------- フッター ---------- */
.site-footer {
  margin-top: auto; background: var(--footer-bg); border-top: 1px solid var(--line);
  padding: 0; display: block;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-inner > div { display: flex; gap: 18px; font-size: 12px; color: var(--sub); flex-wrap: wrap; }
.site-footer span { font-size: 12px; color: var(--muted); }
.site-footer a { font-size: 12px; color: var(--sub); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 狭い画面 ---------- */
/* プレイ区を幅で組み直す @media は撤去した。版面は実寸で組んで transform で
   丸ごと縮める方式なので、幅に応じて並びを変える必要が無い。
   しかもここは既に存在しない .play-grid を指しており、生きていた
   .play-col.is-right の横並び指定だけが右柱を潰していた */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
}
/* モバイルは筐体レイアウト固定。ここは大きく変えない方針 */
@media (max-width: 560px) {
  .wrap, .header-inner, .footer-inner { padding-inline: 14px; }
  .title-row { padding-top: 10px; margin-bottom: 10px; gap: 8px; }
  .title-row h1 { font-size: 20px; }
  .title-row h1::before { height: 22px; width: 5px; }
  .play-count { margin-left: 0; width: 100%; }
  .play-grid { display: block; }
  .content-grid { margin-top: 20px; gap: 12px; }
  .content-section { padding: 16px 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-word b { font-size: 18px; }
  .site-nav a { padding: 6px 14px; font-size: 13px; }
  .icon-button { width: 34px; height: 34px; }
}

/* ---------- 練習ページ: 使い方の 3 枚（環 2 上手）---------- */
/* 図は実機のスクリーンショット。3 枚とも同じ 4:5 で撮ってあるので、
   高さは揃う（SD7: 図卡類は齊套か全無、混在させない）*/
.step-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 0; padding: 0; list-style: none;
}
.step-cards li { display: flex; flex-direction: column; gap: 7px; }
.step-cards img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--soft);
}
.step-cards b { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.step-cards span { font-size: 13px; line-height: 1.8; color: var(--sub); }

/* ---------- 練習ページ: 練習の順番（環 4 決策）---------- */
/* 順序そのものが答えなので、番号は装飾ではなく内容。ol のまま使う */
.order-list { margin: 12px 0 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 9px; }
.order-list li { font-size: 13.5px; line-height: 1.85; color: var(--sub); }
.order-list b { display: block; font-size: 14px; color: var(--ink); }

@media (max-width: 700px) {
  .step-cards { grid-template-columns: 1fr; gap: 18px; }
  /* 1 列になると図が本文幅いっぱいまで伸びて主張が強すぎるので上限を切る */
  .step-cards img { max-width: 320px; }
}
