:root {
  color-scheme: light;
  --ink: #153d40;
  --muted: #53676a;
  --paper: #edf0ef;
  --white: #ffffff;
  --line: #bac9c8;
  --soft: #dde7e5;
  --accent: #b73f29;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; scroll-padding-top: 16px; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; }
button, a, input, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, .button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:hover:enabled, .button:hover { background: var(--soft); }
.primary { background: var(--ink); color: white; }
.primary:hover:enabled { background: #21585b; }
button:disabled { color: #667574; border-color: var(--line); background: #eef2f0; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.12; letter-spacing: -.04em; margin-bottom: 10px; }
h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.025em; margin-bottom: 12px; }
h3 { font-size: 18px; line-height: 1.25; }
p { margin-bottom: 14px; }
img { max-width: 100%; height: auto; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 10; left: 12px; top: -90px; padding: 12px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }
.wrap { width: min(1040px, calc(100% - 40px)); margin-inline: auto; }
.site-header { background: var(--ink); color: white; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; font-size: 23px; font-weight: 750; min-height: 44px; letter-spacing: -.04em; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); gap: 3px; }
.brand-mark i { width: 8px; height: 8px; background: white; }
.brand-mark i:last-child { background: #f39077; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a { display: inline-flex; align-items: center; padding: 10px 12px; min-height: 44px; text-decoration: none; }
.site-nav a[aria-current="page"] { background: #2b5557; box-shadow: inset 0 -3px #f39077; }
.site-nav a:hover { background: #2b5557; }
main { min-height: 46vh; }
.sheet-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 24px 0 16px; }
.sheet-intro h1 { margin-bottom: 5px; }
.sheet-intro p { margin-bottom: 0; color: var(--muted); }
.entry-total { border-left: 3px solid var(--accent); padding-left: 12px; flex-shrink: 0; line-height: 1.2; }
.entry-total strong { display: block; font-size: 26px; letter-spacing: -.05em; }
.entry-total span { font-size: 14px; color: var(--muted); }
.search-tools { padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.search-line { display: flex; align-items: stretch; gap: 8px; }
.search-line form { display: flex; gap: 0; flex: 1; min-width: 0; }
.search-line input { flex: 1; min-width: 0; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--ink); border-right: 0; border-radius: 0; background: white; color: var(--ink); }
.search-line button { flex-shrink: 0; }
.search-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; min-width: 0; }
.search-status p { margin: 0; font-size: 14px; color: var(--muted); }
.search-status button { min-height: 44px; padding: 0 8px; border: 0; background: transparent; text-decoration: underline; font-size: 14px; }
.contact-batch { padding: 0 0 12px; margin: 0 0 16px; border-bottom: 2px solid var(--ink); overflow-anchor: none; }
.batch-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.batch-label h2 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
.batch-label span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.contact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sheet-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); background: var(--white); text-decoration: none; }
.sheet-card:hover { border-color: var(--ink); }
.thumbnail-mat { padding: 6px; background: #dce4e2; border-bottom: 1px solid var(--line); aspect-ratio: 4 / 3; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); align-items: center; justify-items: center; min-width: 0; }
.thumbnail-mat img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
/* A shorter preview cell keeps two-row sheets compact. */
.contact-batch .thumbnail-mat { aspect-ratio: 3 / 2; }
.card-caption { padding: 10px; display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto; align-items: start; gap: 5px 8px; }
.category-label { color: var(--muted); font-size: 13px; line-height: 1.3; }
.card-caption h3 { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 16px; line-height: 1.25; font-weight: 750; letter-spacing: -.01em; }
.listed-input { grid-column: 1 / -1; grid-row: 3; font-size: 14px; color: var(--muted); margin: 0; }
.inspect-label { grid-column: 2; grid-row: 1; font-size: 14px; line-height: 1.3; color: var(--accent); font-weight: 650; }
.image-failure { padding: 12px; font-size: 16px; text-align: center; color: var(--ink); }
.more-row { display: flex; justify-content: center; padding-top: 8px; overflow-anchor: none; }
.more-row button { width: min(100%, 340px); background: var(--ink); color: white; }
.batch-next, .sheet-end { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: var(--muted); }
.empty { border-left: 3px solid var(--accent); background: white; padding: 20px; margin-bottom: 24px; }
.empty p { max-width: 50ch; }
.sheet-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-block: 20px; margin-bottom: 12px; }
.sheet-note p { margin: 0; max-width: 58ch; }
.sheet-note a { flex-shrink: 0; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 20px 0 28px; }
.footer-top { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.footer-top strong { display: block; margin-bottom: 6px; }
.footer-top p { font-size: 14px; color: var(--muted); max-width: 48ch; }
.footer-links { display: flex; flex-wrap: wrap; column-gap: 18px; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-bottom { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* A modal sheet keeps advanced controls out of the catalogue's first screen. */
dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 24px); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--ink); color: var(--ink); background: var(--paper); }
@supports (height: 100dvh) { dialog { max-height: calc(100dvh - 24px); } }
dialog::backdrop { background: rgb(13 36 38 / 65%); }
dialog[open] { display: flex; flex-direction: column; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 23px; margin: 0; }
.dialog-header button { padding-inline: 12px; }
#filter-form { display: flex; flex-direction: column; min-height: 0; }
.filter-body { padding: 12px 16px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.filter-body > p { font-size: 16px; margin-bottom: 14px; }
.filter-group { border-top: 1px solid var(--line); }
.filter-group:last-child { border-bottom: 1px solid var(--line); }
.filter-group summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; cursor: pointer; font-size: 16px; font-weight: 700; }
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { content: '+'; width: 20px; text-align: center; }
.filter-group[open] summary::after { content: '−'; }
.filter-group summary span { color: var(--muted); font-weight: 400; margin-left: auto; }
fieldset { border: 0; padding: 0 0 12px; margin: 0; min-width: 0; }
legend { font-size: 16px; padding: 0; }
.radio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.radio-grid label { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; font-size: 16px; border: 1px solid var(--line); padding: 9px; background: white; cursor: pointer; overflow-wrap: anywhere; }
.radio-grid label:has(input:checked) { background: var(--soft); border-color: var(--ink); }
.radio-grid input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--ink); }
.radio-grid label span { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 16px; }
.initial-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.initial-grid label { justify-content: center; gap: 4px; padding-inline: 3px; }
.initial-grid label:first-child { grid-column: span 2; }
.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: 10px; flex-shrink: 0; background: var(--paper); }
.dialog-actions button { flex: 1; }

.page-heading { padding-block: 26px 20px; }
.page-heading p { color: var(--muted); max-width: 60ch; margin-bottom: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; padding-top: 12px; }
.breadcrumb a { display: inline-flex; min-height: 44px; align-items: center; }
.reading-layout { max-width: 760px; margin-inline: auto; }
.reading-block { border-top: 1px solid var(--line); padding-block: 22px; margin-bottom: 4px; }
.reading-block h2 { font-size: 25px; }
.reading-block p:last-child { margin-bottom: 0; }
.reading-block li { margin-bottom: 10px; }
.reading-block ul, .reading-block ol { padding-left: 23px; margin: 0; }
.reading-block .button { margin-top: 4px; }
.numbered-heading { display: flex; gap: 14px; align-items: baseline; }
.numbered-heading > span { color: var(--accent); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.text-links { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.text-links a { display: inline-flex; align-items: center; min-height: 44px; }
.inspect-heading { padding: 0 0 18px; }
.inspect-heading .category-label { display: block; margin: 0 0 8px; }
.inspect-heading h1 { max-width: 28ch; }
.inspect-heading p { margin-bottom: 0; }
.player { border: 1px solid var(--ink); background: white; margin-bottom: 24px; }
.stage { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #102e31; }
.preview-panel { position: absolute; inset: 0; min-width: 0; min-height: 0; }
/* Anchor the image to the definite stage box, independent of intrinsic grid sizing. */
.preview-panel img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.preview-panel .image-failure { color: white; position: absolute; inset: 0; display: grid; place-items: center; }
.stage iframe { position: absolute; inset: 0; display: block; border: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; background: white; }
.player-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.player-toolbar button { flex: 1 1 auto; }
.player-toolbar .primary { min-width: 100px; }
.player-status { padding: 0 12px 12px; font-size: 14px; color: var(--muted); margin: 0; min-height: 36px; }
.player:fullscreen { width: 100%; height: 100%; border: 0; margin: 0; display: flex; flex-direction: column; background: white; }
.player:fullscreen .stage { flex: 1; min-height: 0; aspect-ratio: auto; }
.player:fullscreen .player-toolbar, .player:fullscreen .player-status { flex-shrink: 0; }
.record-description { border-top: 1px solid var(--line); padding-block: 20px; margin-bottom: 8px; max-width: 74ch; }
.record-description p { max-width: 65ch; }
.related-block { margin-top: 18px; padding-top: 20px; padding-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 2px solid var(--ink); }
.related-block .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
.notice { background: var(--soft); border-left: 3px solid var(--accent); padding: 16px; }
.all-titles { columns: 2; column-gap: 32px; padding-left: 24px; }
.all-titles li { break-inside: avoid; margin-bottom: 12px; }
.all-titles a { min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 640px) {
  .search-tools { display: flex; align-items: center; gap: 12px; }
  .search-line { flex: 1; min-width: 0; }
  .search-status { flex: 0 1 auto; max-width: 40%; min-height: 44px; }
}
@media (min-width: 1000px) {
  /* A definite print height leaves room for full long titles in two-row sheets. */
  .contact-batch .thumbnail-mat {
    --print-height: clamp(120px, 12vw, 148px);
    position: relative;
    display: block;
    height: var(--print-height);
    min-height: 0;
    flex: 0 0 var(--print-height);
    aspect-ratio: auto;
  }
  .contact-batch .thumbnail-mat img {
    position: absolute;
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    max-width: calc(100% - 12px);
    max-height: calc(100% - 12px);
    object-fit: cover;
  }
}
@media (min-width: 640px) and (max-width: 999px) {
  .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .wrap { width: calc(100% - 28px); }
  .header-inner { align-items: stretch; flex-direction: column; gap: 2px; padding-top: 10px; }
  .brand { align-self: start; font-size: 22px; }
  .site-nav { gap: 0; justify-content: space-between; }
  .site-nav a { padding-inline: 8px; font-size: 16px; }
  .sheet-intro { padding: 18px 0 14px; gap: 12px; }
  .sheet-intro h1 { font-size: 28px; }
  .sheet-intro p { font-size: 14px; max-width: 32ch; }
  .entry-total strong { font-size: 23px; }
  .entry-total span { font-size: 13px; }
  .entry-total { padding-left: 8px; }
  .search-line { gap: 6px; }
  .search-line button { padding: 10px; font-size: 16px; }
  .search-line input { padding-inline: 9px; }
  .search-status p { font-size: 13px; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .thumbnail-mat { padding: 4px; }
  .card-caption { padding: 8px; }
  .card-caption h3 { font-size: 16px; line-height: 1.25; }
  .category-label { font-size: 13px; }
  .listed-input, .inspect-label { font-size: 13px; }
  .contact-batch { padding-bottom: 10px; margin-bottom: 12px; }
  .sheet-note { align-items: start; flex-direction: column; gap: 4px; }
  .footer-top { flex-direction: column; gap: 2px; }
  .footer-top p { margin-bottom: 6px; }
  .footer-links { column-gap: 18px; }
  .filter-body, .dialog-header, .dialog-actions { padding-inline: 12px; }
  .radio-grid { gap: 6px; }
  .radio-grid label { padding: 8px; gap: 6px; }
  .initial-grid label { padding-inline: 3px; gap: 4px; }
  .page-heading { padding-top: 22px; }
  .reading-block h2 { font-size: 23px; }
  .inspect-heading h1 { font-size: 30px; }
  .player-toolbar { gap: 6px; padding: 8px; }
  .player-toolbar button { flex-basis: calc(50% - 6px); padding-inline: 6px; }
  .player-toolbar .primary { min-width: 0; }
  .player-status { padding-inline: 8px; }
  .all-titles { columns: 1; }
}
@media (max-height: 539px) and (min-width: 640px) {
  .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .thumbnail-mat { aspect-ratio: 4 / 3; }
  .header-inner { min-height: 60px; }
  .sheet-intro { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* Filled preview cells and native links for complete game cards. */
.thumbnail-mat { padding: 0; }
.contact-batch .thumbnail-mat img { inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; }
