/* サイトの頁（紹介・プレス・ライセンス・規約・プライバシー・用語集・アップデート情報）に共通の見た目。
   2026-11-04、デザインの作業場の段2（会話U3）。方向B「欄外の写本」：紙・墨・朱と、ASCIIの区切り。
   値の元は docs/design/tokens.md。字体は /site/fonts/fonts.css（npm run design:fonts が作る）を先に読む。
   本文は読みやすさ優先のゴシック、見出しは明朝（2026-11-04、ユーザーの答え）。
   紹介の頁（/about/）だけの物は /about/about.css
   色は、はじめは夜（暗い色。案A「夜の写本」）。［昼］を選ぶと html に data-theme="light" が付き、紙の色になる。
   切り替えは /site/theme.js（2026-11-04、会話U4。ユーザーの答え「ダークモードの方をデフォルト設定に」「A 夜の写本」） */
:root {
  color-scheme: dark;
  /* 夜：同じ写本を、灯りの下で読む。茶色がかった暗い地に、紙の色の字 */
  --paper: #221c15;
  --paper-2: #2e271e;
  --ink: #e6dcc8;
  --ink-2: #c2b59d;
  --faint: #a89a82;
  --rule: #7a6c58;
  --shu: #e0674f;
  /* 封蝋はユーザーが選んだ色のまま（暗い地でも、上下の ==== と明るい字で押せる物と分かる） */
  --wax: #7f1d1d;
  --wax-deep: #5e1414;
  /* 図の枠・押せる四角の枠・ゲームの画面の四角（暗い地）の縁。暗い地では、ゲームの画面の四角が頁の地に溶けるので縁を付ける */
  --frame: #5a4e3e;
  --frame-soft: #5a4e3e;
  --ring: #5a4e3e;
  --map: #0e1116;
  --map-text: #d8dee6;
  --map-text-2: #a9b2bf;
  --map-rule: #8a94a3;
  --f-body: 'Atpo Gothic', 'BIZ UDPGothic', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  --f-head: 'Atpo Mincho', 'Shippori Mincho', 'BIZ UDPMincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  --f-mono: 'Atpo Mono', 'BIZ UDGothic', 'Atpo Gothic', 'MS Gothic', Consolas, monospace;
  /* ASCIIの区切りの元（欄の幅いっぱいに並べ、はみ出た分は切る） */
  --dbl: '========================================================================================================================================================================================================';
  --one: '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------';
}
/* 昼：写本の紙と墨 */
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #ebe3d1;
  --paper-2: #e2d8c2;
  --ink: #2a231b;
  --ink-2: #5c5040;
  --faint: #6b5e4a;
  --rule: #8a7c66;
  --shu: #a8341f;
  --wax: #7f1d1d;
  --wax-deep: #5e1414;
  --frame: #2a231b;
  --frame-soft: #5c5040;
  --ring: transparent;
}
* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: break-word;
  line-break: strict;
  /* 本文は1字ずつ折り、句読点・括弧・小さい字の禁則だけ守る（日本語のサイトのふつうの組み方）。
     文節で折る（auto-phrase）を本文に当てると、行の右が大きく空き、「身の／こなし」「カオ／ス」のような
     折れも出たので、見出しと短い札だけにした（会話U9。ユーザーの指示「文字の改行位置がおかしい部分が多数ある」） */
  word-break: normal;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
a { color: var(--shu); text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
a:hover, a:focus-visible { color: var(--ink); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
p { margin: 0 0 1em; }
p, li, dd { text-wrap: pretty; }
strong, b { font-weight: 700; }
.wrap { max-width: 74rem; margin: 0 auto; padding: 0 16px; }
/* 読み物の頁は、一行が長くなりすぎない幅に */
main.wrap { max-width: 50rem; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 10; padding: 0.3em 0.8em; background: var(--paper); color: var(--ink); }
.skip:focus { top: 12px; }
.mono { font-family: var(--f-mono); }
.dim { color: var(--ink-2); }

/* ===== 見出し（明朝）===== */
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; text-wrap: balance; word-break: auto-phrase; }
h4, dt, th { word-break: auto-phrase; }
/* 見出しの中で、まとめて折りたい語のかたまり（入りきらないときだけ中で折れる） */
.nb { display: inline-block; }
h1 { margin: 0 0 0.6rem; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.5; }
/* 章の見出し：題の下に、題と同じ長さの ==== */
h2 { width: fit-content; max-width: 100%; margin: 4rem 0 1.4rem; font-size: clamp(1.35rem, 2.4vw, 1.6rem); line-height: 1.5; scroll-margin-top: 16px; }
h2::after { content: var(--dbl); display: block; width: 0; min-width: 100%; height: 1.3em; overflow: hidden; white-space: nowrap; color: var(--rule); font-family: var(--f-mono); font-size: 14px; font-weight: 400; line-height: 1.3; }
h2 .num { color: var(--shu); font-family: var(--f-mono); font-size: 0.6em; font-weight: 400; margin-right: 0.7em; vertical-align: 0.2em; }
h3 { margin: 2.2rem 0 0.5rem; font-size: 1.2rem; line-height: 1.6; }
h4 { margin: 1.6rem 0 0.4rem; font-size: 1rem; font-weight: 700; line-height: 1.7; }

/* ===== 一覧と文の中の物 ===== */
ul, ol { margin: 0 0 1em; padding-left: 1.6em; }
li { margin: 0 0 0.4em; }
ol > li::marker { font-family: var(--f-mono); color: var(--ink-2); }
/* 印のない一覧の頭は「-」（朱・等幅） */
main ul:not([class]) { list-style: none; padding-left: 1.4em; }
main ul:not([class]) > li::before { content: '-'; display: inline-block; width: 1.4em; margin-left: -1.4em; color: var(--shu); font-family: var(--f-mono); }
/* 文の中のコードとキー（/bug・?）。ゲームの記号の暗い四角と見分けが付くよう、明るい地に等幅 */
code, kbd { padding: 0.05em 0.3em; background: var(--paper-2); color: var(--ink); font-family: var(--f-mono); font-size: 0.92em; overflow-wrap: anywhere; }
/* 文の中のゲームの記号（@）。暗い地にゲームと同じ色 */
.glyphs { padding: 0 0.4em; background: var(--map); color: var(--map-text); font-family: var(--f-mono); font-size: 0.94em; outline: 1px solid var(--ring); outline-offset: -1px; }
hr { height: 1.4em; margin: 3rem 0; border: 0; overflow: hidden; }
hr::before { content: var(--dbl); display: block; white-space: nowrap; color: var(--rule); font-family: var(--f-mono); font-size: 14px; line-height: 1.4; }
/* 知らせ・注意：頭に朱の * を下げて置く（左の線の囲みは使わない） */
.notice { position: relative; margin: 1.4rem 0; padding-left: 1.4em; }
.notice::before { content: '*'; position: absolute; left: 0; color: var(--shu); font-family: var(--f-mono); }
blockquote { margin: 1.4rem 0; padding: 0 0 0 1.4em; color: var(--ink-2); }

/* ===== ASCIIの区切り（要素）===== */
.sep { overflow: hidden; white-space: nowrap; color: var(--rule); font-family: var(--f-mono); font-size: 14px; line-height: 1.4; user-select: none; }
.sep::before { content: var(--one); }
.sep.dbl::before { content: var(--dbl); }

/* ===== 頁の上の欄：小さなロゴと頁の移動 ===== */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; padding-top: 14px; padding-bottom: 10px; }
.brand { margin: 0; line-height: 0; }
.brand a { display: inline-block; }
.brand img { display: block; width: 159px; height: auto; image-rendering: pixelated; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 1.4em; font-size: 14px; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--shu); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); }
/* いまの頁は、色だけでなく頭の * でも示す（principles の7） */
.site-nav a[aria-current="page"]::before { content: '* '; color: var(--shu); font-family: var(--f-mono); }
.site-header::after { content: var(--dbl); display: block; width: calc(min(74rem, 100%) - 32px); margin: 0 auto; overflow: hidden; white-space: nowrap; color: var(--rule); font-family: var(--f-mono); font-size: 14px; line-height: 1.4; }

/* ===== 頁の題（読み物の頁は、小さなロゴと題だけ。2026-11-04、ユーザーの答え）===== */
.hero { padding-top: 2.4rem; }
.hero h1 { font-weight: 800; }
.hero .reading, .updated { margin: 0 0 0.4rem; color: var(--ink-2); font-size: 14px; }
.lead { color: var(--ink-2); }
main { padding-bottom: 4rem; }

/* ===== 目次：「-- 目次 --」の下に、2列で ===== */
.toc { margin: 2rem 0 0; }
.toc h2 { width: auto; margin: 0 0 0.4rem; font-family: var(--f-mono); font-size: 13px; font-weight: 400; color: var(--faint); line-height: 1.6; }
.toc h2::before { content: '-- '; }
.toc h2::after { content: ' --'; display: inline; width: auto; min-width: 0; height: auto; color: inherit; font-size: inherit; }
.toc ol, .toc ul { margin: 0; padding: 0; list-style: none; columns: 2 16rem; column-gap: 2.4rem; }
.toc li { margin: 0 0 0.25rem; break-inside: avoid; font-size: 15px; line-height: 1.7; }
.toc li::before { content: none; }
/* 目次は墨の字に朱の下線（朱の字が並びすぎないように。会話U4の見直し） */
.toc a { color: var(--ink); text-decoration-color: var(--shu); }
.toc a:hover, .toc a:focus-visible { color: var(--shu); }

/* ===== 図 ===== */
.shot { margin: 1.4rem 0 2rem; }
.shot img, .shot video, .pv iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--frame); background: var(--map); }
.shot a { display: block; }
.shot figcaption, .pv figcaption { margin-top: 0.4rem; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.4rem; margin: 1.4rem 0 2rem; }
.shots .shot { margin: 0; }
.pv { margin: 1.4rem 0 2rem; }

/* ===== 表：見出しの行の下に墨の線、行のあいだに細い線（囲みの枠は付けない）===== */
table { width: 100%; margin: 1.4rem 0 2rem; border-collapse: collapse; font-size: 15px; line-height: 1.75; }
th, td { padding: 0.6rem 0.8rem 0.6rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
thead th, tr:first-child > th { border-bottom: 1px solid var(--ink); }
th { color: var(--ink); font-weight: 700; font-size: 14px; }
td:first-child { color: var(--shu); font-weight: 700; }
td:last-child, th:last-child { padding-right: 0; }

/* ===== 頁の下の欄 ===== */
.site-footer { margin-top: 2rem; font-size: 14px; }
.site-footer::before { content: var(--dbl); display: block; width: calc(min(74rem, 100%) - 32px); margin: 0 auto; overflow: hidden; white-space: nowrap; color: var(--rule); font-family: var(--f-mono); font-size: 14px; line-height: 1.4; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 2px 1.4em; padding-top: 1rem; padding-bottom: 2.6rem; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--shu); }
.site-footer .who { flex-basis: 100%; margin: 0 0 0.4rem; color: var(--ink-2); }
.site-footer .footer-share { flex-basis: 100%; margin: 0 0 0.6rem; }

/* ===== 共有（/site/share.js が描く。会話U9。見本 A 文字の札）：等幅の字と朱の [ ] ===== */
.share-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.9rem; font-family: var(--f-mono); font-size: 14px; line-height: 1.9; }
.share-row .lead { color: var(--faint); }
.share-row a, .share-row button { appearance: none; border: 0; background: none; padding: 0; color: var(--ink); font: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; }
.share-row a::before, .share-row button::before { content: '['; margin-right: 0.25em; color: var(--shu); }
.share-row a::after, .share-row button::after { content: ']'; margin-left: 0.25em; color: var(--shu); }
.share-row a:hover, .share-row button:hover, .share-row a:focus-visible, .share-row button:focus-visible { color: var(--shu); }
.share-row .share-done { color: var(--shu); font-size: 13px; }
/* 指で押す端末では、押せる所の上下を広げる（字の並びは変えない） */
@media (pointer: coarse) { .share-row a, .share-row button { padding: 0.55em 0.1em; } }

/* ===== 昼と夜の切り替え（/site/theme.js が頁の上の欄に足す）：選んでいる方の頭に朱の * ===== */
.theme-switch { display: inline-flex; gap: 0.1em; font-family: var(--f-mono); }
.theme-switch button { appearance: none; border: 0; background: none; padding: 0 0.25em; cursor: pointer; color: var(--ink-2); font: inherit; }
.theme-switch button::before { content: ' '; white-space: pre; color: var(--shu); }
.theme-switch button[aria-pressed="true"] { color: var(--ink); }
.theme-switch button[aria-pressed="true"]::before { content: '*'; }
.theme-switch button:hover { color: var(--shu); }

/* ===== 言葉の切り替え（規約・プライバシー）===== */
.lang-switch { font-family: var(--f-mono); font-size: 14px; }

/* ===== 規約・プライバシー（日本語と英語を1頁に並べる。2026-11-04、ユーザーの答えで形は残す）===== */
article { padding-top: 0.4rem; }
article + article { margin-top: 4rem; }
article + article::before { content: var(--dbl); display: block; margin-bottom: 2rem; overflow: hidden; white-space: nowrap; color: var(--rule); font-family: var(--f-mono); font-size: 14px; line-height: 1.4; }
article > h1 { margin-top: 2.4rem; font-weight: 800; }
[lang="en"] { word-break: normal; }
li > ol, li > ul { margin: 0.3em 0; }
.table { margin: 1.4rem 0 2rem; }
.table table { margin: 0; }
th:first-child { min-width: 8em; }

/* ===== プレスの頁 ===== */
.blurb { margin: 1rem 0 1.8rem; }
.blurb h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.blurb h3::before { content: '-- '; color: var(--rule); font-family: var(--f-mono); font-weight: 400; }
.blurb p { margin: 0; }
.logos { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; align-items: flex-end; margin: 1.4rem 0 2rem; }
.logos figure { margin: 0; }
.logos img { display: block; border: 1px solid var(--frame); background: var(--map); }
.logos .og img { width: min(100%, 24rem); height: auto; }
.logos .logo-wide { flex-basis: 100%; }
.logos .logo-wide img { width: min(100%, 636px); height: auto; border: 0; background: none; image-rendering: pixelated; }
.logos figcaption { margin-top: 0.4rem; color: var(--ink-2); font-size: 13px; }
.made-with { margin-top: 2.4rem; color: var(--ink-2); font-size: 14px; }

/* ===== 用語集（/glossary/。頁は npm run glossary-page が作る）===== */
.terms { margin: 1rem 0 0; }
.terms dt { margin: 1.8rem 0 0.2rem; font-family: var(--f-head); font-size: 1.15rem; font-weight: 600; line-height: 1.6; scroll-margin-top: 16px; }
.terms dt:target { color: var(--shu); }
.terms dt:target::before { content: '* '; font-family: var(--f-mono); font-weight: 400; }
.terms dt .reading { margin-left: 0.6em; color: var(--ink-2); font-family: var(--f-body); font-size: 13px; font-weight: 400; }
.terms dd { margin: 0; }
.terms dd p { margin: 0.2em 0; }
.terms dd .extra { color: var(--ink-2); }
.terms dd .related { font-size: 14px; }
.terms dd .related a { margin-right: 0.8em; white-space: nowrap; }

/* ===== アップデート情報（/patch-notes/。頁は npm run patch-notes が作る）===== */
.notes-toc .toc-highlight { color: var(--ink-2); }
.note { scroll-margin-top: 16px; }
.note-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1.4rem; margin: 4rem 0 1.4rem; }
.note-head h2 { margin: 0; }
.note-share { margin: 0; }
.note h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1rem; width: auto; }
.note h2::after { flex-basis: 100%; }
.note h2 a { color: var(--ink); text-decoration: none; }
.note h2 a:hover, .note h2 a:focus-visible { color: var(--shu); text-decoration: underline; }
/* 日付は等幅にしない（anti-ai の10）。小さく、本文の字で */
.note-time { color: var(--ink-2); font-family: var(--f-body); font-size: 14px; font-weight: 400; }
.note .lead { margin: 0 0 1rem; }
/* 変わったことの種類は、頭の記号で分ける（+ 足した・* 変えた・! 直した）。色だけに頼らない */
.note h3 { margin: 2rem 0 0.4rem; font-size: 1.2rem; font-weight: 800; }
.note h3::before { margin-right: 0.5em; color: var(--shu); font-family: var(--f-mono); font-weight: 400; }
.note h3.kind-new::before { content: '+'; }
.note h3.kind-change::before { content: '*'; }
.note h3.kind-fix::before { content: '!'; }
.note h3.kind-info::before { content: '-'; }
.note ul ul { margin: 0.2em 0 0.4em; }
.note ul ul li { color: var(--ink-2); font-size: 15px; }
.note ul ul li strong { color: var(--ink); }

@media (max-width: 900px) {
  h2 { margin-top: 3rem; }
}
@media (max-width: 640px) {
  .shots { grid-template-columns: minmax(0, 1fr); }
  /* 表は、狭い幅では1行ずつ縦に並べる（左の列を項目名に） */
  table:not(.keep), table:not(.keep) tbody, table:not(.keep) tr, table:not(.keep) td, table:not(.keep) th { display: block; width: 100%; }
  table:not(.keep) thead { display: none; }
  table:not(.keep) tr { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
  table:not(.keep) th, table:not(.keep) td { padding: 0; border: 0; }
  table:not(.keep) tr:first-child > th { border-bottom: 0; }
  table:not(.keep) td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; }
  table:not(.keep) td + td { margin-top: 0.2rem; }
}
