@charset "UTF-8";

@page {
  size: JIS-B5;
  margin: 18mm 17mm 20mm;

  @bottom-center {
    content: counter(page);
    font-family: sans-serif;
    font-size: 7.5pt;
  }
}

@page :first {
  @bottom-center {
    content: none;
  }
}

:root {
  font-family: "Noto Serif CJK JP", "Noto Serif JP", "Yu Mincho", serif;
  font-size: 9pt;
  line-height: 1.8;
  color: #171717;
  widows: 2;
  orphans: 2;
  text-spacing-trim: trim-start;
  hanging-punctuation: first allow-end;
}

body {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-weight: 700;
  line-height: 1.35;
  break-after: avoid;
}

h1 {
  margin: 0 0 10mm;
  font-size: 22pt;
  letter-spacing: 0.02em;
}

h2 {
  margin: 1.6em 0 0.7em;
  padding-bottom: 0.25em;
  border-bottom: 0.6pt solid #555;
  font-size: 15pt;
}

h3 {
  margin: 1.4em 0 0.5em;
  font-size: 11.5pt;
}

p {
  margin: 0 0 0.8em;
  text-align: justify;
}

ul,
ol {
  margin: 0.5em 0 1em;
  padding-inline-start: 2em;
}

li {
  margin: 0.15em 0;
}

figure,
table,
pre,
blockquote {
  break-inside: avoid;
}

figure {
  margin: 1.2em auto;
  text-align: center;
}

figure img {
  display: block;
  max-width: 100%;
  max-height: 120mm;
  margin: 0 auto;
}

figure.gameboy-screen img {
  width: 80mm;
  image-rendering: pixelated;
}

figure.record-position {
  margin-block: 0.7em;
}

.record-crop {
  width: 100mm;
  height: 64mm;
  margin: 0 auto;
  overflow: hidden;
  border: 0.5pt solid #777;
}

.record-crop img {
  width: 218mm;
  max-width: none;
  max-height: none;
  transform: translate(0, -6.8mm);
}

figcaption {
  margin-top: 0.5em;
  font-family: "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 8pt;
  line-height: 1.5;
}

.capacity-figure {
  margin-block: 1em;
  padding: 3mm 4mm;
  border: 0.5pt solid #aaa;
  font-family: "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", sans-serif;
  text-align: left;
  print-color-adjust: exact;
}

.capacity-group + .capacity-group {
  margin-top: 3mm;
}

.capacity-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.2mm;
}

.capacity-title strong {
  font-size: 10pt;
}

.capacity-title span {
  font-size: 8pt;
}

.capacity-bar {
  display: flex;
  width: 100%;
  height: 10mm;
  overflow: hidden;
  border: 0.5pt solid #555;
}

.capacity-segment {
  display: flex;
  flex-basis: 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-inline-end: 0.4pt solid rgba(0, 0, 0, 0.45);
  color: #111;
  font-size: 7pt;
  font-weight: 700;
  white-space: nowrap;
}

.capacity-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5mm 4mm;
  margin: 1.5mm 0 0;
  padding: 0;
  font-size: 6.8pt;
  line-height: 1.35;
  list-style: none;
}

.capacity-legend li {
  display: grid;
  grid-template-columns: 3mm 1fr auto auto;
  gap: 1mm;
  align-items: center;
  margin: 0;
}

.capacity-legend i {
  width: 3mm;
  height: 3mm;
  box-sizing: border-box;
  border: 0.4pt solid #666;
}

.capacity-legend b {
  font-variant-numeric: tabular-nums;
}

.capacity-legend small {
  width: 3.6em;
  color: #444;
  text-align: right;
}

.capacity-figure .engine { background: #8fb8cf; }
.capacity-figure .tiles { background: #d9b86c; }
.capacity-figure .book { background: #9fc58f; }
.capacity-figure .ui { background: #d49c94; }
.capacity-figure .system { background: #b9b9c8; }
.capacity-figure .free { background: #fff; }
.capacity-figure .tt { background: #8fb8cf; }
.capacity-figure .stack { background: #dedede; }
.capacity-figure .oam { background: #d9b86c; }
.capacity-figure .position { background: #9fc58f; }
.capacity-figure .state { background: #d49c94; }

.capacity-figure figcaption {
  text-align: center;
}

table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  font-family: "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 8pt;
}

th,
td {
  padding: 0.35em 0.55em;
  border: 0.5pt solid #777;
}

th {
  background: #ededed;
  font-weight: 700;
}

pre {
  margin: 1em 0;
  padding: 0.8em 1em;
  overflow-wrap: anywhere;
  border: 0.5pt solid #aaa;
  background: #f5f5f5;
  font-size: 7.5pt;
  line-height: 1.5;
  white-space: pre-wrap;
}

code {
  font-family: "Noto Sans Mono CJK JP", "Noto Sans Mono", monospace;
}

blockquote {
  margin: 1em 1.5em;
  padding: 0.6em 1em;
  border-inline-start: 3pt solid #777;
  color: #333;
}

.lead {
  margin: 0 0 1.5em;
  font-size: 11pt;
  line-height: 1.75;
}

.page-break {
  break-before: page;
}

@media screen {
  :root {
    background: #f4f0e5;
    font-size: 16px;
    line-height: 1.9;
  }

  body {
    max-width: 52rem;
    margin: 0 auto;
    padding: 3rem clamp(1.25rem, 5vw, 4rem) 5rem;
    background: #fff;
    box-shadow: 0 0 36px rgb(49 45 34 / 12%);
  }

  h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  table,
  figcaption {
    font-size: 0.85rem;
  }

  pre {
    font-size: 0.82rem;
  }

  .lead {
    font-size: 1.15rem;
  }
}
