/* PixelJS portal. Dark first, light on request; tokens at the top. */
:root {
  color-scheme: dark;
  --bg: #0e1311;
  --bg-raised: #151c19;
  --surface: #1b2420;
  --surface-2: #232e29;
  --surface-hover: #2a3631;
  --border: #2c3833;
  --text: #eef1e7;
  --text-muted: #a3afa7;
  --text-faint: #7d8a82;
  --accent: #fa695d;
  --accent-strong: #ff8075;
  --accent-ink: #1b0705;
  --accent-soft: rgb(250 105 93 / 14%);
  --lime: #d9ed96;
  --lime-ink: #141a0c;
  --good-ink: #d9ed96; /* lime text that stays readable on the theme's background */
  --orange: #f9a75a;
  --focus: #d9ed96;
  --danger: #ff6b6b;
  --ok: #9fd86b;
  --letterbox: #050706;
  --shadow: 0 10px 30px rgb(0 0 0 / 45%);
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --header-h: 64px;
  --sidebar-w: 232px;
  --sidebar-mini-w: 76px;
  --tabbar-h: 62px;
  --content-max: 1760px;
  --gutter: 32px;
  --motion: 160ms;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
:root[data-theme="light"] {
  color-scheme: light;
  --good-ink: #4a6800;
  --bg: #f7f4ec;
  --bg-raised: #fffdf8;
  --surface: #efeadf;
  --surface-2: #e6e1d4;
  --surface-hover: #e2dccd;
  --border: #d9d4c6;
  --text: #20241f;
  --text-muted: #5f665c;
  --text-faint: #6c7268;
  --accent: #e2483b;
  --accent-strong: #c8392d;
  --accent-ink: #fff;
  --accent-soft: rgb(226 72 59 / 12%);
  --ok: #4f8f1f;
  --focus: #795fce;
  --letterbox: #0b0d0c;
  --shadow: 0 10px 30px rgb(40 30 10 / 15%);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --good-ink: #4a6800;
    --bg: #f7f4ec;
    --bg-raised: #fffdf8;
    --surface: #efeadf;
    --surface-2: #e6e1d4;
    --surface-hover: #e2dccd;
    --border: #d9d4c6;
    --text: #20241f;
    --text-muted: #5f665c;
    --text-faint: #6c7268;
    --accent: #e2483b;
    --accent-strong: #c8392d;
    --accent-ink: #fff;
    --accent-soft: rgb(226 72 59 / 12%);
    --ok: #4f8f1f;
    --focus: #795fce;
    --letterbox: #0b0d0c;
    --shadow: 0 10px 30px rgb(40 30 10 / 15%);
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; min-height: 100vh; background: var(--bg); line-height: 1.45; font-size: 14px; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(12px);
}
.topbar-start, .topbar-end { display: flex; align-items: center; gap: 6px; flex: none; }
.topbar-start { min-width: calc(var(--sidebar-w) - 12px); }
.topbar-end { gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: transparent; color: var(--text);
}
.icon-btn:hover { background: var(--surface-hover); }
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 12px; font-weight: 900; font-size: 23px; letter-spacing: -1.2px; line-height: 1; }
.logo-mark { width: 24px; height: 24px; transform: rotate(-7deg); }
.logo .js { color: var(--accent); }
.beta-badge { font: 700 9px/1 var(--font-mono); letter-spacing: 1px; color: var(--good-ink); border: 1px solid color-mix(in srgb, var(--good-ink) 55%, transparent); padding: 3px 5px; border-radius: 5px; transform: translateY(-7px); }
.search {
  flex: 1 1 320px; max-width: 640px; min-width: 0; margin: 0 auto; display: flex; align-items: center; min-height: 46px;
  padding: 0 16px 0 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-raised);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search input { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 15px; }
.search input::placeholder { color: var(--text-muted); opacity: 1; }
.search-submit { order: -1; flex: none; display: grid; place-items: center; width: 38px; height: 38px; margin-right: 4px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); }
.search-submit:hover { background: var(--surface-hover); color: var(--text); }
.search-submit svg.icon { width: 20px; height: 20px; }
.search-link { display: none; }
.bell-count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font: 800 11px/18px var(--font-ui); text-align: center; box-shadow: 0 0 0 2px var(--bg);
}
.me { position: relative; }
.me-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: transparent; }
.me-btn .pavatar { width: 36px; height: 36px; border-radius: 11px; transition: box-shadow var(--motion); }
.me-btn:hover .pavatar, .me-btn[aria-expanded="true"] .pavatar { box-shadow: 0 0 0 2px var(--accent); }
.me-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70; display: grid; gap: 2px; width: 264px; padding: 8px;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-raised); box-shadow: var(--shadow);
}
.me-menu-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding: 6px 8px 12px; border-bottom: 1px solid var(--border); }
.me-menu-head .pavatar { width: 44px; height: 44px; border-radius: 13px; }
.me-menu-head > span { display: grid; min-width: 0; }
.me-menu-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.me-menu a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 10px; font-weight: 600; }
.me-menu a:hover { background: var(--surface-hover); }
.me-menu svg.icon { width: 20px; height: 20px; color: var(--text-muted); }
.bell-panel {
  position: absolute; top: calc(var(--header-h) - 4px); right: 12px; z-index: 70; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow: auto;
  padding: 12px; border-radius: var(--radius-lg); background: var(--bg-raised); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.bell-panel ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.bell-panel li { padding: 10px 12px; border-radius: 10px; background: var(--surface); }
.bell-panel li.is-unread { box-shadow: inset 3px 0 0 var(--accent); }
.bell-panel > a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 6px; font-weight: 700; color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text);
}
.btn:hover { background: var(--surface-hover); }
.btn svg.icon { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-primary svg.icon[data-solid], .btn-play svg.icon { fill: currentColor; stroke: none; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.btn[aria-pressed="true"] svg.icon { color: var(--accent); fill: currentColor; }
.avatar-btn { width: 36px; height: 36px; border-radius: 11px; overflow: hidden; border: 0; padding: 0; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; }
@media (pointer: coarse), (max-width: 719.98px) {
  .btn-sm { min-height: 44px; }
}

/* ---------- Shell: navigation rail, content, phone tab bar ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
  container: rail / inline-size;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 10px 32px; scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent;
}
.nav-group { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text); font-size: 14px; font-weight: 500; }
.nav-item > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--surface-hover); }
.nav-item[aria-current="page"] { background: var(--surface); font-weight: 700; }
.nav-item[aria-current="page"] svg.icon { color: var(--accent); }
.nav-item svg.icon { width: 22px; height: 22px; }
.nav-sep { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.nav-heading { padding: 4px 12px 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.nav-dot { width: 22px; height: 22px; display: grid; place-items: center; flex: none; }
.nav-dot::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--cat, var(--accent)); transform: rotate(-7deg); }
.nav-more { color: var(--text-muted); }
.sidebar-footer { padding: 16px 12px 0; color: var(--text-faint); font-size: 12px; line-height: 1.5; }
.sidebar-footer a { display: inline-flex; align-items: center; min-height: 28px; margin-right: 10px; color: var(--text-muted); }
.sidebar-footer a:hover { color: var(--text); }
.sidebar-footer p { margin-top: 6px; }
/* The icon rail: the same entries, icons over short labels. */
@container rail (max-width: 140px) {
  .nav-item { flex-direction: column; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 2px; font-size: 11px; font-weight: 600; text-align: center; }
  .nav-item > span:last-child { max-width: 100%; }
  .nav-item[aria-current="page"] { font-weight: 800; }
  .nav-extra, .nav-sep { display: none; }
}
.content { min-width: 0; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 16px var(--gutter) 64px; }
@media (min-width: 1024px) {
  body.sidebar-collapsed .shell, body.rail-watch .shell { grid-template-columns: var(--sidebar-mini-w) minmax(0, 1fr); }
  body.sidebar-collapsed .sidebar, body.rail-watch .sidebar { padding-inline: 6px; }
}
@media (min-width: 720px) and (max-width: 1023.98px) {
  :root { --gutter: 24px; }
  .shell { grid-template-columns: var(--sidebar-mini-w) minmax(0, 1fr); }
  .sidebar { padding-inline: 6px; }
  .topbar-start { min-width: 0; }
}
/* The whole rail over the page (tablets, and game pages on wide screens). */
body.sidebar-open .sidebar {
  position: fixed; z-index: 60; left: 0; top: var(--header-h); bottom: 0; width: var(--sidebar-w); height: auto;
  padding: 12px 10px 32px; background: var(--bg); box-shadow: var(--shadow); border-right: 1px solid var(--border);
}
@media (min-width: 1024px) {
  body.sidebar-collapsed.sidebar-open:not(.rail-watch) .sidebar { position: sticky; width: auto; box-shadow: none; border: 0; }
}
.tabbar { display: none; }

/* ---------- Section heads, chips, segmented controls ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; padding: 8px 0 16px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.15; }
.page-head p { color: var(--text-muted); margin-top: 4px; }
.section { margin-top: 28px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.section-title::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); transform: rotate(-7deg); }
.section-title.is-live::before { border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); transform: none; }
.section-sub { color: var(--text-muted); font-size: 14px; }
.shelf { margin-top: 36px; }
.shelf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 14px; }
.shelf-head .section-sub { flex: 1 1 auto; }
.see-all, .shelf-head > a.small {
  margin-left: auto; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 6px 0 12px;
  border-radius: 12px; color: var(--text-muted); font-size: 14px; font-weight: 600;
}
.see-all:hover, .shelf-head > a.small:hover { background: var(--surface-hover); color: var(--text); }
.see-all svg.icon { width: 18px; height: 18px; }
.pill-count { padding: 2px 10px; border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 700; }
.pill-count.is-accent { background: var(--accent-soft); color: var(--accent); }
.chips {
  position: sticky; top: var(--header-h); z-index: 30; display: flex; gap: 8px; margin: 0 -2px; padding: 10px 2px; overflow-x: auto;
  background: var(--bg); scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.chip:hover { background: var(--surface-hover); }
.chip[aria-current="page"], .chip[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 700; }
.chip svg.icon { width: 18px; height: 18px; }
.chip-collection { font-weight: 700; }
.chips.subgenres { position: static; z-index: auto; padding: 0 2px 10px; }
.chips.subgenres .chip { min-height: 36px; font-size: 13px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); }
.seg > a, .seg > button {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text); font-size: 14px; font-weight: 600;
}
.seg > a:hover, .seg > button:hover { background: var(--surface-hover); }
.seg > [aria-current="page"], .seg > [aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 700; }
.seg > [aria-current="page"]:hover, .seg > [aria-pressed="true"]:hover { background: var(--text); }
@media (pointer: coarse), (max-width: 719.98px) {
  .chip, .seg > a, .seg > button { min-height: 44px; }
}
/* Section tabs (game pages, profiles, the channel). */
.tabs { display: flex; gap: 4px; margin-top: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px;
  color: var(--text-muted); font-size: 15px; font-weight: 600; white-space: nowrap; border-radius: 10px 10px 0 0;
}
.tabs a:hover { color: var(--text); background: var(--surface-hover); }
.tabs a[aria-current="page"], .tabs a[aria-selected="true"] { color: var(--text); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.tabs .tab-count { padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 700; }
.tab-panel { padding-top: 20px; scroll-margin-top: calc(var(--header-h) + 12px); }
.tab-panel:focus { outline: none; }
[data-tabs]:not(.is-tabbed) .tab-panel + .tab-panel { margin-top: 12px; border-top: 1px solid var(--border); }
.tab-panel > h2.sr-tab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-tabs]:not(.is-tabbed) .tab-panel > h2.sr-tab { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-bottom: 12px; font-size: 20px; font-weight: 800; }

/* ---------- Game cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 28px 18px; }
@media (min-width: 1700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); } }
.card { position: relative; display: grid; align-content: start; gap: 10px; min-width: 0; }
.card-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  transition: box-shadow var(--motion);
}
.card-thumb img, .card-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-thumb video { opacity: 0; transition: opacity 200ms ease; }
.card.is-previewing .card-thumb video.is-playing { opacity: 1; }
.card:hover .card-thumb { box-shadow: 0 0 0 2px var(--text); }
.thumb-badge {
  position: absolute; z-index: 2; right: 8px; bottom: 8px; padding: 3px 7px; border-radius: 6px;
  background: rgb(0 0 0 / 78%); color: #fff; font: 700 12px/1.2 var(--font-mono); letter-spacing: .3px;
}
.thumb-badge.rating { left: 8px; right: auto; }
.thumb-tag {
  position: absolute; z-index: 2; left: 8px; top: 8px; padding: 4px 8px; border-radius: 6px; background: var(--lime); color: var(--lime-ink);
  font: 800 12px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
}
.thumb-tag.is-daily { background: var(--orange); }
.thumb-tag.is-live { background: var(--accent); color: var(--accent-ink); }
.thumb-play {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); opacity: 0;
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  background: rgb(0 0 0 / 74%); color: #fff; font-weight: 700; transition: opacity var(--motion), transform var(--motion);
}
.thumb-play svg.icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.card:hover .thumb-play, .card:focus-within .thumb-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.card.is-previewing .thumb-play { opacity: 0; }
.thumb-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); font: 800 42px var(--font-ui);
  background: repeating-conic-gradient(var(--surface) 0 25%, var(--surface-2) 0 50%) 0 0 / 28px 28px;
}
.thumb-progress { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(0 0 0 / 60%); }
.thumb-progress > span { display: block; height: 100%; background: var(--accent); }
.card-meta { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.card-text { flex: 1; min-width: 0; display: grid; align-content: start; gap: 2px; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.card-title a { display: -webkit-box; min-height: 24px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-title a:hover { text-decoration: underline; text-underline-offset: 2px; }
.card-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.card-category { display: inline-flex; align-items: center; min-height: 24px; color: var(--text-muted); }
.card-category:hover { color: var(--text); }
.card-stat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-stat svg.icon { width: 14px; height: 14px; }
.card-stat.is-likes svg.icon { color: var(--accent); }
.card-avatar { flex: none; width: 36px; height: 36px; border-radius: 11px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--text-muted); }
.card-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Compact cards: the "Up next" rail of game pages. */
.compact-list { display: grid; gap: 12px; }
.card.compact { grid-template-columns: 168px minmax(0, 1fr); align-items: start; gap: 12px; }
.card.compact .card-thumb { border-radius: 10px; }
.card.compact .card-title { font-size: 14px; }
.card.compact .card-sub { font-size: 12px; }
.card.compact .thumb-play { padding: 6px 10px; font-size: 13px; }
/* Rows that scroll sideways (home shelves). */
.shelf-row {
  --per-view: 4;
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--per-view) - 1) * 16px) / var(--per-view)); gap: 16px; overflow-x: auto;
  padding: 2px 2px 12px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent;
}
.shelf-row > * { scroll-snap-align: start; }
@media (min-width: 1600px) { .shelf-row { --per-view: 5; } }
@media (max-width: 1023.98px) { .shelf-row { --per-view: 3; } }

/* ---------- Pages ---------- */
.pager { display: flex; justify-content: center; gap: 12px; margin: 40px 0 0; }
.empty { display: grid; place-items: center; gap: 12px; text-align: center; padding: 72px 16px; color: var(--text-muted); }
.empty h2 { color: var(--text); font-size: 22px; font-weight: 800; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--surface); border-left: 4px solid var(--accent); }
.notice.ok { border-left-color: var(--ok); }
.notice.warn { border-left-color: var(--orange); }
.notice.error { border-left-color: var(--danger); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.caught-up {
  display: grid; justify-items: center; gap: 12px; margin-top: 48px; padding: 40px 16px; border: 1px dashed var(--border);
  border-radius: 20px; text-align: center;
}
.caught-up-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--lime); color: var(--lime-ink); transform: rotate(-7deg); }
.caught-up-mark svg.icon { width: 30px; height: 30px; stroke-width: 2.4; }
.caught-up h2 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.caught-up p { max-width: 520px; color: var(--text-muted); font-size: 15px; }
.caught-up .row { justify-content: center; }

/* ---------- Game (watch) page ---------- */
.content:has(.watch) { max-width: none; }
.watch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 8px; margin: 0 auto; max-width: 1880px; }
.watch.is-theater { grid-template-columns: minmax(0, 1fr); }
.watch.is-theater .watch-secondary { grid-column: 1; }
body:has(.watch.is-theater) .shell { grid-template-columns: minmax(0, 1fr); }
body:has(.watch.is-theater) .sidebar { display: none; }
.content:has(.watch.is-theater) { padding-inline: 0; }
.watch.is-theater { padding-top: 0; }
.watch.is-theater .watch-head, .watch.is-theater .watch-actions, .watch.is-theater .watch-tabs,
.watch.is-theater .watch-secondary { margin-inline: 24px; }
/* The game page (rail-watch): "Up next" beside the player on wide screens. */
@media (min-width: 1200px) {
  body.rail-watch .watch:not(.is-theater) { grid-template-columns: minmax(0, 1fr) clamp(320px, 25vw, 402px); align-items: start; }
  body.rail-watch .watch:not(.is-theater) .watch-secondary { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
.watch-head { display: flex; align-items: center; gap: 14px; margin-top: 18px; min-width: 0; }
.game-icon { position: relative; flex: none; width: 56px; height: 56px; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.game-icon img, .game-icon .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 24px; }
.watch-head > div { display: grid; gap: 4px; min-width: 0; }
.watch-title { font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; overflow-wrap: anywhere; }
.watch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--text-muted); font-size: 14px; }
.watch-meta a { display: inline-flex; align-items: center; min-height: 28px; }
.watch-meta a:hover { color: var(--text); }
.channel-link { gap: 5px; color: var(--text); font-weight: 700; }
.channel-link svg.icon { width: 16px; height: 16px; color: var(--good-ink); }
.watch-meta .card-stat svg.icon { width: 15px; height: 15px; }
.watch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.watch-actions .btn { background: var(--surface-2); }
.watch-actions .btn:hover { background: var(--surface-hover); }
.watch-actions .btn[aria-pressed="true"] { background: var(--accent-soft); }
.like-group { display: inline-flex; border-radius: 999px; background: var(--surface-2); }
.like-group .btn { background: transparent; }
.like-group .btn:first-child { padding-right: 14px; border-radius: 999px 0 0 999px; }
.like-group .btn + .btn { padding: 0 16px 0 14px; border-radius: 0 999px 999px 0; box-shadow: inset 1px 0 0 var(--border); }
.like-group .btn:hover { background: var(--surface-hover); }
.like-group .btn[aria-pressed="true"] { background: var(--accent-soft); }
.watch-secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-content: start; }
.watch-secondary h2 { grid-column: 1 / -1; font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.watch-box { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface); }
.watch-box .stats { font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 16px; }
.fact { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface); }
.fact dt { color: var(--text-muted); font-size: 13px; }
.fact dd { margin: 0; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--text-muted); }
a.tag:hover { color: var(--text); background: var(--surface-hover); }
.tag.rating { color: var(--text); font-weight: 700; }
.prose { margin-top: 10px; overflow-wrap: anywhere; line-height: 1.6; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote { margin: 0 0 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose code { font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.prose h3, .prose h4 { font-size: 15px; margin: 14px 0 6px; }
.lead { font-size: 16px; font-weight: 600; line-height: 1.5; }
.panel-title { font-size: 18px; font-weight: 800; letter-spacing: -.2px; margin: 24px 0 10px; }
.online-box { display: grid; gap: 14px; padding: 18px; border-radius: var(--radius-lg); background: var(--surface); }
.online-now { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.online-now::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.join-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.join-form .field { flex: 1 1 200px; max-width: 280px; }
.join-form input { text-transform: uppercase; letter-spacing: 4px; font-family: var(--font-mono); font-weight: 700; }

/* ---------- Player ---------- */
.player { position: relative; --player-controls-h: 60px; }
.player-stage {
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--letterbox);
  border-radius: var(--radius); overflow: hidden; min-height: 240px;
}
.watch.is-theater .player-stage { border-radius: 0; }
.player-viewport { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 192px; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100dvh - var(--header-h) - 128px); }
.player[data-portrait="true"] .player-viewport { aspect-ratio: 4 / 3; }
.player[data-scale="responsive"] .player-viewport { aspect-ratio: auto; height: calc(100dvh - var(--header-h) - 128px); min-height: 300px; }
.watch.is-theater .player-viewport { max-height: calc(100dvh - var(--header-h) - var(--player-controls-h)); }
.watch.is-theater .player[data-scale="responsive"] .player-viewport { height: calc(100dvh - var(--header-h) - var(--player-controls-h)); }
.player-viewport iframe { border: 0; display: block; background: #000; color-scheme: normal; }
.player-cover { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; }
.player-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(1.1); }
.player-cover-inner { position: relative; display: grid; justify-items: center; gap: 12px; text-align: center; padding: 16px; }
.player-play {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 18px; font-weight: 800; box-shadow: var(--shadow);
  transition: transform var(--motion);
}
.player-play:hover { transform: scale(1.04); background: var(--accent-strong); }
.player-play svg.icon { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.player-note { color: #e9ece4; font-size: 13px; text-shadow: 0 1px 2px rgb(0 0 0 / 60%); }
.player-status { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; pointer-events: none; color: #fff; font-weight: 600; }
.player-status:empty { display: none; }
.player-status .box { pointer-events: auto; display: grid; justify-items: center; gap: 10px; background: rgb(0 0 0 / 70%); padding: 18px 22px; border-radius: 12px; max-width: 90%; text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgb(255 255 255 / 25%); border-top-color: var(--accent); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-controls { position: relative; z-index: 5; display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #0b0f0d; color: #e9ece4; }
.player-controls button { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; min-width: 48px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 13px; font-weight: 600; }
.player-controls button:hover { background: rgb(255 255 255 / 12%); }
.player-controls button[aria-pressed="true"] { background: rgb(255 255 255 / 16%); }
.player-controls svg.icon { width: 20px; height: 20px; }
.player-controls .spacer { flex: 1; }
.player-controls .label { display: none; }
@media (min-width: 720px) { .player-controls .label { display: inline; } }
/* The way back to the main site's home, for a player with no page around it (the Casino):
   the mark on the left of the controls, and the last item of the menu. */
.player-controls .player-home { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 10px;
  border-radius: 8px; color: inherit; font-size: 15px; font-weight: 900; letter-spacing: -.4px; text-decoration: none; }
.player-controls .player-home:hover, .player-controls .player-home:focus-visible { background: rgb(255 255 255 / 12%); }
.player-home .logo-mark { width: 22px; height: 22px; }
.player-menu .player-menu-home { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px;
  color: inherit; font-size: 14px; font-weight: 600; text-decoration: none; }
.player-menu .player-menu-home:hover, .player-menu .player-menu-home:focus-visible { background: rgb(255 255 255 / 12%); }
.player-menu-home .logo-mark { flex: none; width: 16px; height: 16px; }
/* Screen effects: the menu, and the approximation laid over games that do not render them. */
.player-controls [data-cmd="display"][aria-expanded="true"] { background: rgb(255 255 255 / 16%); }
.player-menu { position: absolute; inset: auto 12px 72px auto; z-index: 6; display: grid; gap: 2px; min-width: 220px; max-width: calc(100% - 24px);
  max-height: calc(100% - 84px); overflow: auto; padding: 6px; border-radius: 12px; background: #0b0f0d; color: #e9ece4;
  border: 1px solid rgb(255 255 255 / 14%); box-shadow: var(--shadow); }
.player-menu[hidden], .player-menu button[hidden] { display: none; }
.player-menu [role="group"] { display: grid; gap: 2px; }
.player-menu [role="group"] + [role="group"] { margin-top: 4px; padding-top: 6px; border-top: 1px solid rgb(255 255 255 / 14%); }
.player-menu-title { margin: 0; padding: 4px 12px 2px; font-size: 12px; font-weight: 700; letter-spacing: .02em; opacity: .72; }
.player-filters { position: absolute; width: 0; height: 0; overflow: hidden; }
.player-viewport iframe[data-assist="protan"] { filter: url(#pjs-assist-protan); }
.player-viewport iframe[data-assist="deutan"] { filter: url(#pjs-assist-deutan); }
.player-viewport iframe[data-assist="tritan"] { filter: url(#pjs-assist-tritan); }
.player-menu button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 600; text-align: left; }
.player-menu button::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; opacity: .7; }
.player-menu button[aria-checked="true"]::before { background: var(--lime); border-color: var(--lime); opacity: 1; }
.player-menu button:hover, .player-menu button:focus-visible { background: rgb(255 255 255 / 12%); }
.player-fx { position: absolute; z-index: 2; left: 0; top: 0; pointer-events: none; --fx-row: 4px; --fx-col: 4px;
  --fx-lines: repeating-linear-gradient(to bottom, transparent 0 calc(var(--fx-row) * .55), rgb(0 0 0 / 30%) calc(var(--fx-row) * .55) var(--fx-row));
  --fx-vignette: radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / 45%) 100%); }
.player-fx[data-effect="scanlines"] { background-image: var(--fx-lines); }
.player-fx[data-effect="crt"] { background-image: var(--fx-vignette), var(--fx-lines); box-shadow: inset 0 0 36px rgb(0 0 0 / 55%); }
.player-fx[data-effect="lcd"] { background-image: repeating-linear-gradient(to right, rgb(0 0 0 / 24%) 0 1px, transparent 1px var(--fx-col)),
  repeating-linear-gradient(to bottom, rgb(0 0 0 / 24%) 0 1px, transparent 1px var(--fx-row)); }
@media (max-width: 380px) {
  .player-controls { gap: 2px; padding: 6px 4px; }
  .player-controls button { min-width: 44px; padding: 0 6px; }
}
.player[data-state="idle"] .player-controls [data-cmd="restart"],
.player[data-state="idle"] .player-controls [data-cmd="pause"],
.player[data-state="idle"] .player-controls [data-cmd="mute"] { display: none; }
.player-stage:fullscreen { aspect-ratio: auto; max-height: none; border-radius: 0; width: 100vw; height: 100vh; }
.player-stage:-webkit-full-screen { aspect-ratio: auto; max-height: none; border-radius: 0; width: 100vw; height: 100vh; }
.player.is-expanded .player-stage { position: fixed; inset: 0; z-index: 90; aspect-ratio: auto; max-height: none; border-radius: 0; }
.player-stage:fullscreen .player-viewport, .player-stage:-webkit-full-screen .player-viewport,
.player.is-expanded .player-viewport { aspect-ratio: auto; height: auto; max-height: none; min-height: 0; }
body.player-expanded { overflow: hidden; }
.rotate-hint { position: absolute; z-index: 4; left: 50%; top: 12px; transform: translateX(-50%); background: rgb(0 0 0 / 70%); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
/* Phones play like an app: the game takes the whole screen in its orientation; the
   controls slide in from a handle at the top (player.js, phonePlay). */
.player-handle, .player-rotate[hidden] { display: none; }
.player.is-phone-play .player-stage { grid-template-rows: minmax(0, 1fr); }
/* The game stays out of the camera cutout and the rounded corners: the viewport is padded
   by the safe area, so games get a frame they can fill edge to edge. */
.player.is-phone-play .player-stage .player-viewport {
  aspect-ratio: auto; height: 100dvh; max-height: none; min-height: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.player.is-phone-play .player-controls {
  position: absolute; z-index: 6; inset: 0 0 auto; padding-top: max(6px, env(safe-area-inset-top));
  padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  background: rgb(11 15 13 / 94%); transform: translateY(-105%); transition: transform var(--motion);
}
.player.is-phone-play.is-controls-open .player-controls { transform: none; }
/* Only a thin grip shows, and it fades after a few seconds (is-handle-quiet); the touch
   area around it stays 96 × 44 px and sits over the cutout band where there is one. */
.player.is-phone-play .player-handle {
  display: block; position: absolute; z-index: 7; top: 0; left: 50%; width: 96px; height: max(44px, env(safe-area-inset-top));
  padding: 0; border: 0; background: none; transform: translateX(-50%); transition: top var(--motion);
}
.player.is-phone-play .player-handle::after {
  content: ""; position: absolute; left: 28px; right: 28px; top: 7px; height: 5px; border-radius: 3px;
  background: rgb(255 255 255 / 75%); box-shadow: 0 0 0 1px rgb(0 0 0 / 30%), 0 1px 4px rgb(0 0 0 / 40%); transition: opacity 600ms;
}
.player.is-phone-play.is-handle-quiet:not(.is-controls-open) .player-handle::after { opacity: .28; }
.player.is-phone-play.is-controls-open .player-handle { top: calc(var(--player-controls-h) + max(6px, env(safe-area-inset-top))); }
/* The controls are at the top there: the menu opens below them, not behind them, and
   the way home stays next to the controls (first here, last in the menu above them). */
.player.is-phone-play .player-menu { inset: calc(var(--player-controls-h) + max(6px, env(safe-area-inset-top)) + 6px) max(12px, env(safe-area-inset-right)) auto auto;
  max-height: calc(100% - var(--player-controls-h) - max(6px, env(safe-area-inset-top)) - 18px); }
.player.is-phone-play .player-menu .player-menu-home-group { order: -1; margin: 0 0 4px; padding: 0 0 6px; border-top: 0;
  border-bottom: 1px solid rgb(255 255 255 / 14%); }
.player-rotate {
  position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; padding: 24px;
  background: rgb(5 7 6 / 94%); color: #fff; font-size: 20px; font-weight: 700; line-height: 1.35; text-align: center;
}

/* ---------- Profiles, the channel and category tiles ---------- */
.hero { margin-bottom: 8px; }
.hero-banner {
  position: relative; height: 220px; border-radius: 20px; overflow: hidden;
  background: radial-gradient(90% 180% at 0% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%),
    radial-gradient(70% 160% at 100% 100%, color-mix(in srgb, var(--lime) 22%, transparent), transparent 60%), var(--surface);
}
.hero-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero-banner:has(img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(14 19 17 / 72%), rgb(14 19 17 / 0%) 55%); }
.hero-banner.is-mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.hero-banner.is-mosaic span { position: relative; overflow: hidden; }
.hero-banner.is-mosaic img { filter: saturate(1.1) brightness(.8); }
.hero-caption { position: absolute; z-index: 1; right: 14px; bottom: 12px; padding: 4px 8px; border-radius: 6px; background: rgb(0 0 0 / 72%); color: #e9ece4; font-size: 12px; }
.hero-head { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; margin-top: -56px; padding: 0 24px; }
.hero-avatar {
  position: relative; flex: none; display: grid; place-items: center; width: 128px; height: 128px; border-radius: 32px; overflow: hidden;
  background: var(--surface-2); box-shadow: 0 0 0 6px var(--bg); color: var(--text);
}
.hero-avatar .pavatar, .hero-avatar img { width: 100%; height: 100%; border-radius: 0; }
.hero-avatar .logo-mark { width: 64px; height: 64px; }
.hero-body { flex: 1 1 380px; min-width: 0; display: grid; gap: 8px; padding-top: 64px; }
.hero-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hero-title h1 { font-size: 32px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; overflow-wrap: anywhere; }
.hero-sub { color: var(--text-muted); font-size: 15px; }
.hero-text { max-width: 680px; font-size: 15px; }
.hero-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--text-muted); font-size: 14px; }
.hero-stats strong { color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 64px; }
.level-pill {
  padding: 4px 9px; border-radius: 7px; background: var(--lime); color: var(--lime-ink);
  font: 800 13px/1.2 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.verified-mark { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--lime) 18%, transparent); color: var(--good-ink); font-size: 13px; font-weight: 700; }
.verified-mark svg.icon { width: 16px; height: 16px; }
.xp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; max-width: 520px; }
.xp-line .xp-label { font: 800 13px/1 var(--font-mono); letter-spacing: .05em; color: var(--good-ink); }
.xp-line .xp-bar { flex: 1 1 160px; width: auto; margin: 0; }
.xp-line .xp-numbers { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.badge-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.badge-card { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 14px; background: var(--surface); }
.badge-glyph { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--lime); color: var(--lime-ink); transform: rotate(-7deg); flex: none; }
.badge-glyph svg.icon { width: 20px; height: 20px; }
.badge-card:nth-child(4n+2) .badge-glyph { background: var(--orange); }
.badge-card:nth-child(4n+3) .badge-glyph { background: var(--accent); color: var(--accent-ink); }
.badge-card:nth-child(4n+4) .badge-glyph { background: var(--ok); }
.badge-card strong { display: block; font-size: 14px; }
.badge-card small { display: block; color: var(--text-muted); font-size: 12px; }
.channel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding-top: 8px; }
.channel-tile { --hue: 8; position: relative; overflow: hidden; display: grid; align-content: end; gap: 2px; min-height: 120px; padding: 14px 16px;
  border-radius: var(--radius-lg); color: #fff; background: linear-gradient(135deg, hsl(var(--hue) 62% 42%), hsl(calc(var(--hue) + 40) 70% 26%)); }
.channel-tile:hover { color: #fff; box-shadow: 0 10px 24px hsl(var(--hue) 70% 30% / 45%); }
.channel-tile strong { font-size: 17px; font-weight: 800; }
.channel-tile .muted { color: rgb(255 255 255 / 85%); font-size: 13px; }
.channel-tile .channel-avatar { position: absolute; right: -6px; top: -16px; font: 900 84px/1 var(--font-ui); opacity: .2; color: #fff; background: none; width: auto; height: auto; }
.channel-tile:nth-child(8n+2) { --hue: 200; } .channel-tile:nth-child(8n+3) { --hue: 140; } .channel-tile:nth-child(8n+4) { --hue: 270; }
.channel-tile:nth-child(8n+5) { --hue: 34; } .channel-tile:nth-child(8n+6) { --hue: 320; } .channel-tile:nth-child(8n+7) { --hue: 175; } .channel-tile:nth-child(8n+8) { --hue: 230; }
/* Category colors (rail dots). */
.cat-arcade { --cat: #fa695d; } .cat-board { --cat: #a9c94f; } .cat-cards { --cat: #f9a75a; } .cat-casino { --cat: #e5b94f; }
.cat-puzzle { --cat: #7cc6f2; } .cat-sports { --cat: #9fd86b; } .cat-strategy { --cat: #b49cf4; } .cat-platformer { --cat: #f28fc6; }
.cat-action { --cat: #ff8a5c; } .cat-casual { --cat: #6fd6c4; } .cat-word { --cat: #e3b93f; } .cat-racing { --cat: #ff6b6b; }

/* ---------- Documents and forms ---------- */
.doc { max-width: 820px; margin: 0 auto; padding: 24px 0 48px; }
.doc h1 { font-size: 30px; font-weight: 800; letter-spacing: -.6px; margin-bottom: 6px; }
.doc h2 { font-size: 20px; margin: 28px 0 8px; }
.doc h3 { font-size: 16px; margin: 20px 0 6px; }
.doc p, .doc li { color: var(--text); line-height: 1.65; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 12px; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
.doc th, .doc td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.form { display: grid; gap: 16px; max-width: 640px; }
.form.wide { max-width: 860px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 600; }
.field .hint { color: var(--text-muted); font-size: 13px; }
.field .error { color: var(--danger); font-size: 13px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--text);
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 28px; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.form > .btn, .form > button { justify-self: start; }
fieldset { border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px 16px; margin: 0; }
legend { padding: 0 6px; font-weight: 700; }
.auth { max-width: 440px; margin: 40px auto; padding: 28px; border-radius: 20px; background: var(--bg-raised); border: 1px solid var(--border); }
.auth h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.auth .form { margin-top: 18px; }
.btn-google { width: 100%; min-height: 48px; background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 600; }
.btn-google:hover { background: #f2f2f2; color: #1f1f1f; }
.btn-google svg.icon { width: 20px; height: 20px; }
.auth-or { text-align: center; margin: 14px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Staff and settings panels ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); background: var(--bg-raised); }
table.list tr:last-child td { border-bottom: 0; }
.state { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.state-live, .state-published, .state-approved, .state-ready, .state-active { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.state-in_review, .state-validating, .state-pending, .state-processing { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--orange); }
.state-invalid, .state-rejected, .state-suspended, .state-removed, .state-changes_requested { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; background: var(--bg-raised); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 120ms; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.settings-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.settings-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: 14px; background: var(--surface); font-weight: 700; }
.settings-link:hover { background: var(--surface-hover); }
.settings-link svg.icon { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { display: grid; gap: 14px; margin-top: 64px; padding: 24px 0 8px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-prefs { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-prefs .seg > button { min-height: 34px; padding: 0 14px; font-size: 13px; color: var(--text-muted); }
.footer-prefs .seg > button[aria-pressed="true"] { color: var(--bg); }

/* ---------- Phones ---------- */
@media (max-width: 719.98px) {
  :root { --header-h: 56px; --gutter: 16px; }
  body { font-size: 16px; }
  .topbar { gap: 4px; padding: 0 max(6px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
  .topbar-start { min-width: 0; gap: 0; }
  .nav-toggle, .search, .beta-badge { display: none; }
  .search-link { display: inline-grid; }
  .logo { padding: 0 4px; font-size: 22px; }
  .topbar-end { gap: 2px; }
  .btn-signin { padding: 0 14px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .content { padding: 12px var(--gutter) 32px; }
  .content:has(.watch) { padding-inline: 12px; }
  .page-head h1 { font-size: 26px; }
  .section-title { font-size: 19px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .card-title { font-size: 16px; }
  .card-sub { font-size: 14px; }
  .shelf { margin-top: 28px; }
  /* A title with a note and a link: the link beside the title, the note under both. */
  .shelf-head:has(> .section-sub):has(> .see-all) { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .shelf-head:has(> .section-sub) > .see-all { grid-column: 2; grid-row: 1; }
  .shelf-head:has(> .see-all) > .section-sub { grid-column: 1 / -1; }
  .shelf-row { grid-auto-columns: 78%; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .card.compact { grid-template-columns: 148px minmax(0, 1fr); }
  .watch { padding-top: 0; }
  .watch-head { margin-top: 14px; gap: 12px; }
  .game-icon { width: 44px; height: 44px; border-radius: 13px; }
  .watch-title { font-size: 24px; letter-spacing: -.4px; }
  .watch-actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .watch-actions .btn { flex-direction: column; gap: 4px; min-height: 60px; padding: 6px 2px; border-radius: 14px; font-size: 12px; white-space: normal; text-align: center; line-height: 1.15; }
  .watch-actions > .like-group { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; }
  .watch-actions > .like-group .btn:first-child { padding: 6px 2px; border-radius: 14px 0 0 14px; }
  .watch-actions > .like-group .btn + .btn { padding: 6px 2px; border-radius: 0 14px 14px 0; }
  .tabs { margin-inline: -12px; padding-inline: 4px; }
  .tabs a { min-height: 46px; padding: 0 12px; font-size: 14px; }
  .hero-banner { height: 132px; border-radius: 16px; }
  .hero-head { margin-top: -44px; padding: 0 12px; gap: 12px; }
  .hero-avatar { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 0 0 5px var(--bg); }
  .hero-body { flex-basis: 100%; padding-top: 0; }
  .hero-title h1 { font-size: 26px; }
  .hero-actions { padding-top: 0; }
  .footer { margin-top: 48px; }
}
@media (max-width: 379.98px) {
  .watch-actions > .btn .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 720px) {
  .player[data-portrait="true"]:not([data-scale="responsive"]) .player-viewport { aspect-ratio: 4 / 5; max-height: calc(72dvh - var(--player-controls-h)); }
  .player-controls [data-cmd="theater"] { display: none; }
  .player-stage { border-radius: 0; margin: 0 -12px; }
}
/* The phone tab bar: phones, and phones held sideways before playing (Play goes full
   screen, phonePlay). */
@media (max-width: 719.98px), (pointer: coarse) and (max-height: 500px) {
  .shell, body.sidebar-collapsed .shell, body.rail-watch .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .nav-toggle { display: none; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-raised) 96%, transparent); backdrop-filter: saturate(160%) blur(12px);
  }
  body.player-expanded .tabbar, body:has(.player.is-phone-play) .tabbar { display: none; }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: var(--tabbar-h); color: var(--text-muted); font-size: 11px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
  .tab:hover { color: var(--text); }
  .tab-icon { position: relative; display: grid; place-items: center; width: 54px; height: 30px; border-radius: 15px; }
  .tab-icon svg.icon { width: 24px; height: 24px; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab[aria-current="page"] { color: var(--text); font-weight: 800; }
  .tab[aria-current="page"] .tab-icon { background: var(--surface-2); }
  .tab .pavatar { width: 26px; height: 26px; border-radius: 8px; }
  .tab .bell-count { top: -3px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; box-shadow: 0 0 0 2px var(--bg-raised); }
  .tab-play { color: var(--text); font-weight: 800; }
  .tab-play-icon {
    display: grid; place-items: center; width: 54px; height: 54px; margin-top: -24px; border-radius: 18px;
    background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px var(--bg-raised), 0 10px 24px rgb(0 0 0 / 45%); transform: rotate(-7deg);
  }
  .tab-play-icon svg.icon { width: 26px; height: 26px; fill: currentColor; stroke: none; transform: rotate(7deg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* ---------- Players: leaderboards, levels, achievements (doc 20) ---------- */
.pavatar { width: 24px; height: 24px; border-radius: 6px; image-rendering: pixelated; flex: none; background: var(--surface-2); }
.handle { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; min-height: 32px; }
.handle .pavatar { width: 28px; height: 28px; border-radius: 9px; }
.handle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.handle:hover span { text-decoration: underline; text-underline-offset: 2px; }
.badge-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: color-mix(in srgb, var(--lime) 22%, transparent); color: var(--good-ink); white-space: nowrap; }
.badge-chip.big { font-size: 13px; padding: 4px 10px; }
.verified-chip { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--good-ink); white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 0 6px; min-height: 32px; color: var(--text-faint); cursor: pointer; font: inherit; }
.link-btn:hover { color: var(--text); }
.play-panels { display: grid; gap: 16px; }
.champions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.champion { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--lime) 16%, transparent), transparent 60%), var(--bg-raised); }
.champion .pavatar { width: 52px; height: 52px; border-radius: 15px; }
.champion > span { display: grid; gap: 2px; min-width: 0; }
.champion strong { font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
.champion-label { font: 800 11px/1.2 var(--font-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--good-ink); }
.champion-value { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.champion.is-empty { display: grid; color: var(--text-muted); }
.panel-head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
table.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.board th, table.board td { padding: 10px; text-align: left; vertical-align: middle; }
table.board th { padding-block: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
table.board td { border-top: 1px solid var(--border); }
table.board td.num, table.board th.num { text-align: right; font-weight: 700; }
table.board td.rank { width: 64px; padding-left: 14px; font-weight: 700; color: var(--text-muted); }
table.board tr.is-me td { background: var(--accent-soft); }
table.board td.when { width: 1%; white-space: nowrap; text-align: right; }
table.board .handle .pavatar { width: 34px; height: 34px; border-radius: 11px; }
.medal { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-size: 15px; font-weight: 800; color: var(--lime-ink); transform: rotate(-7deg); }
.medal.gold { background: var(--lime); }
.medal.silver { background: #cfd8d2; }
.medal.bronze { background: var(--orange); }
.you-row { margin: 12px 0; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--bg-raised)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); display: grid; gap: 8px; }
.you-row p { margin: 0; font-weight: 700; }
.you-row > .btn { justify-self: start; }
.you-row.is-sticky { position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; }
.you-row .near { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.you-row .near li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.you-row .near li.is-me { font-weight: 800; }
.you-row .near .num { font-variant-numeric: tabular-nums; }
.board-filters { margin: 8px 0 12px; gap: 8px; flex-wrap: wrap; }
.board-filters select.input { width: auto; min-width: 150px; }
.pager.numbered { flex-wrap: wrap; gap: 6px; }
.pager.numbered a[aria-current="page"] { background: var(--text); color: var(--bg); }
.world-title { font-size: 13px; margin: 14px 0 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }
.level-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.level-btn { width: 100%; min-height: 56px; display: grid; gap: 2px; text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.level-btn:hover { background: var(--surface-hover); }
.level.is-done .level-btn { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.level.is-locked .level-btn { opacity: .55; }
.level.is-locked .level-name::before { content: "🔒 "; }
.level-name { font-weight: 700; }
.level-stars { color: #f5c84c; letter-spacing: 2px; min-height: 1em; }
.achievement-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.achievement { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); opacity: .72; }
.achievement.is-unlocked { opacity: 1; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 45%, transparent); }
.achievement img, .achievement-icon { width: 44px; height: 44px; border-radius: 12px; image-rendering: pixelated; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--good-ink); }
.achievement > span { display: grid; gap: 2px; min-width: 0; }
.comments { margin-top: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.comment-list.replies { margin: 10px 0 0 36px; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-body { margin: 4px 0 0 38px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.comment-form { margin-bottom: 14px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { position: relative; padding: 12px 36px 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow); }
.toast p { margin: 0 0 4px; }
.toast .row { margin: 8px 0 0; }
.toast-title { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.toast-close { position: absolute; top: 6px; right: 8px; min-width: 32px; min-height: 32px; border: 0; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in 180ms ease-out; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Notifications ("Activity"): a list grouped by day. */
.activity { display: grid; gap: 28px; max-width: 860px; }
.activity-day h2 { margin-bottom: 10px; color: var(--text-muted); font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.activity-item { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface); }
.activity-item.is-unread { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.activity-item.is-unread::after { content: ""; position: absolute; left: 5px; top: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.activity-glyph { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); transform: rotate(-7deg); }
.activity-glyph svg.icon { width: 21px; height: 21px; transform: rotate(7deg); }
.activity-glyph.is-achievement, .activity-glyph.is-badge { background: color-mix(in srgb, var(--lime) 22%, transparent); color: var(--good-ink); }
.activity-glyph.is-new_levels, .activity-glyph.is-channel_game { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--orange); }
.activity-glyph.is-reply { background: var(--surface-2); color: var(--text); }
.activity-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.activity-text a { font-weight: 600; line-height: 1.4; }
.activity-text a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.activity-text a:focus-visible { outline: none; }
.activity-item:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.activity-text .muted { font-size: 13px; }
.activity-thumb { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.activity-thumb img, .activity-thumb .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 20px; }

/* Home rows and "Play next": small game cards built by scripts (feed.js). */
.mini-card { position: relative; display: grid; align-content: start; gap: 4px; min-width: 0; }
.mini-thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; margin-bottom: 6px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); font: 800 32px/1 var(--font-ui); color: var(--text-faint); transition: box-shadow var(--motion);
}
.mini-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-card:hover .mini-thumb { box-shadow: 0 0 0 2px var(--text); }
.mini-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.mini-card .muted.small { font-size: 13px; }
.event-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-top: 12px; min-height: 56px; padding: 14px 18px;
  border-radius: var(--radius-lg); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 28%, var(--bg-raised)), var(--bg-raised)); border: 1px solid var(--border);
}
.event-banner strong { font-size: 16px; }
.event-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.rankings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.rankings-grid .panel + .panel { margin-top: 0; }
.ranked-games, .records, .rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ranked-games .ranked-game { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 0; }
.thumb-box { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface); }
.thumb-box > img { width: 100%; height: 100%; object-fit: cover; }
.ranked-game > span { display: grid; gap: 2px; }
.records li, .rank-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rank-pill { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-weight: 800; font-variant-numeric: tabular-nums; }
.xp-bar { display: block; width: min(320px, 100%); height: 10px; border: 0; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 8px 0; appearance: none; accent-color: var(--lime); }
.xp-bar::-webkit-progress-bar { background: var(--surface-2); }
.xp-bar::-webkit-progress-value { background: var(--lime); border-radius: 6px; }
.xp-bar::-moz-progress-bar { background: var(--lime); border-radius: 6px; }
.badge-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, 56px); gap: 8px; }
.avatar-pick { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; }
.avatar-pick input { position: absolute; opacity: 0; }
.avatar-pick .pavatar { width: 48px; height: 48px; border-radius: 12px; }
.avatar-pick:has(input:checked) { border-color: var(--accent); }
.avatar-pick:has(input:focus-visible) { outline: 2px solid var(--focus); }
.share-result { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 32px 0; }
.share-card { width: min(640px, 100%); border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-raised); }
.share-card > .thumb-box { border-radius: 0; }
.share-body { display: grid; justify-items: center; gap: 4px; padding: 16px; }
.share-body .pavatar { width: 64px; height: 64px; border-radius: 18px; margin-top: -48px; border: 4px solid var(--bg-raised); }
.share-handle { font-weight: 800; font-size: 18px; margin: 0; }
.share-value { font-size: 40px; font-weight: 900; margin: 0; color: var(--good-ink); font-variant-numeric: tabular-nums; }
.inspector { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; display: grid; gap: 2px; }
.inspector li { padding: 4px 6px; border-radius: 4px; background: var(--surface); overflow-wrap: anywhere; }
.inspector li.is-problem { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); }
.doc.wide { max-width: 980px; }
@media (max-width: 719.98px) {
  table.board .when { display: none; }
  table.board td, table.board th { padding-inline: 8px; }
  table.board td.rank { width: 52px; padding-left: 10px; }
  .activity-item { gap: 12px; padding: 12px; }
  .activity-thumb { width: 72px; }
}

/* Toasts stay above the phone tab bar. */
@media (max-width: 719.98px), (pointer: coarse) and (max-height: 500px) {
  .toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
}

/* ---------- Online play ---------- */
.tag.online { background: color-mix(in srgb, var(--lime) 30%, var(--surface)); color: var(--good-ink); font-weight: 700; }
.mp-panel { position: absolute; inset: auto 12px 72px auto; z-index: 6; width: min(340px, calc(100% - 24px)); max-height: calc(100% - 96px); overflow: auto;
  display: grid; gap: 8px; justify-items: start; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--bg-raised) 94%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.mp-panel .spinner { justify-self: center; }
.player-controls .mp-toggle { min-width: 48px; height: 48px; justify-content: center; }
.player-controls .mp-toggle[aria-expanded="true"] { background: rgb(255 255 255 / 16%); }
.mp-panel button { min-width: 48px; min-height: 48px; }
.mp-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.mp-title { margin: 0; font-weight: 800; font-size: 16px; }
.mp-code { margin: 0; font: 900 28px/1 var(--font-mono); letter-spacing: 6px; color: var(--good-ink); }
.mp-players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; }
.mp-players li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-players li > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tutorial-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tutorial-card { display: grid; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--border);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg-raised); }
.tutorial-card strong { font-size: 17px; }
.tutorial-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.doc pre { margin: 8px 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  overflow-x: auto; font: 13px/1.5 var(--font-mono); }
.doc :not(pre) > code { padding: 1px 5px; border-radius: 5px; background: var(--surface); font: 0.92em var(--font-mono); }

/* ---------- Categories, sub-genres and play modes ---------- */
.category-text { max-width: 72ch; margin: 0 0 8px; }
.mode-choice { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mode-choice .player-play { padding: 12px 20px; font-size: 16px; }
.mode-choice .player-play svg.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.mode-choice .player-play[data-mode="solo"] svg.icon { fill: currentColor; stroke: none; }
@media (max-width: 560px) {
  .player-cover-inner:has(.mode-choice) { gap: 8px; padding: 12px; }
  .mode-choice { flex-direction: column; align-items: stretch; gap: 8px; }
  .mode-choice .player-play { justify-content: center; min-height: 44px; padding: 8px 16px; font-size: 15px; }
  .mode-choice .player-play svg.icon { width: 18px; height: 18px; }
}
/* Before Play on a phone the whole poster shows (a 16:9 box) with the Play buttons over it,
   and the title stays above the fold; the game itself then plays full screen. */
@media (max-width: 720px) {
  .player[data-state="idle"] .player-viewport { aspect-ratio: 16 / 9; height: auto; min-height: 232px; max-height: none; }
}
.tag-picker { display: grid; gap: 8px; }
.tag-picker legend { font-weight: 600; padding: 0 4px; }
.tag-picker .hint { margin: 0; }
.tag-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.tag-option { align-items: center; font-size: 14px; }
.tag-option input { margin-top: 0; }
.tag-option:has(input:disabled) { opacity: .5; }

/* ---------- Daily challenge banner ---------- */
.daily-banner {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px;
  min-height: 168px; padding: 22px 26px; border-radius: 20px; color: #fff; background: #0b0f1a;
  box-shadow: 0 0 0 1px var(--border); transition: box-shadow var(--motion);
}
.daily-banner:hover { box-shadow: 0 0 0 2px var(--orange), 0 0 28px color-mix(in srgb, var(--orange) 35%, transparent); }
.daily-media { position: absolute; inset: 0 0 0 auto; width: 62%; z-index: -2; }
.daily-media img, .daily-media .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform 600ms ease; }
.daily-banner:hover .daily-media img { transform: scale(1.05); }
.daily-banner::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #0b0f1a 0%, #0b0f1a 38%, rgb(11 15 26 / 70%) 60%, rgb(11 15 26 / 15%) 100%),
    radial-gradient(80% 140% at 0% 0%, color-mix(in srgb, var(--orange) 30%, transparent), transparent 60%); }
.daily-body { display: grid; justify-items: start; gap: 8px; max-width: 560px; }
.daily-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--orange); color: #1d1000;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.daily-badge svg.icon { width: 16px; height: 16px; }
.daily-title { font-size: clamp(22px, 2.6vw, 32px); font-weight: 900; line-height: 1.05; letter-spacing: -.4px; }
.daily-text { color: rgb(255 255 255 / 78%); font-size: 14px; }
.daily-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.daily-xp, .daily-timer { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.daily-xp { background: var(--lime); color: #142000; }
.daily-timer { background: rgb(255 255 255 / 14%); font-family: var(--font-mono); font-weight: 700; }
.daily-timer svg.icon { width: 15px; height: 15px; }
.daily-play { align-self: end; }
@media (max-width: 640px) {
  .daily-banner { grid-template-columns: 1fr; padding: 18px; min-height: 0; }
  .daily-media { width: 100%; opacity: .45; }
  .daily-banner::before { background: linear-gradient(0deg, #0b0f1a 30%, rgb(11 15 26 / 55%)); }
  .daily-play { justify-self: start; }
}

.panel.daily .daily-banner { margin-top: 8px; }
.doc table { display: block; max-width: 100%; overflow-x: auto; }
.doc { overflow-wrap: anywhere; }
.doc pre { max-width: 100%; }
/* Touch targets of at least 24 x 24 CSS pixels (WCAG 2.2, 2.5.8). */
.panel li a { display: inline-flex; align-items: center; min-height: 24px; }
.muted.small a { display: inline-flex; align-items: center; min-height: 24px; }
.daily-banner { -webkit-tap-highlight-color: transparent; }
@media (max-width: 400px) {
  .daily-title { font-size: 22px; }
}

/* ---------- Discovery, recommendations and celebrations (doc 26) ---------- */
/* Discover: one game per screen, snapping vertically, below the top bar. */
.content:has(.discover) { padding-top: 0; padding-bottom: 0; }
.content:has(.discover) > .footer { display: none; }
.discover { margin-inline: calc(-1 * var(--gutter)); }
.discover-feed {
  position: relative; height: calc(100dvh - var(--header-h)); overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none;
}
.discover-feed::-webkit-scrollbar { display: none; }
.discover-loading { height: 100%; display: grid; place-items: center; }
.discover-item, .discover-end {
  position: relative; height: 100%; overflow: hidden; display: grid; place-items: center; padding: 16px 24px;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.discover-item:focus, .discover-end:focus { outline: none; }
.discover-item:focus-visible, .discover-end:focus-visible { outline: 3px solid var(--focus); outline-offset: -6px; border-radius: 18px; }
.discover-glow { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.discover-glow img { position: absolute; left: 50%; top: 42%; width: min(110%, 1400px); height: 78%; transform: translate(-50%, -50%);
  object-fit: cover; filter: blur(48px) saturate(1.3); opacity: .42; }
:root[data-theme="light"] .discover-glow img { opacity: .28; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .discover-glow img { opacity: .28; } }
.discover-card { position: relative; z-index: 1; display: grid; gap: 14px; width: min(100%, 1040px, calc((100dvh - var(--header-h) - 250px) * 16 / 9)); min-width: min(100%, 280px); }
.discover-media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px;
  background: var(--letterbox); box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.discover-media img, .discover-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.discover-media video { opacity: 0; transition: opacity 240ms ease; }
.discover-media video.is-playing { opacity: 1; }
.discover-letter { font: 900 64px/1 var(--font-ui); color: var(--text-faint); }
.discover-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 20px; }
.discover-info { display: grid; gap: 6px; min-width: 0; }
.discover-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.discover-category { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; }
.discover-reason { color: var(--good-ink); font-weight: 700; }
.discover-reason::before, .mini-reason::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 2px;
  background: var(--accent); transform: rotate(-7deg); vertical-align: 1px; }
.discover-title { font-size: clamp(20px, 2.4vw, 30px); font-weight: 900; line-height: 1.15; letter-spacing: -.4px; overflow-wrap: anywhere; }
.discover-title a { display: inline-block; min-height: 24px; }
.discover-summary { max-width: 70ch; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.discover-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.discover-play { min-height: 48px; padding: 0 22px; font-size: 16px; font-weight: 800; }
.discover-play svg.icon { fill: currentColor; stroke: none; }
.discover-act { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 56px; min-height: 52px;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  font-size: 11px; font-weight: 700; line-height: 1.1; }
.discover-act:hover { background: var(--surface-hover); }
.discover-act svg.icon { width: 22px; height: 22px; }
.discover-act[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.discover-act[aria-pressed="true"] svg.icon { color: var(--accent); fill: currentColor; }
.discover-act .label:empty { display: none; }
.discover-end-box { display: grid; justify-items: center; gap: 12px; max-width: 460px; padding: 32px 24px; border-radius: 20px; text-align: center;
  border: 1px solid var(--border); background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--bg-raised); }
.discover-end-box svg.icon { width: 48px; height: 48px; color: var(--good-ink); }
.discover-end-box h2 { font-size: 24px; letter-spacing: -.3px; }
.discover-end-box p { color: var(--text-muted); }
.discover-end-box .btn { min-height: 48px; }
@media (max-width: 720px) {
  .discover-item, .discover-end { padding: 12px; }
  .discover-body { grid-template-columns: minmax(0, 1fr); }
  .discover-play { flex: 1 1 140px; }
}
@media (max-width: 400px) {
  .discover-play { flex-basis: 100%; }
  .discover-act { flex: 1 1 0; }
}
/* Short landscape screens: the preview beside the text. */
@media (max-height: 520px) and (min-width: 560px) {
  .discover-card { width: min(100%, 1040px); grid-template-columns: minmax(0, 1.25fr) minmax(220px, 1fr); align-items: center; }
  .discover-body { grid-template-columns: minmax(0, 1fr); }
  .discover-summary { display: none; }
}

/* Phones: the feed is immersive, like the design's moments feed: the tab bar steps
   aside and the feed reaches the bottom of the screen. */
@media (max-width: 719.98px), (pointer: coarse) and (max-height: 500px) {
  body:has(.discover) { padding-bottom: 0; }
  body:has(.discover) .tabbar { display: none; }
  body:has(.discover) .toasts { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .discover-item, .discover-end { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* Home rows and "Play next": the reason under each game, previews on small cards. */
.mini-reason { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--good-ink); }
.mini-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 200ms ease; }
.mini-card.is-previewing .mini-thumb video.is-playing { opacity: 1; }
.next-panel { margin-top: 12px; padding: 12px 14px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-raised); }
.watch.is-theater .next-panel { margin-inline: 24px; }
.next-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.next-head h2 { font-size: 17px; font-weight: 800; }
.next-close { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-muted); font-size: 22px; line-height: 1; }
.next-close:hover { background: var(--surface-hover); color: var(--text); }
.next-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
@media (max-width: 560px) {
  .next-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(180px, 72%); overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
}

/* Streak, XP and celebrations. */
.streak { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 999px; font-size: 13px; font-weight: 800;
  background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--text); }
.streak svg.icon { width: 18px; height: 18px; fill: var(--orange); stroke: none; }
.xp-gain { color: var(--good-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.fx-burst { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.fx-pop { position: fixed; z-index: 70; width: 160px; height: 160px; pointer-events: none; }
.fx-badge { position: absolute; z-index: 3; left: 50%; top: 24%; max-width: calc(100% - 24px); padding: 8px 18px; border-radius: 999px;
  transform: translate(-50%, -50%); background: rgb(11 15 13 / 84%); color: #fff; font-size: clamp(16px, 3vw, 26px); font-weight: 900; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; box-shadow: 0 0 0 2px var(--fx-ring, #f5c84c), 0 8px 24px rgb(0 0 0 / 45%); }
.fx-badge.fx-rank, .fx-badge.fx-level { --fx-ring: #d9ed96; }
.fx-badge.fx-daily { --fx-ring: #f9a75a; }
.fx-badge.fx-best { --fx-ring: #fa695d; }
.fx-badge.is-moving { animation: fx-badge 1200ms ease-out both; }
@keyframes fx-badge {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.75); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  30% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -64%); }
}

/* Break reminder: a small note at the top of the stage; the game keeps running. */
.break-note { position: absolute; z-index: 6; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 24px); padding: 10px 10px 10px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.break-note p { margin: 0; }
.break-note .btn { flex: none; min-height: 40px; }
@media (max-width: 480px) { .break-note { width: calc(100% - 24px); font-size: 13px; } }

/* ---------- Social portal: home feed, Live, the channel, the library ---------- */
.home-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; }
.feed-tabs > a { gap: 8px; min-height: 40px; padding: 0 18px; font-size: 15px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.streak-line { margin: 0; }
/* Bubbles: round posters with a ring, like stories, leading to play. */
.bubbles { margin: 0 calc(-1 * var(--gutter)) 4px; }
.bubble-row { list-style: none; margin: 0; padding: 4px var(--gutter) 10px; display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
.bubble-row::-webkit-scrollbar { display: none; }
.bubble-row > li { flex: none; scroll-snap-align: start; }
.bubble { position: relative; display: grid; justify-items: center; gap: 6px; width: 92px; text-align: center; -webkit-tap-highlight-color: transparent; }
.bubble-ring {
  display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 200deg, var(--accent), var(--orange), var(--lime), var(--accent));
}
.bubble.is-updated .bubble-ring { background: conic-gradient(from 200deg, var(--lime), var(--ok), var(--lime)); }
.bubble.is-daily .bubble-ring { background: conic-gradient(from 200deg, var(--orange), #ffd27a, var(--orange)); }
.bubble.is-event .bubble-ring { background: var(--accent); }
.bubble.is-popular .bubble-ring { background: var(--border); }
.bubble-face { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 3px var(--bg); }
.bubble-face img, .bubble-face .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 28px; }
.bubble:hover .bubble-face img { transform: scale(1.06); }
.bubble-face img { transition: transform 300ms ease; }
.bubble-tag {
  position: absolute; top: 72px; left: 50%; transform: translateX(-50%); padding: 2px 7px; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); font: 800 10px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 0 0 2px var(--bg);
}
.bubble.is-updated .bubble-tag { background: var(--lime); color: var(--lime-ink); }
.bubble.is-daily .bubble-tag { background: var(--orange); color: var(--lime-ink); }
.bubble.is-popular .bubble-tag { background: var(--surface-2); color: var(--text-muted); }
.bubble-name { width: 100%; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
/* Record cards: a record of the week over its game's poster. */
.record-card { display: grid; align-content: start; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.record-media { position: relative; display: block; aspect-ratio: 16 / 7; overflow: hidden; background: var(--surface-2); }
.record-media img, .record-media .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.record-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 82%), rgb(0 0 0 / 0%) 70%); }
.record-value { position: absolute; z-index: 1; left: 14px; bottom: 8px; color: #fff; font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.record-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.record-body .card-sub { gap: 4px 10px; }
.record-body .handle { font-weight: 700; }
.record-beat { justify-self: start; }
.record-beat svg.icon { width: 18px; height: 18px; }
/* Rooms: games to play online now. */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.room { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border-radius: 14px; background: var(--surface); }
.room-thumb { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.room-thumb img, .room-thumb .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 20px; }
.room-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.room-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; }
.room-title:hover { text-decoration: underline; text-underline-offset: 2px; }
.room-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 13px; }
.room-online { display: inline-flex; align-items: center; gap: 6px; color: var(--good-ink); font-size: 13px; font-weight: 700; }
.room-online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.room .btn { flex: none; }
/* Games hub links (Explore). */
.hub-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; margin-bottom: 8px; }
.hub-link { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; border-radius: 14px; background: var(--surface); }
.hub-link:hover { background: var(--surface-hover); }
.hub-link svg.icon { flex: none; width: 26px; height: 26px; color: var(--accent); }
.hub-link span { display: grid; min-width: 0; }
.hub-link strong { font-size: 15px; }
.hub-link small { color: var(--text-muted); font-size: 13px; }
.panel-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
/* Event cards (Live, the channel). */
.event-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 12px; }
.event-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.event-date { flex: none; display: grid; justify-items: center; align-content: center; width: 58px; height: 64px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); line-height: 1.05; }
.event-month { font: 800 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.event-day { font-size: 26px; font-weight: 800; }
.event-body { flex: 1; display: grid; gap: 4px; min-width: 0; }
.event-body h3 { font-size: 16px; }
.event-body h3 a:hover { text-decoration: underline; text-underline-offset: 2px; }
.event-body .muted { font-size: 13px; }
.event-when { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; font-weight: 700; }
.event-when svg.icon { width: 16px; height: 16px; color: var(--orange); }
.event-thumb { position: relative; flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.event-thumb img, .event-thumb .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 20px; }
.live-help { margin-top: 36px; max-width: 820px; }
/* The channel: its avatar and its posts. */
.channel-mark { background: var(--surface-2); }
.channel-mark .logo-mark { color: var(--text); }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 760px; }
.post { display: grid; gap: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--bg-raised); }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-head p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.post-avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); }
.post-avatar .logo-mark { width: 22px; height: 22px; color: var(--text); }
.post-time { font-size: 13px; }
.post-time::before { content: "· "; }
.post-media { position: relative; display: block; max-width: 600px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--surface); }
.post-media img, .post-media .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-body { display: grid; gap: 8px; }
.post-body h3 { font-size: 18px; }
.post-body h3 a:hover { text-decoration: underline; text-underline-offset: 2px; }
.end-note { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; color: var(--text-muted); }
.end-note svg.icon { width: 18px; height: 18px; color: var(--good-ink); }
.about-text { max-width: 720px; margin: 0 0 16px; }
/* The library's "you" card. */
.you-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 20px; border-radius: 20px; border: 1px solid var(--border);
  background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), var(--bg-raised); }
.you-card > .pavatar { width: 72px; height: 72px; border-radius: 20px; }
.you-body { flex: 1 1 280px; display: grid; gap: 8px; min-width: 0; }
.you-body h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; overflow-wrap: anywhere; }
.you-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb-progress progress { display: block; width: 100%; height: 100%; border: 0; appearance: none; background: transparent; accent-color: var(--accent); }
.thumb-progress progress::-webkit-progress-bar { background: transparent; }
.thumb-progress progress::-webkit-progress-value { background: var(--accent); }
.thumb-progress progress::-moz-progress-bar { background: var(--accent); }
.page-search { display: none; max-width: none; margin: 0 0 16px; }
@media (max-width: 719.98px) {
  .page-search { display: flex; }
  .hub-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hub-link { align-items: flex-start; gap: 10px; min-height: 0; padding: 12px; }
  .hub-link svg.icon { width: 22px; height: 22px; }
  .hub-link strong { font-size: 15px; }
  .home-head { margin-bottom: 12px; }
  .feed-tabs { width: 100%; }
  .feed-tabs > a { flex: 1; justify-content: center; padding: 0 10px; }
  .bubble { width: 80px; }
  .bubble-ring { width: 74px; height: 74px; }
  .bubble-tag { top: 63px; }
  .room { padding: 10px; }
  .room-thumb { width: 84px; }
  .event-thumb { display: none; }
  .post { padding: 14px; }
}
/* Profiles: showcase, records and activity. */
.showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.profile-tabs { margin-top: 36px; }
.game-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-cell > span:last-child { display: grid; min-width: 0; }
.game-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-cell:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.game-cell-thumb { position: relative; flex: none; width: 80px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.game-cell-thumb img, .game-cell-thumb .thumb-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 18px; }
.post-media .record-value { font-size: 40px; }
.post-media.is-wide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 70%), rgb(0 0 0 / 0%) 55%); }
.post-media .thumb-tag, .post-media .thumb-badge, .post-media .record-value { z-index: 2; }
.post-head .pavatar { width: 40px; height: 40px; border-radius: 12px; }
.panel-name { font-size: 18px; font-weight: 800; }
.board-panel { padding: 0; overflow: hidden; }
.board-panel > .panel-head { padding: 16px 16px 4px; }
.board-panel > .you-row { margin: 12px 16px; }
.board-panel > .row { padding: 4px 16px 16px; }
.board-panel table.board th:first-child, .board-panel table.board td:first-child { padding-left: 16px; }
.board-panel table.board th:last-child, .board-panel table.board td:last-child { padding-right: 16px; }
.levels-panel { margin-top: 20px; }
.levels-panel .panel-title { margin: 0; }
.achievements-panel .panel-head { margin-bottom: 10px; }
@media (max-width: 719.98px) {
  .profile-tabs { margin-top: 28px; }
  .post-media .record-value { font-size: 30px; }
  .game-cell-thumb { width: 64px; }
}
/* A card's title link covers its text block, so the whole card is one large target;
   the category link sits above it. */
.card-text { position: relative; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:focus-visible { outline: none; }
.card-text:has(.card-title a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.card-category, .card-sub .handle { position: relative; z-index: 1; }
/* Touch screens: every control at least 44 px tall. */
@media (pointer: coarse), (max-width: 719.98px) {
  .feed-tabs > a, .chips.subgenres .chip, .footer-prefs .seg > button, .footer-links a, .comments .link-btn { min-height: 44px; }
}
.record-body { position: relative; }
.record-beat { position: relative; z-index: 1; }
.room-text { position: relative; }
.room-title::after { content: ""; position: absolute; inset: 0; }
.event-body { position: relative; }
.event-body h3 a::after { content: ""; position: absolute; inset: 0; }
@media (min-width: 720px) and (max-width: 1023.98px) {
  .hero-actions { flex-basis: 100%; padding: 0 0 0 152px; }
}
.board-panel .table-wrap { border: 0; border-radius: 0; border-top: 1px solid var(--border); }
.board-panel table.board tbody tr:first-child td { border-top: 1px solid var(--border); }

/* ---------- The Casino world (doc 32 §3) ---------- */
/* The Casino's age sign (13+), on its page and on its doors. */
.age-mark { flex: none; display: inline-flex; align-items: center; margin-left: auto; padding: 1px 7px; border-radius: 6px;
  border: 1px solid currentColor; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .02em; line-height: 1.4; }
.nav-door .age-mark { min-width: auto; overflow: visible; }
.channel-tile .age-mark { margin-left: 8px; color: #fff; vertical-align: 2px; }
.casino-tile { --hue: 42; background: radial-gradient(circle at 80% 20%, rgb(255 210 120 / 30%), transparent 45%),
  linear-gradient(135deg, #3a1d52, #12081c); }
/* The casino host's page: no portal shell, the whole screen, inside the safe area. */
.casino-page { min-height: 100dvh; background: radial-gradient(ellipse at 50% 0%, #3a1846 0%, #140a1c 55%, #07040b 100%) fixed;
  color: #f4ecff; }
.casino { min-height: 100dvh; display: grid; place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.casino-door { display: grid; justify-items: center; gap: 16px; max-width: 520px; padding: 32px 20px; text-align: center; }
.casino-door h1 { font-size: 28px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; }
.casino-door p { color: rgb(244 236 255 / 82%); line-height: 1.5; }
.casino-door .btn { min-height: 48px; padding: 0 22px; }
.casino-sign { display: inline-flex; align-items: center; gap: 12px; }
.casino-sign-name { font-size: 30px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: #ffe08a;
  text-shadow: 0 0 6px rgb(255 190 80 / 80%), 0 0 18px rgb(255 120 60 / 60%), 0 0 36px rgb(240 60 140 / 45%); }
.casino-sign .age-mark { margin: 0; color: #ff9db8; font-size: 13px; box-shadow: 0 0 10px rgb(255 120 160 / 45%); }
.casino-notice { max-width: 440px; font-size: 16px; }
.casino-signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: #ffe08a;
  font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.casino-signin:hover { color: #fff; }
.casino-back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: rgb(244 236 255 / 78%);
  text-decoration: underline; text-underline-offset: 3px; }
.casino-back:hover { color: #fff; }
/* The player fills the page: the game above, the controls below (casino.js sets
   data-state="open" once the door opens). */
.casino[data-state="open"] { display: block; place-items: normal; padding: 0; }
.casino-player { width: 100%; }
.casino-player .player-stage { height: 100dvh; min-height: 0; border-radius: 0; background: #050307;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.casino-player .player-viewport, .casino-player[data-scale="responsive"] .player-viewport,
.casino-player[data-portrait="true"] .player-viewport { aspect-ratio: auto; height: auto; max-height: none; min-height: 0; }
.casino-player.is-phone-play .player-stage { padding: 0; }
.casino-player .player-cover-inner { gap: 14px; }
.casino-game-title { font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / 70%); }
.casino-game-title:empty { display: none; }
@media (max-height: 480px) {
  .casino-door { gap: 10px; padding: 16px; }
  .casino-sign-name { font-size: 24px; }
  .casino-player .player-cover-inner { gap: 8px; padding: 8px; }
}
