/* Compact reading aids for the two game routes. */
.chapter.paper-warm { background: var(--paper); }
.game-quick-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.25rem; font: .75rem/1.5 var(--mono); }
.game-quick-links a, .guide-source a { text-decoration: underline; text-underline-offset: .2em; }
.controls-guide { margin: 2.5rem 0; padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid #b5ab95; border-top: 3px solid var(--red); }
.controls-guide h3, .reference-body h3 { margin: 0 0 .75rem; font: 400 clamp(1.8rem, 3vw, 2.5rem)/1.1 var(--display); }
.controls-guide > p { max-width: 65ch; }
.controls-chapter .controls-guide { margin: 0; padding: 0; border: 0; }
.controls-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem 2.5rem; margin: 1.5rem 0; }
.controls-list > div { border-top: 1px solid #b5ab95; padding-top: .8rem; }
.controls-list dt { font-weight: 700; margin-bottom: .5rem; }
.controls-list dd { margin: 0; font-size: .95rem; }
.controls-list kbd { display: inline-block; padding: .1rem .4rem; margin: 0 .1rem .15rem 0; border: 1px solid #938874; border-bottom-width: 2px; border-radius: 3px; background: #fff7e6; color: #332a21; font: .85rem/1.3 var(--mono); }
.guide-source { margin: 1.25rem 0 0; font-size: .78rem; line-height: 1.6; color: #655d51; }
.game-reference { scroll-margin-top: 9rem; margin-top: 2rem; border-bottom: 1px solid var(--rule); }
.game-reference > summary { padding: .85rem 0; }
.game-reference:not([open]) > :not(summary) { display: none; }
.game-reference .reference-body { border: 0; background: transparent; padding: 1.25rem 0; }
.game-reference .reference-table { color: var(--red); }
.scoring-guide { margin-top: clamp(3rem, 6vw, 5rem); padding-top: 2rem; border-top: 1px solid var(--rule); scroll-margin-top: 9rem; }
.chapter .scoring-guide h2 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 1.5rem; }
.scoring-guide > p { max-width: 85ch; }
.scoring-chapter .scoring-guide { margin-top: 2rem; padding-top: 0; border-top: 0; }
.score-reference .score-bonuses { color: var(--red); padding: 0 1rem; }
.game-reference > summary:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.reference-body { padding: clamp(1rem, 2.5vw, 2rem); background: #f5efdf; color: #302a23; border: 1px solid #b5ab95; }
.reference-body > p { max-width: 85ch; }
.reference-table { width: 100%; border-collapse: collapse; font-size: .85rem; line-height: 1.5; }
.reference-table caption { text-align: left; padding-bottom: 1rem; font-weight: 700; }
.reference-table th, .reference-table td { text-align: left; vertical-align: middle; border-bottom: 1px solid #c6bca8; padding: .9rem .65rem; }
.reference-table thead th { font: 700 .68rem/1.4 var(--mono); text-transform: uppercase; color: #74372b; }
.reference-table thead th:nth-child(-n+2) { text-align: center; }
.reference-table tbody th { min-width: 6rem; }
.reference-identity { display: inline-flex; align-items: center; flex-direction: column; gap: .35rem; min-width: 7.5rem; text-align: center; }
.reference-icon { flex: 0 0 auto; object-fit: contain; image-rendering: pixelated; }
.reference-item-icon {
  width: 4.5rem;
  height: 5.25rem;
  margin-bottom: -.95rem;
  object-fit: cover;
  object-position: center;
}
/* PCW's native tray crop fills the raster vertically. Scale it uniformly, but
   widen its layout box so the visible horizontal size remains consistent. */
html[data-platform="pcw"] .reference-item-icon {
  width: 7.03rem;
  transform: scale(.64);
  transform-origin: center;
}
.reference-character-icon { width: 4.4rem; height: 5.5rem; }
.reference-table tbody tr:last-child > * { border-bottom: 0; }
.score-formula { padding: 1rem 1.25rem; margin: 1.25rem 0; border-left: 3px solid #943b29; background: #e8dfca; font: 700 clamp(.95rem, 2vw, 1.2rem)/1.6 var(--mono); }
.score-bonuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; padding: 0; list-style: none; counter-reset: bonus; }
.score-bonuses li { display: grid; grid-template-columns: 2.5rem 1fr; gap: .5rem; padding: .75rem 0; border-top: 1px solid #c6bca8; font-size: .9rem; }
.score-bonuses li::before { content: '+4'; color: #74372b; font: 700 .9rem/1.6 var(--mono); }
@media (max-width: 760px) {
  .controls-list, .score-bonuses { grid-template-columns: 1fr; }
  .reference-table, .reference-table tbody { display: block; }
  .reference-table caption { display: block; }
  .reference-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .reference-table tbody tr { display: block; padding: 1rem 0; border-top: 2px solid #b5ab95; }
  .reference-table tbody th { display: block; padding: .25rem 0 .75rem; border: 0; font-size: 1.2rem; }
  .reference-identity { min-width: 0; }
  .reference-table tbody td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .75rem; padding: .6rem 0; border: 0; }
  .reference-table td::before { content: attr(data-label); color: #74372b; font-weight: 700; }
}
