/* 別ページの説明文にも、ゲーム画面と同じ紙色・罫線・テーマを適用する。 */
:root {
  color-scheme: light;
  --ui-paper: #faf9f5;
  --ui-surface: #ffffff;
  --ui-ink: #223547;
  --ui-muted: #60676c;
  --ui-rule: #d6d8d3;
  --ui-accent: #aa4737;
  --ui-soft: #f0eee7;
  --ui-panel: #fdfcf9;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --ui-paper: #181e25;
  --ui-surface: #222b34;
  --ui-ink: #e8e9e4;
  --ui-muted: #b3bdc4;
  --ui-rule: #3b4650;
  --ui-accent: #efa28f;
  --ui-soft: #2d3640;
  --ui-panel: #202832;
}

:root[data-theme='spring'] {
  --ui-paper: #faf7f6;
  --ui-surface: #fffdfc;
  --ui-ink: #493d43;
  --ui-muted: #746369;
  --ui-rule: #e0d5d8;
  --ui-accent: #a34365;
  --ui-soft: #f3e9ed;
  --ui-panel: #fffbfc;
}

:root[data-theme='summer'] {
  --ui-paper: #f5f9f8;
  --ui-surface: #ffffff;
  --ui-ink: #24494f;
  --ui-muted: #567176;
  --ui-rule: #cddfdf;
  --ui-accent: #226e79;
  --ui-soft: #e8f1ef;
  --ui-panel: #fbfefd;
}

:root[data-theme='autumn'] {
  --ui-paper: #fbf6ed;
  --ui-surface: #fffdf8;
  --ui-ink: #503d2e;
  --ui-muted: #786550;
  --ui-rule: #dfd2be;
  --ui-accent: #a34d2b;
  --ui-soft: #f1e6d5;
  --ui-panel: #fffaf2;
}

:root[data-theme='winter'] {
  --ui-paper: #f5f8fa;
  --ui-surface: #ffffff;
  --ui-ink: #2c455b;
  --ui-muted: #5f7487;
  --ui-rule: #cfdae2;
  --ui-accent: #376b8e;
  --ui-soft: #e9eff4;
  --ui-panel: #fbfdff;
}

/* JavaScriptが使えない場合も、OSの配色で本文を読めるようにする。 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ui-paper: #181e25;
    --ui-surface: #222b34;
    --ui-ink: #e8e9e4;
    --ui-muted: #b3bdc4;
    --ui-rule: #3b4650;
    --ui-accent: #efa28f;
    --ui-soft: #2d3640;
    --ui-panel: #202832;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--ui-paper);
  color: var(--ui-ink);
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.95;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--ui-accent); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 4px; }
svg { display: block; }

.guide-header {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
  border-bottom: 1px solid var(--ui-rule);
}
.guide-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  min-height: 88px;
  padding-block: 18px;
  border-bottom: 2px solid var(--ui-ink);
}
.guide-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ui-ink);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.3;
  text-decoration: none;
}
.guide-brand:hover { text-decoration: none; }
.guide-brand span { white-space: nowrap; }
.guide-brand-mark { flex: 0 0 auto; width: 29px; height: 29px; }
.guide-brand-mark-cell { fill: var(--ui-accent); }
.guide-play-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--ui-ink);
  border-radius: 4px;
  background: var(--ui-ink);
  color: var(--ui-paper);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}
.guide-play-link:hover { border-color: var(--ui-accent); background: var(--ui-accent); color: var(--ui-paper); text-decoration: none; }
.guide-breadcrumb {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 10px;
  padding-block: 12px;
  color: var(--ui-muted);
  font-size: 0.875rem;
  line-height: 1.7;
}
.guide-breadcrumb a { color: var(--ui-muted); }

.guide-article {
  width: min(840px, calc(100% - 48px));
  margin: clamp(36px, 6vw, 76px) auto 72px;
}
.guide-article-header { margin-bottom: 32px; }
.guide-article h1 {
  margin: 0 0 24px;
  color: var(--ui-ink);
  font-family: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.55;
  text-wrap: balance;
}
.guide-title-name { white-space: nowrap; }
.guide-article-header p {
  max-width: 48em;
  margin: 0;
  color: var(--ui-muted);
  font-size: 1.0625rem;
  line-height: 1.95;
}
.guide-article-header .updated { font-size: 0.875rem; }
.guide-article > p,
.guide-article > ul,
.guide-article > ol,
.guide-article > h2,
.guide-article > h3 { max-width: 720px; margin-inline: auto; }
.guide-article p { margin-block: 0 18px; }
.guide-article h2 {
  margin-top: 44px;
  margin-bottom: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--ui-rule);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.65;
  scroll-margin-top: 24px;
}
.guide-article h3 { margin-top: 24px; margin-bottom: 10px; font-size: 1.0625rem; line-height: 1.7; }
.guide-article ul,
.guide-article ol { margin-block: 0 22px; padding-left: 24px; }
.guide-article li { margin-bottom: 8px; padding-left: 3px; }
.guide-article li::marker { color: var(--ui-accent); }
.guide-article strong { font-weight: 700; }

.guide-toc {
  margin: 32px 0;
  padding: 20px 24px;
  border-top: 2px solid var(--ui-ink);
  border-bottom: 1px solid var(--ui-rule);
  background: var(--ui-soft);
}
.guide-toc .guide-toc-title { margin: 0 0 10px; color: var(--ui-ink); font-size: 0.875rem; font-weight: 700; }
.guide-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; padding: 0; list-style: none; }
.guide-toc li { min-width: 0; margin: 0; padding: 0; }
.guide-toc a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; color: var(--ui-ink); font-size: 0.875rem; line-height: 1.7; text-decoration: none; }
.guide-toc a:hover { color: var(--ui-accent); text-decoration: underline; }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; margin: 24px 0 32px; }
.guide-card { min-width: 0; padding: 18px 0; border-top: 2px solid var(--ui-rule); }
.guide-card strong { display: block; margin-bottom: 6px; color: var(--ui-ink); }
.guide-card > br { display: none; }
.tip,
.note { max-width: 720px; margin: 24px auto; padding: 18px 22px; border-left: 3px solid var(--ui-accent); background: var(--ui-soft); }
.guide-article table { width: 100%; margin: 24px auto 32px; border-collapse: collapse; table-layout: fixed; background: var(--ui-surface); }
.guide-article th,
.guide-article td { padding: 14px 16px; border: 1px solid var(--ui-rule); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.guide-article th { background: var(--ui-soft); font-weight: 600; }
.guide-article tbody th { width: 28%; }
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--ui-ink);
  border-radius: 4px;
  background: var(--ui-ink);
  color: var(--ui-paper);
  font-weight: 600;
  line-height: 1.7;
  text-decoration: none;
}
.button-link:hover { border-color: var(--ui-accent); background: var(--ui-accent); color: var(--ui-paper); text-decoration: none; }

.guide-footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 32px;
  border-top: 1px solid var(--ui-rule);
  color: var(--ui-muted);
  font-size: 0.875rem;
  line-height: 1.8;
}
.guide-footer nav { display: flex; flex-wrap: wrap; gap: 0 28px; }
.guide-footer nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ui-muted); text-decoration: none; }
.guide-footer nav a:hover { color: var(--ui-accent); text-decoration: underline; }
.guide-footer p { margin: 14px 0 0; font-size: 0.75rem; }

@media (max-width: 600px) {
  .guide-header,
  .guide-article,
  .guide-footer { width: calc(100% - 32px); }
  .guide-header-inner { min-height: 64px; gap: 8px 10px; padding-block: 9px; }
  .guide-brand { gap: 8px; min-height: 44px; font-size: clamp(1rem, 5vw, 1.25rem); }
  .guide-brand-mark { width: 23px; height: 23px; }
  .guide-play-link { padding-inline: 10px; }
  .guide-breadcrumb { align-items: center; gap: 0 8px; padding-block: 0; }
  .guide-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .guide-article { margin-block: 26px 48px; }
  .guide-article-header { margin-bottom: 24px; }
  .guide-article h1 { margin-bottom: 18px; font-size: 1.625rem; letter-spacing: 0.025em; }
  .guide-article-header p { color: var(--ui-ink); font-size: 1rem; }
  .guide-article h2 { margin-top: 32px; padding-top: 20px; font-size: 1.125rem; }
  .guide-toc { margin-block: 24px; padding: 14px 14px 6px; }
  .guide-toc .guide-toc-title { margin-bottom: 4px; color: var(--ui-muted); }
  .guide-toc li + li { border-top: 1px solid var(--ui-rule); }
  .guide-toc a { min-height: 46px; font-size: 0.9375rem; }
  .guide-toc a:active { color: var(--ui-accent); }
  .guide-toc ol,
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-grid { gap: 0; }
  .guide-card { padding-block: 16px; }
  .guide-article th,
  .guide-article td { padding: 9px 8px; font-size: 0.9375rem; line-height: 1.7; }
  .guide-article thead th:first-child { width: 23%; }
  .guide-article thead th:nth-child(2) { width: 34%; }
  .guide-article tbody th { width: 30%; }
  .guide-article #related + ul { padding: 0; list-style: none; }
  .guide-article #related + ul li { margin: 0; padding: 0; border-bottom: 1px solid var(--ui-rule); }
  .guide-article #related + ul a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; line-height: 1.6; }
  .tip,
  .note { padding: 16px; }
  .guide-footer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
}
