/* Guilt Free Games
   Layout idea: a quiet, cool page that lets each game's own colour do the talking.
   The shelf of spines is the one loud thing; everything else stays left-aligned and plain. */
:root {
  --ground: #EDF0EC;
  --ink: #18212B;
  --muted: #4A5561;
  --line: #CBD2CC;
  --plank: #B9A88E;
  --accent: #1C5788;
  --display: "Calistoga", "Cooper Black", Georgia, serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --edge: inset 0 0 0 1px rgba(0, 0, 0, .09);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #12171E; --ink: #E7EBEF; --muted: #A9B3BE; --line: #2B343F;
    --plank: #5B4E3D; --accent: #8DC1EE; --edge: inset 0 0 0 1px rgba(255, 255, 255, .1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #12171E; --ink: #E7EBEF; --muted: #A9B3BE; --line: #2B343F;
  --plank: #5B4E3D; --accent: #8DC1EE; --edge: inset 0 0 0 1px rgba(255, 255, 255, .1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.55 var(--body);
}
a { color: var(--accent); text-underline-offset: .18em; }
a:focus-visible, .tile:focus-visible, .spine:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.site-head { padding: 22px 0 0; }
.wordmark { font-family: var(--display); font-size: 22px; color: var(--ink); text-decoration: none; }
.site-foot { margin-top: 96px; padding: 36px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.site-foot .wrap { display: grid; gap: 18px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-links a { color: var(--ink); }

/* Home intro */
.intro { padding: 56px 0 8px; display: grid; gap: 18px; }
.intro h1 { font-size: clamp(34px, 5.2vw, 60px); max-width: 17ch; }
.intro p { font-size: 19px; color: var(--muted); max-width: 52ch; }

/* The shelf */
.shelf { margin-top: 40px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.shelf ol {
  list-style: none; margin: 0; padding: 14px 0 0;
  display: flex; align-items: flex-end; gap: 4px;
  min-width: max-content;
  border-bottom: 10px solid var(--plank);
}
.spine {
  display: flex; align-items: center; justify-content: flex-start;
  width: 40px; height: var(--h);
  padding: 12px 0;
  background: var(--bg); color: var(--fg);
  box-shadow: var(--edge);
  border-radius: 3px 3px 0 0;
  writing-mode: vertical-rl;
  font-family: var(--display); font-size: 15px; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: transform .15s ease-out;
}
.spine:hover, .spine:focus-visible { transform: translateY(-8px); }
.shelf-note { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Genre links */
.kinds { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; padding: 0; list-style: none; }
.kinds a {
  display: inline-flex; align-items: baseline; gap: 8px;
  min-height: 44px; padding: 10px 16px;
  border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 700;
}
.kinds a:hover { border-color: var(--ink); }
.kinds span { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.kinds a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.kinds a[aria-current="page"] span { color: var(--ground); }

/* Genre sections on the home page */
.genre { margin-top: 72px; }
.genre-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 20px; }
.genre-head h2 { font-size: clamp(26px, 3vw, 34px); }
.genre-head a { font-weight: 700; }

/* Tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px 24px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { display: grid; gap: 6px; color: var(--ink); text-decoration: none; }
.tile h3 { font-size: 21px; margin-top: 8px; }
.tile p { color: var(--muted); font-size: 16px; }
.tile:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }

/* Art: the share image on the live site, the game's own colours as a stand-in */
.art {
  position: relative; aspect-ratio: 1200 / 630; overflow: hidden;
  border-radius: 6px; background: var(--bg); color: var(--fg); box-shadow: var(--edge);
}
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art .stand-in {
  position: absolute; left: 7%; right: 7%; bottom: 10%;
  font-family: var(--display); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.05;
}

/* Genre page */
.crumbs { margin-top: 36px; font-size: 15px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.genre-intro { padding: 18px 0 8px; display: grid; gap: 18px; }
.genre-intro h1 { font-size: clamp(34px, 5vw, 56px); max-width: 18ch; }
.genre-intro p { font-size: 19px; color: var(--muted); max-width: 60ch; }

.rows { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 48px; }
.row { display: grid; gap: 20px 36px; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; }
.row .art .stand-in { font-size: clamp(24px, 3.2vw, 40px); }
.row-text { display: grid; gap: 10px; justify-items: start; }
.row-text h2 { font-size: clamp(26px, 3vw, 36px); }
.row-text h2 a { color: var(--ink); text-decoration: none; }
.row-text h2 a:hover { text-decoration: underline; }
.row-text .tag { font-weight: 700; font-size: 18px; }
.row-text p { max-width: 54ch; }
.play {
  margin-top: 8px; display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px;
  background: var(--bg); color: var(--fg); box-shadow: var(--edge);
  border-radius: 8px; font-weight: 700; text-decoration: none;
}
.play:hover { text-decoration: underline; }
.play:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.more { margin-top: 88px; }
.more h2 { font-size: clamp(24px, 2.6vw, 30px); }
.more .kinds { margin-top: 18px; }

@media (max-width: 700px) {
  body { font-size: 16px; }
  .intro { padding-top: 36px; }
  .intro p, .genre-intro p { font-size: 17px; }
  .row { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 26px 16px; }
  .tile h3 { font-size: 19px; }
  .tile p { font-size: 15px; }
  .genre { margin-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .spine { transition: none; }
  .spine:hover, .spine:focus-visible { transform: none; }
}
