/* Nano Games — white, image-first, quiet chrome. One typeface, one accent. */
/* Self-hosted (SIL OFL), see /fonts/OFL-NOTICE.txt. */
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/fonts/schibsted-grotesk-v7-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/fonts/schibsted-grotesk-v7-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --surface: #f5f5f4;
  --sunk: #efefee;
  --ink: #111111;
  --ink-2: #4a4a4a;
  --ink-3: #737373;
  --rule: #ececec;
  --rule-2: #dedede;
  --hairline: rgba(0, 0, 0, 0.06);
  --accent: #e5391c;
  --on-accent: #ffffff;
  --pressed: #ffffff;
  --shadow-card: 0 14px 28px -12px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 24px 64px -16px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.05);

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1680px;
  --gutter: clamp(16px, 2.2vw, 32px);
  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --header-h: 64px;
  --side-w: 236px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --surface: #181818; --sunk: #1c1c1c;
    --ink: #f2f2f2; --ink-2: #b4b4b4; --ink-3: #8a8a8a;
    --rule: #222222; --rule-2: #333333; --hairline: rgba(255, 255, 255, 0.07);
    --accent: #ff5a3a; --pressed: #2a2a2a;
    --shadow-card: 0 14px 28px -12px rgba(0, 0, 0, 0.8);
    --shadow-pop: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --surface: #181818; --sunk: #1c1c1c;
  --ink: #f2f2f2; --ink-2: #b4b4b4; --ink-3: #8a8a8a;
  --rule: #222222; --rule-2: #333333; --hairline: rgba(255, 255, 255, 0.07);
  --accent: #ff5a3a; --pressed: #2a2a2a;
  --shadow-card: 0 14px 28px -12px rgba(0, 0, 0, 0.8);
  --shadow-pop: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* Sidebar collapses to an icon rail on game pages (more room for the player),
   or anywhere the visitor chose it. */
@media (min-width: 1100px) {
  :root[data-nav="rail"], :root[data-page="game"]:not([data-nav="full"]) { --side-w: 72px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; margin-inline: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); }
.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; }
.kicker { font-size: 13.5px; font-weight: 500; color: var(--ink-3); }
/* Tabular figures only where numbers line up — this face also makes , and . tabular. */
.sh-count, .toolbar-count, .chips a span, .gc-meta { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ header */

.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--bg); border-bottom: 1px solid var(--rule); }
.header-row { display: grid; grid-template-columns: 1fr minmax(0, 620px) 1fr; align-items: center; gap: 20px; height: 100%; padding: 0 16px 0 14px; }
.header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-right { display: flex; justify-content: flex-end; gap: 4px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.035em; white-space: nowrap; }
.logo-mark { width: 20px; height: 20px; fill: var(--ink); stroke: none; }
.logo-mark .lm-accent { fill: var(--accent); }

.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); font-size: 20px; color: var(--ink); transition: background .15s; }
.icon-btn:hover { background: var(--surface); }
.theme-btn svg:last-child { display: none; }
:root[data-theme="dark"] .theme-btn svg:first-child { display: none; }
:root[data-theme="dark"] .theme-btn svg:last-child { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn svg:first-child { display: none; }
  :root:not([data-theme="light"]) .theme-btn svg:last-child { display: block; }
}

.search-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 8px 0 16px;
  border: 1px solid transparent; border-radius: 999px; background: var(--surface);
  color: var(--ink-3); font-size: 15px; transition: border-color .15s, background .15s;
}
.search-trigger:hover { border-color: var(--rule-2); background: var(--bg); }
.search-trigger svg { font-size: 18px; color: var(--ink-2); }
.search-trigger kbd { margin-left: auto; font: 500 12px/1 var(--sans); min-width: 24px; padding: 5px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--rule-2); color: var(--ink-3); }

@media (max-width: 760px) {
  :root { --header-h: 56px; }
  .header-row { display: flex; gap: 4px; padding: 0 8px 0 6px; }
  .header-left { margin-right: auto; gap: 4px; }
  .search-trigger { width: 40px; height: 40px; padding: 0; justify-content: center; background: none; border-radius: var(--r-sm); }
  .search-trigger:hover { border-color: transparent; background: var(--surface); }
  .search-trigger svg { font-size: 20px; color: var(--ink); }
  .st-label, .search-trigger kbd { display: none; }
}

/* ------------------------------------------------------------ shell & sidebar */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
/* .main-col is the scroller and stays a plain box; the container-query context
   lives one level in, so the scroller carries no containment. */
.main-col { min-width: 0; }
.main-inner { container-type: inline-size; }

.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 12px 10px 24px; background: var(--bg);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar hr { border: 0; border-top: 1px solid var(--rule); margin: 10px 12px; }
.sb-item {
  display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s;
}
.sb-item svg { font-size: 20px; }
.sb-item:hover { background: var(--surface); color: var(--ink); }
/* Selected state changes colour only — a weight change would shift the text width. */
.sb-item[aria-current] { background: var(--surface); color: var(--ink); }
.sb-item[aria-current] svg { color: var(--accent); }
.nav-backdrop { display: none; }

@media (min-width: 1100px) {
  :root[data-nav="rail"] .sidebar, :root[data-page="game"]:not([data-nav="full"]) .sidebar { padding-inline: 10px; }
  :root[data-nav="rail"] .sb-item, :root[data-page="game"]:not([data-nav="full"]) .sb-item { justify-content: center; padding: 0; height: 44px; }
  :root[data-nav="rail"] .sb-item span, :root[data-page="game"]:not([data-nav="full"]) .sb-item span { display: none; }
  :root[data-nav="rail"] .sidebar hr, :root[data-page="game"]:not([data-nav="full"]) .sidebar hr { margin-inline: 8px; }
}

/* Mouse / trackpad: the page itself never scrolls, so the header never moves.
   The sidebar and the content column are independent scroll areas, each with
   the native macOS rubber band. `contain` keeps that bounce but stops the
   overscroll from chaining out to the page (`none` would remove the bounce).
   Touch devices keep normal page scrolling (iOS needs it for the collapsing
   address bar). */
@media (hover: hover) and (pointer: fine) {
  /* overscroll-behavior on <html> is the viewport's own setting; `none` there
     switches off the rubber band for nested scrollers too. Set it on body only. */
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; overscroll-behavior: none; }
  .site-header { position: relative; flex: none; }
  .shell { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .main-col { overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 16px; outline: none; }
  .sidebar { overscroll-behavior: contain; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
  .sidebar { position: relative; top: auto; align-self: stretch; height: auto; }
}

@media (max-width: 1099px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: min(280px, 84vw); height: 100dvh;
    padding-top: 16px; transform: translateX(-102%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
    box-shadow: var(--shadow-pop); visibility: hidden;
  }
  :root.nav-open .sidebar { transform: none; visibility: visible; }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(10, 10, 10, .35); opacity: 0; pointer-events: none; transition: opacity .2s; }
  :root.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  :root.nav-open { overflow: hidden; }
}

/* ------------------------------------------------------------ section heads, buttons */

.section-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.section-head h2 { font-size: 19px; letter-spacing: -0.025em; }
.section-head h2 a { transition: color .15s; }
.section-head h2 a:hover { color: var(--accent); }
.sh-count { font-size: 14px; color: var(--ink-3); }
.more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: color .15s; }
.more svg { font-size: 15px; transition: transform .2s; }
.more:hover { color: var(--ink); }
.more:hover svg { transform: translateX(2px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border: 1px solid var(--rule-2); border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid var(--rule-2); border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.ghost-btn svg { font-size: 16px; color: var(--ink-2); }
.ghost-btn:hover { background: var(--surface); border-color: var(--ink-3); }

/* ------------------------------------------------------------ cards */

.card { position: relative; display: block; min-width: 0; border-radius: var(--r); transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.card-media { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; border-radius: var(--r); background: var(--sunk); transition: box-shadow .25s; }
.card-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hairline); pointer-events: none; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-badge { position: absolute; top: 6px; left: 6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; }
.card-title { display: block; margin-top: 7px; font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mouse: image-only cards, title slides in on hover. Touch: title stays below. */
@media (hover: hover) and (pointer: fine) {
  .card-badge { display: none; }
  .card-title {
    position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 26px 12px 9px;
    color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    border-radius: 0 0 var(--r) var(--r);
    opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none;
  }
  .card:hover, .card:focus-visible { transform: translateY(-3px); }
  .card:hover .card-media, .card:focus-visible .card-media { box-shadow: var(--shadow-card); }
  .card:hover .card-title, .card:focus-visible .card-title { opacity: 1; transform: none; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 16px 12px; }
@container (max-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; } }

/* ------------------------------------------------------------ horizontal rows */

.scroller { --card-w: clamp(180px, 16cqi, 252px); position: relative; }
.sc-track {
  display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-block: 6px 10px; margin-block: -6px -10px;
}
.sc-track::-webkit-scrollbar { display: none; }
.sc-track > .card { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.sc-btn {
  position: absolute; z-index: 3; top: calc(var(--card-w) / 4); translate: 0 -50%;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg); color: var(--ink); font-size: 18px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18), 0 0 0 1px var(--hairline);
  opacity: 0; transition: opacity .2s, background .15s;
}
.sc-btn:hover { background: var(--surface); }
.sc-prev { left: -12px; }
.sc-next { right: -12px; }
@media (hover: hover) and (pointer: fine) { .scroller:hover .sc-btn { opacity: 1; } }
.scroller[data-at-start] .sc-prev, .scroller[data-at-end] .sc-next { opacity: 0 !important; pointer-events: none; }
@container (max-width: 700px) {
  .scroller { --card-w: 44cqi; }
  .sc-track { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); gap: 10px; }
  .sc-btn { display: none; }
}

/* ------------------------------------------------------------ home */

.top { padding-top: 22px; padding-bottom: 40px; }
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bento > .card:nth-child(n+6) { display: none; }
@container (min-width: 1240px) {
  .bento { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bento > .card:nth-child(n+6) { display: block; }
  .bento > .card:nth-child(n+8) { display: none; }
}
@container (min-width: 1500px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bento > .card:nth-child(n+6) { display: block; }
}
.tile-lg { grid-column: span 2; grid-row: span 2; position: relative; display: block; min-height: 180px; border-radius: var(--r-lg); overflow: hidden; color: #fff; }
.tile-lg .card-media { position: absolute; inset: 0; aspect-ratio: auto; border-radius: inherit; }
.tile-lg .card-media img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tile-lg:hover .card-media img { transform: scale(1.025); }
.tile-body {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 16px;
  padding: 64px 22px 20px; background: linear-gradient(to top, rgba(0, 0, 0, .74), rgba(0, 0, 0, 0));
}
.tile-kicker { width: 100%; font-size: 13px; font-weight: 600; opacity: .85; }
.tile-title { flex: 1; min-width: 0; font-size: clamp(22px, 2.3cqi, 32px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.tile-play {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: 999px;
  background: #fff; color: #111; font-size: 15px; font-weight: 600; transition: background .15s, color .15s;
}
.tile-play svg { fill: currentColor; stroke: none; font-size: 15px; margin-left: -3px; }
.tile-lg:hover .tile-play { background: var(--accent); color: #fff; }
@container (max-width: 700px) {
  .top { padding-top: 14px; padding-bottom: 32px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .tile-lg { grid-row: auto; aspect-ratio: 2 / 1; }
  .tile-body { padding: 40px 14px 12px; }
  .tile-play { display: none; }
  .bento > .card:nth-child(n+6) { display: none; }
}

.recent { padding-bottom: 36px; }
.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; padding-bottom: 72px; }
.row, .scroller { min-width: 0; }

.about-strip { padding-bottom: 72px; }
.about-strip h2 { font-size: 15px; letter-spacing: -0.01em; padding-top: 28px; border-top: 1px solid var(--rule); margin-bottom: 10px; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; color: var(--ink-3); font-size: 14.5px; max-width: 1040px; }
@container (max-width: 760px) { .about-cols { grid-template-columns: 1fr; gap: 10px; } }

/* ------------------------------------------------------------ inner pages */

.crumbs { padding-top: 20px; font-size: 13.5px; color: var(--ink-3); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rule-2); }
.crumbs a { transition: color .15s; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink-2); }

.page-head { display: flex; gap: 20px; align-items: flex-start; padding: clamp(20px, 3vw, 36px) 0 clamp(24px, 3vw, 32px); }
.page-head-icon { flex: none; display: grid; place-items: center; width: 56px; height: 56px; margin-top: 4px; border-radius: var(--r-lg); background: var(--surface); color: var(--accent); font-size: 28px; }
.page-head h1 { font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -0.04em; font-weight: 800; }
.page-intro { margin-top: 10px; font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
.page-note { margin-top: 8px; font-size: 14.5px; color: var(--ink-3); max-width: 72ch; }
.page-note a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); transition: color .15s, text-decoration-color .15s; }
.page-note a:hover { color: var(--ink); text-decoration-color: currentColor; }
@container (max-width: 600px) { .page-head-icon { display: none; } }

/* Listing pages: one compact line, then the games. */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0 18px; }
.list-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); color: var(--accent); font-size: 18px; }
.list-head h1 { font-size: clamp(22px, 2.3vw, 28px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.list-meta { align-self: flex-end; padding-bottom: 3px; font-size: 14.5px; color: var(--ink-3); white-space: nowrap; }
.list-note { margin: -4px 0 20px; color: var(--ink-2); }
.list-about { padding: 32px 0 80px; border-top: 1px solid var(--rule); }
.list-about h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.list-about .page-intro { font-size: 16px; }
.other-genres:has(+ .list-about) { padding-bottom: 48px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; margin-bottom: 20px; border-top: 1px solid var(--rule); }
.toolbar-count { font-size: 14.5px; color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); }
.seg button { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-3); transition: color .15s, background .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--pressed); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--hairline); }

.other-genres { padding: 64px 0 80px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; gap: 8px; align-items: center; height: 40px; padding: 0 16px 0 13px; border: 1px solid var(--rule-2); border-radius: 999px; font-size: 14.5px; font-weight: 500; transition: border-color .15s; }
.chips a svg { font-size: 17px; color: var(--ink-3); }
.chips a span { font-size: 13px; font-weight: 400; color: var(--ink-3); }
.chips a:hover { border-color: var(--ink); }

.grid-page { padding-bottom: 80px; }

.genre-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px 14px; padding-bottom: 80px; }
.genre-card { display: block; }
.gc-media { position: relative; display: block; aspect-ratio: 2 / 1; border-radius: var(--r); overflow: hidden; background: var(--sunk); }
.gc-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hairline); }
.gc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.genre-card:hover .gc-media img { transform: scale(1.04); }
.gc-body { display: flex; align-items: center; gap: 9px; padding-top: 10px; }
.gc-icon { display: grid; color: var(--accent); font-size: 19px; }
.gc-name { flex: 1; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.gc-meta { font-size: 13.5px; color: var(--ink-3); }

.nf { padding-top: clamp(40px, 7vw, 88px); padding-bottom: 88px; }
.nf h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.04em; font-weight: 800; margin-top: 8px; }
.nf .page-intro { margin-bottom: 32px; }
.nf-back { margin-top: 32px; }
.text-page { padding-bottom: 88px; }

/* ------------------------------------------------------------ game page */

.game-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; padding-top: 20px; padding-bottom: 80px; }
@container (max-width: 1060px) { .game-shell { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  max-height: calc(100dvh - var(--header-h) - 132px); min-height: 220px;
  background: #0b0b0b; border-radius: var(--r-lg); overflow: hidden; isolation: isolate;
}
/* The 150px icon is already cached from the game bar: blur it as a placeholder
   until the (much heavier) poster arrives. */
.player::before { content: ""; position: absolute; inset: -60px; background: var(--placeholder) center / cover no-repeat; filter: blur(48px) saturate(1.2); opacity: .75; }
.player.is-playing::before { display: none; }
/* Every game gets the whole frame, whatever its orientation flag says. On
   desktop app.js may give the iframe a larger size and scale it down (see
   fitGame), so fixed-size games show whole with black bars, never cropped. */
.player iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; background: #000; transform-origin: 0 0; }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.player-start {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: #fff; text-align: center; padding: 24px;
  background: radial-gradient(50% 60% at 50% 50%, rgba(0,0,0,.55), rgba(0,0,0,.22) 75%), linear-gradient(to top, rgba(0,0,0,.35), transparent 50%);
  text-shadow: 0 1px 12px rgba(0,0,0,.45);
}
.play-disc { width: 80px; height: 80px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 10px 30px -8px rgba(0,0,0,.5); transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.play-disc svg { fill: #fff; stroke: none; font-size: 30px; margin-left: 3px; }
.play-label { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.play-hint { font-size: 13.5px; opacity: .85; }
.player:hover .play-disc { transform: scale(1.06); }
.player:hover .player-poster { transform: scale(1.015); }
.player.is-playing .player-poster, .player.is-playing .player-start { display: none; }
.player-exit {
  display: none; position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 18px;
}
.player.is-full { position: fixed; inset: 0; z-index: 100; max-height: none; min-height: 0; aspect-ratio: auto; border-radius: 0; }
.player:popover-open {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; min-height: 0;
  margin: 0; padding: 0; border: 0; border-radius: 0; aspect-ratio: auto; overflow: hidden; background: #000; color: #fff;
}
.player:popover-open::backdrop { background: #000; }
.player:popover-open .player-exit { display: grid; }
/* Browsers without popovers: drop the containment that traps position:fixed. */
@supports not selector(:popover-open) { :root.player-locked .main-inner { container-type: normal; } }
.player:fullscreen { max-height: none; border-radius: 0; }
.player.is-full .player-exit, .player:fullscreen .player-exit { display: grid; }
:root.player-locked { overflow: hidden; }

.game-bar { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.game-icon { width: 56px; height: 56px; border-radius: 13px; background: var(--sunk); box-shadow: 0 0 0 1px var(--hairline); object-fit: cover; }
.game-bar h1 { font-size: clamp(22px, 2.2cqi, 30px); font-weight: 800; letter-spacing: -0.035em; }
.game-sub { display: flex; flex-wrap: wrap; margin-top: 3px; font-size: 14px; color: var(--ink-3); }
.game-sub > * + *::before { content: "·"; margin: 0 7px; }
.game-sub a { color: var(--ink-2); font-weight: 500; transition: color .15s; }
.game-sub a:hover { color: var(--accent); }
.game-actions { display: flex; gap: 8px; }

.back-to-game {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 60;
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px 0 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.back-to-game svg { font-size: 16px; }
.back-to-game.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

.game-info { max-width: 780px; padding-top: 4px; }
.game-info .crumbs { padding-top: 18px; margin-bottom: 14px; }
.lead { font-size: 18px; line-height: 1.55; letter-spacing: -0.01em; }
.controls { margin-top: 22px; padding: 16px 18px; background: var(--surface); border-radius: var(--r); }
.controls h2 { font-size: 14px; letter-spacing: 0; color: var(--ink-2); margin-bottom: 4px; }
.controls p { font-size: 15px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; margin: 22px 0 0; }
.facts div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.facts a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.facts a:hover { text-decoration-color: currentColor; }
@container (max-width: 600px) { .facts { grid-template-columns: 1fr; } }

.prose { margin-top: 32px; max-width: 70ch; color: var(--ink-2); }
.prose h2 { color: var(--ink); font-size: 20px; letter-spacing: -0.025em; margin: 32px 0 10px; }
.prose h3, .prose h4 { color: var(--ink); font-size: 17px; letter-spacing: -0.015em; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 18px; }
.prose li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.prose ul li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.prose ol { counter-reset: n; }
.prose ol li::before { counter-increment: n; content: counter(n) "."; position: absolute; left: 0; font-weight: 600; color: var(--ink-3); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.prose a:hover { text-decoration-color: currentColor; }
.prose > :first-child { margin-top: 0; }
.prose.is-clamped { max-height: 360px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.read-more { margin-top: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.tags li { font-size: 13.5px; color: var(--ink-3); padding: 6px 12px; background: var(--surface); border-radius: 999px; }
.tags li:has(a) { padding: 0; background: none; }
.tags a { display: block; padding: 6px 12px; border-radius: 999px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule-2); transition: box-shadow .15s, color .15s; }
.tags a:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.play-next h2 { font-size: 16px; letter-spacing: -0.015em; margin-bottom: 12px; }
.pn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@container (max-width: 1060px) {
  .play-next { padding-top: 32px; }
  .pn-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 10px; }
}
@container (max-width: 480px) { .pn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@container (max-width: 700px) {
  .game-shell { padding-top: 0; }
  .player { margin-inline: calc(var(--gutter) * -1); width: auto; border-radius: 0; min-height: 0; }
  .player-start { gap: 8px; }
  .play-disc { width: 60px; height: 60px; }
  .play-disc svg { font-size: 24px; }
  .play-label { font-size: 17px; margin-top: 2px; }
  .game-bar { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0 16px; }
  .game-icon { width: 48px; height: 48px; border-radius: 11px; }
  .game-sub span:last-child { display: none; }
  .ghost-btn { width: 40px; padding: 0; justify-content: center; }
  .ghost-btn span { display: none; }
  .game-actions [data-copy-link] { display: none; }
}

.ad-slot { background: var(--surface); border-radius: var(--r); }
.ad-leader { width: 728px; max-width: 100%; height: 90px; margin: 24px auto 0; }
.ad-rect { width: 300px; height: 250px; margin-top: 20px; }

/* ------------------------------------------------------------ footer */

.site-footer { border-top: 1px solid var(--rule); padding-top: 48px; font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1.4fr 0.8fr; gap: 48px; padding-bottom: 48px; }
.footer-about p { margin-top: 14px; color: var(--ink-3); max-width: 34ch; }
.footer-h { font-size: 14px; letter-spacing: -0.005em; margin-bottom: 14px; }
.footer-links li { margin-bottom: 9px; }
.footer-links-2 { columns: 2; column-gap: 24px; }
.footer-links a { color: var(--ink-3); transition: color .15s; }
.footer-links a:hover { color: var(--ink); }
.footer-base { padding-block: 18px 28px; border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--ink-3); }
@container (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; } .footer-about { grid-column: 1 / -1; } .footer-links-2 { columns: 1; } }

/* ------------------------------------------------------------ search */

.search-dialog { position: fixed; inset: 0; z-index: 80; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 10, .32); animation: fade .16s ease-out; }
.search-panel {
  position: relative; width: min(640px, calc(100% - 24px)); margin: 12vh auto 0;
  background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow-pop), 0 0 0 1px var(--hairline);
  overflow: hidden; animation: pop .18s cubic-bezier(.2,.7,.2,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.99); } }
@keyframes fade { from { opacity: 0; } }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--rule); }
.search-field svg { font-size: 20px; color: var(--ink-3); }
.search-field input { flex: 1; height: 60px; border: 0; background: none; font: 500 18px var(--sans); letter-spacing: -0.01em; color: var(--ink); outline: none; min-width: 0; }
.search-field input::placeholder { color: var(--ink-3); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-esc { font-size: 12px; font-weight: 500; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--rule-2); color: var(--ink-3); }
.search-results { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.sr-label { font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 12px 10px 6px; }
.sr-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); }
.sr-item img { width: 40px; height: 40px; border-radius: 8px; background: var(--sunk); object-fit: cover; }
.sr-item b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item span { font-size: 13px; color: var(--ink-3); }
.sr-item[aria-selected="true"] { background: var(--surface); }
@media (hover: hover) { .sr-item:hover { background: var(--surface); } }
.sr-empty { padding: 32px 10px; color: var(--ink-3); text-align: center; font-size: 15px; }
.sr-more { display: block; margin: 6px 0 2px; padding: 10px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: center; }
.sr-more:hover { background: var(--surface); color: var(--ink); }

/* Search results page */
.search-page-form { display: flex; align-items: center; gap: 12px; max-width: 560px; height: 48px; padding: 0 16px; margin: 4px 0 28px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--bg); }
.search-page-form svg { font-size: 18px; color: var(--ink-3); flex: none; }
.search-page-form input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: 500 16px var(--sans); color: var(--ink); outline: none; }
.search-page-form:focus-within { border-color: var(--ink-3); }

/* Category pagination */
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 8px; }
.pager a, .pager span { min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pager a { color: var(--ink-2); border: 1px solid var(--rule); }
.pager a:hover { color: var(--ink); background: var(--surface); }
.pager span { background: var(--ink); color: var(--bg); }
.page-no { color: var(--ink-3); font-weight: 500; }
@media (max-width: 600px) { .search-panel { margin-top: 10px; } }

:root.theme-switching *, :root.theme-switching *::before, :root.theme-switching *::after { transition: none !important; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
