/* Hoardling -- dense catalogue in a warm "ember lair". Colour tokens per theme in static/themes.css (Ember Dark default).
   Display face (Young Serif) only for the wordmark, page headings and big profile numbers; Inter for everything else. */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter-var.wght400-750.woff2") format("woff2");
  font-weight: 400 750;
  font-display: swap;
}
@font-face {
  font-family: "Young Serif";
  src: url("/static/fonts/YoungSerif-Regular.latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
/* metric-matched Georgia while Young Serif loads (no layout shift on headings) */
@font-face { font-family: "Young Serif fallback"; src: local("Georgia"); size-adjust: 104%; ascent-override: 101%; descent-override: 35%; }

:root {  /* colours: static/themes.css (one block per theme; data-theme on <html> from the `theme` cookie) */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Young Serif", "Young Serif fallback", Georgia, serif;
}

/* status colour hook: any element with .status-x gets --sc */
.status-want_to_play { --sc: var(--s-want_to_play); }
.status-backlog { --sc: var(--s-backlog); }
.status-playing { --sc: var(--s-playing); }
.status-on_hold { --sc: var(--s-on_hold); }
.status-played { --sc: var(--s-played); }
.status-completed { --sc: var(--s-completed); }
.status-dropped { --sc: var(--s-dropped); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; counter-reset: selected;
  /* column so the site footer sits at the viewport bottom on short pages (margin-top: auto) */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.text-link { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.text-link:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }
h1 { font-family: var(--display); font-size: 26px; line-height: 1.2; font-weight: 400; font-synthesis: none; margin: 0; letter-spacing: 0; }
h2 {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 32px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 12px;
}
.h2-link { margin-left: auto; font-size: 11px; color: var(--muted); }
.label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.sep { color: var(--muted); padding: 0 2px; }
.empty { color: var(--muted); margin: 8px 0 24px; }
.error, .notice { color: var(--danger); }
.notice { color: var(--text-2); border-left: 3px solid var(--danger); padding: 8px 12px; background: var(--bg-2); }
code { font-size: 12.5px; background: var(--bg-3); padding: 1px 5px; border-radius: 2px; }
.icon { width: 16px; height: 16px; flex: none; fill: currentColor; vertical-align: -3px; }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 20px 40px; overflow-wrap: break-word; }
/* phones: long unbroken names wrap (break-word, inherited; not anywhere: that shrinks flex items like h2 titles mid-word) instead of widening the page (tests/test_overflow.py) */

/* ---- controls ---- */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: 6px 9px; min-height: 32px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--accent); }
textarea { resize: vertical; line-height: 1.5; }
/* iOS (WebKit touch) zooms into any field under 16px on focus and stays zoomed: the page then scrolls sideways */
@supports (-webkit-touch-callout: none) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
}
input[type=date] { color-scheme: inherit; }
::placeholder { color: var(--muted); }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .5; cursor: progress; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 3px; color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap; transition: background-color .1s, border-color .1s;
}
.btn:hover { color: var(--text); border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn:focus-visible { box-shadow: var(--glow); }
button.link { color: var(--muted); font-size: 13px; }
button.link:hover { color: var(--text); text-decoration: underline; }
button.link.danger:hover { color: var(--danger); }

/* ---- nav ---- */
.navbar { background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-inner { max-width: 1180px; margin: 0 auto; min-height: 48px; padding: 0 20px; display: flex; align-items: center; gap: 28px; }
/* wordmark: brand.svg#mark (Ember Egg: hatchling peeking from its cracked ember egg) + #wordmark ("hoardling" in Young Serif, outlined) whose i-dot is an
   ember coin (#wordmark-dot, coloured by the .wm-dot <use>) */
.wordmark { display: inline-flex; align-items: flex-end; gap: 7px; color: var(--text); flex: none; }
.wordmark:hover { color: var(--text); }
.wordmark svg { display: block; fill: currentColor; }
/* brand.svg colour contract: the dragon is currentColor, the ember (shell, egg, coins) the inherited fill */
.wordmark .wm-mark { width: 26px; height: 26px; color: var(--text); fill: var(--accent); margin-bottom: -1px; }
.wm-text { width: 100px; height: 21px; }
.wm-dot { color: var(--accent); }
.wordmark:hover .wm-mark { transform: translateY(-1px); transition: transform .12s; }
/* links shrink and wrap onto a second line when the row is full (large text), never past the viewport; the header grows */
.nav-links { display: flex; flex-wrap: wrap; column-gap: 20px; align-self: stretch; min-width: 0; }
.nav-links a { display: flex; align-items: center; min-height: 40px; padding: 2px 4px 0; margin: 0 -4px; color: var(--text-2); font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; }
.nav-links a:focus-visible { outline-offset: -2px; }  /* inside the bar: not cut off by the viewport top or the next row */
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.nav-search { margin-left: auto; position: relative; display: flex; align-items: center; }
.nav-search > .icon { position: absolute; left: 8px; color: var(--muted); pointer-events: none; }
/* phones (<=760px): the search box hides behind a Search icon button; static/js/search.js opens it over the bar (.search-open) */
.nav-search-open, .nav-search-close { display: none; align-items: center; justify-content: center; flex: none; width: 36px; height: 44px; color: var(--text-2); }
.nav-search-open:hover, .nav-search-close:hover { color: var(--text); }
.navbar .btn { gap: 0; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); max-width: 160px; }
.nav-user span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user[aria-current] { color: var(--text); }
.nav-user img, .avatar-blank { width: 24px; height: 24px; border-radius: 2px; flex: none; background: var(--bg-3); }
.nav-search input { width: 200px; padding-left: 30px !important; height: 30px; min-height: 0 !important; background: var(--bg) !important; font-size: 13px; }
/* avatar menu (Profile / Account): <details>, closed on outside click / Esc by app.js */
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; height: 48px; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover { color: var(--text); }
.nav-menu-list {
  position: absolute; right: 0; top: 100%; min-width: 150px; z-index: 30; display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; padding: 4px 0;
}
.nav-menu-list a { padding: 7px 14px; font-size: 13px; color: var(--text-2); }
.nav-menu-list a:hover, .nav-menu-list a[aria-current] { color: var(--text); background: var(--bg-3); }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 20px; right: 20px; max-width: 360px; z-index: 50;
  background: var(--bg-3); border: 1px solid var(--line); border-left: 3px solid var(--danger);
  border-radius: 2px; padding: 10px 14px; font-size: 13px;
}
/* mascot stage-up (once per stage, mascot.py): ember edge, the new stage beside the line, fade/slide 8px in 150 ms */
.toast.stage-toast { display: flex; align-items: center; gap: 12px; border-left-color: var(--accent); padding-right: 8px; animation: toast-in .15s ease-out; }
.toast.stage-toast[hidden] { display: none; }
.stage-toast p { margin: 0; }
.stage-toast .mascot { width: 40px; height: 40px; color: var(--text); }
.toast-close { width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); border-radius: 2px; flex: none; }
.toast-close:hover { color: var(--text); background: var(--bg-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- covers ---- */
.cover {
  position: relative; display: block; aspect-ratio: 264 / 374; border-radius: 2px; overflow: hidden;
  background: var(--bg-3);
}
/* IGDB community score on grid covers: band colour (score_class -> .rb-* -> --rb-c) as text + ring on an opaque
   bg-2 chip, so the --score-* contrast checked in test_themes.py holds over any cover art; few ratings = dashed, muted */
.igdb-score {
  position: absolute; top: 6px; right: 6px; z-index: 1; min-width: 26px; padding: 0 4px; border-radius: 3px;
  border: 1px solid var(--rb-c, var(--line)); background: var(--bg-2); color: var(--rb-c, var(--text));
  box-shadow: 0 1px 3px rgb(0 0 0 / .35); font-size: 11px; font-weight: 700; line-height: 18px;
  text-align: center; font-variant-numeric: tabular-nums; pointer-events: none;
}
.igdb-num { color: var(--rb-c, inherit); font-weight: 600; }  /* table IGDB column, similar strip */
.igdb-score.rb-few { border-style: dashed; color: var(--text-2); }
.igdb-num.rb-few { color: inherit; font-weight: inherit; }
.cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--cover-edge); pointer-events: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .1s; }
.no-cover {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10px;
  background: linear-gradient(165deg, var(--bg-3) 30%, color-mix(in srgb, var(--line) 60%, var(--bg-3)));
  font-family: var(--serif); font-size: 15px; line-height: 1.2; color: var(--text-2); overflow: hidden;
}
.card:hover .no-cover span { opacity: 0; }
.no-cover span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.status-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--sc); z-index: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
.grid-lg { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card { position: relative; min-width: 0; }
.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; }
.card-link:hover .cover::after, .card-link:focus-visible .cover::after { box-shadow: inset 0 0 0 2px var(--accent); }
.card-link:hover img { filter: brightness(1.1); }
.card-link:focus-visible { outline: none; }
.card h3 {
  margin: 7px 0 0; font-size: 12.5px; font-weight: 500; line-height: 1.3; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-link:hover h3 { color: var(--text); }
.card .meta { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; margin-top: 2px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.score { display: inline-flex; align-items: center; gap: 3px; color: var(--text-2); }
.score .icon { width: 11px; height: 11px; color: var(--star); vertical-align: 0; }

/* selection checkbox: hidden until hover or until something is selected */
.card .select {
  position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; margin: 0; z-index: 3;
  accent-color: var(--accent); opacity: 0; cursor: pointer; transition: opacity .1s;
}
.card:hover .select, .card .select:focus-visible, .library:has(.select:checked) .select { opacity: 1; }
.card .select:checked { counter-increment: selected; }
.card:has(.select:checked) .cover::after { box-shadow: inset 0 0 0 2px var(--accent); }

/* quick status overlay (pointer devices only) */
.quick {
  position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 264 / 374; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; padding: 0 4px 8px;
  background: linear-gradient(transparent 58%, rgb(0 0 0 / .82));
  border-radius: 2px; opacity: 0; pointer-events: none; transition: opacity .1s;
}
.quick button { width: 20px; height: 22px; display: grid; place-items: center; color: rgb(255 255 255 / .6); border-radius: 2px; }
.quick button:hover { color: #fff; background: rgb(255 255 255 / .14); }
.quick button.on { color: var(--sc); }
.quick .icon { width: 14px; height: 14px; vertical-align: 0; }
.card:hover .quick, .card:focus-within .quick { opacity: 1; }
.card:hover .quick button, .card:focus-within .quick button { pointer-events: auto; }
@media (hover: none) { .quick { display: none; } }

.load-more { grid-column: 1 / -1; justify-self: center; margin-top: 12px; padding: 8px 16px; color: var(--text-2); font-size: 13px; }
.load-more:hover { color: var(--text); text-decoration: underline; }

/* status as text */
.status-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--sc, var(--muted)); font-weight: 500; }

/* ---- page heads ---- */
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .muted { font-size: 13px; }
.page-head > div { min-width: 0; overflow-wrap: anywhere; }

/* ---- dashboard ---- */
.summary-line { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.summary-line a:hover { color: var(--accent); }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 40px; }
.dash-main { min-width: 0; }
.dash-main > section:first-child h2 { margin-top: 16px; }
.dash-side h2 { margin-top: 16px; }
.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.strip-item { flex: 0 0 110px; min-width: 0; }
.strip-item:hover .cover::after { box-shadow: inset 0 0 0 2px var(--accent); }
.strip-item .no-cover { font-size: 12.5px; padding: 8px; }
.strip-title { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-item:hover .strip-title { color: var(--text); }
.strip-sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* IsThereAnyDeal line (components/price-line.html, itad.py): lazy, empty placeholder takes no room */
.price-line { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.price-line:empty { display: none; }
.price-line strong { color: var(--text); font-weight: 600; }
.price-cut { color: var(--score-good); font-weight: 600; }
.price-line > span:not(.sep), .price-src { display: inline-block; max-width: 100%; }  /* breaks fall between parts; a part wider than the line wraps inside */
.game-updates { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--text-2); }
.game-updates li { margin: 2px 0; overflow-wrap: anywhere; }
.game-updates .gu-label { color: var(--muted); cursor: help; }
.dist { display: flex; height: 8px; gap: 1px; border-radius: 1px; overflow: hidden; background: var(--bg-3); }
.dist span { background: var(--sc); min-width: 2px; }
.legend { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; }
.legend a { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text-2); }
.legend a:hover { color: var(--text); }
.legend .num { margin-left: auto; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 1px; background: var(--sc, var(--bg-3)); flex: none; }
.legend-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }

/* ---- library ---- */
.library {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 32px;
  grid-template-areas: "tabs tabs" "side tool" "side main";
}
#filters { display: contents; }
.tabs { grid-area: tabs; display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: flex; align-items: baseline; gap: 6px; padding: 8px 0 10px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.tab .num { font-size: 11.5px; color: var(--muted); }
.tab input { position: absolute; opacity: 0; pointer-events: none; }
.tab:hover { color: var(--text); }
.tab:has(input:checked) { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tab:has(input:focus-visible) { outline: var(--focus-w) solid var(--focus); outline-offset: -2px; }
.toolbar { grid-area: tool; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search-field { position: relative; flex: 1 1 220px; max-width: 320px; display: flex; align-items: center; }
.search-field .icon { position: absolute; left: 9px; color: var(--muted); }
.search-field input { width: 100%; padding-left: 31px !important; }
.sort-field { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dir-toggle .icon { color: var(--muted); }
.dir-toggle[data-dir="asc"] .icon { transform: scaleY(-1); }
.filters { grid-area: side; align-self: start; position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; scrollbar-width: thin; }
.results { grid-area: main; min-width: 0; }
.result-count { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.facet { border-bottom: 1px solid var(--line); }
.facet summary { list-style: none; cursor: pointer; padding: 10px 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; }
.facet summary::-webkit-details-marker { display: none; }
.facet summary::after { content: "+"; margin-left: auto; font-weight: 400; }
.facet[open] summary::after { content: "\2212"; }
.facet summary:hover { color: var(--text); }
.facet-options { display: flex; flex-direction: column; padding-bottom: 10px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.opt { display: block; padding: 3px 0; font-size: 13px; color: var(--text-2); cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:hover { color: var(--text); }
.opt:has(input:checked) { color: var(--accent); font-weight: 500; }
.opt:has(input:focus-visible) { outline: var(--focus-w) solid var(--focus); }
.opt:has(input[type=checkbox]) { display: flex; align-items: center; gap: 8px; }
.opt input[type=checkbox] { position: static; opacity: 1; pointer-events: auto; flex: none; width: 13px; height: 13px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.opt:has(input[type=checkbox]:focus-visible) { outline: 0; }
.opt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .num { margin-left: auto; padding-left: 8px; font-size: 11.5px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.opt.zero { opacity: .6; }
.facet:not(.show-all) .opt.extra, .more-opts .when-open, .show-all .more-opts .when-closed { display: none; }
.show-all .more-opts .when-open { display: inline; }
.more-opts { margin-top: 4px; align-self: flex-start; font-size: 12px; }
.opt-empty { margin: 0; padding: 3px 0; font-size: 12px; color: var(--muted); }
.facet .hint { margin-left: 6px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.facet .facet-options { max-height: none; overflow: visible; }
#facet-length .opt { display: flex; align-items: baseline; }  /* Length filter: bucket name + its range */
.opt-note { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.backlog-ttb { margin: 0; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.result-head .result-count { margin: 0; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 8px; font-size: 12px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 3px; color: var(--text);
}
.chip .icon { width: 10px; height: 10px; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip:hover .icon { color: var(--accent); }
.clear-filters { font-size: 12px; margin-left: 4px; }

/* "What should I play next?" (Backlog tab, pick.py) */
.picker { margin: 0 0 22px; padding: 12px 14px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; }
.picker h2 { margin: 0 0 10px; padding: 0; border: 0; }
.pick-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pick-opt {
  position: relative; display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; font-size: 13px;
  color: var(--text-2); background: var(--bg-3); border: 1px solid var(--line); border-radius: 15px; cursor: pointer;
}
.pick-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pick-opt:hover { color: var(--text); border-color: var(--muted); }
.pick-opt:has(input:checked) { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.pick-opt:has(input:focus-visible) { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }
.pick-break { flex-basis: 100%; height: 0; }
.pick-sep { margin: 0 4px 0 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pick-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.pick-genre { display: flex; align-items: center; gap: 8px; }
.pick-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.pick-check input { margin: 0; accent-color: var(--accent); }
.pick-results { margin-top: 14px; }
.pick-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 170px)); }
.pick-why { margin: 4px 0 0; font-size: 12px; color: var(--text-2); }
.pick-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 0; font-size: 12px; }
.pick-foot .btn { margin-left: auto; }
.pick-empty { margin: 0; }
.h2-pick + .h2-link { margin-left: 0; }
.random-link { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; }
@media (max-width: 760px) {
  .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .pick-opt { min-height: 32px; padding: 0 10px; }
}

.select-toggle .icon { color: var(--muted); }
.select-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.select-toggle[aria-pressed="true"] .icon { color: var(--accent); }
.library.selecting .select { opacity: 1; }
.library.selecting .quick, .library.selecting .status-btn { display: none !important; }
.library.selecting .card-link { cursor: default; }

/* status button + bottom sheet (touch only; pointer devices use the hover overlay) */
.status-btn, .q-label, .sheet-title { display: none; }
.card.leaving { animation: card-leave .35s ease forwards; pointer-events: none; }
@keyframes card-leave { to { opacity: 0; transform: scale(.94); } }
@media (hover: none) {
  .card .select { display: none; }
  .library.selecting .card .select { display: block; width: 22px; height: 22px; top: 4px; left: 4px; }
  .status-btn {
    display: grid; place-items: center; position: relative; margin-left: auto; width: 28px; height: 22px; flex: none;
    color: var(--sc, var(--text-2)); border: 1px solid var(--line); border-radius: 3px; background: var(--bg-2);
  }
  .status-btn::before { content: ""; position: absolute; inset: -8px -6px; } /* bigger tap target */
  .status-btn .icon { width: 13px; height: 13px; vertical-align: 0; }
  .card.menu-open .quick {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px; position: fixed; inset: auto 0 0 0; aspect-ratio: auto;
    z-index: 60; opacity: 1; pointer-events: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--bg-2); border-top: 1px solid var(--line); border-radius: 8px 8px 0 0;
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / .55);
  }
  .card.menu-open .quick button {
    display: flex; align-items: center; gap: 10px; width: auto; height: 44px; padding: 0 12px; pointer-events: auto;
    background: var(--bg-3); color: var(--text); font-size: 14px; text-align: left;
  }
  .card.menu-open .quick button .icon { width: 16px; height: 16px; color: var(--sc); }
  .card.menu-open .quick button.on { box-shadow: inset 0 0 0 1px var(--sc); }
  .card.menu-open .quick button::after { display: none; }
  .card.menu-open .q-label { display: flex; flex-direction: column; line-height: 1.15; }
  .q-note { color: var(--muted); font-size: 11.5px; }
  .card.menu-open .sheet-title {
    display: block; grid-column: 1 / -1; margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
}

/* view toggle (grid / table) */
.view-toggle { display: inline-flex; }
.view-toggle .btn { padding: 0 9px; color: var(--muted); }
.view-toggle .btn:first-child { border-radius: 3px 0 0 3px; }
.view-toggle .btn:last-child { border-radius: 0 3px 3px 0; }
.view-toggle .btn + .btn { margin-left: -1px; }
.view-toggle .btn:not(:first-child):not(:last-child) { border-radius: 0; }
.view-toggle .btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); position: relative; z-index: 1; }

/* library table view: rows are .card articles (select mode, quick status, leaving all reuse the card code) */
.gtable { border-top: 1px solid var(--line); }
.trow {
  display: grid; align-items: center; gap: 12px; min-height: 54px; padding: 4px 8px;
  grid-template-columns: 16px 32px minmax(0, 2.2fr) minmax(0, 1.2fr) 112px 72px 40px 80px 44px 116px 84px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.trow > * { min-width: 0; }
.trow:not(.thead):hover { background: var(--bg-2); }
.trow:has(.select:checked) { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.trow.menu-open { z-index: 20; }
.thead { min-height: 34px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.th { display: inline-flex; align-items: center; gap: 4px; justify-self: start; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; white-space: nowrap; }
button.th:hover, a.th:hover, .th.on { color: var(--text); }
a.th { text-decoration: none; }
.th .icon { width: 12px; height: 12px; vertical-align: 0; }
.th .dir-asc { transform: scaleY(-1); }
.thead .c-rating, .thead .c-igdb, .thead .c-time, .thead .c-year, .thead .c-gupdate, .thead .c-updated { justify-self: end; }
.c-rating, .c-igdb, .c-time, .c-year, .c-gupdate, .c-updated { text-align: right; }
.trow .select { position: static; opacity: 1; width: 14px; height: 14px; display: block; }
.tcover { display: block; width: 32px; aspect-ratio: 264 / 374; border-radius: 2px; overflow: hidden; background: var(--bg-3); box-shadow: var(--cover-edge); }
.tcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trow .c-title { font-weight: 500; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.trow .c-title:hover { color: var(--accent); }
.trow .c-title:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 1px; color: var(--accent); }  /* table rows have no cover ring */
.c-plat { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-igdb, .c-time, .c-year { color: var(--text-2); }
.c-updated, .c-gupdate { color: var(--muted); font-size: 12px; }
.trow .score { justify-content: flex-end; }
.c-status { position: relative; }
.trow .status-btn {
  display: inline-flex; align-items: center; gap: 6px; width: auto; height: 28px; margin: 0 0 0 -6px; padding: 0 6px;
  color: var(--sc, var(--muted)); font-weight: 500; font-size: 13px; border: 0; border-radius: 3px; background: none; white-space: nowrap;
}
.trow .status-btn:hover, .trow.menu-open .status-btn { background: var(--bg-3); }
.trow .status-btn .icon { width: 14px; height: 14px; }
.trow .status-btn::before { content: none; }
.trow .quick { display: none; }
.library.selecting .trow .status-btn { display: inline-flex !important; pointer-events: none; }
@media (hover: hover) {
  .trow.menu-open .quick {
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1px;
    inset: calc(100% + 2px) auto auto -6px; width: 200px; aspect-ratio: auto; padding: 4px; z-index: 40;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 24px rgb(0 0 0 / .35);
    opacity: 1; pointer-events: auto;
  }
  .trow.menu-open .quick button { display: flex; align-items: center; gap: 9px; width: auto; height: 30px; padding: 0 8px; color: var(--text); font-size: 13px; text-align: left; }
  .trow.menu-open .quick button:hover { background: var(--bg-3); color: var(--text); }
  .trow.menu-open .quick button .icon { color: var(--sc); }
  .trow.menu-open .quick button.on { box-shadow: inset 0 0 0 1px var(--sc); }
  .trow.menu-open .quick button::after { display: none; }
  .trow.menu-open .q-label { display: inline; }
  .trow .q-note { display: none; }
}
@media (hover: none) { .library:not(.selecting) .trow .c-check { visibility: hidden; } }

.bulk-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none;
  align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 10px 20px; background: var(--bg-2); border-top: 1px solid var(--line);
}
body:has(#game-grid .select:checked) .bulk-bar { display: flex; }
.bulk-count { margin-right: 8px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bulk-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.bulk-msg { font-size: 13px; color: var(--text-2); }
.bulk-msg:empty { display: none; }

/* list page: add from library */
.list-add { position: relative; max-width: 420px; margin: 0 0 20px; }
.list-add .search-field { max-width: none; }
.lsr-list { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--bg-2); }
.lsr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 10px; font-size: 13px; }
.lsr + .lsr { border-top: 1px solid var(--line); }
.lsr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsr .btn { height: 28px; padding: 0 10px; }
.lsr .btn .icon { width: 12px; height: 12px; }
.lsr.added { color: var(--muted); padding-right: 12px; }
.lsr-empty { margin: 6px 0 0; font-size: 13px; }
#list-grid:has(.card-wrap) + .list-empty { display: none; }

/* ---- game detail ---- */
.sprite { display: none; }
.backdrop {  /* <img>: no inline style under the CSP */
  display: block; width: calc(100% + 40px); max-width: none; height: 180px; margin: -24px -20px -120px;
  object-fit: cover; object-position: center 30%; opacity: .25; pointer-events: none;
  /* fade on all sides so the image has no hard edges */
  mask-image: radial-gradient(ellipse 50% 100% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 50% 100% at 50% 0%, #000 30%, transparent 100%);
}
.detail {
  position: relative; display: grid; grid-template-columns: 230px minmax(0, 1fr); column-gap: 40px;
  grid-template-areas: "cover head" "cover main" "side main"; grid-template-rows: auto auto 1fr; align-items: start;
}
.detail-cover { grid-area: cover; }
.detail-cover .cover-img { width: 100%; display: block; border-radius: 2px; box-shadow: 0 0 0 1px var(--line); }
.detail-cover .no-cover { font-size: 20px; padding: 16px; }
.detail-side { grid-area: side; }
.detail-head { grid-area: head; padding-top: 4px; }
.detail-main { grid-area: main; }
.detail h1 { font-size: 32px; line-height: 1.15; }
.meta-line { margin: 8px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.genres { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.genres a:hover { color: var(--accent); }
.rating-badge {  /* components/rating-badge.html; band colours = --score-* (themes.css) */
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin: 0; padding: 6px 14px 6px 6px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2);
}
.rb-bad { --rb-c: var(--score-bad); }
.rb-mid { --rb-c: var(--score-mid); }
.rb-ok { --rb-c: var(--score-ok); }
.rb-good { --rb-c: var(--score-good); }
.rb-num {
  display: inline-flex; align-items: baseline; justify-content: center; min-width: 52px; padding: 6px 8px;
  border: 2px solid var(--rb-c); border-radius: 4px; background: var(--bg-3); color: var(--rb-c);
  font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.rb-max { margin-left: 1px; font-size: 11px; font-weight: 500; color: var(--muted); }
.rb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.25; }
.rb-label { font-size: 14px; font-weight: 600; color: var(--text); }
.rb-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rb-few .rb-num { border-style: dashed; color: var(--text-2); }
/* time to beat (components/time-to-beat.html): panel beside the rating badge in .score-row, same box family */
.score-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 12px 0 0; }
.ttb {
  display: flex; flex-direction: column; justify-content: center; gap: 3px; max-width: 100%; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2);
}
.ttb-stats { display: flex; flex-wrap: wrap; row-gap: 4px; margin: 0; }
.ttb-stat { display: flex; flex-direction: column-reverse; padding: 0 14px; border-left: 1px solid var(--line); }
.ttb-stat:first-child { padding-left: 0; border-left: 0; }
.ttb-stat:last-child { padding-right: 0; }
.ttb-stat dt { font-size: 12px; line-height: 1.25; color: var(--text-2); cursor: help; }
.ttb-stat dd { margin: 0; font-size: 12px; line-height: 1.15; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ttb-num { font-size: 20px; font-weight: 700; color: var(--text); }
.ttb-foot { margin: 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {  /* phones: own full-width row under the badge, one equal column per shown mode, no wrapping */
  .ttb { flex: 1 1 100%; padding: 6px 10px; }
  .ttb-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .ttb-stat { padding: 0 6px; align-items: center; text-align: center; min-width: 0; }
  .ttb-stat dt { font-size: 11px; }
  .ttb-num { font-size: clamp(14px, 5vw, 18px); }
  .ttb-foot { text-align: center; }
}
@media (max-width: 380px) { .ttb { padding: 6px 4px; } .ttb-stat { padding: 0 2px; } .ttb-stat dt { font-size: 10px; } }  /* 320px: ~150px column */
.ext-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.ext-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid var(--line);
  border-radius: 3px; font-size: 12px; color: var(--text-2); background: var(--bg-2);
}
.ext-link:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.ext-link .icon { width: 11px; height: 11px; }
.detail-side h2 { margin-top: 20px; }
.status-control { display: flex; flex-direction: column; }
.status-opt {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; font-size: 13px; color: var(--text-2);
  border-left: 2px solid transparent; text-align: left; transition: background-color .1s;
}
.status-opt .icon { color: var(--muted); }
.status-opt:hover { background: var(--bg-2); color: var(--text); }
.status-opt:hover .icon { color: var(--sc); }
.status-opt.on { background: var(--bg-3); color: var(--sc); border-left-color: var(--sc); font-weight: 600; }
.status-opt.on .icon { color: var(--sc); }

.summary { position: relative; max-width: 65ch; margin-top: 20px; color: var(--text-2); }
.summary p { margin: 0; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.more-toggle { position: absolute; opacity: 0; pointer-events: none; }
.more-toggle:checked ~ p { -webkit-line-clamp: unset; }
.summary .when-open, .more-toggle:checked ~ label .when-closed, .summary.fits label { display: none; }
.more-toggle:checked ~ label .when-open { display: inline; }
.summary label { cursor: pointer; font-size: 13px; }
.more-toggle:focus-visible ~ label { outline: var(--focus-w) solid var(--focus); }

.rating-row { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rating-row + h2 { margin-top: 28px; }
.stars { display: flex; }
.half { width: 12px; height: 24px; overflow: hidden; position: relative; color: var(--star-empty); }
.half svg { position: absolute; top: 0; width: 24px; height: 24px; fill: currentColor; }
.half.l svg { left: 0; }
.half.r svg { left: -12px; }
.half.r { margin-right: 4px; }
.half.on { color: var(--star); }
.stars:hover .half { color: var(--star-empty); }
.stars .half:hover, .stars .half:has(~ .half:hover) { color: var(--star); }
.half:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 0; z-index: 1; }
.rating-value { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2ch; }

.save-state { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; color: var(--muted); }
.save-state.on { animation: fade 2.5s forwards; }
@keyframes fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.notes-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; max-width: 640px; }
.notes-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.notes-form input, .notes-form textarea { width: 100%; min-width: 0; font-size: 13.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
.notes-form .wide { grid-column: 1 / -1; }
.steam-log { margin: 0; font-size: 13px; }
.steam-log:empty { display: none; }
.notes-form select { width: 100%; min-width: 0; font-size: 13.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }

/* play journal */
.h2-count { font-weight: 400; letter-spacing: 0; }
.journal-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; max-width: 640px; margin-bottom: 18px; }
.journal-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.journal-form input, .journal-form select, .journal-form textarea { width: 100%; min-width: 0; font-size: 13.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
.journal-form .wide { grid-column: 1 / -1; }
.journal-month { margin: 18px 0 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.journal-rows { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.journal-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 16px 24px 24px; gap: 4px 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.journal-row time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.journal-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--text); }
.journal-hours { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.journal-status { color: var(--sc); align-self: center; display: flex; }
.journal-status .icon { width: 14px; height: 14px; }
.journal-act { color: var(--muted); align-self: center; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 3px; opacity: .6; }
.journal-act:hover, .journal-act:focus-visible { color: var(--text); opacity: 1; background: var(--bg-3); }
.journal-del:hover, .journal-del:focus-visible { color: var(--danger); }
.journal-act .icon { width: 12px; height: 12px; }
.journal-row.editing { display: block; padding: 12px 0 12px 12px; border-left: 2px solid var(--accent); }
.journal-row.editing .journal-form { margin: 0; }
.form-actions { display: flex; align-items: center; gap: 14px; }
.dash-journal .journal-row { grid-template-columns: 92px minmax(0, 1fr) 16px; }
.journal-game { font-weight: 500; margin-right: 6px; }

.list-toggles { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.list-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 13px; color: var(--muted); max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.list-toggle:hover { color: var(--text); }
.list-toggle.on { color: var(--accent); }
/* "Hide from profile" (components/profile-hide.html) + the muted mark on own cards/rows */
.profile-hide { margin-top: 10px; padding-left: 12px; }
.profile-hide:empty { display: none; }
/* the viewer's own Steam achievements (components/achievements.html) */
.game-ach { margin: 10px 0 0; padding-left: 12px; font-size: 13px; }
.game-ach p { margin: 0; }
.ach-spark { display: block; width: 100%; max-width: 240px; height: 20px; margin-top: 6px; }
.ach-bar { fill: var(--accent); }
.ach-bar-empty { fill: var(--line); }
.ach-bar:hover { opacity: .8; }
/* achievement names (achievements.py; components/ach-macros.html): game page section, profile tab, day panel, review */
.ach-section h2 .h2-note { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.ach-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 4px 28px; }
.ach-sub { margin: 14px 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ach-list { list-style: none; margin: 0; padding: 0; }
.ach-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ach-list .ach-item:first-child { border-top: 0; }
.ach-icon { width: 32px; height: 32px; border-radius: 4px; background: var(--bg-3); object-fit: cover; }
.ach-icon-blank { display: block; box-shadow: inset 0 0 0 1px var(--line); }
.ach-item.is-locked .ach-icon { opacity: .55; }
.ach-text { min-width: 0; overflow-wrap: anywhere; }
.ach-name { color: var(--text); }
.ach-item.is-locked .ach-name { color: var(--text-2); }
.ach-item.is-masked .ach-name { font-style: italic; color: var(--muted); }
.ach-of { font-size: 12px; }
.ach-desc { display: block; font-size: 12px; }
.ach-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; white-space: nowrap; }
.ach-rar { font-size: 11.5px; font-weight: 600; }
.rar-ultra { color: var(--accent-2); }
.rar-rare { color: var(--s-played); }
.rar-uncommon { color: var(--s-want_to_play); }
.rar-common { color: var(--text-2); }
.ach-all { margin-top: 12px; }
.ach-all > summary { cursor: pointer; font-size: 13px; width: max-content; max-width: 100%; }
.ach-note { font-size: 12px; margin: 8px 0 0; }
/* paged full list (ach-macros ach_paged): range line, numbered pager (tap targets >= 28px) */
.ach-paged:focus:not(:focus-visible) { outline: none; }
.ach-range { margin: 8px 0 0; font-size: 12px; }
.ach-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0 0; font-size: 13px; }
.ach-pg { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--text-2); text-decoration: none; }
.ach-pg:hover { color: var(--text); border-color: var(--accent); }
.ach-pg[aria-current] { color: var(--text); background: var(--bg-3); border-color: var(--accent); font-weight: 600; }
.ach-pg.is-off { color: var(--muted); border-style: dashed; }
.ach-pg-gap { min-width: 16px; text-align: center; color: var(--muted); }
.followed-played { margin: 10px 0 0; padding-left: 12px; font-size: 13px; }
.ph-mark { display: inline-flex; align-items: center; color: var(--muted); }
.ph-mark .icon { width: 12px; height: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.facts a:hover { color: var(--accent); }
.footer-actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: baseline; margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.footer-actions a:hover { color: var(--text); }
.footer-actions .danger { margin-left: auto; }

/* ---- add game ---- */
.narrow { max-width: 720px; margin: 0 auto; }
.narrow h1 { margin-bottom: 16px; }
.login { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; }
.login .wordmark { gap: 10px; }
.login .wm-mark { width: 44px; height: 44px; }
.login .wm-text { width: 160px; height: 34px; }
.login-tag { margin: -8px 0 0; font-family: var(--display); font-size: 20px; color: var(--text-2); }
/* first sign-in (pages/welcome.html): one form, defaults preselected */
.welcome { max-width: 520px; margin: 32px auto; display: flex; flex-direction: column; gap: 14px; }
.welcome .mascot { width: 56px; height: 56px; }
.welcome h1 { margin: 0; overflow-wrap: anywhere; }
.welcome-lead { margin: 0; color: var(--text-2); }
.welcome-form { display: grid; gap: 18px; margin-top: 6px; }
.welcome-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 10px; }
.welcome-form legend { font-weight: 600; margin-bottom: 8px; }
.welcome-form label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.welcome-form label input { margin-top: 4px; flex: none; }
.welcome-form label .muted { display: block; font-size: 13px; }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 4px 0 0; }

/* ---- mascot (brand.svg#stage-*): own profile header, empty states, import progress, stage-up toast. Never on grids
   or game pages; static (no looping animation). ---- */
.mascot { display: block; flex: none; fill: var(--accent); color: var(--mascot); }
.empty-hoard { display: flex; align-items: center; gap: 14px; margin: 8px 0 24px; }
.empty-hoard .mascot { width: 48px; height: 48px; }
.empty-hoard .empty { margin: 0; }
/* error pages (errors.py: 400/403/404/405/410/413/429/500): wordmark, the empty-state hoardling, two fixed links */
.error-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 32px 16px; text-align: center; }
.error-page .wm-mark { width: 32px; height: 32px; }
.error-page .wm-text { width: 120px; height: 25px; }
.error-card { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 440px; width: 100%; padding: 32px 24px 28px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; }
.error-card .mascot { width: 72px; height: 72px; color: var(--text); margin-bottom: 4px; }
.error-code { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.error-card h1 { margin: 0; font: 400 28px/1.2 var(--display); color: var(--text); }
.error-text { margin: 0; color: var(--text-2); max-width: 36ch; overflow-wrap: anywhere; }
.error-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px 0 0; }
.login .muted { font-size: 13px; margin: 0; max-width: 40ch; }
/* Valve's official "Sign in through Steam" image (steamcommunity.com/dev sits_01, self-hosted for the CSP) */
.steam-signin { height: 40px; padding: 0 22px; font-size: 15px; }
/* site footer (base.html): nav + IGDB credit, then one fine-print line; error pages (errors.py) reuse it */
.site-footer { width: 100%; max-width: 1180px; margin: auto auto 0; padding: 20px 20px 32px; border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.6; color: var(--muted); }
/* room above the fixed bulk bar: its measured height (app.js sets --bulk-h), else a generous guess */
body:has(#game-grid .select:checked) .site-footer { padding-bottom: calc(var(--bulk-h, 160px) + 24px); }
.site-footer p { margin: 0; }
.site-footer .text-link { color: var(--muted); }
.site-footer .text-link:hover, .site-footer .text-link:focus-visible { color: var(--accent); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { padding: 4px 0; }
.footer-version { font-variant-numeric: tabular-nums; }
.site-footer .footer-fine { max-width: 90ch; margin-top: 8px; }
.error-page .site-footer { margin: 0; padding: 12px 0 0; max-width: 60ch; border-top: 0; text-align: center; }
.error-page .footer-top { justify-content: center; }
.error-page .footer-fine { margin-left: auto; margin-right: auto; }
/* /privacy, /terms (legal_routes.py): short-version box, on-page contents, tables that scroll in their own box */
.legal p, .legal li { color: var(--text-2); line-height: 1.6; }
.legal strong, .legal th { color: var(--text); font-weight: 600; }
.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 6px; }
.legal h2 { scroll-margin-top: 72px; }
.legal-unset { color: var(--muted); font-style: italic; }
.legal-back { margin: 0 0 12px; font-size: 13px; }
.legal-summary { margin: 20px 0 0; padding: 4px 20px 8px; background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 4px; }
.legal-summary h2 { margin-top: 12px; }
.legal-summary ul { margin-bottom: 4px; }
.legal-toc { margin: 24px 0 0; }
.legal-toc ol { columns: 2; column-gap: 32px; margin: 0; padding-left: 20px; }
.legal-toc li { break-inside: avoid; margin-bottom: 4px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 4px; }
.legal-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13px; }
.legal-table th, .legal-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top;
  line-height: 1.5; color: var(--text-2); overflow-wrap: break-word; }
.legal-table thead th { background: var(--bg-2); color: var(--text); }
.legal-table-5 { min-width: 680px; table-layout: fixed; }  /* what we keep: 5 columns, the "why" one widest */
.legal-table-5 .c-data { width: 17%; } .legal-table-5 .c-from { width: 19%; } .legal-table-5 .c-why { width: 30%; }
.legal-table-5 .c-basis { width: 14%; } .legal-table-5 .c-kept { width: 20%; }
.legal-table tbody th { color: var(--text); }
.legal-table tr:last-child > * { border-bottom: 0; }
.legal .legal-changes { list-style: none; padding-left: 0; }
.legal-changes time { color: var(--text); font-weight: 600; margin-right: 6px; }
/* /about (legal_routes.py): lede + FAQ as <details> */
.about .about-lede, .changes .about-lede { color: var(--text); font-size: 16px; }
.about-faq { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 4px; }
.about-faq details + details { border-top: 1px solid var(--line); }
.about-faq summary { padding: 10px 14px; cursor: pointer; color: var(--text); font-weight: 600; }
.about-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.about-faq details > p { margin: 0; padding: 0 14px 12px; }
/* /changes (changelog.py): dated entries, newest first; kind tags are small outlined labels */
.changes-entry { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.changes-entry:first-of-type { border-top: 0; padding-top: 0; }
.changes-entry h2 { margin: 6px 0 8px; padding: 0; border: 0; font-size: 18px; font-weight: 600; letter-spacing: 0;
  text-transform: none; line-height: 1.35; scroll-margin-top: 72px; }
.changes-entry h2 a { color: var(--text); }
.changes-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 13px; color: var(--muted); }
.changes-meta time { color: var(--text-2); font-weight: 600; }
.changes-version { font-variant-numeric: tabular-nums; }
.change-kind { padding: 1px 7px; border: 1px solid var(--line); border-radius: 3px; font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.login .login-legal { margin-top: -12px; }
.account-head { align-items: center; gap: 14px; }
.account-head h1 { margin: 0 0 2px; }
.account-head .text-link { font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 2px; background: var(--bg-3); }
.logout { margin-left: auto; }
.sync-form { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 20px 0 12px; padding-bottom: 8px; }
.sync-form .muted { font-size: 13px; }
.sync-wait { display: none; flex-basis: 100%; }
.sync-wait.htmx-request { display: block; }
.sync-carry { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; }
.sync-carry .mascot { width: 32px; height: 32px; color: var(--text); }
.sync-summary { font-size: 14px; color: var(--text-2); }
.unmatched summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.unmatched summary:hover { color: var(--text); }
.unmatched ul { columns: 2 220px; font-size: 13px; color: var(--text-2); padding-left: 18px; }
.big-search { position: relative; margin-bottom: 20px; }
.big-search input { width: 100%; height: 48px; font-size: 16px; padding: 0 14px !important; border-width: 0 0 1px !important; border-radius: 3px 3px 0 0 !important; }
.big-search input:focus-visible { box-shadow: none; border-bottom: 1px solid var(--accent) !important; }
.progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; overflow: hidden; }
.progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--accent); animation: slide 1s linear infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.htmx-indicator { visibility: hidden; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { visibility: visible; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { display: flex; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.search-results img, .thumb-blank { width: 40px; height: 56px; object-fit: cover; border-radius: 2px; background: var(--bg-3); flex: none; }
.search-results .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.search-results .title { font-weight: 500; align-self: flex-start; }
.search-results .title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.search-results .sr-thumb { display: block; flex: none; }
.search-results .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .action { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.search-results .action form { display: flex; gap: 6px; }
.search-results select { font-size: 12.5px; min-height: 32px; }

/* ---- lists ---- */
.new-list { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.new-list input { width: 180px; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px 28px; }
.list-tile { display: flex; flex-direction: column; min-width: 0; }
.fan { display: flex; margin-bottom: 10px; }
.fan .cover { width: 64px; flex: none; box-shadow: 3px 0 6px rgb(0 0 0 / .35); }
.fan .cover + .cover { margin-left: -18px; }
.fan .cover:nth-child(1) { z-index: 5; } .fan .cover:nth-child(2) { z-index: 4; } .fan .cover:nth-child(3) { z-index: 3; }
.fan .cover:nth-child(4) { z-index: 2; } .fan .cover:nth-child(5) { z-index: 1; }
.fan .cover.blank { background: var(--bg-2); box-shadow: none; }
.fan .no-cover span { display: none; }
.list-tile:hover .fan .cover::after { box-shadow: inset 0 0 0 1px var(--accent); }
.list-name { font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.list-tile:hover .list-name { color: var(--accent); }
.list-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list-head { justify-content: space-between; align-items: flex-end; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.list-head h1 { margin: 2px 0 4px; }
.list-head p { margin: 2px 0 0; font-size: 13px; }
.head-actions { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.head-actions form { display: inline; }
/* list privacy + sharing (components/list-share.html) */
.only-me { display: inline-block; margin-left: 4px; padding: 0 5px; border: 1px solid var(--line); border-radius: 2px;
  font-size: 10.5px; line-height: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-2);
  background: var(--bg-2); vertical-align: 1px; }
.list-share { margin: -12px 0 20px; font-size: 13px; }
.list-share summary { cursor: pointer; color: var(--text-2); width: max-content; max-width: 100%; }
.list-share summary:hover { color: var(--text); }
.list-share-body { display: grid; gap: 16px; margin-top: 10px; padding: 14px 16px; max-width: 640px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; }
.list-share fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.list-share legend, .list-share h2 { margin: 0 0 6px; padding: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.list-share h2 { display: block; text-transform: none; letter-spacing: 0; border: 0; }
.list-share label { display: flex; gap: 8px; align-items: center; color: var(--text-2); cursor: pointer; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-url { flex: 1 1 260px; min-width: 0; font-size: 12.5px; }
.share-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.share-actions form { display: inline; }
.list-share .hint { margin: 8px 0 0; font-size: 12.5px; }
.card-wrap { position: relative; min-width: 0; }
.remove-from-list {
  position: absolute; top: 6px; right: 6px; z-index: 4; width: 22px; height: 22px; display: grid; place-items: center;
  background: rgb(0 0 0 / .7); color: #fff; border-radius: 2px; opacity: 0; transition: opacity .1s;
}
.remove-from-list .icon { width: 14px; height: 14px; vertical-align: 0; }
.card-wrap:hover .remove-from-list, .remove-from-list:focus-visible { opacity: 1; }
.remove-from-list:hover { background: var(--danger); }
@media (hover: none) { .remove-from-list { opacity: 1; } }

/* ---- responsive ---- */
@media (max-width: 999px) {
  .dash { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dash-side h2 { margin-top: 32px; }
  .legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 24px; }
  .legend-total { border-top: 0; margin-top: 0; padding-top: 0; }
}
@media (max-width: 760px) {
  .nav-inner { gap: 12px; padding: 0 16px; }
  .nav-links .nav-home { display: none; }  /* the wordmark links home; room for Discover */
  .nav-search, .nav-add { display: none; }
  .nav-search-open { display: flex; }
  .navbar.search-open .nav-search { display: flex; position: absolute; inset: 0 0 auto; height: 48px; z-index: 25; margin: 0; padding: 0 4px 0 12px; gap: 4px; background: var(--bg-2); }
  .navbar.search-open .nav-search > .icon { left: 21px; }
  .navbar.search-open .nav-search input { flex: 1; min-width: 0; width: auto; height: 36px; font-size: 16px; }  /* 16px: no iOS zoom-in */
  .navbar.search-open .nav-search input::-webkit-search-cancel-button { display: none; }  /* the ✕ button closes */
  .navbar.search-open .nav-search-close { display: flex; }
  .navbar.search-open .nav-search .sg-list { top: calc(100% + 1px); left: 0; right: 0; width: auto; max-width: none; border-radius: 0; border-width: 0 0 1px;
    max-height: calc(100vh - 49px); max-height: calc(100dvh - 49px); font-size: 14px; }
  .nav-links { column-gap: 14px; margin-left: auto; }
  .navbar .btn.primary { padding: 0 10px; }
  .wordmark { gap: 5px; }
  .wm-mark { width: 22px; height: 22px; }
  .wm-text { width: 80px; height: 17px; }
  .hide-sm { display: none; }
  main { padding: 16px 16px 32px; }
  .site-footer { padding: 16px 16px 28px; }
  .legal-toc ol { columns: 1; }
  .login { min-height: 64vh; }  /* with the footer: no 1px page scroll on phones */
  .legal-summary { padding: 4px 16px 8px; }
  .grid, .grid-lg { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 8px; }
  .library { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tabs" "tool" "side" "main"; }
  .tabs { margin: 0 -16px 12px; padding: 0 16px; }
  /* phones: the facet headers wrap onto rows at their natural width (one squeezed row overlapped); open = own row */
  .filters { position: static; max-height: none; display: flex; flex-wrap: wrap; column-gap: 16px; margin-bottom: 12px; }
  .facet { flex: 1 1 auto; min-width: 0; }
  .facet summary { gap: 8px; white-space: nowrap; }
  .facet[open] { flex-basis: 100%; }
  .bulk-sep { display: none; }  /* the bar wraps on phones: dividers would dangle at line ends */
  .facet:not([open]) .hint { display: none; }
  .search-field { max-width: none; flex-basis: 100%; }
  .sort-field { margin-left: 0; }
  .sort-field .label { display: none; }
  .detail { grid-template-columns: 120px minmax(0, 1fr); column-gap: 16px; grid-template-areas: "cover head" "side side" "main main"; grid-template-rows: auto; }
  .detail-head { align-self: center; }
  .detail h1 { font-size: 24px; }
  .detail-side .status-control { display: grid; grid-template-columns: 1fr 1fr; }
  .detail-main { margin-top: 8px; }
  .notes-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* minmax(0): mobile date inputs' intrinsic width */
  .backdrop { width: calc(100% + 32px); margin: -16px -16px -100px; }
  .new-list { margin-left: 0; width: 100%; }
  .new-list input { flex: 1; width: auto; min-width: 0; }
  .list-head { flex-direction: column; align-items: flex-start; }
  .footer-actions .danger { margin-left: 0; }
}
/* ---- library Graph view (components/library-graph.html, static/js/graph.js) ---- */
.graph-mode .sort-field, .graph-mode .dir-toggle, .graph-mode .select-toggle { display: none; }
.graph { display: flex; flex-direction: column; gap: 10px; }
.graph-bar { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.graph-find { flex: 1 1 220px; }
.graph-panel { position: relative; }
.graph-panel > summary { list-style: none; cursor: pointer; }
.graph-panel > summary::-webkit-details-marker { display: none; }
.graph-panel[open] > summary { color: var(--accent); border-color: var(--accent); }
.graph-panel-body { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.graph-panel fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; border: 0; margin: 0; padding: 0; }
.graph-panel legend { float: left; padding: 0; margin-right: 2px; }
.graph-panel .opt { white-space: nowrap; }
.graph-panel .opt.radio:has(input:checked)::before { content: "\2022"; margin-right: 6px; }
.graph-zoom { display: inline-flex; margin-left: auto; }
@media (min-width: 761px) {  /* desktop: the options are a row under the bar (graph.js opens the details) */
  .graph-panel { order: 3; flex-basis: 100%; }
  .graph-panel > summary { display: none; }
}
.graph-zoom .btn { padding: 0 10px; min-width: 34px; justify-content: center; }
.graph-zoom .btn + .btn { margin-left: -1px; }
.graph-zoom .btn:first-child { border-radius: 3px 0 0 3px; }
.graph-zoom .btn:last-child { border-radius: 0 3px 3px 0; }
.graph-zoom .btn:not(:first-child):not(:last-child) { border-radius: 0; }
.graph-stage {
  position: relative; height: min(72vh, 760px); min-height: 360px; border: 1px solid var(--line); border-radius: 3px;
  background: radial-gradient(ellipse at 50% 45%, var(--bg-2), var(--bg) 75%); overflow: hidden;
}
.graph-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; }
.graph-canvas:active { cursor: grabbing; }
.graph-canvas:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: -2px; }
.graph-msg { position: absolute; left: 12px; bottom: 8px; margin: 0; font-size: 12px; color: var(--muted); }
.graph-tip {
  position: absolute; z-index: 4; display: flex; gap: 10px; align-items: center; max-width: 280px; padding: 8px 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 6px 18px rgb(0 0 0 / .3);
  pointer-events: none; font-size: 12.5px;
}
.graph-tip[hidden] { display: none; }
.graph-tip img { width: 45px; height: 60px; object-fit: cover; border-radius: 2px; flex: none; background: var(--bg-3); }
.graph-tip div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.graph-tip strong { font-weight: 600; overflow-wrap: anywhere; }
.graph-desc { margin: 0; font-size: 12px; color: var(--muted); max-width: 80ch; }
.graph-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--text-2); }
.graph-legend li { display: flex; align-items: center; gap: 6px; }
.graph-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc, var(--muted)); flex: none; }
.graph-key { width: 8px; height: 8px; transform: rotate(45deg); border: 1.5px solid var(--kc, var(--muted)); flex: none; margin: 0 1px; }
.k-series { --kc: var(--g-series); } .k-developer { --kc: var(--g-developer); } .k-genre { --kc: var(--g-genre); }
.k-theme { --kc: var(--g-theme); } .k-similar { --kc: var(--g-similar); }
.graph-links .graph-key.k-similar { transform: none; border-width: 0 0 1.5px; width: 10px; height: 0; }
.graph-list summary { cursor: pointer; font-size: 12.5px; width: fit-content; }
.graph-list h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.graph-list ul { margin: 0; padding-left: 18px; font-size: 13px; }
.graph-list li { margin: 3px 0; }
.graph-list .link { font-weight: 600; color: var(--text); }
.graph-list .graph-list-games { display: flex; flex-wrap: wrap; gap: 2px 12px; list-style: none; padding: 2px 0 4px; color: var(--text-2); }
.graph-list .graph-list-games a:hover { color: var(--accent); }
@media (max-width: 760px) {
  .graph-stage { height: min(62vh, 100vw); min-height: 320px; }  /* the settled layout is roughly round: no empty bands */
  .graph-find { flex-basis: 100%; }
  .graph-panel[open] .graph-panel-body {  /* a drop-down over the graph */
    position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 6px; padding: 10px 12px; flex-direction: column;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 8px 24px rgb(0 0 0 / .3);
  }
}

@media (min-width: 761px) and (max-width: 980px) {  /* table view: the two date columns go so the page itself never scrolls sideways */
  .gtable .c-gupdate, .gtable .c-updated { display: none; }
  .gtable .trow { grid-template-columns: 16px 32px minmax(0, 2.2fr) minmax(0, 1.2fr) 112px 72px 40px 80px 44px; }
}
@media (max-width: 760px) {  /* table view: dense rows (cover, title, rating, status) */
  .thead, .trow .c-plat, .trow .c-igdb, .trow .c-time, .trow .c-year, .trow .c-gupdate, .trow .c-updated, .library:not(.selecting) .trow .c-check { display: none; }
  .trow { grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 10px; padding: 4px 2px; }
  .library.selecting .trow { grid-template-columns: 22px 32px minmax(0, 1fr) auto auto; }
  .library.selecting .trow .select { width: 20px; height: 20px; }
  .trow .c-rating { order: 1; }
  .trow .c-status { order: 2; }
  .trow .tstatus-label { display: none; }
  .trow .status-btn { margin: 0; width: 34px; justify-content: center; border: 1px solid var(--line); background: var(--bg-2); }
  .gtable { border-top: 0; }
}
@media (max-width: 420px) { .navbar .wm-mark { display: none; } }  /* room for the avatar menu on phones */
@media (max-width: 380px) {  /* 320px (WCAG reflow): the mark stands in for the wordmark text, tighter gaps */
  .navbar .wm-mark { display: block; } .navbar .wm-text { display: none; }
  .nav-inner { gap: 10px; padding: 0 12px; } .nav-links { column-gap: 10px; }
}
/* member nav (5 links): between 761 and 960px tighter gaps, a narrower search and the avatar without its name; on phones (search
   icon, no Add) the mark stands in for the wordmark text up to 480px, gaps tighten at 372px and below 352px the links take a second row */
@media (min-width: 761px) and (max-width: 960px) {
  .navbar:not(.navbar-guest) .nav-inner { gap: 12px; padding: 0 16px; } .navbar:not(.navbar-guest) .nav-links { column-gap: 16px; }
  .navbar:not(.navbar-guest) .nav-search input { width: 144px; } .navbar:not(.navbar-guest) .nav-user .hide-sm { display: none; }
}
@media (max-width: 480px) {
  .navbar:not(.navbar-guest) .wm-mark { display: block; } .navbar:not(.navbar-guest) .wm-text { display: none; }
  .navbar:not(.navbar-guest) .nav-inner { gap: 10px; padding: 0 12px; } .navbar:not(.navbar-guest) .nav-links { column-gap: 12px; }
}
@media (max-width: 372px) { .navbar:not(.navbar-guest) .nav-inner { gap: 8px; } .navbar:not(.navbar-guest) .nav-links { column-gap: 10px; } }
@media (max-width: 352px) {  /* 320px (WCAG reflow): the links get their own row under the mark, search and avatar */
  .navbar:not(.navbar-guest) .nav-inner { flex-wrap: wrap; height: auto; row-gap: 0; }
  .navbar:not(.navbar-guest) .nav-inner > .nav-search-open { margin-left: auto; }
  .navbar:not(.navbar-guest) .nav-links { order: 1; flex: 1 0 100%; margin-left: 0; column-gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01ms !important; } }

/* quick-status: name of the hovered/focused icon, so the 7 glyphs are self-explanatory */
.quick button::after {
  content: attr(data-label); position: absolute; left: 0; right: 0; bottom: 32px; padding: 0 6px;
  text-align: center; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .9);
  opacity: 0; pointer-events: none;
}
.quick button:hover::after, .quick button:focus-visible::after { opacity: 1; }
.first-run { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; font-size: 14px; }
.first-run .muted { font-size: 13px; }

/* ---- round 4: list page tools/edit/ranking/table, screenshots, account data ---- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* a11y: skip link (base.html; visible on keyboard focus); <main tabindex=-1> takes focus from it without a ring */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 60; padding: 8px 14px; border-radius: 3px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.skip-link:focus { top: 8px; color: var(--accent-ink); }
main:focus { outline: none; }
.list-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.list-tools .list-add { flex: 1; margin: 0; }
.view-toggle .btn[aria-current="true"] { color: var(--accent); border-color: var(--accent); position: relative; z-index: 1; }
.head-actions { flex-wrap: wrap; }
.head-actions .list-toggle { padding: 0; align-items: baseline; }
/* the icon has no baseline: centred and out of baseline alignment, so the button's baseline is its text's, not the svg's bottom edge */
.head-actions .list-toggle .icon { align-self: center; }
.list-desc { max-width: 65ch; }
.list-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px 14px; align-items: end; }
.list-edit label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.list-edit input { width: 100%; min-width: 0; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
.list-edit .form-actions { grid-column: 1 / -1; }
.list-body:has(.card-wrap) .list-empty { display: none; }
.ltable:not(:has(.card-wrap)) { display: none; }
.l-btn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 3px; color: var(--muted); }
.l-btn:hover:not(:disabled), .l-btn:focus-visible { background: var(--bg-3); color: var(--text); }
.l-btn:disabled { opacity: .25; cursor: default; }
.l-btn .icon { width: 14px; height: 14px; }
.l-rank { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
ol.rank-list { list-style: none; padding: 0; margin: 0; } /* IGDB list page (guests): ranks are the .l-rank badges */
.igdb-list-foot { margin-top: 28px; font-size: 12.5px; }
/* grid: rank badge on the cover, move buttons under the card */
.grid .l-rank {
  position: absolute; top: 6px; left: 6px; z-index: 4; min-width: 22px; height: 22px; padding: 0 5px;
  display: grid; place-items: center; background: rgb(0 0 0 / .75); color: #fff; font-size: 12px; border-radius: 2px;
}
.grid .l-actions { display: flex; gap: 4px; margin-top: 6px; }
.grid .l-move { flex: 1; height: 26px; border: 1px solid var(--line); background: var(--bg-2); }
.grid .l-actions:not(:has(.l-move)) { display: contents; }
/* table: [rank] row [actions]; the row is the library's game-row without its checkbox column */
.ltable .litem { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.list-body.ranked .ltable .litem { grid-template-columns: 30px minmax(0, 1fr) 92px; }
.ltable .litem:not(.lhead):hover { background: var(--bg-2); }
.ltable .trow { border-bottom: 0; grid-template-columns: 32px minmax(0, 2.2fr) minmax(0, 1.2fr) 112px 72px 40px 80px 44px 116px 84px; }
.ltable .trow:not(.thead):hover { background: none; }
.ltable .c-check { display: none; }
.ltable .l-rank { text-align: right; font-size: 13px; }
.ltable .lhead .l-rank { font-size: 11px; color: var(--muted); }
.ltable .l-actions { display: flex; justify-content: flex-end; gap: 2px; padding-right: 4px; }
.ltable .remove-from-list { position: static; opacity: 1; background: none; color: var(--muted); }
.ltable .remove-from-list:hover { background: var(--bg-3); color: var(--danger); }
/* another member's list (read-only table): no actions column */
.list-body.readonly .ltable .litem { grid-template-columns: minmax(0, 1fr); }
.list-body.readonly.ranked .ltable .litem { grid-template-columns: 30px minmax(0, 1fr); }
.ltable .lhead .l-rank.th { justify-self: end; }
/* sorted by a column header: the way back to the list's own order */
.list-sorted { margin: 0 0 10px; font-size: 13px; }
.list-sorted .text-link { display: inline-flex; align-items: center; gap: 4px; }
.list-sorted .icon { width: 14px; height: 14px; }
/* game page preview (a game not in the catalog, discover_routes.game_preview) */
.preview-note { display: flex; gap: 8px; align-items: flex-start; max-width: 62ch; margin: 10px 0 0; padding: 8px 10px;
  border: 1px solid var(--line); border-left: 3px solid var(--s-want_to_play); border-radius: 2px; background: var(--bg-2);
  font-size: 13px; color: var(--text-2); }
.preview-note .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--s-want_to_play); }
.log-hint { margin: 4px 0 0; font-size: 12.5px; }
.similar-strip { list-style: none; margin: 0; padding: 0 0 6px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; }
.similar-strip li { flex: none; width: 96px; scroll-snap-align: start; }
.similar { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.3; color: var(--text-2); }
.similar-cover { position: relative; display: block; width: 96px; aspect-ratio: 264 / 374; border-radius: 2px; overflow: hidden; background: var(--bg-3); box-shadow: var(--cover-edge); }
.similar-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.similar.lib .similar-cover { box-shadow: inset 0 0 0 2px var(--sc); }
.similar.lib .similar-cover img { opacity: .9; }
.similar-status { position: absolute; top: 4px; right: 4px; display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center;
  border-radius: 2px; background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--sc); }  /* status tokens are >= 4.5:1 on bg in every theme */
.similar-status .icon { width: 13px; height: 13px; }
.similar-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.similar-meta { font-size: 11px; color: var(--muted); }
.similar:hover .similar-name { color: var(--accent); }
.similar:hover .similar-cover { outline: 2px solid var(--accent); outline-offset: -2px; }
/* "In this series" (components/series.html): the similar strip + the current game marked */
.series-sec { margin: 8px 0 24px; }
.series-sec h2 { flex-wrap: wrap; row-gap: 2px; }
.series-name { min-width: 0; color: var(--text-2); }
.similar.current .similar-cover { outline: 2px solid var(--accent); outline-offset: -2px; }
.series-here { color: var(--text-2); font-weight: 600; }
.series-more { margin: 6px 0 0; font-size: 12.5px; }
/* screenshots strip + lightbox */
.shots { margin: 16px 0 24px; }
.shot-strip { list-style: none; margin: 0; padding: 0 0 6px; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; }
.shot-strip li { flex: none; scroll-snap-align: start; }
.shot { display: block; border-radius: 2px; }
.shot img { display: block; width: 220px; height: auto; aspect-ratio: 569 / 320; object-fit: cover; border-radius: 2px; background: var(--bg-3); box-shadow: var(--cover-edge); }
.shot:hover img, .shot:focus-visible img { outline: var(--focus-w) solid var(--focus); outline-offset: -2px; }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(0 0 0 / .92); color: #fff; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(0 0 0 / .6); }
.lightbox-img { max-width: min(1280px, 94vw); max-height: 84dvh; object-fit: contain; border-radius: 2px; }
.lightbox-count { position: absolute; bottom: 14px; left: 0; right: 0; margin: 0; text-align: center; font-size: 13px; color: rgb(255 255 255 / .75); }
.lightbox-btn { position: absolute; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; border-radius: 3px; background: rgb(255 255 255 / .08); }
.lightbox-btn:hover, .lightbox-btn:focus-visible { background: rgb(255 255 255 / .2); }
.lightbox-btn .icon { width: 20px; height: 20px; }
.lightbox-prev { left: 12px; top: calc(50% - 22px); }
.lightbox-next { right: 12px; top: calc(50% - 22px); }
.lightbox-close { right: 12px; top: 12px; }
.lightbox.single .lightbox-prev, .lightbox.single .lightbox-next { display: none; }
/* trailers: strip thumbnails (play badge + label, theme tokens) and the click-to-load facade in the lightbox */
.shot-video { position: relative; }
.shot-play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 10px rgb(0 0 0 / .45); pointer-events: none; }
.shot-play .icon { width: 18px; height: 18px; margin-left: 3px; }
.shot-label { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 2px; background: var(--bg-2); color: var(--text);
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; pointer-events: none; }
.shot-video:hover .shot-play, .shot-video:focus-visible .shot-play { filter: brightness(1.1); transform: scale(1.06); }
.lightbox-img[hidden], .lightbox-video[hidden], .lightbox-play[hidden] { display: none; }
.lightbox-video { width: min(1280px, 94vw, calc(80dvh * 16 / 9)); display: grid; gap: 10px; }
.lightbox-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 2px; overflow: hidden; }
.lightbox-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox-play { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.lightbox-poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox-play .shot-play { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
.lightbox-play .shot-play .icon { width: 28px; height: 28px; margin-left: 4px; }
.lightbox-play:hover .shot-play { filter: brightness(1.1); transform: scale(1.06); }
/* the frame clips (overflow: hidden), so the ring goes inside the edge, plus a ring on the play badge itself */
.lightbox-play:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: calc(-1 * var(--focus-w) - 2px); }
.lightbox-play:focus-visible .shot-play { box-shadow: 0 0 0 2px var(--accent-ink), 0 0 0 5px var(--focus), 0 2px 10px rgb(0 0 0 / .45); }
.lightbox-video-meta { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 13px; color: rgb(255 255 255 / .85); }
.lightbox-video-name { overflow-wrap: anywhere; }
.lightbox-yt { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.lightbox-yt:hover { text-decoration-thickness: 2px; }
/* account: export + delete */
.account-note { font-size: 13px; margin: 0 0 10px; }
/* Account > Privacy / Adult content (+ the adult picker in the guest menu, components/adult-picker.html) */
.account-choice { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 8px; }
.account-choice fieldset, .adult-picker fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.account-choice fieldset { display: grid; gap: 6px; }
.account-choice legend { margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 600; }
.account-choice label { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.account-choice .platform-picks { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px 14px; flex: 1 1 100%; }
.platform-picks legend { grid-column: 1 / -1; }
.adult-picker { margin-bottom: 8px; }
.adult-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.adult-picker-menu { margin: 0; border-top: 1px solid var(--line); }
.adult-picker-menu .adult-opts { padding: 0 14px 10px; }
.adult-opt[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
.export-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.btn .icon { width: 14px; height: 14px; }
.text-link.danger { color: var(--danger); text-decoration-color: currentColor; }
.account-danger { margin-top: 32px; font-size: 13px; }
.danger-btn { background: var(--danger); border-color: var(--danger); color: var(--bg); font-weight: 600; }  /* >= 5:1 both themes */
.danger-btn:hover { color: var(--bg); filter: brightness(1.08); border-color: var(--danger); }
/* themed confirm dialog (base.html #confirm-dialog, js/confirm.js) */
.confirm { width: min(420px, calc(100vw - 32px)); max-width: none; margin: auto; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg-2); color: var(--text); box-shadow: 0 18px 48px rgb(0 0 0 / .35); }
.confirm.danger { border-top: 3px solid var(--danger); }
.confirm::backdrop { background: rgb(0 0 0 / .55); background: color-mix(in srgb, var(--backdrop) 60%, transparent); }
.confirm[open] { animation: confirm-in .14s ease-out; }
.confirm[open]::backdrop { animation: confirm-fade .14s ease-out; }
@keyframes confirm-in { from { opacity: 0; transform: scale(.96); } }
@keyframes confirm-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confirm[open], .confirm[open]::backdrop { animation: none; } }
.confirm-box { padding: 20px 20px 16px; }
.confirm-title { display: block; margin: 0 0 8px; padding: 0; border: 0; font-size: 17px; font-weight: 650; line-height: 1.3;
  text-transform: none; letter-spacing: normal; color: var(--text); }
.confirm-msg { margin: 0 0 18px; color: var(--text-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.confirm-actions .btn { height: 36px; padding: 0 14px; justify-content: center; }
.confirm-actions .btn:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: 2px; }
@media (max-width: 480px) {
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .btn { width: 100%; height: 44px; }
}
.delete-account { display: grid; gap: 14px; max-width: 440px; margin-top: 20px; }
.delete-account label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.notice-ok { border-left-color: var(--accent); }
/* one-time "we gave you @oni-2" banner (base.html, users.handle_hint) */
.handle-hint { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-right: 8px; }
.handle-hint p { margin: 0; flex: 1; }
.handle-hint form { margin: 0; }
/* first Steam import: next steps (components/sync-result.html; the reply to that one sync, dismiss = gone) */
.first-steps { position: relative; margin: 14px 0 6px; padding: 16px 44px 14px 18px; background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; }
.first-steps h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.first-steps > .muted { margin: 0 0 10px; font-size: 13px; }
.first-steps .toast-close { position: absolute; top: 8px; right: 8px; }
.first-steps-list { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.first-steps-list .muted { font-size: 13px; }
.first-steps-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; }
.first-steps-foot .muted { font-size: 13px; }
.steam-private p { margin: 0 0 6px; }
.steam-private p:last-child { margin: 0; }
.sync-wait .sync-note { margin: 2px 0 0 42px; font-size: 13px; }
@media (max-width: 760px) {
  .list-tools { flex-wrap: wrap; }
  .list-tools .list-add { flex-basis: 100%; order: 2; }
  .list-edit { grid-template-columns: minmax(0, 1fr); }
  /* the header row becomes a wrapping row of sort links (the columns themselves are hidden on phones) */
  .ltable .lhead { display: block; }
  .ltable .lhead .l-rank, .ltable .lhead .l-actions, .ltable .lhead .c-check, .ltable .lhead .c-cover, .ltable .lhead span.th { display: none; }
  .ltable .lhead .thead { display: flex; flex-wrap: wrap; gap: 0 14px; min-height: 0; padding: 2px 2px 6px; }
  .ltable .lhead .thead > a.th { display: inline-flex; min-height: 32px; order: 0; }
  .ltable .lhead .thead::before { content: "Sort by"; align-self: center; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
  .ltable .trow { grid-template-columns: 32px minmax(0, 1fr) auto auto; }
  .list-body.ranked .ltable .litem { grid-template-columns: 20px minmax(0, 1fr) 88px; }
  .list-body.readonly.ranked .ltable .litem { grid-template-columns: 20px minmax(0, 1fr); }
  .ltable .l-actions { padding-right: 0; }
  .shot img { width: 160px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 8px; }
}

/* "Out now": a wanted game released in the last 7 days (library cards/rows) */
.out-now { color: var(--accent); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }

/* active-filter chip kind ("Genre: RPG"); profile library: back link, read-only status */
.chip[data-kind]::before { content: attr(data-kind) ":"; color: var(--muted); }
.back-overview { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; font-size: 12.5px; }
.back-overview .icon { width: 12px; height: 12px; }
.card .ro-status { margin-left: auto; }
.card .ro-status .icon { width: 12px; height: 12px; vertical-align: 0; }
.trow .status-tag.tstatus { gap: 6px; font-size: 13px; white-space: nowrap; }
.trow .status-tag.tstatus .icon { width: 14px; height: 14px; }
/* DLC & expansions (schema v10): badges, library indicator, the game page section */
.plat-tag { color: var(--muted); white-space: nowrap; }  /* "Not on PC" (my_platforms.not_on) */
.search-results .plat-tag { font-size: 12px; }
.type-tag { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-radius: 2px; font-size: 10px; font-weight: 600;
  line-height: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); vertical-align: 1px; white-space: nowrap; }
.dlc-prog { display: inline-block; padding: 0 4px; border-radius: 2px; background: var(--bg-3); font-size: 10.5px; font-weight: 600;
  line-height: 16px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: 1px; }
.dlc-prog.done { color: var(--accent); }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 0; }
.trow .c-title .type-tag, .trow .c-title .dlc-prog { margin-left: 4px; }
.facet-dlc { padding: 8px 0; border-bottom: 1px solid var(--line); }
.dlc-parent { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.dlc-sec { margin: 8px 0 24px; }
.dlc-note { margin: -4px 0 8px; font-size: 12.5px; }
.dlc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dlc-row { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0 8px 8px;
  border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.dlc-row.tracked { border-left-color: var(--sc); }
.dlc-cover { position: relative; display: block; width: 45px; aspect-ratio: 264 / 374; border-radius: 2px; overflow: hidden; background: var(--bg-3); box-shadow: var(--cover-edge); }
.dlc-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dlc-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dlc-name { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.dlc-name:hover { color: var(--accent); }
.dlc-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.dlc-controls { display: flex; align-items: center; gap: 12px; }
.dlc-status { max-width: 170px; }
@media (max-width: 760px) {
  .dlc-row { grid-template-columns: 45px minmax(0, 1fr); }
  .dlc-controls { grid-column: 2; flex-wrap: wrap; gap: 8px 12px; }
  .filters:has(.facet-dlc) { flex-wrap: wrap; row-gap: 0; }
  .facet-dlc { flex-basis: 100%; display: flex; flex-wrap: wrap; column-gap: 16px; padding: 0 0 4px; border: 0; }
}

/* ---- colour themes (static/themes.css, theme.js): ::selection + the picker ---- */
::selection { background: var(--sel-bg); color: var(--sel-text); }
.theme-picker fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.theme-opt i { display: block; }
.theme-check { width: 14px; height: 14px; flex: none; color: var(--accent); visibility: hidden; }
.theme-opt[aria-pressed="true"] .theme-check { visibility: visible; }
/* avatar menu / login: compact list, round swatch = the theme's page colour + accent dot */
.theme-picker-menu { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 2px; }
.theme-picker-menu fieldset { display: flex; flex-direction: column; }
.theme-legend { padding: 6px 14px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.theme-picker-menu .theme-opt { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 12px 6px 14px; font-size: 13px; color: var(--text-2); text-align: left; white-space: nowrap; }
.theme-picker-menu .theme-opt:hover, .theme-picker-menu .theme-opt[aria-pressed="true"] { color: var(--text); background: var(--bg-3); }
.theme-picker-menu .theme-opt:focus-visible { outline-offset: -2px; }
.theme-picker-menu .theme-check { margin-left: auto; }
/* outer ring in the text colour of the surrounding theme (currentColor is inherited; the swatch's own tokens are its
   theme's): a light theme's swatch stays visible on a light menu, a dark one on a dark menu */
.theme-swatch { position: relative; display: flex; width: 16px; height: 16px; flex: none; border-radius: 50%; overflow: hidden; background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 1px color-mix(in srgb, currentColor 40%, transparent); }
.theme-swatch i { width: 7px; height: 7px; margin: auto; border-radius: 50%; background: var(--accent); }
.theme-swatch.split { background: none; }
.theme-swatch-half { flex: 1; display: flex; background: var(--bg); }
.theme-swatch-half i { width: 5px; height: 5px; }
.theme-swatch.split::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
/* /account Appearance: cards with a miniature page (nav bar, cover, title, status dots) in the theme's own tokens */
.theme-picker-cards fieldset { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .theme-picker-cards fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }  /* phones: 2 across, not 7 tall cards */
.theme-picker-cards .theme-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; align-content: start; gap: 8px 6px; padding: 8px 10px 10px 8px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2); color: var(--text); text-align: left; }
.theme-picker-cards .theme-opt:hover { border-color: var(--muted); }
.theme-picker-cards .theme-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-picker-cards .theme-check { margin-top: 2px; }
.theme-preview { grid-column: 1 / -1; display: flex; height: 92px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.theme-preview-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.tp-nav { display: flex; align-items: center; gap: 6px; height: 20px; flex: none; padding: 0 8px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.tp-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tp-line { width: 34px; height: 4px; border-radius: 2px; background: var(--text-2); }
.tp-btn { width: 18px; height: 9px; margin-left: auto; border-radius: 2px; background: var(--accent); }
.tp-body { flex: 1; display: flex; gap: 8px; padding: 8px; min-height: 0; }
.tp-cover { width: 30px; flex: none; border-radius: 2px; background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line); }
.tp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tp-title { width: 80%; height: 6px; border-radius: 2px; background: var(--text); }
.tp-sub { width: 55%; height: 4px; border-radius: 2px; background: var(--muted); }
.tp-dots { display: flex; gap: 4px; margin-top: auto; }
.tp-dots i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.theme-preview.split .tp-cover { display: none; }  /* half-width panes: room for the status dots */
.theme-card-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.theme-card-text .theme-name { font-weight: 600; font-size: 13px; }
.theme-desc { font-size: 12px; color: var(--muted); }
.login-theme { font-size: 13px; }
.login-theme > summary { height: auto; color: var(--muted); }
.login-theme .nav-menu-list { text-align: left; right: auto; left: 50%; top: auto; bottom: calc(100% + 6px); transform: translateX(-50%); }
.login-theme .theme-picker-menu { border-top: 0; margin-top: 0; }

/* search typeahead (static/js/search.js, components/search-suggest.html): overlays the page, no layout shift */
.sg-list { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; display: block; width: max(100%, 340px); max-width: calc(100vw - 32px);
  max-height: min(70vh, 460px); overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .28); padding: 4px 0; text-align: left; font-size: 13px; }
.sg-list[hidden] { display: none; }
.nav-search .sg-list { left: auto; right: 0; width: 360px; }
.sg-head { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 6px 12px; color: var(--text); text-decoration: none; min-height: 44px; }
.sg-item:hover, .sg-item[aria-selected="true"] { background: var(--bg-3); color: var(--text); }
.sg-item[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
.sg-thumb { flex: none; width: 30px; height: 40px; border-radius: 2px; overflow: hidden; background: var(--bg-3); }
.sg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sg-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.sg-hint { color: var(--text-2); }
.sg-item .status-tag { flex: none; font-size: 12px; }
.sg-all { border-top: 1px solid var(--line); margin-top: 4px; min-height: 40px; color: var(--accent); }
.sg-all .sg-name { font-weight: 500; }
.sg-none { margin: 0; padding: 8px 12px 4px; color: var(--muted); }
/* library "not on Hoardling yet" empty state (components/game-grid.html) */
.missing { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.missing .btn { margin-top: 4px; }
.missing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; max-width: 560px; }
.missing-list .sg-item { border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); }

/* ---- public read-only pages (guests): header, homepage, sign-in cards, /search ---- */
.nav-theme .icon { color: var(--muted); }
.home-hero { max-width: 680px; margin: 24px 0 8px; display: flex; flex-direction: column; gap: 14px; }
.home-hero h1 { font-size: 34px; line-height: 1.15; }
.home-pitch { margin: 0; font-size: 16px; line-height: 1.55; color: var(--text-2); max-width: 60ch; }
.home-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.home-signin .btn { height: 40px; }
.home-note { margin: 0; font-size: 13px; }
.home-sec h2 { flex-wrap: wrap; row-gap: 2px; }
.nowrap { white-space: nowrap; }
.h2-hint { font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.strip-sub .icon { width: 12px; height: 12px; vertical-align: -2px; color: var(--accent); }
.signin-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; margin-top: 20px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; }
.signin-card h2 { margin: 0; padding: 0; border: 0; }
.signin-card p { margin: 0; font-size: 13px; }
.guest-foryou { max-width: 520px; }
.guest-foryou p { color: var(--text-2); }
.guest-strip { margin: -4px 0 16px; font-size: 13px; color: var(--muted); }
.search-page form { display: flex; gap: 8px; max-width: 520px; margin: 0 0 20px; }
.search-page input[type=search] { flex: 1; min-width: 0; }
.search-page .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* member rows (components/people.html): search, a game's members, /following suggestions */
.people { list-style: none; margin: 0 0 24px; padding: 0; max-width: 760px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mrow-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--text); }
.mrow-who:hover .mrow-name { color: var(--accent); }
.mrow-who img, .mrow-who .avatar-blank { width: 32px; height: 32px; border-radius: 2px; flex: none; }
.mrow-id { display: flex; flex-direction: column; min-width: 0; }
.mrow-name, .mrow-handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow-name { font-weight: 500; }
.mrow-handle { font-size: 12px; }
.mrow-note { display: flex; gap: 8px; align-items: center; flex: none; font-size: 13px; }
.mrow .follow-btn .icon { width: 12px; height: 12px; }
.mrow-more { list-style: none; padding: 8px 0; text-align: center; }
.mrow-more .load-more { display: inline-block; }
.game-members h1 .num { font-size: 15px; font-family: inherit; }
.gm-back { margin: 0 0 4px; font-size: 13px; }
.members-played { margin: 4px 0 0; padding-left: 12px; font-size: 13px; }
.sg-avatar { flex: none; width: 28px; height: 28px; border-radius: 2px; overflow: hidden; background: var(--bg-3); }
.sg-avatar img { width: 100%; height: 100%; display: block; }
@media (max-width: 760px) {
  .mrow { flex-wrap: wrap; row-gap: 4px; }
  .mrow-note { order: 3; flex-basis: 100%; padding-left: 42px; }
  .home-hero { margin-top: 8px; }
  .home-hero h1 { font-size: 27px; }
}

/* ---- adult content (adult.py): images of games IGDB tags as erotic are blurred unless <html data-adult="show">
   or the viewer revealed them (static/js/adult.js adds .revealed). Titles stay readable. ---- */
html:not([data-adult="show"]) .adult:not(.revealed) { overflow: hidden; cursor: pointer; }
html:not([data-adult="show"]) .adult:not(.revealed) img,
html:not([data-adult="show"]) img.adult-img:not(.revealed),
html:not([data-adult="show"]) .adult-page:not(.revealed) :is(.cover-img, .shot img, .lightbox-img, .lightbox-poster) {
  filter: blur(16px) saturate(.5); transform: scale(1.08); transition: filter .15s, transform .15s;
}
.adult-tag {
  position: absolute; bottom: 8px; left: 4px; z-index: 3; padding: 0 4px; border-radius: 2px; pointer-events: none;
  font-size: 10px; font-weight: 600; line-height: 15px; color: var(--muted); background: var(--bg-3);
}
html[data-adult="show"] .adult-tag, .adult.revealed .adult-tag { display: none; }
/* early access (macros.ea_tag): bottom-right of a cover, above the status bar (rating top-right, Adult bottom-left) */
.ea-tag {
  position: absolute; bottom: 8px; right: 4px; z-index: 3; padding: 0 4px; border: 1px solid currentColor; border-radius: 2px;
  pointer-events: none; font-size: 10px; font-weight: 600; line-height: 14px; white-space: nowrap;
  color: var(--accent-2); background: var(--bg-2);
}
/* Steam demo (macros.demo_tag): top-left of a cover, clear of the rating (top-right), Adult / EA tags (bottom) */
.demo-tag {
  position: absolute; top: 6px; left: 4px; z-index: 3; padding: 0 4px; border: 1px solid var(--line); border-radius: 2px;
  pointer-events: none; font-size: 10px; font-weight: 600; line-height: 14px; white-space: nowrap;
  color: var(--text); background: var(--bg-2); box-shadow: 0 1px 3px rgb(0 0 0 / .35);
}
/* top-left taken only while the select checkbox shows (hover, focus, any checked, select mode) or by the IGDB list rank badge */
.card:has(> .select:focus-visible) .demo-tag, .library:has(.select:checked) .card .demo-tag,
.library.selecting .card .demo-tag, .l-rank + .card .demo-tag { top: 32px; }
@media (hover: hover) { .card:has(> .select):hover .demo-tag { top: 32px; } }
.demo-tag.demo-inline { position: static; display: inline-block; box-shadow: none; vertical-align: 1px; }
.demo-line { margin: 8px 0 0; font-size: 13px; }
.ea-tag.ea-inline { position: static; display: inline-block; margin-right: 8px; vertical-align: 1px; }
.similar-meta.ea-meta { color: var(--accent-2); }
.adult-notice { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
html[data-adult="show"] .adult-notice, .adult-notice.done { display: none; }
@media (prefers-reduced-motion: reduce) {
  .adult img, img.adult-img, .adult-page :is(.cover-img, .shot img, .lightbox-img, .lightbox-poster) { transition: none; }
}
.home-tagline, .about-tagline { margin: 0; font-size: 15px; color: var(--text-2); }
