/* =========================================================
   針の番人 取扱説明書（ウェブ版）
   2色刷り（紺＋黄土）のレトロ説明書スタイル
   ページを足すときは <section class="page"> を .spread の中に
   2つずつ並べるだけ。文字はすべてHTML側（英語版は lang="en" の
   別ファイルを同じCSSで作る想定）。
   ========================================================= */

@font-face {
  font-family: "PixelMplus12";
  src: url("fonts/PixelMplus12-subset.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #1f2a4a;         /* 1色目：紺 */
  --ink-soft: #46527a;
  --gold: #c08a2b;        /* 2色目：黄土 */
  --gold-tint: #f4e7c6;   /* 黄土の網（薄） */
  --ink-tint: #e6e9f1;    /* 紺の網（薄） */
  --paper: #fcfbf7;       /* 白い紙（黄ばませない） */
  --desk: #dcdfe7;
  --pixel: "PixelMplus12", "MS Gothic", "Osaka-Mono", monospace;
  --gothic: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", sans-serif;
  /* ページ内の基準文字サイズ。見開き表示ではページ幅に比例（=印刷物のように縮む） */
  --fs: 15px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--desk);
  /* 机の上：ごく薄い針と糸の柄＋細かな網点（ページより目立たせない） */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='%231f2a4a' stroke-opacity='.09' stroke-linecap='round'><g transform='rotate(-35 60 60)'><line x1='22' y1='60' x2='96' y2='60' stroke-width='2.4'/><ellipse cx='30' cy='60' rx='5' ry='1.6' stroke-width='1.2'/></g><path d='M27 52 C 60 20, 120 120, 170 80 S 230 150, 200 200' stroke='%23c08a2b' stroke-opacity='.18' stroke-width='1.6' stroke-dasharray='6 5'/><g transform='rotate(25 160 170)'><line x1='130' y1='170' x2='188' y2='170' stroke-width='2'/><ellipse cx='136' cy='170' rx='4' ry='1.3' stroke-width='1'/></g></svg>"),
    radial-gradient(rgba(31, 42, 74, .06) 1px, transparent 1.2px);
  background-size: 220px 220px, 6px 6px;
  color: var(--ink);
  font-family: var(--gothic);
  line-height: 1.7;
}

/* ---------- サイト側の見出し（説明書の外） ---------- */
.site-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.site-head h1 {
  margin: 0;
  font-family: var(--pixel);
  font-weight: normal;
  font-size: 20px;
  letter-spacing: .08em;
}
.site-head p { margin: 0; font-size: 13px; color: var(--ink-soft); }

.booklet {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 40px;
}

.spread-label {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--ink-soft);
  margin: 24px 0 6px;
  letter-spacing: .1em;
}

/* ---------- 見開き / ページ ---------- */
.spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.page {
  container-type: inline-size;
  position: relative;
  background-color: var(--paper);
  /* 紙のごく薄い繊維感（黄ばみなし） */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.16  0 0 0 0 0.29  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 6px 18px rgba(31, 42, 74, .16);
  overflow: hidden;
}

.page__body {
  position: relative;
  font-size: var(--fs);
  padding: 3em 1.6em 3.4em;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: .7em;
}

/* 縫い目の内枠（ステッチ） */
.page::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(192, 138, 43, .55);
  border-radius: 4px;
  pointer-events: none;
}

/* 柱（ページ上の小見出し） */
.running-head {
  position: absolute;
  top: 1.35em;
  left: 1.6em;
  right: 1.6em;
  display: flex;
  justify-content: space-between;
  font-family: var(--pixel);
  font-size: .72em;
  letter-spacing: .15em;
  color: var(--ink-soft);
}

/* ノンブル（大きなページ数字） */
.folio {
  position: absolute;
  bottom: .55em;
  font-family: var(--pixel);
  font-size: 2.1em;
  line-height: 1;
  color: var(--ink);
  text-shadow: .06em .05em 0 var(--gold);
}
.folio::before, .folio::after {
  content: "";
  display: inline-block;
  width: 1.6em;
  border-top: .12em solid var(--ink);
  vertical-align: middle;
  margin: 0 .25em;
}
.page:nth-child(odd) .folio { left: .7em; }
.page:nth-child(odd) .folio::after { display: none; }
.page:nth-child(even) .folio { right: .7em; }
.page:nth-child(even) .folio::before { display: none; }

/* ---------- 見出し ---------- */
.midashi {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5em;
  border-top: .3em solid var(--ink);
  border-bottom: .12em solid var(--ink);
  padding: .35em 0 .3em;
}
.midashi__title {
  font-family: var(--pixel);
  font-weight: normal;
  font-size: 1.6em;
  line-height: 1.15;
  letter-spacing: .08em;
  white-space: nowrap;
  /* 版ズレ風：黄土の版が少しずれて刷られている */
  text-shadow: .055em .045em 0 var(--gold);
}
.midashi__en {
  margin-left: auto;
  font-family: var(--pixel);
  font-size: .7em;
  letter-spacing: .2em;
  color: var(--gold);
}
.midashi__mark {
  flex: none;
  width: 1.5em;
  height: 1.5em;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--pixel);
  font-size: 1em;
  display: grid;
  place-items: center;
  box-shadow: .18em .18em 0 var(--gold);
}

/* 箱見出し（小） */
.kobako {
  margin: 0;
  display: inline-block;
  align-self: flex-start;
  font-family: var(--pixel);
  font-weight: normal;
  font-size: 1.05em;
  letter-spacing: .1em;
  padding: .15em .7em;
  border: .14em solid var(--ink);
  background: var(--paper);
  box-shadow: .22em .22em 0 var(--gold);
}

p { margin: 0; }
.lead { font-size: .98em; text-align: justify; }
.small { font-size: .8em; color: var(--ink-soft); }
em.gold { font-style: normal; color: var(--gold); font-weight: bold; }
strong { color: var(--ink); }

/* 網点（ハーフトーン）背景 */
.halftone {
  background-color: var(--gold-tint);
  background-image: radial-gradient(rgba(192, 138, 43, .38) 18%, transparent 20%);
  background-size: .5em .5em;
}
.halftone-ink {
  background-color: var(--ink-tint);
  background-image: radial-gradient(rgba(31, 42, 74, .16) 18%, transparent 20%);
  background-size: .45em .45em;
}

/* ステッチの区切り線 */
.stitch-rule {
  border: 0;
  height: .5em;
  margin: .1em 0;
  background:
    repeating-linear-gradient(90deg, var(--gold) 0 .7em, transparent .7em 1.15em) center / 100% .14em no-repeat;
}

/* ---------- 表紙 ---------- */
.page--cover .page__body {
  padding: 0;
  gap: 0;
  justify-content: flex-start;
}
.page--cover::before { inset: 8px; border-color: rgba(252, 251, 247, .5); z-index: 2; }

.cover-band {
  background: var(--ink);
  color: var(--paper);
  padding: 1.1em 1.4em .9em;
  position: relative;
}
/* 表紙上部の2色ストライプ */
.cover-band::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1.1em;
  height: 1.1em;
  background: repeating-linear-gradient(180deg,
    var(--gold) 0 .22em, var(--paper) .22em .36em, var(--ink) .36em .52em, var(--paper) .52em .66em);
}
.cover-band__top {
  display: flex;
  justify-content: space-between;
  font-family: var(--pixel);
  font-size: .78em;
  letter-spacing: .2em;
  color: var(--gold-tint);
}
.cover-logo {
  display: block;
  width: 92%;
  margin: .6em auto .2em;
  height: auto;
}

.cover-art {
  margin: 2.1em 1.4em 0;
  border: .3em solid var(--ink);
  box-shadow: .35em .35em 0 var(--gold);
  line-height: 0;
  background: var(--ink);
}
.cover-art img { width: 100%; height: auto; display: block; }

.cover-copy {
  margin: 1.2em 1.4em 0;
  text-align: center;
  font-family: var(--pixel);
  font-size: 1.15em;
  letter-spacing: .12em;
  line-height: 1.6;
}
.cover-copy small { display: block; font-size: .7em; color: var(--ink-soft); letter-spacing: .1em; }

.cover-title {
  margin: auto 1.4em 0;
  display: flex;
  align-items: stretch;
  border: .16em solid var(--ink);
}
.cover-title__label {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--pixel);
  padding: .5em .7em;
  font-size: 1.25em;
  letter-spacing: .3em;
  writing-mode: horizontal-tb;
  display: grid;
  place-items: center;
}
.cover-title__meta {
  flex: 1;
  padding: .4em .8em;
  font-size: .78em;
  line-height: 1.5;
  display: grid;
  align-content: center;
}
.cover-title__meta b { font-family: var(--pixel); font-weight: normal; letter-spacing: .08em; font-size: 1.1em; }

.cover-foot {
  margin: .8em 1.4em 1.4em;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.cover-foot .sprites { display: flex; gap: .2em; align-items: flex-end; }
.cover-foot .platform {
  font-family: var(--pixel);
  font-size: .8em;
  border: .12em solid var(--ink);
  padding: .1em .6em;
  letter-spacing: .15em;
}

/* ---------- ピクセルアート（整数倍のみ） ---------- */
.px {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}
.px-96 { width: 96px; height: 96px; }      /* 96pxスプライト等倍 */
.px-48 { width: 48px; height: 48px; }      /* 1/2 */
img.face { width: auto; height: auto; }    /* 顔は等倍のまま */

/* ---------- ごあいさつ ---------- */
.greeting {
  border: .14em solid var(--ink);
  padding: .9em 1em;
  position: relative;
}
.greeting::after {
  content: "";
  position: absolute;
  inset: .3em;
  border: 1px dashed var(--gold);
  pointer-events: none;
}

/* 健康のための注意 */
.caution {
  border: .2em solid var(--ink);
  box-shadow: .3em .3em 0 var(--gold);
  background: var(--paper);
}
.caution__head {
  display: flex;
  align-items: center;
  gap: .5em;
  background: var(--ink);
  color: var(--paper);
  padding: .35em .7em;
  font-family: var(--pixel);
  font-size: 1.1em;
  letter-spacing: .12em;
}
.caution__head svg { width: 1.3em; height: 1.3em; flex: none; }
.caution ul {
  margin: 0;
  padding: .6em .9em .7em 2.1em;
  font-size: .82em;
  line-height: 1.65;
}
.caution li { margin: .25em 0; }
.caution li::marker { content: "■ "; color: var(--gold); }
.caution .warn {
  margin: 0 .7em .7em;
  padding: .5em .7em;
  font-size: .82em;
  line-height: 1.6;
}

/* ---------- 会話・ワンポイント ---------- */
.talk {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4em .5em;
  align-items: center;
}
.talk .face-box {
  width: 4.4em;
  height: 4.4em;
  border: .12em solid var(--ink);
  background: var(--paper);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.talk .face-box img {
  /* 顔は整数倍（1/2）。大きいページでは等倍 */
  width: 50%;
  min-width: 60px;
  height: auto;
  image-rendering: pixelated;
}
.balloon {
  position: relative;
  border: .12em solid var(--ink);
  border-radius: .6em;
  background: var(--paper);
  padding: .45em .7em;
  font-size: .86em;
  line-height: 1.55;
}
.balloon::before {
  content: "";
  position: absolute;
  left: -.55em;
  top: 50%;
  margin-top: -.4em;
  border: .4em solid transparent;
  border-right: .55em solid var(--ink);
  border-left: 0;
}
.balloon b {
  font-family: var(--pixel);
  font-weight: normal;
  color: var(--gold);
  margin-right: .3em;
}

/* 2人の掛け合い。顔は等倍（拡大縮小しない） */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6em;
  align-items: end;
}
.duo__item { display: flex; flex-direction: column; align-items: flex-start; gap: .55em; min-width: 0; }
.duo__item--right { align-items: flex-end; }
.duo .face { flex: none; }
.balloon--down { align-self: stretch; }
.balloon--down::before {
  left: 2.2em;
  top: auto;
  bottom: -.55em;
  margin-top: 0;
  border: .4em solid transparent;
  border-top: .55em solid var(--ink);
  border-bottom: 0;
}
.duo__item--right .balloon--down::before { left: auto; right: 2.2em; }
/* 横並び（顔の右に吹き出し）。せまい画面では顔の下に吹き出し */
.duo--row { grid-template-columns: 1fr; gap: .5em; }
.duo--row .duo__item { flex-direction: row; align-items: center; }
.duo--row .balloon { flex: 1; }

.onepoint {
  border: .16em solid var(--ink);
  padding: 1em .7em .5em;
  position: relative;
  margin-top: .6em;
}
.onepoint__label {
  position: absolute;
  top: -.85em;
  left: .8em;
  background: var(--gold);
  color: var(--paper);
  font-family: var(--pixel);
  font-size: .9em;
  padding: .1em .7em;
  letter-spacing: .12em;
  border: .14em solid var(--ink);
}
.onepoint .talk + .talk { margin-top: .45em; }

/* ---------- 画面の見かた ---------- */
.screen {
  position: relative;
  border: .25em solid var(--ink);
  box-shadow: .3em .3em 0 var(--gold);
  line-height: 0;
  margin: .2em .3em .6em 0;
}
.screen img { width: 100%; height: auto; display: block; }
.callout {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 1.55em;
  height: 1.55em;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: .14em solid var(--ink);
  box-shadow: .1em .1em 0 var(--gold);
  font-family: var(--pixel);
  font-size: .82em;
  line-height: 1;
  display: grid;
  place-items: center;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: .25em 1em;
  font-size: .74em;
  line-height: 1.42;
  counter-reset: lg;
}
.legend li {
  display: grid;
  grid-template-columns: 1.6em 1fr;
  gap: .3em;
  align-items: start;
}
.legend .num {
  font-family: var(--pixel);
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  line-height: 1.6;
  border-radius: 50%;
  width: 1.6em;
  height: 1.6em;
  font-size: .95em;
}
.legend b { font-weight: bold; }

/* ---------- 操作方法 ---------- */
.fig { flex: none; width: 100%; margin: 0 auto; }
.fig--pad { max-width: 27em; }
.diagram { width: 100%; height: auto; display: block; }
.diagram text { font-family: var(--pixel); fill: var(--ink); }

.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: .78em;
  line-height: 1.38;
}
.keys th, .keys td {
  border-bottom: 1px dashed rgba(31, 42, 74, .35);
  padding: .2em .3em;
  vertical-align: top;
  text-align: left;
}
.keys th {
  font-family: var(--pixel);
  font-weight: normal;
  white-space: nowrap;
  width: 1%;
  padding-right: .8em;
}
.keys th span {
  display: inline-block;
  min-width: 1.5em;
  text-align: center;
  border: .1em solid var(--ink);
  border-radius: .3em;
  padding: 0 .3em;
  background: var(--paper);
}
.keys tr.sub td { color: var(--ink-soft); }
.keys-cols { display: grid; grid-template-columns: 1fr; gap: 0 1.2em; }

.mk {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5em 1em;
  align-items: start;
}
.mk .diagram { max-width: 16em; margin: 0 auto; }

/* =========================================================
   見開き（タブレット横〜PC）：A5比率で固定、文字はページ幅に比例
   ========================================================= */
@media (min-width: 1100px) {
  .spread {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    box-shadow: 0 10px 28px rgba(31, 42, 74, .22);
  }
  .page {
    aspect-ratio: 148 / 210;
    box-shadow: none;
  }
  /* 綴じ目（のど）の影 */
  .page:nth-child(odd) { background-color: var(--paper); box-shadow: inset -14px 0 18px -14px rgba(31, 42, 74, .28); }
  .page:nth-child(even) { box-shadow: inset 14px 0 18px -14px rgba(31, 42, 74, .28); }
  .page__body {
    --fs: 2.42cqw;
    height: 100%;
    overflow: hidden;
  }
  .legend { grid-template-columns: 1fr 1fr; }
  .duo--row { grid-template-columns: 1fr 1fr; }
  .keys-cols { grid-template-columns: 1fr 1fr; }
  .mk { grid-template-columns: 13em 1fr; }
  .talk .face-box img { min-width: 0; width: auto; }
}

/* スマホ：1ページずつ縦に並べる */
@media (max-width: 1099.98px) {
  .page__body { --fs: 14.5px; }
  .page--cover .page__body { min-height: 0; }
  .cover-title { margin-top: 1.4em; }
}
@media (max-width: 420px) {
  .page__body { padding-left: 1.2em; padding-right: 1.2em; }
  .midashi__title { font-size: 1.38em; }
  .site-head h1 { font-size: 17px; }
}

/* =========================================================
   印刷：1ページ = A5 1枚
   ========================================================= */
@page { size: A5 portrait; margin: 0; }
@media print {
  body { background: none; }
  .site-head, .spread-label, .site-foot { display: none; }
  .booklet { max-width: none; padding: 0; margin: 0; }
  .spread { display: block; gap: 0; box-shadow: none; }
  .page {
    width: 148mm;
    height: 210mm;
    aspect-ratio: auto;
    box-shadow: none !important;
    break-after: page;
    page-break-after: always;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page__body { --fs: 2.42cqw; height: 100%; overflow: hidden; }
  .legend, .keys-cols, .duo--row { grid-template-columns: 1fr 1fr; }
  .mk { grid-template-columns: 13em 1fr; }
}

.site-foot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 32px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------- もくじ（ドットリーダー） ---------- */
.toc { display: grid; grid-template-columns: auto 1fr; gap: 1em; align-items: start; }
.toc ol { list-style: none; margin: 0; padding: 0; font-size: .82em; line-height: 1.5; }
.toc li { display: flex; align-items: baseline; gap: .4em; padding: .05em 0; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.toc .dots { flex: 1; border-bottom: .18em dotted var(--ink-soft); transform: translateY(-.3em); }
.toc .pg { font-family: var(--pixel); font-size: 1.2em; color: var(--ink); text-shadow: .06em .05em 0 var(--gold); }

/* =========================================================
   追加ページ用の部品
   ========================================================= */

/* 言語切り替え */
.lang-switch { font-family: var(--pixel); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.lang-switch a, .lang-switch b {
  border: 2px solid var(--ink); padding: 0 8px; text-decoration: none; color: var(--ink); background: var(--paper);
}
.lang-switch b { background: var(--ink); color: var(--paper); font-weight: normal; }

/* もくじ（全面） */
.toc-full { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1em; font-size: .95em; }
.toc-full li { display: flex; align-items: baseline; gap: .5em; padding: .2em 0; }
.toc-full .no { font-family: var(--pixel); color: var(--gold); width: 1.8em; flex: none; }
.toc-full a { color: var(--ink); text-decoration: none; }
.toc-full a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.toc-full .dots { flex: 1; border-bottom: .18em dotted var(--ink-soft); transform: translateY(-.3em); }
.toc-full .pg { font-family: var(--pixel); font-size: 1.25em; text-shadow: .06em .05em 0 var(--gold); }

/* ものがたり */
.story { font-size: .92em; line-height: 1.95; text-align: justify; }
.story p + p { margin-top: .6em; }
.story .initial { float: left; font-family: var(--pixel); font-size: 3.1em; line-height: 1; margin: .05em .12em 0 0; text-shadow: .05em .04em 0 var(--gold); }
.story-art { border: .25em solid var(--ink); box-shadow: .3em .3em 0 var(--gold); line-height: 0; margin: .2em .3em .3em 0; }
.story-art img { width: 100%; height: 8.6em; object-fit: cover; display: block; }

/* 手順（1→2→3） */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55em; }
.step { display: grid; grid-template-columns: 2.4em 1fr; gap: .6em; align-items: start; }
.step__no {
  width: 2.4em; height: 2.4em; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-family: var(--pixel); font-size: 1em;
  box-shadow: .15em .15em 0 var(--gold);
}
.step__body { border-left: .14em dashed var(--gold); padding-left: .7em; min-width: 0; }
.step__title { font-family: var(--pixel); font-size: 1.1em; letter-spacing: .06em; }
.step__text { font-size: .82em; line-height: 1.58; }
.step__img { margin-top: .35em; border: .16em solid var(--ink); line-height: 0; }
.step__img img { width: 100%; height: auto; display: block; }

/* 勝ち負けの箱 */
.rule-box { display: grid; grid-template-columns: 1fr; gap: .5em; }
.rule { border: .16em solid var(--ink); padding: .45em .7em; font-size: .82em; line-height: 1.55; }
.rule__label { display: inline-block; font-family: var(--pixel); font-size: 1.05em; padding: 0 .5em; margin-right: .4em; background: var(--ink); color: var(--paper); }
.rule--lose .rule__label { background: var(--gold); }

/* スキルカード */
.skill { display: grid; grid-template-columns: 4.2em 1fr; gap: .7em; border: .16em solid var(--ink); padding: .55em .7em; box-shadow: .25em .25em 0 var(--gold); background: var(--paper); }
.skill__icon { width: 4.2em; height: 4.2em; border: .14em solid var(--ink); display: grid; place-items: center; background: var(--ink-tint); overflow: hidden; }
.skill__icon img { image-rendering: pixelated; display: block; }
.skill__icon svg { width: 80%; height: 80%; }
.skill__name { font-family: var(--pixel); font-size: 1.15em; letter-spacing: .05em; }
.skill__name small { font-size: .7em; color: var(--gold); margin-left: .5em; letter-spacing: .1em; }
.skill__text { font-size: .8em; line-height: 1.55; }
.skill__meta { display: flex; flex-wrap: wrap; gap: .3em .5em; margin-top: .3em; font-size: .72em; }
.skill__meta span { border: .1em solid var(--ink); padding: 0 .45em; border-radius: .3em; background: var(--paper); }

/* 仲間・理の者カード */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); gap: .45em; }
.card { border: .14em solid var(--ink); background: var(--paper); display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: .25em; padding: .1em .45em .1em .05em; min-width: 0; }
.card img { width: 96px; height: 96px; image-rendering: pixelated; display: block; }
.card__name { font-family: var(--pixel); font-size: 1em; line-height: 1.25; min-width: 0; }
.card__name small { display: block; font-family: var(--gothic); font-size: .78em; color: var(--ink-soft); margin-top: .2em; line-height: 1.4; }
.card__tag { display: inline-block; font-family: var(--pixel); font-size: .68em; background: var(--ink); color: var(--paper); padding: 0 .4em; margin-bottom: .2em; }
.card--sil { background: var(--ink-tint); }

/* 進化の並び */
.evo { display: flex; align-items: center; justify-content: center; gap: .1em; flex-wrap: wrap; }
.evo figure { margin: 0; text-align: center; }
.evo img { width: 96px; height: 96px; image-rendering: pixelated; display: block; margin: 0 auto; }
.evo figcaption { font-family: var(--pixel); font-size: .78em; }
.evo .arrow { font-family: var(--pixel); color: var(--gold); font-size: 1.4em; padding: 0 .1em; }

/* 章の一覧 */
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: .25em; }
.chapters li { display: grid; grid-template-columns: 2.3em 1fr; gap: .55em; align-items: center; border-bottom: 1px dashed rgba(31,42,74,.25); padding: .15em 0 .22em; }
.chapters .ch { font-family: var(--pixel); background: var(--ink); color: var(--paper); text-align: center; font-size: .9em; line-height: 2; box-shadow: .12em .12em 0 var(--gold); }
.chapters .ttl { font-family: var(--pixel); font-size: 1em; }
.chapters .mood { display: block; font-size: .76em; color: var(--ink-soft); line-height: 1.45; }

/* 一般の箱 */
.box { border: .16em solid var(--ink); padding: .55em .75em; font-size: .82em; line-height: 1.6; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .25em .7em; font-size: .8em; line-height: 1.5; margin: 0; }
.dl dt { font-family: var(--pixel); white-space: nowrap; }
.dl dd { margin: 0; }
.bullets { margin: 0; padding-left: 1.3em; font-size: .82em; line-height: 1.6; }
.bullets li::marker { content: "■ "; color: var(--gold); }
.bullets li + li { margin-top: .2em; }

/* 攻略のヒント（掛け合い） */
.tips { display: flex; flex-direction: column; gap: .5em; }
.tip-row { display: grid; grid-template-columns: auto 1fr; gap: .7em; align-items: center; }
.tip-row--r { grid-template-columns: 1fr auto; }
.tip-row--r .balloon::before { left: auto; right: -.55em; border-right: 0; border-left: .55em solid var(--ink); }
.tip-row .face { width: auto; height: auto; }

/* MEMO */
.memo-lines {
  flex: 1;
  min-height: 20em;
  border-top: .14em solid var(--ink);
  background-image: linear-gradient(180deg, transparent calc(100% - 1px), rgba(31,42,74,.3) calc(100% - 1px));
  background-size: 100% 2em;
  position: relative;
}
.memo-lines::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 2.2em;
  border-left: .14em dashed var(--gold);
}

/* 裏表紙 */
.page.page--back { background-color: var(--ink); color: var(--paper); }
.page--back::before { border-color: rgba(244, 231, 198, .45); }
.page--back .page__body { justify-content: space-between; }
.back-logo { width: 78%; height: auto; margin: .5em auto 0; display: block; }
.back-sprites { display: flex; justify-content: center; gap: .2em; flex-wrap: wrap; }
.back-credits { font-size: .78em; line-height: 1.75; color: var(--gold-tint); text-align: center; }
.back-credits b { font-family: var(--pixel); font-weight: normal; color: var(--paper); letter-spacing: .1em; }
.back-spec { display: grid; grid-template-columns: auto 1fr; border: .14em solid var(--gold); font-size: .8em; margin: 0; }
.back-spec dt { background: var(--gold); color: var(--ink); font-family: var(--pixel); padding: .25em .7em; }
.back-spec dd { margin: 0; padding: .25em .7em; border-bottom: 1px dashed rgba(244,231,198,.3); }
.page--back .running-head { color: var(--gold-tint); }
.page--back .folio { color: var(--paper); }
.page--back .folio::before, .page--back .folio::after { border-color: var(--paper); }

.tag-mouse { display: inline-block; font-family: var(--pixel); font-size: .8em; font-weight: normal; border: .1em solid var(--gold); color: var(--gold); padding: 0 .35em; margin-left: .3em; border-radius: .25em; line-height: 1.3; }


.step__row { display: grid; grid-template-columns: minmax(0,1fr) 12em; gap: .6em; align-items: start; }
.step__row .step__img { margin-top: .2em; }
.bosses { display: flex; flex-wrap: wrap; gap: .4em 1em; justify-content: flex-start; }
.bosses figure { margin: 0; text-align: center; }
.bosses img { width: 96px; height: 96px; image-rendering: pixelated; display: block; margin: 0 auto; }
.bosses figcaption { font-family: var(--pixel); font-size: .74em; line-height: 1.3; }
.cards { grid-template-columns: repeat(auto-fill, minmax(14em, 1fr)); }

@media (min-width: 1100px) {
  .rule-box { grid-template-columns: 1fr 1fr; }
}
@media print {
  .rule-box { grid-template-columns: 1fr 1fr; }
  .lang-switch { display: none; }
}

.figure-small { margin: 0 auto; width: 54%; border: .16em solid var(--ink); line-height: 0; }
.figure-small img { width: 100%; height: auto; display: block; }
.figure-small figcaption { line-height: 1.4; font-size: .74em; padding: .3em .5em; background: var(--paper); border-top: .12em solid var(--ink); }

/* せまい画面：手順の画像は文の下へ */
@media (max-width: 600px) {
  .step__row { grid-template-columns: minmax(0, 1fr); }
  .step__row .step__img { max-width: 17em; }
  .figure-small { width: 85%; }
}
/* 英語は両端揃えにすると語間が開くので左揃え */
:lang(en) .story, :lang(en) .lead { text-align: left; }

/* --- official site integration (added by scripts/sync-manual.mjs) --- */
.site-back {
  font-family: var(--pixel); font-size: 13px; margin-left: auto;
  border: 2px solid var(--ink); padding: 0 8px; text-decoration: none; color: var(--ink); background: var(--paper);
}
.site-back:hover, .lang-switch a:hover { background: var(--gold-tint); }
.site-back:focus-visible, .lang-switch a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media print { .site-back { display: none; } }
