:root {
  --paper: #f4eddf;
  --sheet: #fffdf6;
  --ink: #232c29;
  --muted: #5c635b;
  --copper: #88451f;
  --line: #c6bbab;
  --wash: #e8dfce;
  --site-width: 1184px;
  --site-gutter: 24px;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, .button { cursor: pointer; }
button:disabled { cursor: default; color: var(--muted); border-color: var(--line); background: var(--wash); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--copper); outline-offset: 4px; }
button:hover:enabled, .button:hover { background: var(--wash); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; overflow-wrap: anywhere; }
h1 { font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; }
h2 { font-family: Georgia, serif; font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 500; }
h3 { font-size: 1.1rem; }
.skip, .skip-link { position: absolute; left: 16px; top: -100px; padding: 12px; background: var(--sheet); z-index: 10; }
.skip:focus, .skip-link:focus { top: 8px; }
.site-header { position: relative; max-width: var(--site-width); margin: auto; padding: 20px var(--site-gutter) 12px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 2px solid transparent; }
.site-header::after,
.site-footer::before {
  content: '';
  position: absolute;
  inset-inline: var(--site-gutter);
  height: 2px;
  background: var(--ink);
  pointer-events: none;
}
.site-header::after { bottom: -2px; }
.site-footer::before { top: -2px; }
.brand { font-family: Georgia, serif; font-size: 1.65rem; font-weight: bold; text-decoration: none; display: flex; gap: 10px; align-items: center; min-height: 44px; }
.brand-mark { width: 26px; height: 30px; border: 2px solid var(--copper); border-right-width: 6px; display: inline-block; flex: 0 0 auto; }
.site-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.site-nav a { min-height: 44px; padding: 10px 12px; text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { border-color: var(--copper); color: var(--copper); }
main { max-width: var(--site-width); margin: 0 auto; padding: 24px var(--site-gutter) 40px; }
.page-intro { margin-bottom: 22px; }
.page-intro p { margin-top: 6px; color: var(--muted); }
.content-block { position: relative; margin-bottom: 24px; padding: 24px; background: var(--sheet); border: 1px solid var(--line); }
.block-index { color: var(--copper); font-weight: bold; letter-spacing: .07em; }
.manual-spread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0; }
.spread-art { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 20px; background: var(--wash); }
.spread-art img { width: 100%; height: 260px; object-fit: cover; }
.spread-art:hover { background: #ded3bf; }
.spread-copy { padding: 24px 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.spread-copy h2 a { text-decoration: none; }
.spread-copy p { max-width: 50ch; }
.small-label { color: var(--muted); }
.cue { border-left: 3px solid var(--copper); padding-left: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 15px; border: 1px solid var(--ink); background: var(--ink); color: var(--sheet); text-decoration: none; line-height: 1.45; text-align: center; }
.secondary { color: var(--ink); background: transparent; }
.index-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.index-tabs a { min-height: 48px; border-left: 5px solid var(--copper); padding: 10px 12px; background: var(--wash); text-decoration: none; display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.index-tabs a:hover { background: #ded3bf; }
.block-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.text-link { display: inline-flex; min-height: 44px; align-items: center; }
.note-route { display: flex; align-items: center; gap: 24px; justify-content: space-between; }
.note-route p { margin-top: 8px; max-width: 60ch; }
.catalogue-heading { margin-bottom: 12px; }
.catalogue-heading h1 { font-size: 2rem; }
.search-dock { padding: 6px 0; margin-bottom: 0; }
.search-row { display: flex; gap: 8px; }
#search-form { display: flex; gap: 8px; flex: 1; min-width: 0; }
.search-field { min-width: 0; flex: 1; }
#game-search { width: 100%; min-width: 0; height: 44px; padding: 9px 12px; background: var(--sheet); border: 1px solid var(--ink); border-radius: 0; }
.search-row button { flex: 0 0 auto; }
.search-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; }
#catalogue-status { color: var(--muted); }
#clear-conditions { padding: 8px; min-height: 44px; border: 0; background: transparent; text-decoration: underline; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.game-card { min-width: 0; border-bottom: 1px solid var(--line); }
.game-link { display: flex; flex-direction: column; gap: 8px; height: 100%; text-decoration: none; }
.game-link:hover strong { color: var(--copper); text-decoration: underline; }
.thumbnail { width: 100%; height: 116px; background: var(--wash); display: flex; align-items: center; justify-content: center; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.image-error { padding: 12px; text-align: center; }
.card-text { display: flex; flex: 1; flex-direction: column; gap: 3px; padding-bottom: 10px; overflow-wrap: anywhere; }
.card-text strong { font-size: 1.0625rem; line-height: 1.25; }
.card-category { color: var(--copper); }
.card-controls { color: var(--muted); margin-top: auto; }
.catalogue-batch { padding: 18px; }
.batch-tail { min-height: 44px; margin-top: 16px; display: flex; justify-content: flex-end; align-items: center; }
.empty-state { display: grid; gap: 16px; justify-items: start; }
.empty-state p { max-width: 58ch; }
dialog { border: 2px solid var(--ink); padding: 0; color: var(--ink); background: var(--sheet); width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgb(21 29 25 / 62%); }
.dialog-layout { display: flex; flex-direction: column; max-height: calc(100dvh - 30px); }
.dialog-header { padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 1.5rem; }
.dialog-header button { flex-shrink: 0; }
.dialog-content { padding: 16px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.dialog-content > p { margin-bottom: 16px; }
.filter-group { border-bottom: 1px solid var(--line); }
.filter-group summary { cursor: pointer; min-height: 52px; padding: 12px 0; }
.filter-group summary span { color: var(--muted); margin-left: 8px; }
fieldset { border: 0; padding: 8px 0 16px; margin: 0; min-width: 0; }
legend { font-weight: bold; }
.radio-option { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 9px 10px; cursor: pointer; margin-top: 4px; border: 1px solid var(--line); font-size: 16px; }
.radio-option:has(input:checked) { background: var(--wash); border-color: var(--copper); }
.radio-option input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--copper); }
.radio-option span:last-child { margin-left: auto; }
.dialog-actions { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; background: var(--sheet); }
.manual-layout { width: 100%; }
.contents { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.contents a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); text-decoration: none; }
.prose { overflow-wrap: anywhere; }
.prose h2 { margin: 6px 0 14px; }
.prose p + p { margin-top: 12px; }
.example-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.breadcrumb a { min-height: 44px; display: inline-flex; align-items: center; }
.game-heading { margin-bottom: 20px; }
.game-heading h1 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); max-width: 30ch; }
.game-heading p { color: var(--copper); margin-bottom: 6px; }
.player-panel { padding: 14px; background: var(--ink); color: var(--sheet); }
.game-screen { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 180px; display: flex; align-items: center; justify-content: center; background: #151c19; }
.game-screen > img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.game-screen iframe { width: 100%; height: 100%; position: absolute; inset: 0; border: 0; }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.player-actions button { background: var(--sheet); color: var(--ink); border-color: var(--sheet); }
.player-actions button:disabled { background: var(--ink); color: #c7c5ba; border-color: #7c837c; }
.player-status { line-height: 1.4; overflow-wrap: anywhere; }
.player-panel:fullscreen { display: flex; flex-direction: column; border: 0; padding: 8px; overflow: auto; }
.player-panel:fullscreen .game-screen { flex: 1; min-height: 100px; aspect-ratio: auto; }
.player-panel:fullscreen .player-status { font-size: 16px; }
.game-notes { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; }
.game-notes .content-block { margin: 0 0 24px; }
.game-notes h2 { font-size: 1.5rem; }
.related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.site-footer { position: relative; max-width: var(--site-width); margin: 0 auto; padding: 20px var(--site-gutter) 32px; border-top: 2px solid transparent; }
.footer-links { display: flex; gap: 10px 24px; flex-wrap: wrap; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
.site-footer p { margin-top: 12px; color: var(--muted); max-width: 70ch; }
noscript .content-block { margin: 20px 0; }
@media (max-width: 767px) {
  :root { --site-gutter: 14px; }
  .site-header { padding: 12px 16px 0; flex-wrap: wrap; gap: 4px 16px; }
  .brand { font-size: 1.5rem; }
  .site-nav { gap: 0; margin-left: -8px; }
  .site-nav a { padding: 10px 8px; }
  main { padding: 20px var(--site-gutter) 32px; }
  .content-block { padding: 18px; margin-bottom: 20px; }
  .manual-spread { grid-template-columns: 120px minmax(0, 1fr); padding: 0; }
  .spread-art { padding: 8px; }
  .spread-art img { height: 132px; }
  .spread-copy { padding: 16px; gap: 8px; }
  .spread-copy h2 { font-size: 1.5rem; }
  .spread-copy .cue { grid-column: 1 / -1; }
  .spread-copy .small-label { font-size: 16px; }
  .index-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .note-route { align-items: flex-start; flex-direction: column; gap: 14px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .thumbnail { height: 92px; }
  .card-category { display: none; }
  .card-text strong { font-size: 16px; }
  .card-controls { font-size: 16px; }
  .catalogue-batch { padding: 12px; }
  .batch-tail { margin-top: 12px; }
  .search-dock { padding-top: 6px; padding-bottom: 6px; }
  .search-row { gap: 6px; }
  #search-form { gap: 6px; }
  .search-row button { padding-left: 10px; padding-right: 10px; }
  .search-summary { min-height: 36px; }
  #catalogue-status { font-size: 16px; }
  .game-notes { display: block; }
  .player-panel { padding: 10px; }
  .game-screen { aspect-ratio: 4 / 3; }
  .game-heading h1 { font-size: 1.8rem; }
  .player-actions { gap: 6px; }
  .player-actions button { flex: 1 1 auto; padding: 8px; }
}
@media (max-width: 399px) {
  .manual-spread { grid-template-columns: 1fr; }
  .spread-art { padding: 10px; }
  .spread-art img { height: 134px; }
  .spread-copy { padding: 14px; }
  .spread-copy h2 { font-size: 1.5rem; }
  .card-controls { line-height: 1.25; }
  .search-row button { padding-inline: 8px; }
  .index-tabs a { padding-inline: 8px; }
}
@media (min-width: 760px) and (max-width: 1000px) {
  .site-header { padding-inline: 20px; }
  .spread-copy { padding: 20px; }
  .spread-art img { height: 250px; }
  .card-grid { gap: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  a, button { transition: background-color .12s, color .12s; }
}

/* Filled preview cells and native links for complete game cards. */
.manual-spread { color: inherit; text-decoration: none; }
.spread-art { padding: 0; position: relative; }
.spread-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.manual-spread:hover h2 { color: var(--copper); text-decoration: underline; }

.spread-art { min-height: 260px; }
@media (min-width: 760px) and (max-width: 1000px) { .spread-art { min-height: 250px; } }
@media (max-width: 759px) { .spread-art { min-height: 132px; } }
@media (max-width: 399px) { .spread-art { min-height: 134px; } }
