/* GamesLink: warm paper, black ink, one tangerine accent. */
:root {
  --bg: #f6f1e7;
  --panel: #fffaf1;
  --ink: #16130f;
  --muted: #5d554a;
  --line: #e2d8c6;
  --accent: #e8491d;
  --accent-ink: #ffffff;
  --accent-soft: #fde1d3;
  --shadow: 0 1px 0 rgba(22, 19, 15, .06), 0 8px 24px -12px rgba(22, 19, 15, .25);
  --radius: 14px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110d;
    --panel: #1d1914;
    --ink: #f1e9da;
    --muted: #a99f8f;
    --line: #342d24;
    --accent: #ff6a3d;
    --accent-ink: #14110d;
    --accent-soft: #3a2117;
    --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 600; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.kicker { font: 500 .75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 .6rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--panel); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; flex-wrap: wrap; }
.brand { font: 800 1.35rem var(--display); text-decoration: none; display: inline-flex; align-items: center; gap: .45rem; letter-spacing: -.02em; }
.brand b { color: var(--accent); font-weight: 800; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); position: relative; flex: none; }
.mark::before, .mark::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; top: 7px; background: var(--accent); }
.mark::before { left: 3px; }
.mark::after { right: 3px; background: var(--bg); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.nav a:hover { background: var(--accent-soft); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--accent); color: var(--accent-ink); font: 700 1rem var(--body); border: 0; border-radius: 999px; padding: .75rem 1.4rem; text-decoration: none; cursor: pointer; box-shadow: var(--shadow); }
.btn:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.4rem; }

/* home */
.hero { background: var(--ink); color: var(--bg); padding: clamp(28px, 6vw, 64px) 0; }
.hero-in { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.hero .lede { color: color-mix(in srgb, var(--bg) 78%, transparent); }
.hero .btn-ghost { color: var(--bg); box-shadow: inset 0 0 0 2px var(--bg); }
.hero-art img { border-radius: var(--radius); aspect-ratio: 1200 / 630; object-fit: cover; width: 100%; box-shadow: 0 30px 60px -30px #000; }
.intro { padding: 36px 0 8px; font-size: 1.12rem; max-width: 52rem; }
.shelf { margin-block: 40px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shelf-head h2 { margin: 0; }
.shelf-head a { font-weight: 600; color: var(--accent); text-decoration: none; }
.shelf > .muted { margin: .3rem 0 1rem; }

/* genre filter */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.filters button { font: 600 .95rem var(--body); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.filters button span { font: 500 .75rem var(--mono); color: var(--muted); margin-left: 4px; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters button[aria-selected="true"] span { color: var(--bg); opacity: .7; }
.filter-note { margin: 10px 0 0; }
.filter-note a { color: var(--accent); font-weight: 600; }
.card[hidden] { display: none; }

/* game cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--line); }
.card-body { padding: 12px 14px 14px; display: grid; gap: 2px; }
.card-title { font: 800 1.08rem var(--display); }
.card-tag { color: var(--muted); font-size: .92rem; line-height: 1.4; }

/* reading cards */
.reads { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 16px; }
.read { display: grid; gap: 6px; align-content: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; border-top: 4px solid var(--accent); }
.read:hover { box-shadow: var(--shadow); }
.read .kicker { margin: 0; }
.read-title { font: 800 1.2rem/1.2 var(--display); }
.read-desc { color: var(--muted); font-size: .95rem; }

/* page scaffolding */
.page { padding: 20px 0 48px; }
.crumbs { font-size: .88rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.crumbs a { color: var(--muted); }

/* game page */
.game-head { margin-bottom: 16px; }
.game-head h1 { margin-bottom: .15em; }
.tagline { font-size: 1.2rem; color: var(--muted); margin: 0 0 .8rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 500 .78rem var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.chip-plain { background: transparent; box-shadow: inset 0 0 0 1px var(--line); text-transform: none; }

.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 110px); margin-inline: auto; }
.player-any { aspect-ratio: 4 / 3; max-width: min(100%, calc((100vh - 110px) * 4 / 3)); }
.player-landscape { max-width: min(100%, calc((100vh - 110px) * 16 / 9)); }
.player-portrait { aspect-ratio: 9 / 16; max-width: min(100%, calc((100vh - 110px) * 9 / 16), 460px); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.player-ui { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 16px; text-align: center; background: radial-gradient(circle at center, rgba(0,0,0,.15), rgba(0,0,0,.65)); }
.btn-play { font-size: 1.15rem; padding: 1rem 2rem; }
.player-note { color: #fff; margin: 0; font: 500 .85rem var(--mono); text-shadow: 0 1px 3px #000; }
.bar { width: min(320px, 70vw); height: 8px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.bar.waiting span { width: 35%; animation: sheen 1.2s ease-in-out infinite; }
@keyframes sheen { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.player.playing .player-cover, .player.playing .player-ui { display: none; }
.player-full { position: absolute; right: 10px; bottom: 10px; z-index: 2; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font: 600 .82rem var(--body); cursor: pointer; opacity: .7; }
.player-full:hover { opacity: 1; }
.player:fullscreen { max-width: none; max-height: none; border-radius: 0; }
.player.immersive { position: fixed; inset: 0; z-index: 50; max-width: none; max-height: none; aspect-ratio: auto; border-radius: 0; }
body.has-immersive { overflow: hidden; }

.game-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; margin-top: 32px; align-items: start; }
.facts { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 80px; }
.facts h2 { font-size: 1.1rem; }
.facts dl { margin: 0 0 1rem; }
.facts dt { font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: .8rem; }
.facts dd { margin: .15rem 0 0; font-size: .95rem; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.more a { font-weight: 700; color: var(--accent); }

/* long reads */
.doc { max-width: 760px; margin-inline: auto; }
.doc-head { margin-bottom: 24px; }
.prose { font-size: 1.06rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose li { max-width: 70ch; }
.prose li { margin: .35em 0; }
.prose a { color: var(--accent); }
.prose code { font: .9em var(--mono); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.prose blockquote { margin: 1.2em 0; padding: .2em 1.1em; border-left: 4px solid var(--accent); color: var(--muted); }
.table { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.prose > table, .doc .prose table { display: table; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 20px 0 8px; }
.toc h2 { font-size: 1rem; margin: 0 0 .4rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 28px; }
.toc a { color: var(--ink); }
.play-strip { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; margin: 24px 0; }
.play-strip img { width: 96px; border-radius: 8px; aspect-ratio: 4 / 3; object-fit: cover; flex: none; }
.play-strip > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.play-strip > span:nth-child(2) span { color: var(--muted); font-size: .92rem; }
.play-strip .btn { flex: none; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 36px 0 24px; background: var(--panel); }
.foot-in { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.foot nav { display: grid; gap: 6px; align-content: start; }
.foot h2 { font: 500 .75rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .3rem; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: var(--accent); }
.legal { font-size: .85rem; margin-top: 28px; }

@media (max-width: 900px) {
  .hero-in, .game-body { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .facts { position: static; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .toc ol { columns: 1; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-tag { display: none; }
  .reads { grid-template-columns: 1fr; }
  .play-strip { flex-wrap: wrap; }
  .play-strip .btn { width: 100%; }
  .nav a { padding: 6px 9px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .filters button { flex: none; }
}

/* author */
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 800 .9rem var(--display); text-decoration: none; flex: none; letter-spacing: .02em; box-shadow: inset 0 -4px 0 var(--accent); }
.avatar-lg { width: 84px; height: 84px; font-size: 1.7rem; box-shadow: inset 0 -8px 0 var(--accent); }
.byline { display: flex; gap: 12px; align-items: center; font-size: .95rem; margin-top: 1rem; line-height: 1.45; }
.byline a { color: inherit; font-weight: 600; }
.byline .muted a { font-weight: 500; }
.author-head { display: flex; gap: 20px; align-items: center; }
.author-head h1 { margin: 0; }
.devnote { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 4px 22px 16px; }
.devnote-sig { display: flex; gap: 10px; align-items: center; font-size: .92rem; color: var(--muted); }
.devnote-sig a { color: var(--ink); font-weight: 600; }
.history { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.history li { position: relative; padding: 0 0 14px 20px; display: grid; gap: 2px; max-width: none; }
.history li::before { content: ''; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.history time { font: 500 .78rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.byline a.avatar, .devnote-sig a.avatar { color: var(--bg); font-weight: 800; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar:has(img) { box-shadow: 0 0 0 2px var(--accent); background: var(--line); }
.author-links { margin: .4rem 0 0; font-weight: 600; }
.author-links a { color: var(--accent); }
