/* touch grass later — cozy, quiet, fast to scan. */

:root {
  color-scheme: light;
  --bg: #f4eee2;
  --blob-1: rgba(141, 178, 121, 0.30);
  --blob-2: rgba(234, 172, 128, 0.24);
  --surface: #fffaf2;
  --surface-2: #f9f2e6;
  --surface-3: #f1e7d6;
  --border: #e6dac7;
  --border-strong: #d5c5ab;
  --ink: #2d2822;
  --ink-2: #554c41;
  --muted: #6b6053;
  --grass: #44723b;
  --grass-ink: #2e5626;
  --grass-soft: #e1edd7;
  --clay: #984a27;
  --clay-soft: #f6e1d1;
  --plum: #5f5199;
  --plum-soft: #ebe5f6;
  --join: #5865f2;
  --join-hover: #4752c4;
  --join-ink: #ffffff;
  --online: #2b9653;
  --focus: #b8662f;
  --av-s: 34%;
  --av-l: 85%;
  --av-ink-l: 30%;
  --wood: #b98258;
  --wood-dark: #8a5a3a;
  --curtain: #e9b9a1;
  --curtain-fold: #d79d82;
  --cat: #e0a066;
  --cat-dark: #b5733f;
  --cat-ink: #5a3a22;
  --mug: #fbf6ec;
  --g1: #7fae62;
  --g2: #6a9a50;
  --g3: #8fbf70;
  --night-o: 0;
  --day-o: 1;
  --land-o: .5;
  --garland-o: .7;
  --grain-opacity: .07;
  --shadow-sm: 0 1px 2px rgba(74, 56, 34, 0.06);
  --shadow: 0 1px 2px rgba(74, 56, 34, 0.05), 0 10px 24px -12px rgba(74, 56, 34, 0.22);
  --shadow-lg: 0 30px 70px -24px rgba(48, 34, 18, 0.45);
  --radius: 18px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Nunito", ui-rounded, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --topbar-h: 68px;
  --side-w: 206px;
  --detail-w: 420px;
  --col-gap: 22px;
  --gx: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1a1713;
    --blob-1: rgba(120, 165, 98, 0.13);
    --blob-2: rgba(232, 150, 92, 0.11);
    --surface: #24201b;
    --surface-2: #2a251f;
    --surface-3: #332d25;
    --border: #393228;
    --border-strong: #4b4236;
    --ink: #f3eadc;
    --ink-2: #d2c5b2;
    --muted: #a99b87;
    --grass: #9ccb8f;
    --grass-ink: #bfe3b2;
    --grass-soft: #2a3925;
    --clay: #eaa57d;
    --clay-soft: #3c2b20;
    --plum: #bcb0f2;
    --plum-soft: #302a45;
    --online: #57cf83;
    --focus: #eaa57d;
    --av-s: 26%;
    --av-l: 30%;
    --av-ink-l: 84%;
    --wood: #6e4a33;
    --wood-dark: #523523;
    --curtain: #6e3f34;
    --curtain-fold: #5a322a;
    --cat: #c4844f;
    --cat-dark: #95602f;
    --cat-ink: #3a2414;
    --mug: #e9e1d2;
    --g1: #3f6b44;
    --g2: #335a39;
    --g3: #4d7d50;
  --night-o: 1;
  --day-o: 0;
  --land-o: .62;
  --garland-o: 1;
    --night-o: 1;
    --day-o: 0;
    --land-o: .62;
    --garland-o: 1;
    --grain-opacity: .05;
    --blob-1: rgba(240, 168, 92, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1713;
  --blob-1: rgba(120, 165, 98, 0.13);
  --blob-2: rgba(232, 150, 92, 0.11);
  --surface: #24201b;
  --surface-2: #2a251f;
  --surface-3: #332d25;
  --border: #393228;
  --border-strong: #4b4236;
  --ink: #f3eadc;
  --ink-2: #d2c5b2;
  --muted: #a99b87;
  --grass: #9ccb8f;
  --grass-ink: #bfe3b2;
  --grass-soft: #2a3925;
  --clay: #eaa57d;
  --clay-soft: #3c2b20;
  --plum: #bcb0f2;
  --plum-soft: #302a45;
  --online: #57cf83;
  --focus: #eaa57d;
  --av-s: 26%;
  --av-l: 30%;
  --av-ink-l: 84%;
  --wood: #6e4a33;
  --wood-dark: #523523;
  --curtain: #6e3f34;
  --curtain-fold: #5a322a;
  --cat: #c4844f;
  --cat-dark: #95602f;
  --cat-ink: #3a2414;
  --mug: #e9e1d2;
  --g1: #3f6b44;
  --g2: #335a39;
  --g3: #4d7d50;
  --grain-opacity: .05;
  --blob-1: rgba(240, 168, 92, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* a column, so the grass and footer sit at the bottom even when there are only a few results */
  display: flex; flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at -10% -12%, var(--blob-1), transparent 70%),
    radial-gradient(760px 520px at 110% 108%, var(--blob-2), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p { margin: 0; }
h3, h4 { font-size: inherit; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }
img { display: block; }

:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 10px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px;
  text-decoration: none; font-weight: 700;
}
.skip:focus { top: 12px; }

kbd {
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 700;
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 7px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  color: var(--ink-2);
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.topbar__inner {
  max-width: 1520px; margin: 0 auto;
  min-height: var(--topbar-h);
  padding: 10px max(var(--gx), env(safe-area-inset-right)) 10px max(var(--gx), env(safe-area-inset-left));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand search actions";
  align-items: center;
  gap: 20px;
}

.brand {
  grid-area: brand;
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  border-radius: 12px;
}
.brand__mark { width: 34px; height: 34px; }
.brand__tile { fill: var(--grass-soft); }
.brand__stem { stroke: var(--grass); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.brand__leaf { fill: var(--grass); }
.brand__leaf--b { fill: color-mix(in srgb, var(--grass) 72%, var(--clay)); }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand__name em { font-style: italic; font-weight: 600; color: var(--clay); }

.search {
  grid-area: search;
  position: relative;
  width: 100%; max-width: 620px;
  justify-self: center;
}
.search__icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round;
  pointer-events: none;
}
.search__input {
  width: 100%; height: 48px;
  padding: 0 52px 0 46px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font-size: 16px; font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.search__input::placeholder { color: var(--muted); font-weight: 600; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__input:hover { border-color: var(--border-strong); }
.search__input:focus { outline: none; border-color: var(--grass); box-shadow: 0 0 0 4px var(--grass-soft); }
.search__kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search__clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--surface-3);
  display: grid; place-items: center;
}
.search__clear svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; }
.search__clear:hover { background: var(--border); }
.search.has-text .search__kbd { display: none; }

.topbar__actions { grid-area: actions; justify-self: end; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  height: 40px; padding: 0 14px 0 11px;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 700; font-size: 14px;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--ink); background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--round { width: 40px; padding: 0; justify-content: center; }

.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- layout ---------- */

.layout {
  width: 100%; max-width: 1520px; margin: 0 auto;
  padding: 18px max(var(--gx), env(safe-area-inset-right)) 32px max(var(--gx), env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--col-gap);
  align-items: start;
}

.side { display: none; }

@media (min-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (min-width: 1200px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--detail-w); }
  .side { display: block; }
  /* the search box lines up with the results column under it */
  .topbar__inner { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--detail-w); gap: var(--col-gap); }
  .search { justify-self: stretch; max-width: none; }
  .brand__name { font-size: 20px; }
}

/* ---------- sidebar ---------- */

.side {
  position: sticky; top: calc(var(--topbar-h) + 18px);
  max-height: calc(100vh - var(--topbar-h) - 36px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.side__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side__sep { height: 1px; background: var(--border); margin: 8px 10px; }
.side__btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border: 0; border-radius: 11px;
  background: transparent;
  text-align: left;
  font-weight: 600; font-size: 14px;
  color: var(--ink-2);
  transition: background .12s, color .12s;
}
.side__btn:hover { background: color-mix(in srgb, var(--surface-3) 70%, transparent); color: var(--ink); }
.side__btn[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); font-weight: 800;
  box-shadow: inset 3px 0 0 var(--grass), var(--shadow-sm), inset 0 0 0 1px var(--border);
}
.side__btn:focus-visible { outline-offset: -2.5px; }
.side__emoji { width: 20px; text-align: center; font-size: 15px; }
.side__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__count { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- browse column ---------- */

.browse { min-width: 0; }

.intro { display: none; }
@media (max-width: 859px) {
  .intro {
    display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 12px;
    margin-bottom: 12px; padding: 8px 14px 8px 8px;
    border-radius: var(--radius); border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--ink-2); font-weight: 600; font-size: 14px; line-height: 1.4;
  }
  .intro__scene { aspect-ratio: 276 / 182; } /* the compact window's viewBox, reserved before cozy.js draws it */
  .intro__scene .scene { width: 100%; height: auto; display: block; }
}
body.is-searching .intro { display: none; }

.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--grass-ink); font-weight: 800;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}

.browse__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-bottom: 12px;
  min-height: 40px;
}
.browse__meta {
  flex: 1 1 auto; min-width: 0;
  color: var(--muted); font-weight: 600; font-size: 14px;
  overflow-wrap: anywhere;
}
.browse__meta strong { color: var(--ink); font-weight: 800; }

.picker { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.picker select {
  height: 40px; padding: 0 30px 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6053' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 16px;
  color: var(--ink);
  font-weight: 700; font-size: 14px;
  max-width: 100%;
  -webkit-appearance: none; appearance: none;
  cursor: pointer;
}
.picker select:hover { border-color: var(--border-strong); }
.picker--cat select { font-weight: 800; }

@media (min-width: 1200px) {
  .picker--cat { display: none; }
}
@media (max-width: 1199px) {
  .browse__bar { justify-content: space-between; }
  .picker--cat { order: 1; flex: 1 1 0; max-width: 320px; min-width: 0; }
  .picker--cat select { width: 100%; text-overflow: ellipsis; }
  .sort { order: 2; flex: none; }
  .browse__meta { order: 3; flex-basis: 100%; }
}
@media (max-width: 374px) {
  .browse__bar { gap: 8px; }
  .picker select { padding: 0 24px 0 10px; background-position: right 6px center; }
}
@media (max-width: 859px) {
  body:not(.is-searching) .browse__meta { display: none; }
  .sort__label { display: none; }
  /* while searching, results sit right under the search box */
  body.is-searching .picker { display: none; }
  body.is-searching .browse__bar { min-height: 0; margin-bottom: 8px; }
}

/* until app.js has drawn the first results, keep the footer below the fold so nothing jumps (CLS) */
body:not(.is-ready) .grid { min-height: 100vh; }

/* ---------- game cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 12px;
}

.card { position: relative; min-width: 0; container-type: inline-size; }

.card__main {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  text-align: left;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}
.card__main:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card.is-selected .card__main {
  background: color-mix(in srgb, var(--grass-soft) 45%, var(--surface));
  border-color: var(--grass);
  box-shadow: 0 0 0 1.5px var(--grass), var(--shadow);
}

.card__body { min-width: 0; display: grid; gap: 3px; }
.card__name {
  padding-right: 26px;
  font-weight: 800; font-size: 15.5px; line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
  text-wrap: balance;
}
.card__sub {
  display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start;
  gap: 0 8px;
  height: 20px; overflow: hidden; /* one line; a part that doesn't fit drops out whole */
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.card__sub > * { flex: none; white-space: nowrap; }
.card__online {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* wide cards: status and online count share one line */
@container (min-width: 340px) {
  .card__body { grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; }
  .card__name { grid-column: 1 / -1; }
  .card__online { justify-self: end; }
}

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--online) 20%, transparent);
  display: inline-block; flex: none;
}

.card__star {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: color .15s, background .15s, opacity .15s;
}
.card__star svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.card__star[aria-pressed="true"] { color: var(--clay); }
.card__star[aria-pressed="true"] svg { fill: currentColor; }
@media (hover: hover) {
  .card__star:hover { color: var(--clay); background: var(--clay-soft); }
  .card__star[aria-pressed="false"] { opacity: 0; }
  .card:hover .card__star, .card__star:focus-visible, .card.is-selected .card__star, .card:focus-within .card__star { opacity: 1; }
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px 0 8px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 800;
  white-space: nowrap;
  flex: none;
}
.badge svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.badge--official { background: var(--grass-soft); color: var(--grass-ink); }
.badge--fan { background: var(--plum-soft); color: var(--plum); }
.badge--fan svg { stroke-width: 2; }
.badge--none { background: var(--surface-3); color: var(--ink-2); }
.badge--sub { background: var(--clay-soft); color: var(--clay); }
.badge__r { font-weight: 800; letter-spacing: -0.02em; }
.badge--sm { height: 20px; padding: 0 7px 0 5px; gap: 3px; font-size: 12px; }
.badge--sm svg { width: 13px; height: 13px; }

/* ---------- avatars ---------- */

.av {
  width: 46px; height: 46px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface-3);
  flex: none;
}
.av--fb {
  display: grid; place-items: center;
  background: hsl(var(--h) var(--av-s) var(--av-l));
  color: hsl(var(--h) 40% var(--av-ink-l));
  font-family: var(--font-display);
  font-weight: 700; font-size: 17px;
  letter-spacing: -0.02em;
}
.av--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; }
.av--srv { width: 40px; height: 40px; border-radius: 50%; font-size: 15px; }
.av--sub {
  display: grid; place-items: center;
  background: var(--clay-soft); color: var(--clay);
  font-family: var(--font-ui); font-weight: 800; font-size: 14px; letter-spacing: -0.02em;
}

/* ---------- empty ---------- */

.empty {
  margin-top: 8px;
  padding: 34px 24px;
  border-radius: var(--radius);
  border: 1.5px dashed var(--border-strong);
  text-align: center;
  color: var(--ink-2);
}
.empty h2 { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 6px; overflow-wrap: anywhere; }
.empty p { max-width: 460px; margin: 0 auto 14px; overflow-wrap: anywhere; }
.empty__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.empty__suggest { margin: 14px auto 0 !important; font-size: 14px; font-weight: 600; }
.empty__suggest a { color: var(--clay); text-underline-offset: 2px; }

/* ---------- detail panel ---------- */

.detail {
  position: sticky; top: calc(var(--topbar-h) + 18px);
  max-height: calc(100vh - var(--topbar-h) - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.detail:focus { outline: none; }
@media (max-width: 859px) { .detail { display: none; } }

.d-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.d-cat { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--clay); }
.d-title h2 {
  font-family: var(--font-display);
  font-size: 26px; line-height: 1.12; font-weight: 700;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.d-by { font-size: 13.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }

.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 16px 0 0; }
.pill-btn {
  height: 36px; padding: 0 13px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-weight: 700; font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.pill-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.pill-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill-btn[aria-pressed="true"] { color: var(--clay); border-color: color-mix(in srgb, var(--clay) 45%, var(--border)); background: var(--clay-soft); }
.pill-btn[aria-pressed="true"] svg { fill: currentColor; }
.pill-btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill-btn--primary:hover { color: var(--bg); opacity: .9; }

.d-platforms { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.d-noofficial {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin-top: 18px;
  font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--muted);
}

.d-sec { margin-top: 20px; }
.d-sec__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.d-sec__title { display: flex; }
.d-sec__hint { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.d-sec__empty { font-size: 13.5px; color: var(--muted); }

/* server rows */

.srv {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon name name"
    "icon stats actions"
    "body body body";
  column-gap: 11px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
}
.srv + .srv { margin-top: 8px; }
.srv--official {
  background: linear-gradient(180deg, color-mix(in srgb, var(--grass-soft) 55%, var(--surface)), var(--surface-2));
  border-color: color-mix(in srgb, var(--grass) 30%, var(--border));
}
.srv > .av { grid-area: icon; align-self: start; margin-top: 2px; }
.srv__name {
  grid-area: name;
  min-width: 0;
  font-size: 15px; font-weight: 800; line-height: 1.3;
  overflow-wrap: anywhere;
}
.srv__verified { display: inline-block; width: 16px; height: 16px; margin-left: 4px; vertical-align: -2.5px; color: var(--join); }
.srv__stats {
  grid-area: stats;
  min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.srv__stats .online { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 700; }
.srv__lang {
  font-size: 11px; font-weight: 800; letter-spacing: .03em;
  padding: 1px 6px; border-radius: 6px;
  background: var(--surface-3); color: var(--ink-2);
}
.srv__actions { grid-area: actions; display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.srv--inline { grid-template-areas: "icon name actions" "body body body"; }
.srv--inline > .av { align-self: center; margin-top: 0; }
.srv--inline .srv__actions { margin-top: 0; }
.srv--stack { grid-template-areas: "icon name name" "icon actions actions" "body body body"; }
.srv--stack .srv__actions { justify-self: start; }
.srv__body { grid-area: body; margin-top: 10px; display: grid; gap: 7px; }
.srv__blurb { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.srv__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-2);
}
.tag--lfg { background: var(--clay-soft); border-color: transparent; color: var(--clay); font-weight: 800; }
.srv__proof {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  line-height: 1.4;
}
.srv__proof svg { width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.srv--official .srv__proof { color: var(--grass-ink); }
.srv__proof-k { font-weight: 800; }
.srv__proof a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; overflow-wrap: anywhere; }

.btn {
  height: 38px; padding: 0 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 11px;
  border: 0;
  font-weight: 800; font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn--join { background: var(--join); color: var(--join-ink); box-shadow: 0 6px 14px -8px var(--join); }
.btn--join:hover { background: var(--join-hover); }
.btn--join svg { width: 18px; height: 18px; fill: currentColor; }
.btn--copy {
  width: 38px; padding: 0;
  background: var(--surface); color: var(--ink-2);
  border: 1.5px solid var(--border);
}
.btn--copy:hover { border-color: var(--border-strong); color: var(--ink); }
.btn--copy svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--copy.is-done { color: var(--grass-ink); border-color: var(--grass); background: var(--grass-soft); }
.btn--copy.is-done svg { stroke-width: 2.6; }
.btn--sub {
  background: var(--surface); color: var(--clay);
  border: 1.5px solid color-mix(in srgb, var(--clay) 35%, var(--border));
}
.btn--sub:hover { background: var(--clay-soft); }
.btn--sub svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- welcome panel ---------- */

.welcome__art { width: 92px; height: 92px; margin: 2px 0 10px -6px; }
.welcome h2 { font-family: var(--font-display); font-size: 25px; line-height: 1.15; letter-spacing: -0.015em; }
.welcome__lead { margin-top: 6px; color: var(--ink-2); font-weight: 600; }
.legend { margin: 18px 0 0; display: grid; gap: 12px; }
.legend div { display: grid; gap: 5px; }
.legend dt { display: flex; }
.legend dd { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.tips {
  list-style: none; margin: 18px 0 0; padding: 14px 0 0;
  border-top: 1px dashed var(--border-strong);
  display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 22px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.tips li { display: inline-flex; align-items: center; gap: 5px; }
.welcome__saved { margin-top: 18px; }
.welcome__saved h3 { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.mini-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mini {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 12px 0 4px;
  border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-weight: 700; font-size: 13.5px;
}
.mini:hover { border-color: var(--border-strong); }
.mini .av { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; }
.welcome__snap { margin-top: 16px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.welcome__picks { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.welcome__picks .pill-btn { color: var(--clay); border-color: color-mix(in srgb, var(--clay) 35%, var(--border)); background: var(--clay-soft); }
.welcome__picks + .welcome__lists { margin-top: 10px; }
.welcome__lists { margin-top: 16px; font-size: 13.5px; font-weight: 600; color: var(--muted); line-height: 1.6; }
.welcome__lists a { color: var(--ink-2); text-underline-offset: 2px; }

/* ---------- small screens: header, list, bottom sheet ---------- */

.d-close { display: none; }

@media (max-width: 859px) {
  :root { --gx: 16px; }
  .topbar__inner { gap: 12px; }
  .search { max-width: none; }
  .search__kbd { display: none; }
  .icon-btn__label { display: none; }
  #howBtn { width: 40px; padding: 0; justify-content: center; }
  .layout { padding-top: 14px; padding-bottom: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
  .card__main { padding: 10px 12px; }

  .detail {
    display: block;
    position: fixed; z-index: 60;
    left: 0; right: 0; bottom: 0; top: auto;
    max-height: none;
    height: min(92dvh, 92vh);
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
    padding: 12px max(18px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    box-shadow: var(--shadow-lg);
    transform: translateY(104%);
    visibility: hidden;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
  }
  .detail.is-open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  .detail::before {
    content: ""; display: block;
    width: 44px; height: 5px; border-radius: 99px;
    background: var(--border-strong);
    margin: 0 auto 10px;
  }
  /* the close button floats and stays reachable while the sheet scrolls */
  .d-close {
    display: grid; place-items: center;
    position: sticky; top: 0; z-index: 2;
    float: right;
    margin: -2px -4px -40px 0;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid var(--border); background: var(--surface-2);
    box-shadow: var(--shadow-sm);
  }
  .d-close svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; }
  .d-head { grid-template-columns: 56px minmax(0, 1fr); padding-right: 46px; }
  .d-head .av--lg { width: 56px; height: 56px; font-size: 21px; }
  .d-title h2 { font-size: 23px; }
  .d-actions { margin-top: 12px; }
  .d-sec { margin-top: 16px; }
  body.sheet-open { overflow: hidden; }
}

/* phones in portrait: brand row on top, search below; only the search stays pinned while scrolling */
@media (max-width: 599px) {
  .topbar { top: -52px; }
  html { scroll-padding-top: 81px; }
  .topbar__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "search search";
    gap: 10px 12px;
    padding-top: 10px; padding-bottom: 12px;
  }
}

/* short screens (landscape phones, big zoom): one slim row */
@media (max-width: 859px) and (max-height: 500px) {
  :root { --topbar-h: 56px; }
  .topbar__inner { padding-top: 6px; padding-bottom: 6px; }
  .search__input { height: 42px; }
  .detail { height: 96dvh; }
  .d-head .av--lg { width: 44px; height: 44px; font-size: 17px; }
  .d-head { grid-template-columns: 44px minmax(0, 1fr); }
  .d-title h2 { font-size: 20px; }
}
@media (max-width: 600px) and (max-height: 500px) {
  .topbar { top: 0; }
  .topbar__inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search actions"; }
  .brand__name { display: none; }
}

@media (max-width: 400px) {
  .brand__name { font-size: 19px; }
}
/* narrow phones (360px Android and below): the name goes on two lines so it never runs under the buttons */
@media (max-width: 374px) {
  .brand { gap: 8px; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__name { font-size: 18px; line-height: 1; white-space: normal; }
  .brand__name em { display: block; }
  .topbar__actions { gap: 6px; }
}

/* touch: comfortable targets, no zoom on the selects */
@media (pointer: coarse) {
  .btn { height: 44px; }
  .btn--copy { width: 44px; }
  .srv__actions { gap: 10px; }
  .card__star::before { content: ""; position: absolute; inset: -6px -6px 0 -6px; }
  .card__name { padding-right: 32px; }
  .d-close { width: 44px; height: 44px; }
  .picker select { height: 44px; font-size: 16px; }
  .pill-btn { height: 40px; }
}

.scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(30, 22, 12, 0.42);
  opacity: 0; transition: opacity .25s;
}
.scrim.is-on { opacity: 1; }

/* ---------- footer, dialog, toast ---------- */

.footer {
  width: 100%; max-width: 1520px; margin: 0 auto;
  padding: 8px max(var(--gx), env(safe-area-inset-right)) calc(36px + env(safe-area-inset-bottom)) max(var(--gx), env(safe-area-inset-left));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}

.how {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.how::backdrop { background: rgba(30, 22, 12, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.how__inner { position: relative; padding: 26px 26px 22px; display: grid; gap: 16px; }
.how h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.2; padding-right: 44px; }
.how__close { position: sticky; top: 0; justify-self: end; margin: -8px -8px -56px 0; z-index: 1; }
.how__row { display: grid; gap: 7px; justify-items: start; }
.how__row p { font-size: 14.5px; color: var(--ink-2); }
.how__list { margin: 0; padding: 14px 0 0 18px; border-top: 1px dashed var(--border-strong); display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.how__foot { font-size: 13.5px; font-weight: 600; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 14px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}

/* ---------- cozy layer ---------- */

/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .26 0 0 0 0 .17 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the window */
.welcome__window { margin: -4px -4px 14px; }
.welcome__window .scene { width: 100%; height: auto; display: block; }
.scene__rain { opacity: 0; transition: opacity 1.2s ease; }
.is-raining .scene__rain { opacity: 1; }
.scene__rainlines line { animation: tgl-fall .7s linear infinite; }
.scene__drops circle { animation: tgl-slide 6s ease-in infinite; }
.scene__star { animation: tgl-twinkle 3.6s ease-in-out infinite; }
.scene__firefly { animation: tgl-float 7s ease-in-out infinite; }
.scene__bulb { animation: tgl-glow 2.8s ease-in-out infinite; }
.scene__clouds { animation: tgl-drift 40s ease-in-out infinite alternate; }
.scene__steam { animation: tgl-steam 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.scene__steam--2 { animation-delay: -1.7s; }
.scene__cat ellipse:first-of-type { animation: tgl-breathe 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.scene__zzz { animation: tgl-zzz 3.6s ease-in-out infinite; opacity: 0; }
.scene__zzz--2 { animation-delay: -1.8s; }
.scene__blades { animation: tgl-sway 6s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }

@keyframes tgl-fall { from { transform: translateY(-40px); } to { transform: translateY(150px); } }
@keyframes tgl-slide { 0%, 55% { transform: translateY(0); opacity: .9; } 100% { transform: translateY(70px); opacity: 0; } }
@keyframes tgl-twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .3; } }
@keyframes tgl-float { 0%, 100% { transform: translate(0, 0); opacity: .9; } 25% { opacity: .2; } 50% { transform: translate(8px, -7px); opacity: 1; } 75% { transform: translate(-5px, -3px); opacity: .4; } }
@keyframes tgl-glow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes tgl-drift { from { transform: translateX(-10px); } to { transform: translateX(26px); } }
@keyframes tgl-steam { 0% { transform: translateY(4px) scaleY(.8); opacity: 0; } 30% { opacity: .55; } 100% { transform: translateY(-8px) scaleY(1.1); opacity: 0; } }
@keyframes tgl-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.05); } }
@keyframes tgl-zzz { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: .8; } 100% { opacity: 0; transform: translate(4px, -6px); } }
@keyframes tgl-sway { 0%, 100% { transform: skewX(0deg); } 50% { transform: skewX(4deg); } }

/* grass along the bottom */
.grass { height: 60px; margin-top: auto; padding-top: 8px; box-sizing: content-box; overflow: hidden; flex-shrink: 0; }
.grass__svg { width: 100%; height: 60px; display: block; }
.grass__sway { transform-box: fill-box; transform-origin: bottom; animation: tgl-sway 7s ease-in-out infinite; }
.grass__sway--1 { animation-duration: 8.5s; animation-delay: -2s; }
.grass__sway--2 { animation-duration: 6.2s; animation-delay: -4s; }
.grass__sway--3 { animation-duration: 9.4s; animation-delay: -1s; }
.grass__flower path { stroke-width: 1.6; }
.grass__fly { fill: #fbf2a0; opacity: 0; filter: drop-shadow(0 0 3px #fbf2a0); }
:root[data-theme="dark"] .grass__fly { animation: tgl-float 8s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grass__fly { animation: tgl-float 8s ease-in-out infinite; } }
.grass + .footer { max-width: none; padding-top: 12px; color: var(--ink-2); background: linear-gradient(180deg, color-mix(in srgb, var(--g2) 22%, transparent), color-mix(in srgb, var(--g2) 8%, transparent)); }

/* the view behind the page (assets/cozy.js backdrop): sky up top, hills along the bottom */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bd__sky { position: absolute; left: 0; top: 0; width: 100%; height: min(46vh, 420px); }
.bd__land { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(110px, 24vh, 230px); opacity: var(--land-o); }
.bd__night { opacity: var(--night-o); transition: opacity .6s ease; }
.bd__day { opacity: calc(var(--day-o) * .55); transition: opacity .6s ease; }
.bd__moonshade { fill: var(--bg); }
/* the moon sits in the right-hand margin, so it only shows when the page is wide enough to have one */
@media (max-width: 1699px) { .bd__moon { display: none; } }
.bd__twinkle { animation: tgl-twinkle 4.4s ease-in-out infinite; }
.bd__clouds { animation: tgl-drift 70s ease-in-out infinite alternate; }
.bd__h1 { fill: color-mix(in srgb, var(--g3) 34%, var(--bg)); }
.bd__h2 { fill: color-mix(in srgb, var(--g1) 40%, var(--bg)); }
.bd__h3 { fill: color-mix(in srgb, var(--g2) 46%, var(--bg)); }
.bd__lamp { fill: #ffd27a; opacity: calc(.25 + var(--night-o) * .75); }

/* fairy lights hanging under the top bar (wider screens; phones keep the header tight) */
@media (min-width: 860px) {
  .topbar::after {
    content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 22px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='22' viewBox='0 0 240 22'%3E%3Cpath d='M0 3Q60 15 120 3T240 3' fill='none' stroke='%238a5a3a' stroke-width='1.2'/%3E%3Cg%3E%3Ccircle cx='30' cy='9.5' r='7' fill='%23ffd27a' opacity='.22'/%3E%3Ccircle cx='30' cy='9.5' r='3' fill='%23ffd27a'/%3E%3Ccircle cx='90' cy='9.5' r='7' fill='%23ffb38a' opacity='.22'/%3E%3Ccircle cx='90' cy='9.5' r='3' fill='%23ffb38a'/%3E%3Ccircle cx='150' cy='9.5' r='7' fill='%23f8e7a1' opacity='.22'/%3E%3Ccircle cx='150' cy='9.5' r='3' fill='%23f8e7a1'/%3E%3Ccircle cx='210' cy='9.5' r='7' fill='%23ffc9a8' opacity='.22'/%3E%3Ccircle cx='210' cy='9.5' r='3' fill='%23ffc9a8'/%3E%3C/g%3E%3C/svg%3E") repeat-x center top / 240px 22px;
    opacity: var(--garland-o);
    animation: tgl-glow 5.6s ease-in-out infinite;
  }
}

/* a small window that stays in the sidebar while you browse */
.side__nook { display: none; }
@media (min-width: 1200px) and (min-height: 820px) {
  .side__nook { display: block; margin: 18px 6px 4px; padding: 10px 10px 8px; border-radius: 18px; border: 1.5px dashed var(--border-strong); background: color-mix(in srgb, var(--surface) 55%, transparent); }
  .side__nook .scene { width: 100%; height: auto; display: block; }
  .side__nook p { margin-top: 6px; text-align: center; font-family: var(--font-display); font-style: italic; font-size: 13.5px; color: var(--muted); }
}

/* supporter window scenes (assets/cozy.js): what drifts past the glass, and the grass to match */
.scene__leaf { animation: tgl-leaf 9s linear infinite; }
.scene__leaf path { transform-box: fill-box; transform-origin: center; }
.scene__flake { animation: tgl-snow 9s linear infinite; }
@keyframes tgl-leaf { 0% { transform: translate(0, -14px) rotate(0deg); } 25% { transform: translate(10px, 30px) rotate(40deg); } 50% { transform: translate(-6px, 76px) rotate(-20deg); } 75% { transform: translate(9px, 120px) rotate(35deg); } 100% { transform: translate(-2px, 168px) rotate(0deg); } }
@keyframes tgl-snow { 0% { transform: translate(0, -12px); } 50% { transform: translate(7px, 74px); } 100% { transform: translate(-3px, 162px); } }
:root[data-look="autumn"] { --g1: #c98b45; --g2: #b0693a; --g3: #dcab58; }
:root[data-look="snow"] { --g1: #dfe8ef; --g2: #c3d1dd; --g3: #f0f5f9; }
:root[data-look="lofi"] { --g1: #7a66ad; --g2: #62508f; --g3: #9580c4; }
:root[data-look="autumn"][data-theme="dark"] { --g1: #7a5230; --g2: #653f26; --g3: #8f6a38; }
:root[data-look="snow"][data-theme="dark"] { --g1: #56617f; --g2: #475172; --g3: #6a7696; }
:root[data-look="lofi"][data-theme="dark"] { --g1: #4a3b72; --g2: #3d2f5f; --g3: #5b4a86; }
@media (prefers-color-scheme: dark) {
  :root[data-look="autumn"]:not([data-theme="light"]) { --g1: #7a5230; --g2: #653f26; --g3: #8f6a38; }
  :root[data-look="snow"]:not([data-theme="light"]) { --g1: #56617f; --g2: #475172; --g3: #6a7696; }
  :root[data-look="lofi"]:not([data-theme="light"]) { --g1: #4a3b72; --g2: #3d2f5f; --g3: #5b4a86; }
}
.footer__scene { flex-basis: 100%; }
.footer__scene .picker { color: inherit; font-size: 13px; }
.footer__scene select { height: 34px; }

/* rain button */
#rainBtn[aria-pressed="true"] { color: var(--join); border-color: color-mix(in srgb, var(--join) 45%, var(--border)); background: color-mix(in srgb, var(--join) 10%, var(--surface)); }
#rainBtn .rain-drop { opacity: .45; }
#rainBtn[aria-pressed="true"] .rain-drop { opacity: 1; animation: tgl-drip 1s linear infinite; }
@keyframes tgl-drip { from { transform: translateY(-1px); } to { transform: translateY(1.5px); } }

/* star pop */
.is-pop svg { animation: tgl-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.is-pop { position: relative; }
.is-pop::after {
  content: ""; position: absolute; inset: 2px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 2px var(--clay); opacity: 0; animation: tgl-ring .5s ease-out;
}
@keyframes tgl-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes tgl-ring { 0% { opacity: .7; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.5); } }

/* empty state cat */
.empty__art { width: 150px; height: auto; display: block; margin: -6px auto 6px; }

@media (prefers-reduced-motion: reduce) {
  .scene *, .grass *, .backdrop *, .topbar::after, #rainBtn *, .is-pop, .is-pop *, .empty__art * { animation: none !important; }
  .scene__zzz { opacity: .6; }
  .scene__rainlines line { transform: none; }
}

/* ---------- static game pages ---------- */

.page {
  width: 100%; max-width: 780px; margin: 0 auto;
  padding: 18px max(var(--gx), env(safe-area-inset-right)) 32px max(var(--gx), env(safe-area-inset-left));
}
/* the A-Z hub: room for four game cards a row, so names wrap less */
.page--wide { max-width: 1100px; }
.page--wide .page-lead { max-width: 64ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-game {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 24px;
  box-shadow: var(--shadow); padding: 24px;
}
.page-game .d-title h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.1; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.answer {
  margin: 20px 0 6px; padding: 16px 18px;
  border-radius: 18px; background: var(--surface-2); border: 1.5px dashed var(--border-strong);
  display: grid; gap: 10px; justify-items: start;
}
.answer h2 { font-size: 15px; font-weight: 800; }
.answer p { color: var(--ink-2); }
.page-game .srv__name { font-size: 15px; }
.page-how { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.page-how h2, .related h2 { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.page-how p { font-size: 14px; color: var(--ink-2); }
.related { margin-top: 22px; }
.featured { margin-top: 18px; font-size: 14px; font-weight: 700; color: var(--muted); }
.featured a { color: var(--clay); text-underline-offset: 2px; }
.related ul, .hub ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.related li > a, .hub li > a {
  display: flex; align-items: center; gap: 10px; min-height: 52px; height: 100%;
  padding: 6px 12px 6px 6px; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  text-decoration: none; font-weight: 700; font-size: 14px;
}
.related li > a:hover, .hub li > a:hover { border-color: var(--border-strong); }
.related li > a > span:not(.av):not(.badge), .hub li > a > span:not(.av):not(.badge) { flex: 1; min-width: 0; }
.related .av, .hub .av { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; }
.page-title { font-family: var(--font-display); font-size: 32px; line-height: 1.1; letter-spacing: -0.015em; }
.page-lead { margin: 8px 0 20px; color: var(--ink-2); font-weight: 600; }
.page-intro { margin-top: 10px; max-width: 64ch; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.page-intro + .page-lead { margin-top: 6px; color: var(--muted); font-size: 14px; }
.hub { margin-top: 22px; }
.hub h2 { font-family: var(--font-display); font-size: 21px; margin-bottom: 10px; }
.hub h2 a { text-decoration: none; }
.hub__count { font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.hub h2 a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.footer a { color: inherit; }
.noscript { max-width: 760px; margin: 18px auto 0; padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border); font-weight: 600; }
.noscript a { color: var(--clay); }

/* list chips (hub and list pages) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.chips .pill-btn { height: 34px; }
.chips .is-current { color: var(--ink); border-color: var(--border-strong); background: var(--surface-3); }
.page-sub { font-family: var(--font-display); font-size: 21px; margin: 28px 0 10px; }

/* game rows on list pages */
.glist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.glist__item {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--border);
}
.glist__item > .av { align-self: start; }
.glist__name { font-size: 16px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.glist__name a { text-decoration: none; }
.glist__name a:hover { text-decoration: underline; text-underline-offset: 2px; }
.glist__line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.glist__note { margin-top: 5px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.glist__pick { margin-top: 5px; font-size: 14.5px; color: var(--ink); line-height: 1.45; }
.glist__body .srv__proof { margin-top: 5px; }

/* prose pages: about, privacy, corrections, 404 */
.page-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 24px;
  box-shadow: var(--shadow); padding: 28px 30px 30px;
}
.prose h1 { font-family: var(--font-display); font-size: 32px; line-height: 1.1; letter-spacing: -0.015em; margin-bottom: 14px; }
.prose h2 { font-family: var(--font-display); font-size: 21px; line-height: 1.2; margin: 28px 0 8px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.prose p, .prose li { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 10px; }
.prose ul { margin: 0; padding-left: 22px; display: grid; gap: 5px; }
.prose .lead { font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.prose a:not(.pill-btn) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose .badge { vertical-align: -6px; }
.prose__date { margin-top: 26px !important; font-size: 13.5px !important; color: var(--muted) !important; }
.corrections { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.corrections li { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1.5px solid var(--border); }
.corrections__head { font-size: 13.5px !important; font-weight: 700; color: var(--muted) !important; margin-bottom: 4px; }
/* the badge page: previews of the badge and the snippet to copy */
.embed { margin-top: 14px; display: grid; gap: 12px; }
.embed__previews { display: flex; flex-wrap: wrap; gap: 12px; }
.embed__preview { display: grid; place-items: center; padding: 18px 22px; border-radius: 16px; border: 1.5px solid var(--border); background: #fbf7f0; }
.embed__preview--dark { background: #15120f; border-color: #3a322a; }
.embed__preview img { display: block; }
.embed__code { position: relative; border-radius: 16px; background: var(--surface-2); border: 1.5px solid var(--border); }
.embed__code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.55 ui-monospace, "Cascadia Code", Consolas, Menlo, monospace; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.embed__copy { margin: 0 12px 12px; }
.prose .embed + p { margin-top: 16px; }
.nf { text-align: center; }
.nf__art .empty__art { width: 170px; }
.nf__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px !important; }

@media (max-width: 599px) {
  .page-game { padding: 18px 16px; border-radius: 20px; }
  .page-game .d-title h1 { font-size: 25px; }
  /* phones: the game name carries the title, "Discord servers" drops to a quiet second line */
  .page-game .d-title__sub { display: block; margin-top: 3px; font-family: var(--font-ui); font-size: 15px; font-weight: 800; letter-spacing: 0; color: var(--ink-2); }
  .page-body .topbar__inner { grid-template-areas: "brand actions" "search search"; }
  .page-card { padding: 20px 18px 22px; border-radius: 20px; }
  .prose h1, .page-title { font-size: 27px; }
  .glist__item { grid-template-columns: 40px minmax(0, 1fr); padding: 12px; }
  .glist__item > .av { width: 40px; height: 40px; font-size: 15px; }
  .glist__item > .btn { grid-column: 2; justify-self: start; margin-top: 6px; }
}
