/* 解説ページ(/games, /games/<id>)の見た目。組むのは server/pages.js。
 *
 * アプリの CSS 一式とは分けてある。卓の CSS は盤・札・賽・演出のためのもので、
 * 読み物には一行も要らない ―― 検索から来た人が最初に待たされる時間を、文字を
 * 出すのに必要なぶんだけにする。色と書体は styles/tokens.css を共有するので、
 * 同じ店に見えるが、積む量が違う。
 *
 * 一段組み。読み物なので幅を追わせない。
 */

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

body {
  margin: 0;
  background-color: var(--shop-paper);
  background-image: var(--shop-paper-grain);
  color: var(--shop-ink);
  font-family: var(--shop-font-body), 'Hiragino Kaku Gothic ProN', sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  /* 和文の読み物なので、字送りをわずかに開けて行を落ち着かせる。 */
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
}

.doc-inner {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--shop-seal-deep); }
a:hover { color: var(--shop-seal); }

/* --- 看板 ------------------------------------------------------------- */

.doc-header {
  background: linear-gradient(160deg, var(--shop-walnut-warm), var(--shop-walnut-deep));
  border-bottom: 1px solid var(--shop-brass);
}
.doc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding-block: 10px;
}
.doc-logotype {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--shop-brass-light);
}
/* 菱の中に一字。店先の紋と同じ組み方(shop.css の .emblem)。 */
.doc-emblem {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  transform: rotate(45deg);
  border: 1px solid var(--shop-brass-light);
  background: var(--shop-walnut-deep);
}
.doc-emblem span {
  transform: rotate(-45deg);
  font-family: var(--shop-font-display);
  font-weight: 700;
  font-size: 1rem;
}
.doc-shopname {
  font-family: var(--shop-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.doc-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.doc-nav a {
  padding: 6px 12px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--shop-paper-deep);
}
.doc-nav a:hover { color: var(--shop-brass-light); }
/* 押せる範囲を 44px の丈まで広げる(見た目はそのまま、#195)。 */
.doc-nav a { position: relative; }
.doc-nav a::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, 44px); transform: translateY(-50%); }
.doc-nav .doc-nav-enter {
  border: 1px solid var(--shop-brass-light);
  border-radius: var(--radius);
  color: var(--shop-brass-light);
}
.doc-nav .doc-nav-enter:hover {
  background: var(--shop-brass-light);
  color: var(--shop-walnut-deep);
}

/* --- 現在の位置 ------------------------------------------------------- */

.doc-main { padding: 22px 0 56px; }

.doc-breadcrumb {
  margin-bottom: 18px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--shop-ink-soft);
}
.doc-breadcrumb a { color: var(--shop-ink-soft); text-decoration: none; }
.doc-breadcrumb a:hover { color: var(--shop-seal); text-decoration: underline; }
.doc-sep { margin: 0 8px; opacity: 0.55; }

/* --- 題 --------------------------------------------------------------- */

.doc-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--shop-walnut-deep);
  border-radius: var(--radius);
  color: var(--shop-paper);
  box-shadow: 0 2px 10px rgba(36, 24, 16, 0.22);
}
.doc-hero-art { flex: 0 0 auto; }
.doc-hero-text { min-width: 0; }

/* 箱の蓋。棚に並ぶ箱と同じ絵を、同じ 232 の枠で出す。地はこの枠自身ではなく
   題の地(.doc-hero)なので、ここは絵の器だけ。 */
.doc-cover {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  padding: 4px;
  border: 1px solid rgba(20, 12, 4, 0.35);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 226, 0.12);
}
.doc-cover-art { width: 100%; height: 100%; }
.doc-cover-glyph {
  font-family: var(--shop-font-display);
  font-weight: 700;
  color: var(--shop-paper);
  line-height: 1;
}

.doc-eyebrow {
  margin: 0 0 6px;
  font-family: var(--shop-font-stamp);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: var(--shop-brass-light);
}
.doc-hero h1 {
  margin: 0 0 10px;
  font-family: var(--shop-font-display);
  font-size: clamp(1.5rem, 4.6vw, 2.1rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: 0.04em;
}
.doc-tagline {
  margin: 0 0 12px;
  font-family: var(--shop-font-display);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--shop-brass-light);
}
.doc-lede {
  margin: 0 0 16px;
  font-size: 0.93rem;
  line-height: 1.85;
  color: rgba(247, 241, 225, 0.92);
}

/* --- 卓へ ------------------------------------------------------------- */

.doc-cta {
  display: inline-block;
  padding: 11px 24px;
  background: var(--shop-brass-light);
  border: 1px solid var(--shop-brass);
  border-radius: var(--radius);
  color: var(--shop-walnut-deep);
  font-family: var(--shop-font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(36, 24, 16, 0.3);
}
.doc-cta:hover {
  background: #f0dcab;
  color: var(--shop-walnut-deep);
}
.doc-cta-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(247, 241, 225, 0.7);
}
.doc-cta-wide { padding-inline: 34px; }
.doc-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.doc-close .doc-cta-row { justify-content: center; }
/* 「CPUと一局」: 主の札の脇に置く、枠だけの札。地の色で字の色を替える。 */
.doc-cta-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--shop-paper);
}
.doc-cta-ghost:hover {
  background: rgba(247, 241, 225, 0.12);
  color: var(--shop-paper);
}
.doc-close .doc-cta-ghost,
.doc-close .doc-cta-ghost:hover { color: var(--shop-walnut-deep); }
.doc-close .doc-cta-ghost:hover { background: rgba(176, 138, 62, 0.14); }

/* --- 人数・時間の札 --------------------------------------------------- */

.doc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}
/* 無料・仮想のチップ・換金なし(issue #142、ポーカーだけ)。 */
.doc-note {
  margin: 12px 0 0;
  padding: 8px 14px;
  border: 1px dashed var(--shop-paper-line);
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--shop-ink-soft);
}
.doc-stat {
  padding: 10px 14px;
  background: var(--shop-paper-light);
  border: 1px solid var(--shop-paper-line);
  border-left: 3px solid var(--shop-brass);
  border-radius: var(--radius);
}
.doc-stat dt {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--shop-ink-soft);
}
.doc-stat dd {
  margin: 2px 0 0;
  font-family: var(--shop-font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

/* --- 本文 ------------------------------------------------------------- */

.doc-section { margin-top: 38px; }
.doc-section h2,
.doc-related h2 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--shop-paper-line);
  font-family: var(--shop-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
/* 見出しの下の罫は紙の色、その左端だけ真鍮 ―― 一本の線で、節の始まりと
   店の色を同時に言う。 */
.doc-section h2 { position: relative; }
.doc-section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 52px;
  height: 2px;
  background: var(--shop-brass);
}
.doc-section p { margin: 0 0 14px; }
.doc-section-note {
  font-size: 0.85rem;
  color: var(--shop-ink-soft);
}

.doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc-list li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 20px;
}
.doc-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.78em;
  width: 7px;
  height: 7px;
  border: 1px solid var(--shop-seal);
  border-radius: 50%;
}

/* ルールの箇条。名前で拾って読むものなので、名前を朱で立てる。 */
.doc-rules { margin: 0; }
.doc-rules dt {
  margin-top: 14px;
  font-family: var(--shop-font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--shop-seal-deep);
}
.doc-rules dd {
  margin: 2px 0 0;
  padding-left: 14px;
  border-left: 1px solid var(--shop-paper-line);
  font-size: 0.93rem;
}
.doc-rules dd.doc-rules-plain { padding-left: 0; border-left: 0; margin-top: 10px; }

.doc-faq { margin: 0; }
.doc-faq dt {
  margin-top: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.doc-faq dt::before {
  content: '問';
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  margin-right: 8px;
  background: var(--shop-seal);
  border-radius: 50%;
  color: var(--shop-paper-light);
  font-family: var(--shop-font-stamp);
  font-size: 0.7rem;
  font-weight: 400;
  vertical-align: 0.1em;
}
.doc-faq dd {
  margin: 4px 0 0 calc(1.5em + 8px);
  font-size: 0.93rem;
  color: var(--shop-ink-soft);
}

/* あそびかたの図。一枚の紙に貼ってある体で、紙の色を敷く。 */
.doc-figure {
  margin: 0 0 18px;
  padding: 14px;
  background: var(--shop-paper-light);
  border: 1px solid var(--shop-paper-line);
  border-radius: var(--radius);
}
.doc-figure-art { display: flex; justify-content: center; }
/* 図は 320 前後の幅で描かれている。紙の幅いっぱいに伸ばすと線も字も一緒に
   太るので、アプリの品書き(base.css の .rules-diagram-art)と同じところで
   止める。 */
.doc-figure-art > svg {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
}
.doc-figure figcaption {
  margin-top: 10px;
  font-size: 0.8rem;
  text-align: center;
  color: var(--shop-ink-soft);
}

/* --- 点数表・役一覧とローカルルールの例 -----------------------------------
   組むのは public/rules-diagrams.mjs の ruleTableHtml / ruleExampleHtml。
   解説ページ(article.css)とアプリ(base.css)に同じものを置く。 */
.rt { margin: 0; }
.rt-lead { margin: 0 0 12px; }
.rt-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--shop-paper-light);
  border: 1px solid var(--shop-paper-line);
  font-size: 0.85rem;
  line-height: 1.55;
}
.rt-table thead th {
  padding: 7px 8px;
  background: var(--shop-paper-deep);
  border-bottom: 1px solid var(--shop-brass);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--shop-ink-soft);
  text-align: left;
}
.rt-table td,
.rt-table tbody th {
  padding: 9px 8px;
  border-top: 1px solid var(--shop-paper-line);
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
}
.rt-table .rt-pts { text-align: right; white-space: nowrap; }
/* 例の列は絵の幅で足りるので、役の名前の列に幅を回す。 */
.rt-table thead th:first-child { width: 42%; }
.rt-table td.rt-pts {
  font-family: var(--shop-font-display);
  font-weight: 700;
  color: var(--shop-seal-deep);
}
.rt-table .rt-group th {
  padding: 6px 8px;
  background: rgba(222, 208, 170, 0.35);
  font-family: var(--shop-font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--shop-seal-deep);
}
.rt-name { display: block; font-weight: 700; color: var(--shop-ink); }
.rt-sub { display: block; font-size: 0.72rem; color: var(--shop-ink-soft); }
.rt-art { display: block; margin-bottom: 4px; border-radius: 6px; }
.rt-example { display: flex; flex-direction: column; gap: 3px; }
.rt-dice { display: block; }
.rt-cards { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rt-cards > svg { display: block; flex: none; }
.rt-count { margin-left: 4px; font-size: 0.75rem; color: var(--shop-ink-soft); }
.rt-result { font-size: 0.72rem; color: var(--shop-ink-soft); }
.rt-text { font-size: 0.8rem; }
.rt-note { margin: 8px 0 0; font-size: 0.75rem; line-height: 1.7; color: var(--shop-ink-soft); }

.rx {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 3px;
  background: rgba(222, 208, 170, 0.45);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--shop-ink);
}
.rx-label { margin-right: 4px; font-size: 0.72rem; color: var(--shop-brass-deep); }
.rx-cards { display: inline-flex; gap: 2px; }
.rx-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 3px;
  box-sizing: border-box;
  border: 1px solid var(--shop-ink);
  border-radius: 3px;
  background: var(--shop-paper-light);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: var(--shop-ink);
}
.rx-card.rx-red { color: var(--shop-seal); }
.rx-card.rx-joker { min-width: 36px; border: 1.4px solid var(--shop-seal); font-size: 0.6rem; color: var(--shop-seal); }
.rx-seats { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px; }
.rx-seat {
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--shop-ink-soft);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
}
.rx-seat.rx-active { background: var(--shop-ink); border-color: var(--shop-ink); color: var(--shop-paper-light); }
.rx-seat.rx-next { border: 1.6px solid var(--shop-seal); color: var(--shop-seal); }
.rx-seat.rx-skip { opacity: 0.35; text-decoration: line-through; }
.rx-arrow { font-size: 0.7rem; color: var(--shop-ink-soft); }
.doc-rules dd.doc-rules-example { margin-top: 6px; }

/* --- 締め ------------------------------------------------------------- */

.doc-close {
  margin-top: 40px;
  padding: 26px 20px;
  background: var(--shop-paper-deep);
  border: 1px solid var(--shop-paper-line);
  border-radius: var(--radius);
  text-align: center;
}
.doc-close-lead {
  margin: 0 0 14px;
  font-family: var(--shop-font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

/* --- 商品紹介リンク(#148) --------------------------------------------
   締めの「卓を立てる」より後ろ、更新日の前。この店の本題は無料で遊べること
   なので、締めより目立たせない ―― 地も罫も敷かず、細い一本線の下に小さく。
   「PR」の判は真鍮で、景品表示法のステマ規制で求められる広告の明示。 */

.doc-shop {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--shop-paper-line);
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
/* 品の絵を入れる木札。棚の背表紙や「店主への便り」の封筒と同じ、
   真鍮の縁を打った胡桃の板。紙の地に対して利くので、文だけのときより
   目に入る ―― そのぶん地色は敷かず、札一枚だけで止める。 */
.doc-shop-plaque {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 4px;
  border: 1px solid var(--shop-brass);
  border-radius: 4px;
  background: linear-gradient(160deg, var(--shop-walnut-warm), var(--shop-walnut));
  box-shadow: inset 0 0 0 1px rgba(221, 192, 127, 0.35);
  display: grid;
  place-items: center;
}
.doc-shop-plaque svg { display: block; width: 52px; height: 52px; }
.doc-shop-body { flex: 1; min-width: 0; }
.doc-shop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-family: var(--shop-font-display);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--shop-ink-soft);
}
.doc-shop-pr {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--shop-brass);
  border-radius: 3px;
  font-family: var(--shop-font-stamp);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  color: var(--shop-brass-deep);
}
.doc-shop-link { margin: 0; font-size: 0.95rem; }
.doc-shop-link a {
  color: var(--shop-walnut-warm);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.doc-shop-link a:hover { color: var(--shop-seal-deep); }
/* 実物で遊ぶ情景の一行。リンクの続きとして読ませたいので、字は本文寄りで。 */
.doc-shop-pitch {
  margin: 4px 0 0;
  font-family: var(--shop-font-display);
  font-size: 0.86rem;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--shop-ink-soft);
}
.doc-shop-note {
  margin: 6px 0 0;
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--shop-ink-soft);
}
.doc-shop-note a { color: inherit; text-decoration: underline; }

.doc-updated {
  margin: 20px 0 0;
  font-size: 0.75rem;
  color: var(--shop-ink-soft);
}

/* --- ほかのゲーム ----------------------------------------------------- */

.doc-related { margin-top: 46px; }
.doc-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc-related-list a {
  display: block;
  height: 100%;
  padding: 12px 14px;
  background: var(--shop-paper-light);
  border: 1px solid var(--shop-paper-line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--shop-ink);
}
.doc-related-list a:hover { border-color: var(--shop-brass); }
.doc-related-name {
  display: block;
  font-family: var(--shop-font-display);
  font-size: 1.05rem;
  font-weight: 700;
}
.doc-related-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--shop-ink-soft);
}
.doc-related-all {
  margin: 14px 0 0;
  font-size: 0.85rem;
}

/* --- お品書き(/games) ------------------------------------------------- */

.doc-index-head h1 {
  margin: 0 0 12px;
  font-family: var(--shop-font-display);
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.doc-index-head .doc-eyebrow { color: var(--shop-brass-deep); }
.doc-index-head .doc-lede { color: var(--shop-ink); }

.doc-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc-shelf-item a {
  display: flex;
  gap: 14px;
  height: 100%;
  padding: 14px;
  background: var(--shop-paper-light);
  border: 1px solid var(--shop-paper-line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--shop-ink);
}
.doc-shelf-item a:hover { border-color: var(--shop-brass); }
.doc-shelf-item .doc-cover {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
}
.doc-shelf-body { min-width: 0; }
.doc-shelf-name {
  font-family: var(--shop-font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.doc-shelf-players {
  margin-left: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--shop-ink-soft);
}
.doc-shelf-desc {
  display: block;
  margin-top: 4px;
  font-size: 0.83rem;
  line-height: 1.75;
  color: var(--shop-ink-soft);
}
.doc-shelf-more {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--shop-seal-deep);
}

/* --- 店の裾 ----------------------------------------------------------- */

.doc-footer {
  padding: 26px 0;
  background: linear-gradient(160deg, var(--shop-walnut-warm), var(--shop-walnut-deep));
  border-top: 1px solid var(--shop-brass);
  color: var(--shop-paper-deep);
}
.doc-footer-name {
  margin: 0 0 4px;
  font-family: var(--shop-font-display);
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  color: var(--shop-brass-light);
}
.doc-footer-line {
  margin: 0;
  font-size: 0.82rem;
}
.doc-footer a { color: var(--shop-paper-deep); }
.doc-footer a:hover { color: var(--shop-brass-light); }

/* --- 手のなかの紙 ----------------------------------------------------- */

@media (max-width: 600px) {
  body { font-size: 0.97rem; }
  .doc-inner { padding: 0 16px; }
  /* 題は縦に積む。箱絵は残す ―― どのゲームの紙かを一目で言う唯一の絵なので、
     小さくしても落とさない。 */
  .doc-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .doc-cover { width: 112px; height: 112px; }
  .doc-cta { display: block; text-align: center; }
  .doc-cta-row { flex-direction: column; align-items: stretch; }
  .doc-shelf-item a { gap: 12px; }
  .doc-shelf-item .doc-cover { width: 68px; height: 68px; }
}

/* --- 目次と「すぐ遊ぶ」の札(#183) ------------------------------------ */

/* ふだん(狭い PC・タブレット)は今までの一段組み。目次と右の札は出さず、
   遊ぶ釦は頭の箱の中。 */
.doc-toc,
.doc-play { display: none; }
.doc-toc ul { margin: 0; padding: 0; list-style: none; }
.doc-toc-short { display: none; }
/* 目次から飛んだ見出しが、画面の上端に貼り付かないように。 */
.doc-section,
.doc-related { scroll-margin-top: 16px; }

/* 広い PC は三列: 左に目次、真ん中に本文、右に「すぐ遊ぶ」の札。目次と札は
   送っても横に留まる(sticky。スクリプトは足さない、#137)。頭の箱は題と
   文句だけになり、蓋の絵と釦は右の札へ移る。 */
@media (min-width: 1100px) {
  body.doc-wide .doc-inner { max-width: 1120px; }
  .doc-game {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) 220px;
    grid-template-areas:
      "toc crumb   play"
      "toc article play"
      "toc related play";
    grid-template-rows: auto auto 1fr;
    column-gap: 40px;
  }
  .doc-game > .doc-breadcrumb { grid-area: crumb; }
  .doc-game > .doc-article { grid-area: article; }
  .doc-game > .doc-related { grid-area: related; }
  .doc-game > .doc-toc,
  .doc-game > .doc-play {
    position: sticky;
    top: 20px;
    align-self: start;
  }

  .doc-toc {
    display: block;
    grid-area: toc;
    padding-top: 40px;
    font-size: 0.88rem;
  }
  .doc-toc-head {
    margin: 0 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--shop-ink-soft);
  }
  .doc-toc a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 0 4px 14px;
    border-left: 2px solid var(--shop-paper-line);
    line-height: 1.5;
    color: var(--shop-ink);
    text-decoration: none;
  }
  .doc-toc a:hover {
    border-left-color: var(--shop-brass);
    color: var(--shop-seal-deep);
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .doc-play {
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-area: play;
    padding: 16px;
    background: linear-gradient(160deg, var(--shop-walnut-warm), var(--shop-walnut-deep));
    border: 1px solid var(--shop-walnut-deep);
    border-radius: var(--radius);
    box-shadow: 0 12px 24px rgba(36, 24, 16, 0.3);
  }
  .doc-play-art {
    align-self: center;
    border-radius: var(--radius);
  }
  .doc-play .doc-cover { width: 150px; height: 150px; }
  /* 札の幅は 190px ほど。長い名前(ライアーズダイス)は二行に折れるので、
     折れ目を揃える。 */
  .doc-play .doc-cta {
    display: block;
    padding-inline: 10px;
    text-align: center;
    letter-spacing: 0.04em;
    text-wrap: balance;
  }
  .doc-play .doc-cta-note { margin: 0; line-height: 1.7; }

  .doc-game .doc-hero-art,
  .doc-game .doc-hero .doc-cta-row,
  .doc-game .doc-hero .doc-cta-note { display: none; }
  .doc-game .doc-lede { margin-bottom: 0; }
  /* 真ん中の列は 600px ほど。人数・時間の札を一段に四つ並べる。 */
  .doc-game .doc-stats { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
}

/* --- 目次の帯と、下に留まる遊ぶ帯(#184) ------------------------------- */

/* 三列にならない幅(スマホ・タブレット・狭い PC)。目次は頭の下に、節へ飛ぶ
   札を一段。入りきらない遊びは横に送る。遊ぶ釦は頭の箱から外し、画面の下に
   留めた帯に一本化する ―― 読み終えたところから、いつでも押せるように。 */
.doc-playbar { display: none; }
@media (max-width: 1099px) {
  .doc-toc {
    display: block;
    margin: 0 -20px 18px;
    padding: 10px 20px;
    background: var(--shop-paper-light);
    border-block: 1px solid var(--shop-paper-line);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .doc-toc::-webkit-scrollbar { display: none; }
  .doc-toc-head {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .doc-toc ul { display: flex; gap: 8px; width: max-content; }
  .doc-toc a {
    display: grid;
    place-items: center;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(42, 36, 28, 0.3);
    border-radius: 22px;
    font-size: 0.88rem;
    white-space: nowrap;
    text-decoration: none;
    color: var(--shop-ink);
  }
  .doc-toc a:hover { border-color: var(--shop-brass); color: var(--shop-seal-deep); }
  .doc-toc-long { display: none; }
  .doc-toc-short { display: inline; }

  .doc-game .doc-hero .doc-cta-row { display: none; }

  .doc-playbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(160deg, var(--shop-walnut-warm), var(--shop-walnut-deep));
    border-top: 2px solid var(--shop-brass);
    box-shadow: 0 -8px 18px rgba(36, 24, 16, 0.3);
  }
  .doc-playbar .doc-cta {
    flex: 1 1 0;
    max-width: 280px;
    padding: 13px 8px;
    font-size: 1rem;
    text-align: center;
  }
  /* 帯の高さぶん、紙の下に余白を足す。裾の一行と商品紹介の断りが隠れない。 */
  body:has(.doc-playbar) { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 600px) {
  .doc-toc { margin-inline: -16px; padding-inline: 16px; }
}
/* 横にしたスマホ(#167)。帯が縦の高さを取りすぎないよう、薄くする。 */
@media (max-width: 1099px) and (max-height: 500px) {
  .doc-playbar { padding-block: 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .doc-playbar .doc-cta { padding-block: 8px; font-size: 0.92rem; }
  body:has(.doc-playbar) { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
}

/* --- お品書き(/games)の広い PC(#182) -------------------------------- */

/* 時間の札は広い PC だけ。狭い幅は今までどおり、名前の隣に人数だけ。 */
.doc-shelf-time { display: none; }
.doc-shelf-meta { display: inline; }

/* 解説ページの三列(#183)と同じ 1080px を使い、三列に並べて蓋の絵を主役に
   する。種類の見出しは朱の二重罫で区切る。 */
@media (min-width: 1100px) {
  .doc-index-head .doc-lede { max-width: 720px; }
  .doc-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .doc-shelf-item a {
    gap: 16px;
    border-color: transparent;
    box-shadow: 0 3px 8px rgba(42, 36, 28, 0.12);
  }
  .doc-shelf-item a:hover { border-color: var(--shop-brass); }
  .doc-shelf-item .doc-cover { width: 104px; height: 104px; }
  .doc-shelf-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.06em;
  }
  .doc-shelf-meta { display: flex; gap: 6px; margin-top: 6px; }
  .doc-shelf-players,
  .doc-shelf-time {
    display: inline-block;
    margin: 0;
    padding: 1px 8px;
    border: 1px solid rgba(42, 36, 28, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--shop-ink-soft);
  }
  .doc-shelf-section h2 {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 0;
    border-bottom: 0;
    letter-spacing: 0.2em;
  }
  .doc-shelf-section h2::after {
    content: '';
    position: static;
    flex: 1;
    width: auto;
    height: 3px;
    background: none;
    border-block: 1px solid var(--shop-seal);
    opacity: 0.6;
  }
}

/* --- 無いページ(#174) ---
   店の中の棚と同じ竿に木札を二枚掛け、間の一枚ぶんを点線の空き(品切れ)にする。
   右に朱の判「四〇四」と見出し、出口は「棚へ戻る」「遊べるゲームを見る」の二つ。
   スクリプトは読まない(server/pages.js の notFoundPageHtml)。狭い幅では棚の下に
   字を置く。 */
.nf {
  display: flex;
  align-items: center;
  gap: 44px;
  padding: 48px 0 56px;
}
.nf-shelf {
  position: relative;
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 22px 18px;
  border-radius: 4px;
  background-image:
    repeating-linear-gradient(0.6deg, rgba(0, 0, 0, 0.16) 0px, rgba(0, 0, 0, 0.16) 1px, transparent 1px, transparent 3px, rgba(0, 0, 0, 0.08) 3px, transparent 4px, transparent 7px),
    radial-gradient(ellipse 60% 50% at 50% 0, rgba(255, 236, 190, 0.14), transparent 70%),
    linear-gradient(#33241a, #21170f);
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.5), 0 10px 22px rgba(36, 24, 16, 0.3);
}
/* 真鍮の竿 */
.nf-shelf::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 12px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(var(--shop-brass-light), var(--shop-brass-deep));
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}
.nf-fuda {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55));
}
.nf-fuda:first-child { transform: rotate(0.48deg); transform-origin: 50% 0; }
.nf-fuda:last-child { transform: rotate(-0.3deg); transform-origin: 50% 0; }
/* 紐: 竿の釘から札の両肩へ、逆さの V。 */
.nf-cord {
  position: relative;
  width: 36px;
  height: 20px;
  background: radial-gradient(circle at 50% 4px, var(--shop-brass-light) 3px, transparent 3.5px);
}
.nf-cord::before,
.nf-cord::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 4px;
  width: 1.2px;
  height: 20px;
  background: #c9b48a;
  transform-origin: 50% 0;
  transform: rotate(33deg);
}
.nf-cord::after { transform: rotate(-33deg); }
.nf-plate {
  width: 64px;
  height: 190px;
  box-sizing: border-box;
  padding: 8px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  clip-path: polygon(16% 0, 84% 0, 100% 6%, 100% 100%, 0 100%, 0 6%);
  background-image:
    repeating-linear-gradient(90.5deg, rgba(120, 80, 30, 0.12) 0px, rgba(120, 80, 30, 0.12) 1px, transparent 1px, transparent 5px, rgba(120, 80, 30, 0.06) 5px, transparent 7px, transparent 11px),
    linear-gradient(90deg, #ead6aa, #dcc08a 60%, #cdae74);
}
.nf-hole {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a2616;
}
.nf-plate .doc-cover {
  flex: none;
  width: 42px;
  height: 42px;
  margin-top: 8px;
  padding: 2px;
  box-sizing: border-box;
}
.nf-title {
  margin-top: 10px;
  writing-mode: vertical-rl;
  font-family: var(--shop-font-display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: #1e140c;
  white-space: nowrap;
}
/* 品切れの空き */
.nf-slot {
  display: grid;
  place-items: center;
  width: 64px;
  height: 190px;
  box-sizing: border-box;
  border: 2px dashed rgba(221, 192, 127, 0.5);
  border-radius: 2px;
  font-family: var(--shop-font-display);
  font-size: 15px;
  letter-spacing: 0.3em;
  color: rgba(236, 225, 200, 0.8);
  writing-mode: vertical-rl;
}
.nf-gap { filter: none; }
.nf-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.nf-seal {
  align-self: flex-start;
  padding: 4px 10px;
  border: 2px solid var(--shop-seal);
  color: var(--shop-seal);
  font-family: var(--shop-font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  transform: rotate(-3deg);
}
.nf-text h1 {
  margin: 0;
  font-family: var(--shop-font-display);
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
}
/* 解説ページの頭の箱(胡桃の地)用の淡い字と釦を、紙の地に合わせて濃くする。 */
.nf-text .doc-lede { margin: 0; color: var(--shop-ink-soft); }
.nf-text .doc-cta-ghost,
.nf-text .doc-cta-ghost:hover { color: var(--shop-walnut-deep); }
.nf-text .doc-cta-ghost:hover { background: rgba(176, 138, 62, 0.14); }
.nf-text .doc-cta-row { margin-top: 4px; }
@media (max-width: 720px) {
  .nf { flex-direction: column; align-items: stretch; gap: 28px; padding: 28px 0 40px; }
  .nf-shelf { align-self: center; }
  .nf-text h1 { font-size: 1.6rem; }
}
