/* Layout: a single reading column; the game list reads like a table of contents (name · year · status, one line of description). */
:root {
  --bg: #f4f5f2;        /* paper grey with a faint green bias */
  --surface: #ffffff;
  --raised: #ffffff;
  --ink: #1d232c;
  --muted: #5b6470;
  --line: #d6d9d3;
  --accent: #2b5f86;    /* deep slate blue: links, active language, primary buttons */
  --danger: #b3261e;
  --display: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

/* language switch */
html[data-lang="en"] .ja, html[data-lang="ja"] .en { display: none; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.8 var(--body);
  -webkit-text-size-adjust: 100%;
}
.wrap {
  max-width: 760px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2 { font-family: var(--display); font-weight: 700; text-wrap: balance; line-height: 1.35; margin: 0; }
.mono, .year { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* header */
.bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 10px; }
.logo img { width: 24px; height: 24px; border-radius: 5px; }
.lang {
  font: 500 .8rem/1 var(--mono); color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; display: flex; gap: 6px; white-space: nowrap; flex-shrink: 0;
}
.lang .on { color: var(--accent); font-weight: 700; }
.lang .sep { opacity: .5; }

main { padding-block: 40px 24px; display: grid; gap: 28px; }

/* top page: the games themselves, as thumbnail cards */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 36px 24px; }
.card { display: grid; gap: 8px; text-decoration: none; color: inherit; align-content: start; }
.thumb { display: block; width: 100%; aspect-ratio: 1; max-width: 100%; height: auto; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.thumb-empty { display: grid; place-items: center; color: var(--muted); font-size: .8rem; border-style: dashed; background: transparent; }
.card-name { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; margin-top: 6px; line-height: 1.3; }
.card:hover .card-name { color: var(--accent); }
.card:hover .thumb { border-color: var(--accent); }
.card-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .85rem; }
.card-text { color: var(--muted); font-size: .9rem; line-height: 1.7; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.sep-dot { opacity: .5; }
.tbd { font-style: italic; opacity: .75; }

/* game page */
.crumb a { font-size: .9rem; text-decoration: none; }
.crumb a::before { content: "← "; }
.game { display: grid; gap: 32px; }
.game > *, .ludeme > div { min-width: 0; }
.game-head { display: grid; gap: 16px; }
.game-head h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); letter-spacing: .02em; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.facts div { display: grid; gap: 4px; align-content: start; }
.facts .wide { flex-basis: 100%; }
.facts dt { font: 500 .7rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; }
.lead { margin: 0; font-size: 1.05rem; max-width: 36em; }
.shot { margin: 0; display: grid; gap: 8px; }
.shot img { width: 100%; max-width: 420px; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.shot figcaption { font-size: .85rem; color: var(--muted); }
.game section { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.game h2 { font-size: 1.3rem; }
.game p { margin: 0; }
.lead > div { display: grid; gap: 12px; }
.lead > div.ja, .lead > div.en { display: grid; }
html[data-lang="en"] .lead > div.ja, html[data-lang="ja"] .lead > div.en { display: none; }
/* "experimental" label (card and game title) and the note under the description */
.exp { display: inline-block; font: 700 .7rem/1 var(--body); letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; vertical-align: middle; }
h1 .exp { font-size: .78rem; margin-left: 4px; }
.exp-note { color: var(--muted); font-size: .92rem; margin: 0 0 16px; }
.kana { font-family: var(--body); font-size: .9rem; font-weight: 400; color: var(--muted); letter-spacing: .05em; vertical-align: middle; }

/* rules taken from the old pages */
.rules h3 { font-family: var(--display); font-size: 1.05rem; margin: 22px 0 6px; }
.rules ul, .rules ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.rules ul ul { margin-top: 4px; }
.rules p { margin: 6px 0; }
.rules strong { color: var(--ink); }
.diagram { margin: 14px 0; }
.diagram img { display: block; width: 100%; max-width: 364px; height: auto; background: #e6e4df; border-radius: 8px; }
.diagram.fig { margin: 16px 0 18px; }
.diagram.fig img { width: auto; max-width: min(100%, 364px); }
.diagram figcaption { margin-top: 6px; max-width: 34em; font-size: .86rem; line-height: 1.6; color: var(--muted); }

/* ludeme pages */
.ludeme pre { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font: .82rem/1.55 var(--mono); }
.ludeme p, .ludeme li { color: var(--muted); }
.todo { border: 1px dashed var(--line); border-radius: 6px; padding: 14px 16px; color: var(--muted); font-size: .9rem; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 700; padding: 10px 18px; border-radius: 6px;
}
.btn-sub { display: inline-block; border: 1px solid var(--accent); color: var(--accent); text-decoration: none; font-weight: 700; padding: 8px 16px; border-radius: 6px; }
.btn-sub:hover { background: var(--accent); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions .btn, .actions .btn-sub { margin: 0; }
.note { color: var(--muted); font-size: .85rem; margin-left: 8px; }

.foot { padding-block: 32px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }

@media (prefers-reduced-motion: no-preference) {
  .card-name, .thumb { transition: color .15s, border-color .15s; }
}

/* top page: the shelves of games */
.shelf + .shelf { margin-top: 44px; }
.shelf h2 { font: 700 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }

/* top page: update history */
.updates { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 18px; }
.updates h2 { font: 700 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.updates ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.updates li { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; font-size: .9rem; line-height: 1.7; }
.updates time, .updates .when { font: 500 .82rem/1.9 var(--mono); color: var(--muted); }
.updates .more { margin: 12px 0 0; font-size: .88rem; }
.updates.page { margin-top: 8px; border-top: 0; padding-top: 0; }
.updates.page h1 { font-size: 1.6rem; margin: 0 0 18px; }
.foot-links { display: inline-flex; flex-wrap: wrap; gap: 16px; }
@media (max-width: 520px) { .updates li { grid-template-columns: 1fr; gap: 0; } }
/* about page: outside links */
.links { margin-top: 20px; }

/* game title: pronunciation in IPA on the English page (fonts that carry the phonetic letters first) */
.ipa { font-family: "Gentium Plus", "Charis SIL", "Doulos SIL", "Noto Sans", "Segoe UI", "Lucida Grande", "Arial Unicode MS", sans-serif; letter-spacing: .02em; }
