/* Cheevodex shared component styles: things Tailwind classes express badly.
 * Colours come from assets/tokens.css only. See docs/rules.md and decision-008. */

/* ── Base ─────────────────────────────────────────────────────────────────────── */
html, body { font-family: var(--font); background-color: var(--page); color: var(--ink); }
body { -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1; }
/* Numbers that line up or matter: points, counts, ranks, percentages */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ── Section heading (doc-012) ─────────────────────────────────────────────────────
 * <div class="... border-b ..."><span class="sec-mark" /><span class="sec-t">Title</span></div>
 * Blue diamond, blue title, and a solid blue hairline (35%) under it (lines are never gradients). Any
 * element that directly holds a .sec-mark gets the underline. */
.sec-mark { width: 7px; height: 7px; flex-shrink: 0; background: var(--accent); transform: rotate(45deg); margin: 0 3px 0 2px; box-shadow: 0 0 6px rgb(var(--c-accent) / 0.45); }
.sec-t { font-size: 15px; font-weight: 500; color: var(--accent); letter-spacing: -0.005em; line-height: 1.3; }
.sec-t svg { color: var(--accent); }
html :has(> .sec-mark) { border-bottom: 1px solid rgb(var(--c-accent) / 0.35); }   /* html: beats Tailwind's border-line on the same heading */
/* Card header title: the same marker, smaller, inside a panel's header strip */
.sec-mark.sm { width: 5px; height: 5px; margin: 0 2px 0 1px; box-shadow: none; }
.card-t { font-size: 13px; font-weight: 500; color: var(--accent); line-height: 1.3; }
.card-t svg { color: var(--accent); }
/* Anything already marked tabular is a number column: give it the mono face too */
.tabular-nums { font-family: var(--mono); letter-spacing: -0.01em; }

/* ── Sheet: bottom sheet below md, centred dialog from md (assets/sheet.js) ──────────
 * Ported from Savepoint. z-index sits above the mobile nav (200) so the sheet covers it. */
.sheet-root { position: fixed; inset: 0; z-index: 210; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); transition: opacity 220ms ease-in; }
.sheet-leaving .sheet-backdrop { opacity: 0; }
.sheet-panel {
  position: relative; z-index: 1; width: 100%;
  height: calc(100dvh - 48px - env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--box); border-top: 1px solid var(--line); border-radius: 3px 3px 0 0;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.5);
  animation: sheet-up 280ms cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (min-width: 768px) {
  .sheet-root { align-items: center; padding: 16px; }
  .sheet-panel {
    max-width: 36rem; height: auto; max-height: 90vh;
    border: 1px solid var(--line); border-radius: 3px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: motion-pop 180ms cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }
  .sheet-panel.wide { max-width: 42rem; }
  .sheet-scroll { padding-bottom: 12px; }
}
.sheet-head { position: relative; flex-shrink: 0; overflow: hidden; border-bottom: 1px solid var(--line); touch-action: none; }
.sheet-grab { position: relative; z-index: 1; display: block; width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.45); margin: 8px auto 0; }
.sheet-close {
  position: absolute; z-index: 3; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 3px;
  display: grid; place-items: center; color: var(--ink);
  background: rgb(var(--c-well) / 0.72); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 150ms;
}
.sheet-close:hover { background: rgb(var(--c-well) / 0.9); }
.sheet-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet-title { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
@media (min-width: 768px) { .sheet-grab { display: none; } .sheet-close { top: 10px; right: 10px; width: 28px; height: 28px; } }

/* ── Blurred art background (sheet headers, page headers) ───────────────────────────
 * One <img> bleeding 30px past every edge (more than the blur radius) so no dark rim shows. */
.art-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.art-bg img {
  position: absolute; top: -30px; left: -30px; width: calc(100% + 60px); height: calc(100% + 60px);
  max-width: none; object-fit: cover; object-position: center;
  filter: blur(6px) saturate(1.2) brightness(0.8);
  opacity: 0; transition: opacity 300ms ease-out;
}
.art-bg img.loaded { opacity: 1; }
.sheet-panel:not(.settled) .art-bg img { transition: none; }
.art-bg.art-sheet img { filter: blur(3px) saturate(1.1) brightness(0.55); }
.art-bg.art-sheet::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(var(--c-box) / 0) 0%, rgb(var(--c-box) / 0.4) 50%, var(--box) 100%); }
.art-shadow { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }

@media (prefers-reduced-motion: reduce) {
  .sheet-panel, .sheet-backdrop, .art-bg img { animation: none !important; transition: none !important; }
}

/* ── Tabs (assets/tabs.js) ─────────────────────────────────────────────────────────
 * Uppercase 12px/600 labels, the active one in ink with a 3px blue underline that slides
 * between tabs. Scrolls sideways when the tabs don't fit. Pages set the sticky offset. */
.ptabs-anchor { height: 0; }
.ptabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: rgb(var(--c-page) / 0.94); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ptabs-row { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ptabs-row::-webkit-scrollbar { display: none; }
.ptab {
  flex-shrink: 0; display: flex; align-items: center; gap: 7px; height: 42px; padding: 0 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-3); transition: color 150ms;
}
.ptab:hover { color: var(--ink); }
.ptab.on { color: var(--ink); }
.ptab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.ptab-icon { display: grid; place-items: center; }
.ptab-icon svg { width: 15px; height: 15px; }
.ptab.on .ptab-icon { color: var(--accent); }
.ptab-count { font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); font-family: var(--mono); }
.ptabs-ind { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--accent); box-shadow: 0 0 8px rgb(var(--c-accent) / 0.35); transition: transform 250ms cubic-bezier(0.2, 0.8, 0.3, 1), width 250ms cubic-bezier(0.2, 0.8, 0.3, 1); }
@media (min-width: 768px) { .ptabs-row { gap: 8px; } .ptab { height: 44px; font-size: 12.5px; } }
/* Carousel swipe: the neighbouring tab as a skeleton beside the content while dragging */
.tab-peek { position: absolute; width: 100%; overflow: hidden; pointer-events: none; }
.tab-peek-in { display: flex; flex-direction: column; gap: 10px; }
.pk-line { height: 11px; border-radius: 2px; }
.pk-h2 { padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.pk-row { display: flex; gap: 10px; padding: 10px; background: var(--box); border: 1px solid var(--line-soft); border-radius: 3px; }
.pk-icon { width: 44px; height: 44px; border-radius: 2px; flex-shrink: 0; }
.pk-main { flex: 1; display: flex; flex-direction: column; gap: 7px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .ptabs-ind { transition: none; } }

/* ── Game lists: list / tiles toggle and tiles (profile; assets/game-view.js) ─────────
 * Status colour (gold mastered / silver beaten / blue in progress / line not started)
 * comes in from JS as the tile's bottom edge and the segmented bar's fill. */
.vtoggle { display: inline-flex; flex-shrink: 0; background: var(--well); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.vtoggle button { width: 30px; height: 24px; display: grid; place-items: center; color: var(--ink-3); transition: color 150ms, background-color 150ms; }
.vtoggle button + button { border-left: 1px solid var(--line); }
.vtoggle button:hover { color: var(--ink); }
.vtoggle button.on { color: var(--ink); background: var(--box); box-shadow: inset 0 -2px 0 var(--accent); }
.vtoggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Segmented progress: up to 20 segments, each filling in turn */

.gtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gtile {
  display: flex; flex-direction: column; text-align: left; background: var(--box-hi);
  border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: 3px; overflow: hidden;
  transition: transform 150ms, background-color 150ms;
}
.gtile:hover { transform: translateY(-2px); background: var(--box-hover); }
.gtile.mastered { box-shadow: 0 0 14px rgb(var(--c-gold) / 0.14); }
.gtile-art { position: relative; aspect-ratio: 460 / 215; overflow: hidden; background: var(--well); }
.gtile-art .bg { position: absolute; top: -12px; left: -12px; width: calc(100% + 24px); height: calc(100% + 24px); max-width: none; object-fit: cover; filter: blur(6px) saturate(1.2) brightness(0.7); }
.gtile-art .icon { position: absolute; left: 50%; top: 50%; height: 72%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 3px; border: 2px solid rgba(255, 255, 255, 0.2); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55); object-fit: cover; background: var(--well); }
.gtile.mastered .gtile-art .icon { border-color: var(--gold); box-shadow: 0 0 12px rgb(var(--c-gold) / 0.45), 0 6px 16px rgba(0, 0, 0, 0.55); }
.gtile.beaten .gtile-art .icon { border-color: var(--silver); }
.gtile-ago { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 600; color: var(--ink); background: rgb(var(--c-well) / 0.85); padding: 1px 6px; border-radius: 2px; }
.gtile-mode { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 2px; background: rgb(var(--c-well) / 0.85); border: 1px solid; }
.gtile-body { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px 10px; flex: 1; }
.gtile-title { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gtile-sub { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent); min-width: 0; }
.gtile-sub > .shrink { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtile-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); margin-top: auto; }
.gtile-meta b { color: var(--ink); font-weight: 600; }
@media (min-width: 768px) { .gtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1024px) { .gtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }

/* ── Page header (profile + game; doc-012) ────────────────────────────────────────────
 * The latest game's art blurred behind (.art-bg.art-header), a gold glow top-left and a blue
 * glow top-right, a gold-ringed avatar, identity lines, then the numbers strip and the
 * mastered / beaten / in-progress status row. Phone: stacked; desktop: numbers on the right.
 * With no art (or art that fails to load) it is a plain charcoal header. */
.phead { position: relative; overflow: hidden; background: var(--box); border-bottom: 1px solid var(--line); }
.phead::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(60% 120% at 0% 0%, rgb(var(--c-gold) / 0.13), transparent 60%),
              radial-gradient(60% 120% at 100% 0%, rgb(var(--c-accent) / 0.16), transparent 60%); }
.art-bg.art-header img { filter: blur(6px) saturate(1.1) brightness(0.55); }
.art-bg.art-header::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(var(--c-box) / 0.4) 0%, rgb(var(--c-box) / 0.62) 55%, rgb(var(--c-box) / 0.96) 100%); }
.phead > :not(.art-bg) { position: relative; z-index: 2; }
.phead-in { max-width: 64rem; margin: 0 auto; padding: 28px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.phead-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }
.phead-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
/* 2px gold conic ring around the avatar */
.phead-av { position: relative; flex-shrink: 0; width: 72px; height: 72px; padding: 2px; border-radius: 3px;
  background: conic-gradient(from 210deg, var(--gold-hi), var(--gold), var(--gold-press), var(--gold), var(--gold-hi));
  box-shadow: 0 0 18px rgb(var(--c-gold) / 0.28), 0 2px 12px rgba(0, 0, 0, 0.5); }
.phead-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; background: var(--well); display: block; }
.phead-av .dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--box); }
.phead-av.game { background: var(--line-2); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
.phead-av.game.mastered { background: conic-gradient(from 210deg, var(--gold-hi), var(--gold), var(--gold-press), var(--gold), var(--gold-hi)); box-shadow: 0 0 18px rgb(var(--c-gold) / 0.28), 0 2px 12px rgba(0, 0, 0, 0.5); }
.phead-av.game.beaten { background: var(--silver); }
.phead-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.phead-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.phead-name h1 { font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.15; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; }
.phead-link { flex-shrink: 0; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 2px; border: 1px solid var(--line-2); background: rgb(var(--c-well) / 0.7); transition: border-color 150ms; }
.phead-link:hover { border-color: var(--accent); }
.phead-link img { width: 14px; height: 14px; object-fit: contain; }
.phead-sub { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.phead-sub b { font-weight: 600; }
.phead-motto { font-size: 12.5px; font-style: italic; color: var(--ink); opacity: 0.85; line-height: 1.45; border-left: 2px solid rgb(var(--c-accent) / 0.5); padding-left: 9px; }
.phead-side { display: flex; flex-direction: column; gap: 8px; }
.phead-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: rgb(var(--c-well) / 0.6); border: 1px solid var(--line); border-radius: 3px; }
.phead-stat { padding: 8px 12px; min-width: 0; }
.phead-stat + .phead-stat { border-left: 1px solid var(--line); }
.phead-stat b { display: block; font-size: 18px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phead-stat span { display: block; font-size: 11px; color: var(--ink-2); margin-top: 1px; }
.phead-meta { font-size: 11px; color: var(--ink-3); }
.phead-meta b { color: var(--ink-2); font-weight: 500; }
/* Status row: tinted cells with a coloured bottom edge */
.pstatus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pstatus-cell { display: flex; align-items: center; gap: 5px; padding: 5px 8px; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden;
  background: rgb(var(--c) / 0.1); border-bottom: 2px solid rgb(var(--c)); border-radius: 2px 2px 0 0; }
.pstatus-cell svg { color: rgb(var(--c)); flex-shrink: 0; }
.pstatus-cell b { color: var(--ink); font-weight: 600; }
@media (min-width: 768px) {
  .phead-in { flex-direction: row; align-items: center; gap: 32px; padding: 24px 32px; }
  .phead-av { width: 96px; height: 96px; }
  .phead-name h1 { font-size: 26px; }
  .phead-side { width: 380px; flex-shrink: 0; }
  .phead-meta { text-align: right; }
}

/* ── Brand (top bar, login) ────────────────────────────────────────────────────────
 * Codex mark + wordmark "Cheevo" in ink and "dex" in RA blue, Geist 650 (doc-012). */
.brand { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.wm-mark { width: 18px; height: 18px; image-rendering: pixelated; flex-shrink: 0; }
.wm { font-family: var(--font); font-weight: 650; font-size: 14px; letter-spacing: -0.02em; color: var(--ink); line-height: 1; white-space: nowrap; }
/* Desktop page links in the top bar (assets/ui.js PageLinks): the bottom bar's destinations; the current one blue,
   with a line on the bar's bottom edge (the bottom bar's is on its top edge) */
.tnav { gap: 2px; margin-right: 6px; }
.tnav-a { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 3px;
  font: 600 11px/1 var(--font); color: var(--ink-3); text-decoration: none; transition: color .15s, background .15s; }
.tnav-a:hover { color: var(--ink); background: rgb(var(--c-ink) / 0.05); }
.tnav-a.on { color: var(--accent); }
.tnav-a.on::after { content: ''; position: absolute; left: 9px; right: 9px; bottom: -7px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.tnav-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Desktop search field in the top bar: looks like a field, opens the command palette */
.tsearch { align-items: center; gap: 8px; width: 230px; margin-right: 8px; height: 26px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--well); color: var(--ink-3); font: 500 11.5px var(--font); cursor: pointer; transition: border-color .15s, color .15s; }
.tsearch > svg { color: var(--accent); }      /* the blue of the phone's Search tile, as an accent: a field you type into, not a button */
.tsearch:hover { border-color: rgb(var(--c-accent) / 0.55); color: var(--ink-2); }
.tsearch:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tsearch-t { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsearch kbd { font: 500 10px var(--mono); color: var(--ink-2); background: var(--box-hi); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 5px; }
.wm em { font-style: normal; color: var(--accent); }
a.brand:hover .wm { color: var(--ink); }

/* ══ Ported from Savepoint assets/ui.css (CHV-027–030): game rows, watchlist rows, Overview stat tiles,
   filters, activity timelines, completions panel. Savepoint colours mapped onto tokens. ══ */

.glist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.grow {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px;
  padding: 8px 12px 8px 8px; text-align: left; background: var(--box-hi);
  border: 1px solid var(--line-2); border-left-width: 3px; border-radius: 3px; overflow: hidden;
  transition: background-color 150ms;
}
button.grow:hover { background: var(--box-hover); }
.grow > * { position: relative; }
.grow > .grow-art { position: absolute; top: 0; right: 0; bottom: 0; width: 55%; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, black 80%); mask-image: linear-gradient(90deg, transparent, black 80%); }
.grow-art img { width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0.3; }
.grow-art img.art-icon { filter: blur(8px) saturate(1.2); transform: scale(1.4); }
.grow-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 2px; border: 1px solid var(--well); background: var(--well); object-fit: cover; }
.grow-banner { width: 94px; height: 44px; flex-shrink: 0; border-radius: 2px; border: 1px solid var(--well); background: var(--line); object-fit: cover; }
.grow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.grow-title { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.grow-sub > * { flex-shrink: 0; }
.grow-sub > .keep { flex-shrink: 0; }
.grow-sub > .shrink { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.grow-prog { flex-shrink: 0; width: 76px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gcount { font-size: 11px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6); }
.gcount > span { color: var(--ink-2); font-weight: 400; }

/* ── Backlog as an index ─────────────────────────────────────────────────────────────
   "Up next" (.bnext): the started games as dex cards in a row that scrolls. Then console volumes
   (.dvol, shared with the Dex) of index lines (.bline): icon, title, dotted leader, progress, dex
   number. Subsets are indented lines under their game; a game and its subsets never split (.bgrp). */
.bnext { margin-bottom: 20px; }
.bnext-h { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 7px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.bnext-row { display: grid; grid-auto-flow: column; grid-auto-columns: 124px; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; padding: 2px 2px 6px; scrollbar-width: thin; }
.bnext-row > * { scroll-snap-align: start; }
.bnext-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; color: var(--ink-3);
  border: 1px dashed var(--line-2); border-radius: 3px; transition: color 150ms, border-color 150ms; }
.bnext-more b { font-family: var(--mono); font-size: 18px; color: var(--accent); }
.bnext-more:hover { color: var(--ink); border-color: var(--accent); }
.bvol-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; display: flex; gap: 2px; pointer-events: none; }
.bvol-bar i { display: block; height: 100%; border-radius: 1px; }
.bvol { column-gap: 36px; }
@media (min-width: 768px) { .bvol { column-count: 2; } }
/* A letter of the index: the letter in the gutter, its games beside it */
.blet { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding-top: 6px; }
.blet + .blet { border-top: 1px solid var(--line-faint); margin-top: 6px; }
.blet-k { font-family: var(--pixel); font-size: 19px; line-height: 1; color: var(--ink-2); padding-top: 13px; text-align: center; }
.blet-v { min-width: 0; display: flex; flex-direction: column; }
.bgrp { break-inside: avoid; position: relative; }
.bline { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 6px; text-decoration: none; border-radius: 3px; transition: background-color 150ms; }
.bline:hover { background: var(--box); }
/* The icon: faded until the game is started, lit and ringed blue once it is, ringed gold when mastered */
.bline-pic { position: relative; flex-shrink: 0; width: 34px; height: 34px; border-radius: 3px; background: var(--well); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.bline-pic img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: filter 200ms, opacity 200ms; }
.bline.notstarted .bline-pic img { filter: saturate(0.35) brightness(0.8); }
.bline.noach .bline-pic img { filter: grayscale(1) brightness(0.6); }
.bline:hover .bline-pic img { filter: none; }
.bline.inprogress .bline-pic { box-shadow: 0 0 0 1.5px var(--accent); }
.bline.mastered .bline-pic { box-shadow: 0 0 0 1.5px var(--gold), 0 0 10px rgb(var(--c-gold) / 0.35); }
.bline-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bline-r1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bline-t { min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 150ms; }
.bline.notstarted .bline-t { color: var(--ink-2); font-weight: 400; }
.bline.noach .bline-t { color: var(--ink-3); font-weight: 400; }
.bline:hover .bline-t { color: var(--accent-hi); }
.bline-r2 { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.bline-e { flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 56px; }
.bline-c { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); }
.bline-c span { font-weight: 400; color: var(--ink-3); }
.bline-m { display: inline-flex; align-items: center; gap: 3px; height: 16px; padding: 0 6px; border-radius: 2px; font-size: 10px; font-weight: 700; line-height: 1;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; color: rgb(var(--c-page)); background: var(--gold); box-shadow: 0 0 8px rgb(var(--c-gold) / 0.45); }   /* the same tag as a mastered dex card */
.bline-pts { font-family: var(--mono); font-size: 12px; color: var(--gold-dim); }
.bline-pts small { font-size: 10px; color: var(--ink-3); margin-left: 3px; }
.bline-x { font-size: 11px; color: var(--ink-4); }
/* Subsets hang under their game: a thin line down from the icon, a tick into each set */
.bline.sub { position: relative; padding: 4px 6px 4px 50px; gap: 8px; }
.bline.sub::before { content: ''; position: absolute; left: 23px; top: 0; height: 100%; width: 12px; border-left: 1px solid var(--line-2); }
.bline.sub:last-child::before { height: 50%; border-bottom: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.bline.sub:not(:last-child)::after { content: ''; position: absolute; left: 23px; top: 50%; width: 12px; border-top: 1px solid var(--line-2); }
.bline.sub .bline-t { font-size: 12.5px; font-weight: 500; color: var(--gold-dim); }
.bline.sub .bline-d { flex: 1; min-width: 14px; border-bottom: 1px dotted var(--line-2); }
.bgrp.has-subs > .bline:first-child { padding-bottom: 4px; }

/* ── Profile Overview ───────────────────────────────────────────────────────────────
   Last played is the regular game row (.grow) with one extra line inside it (.grow-extra):
   RA rich presence (.rp, italic) or the game's latest unlock. Stat tiles: value over label, two across
   on phones, three on desktop. */
.grow-extra { font-size: 11.5px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grow-extra.rp { font-style: italic; }
.grow-extra svg { display: inline; vertical-align: -1px; margin-right: 4px; }
.grow-extra em { font-style: normal; color: var(--ink-3); }
/* Overview, wide screens: compact rows of the latest unlocks under the newest one (hidden on phones) */
.ulist { display: none; }
@media (min-width: 1024px) {
  .ulist { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
  .prail .stiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.urow { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px 6px 8px; background: var(--box); border: 1px solid var(--line); border-left: 3px solid rgb(var(--c-gold) / 0.35); border-radius: 3px; text-decoration: none; transition: background-color 150ms; }
.urow:hover { background: var(--box-hi); }
.urow > img { width: 32px; height: 32px; flex-shrink: 0; border-radius: 2px; border: 1px solid var(--well); object-fit: cover; background: var(--well); }
.urow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.urow-title { font-size: 12.5px; font-weight: 500; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow-sub { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urow-end { flex-shrink: 0; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 9px 11px; background: var(--box); border: 1px solid var(--line); border-radius: 3px; }
.stile b { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stile b small { font-size: 11px; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.stile span { font-size: 11px; color: var(--ink-2); line-height: 1.3; }
.smore { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 7px; font-size: 12px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); border-radius: 3px; background: var(--well); transition: color 150ms, border-color 150ms; }
.smore:hover { color: var(--ink); border-color: var(--ink-4); }
@media (min-width: 768px) {
  .stiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Filters (every page) ─────────────────────────────────────────────────────────
   One look for every filter: sentence-case chips in one row that scrolls sideways
   instead of wrapping, a search field with its icon, and sort / group as a compact
   select beside the search. Counts and hints are a plain muted line, never chips. */
.frow { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
/* A row that overflows fades out at the right edge so it reads as scrollable, until it's
   scrolled to the end. Scroll-driven: a row that fits has no active timeline, so no fade */
@supports (animation-timeline: scroll()) {
  .frow { animation: frow-fade linear both; animation-timeline: scroll(self inline); }
  @keyframes frow-fade {
    0%, 96% { -webkit-mask-image: linear-gradient(90deg, black calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, black calc(100% - 36px), transparent); }
    100% { -webkit-mask-image: none; mask-image: none; }
  }
}
.frow::-webkit-scrollbar { display: none; }
.fchip {
  flex-shrink: 0; height: 30px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap; color: var(--ink-2);
  background: var(--well); border: 1px solid var(--line); border-radius: 3px;
  transition: color 150ms, border-color 150ms, background-color 150ms;
}
.fchip:hover { color: var(--ink); border-color: var(--ink-4); }
.fchip.on { color: var(--ink); background: rgb(var(--c-accent) / 0.16); border-color: var(--accent); }
.fchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fchip .n { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fchip.on .n { color: var(--accent-hi); }
.fchip svg { flex-shrink: 0; }
.fsep { flex-shrink: 0; width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.fmenu-caret { transition: transform 150ms; margin-left: -2px; }
.fmenu-caret.open { transform: rotate(180deg); }
/* Checklist under a filter chip (Analytics' Hide). Fixed to the screen: .frow scrolls sideways and would clip it */
.fmenu {
  position: fixed; z-index: 220; width: 260px; padding: 4px; display: flex; flex-direction: column; gap: 2px;
  background: var(--box); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.fmenu-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 2px; text-align: left; width: 100%; }
.fmenu-row:hover { background: var(--box-hi); }
.fmenu-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fmenu-box {
  flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; display: grid; place-items: center; color: var(--well);
  border: 1px solid var(--ink-4); border-radius: 2px; background: var(--well); transition: background-color 150ms, border-color 150ms;
}
.fmenu-box.on { background: var(--accent); border-color: var(--accent); }
.fmenu-b { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fmenu-t { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); font-weight: 500; }
.fmenu-t .n { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fmenu-s { font-size: 11px; color: var(--ink-3); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fmenu-s b { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.fbar { display: flex; align-items: center; gap: 8px; }
.fsearch { position: relative; flex: 1; min-width: 0; }
.fsearch input {
  width: 100%; height: 34px; padding: 0 30px 0 34px; font-size: 13px; color: var(--ink);
  background: var(--well); border: 1px solid var(--line); border-radius: 3px; outline: none; transition: border-color 150ms;
}
.fsearch input::placeholder { color: var(--ink-3); }
.fsearch input:hover { border-color: var(--ink-4); }
.fsearch input:focus { border-color: var(--accent); }
.fsearch > svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.fsearch button { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-3); border-radius: 2px; }
.fsearch button:hover { color: var(--ink); }
/* Sort / group select. Its icons are masks on the wrapper (.fselect-w) so they take a token colour */
.fselect-w { position: relative; flex-shrink: 0; max-width: 40%; display: inline-flex; }
.fselect-w::before, .fselect-w::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); background: var(--ink-2); pointer-events: none; }
.fselect-w::before { left: 9px; width: 15px; height: 15px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 4h-7M10 4H3M21 12h-9M8 12H3M21 20h-5M12 20H3M14 2v4M8 10v4M16 18v4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 4h-7M10 4H3M21 12h-9M8 12H3M21 20h-5M12 20H3M14 2v4M8 10v4M16 18v4'/%3E%3C/svg%3E") center / contain no-repeat; }
.fselect-w::after { right: 8px; width: 10px; height: 10px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.fselect {
  width: 100%; height: 34px; padding: 0 24px 0 31px; font-size: 12.5px; font-weight: 500; color: var(--ink);
  background: var(--box); border: 1px solid var(--line); border-radius: 3px; outline: none;
  -webkit-appearance: none; appearance: none; color-scheme: dark; cursor: pointer; text-overflow: ellipsis;
}
.fselect:hover { border-color: var(--ink-4); }
.fselect:focus-visible { border-color: var(--accent); }
.fmeta { font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.fmeta b { color: var(--ink-2); font-weight: 600; }
.fbar .vtoggle button { width: 36px; height: 32px; }
.fbar .vtoggle svg { width: 15px; height: 15px; }

/* ── Activity timelines (Activity page and the profile Activity tabs; components in assets/activity-ui.js) ──
   Summary card (folded row / stats, last 14 days, streak tiles, heatmap), sticky day headings,
   one card per game run headed by an art band, compact unlock rows */
/* Summary card: stats + platform split, last 14 days + streak, the year heatmap */
.asum { background: var(--box); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.asum-sec { padding: 12px 14px; min-width: 0; }
.asum-sec + .asum-sec, .asum-top + .asum-sec { border-top: 1px solid var(--line-soft); }
@media (min-width: 768px) {
    .asum-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .asum-top > .asum-sec + .asum-sec { border-top: 0; border-left: 1px solid var(--line-soft); }
}
.asum-less { position: absolute; top: 12px; right: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 2px;
             font-size: 11.5px; color: var(--accent); background: none; border: 0; }
.asum-less:hover { color: var(--ink); }
.asum-h { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-bottom: 8px; }
.asum-h > span:not(.sec-mark) { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.asum-h > .sec-mark { margin-right: -2px; }
.asum-h > em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-3); }
.astats-l { gap: 7px; }
.astreak { margin-top: 12px; gap: 6px; }
.astreak .dl-k, .astats-l .dl-k { display: inline-flex; align-items: center; gap: 6px; }
.split { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.split-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--well); }
.split-bar i { display: block; height: 100%; transition: opacity 200ms; }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--ink-2); }
.split-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.split-legend > span.dim { opacity: 0.4; }
.split-legend i { width: 7px; height: 7px; border-radius: 2px; }
.split-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.tday { position: sticky; top: env(safe-area-inset-top); z-index: 20; display: flex; align-items: baseline; gap: 8px;
        padding: 8px 2px 6px; margin-bottom: 4px; background: var(--page); }
@media (min-width: 768px) { .tday { top: 37px; } }
.tday-name { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.tday-name em { font-style: normal; font-weight: 500; color: var(--accent); margin-left: 7px; }
.tday-meta { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tday-meta b { color: var(--ink-2); font-weight: 600; }
.ptag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.subset-tag { flex-shrink: 0; font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; padding: 1px 4px; border-radius: 2px;
              border: 1px solid rgb(var(--c-gold) / 0.3); background: rgb(var(--c-gold) / 0.1); color: var(--gold-dim); }
.trow-ph { flex-shrink: 0; width: 32px; height: 32px; border-radius: 2px; background: var(--line); }
img + .trow-ph, .trow > img { flex-shrink: 0; border-radius: 2px; border: 1px solid var(--well); background: var(--well); object-fit: cover; }
.trow { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 9px; }
.trow > img, .trow > .trow-ph { width: 36px; height: 36px; }
.trow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trow-title { font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-sub { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-end { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trow-end em { font-style: normal; font-size: 10px; color: var(--ink-3); }
.tmore { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; padding: 7px; font-size: 11.5px; color: var(--accent); background: var(--head); border-top: 1px solid var(--line-faint); }
.tmore:hover { color: var(--ink); }
/* Under the profile tab bar the day headings stick below it (42px row + 1px border; 37px top bar + 45px from md) */
.tl-tabs .tday { top: calc(env(safe-area-inset-top, 0px) + 43px); }
@media (min-width: 768px) { .tl-tabs .tday { top: 82px; } }
.trow > a > img { display: block; width: 36px; height: 36px; flex-shrink: 0; border-radius: 2px; border: 1px solid var(--well); background: var(--well); object-fit: cover; }
@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  25% { transform: scale(1.12) rotate(4deg); opacity: 0.85; }
  50% { transform: scale(1.06) rotate(-3deg); opacity: 0.95; }
  75% { transform: scale(1.1) rotate(2deg); opacity: 0.88; }
}
@media (prefers-reduced-motion: reduce) { .astreak svg { animation: none !important; } }

/* ── Completions / Game awards (assets/completions.js) ──────────────────────────
   Tier as a border on every picture: gold (Mastered / Perfect / Completed) with a soft glow, silver (Beaten) plain */
.cmp-h { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.cmp-h-bar { width: 3px; height: 14px; background: var(--gold); border-radius: 1px; flex-shrink: 0; }
.cmp-h-t { flex: 1; font-size: 13px; color: var(--ink); letter-spacing: 0.025em; text-transform: uppercase; font-weight: 500; }
.cmp-h .vtoggle button { width: 28px; height: 22px; }
.cmp-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cmp-tier { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--box); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.cmp-tier::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.cmp-tier.gold::before { background: var(--gold); } .cmp-tier.silver::before { background: var(--silver); }
.cmp-tier-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.cmp-tier.gold .cmp-tier-ic { background: rgb(var(--c-gold) / 0.14); color: var(--gold); }
.cmp-tier.silver .cmp-tier-ic { background: rgb(var(--c-silver) / 0.12); color: var(--silver); }
.cmp-tier b { display: block; font-size: 21px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp-tier.gold b { color: var(--gold); } .cmp-tier.silver b { color: var(--silver); } .cmp-tier.zero b { color: var(--ink-3); }
.cmp-tier small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; }

.cmp-latest { position: relative; display: block; width: 100%; text-align: left; overflow: hidden; margin-bottom: 12px; background: var(--box); border: 1px solid var(--line); border-radius: 3px; }
.cmp-latest.gold { border-color: rgb(var(--c-gold) / 0.55); }
.cmp-latest-bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 30%; opacity: 0.9; }
.cmp-latest-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(var(--c-bar) / 0.95) 0%, rgb(var(--c-bar) / 0.88) 50%, rgb(var(--c-bar) / 0.3) 100%); }
.cmp-latest-in { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; }
.cmp-cov { flex-shrink: 0; object-fit: cover; background: black; border: 2px solid transparent; border-radius: 3px; }
.cmp-cov.sq { width: 64px; height: 64px; } .cmp-cov.wd { width: 100px; height: 47px; } .cmp-cov.pt { width: 56px; height: 84px; }
.cmp-cov.gold { border-color: var(--gold); box-shadow: 0 0 12px rgb(var(--c-gold) / 0.35); } .cmp-cov.silver { border-color: var(--silver); }
.cmp-latest-b { display: flex; flex-direction: column; min-width: 0; }
.cmp-latest-k { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.cmp-latest-n { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.25; margin: 4px 0; }
.cmp-latest-m { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.cmp-latest-m > span { display: inline-flex; align-items: center; gap: 4px; }
.cmp-pct { color: var(--gold); white-space: pre; }
.cmp-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; }
.cmp-tag.gold { background: var(--gold); color: var(--well); } .cmp-tag.silver { background: var(--chip); color: var(--ink); border: 1px solid rgb(var(--c-silver) / 0.35); }

.cmp-grid { display: grid; gap: 8px; }
.cmp-grid.open { overflow-y: auto; overscroll-behavior: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-right: 2px; }
.cmp-grid.open { --ft: black; --fb: black; -webkit-mask-image: linear-gradient(180deg, var(--ft) 0, black 36px, black calc(100% - 40px), var(--fb) 100%); mask-image: linear-gradient(180deg, var(--ft) 0, black 36px, black calc(100% - 40px), var(--fb) 100%); }
.cmp-grid.open.fade-t { --ft: transparent; } .cmp-grid.open.fade-b { --fb: transparent; }
.cmp-item { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.cmp-tile { position: relative; display: block; overflow: hidden; background: black; border: 2px solid transparent; border-radius: 3px; transition: transform 150ms; }
.cmp-item:hover .cmp-tile { transform: translateY(-2px); }
.cmp-tile.sq { aspect-ratio: 1; } .cmp-tile.wd { aspect-ratio: 460 / 215; } .cmp-tile.pt { aspect-ratio: 2 / 3; }
.cmp-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cmp-tile.pixel img, .cmp-cov.pixel { image-rendering: pixelated; }
.cmp-tile.gold { border-color: var(--gold); box-shadow: 0 0 10px rgb(var(--c-gold) / 0.28); } .cmp-tile.silver { border-color: var(--silver); }
.cmp-mk { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--c-well) / 0.85); }
.cmp-tile.wd .cmp-mk { width: 16px; height: 16px; top: 3px; right: 3px; }
.cmp-tile.wd .cmp-mk svg { width: 10px; height: 10px; }
.cmp-tile.gold .cmp-mk { color: var(--gold); } .cmp-tile.silver .cmp-mk { color: var(--silver); }
/* Xbox 360 posters: black padding at the bottom of the file, replaced by a blurred copy of the art */
.ext { position: relative; display: block; overflow: hidden; }
.ext .ext-bg, .ext .ext-fg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top; }
.ext .ext-bg { transform: scale(1.35); transform-origin: 50% 0; filter: blur(8px) brightness(0.85); }
.ext .ext-fg { -webkit-mask-image: linear-gradient(180deg, black 85%, transparent 90.5%); mask-image: linear-gradient(180deg, black 85%, transparent 90.5%); }
.cmp-tile .cmp-pic { width: 100%; height: 100%; }
.cmp-more { margin-top: 10px; width: 100%; height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--ink-2); background: var(--bar); border: 1px solid var(--line); border-radius: 3px; transition: color 150ms, border-color 150ms; }
.cmp-more:hover { color: var(--ink); border-color: var(--ink-4); }
.cmp-more svg { transition: transform 200ms; } .cmp-more svg.rot { transform: rotate(180deg); }
/* Game awards → the Dex on the Beaten filter: a quiet index-style link under the shelf */
.cmp-dex { margin-top: 10px; display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 2px; font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line); transition: color 150ms; }
.cmp-dex:hover { color: var(--accent); }
.cmp-dex svg:last-child { margin-left: auto; transition: transform 150ms; }
.cmp-dex:hover svg:last-child { transform: translateX(2px); }
.cmp-dex:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* List view */
.cmp-grid.list { gap: 0; border: 1px solid var(--line); border-radius: 3px; }
.cmp-row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px 8px 12px; text-align: left; background: var(--box); border-bottom: 1px solid var(--line-faint); transition: background-color 150ms; }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row:hover { background: var(--box-hi); }
.cmp-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.cmp-row.gold::before { background: var(--gold); } .cmp-row.silver::before { background: var(--silver); }
.cmp-rpic { flex-shrink: 0; object-fit: cover; background: black; border: 2px solid transparent; border-radius: 2px; }
.cmp-rpic.sq, .cmp-rpic.pt { width: 40px; height: 40px; } .cmp-rpic.wd { width: 74px; height: 35px; }
.cmp-rpic.gold { border-color: var(--gold); box-shadow: 0 0 8px rgb(var(--c-gold) / 0.28); } .cmp-rpic.silver { border-color: var(--silver); }
.cmp-rpic.pixel { image-rendering: pixelated; }
.cmp-row-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmp-row-n { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-row-s { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-row-r { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cmp-empty { font-size: 12px; color: var(--ink-3); padding: 6px 0 2px; }
.cmp-sk-tier { height: 52px; border-radius: 3px; }
.cmp-sk-latest { height: 90px; border-radius: 3px; margin-bottom: 12px; }

@media (min-width: 768px) { .glist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
/* Cheevodex headings: the completions header uses .sec-mark + .sec-t instead of Savepoint's bar */
.cmp-h .sec-t { flex: 1; }
/* Criteria chips (Savepoint .crit): a view's rules as small chips with an icon instead of a grey sentence.
   3px corners, not Savepoint's pill (Cheevodex keeps 2–3px shapes) */
.crits { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.crit { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px 0 6px; font-size: 10.5px; font-weight: 500; line-height: 1;
  color: var(--ink-2); background: var(--inset); border: 1px solid var(--line-soft); border-radius: 3px; white-space: nowrap; }
.crit svg { flex-shrink: 0; width: 11px; height: 11px; color: var(--accent); }
.crit b { color: var(--ink); font-weight: 600; }

/* Completion card (Savepoint SheetHead card, .shd-*): game page header. % big, numbers, progression meter, bar on the bottom edge */
.shd-card { position: relative; margin: 0 16px 14px; background: rgb(var(--c-inset) / 0.72); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 3px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); overflow: hidden; }
.shd-hrow { display: flex; align-items: stretch; }
.shd-big { display: flex; flex-direction: column; justify-content: center; flex-shrink: 0; padding: 8px 12px 9px; border-right: 1px solid rgba(255, 255, 255, 0.07); }
.shd-big b { font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.shd-big b small { font-size: 13px; font-weight: 600; margin-left: 1px; }
.shd-big span { margin-top: 3px; font-size: 10px; color: var(--ink-2); }
.shd-cells { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shd-cells.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shd-cells.n1 { grid-template-columns: minmax(0, 1fr); }
.shd-stat { padding: 8px 10px 9px; min-width: 0; }
.shd-stat + .shd-stat { border-left: 1px solid rgba(255, 255, 255, 0.07); }
.shd-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.shd-v b { font-size: 15px; font-weight: 600; }
.shd-v em { font-style: normal; font-size: 11px; color: var(--ink-2); }
.shd-l { margin-top: 2px; font-size: 10px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 768px) { .shd-big { padding: 9px 16px 10px; } .shd-stat { padding: 9px 14px 10px; } .shd-v b { font-size: 16px; } }
/* the bar: a lit track along the bottom edge, the fill fading into the status colour with a glow */
.shd-track { position: relative; display: block; height: 8px; background: rgba(255, 255, 255, 0.08); border-top: 1px solid rgba(255, 255, 255, 0.06); }
.shd-track i { position: absolute; inset: 0 auto 0 0; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 50%, var(--inset)), var(--c)); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 65%, transparent); }
/* RA progression: one gold segment per progression achievement */
.shd-steps { display: flex; align-items: center; gap: 8px; padding: 8px 12px 9px; border-top: 1px solid rgba(255, 255, 255, 0.07); font-size: 11px; color: var(--gold); }
.shd-steps-l { color: var(--ink-2); }
.shd-meter { flex: 1; display: flex; gap: 2px; height: 6px; }
.shd-meter i { position: relative; flex: 1; overflow: hidden; border-radius: 1px; background: rgba(255, 255, 255, 0.1); }
.shd-meter i.on { background: var(--gold); box-shadow: 0 0 6px rgb(var(--c-gold) / 0.5); }
.shd-meter i u { position: absolute; inset: 0 auto 0 0; background: var(--gold); }
/* the card tinted up to the completion %, in the status colour, with a hard edge */
.shd-card.wash::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 4%, transparent), color-mix(in srgb, var(--c) 20%, transparent)); border-right: 1px solid color-mix(in srgb, var(--c) 45%, transparent); pointer-events: none; }
.shd-card > * { position: relative; }
.shd-steps b { min-width: 34px; text-align: right; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.shd-steps b span { color: var(--ink-2); font-weight: 400; }
/* a series: one segment per game in its status colour (done gold, beaten silver, started dim blue lit to its %) */
.shd-games .shd-meter i.done { background: var(--gold); box-shadow: 0 0 6px rgb(var(--c-gold) / 0.5); }
.shd-games .shd-meter i.beaten { background: var(--silver); }
.shd-games .shd-meter i.started { background: rgb(var(--c-accent) / 0.32); }
.shd-games .shd-meter i.started u { background: var(--accent); }
.shd-games .shd-meter i.beaten u { display: none; }

/* ══ Cheevodex's own frame (CHV-033–035, doc-012): the dex, the identity rail, dex numbers ══ */

/* Dex number: the RA game ID, the one place the pixel face is used (doc-012) */
/* Silkscreen is drawn on an 8px grid: at exactly 8px it's crisp, at 9px it smears */
.dex-no { font-family: var(--pixel); font-size: 8px; line-height: 1; letter-spacing: 0.02em; color: var(--ink-2); white-space: nowrap; }
.dex-no b { font-weight: 400; color: var(--ink-2); }
.dex-no.lg { font-size: 11px; color: var(--ink-2); }
.dex-no.lg b { color: var(--ink); }

/* Dex counter: played / beaten / mastered, the profile's headline numbers (header on phones, rail on desktop) */
.dexc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; background: rgb(var(--c-well) / 0.6); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.dexc-cell { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 7px 10px 9px; min-width: 0; text-align: left; transition: background-color 150ms; }
button.dexc-cell:hover { background: rgb(var(--c-box-hi) / 0.8); }
.dexc-cell + .dexc-cell { border-left: 1px solid var(--line); }
.dexc-cell > span { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.dexc-cell > b { font-family: var(--mono); font-size: 17px; font-weight: 600; line-height: 1.1; color: var(--c); }
.dexc-cell > i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgb(var(--c-well)); }
.dexc-cell > i > u { display: block; height: 100%; background: var(--c); }
.dexc-cell.mastered > i > u { box-shadow: 0 0 8px rgb(var(--c-gold) / 0.6); }

/* Dex grid: one entry per game, the number on top, the icon as the entry picture with its completion ring */
.dgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .dgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) { .dgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; } }
.dent { position: relative; container: dent / inline-size; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 7px 7px 8px; text-decoration: none;
  background: var(--box); border: 1px solid var(--line); border-radius: 3px; transition: transform 150ms, border-color 150ms, background-color 150ms; }
.dent:hover { transform: translateY(-2px); background: var(--box-hi); border-color: var(--ink-4); }
.dent:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dent-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; height: 15px; }
.dent-sring.full::before { filter: drop-shadow(0 0 3px rgb(var(--c-gold) / 0.6)); }
.dent-pic { position: relative; aspect-ratio: 1; border-radius: 2px; overflow: hidden; background: var(--well); border: 1px solid var(--well-edge); }
.dent-pic img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.dent.unstarted .dent-pic img { filter: grayscale(1) brightness(0.75); opacity: 0.55; }
.dent-t { font-size: 11.5px; font-weight: 500; color: var(--ink); line-height: 1.25; height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dent-m { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; margin-top: auto; font-size: 10px; color: var(--ink-3); }
.dent-c { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent); }
.dent-c.sub { color: var(--gold-dim); }   /* a subset's name, dim gold as in the game rows */
.dent-n { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; font-family: var(--mono); color: var(--ink-3); }
.dent-n b { font-weight: 600; color: var(--ink); }
/* Beaten and mastered: a labelled tag in the top corner, a tint of their metal and a heavier frame round the art */
.dent-badge { display: inline-flex; align-items: center; gap: 3px; height: 15px; padding: 0 5px; flex-shrink: 0; border-radius: 2px;
  font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.dent-badge svg { flex-shrink: 0; }
/* A card too narrow for the word (phones, tablets, any narrow grid): icon only, the word kept for screen readers */
@container dent (max-width: 150px) {
  .dent-badge { width: 17px; padding: 0; justify-content: center; }
  .dent-badge-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.dent.beaten { border-color: rgb(var(--c-silver) / 0.7); background: linear-gradient(180deg, rgb(var(--c-silver) / 0.20), rgb(var(--c-silver) / 0.07)), var(--box); }
.dent.beaten:hover { background: linear-gradient(180deg, rgb(var(--c-silver) / 0.26), rgb(var(--c-silver) / 0.10)), var(--box-hi); }
.dent.beaten .dent-badge { color: var(--silver); background: rgb(var(--c-silver) / 0.12); box-shadow: inset 0 0 0 1px rgb(var(--c-silver) / 0.6); }
.dent.beaten .dent-pic { border-color: var(--silver); box-shadow: 0 0 0 1px rgb(var(--c-silver) / 0.5); }
.dent .dex-no { color: var(--ink-3); }   /* the number is the entry's identity: Silkscreen stays at its 8px grid, so contrast does the work */
.dent .dex-no b { color: var(--ink); }
.dent.beaten .dex-no { color: rgb(var(--c-silver) / 0.65); }   /* "No." in the metal: grey ink vanishes into the tint */
.dent.beaten .dex-no b { color: var(--silver); }
.dent.mastered { border-color: var(--gold); background: linear-gradient(180deg, rgb(var(--c-gold) / 0.28), rgb(var(--c-gold) / 0.09)), var(--box); box-shadow: 0 0 14px rgb(var(--c-gold) / 0.2); }
.dent.mastered:hover { background: linear-gradient(180deg, rgb(var(--c-gold) / 0.34), rgb(var(--c-gold) / 0.13)), var(--box-hi); border-color: var(--gold); }
.dent.mastered .dent-badge { color: rgb(var(--c-page)); background: var(--gold); box-shadow: 0 0 8px rgb(var(--c-gold) / 0.45); }
.dent.mastered .dent-pic { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.dent.mastered .dex-no { color: rgb(var(--c-gold) / 0.65); }
.dent.mastered .dex-no b { color: var(--gold); }
.dent.mastered .dent-n b { color: var(--gold); }
.dent.beaten .dent-m, .dent.beaten .dent-n, .dent.mastered .dent-m, .dent.mastered .dent-n { color: var(--ink-2); }   /* grey ink sinks into the metal tint */
.dent.beaten .dent-c { color: var(--silver); }
.dent.mastered .dent-c { color: rgb(var(--c-gold) / 0.85); }

/* Identity rail (≥1024px): the player's card pinned beside the content, in place of the wide header */
.idrail { display: none; }
@media (min-width: 1024px) {
  .idrail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 53px; max-height: calc(100vh - 69px); overflow-y: auto; scrollbar-width: none; }
  .idrail::-webkit-scrollbar { display: none; }
}
.idr-card { position: relative; overflow: hidden; background: var(--box); border: 1px solid var(--line); border-radius: 3px; }
.idr-card > .art-bg { position: absolute; inset: 0 0 auto 0; height: 120px; }
.idr-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 120px; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, rgb(var(--c-gold) / 0.16), transparent 60%), linear-gradient(180deg, transparent 40%, var(--box)); }
.idr-in { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; padding: 16px 14px 14px; }
.idr-in .phead-av { width: 76px; height: 76px; }
.idr-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.idr-name h1 { font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.idr-sub { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }
.idr-motto { font-size: 11.5px; font-style: italic; color: var(--ink-2); line-height: 1.4; border-left: 2px solid var(--line-2); padding-left: 8px; }
.idr-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.idr-nums > div { padding: 9px 10px; min-width: 0; }
.idr-nums > div + div { border-left: 1px solid var(--line); }
.idr-nums b { display: block; font-family: var(--mono); font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idr-nums span { font-size: 10px; color: var(--ink-3); }
.idr-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.idr-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.idr-foot { font-size: 11px; color: var(--ink-3); }
.idr-foot b { color: var(--ink-2); font-weight: 500; }
.idrail .stiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.idrail .stile { padding: 8px 10px; }

/* Dex index (CHV-037): entries grouped by console like volumes, a sticky heading per console */
.dvol { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 52px); }
@media (min-width: 768px) { .dvol { scroll-margin-top: 92px; } }
.dvol + .dvol { margin-top: 18px; }
.dvol-h { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 43px); z-index: 20; display: flex; align-items: baseline; gap: 8px;
  padding: 10px 2px 7px; margin-bottom: 8px; background: var(--page); border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .dvol-h { top: 82px; } }
.dvol-t { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dvol-n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.dvol-m { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-3); }
.dvol-m b { font-family: var(--mono); font-weight: 600; }
.dindex { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.dindex b { font-family: var(--mono); font-weight: 600; color: var(--ink-2); }

/* Game page as a dex (CHV-036): the summary facts under the completion card, chapter headings, See also */
.dsum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 10px; padding: 0 2px; }
@media (min-width: 768px) { .dsum { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.dsum > div { min-width: 0; }
.dsum dt { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.dsum dd { margin: 1px 0 0; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.dchap { display: flex; align-items: baseline; gap: 8px; padding: 12px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dchap:first-child { padding-top: 2px; }
.dchap-t { font-size: 13px; font-weight: 600; color: var(--ink); }
.dchap-s { font-size: 11px; color: var(--ink-3); }
.dchap-n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.dchap-n b { color: var(--gold); font-weight: 600; }
.seealso { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
@media (min-width: 768px) { .seealso { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seealso a { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; background: var(--box); border: 1px solid var(--line); border-radius: 3px; text-decoration: none; transition: background-color 150ms; }
.seealso a:hover { background: var(--box-hi); }
.seealso img { width: 32px; height: 32px; border-radius: 2px; object-fit: cover; background: var(--well); flex-shrink: 0; image-rendering: pixelated; }
.seealso .t { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seealso .k { font-size: 10.5px; color: var(--ink-3); }

/* ══ Cheevodex motifs, replacing Savepoint's card, row bar and stat tiles (CHV-040) ══
   ring = completion, dotted leaders = the codex index, diamonds = the progression path */

/* Progress ring: conic fill masked to a ring; the value sits in the middle */
.dring { position: relative; flex-shrink: 0; width: var(--s, 72px); height: var(--s, 72px); display: grid; place-items: center; }
.dring::before { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--cb, var(--c)) 0 calc(var(--b, var(--p)) * 1%), var(--c) 0 calc(var(--p) * 1%), var(--rt, rgb(var(--c-ink) / 0.09)) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--w, 6px)), black calc(100% - var(--w, 6px) + 0.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - var(--w, 6px)), black calc(100% - var(--w, 6px) + 0.5px)); }
.dring.full::before { filter: drop-shadow(0 0 6px rgb(var(--c-gold) / 0.55)); }
.dring > b { position: relative; font-family: var(--mono); font-weight: 600; line-height: 1; color: var(--c); }
.dring > b small { font-size: 0.55em; font-weight: 500; margin-left: 1px; }

/* Ledger: label, dotted leader, value — like a line in a book's index */
.dledger { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dl-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.dl-k { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.dl-dots { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line-2); transform: translateY(-3px); }
.dl-v { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-v em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.dl-v small { font-size: 11px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }

/* Dex record (game page): ring + ledger, then the progression path */
.drec { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; background: rgb(var(--c-inset) / 0.78); border: 1px solid var(--line); border-radius: 3px; }
.drec-top { display: flex; align-items: center; gap: 16px; }
.drec-top .dledger { flex: 1; }
@media (min-width: 768px) { .drec-top .dledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; } }

/* Progression path: one diamond per progression achievement (grouped past 20) on a thin line */
.dpath { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dpath-l { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.dpath-t { position: relative; flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: center; height: 12px; }
.dpath-t::before { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; height: 1px; background: var(--line-2); }
.dpath-t::after { content: ''; position: absolute; left: 4px; top: 50%; height: 1px; width: var(--done, 0%); background: var(--gold); }
.dpath-t > i { position: relative; z-index: 1; width: 7px; height: 7px; transform: rotate(45deg); background: var(--well); border: 1px solid var(--line-2); flex-shrink: 0; }
.dpath-t > i.on { background: var(--gold); border-color: var(--gold-hi); box-shadow: 0 0 6px rgb(var(--c-gold) / 0.55); }
.dpath-t > i.part { background: var(--gold-dim); border-color: var(--gold); }
.dpath-n { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--gold); white-space: nowrap; }
.dpath-n span { color: var(--ink-3); font-weight: 400; }

/* Game rows: the count beside a small ring, in place of Savepoint's thin bar */
.grow-prog.dprog { width: auto; flex-direction: row; align-items: center; gap: 8px; }
.grow-prog.dprog .gcount { order: 1; }
.grow-prog.dprog .dring { order: 2; }

/* Stat ledger: the user stats as index lines (Overview and the identity rail) */
.sledger { padding: 10px 12px; background: var(--box); border: 1px solid var(--line); border-radius: 3px; }
.sledger .dl-k { font-size: 11.5px; }
.sledger .dl-v { font-size: 12.5px; }
/* Rings over row art: a dark disc behind so the arc reads on any screenshot */
.grow-prog.dprog .dring { background: rgb(var(--c-well) / 0.75); border-radius: 50%; }
.grow-prog.dprog .dring::before { background: conic-gradient(var(--c) calc(var(--p) * 1%), rgb(var(--c-ink) / 0.16) 0); }
/* Game awards counts as index lines (completions.js) */
.cmp-ledger { margin-bottom: 10px; }
.cmp-ledger .dl-k { display: inline-flex; align-items: center; gap: 6px; }


/* Changelog: releases as volumes, sections as index lines */
.clog-sum { max-width: 320px; }
.clog .dvol-h.clog-rh { top: env(safe-area-inset-top, 0px); width: 100%; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--line); margin-bottom: 0; cursor: pointer; }
@media (min-width: 768px) { .clog .dvol-h.clog-rh { top: 37px; } }
.clog-rh:hover .dvol-t { color: var(--ink); }
.clog-rh .dvol-t { font-weight: 500; color: var(--ink-2); }
.clog-v { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); flex-shrink: 0; }
.clog .dvol { scroll-margin-top: 8px; }
@media (min-width: 768px) { .clog .dvol { scroll-margin-top: 46px; } }
.clog .dvol + .dvol { margin-top: 6px; }
.clog-meta { display: flex; flex-direction: column; gap: 3px; padding: 6px 2px 0 17px; font-size: 11px; color: var(--ink-3); }
.clog-meta p { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.clog-ss { gap: 2px; padding: 10px 0 8px 17px; }
.clog-sh { width: 100%; padding: 5px 2px; background: none; border: 0; text-align: left; align-items: center; border-radius: 2px; }
.clog-sh:hover { background: var(--box); }
.clog-sh .dl-k { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.clog-sh .dl-k i { width: 6px; height: 6px; transform: rotate(45deg); flex-shrink: 0; }
.clog-sh .dl-dots { transform: none; align-self: center; }
.clog-sh .dl-v { font-size: 12px; color: var(--ink-2); }
.clog-es { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 14px 14px; }
.clog-e { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.clog-e > i { flex-shrink: 0; width: 4px; height: 4px; margin-top: 12px; transform: rotate(45deg); background: var(--line-2); }
.clog-e > .clog-eh, .clog-e > button { padding: 4px 6px; margin-left: -6px; }
.clog-e > button { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; background: none; border: 0; border-radius: 2px; color: inherit; }
.clog-e > button:hover { background: var(--box); }
.clog-eh { color: var(--ink); }
.clog-ec { display: inline; margin-left: 5px; vertical-align: -1px; color: var(--ink-3); transition: transform 200ms; }
.clog-e.open .clog-ec { transform: rotate(180deg); }
.clog-er { font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.clog-e strong { color: var(--ink); font-weight: 600; }
.clog-code { font-family: var(--mono); font-size: 0.92em; color: var(--ink-2); overflow-wrap: anywhere; }
.clog-er .clog-code { color: var(--ink-2); }
.clog-jump { flex-wrap: wrap; row-gap: 4px; margin-bottom: 14px; }
.clog-jump > span { margin-right: 2px; }
.clog-jump a { padding: 1px 6px; border: 1px solid var(--line); border-radius: 2px; background: var(--box); }
.clog-jump a:hover { border-color: var(--accent); }
.clog-jump a:hover b { color: var(--ink); }
.clog-jump button { padding: 0 2px; font-size: 11.5px; color: var(--accent); background: none; border: 0; }
.clog-rh .dvol-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.clog-rh .dvol-m { align-self: center; }

/* Activity summary: the dex entries that moved in the last 14 days. Each ring shows what you had before the fortnight
   (dim) and what you gained in it (bright), the game's icon inside */
.mdex-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 12px 14px 4px; }
.mdex-t { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); }
.mdex-tot { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.mdex-tot b { color: var(--ink-2); font-weight: 600; }
.mdex-list { display: flex; flex-direction: column; padding: 2px 6px 4px; }
.mrow { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 7px 8px; border-radius: 2px; }
.mrow:hover { background: var(--box-hi); }
.mrow .dring > img { position: relative; width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--well); }
.mrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mrow-t { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.mrow-s { display: flex; align-items: baseline; gap: 7px; min-width: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.mrow-s > b { font-weight: 600; }
.mrow-e { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: var(--mono); }
.mrow-e > b { font-size: 17px; font-weight: 600; line-height: 1; }
.mrow-e > span { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.mrow-e small { color: var(--ink-3); font-size: 10.5px; }
.mdex-all { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: 2px 8px 4px; padding: 0; font-size: 11.5px; color: var(--accent); background: none; border: 0; }
.mdex-all:hover { color: var(--ink); }
.mdex-none { padding: 6px 14px 10px; font-size: 12px; color: var(--ink-3); }
.mdex-open { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; padding: 8px; font-size: 11.5px; color: var(--accent);
  background: none; border: 0; border-top: 1px solid var(--line-soft); }
.mdex-open:hover { color: var(--ink); background: var(--box-hi); }
.mdex > .anim-fade { border-top: 1px solid var(--line-soft); }
.mdex .astreak { margin-top: 0; }

/* Friends timeline. Strip: active friends, newest first, tap to narrow. Rail: each day's posts hang on a thin
   line with the friend's avatar as the node; a post is their runs back to back, each a game line, then badges */
.fstrip { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; }
.fstrip::-webkit-scrollbar { display: none; }
.fpal { flex-shrink: 0; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 5px;
  background: none; border: 0; border-radius: 3px; }
.fpal:hover { background: var(--box); }
.fpal-av { width: 42px; height: 42px; display: grid; place-items: center; padding: 2px; border-radius: 50%; background: color-mix(in srgb, var(--fc, var(--line-2)) 55%, transparent); color: var(--ink-2); }
.fpal-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--well); }
.fpal.on .fpal-av { background: var(--fc, var(--accent)); box-shadow: 0 0 12px color-mix(in srgb, var(--fc, var(--accent)) 50%, transparent); }
.fpal.all .fpal-av { background: var(--box-hi); }
.fpal.all.on .fpal-av { background: var(--accent); color: var(--page); }
.fpal-name { max-width: 60px; font-size: 10.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpal.on .fpal-name { color: var(--fc, var(--ink)); font-weight: 600; }
.fpal b { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--gold); line-height: 1; }
.fpal.all b { color: var(--ink-2); }

.fposts { position: relative; display: flex; flex-direction: column; gap: 4px; padding-left: 6px; }
.fposts::before { content: ''; position: absolute; left: 23px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.fpost { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 11px; padding: 4px 0; }
.fpost-av { position: relative; z-index: 1; width: 36px; height: 36px; padding: 2px; border-radius: 50%; background: var(--page); box-shadow: 0 0 0 1.5px var(--fc, var(--line-2)), 0 0 6px color-mix(in srgb, var(--fc, transparent) 30%, transparent); }
.fpost-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--well); }
.fpost-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.fpost-h { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fpost-name { font-size: 13px; font-weight: 600; color: var(--fc, var(--ink)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpost-name:hover { filter: brightness(1.2); }
.fpost-time { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.fpost-sum { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.frun { --mc: var(--ink-3); background: var(--box); border: 1px solid var(--line); border-left: 3px solid var(--mc); border-radius: 3px; overflow: hidden; }
.frun.hc { --mc: var(--gold); }
.frun.mix { border-image: linear-gradient(var(--gold) 50%, var(--ink-3) 50%) 1; }
.frun-h { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 11px 9px 9px; background: var(--box-hi);
  border-bottom: 1px solid var(--line-soft); color: var(--ink); overflow: hidden;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--mc) 14%, transparent), transparent 60%); }
.frun-icon { width: 30px; height: 30px; border-radius: 2px; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.frun-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.frun-t { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.frun-h:hover .frun-t > .truncate { color: var(--accent-hi); }
.frun-sub { font-size: 11.5px; color: var(--gold-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.frun-m { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.frun-m .num { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.frun-e { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: var(--mono); }
.frun-e b { font-size: 14px; font-weight: 600; line-height: 1; color: var(--gold); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.frun-e span { font-size: 10.5px; color: var(--ink-2); }
.frun-b { display: flex; align-items: center; gap: 4px; width: 100%; padding: 8px 10px 8px 9px; background: none; border: 0; text-align: left; }
.frun-b:hover { background: var(--box-hi); }
.frun-b img { width: 28px; height: 28px; border-radius: 2px; flex-shrink: 0; border-bottom: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); }
.frun.mix .frun-b img.hc { border-bottom-color: var(--gold); }
.frun.mix .frun-h { background-image: linear-gradient(90deg, rgb(var(--c-gold) / 0.1), transparent 60%); }
@media (max-width: 639px) { .frun-b img:nth-of-type(n+8) { display: none; } }
.frun-more { margin-left: 3px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.frun-c { margin-left: auto; flex-shrink: 0; color: var(--ink-3); transition: transform 200ms; }
.frun.open .frun-c { transform: rotate(180deg); }
.frun-b:hover .frun-c { color: var(--accent); }
.frun-rows { border-top: 1px solid var(--line-soft); }
/* Mine: your runs keep their full unlock rows under the strip */
.frun.mine .frun-rows { border-top: 0; }
.frun-rows > .trow + .trow { border-top: 1px solid var(--line-faint); }

/* Compare sheet rows: game, then your ring and theirs (blue you, aqua them, gold when mastered); the leader lit */
.cmpr { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--box-hi); border-radius: 2px; }
.cmpr:hover { background: var(--box-hover); }
@media (min-width: 640px) { .cmpr { flex-direction: row; align-items: center; gap: 12px; } }
.cmpr-g { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.cmpr-g img { width: 32px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.cmpr-t { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 500; }
.cmpr-g:hover .cmpr-t > .truncate { color: var(--accent-hi); }
.cmpr-s { display: flex; align-items: baseline; gap: 7px; min-width: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.cmpr-p { display: flex; gap: 6px; flex-shrink: 0; }
.cmpx { flex: 1; display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 3px; min-width: 132px; border: 1px solid transparent; }
.cmpx.lead { background: color-mix(in srgb, var(--lc) 12%, transparent); border-color: color-mix(in srgb, var(--lc) 40%, transparent); }
/* the avatar sits inside the ring, a 2px gap between face and arc */
.cmpx-ring { --rt: color-mix(in srgb, var(--lc) 28%, transparent); }   /* the track in the person's colour: whose it is even at 1% */
.cmpx-ring img { position: relative; width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; object-fit: cover; background: var(--well); }
.cmpx-v { flex: 1; display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.cmpx-v b { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.cmpx-v small { font-size: 10px; color: var(--ink-3); }
@media (max-width: 639px) { .cmpr-p > .cmpx { min-width: 0; } }
/* Compare header: you on the left, them on the right, each with an avatar ringed in their colour */
.cmp-top { display: flex; align-items: center; height: 30px; padding: 0 56px 0 16px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
@media (min-width: 768px) { .cmp-top { height: 28px; margin-top: 10px; } }   /* lines up with the close button (12px / 30px on phones under the handle, 10px / 28px on desktop) */
.cmp-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 14px 16px 16px; }
.cmp-p { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.cmp-p.them { justify-content: flex-end; text-align: right; }
.cmp-p img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--well); box-shadow: 0 0 0 2px var(--pc); }
.cmp-p > span { display: flex; flex-direction: column; gap: 2px; }
.cmp-p b { font-size: 14px; font-weight: 600; color: var(--pc); line-height: 1.2; }
.cmp-p small { font-size: 11px; color: var(--ink-3); }
.cmp-p.them:hover small { color: var(--accent-hi); }
.cmp-vs-x { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
/* Who leads: one bar in the two colours */
.cmp-score { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--box-hi); border: 1px solid var(--line-soft); border-radius: 3px; }
.cmp-score-h { font-size: 12px; color: var(--ink-2); }
.cmp-score-h b { color: var(--ink); font-weight: 600; }
.cmp-bar { display: flex; gap: 2px; height: 8px; }
.cmp-bar i { border-radius: 2px; min-width: 4px; }
.cmp-bar .me { background: var(--mc); } .cmp-bar .tie { background: var(--line-2); } .cmp-bar .them { background: var(--tc); }
.cmp-score-k { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.cmp-score-k span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-score-k b { font-weight: 600; }
.cmp-score-k .me b { color: var(--mc); } .cmp-score-k .them b { color: var(--tc); } .cmp-score-k .tie b { color: var(--ink-2); }

/* Tiles: the count beside a small ring (the ring motif), in place of the old segmented bar */
.gtile-n { display: inline-flex; align-items: center; gap: 6px; }
/* Stats tab: streaks and pace as index lines, two columns from md */
.stat-lines { gap: 7px; }
@media (min-width: 768px) { .stat-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; } }
.clog-e > span, .clog-e > button { max-width: 72ch; }
.clog-meta p { max-width: 72ch; }
/* Game page Info tab: time to beat and facts as index lines, two columns from md */
.info-lines { gap: 7px; }
@media (min-width: 768px) { .info-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; } }
/* Achievement page: unlock numbers as index lines, three across from md */
.ach-lines { gap: 6px; }
@media (min-width: 768px) { .ach-lines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; } }

/* ── Consoles page (console/app.js): the catalog by console, one search over it ──────────────────────── */
.cn-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.cn-rail-col { display: none; }
@media (min-width: 768px) {
  .cn-layout { grid-template-columns: 232px minmax(0, 1fr); gap: 28px; }
  .cn-rail-col { display: block; position: sticky; top: 42px; max-height: calc(100vh - 58px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
.cn-icon { display: grid; place-items: center; flex-shrink: 0; overflow: hidden; border-radius: 3px; background: var(--bar); border: 1px solid var(--well); }
.cn-icon img { object-fit: contain; }

/* Header: title + controls, then index lines (main) or crumbs, the console and its coverage (a console) */
.cn-head { position: relative; display: flex; flex-direction: column; gap: 12px; }
.cn-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cn-title h1 { margin: 0; font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.15; letter-spacing: -0.01em; }
.cn-title .cn-st { margin-top: 2px; }
.cn-ledger { max-width: 420px; }
.cn-crumbs { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.cn-crumbs a { color: var(--ink-3); text-decoration: none; }
.cn-crumbs a:hover { color: var(--accent-hi); }
.cn-pick { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; padding: 2px 6px; margin-left: -2px; border: 1px solid transparent; border-radius: 3px;
  background: none; color: var(--ink-2); font: 500 12px var(--font); cursor: pointer; }
.cn-pick:hover, .cn-pick[aria-expanded='true'] { color: var(--ink); background: var(--box); border-color: var(--line); }
@media (min-width: 768px) { .cn-head:not(.norail) .cn-pick svg { display: none; } .cn-head:not(.norail) .cn-pick { pointer-events: none; } }   /* the rail does the switching on desktop; without it (All consoles) the picker works */
.cn-crumbwrap { position: relative; }
.cn-crumbs { min-height: 24px; }
.cn-title .cn-st .text-ink-4 { margin: 0 2px; }
.cn-picker { position: absolute; top: 28px; left: 0; right: 0; max-width: 420px; z-index: 30; max-height: 60vh; overflow-y: auto; padding: 6px; background: var(--box); border: 1px solid var(--line);
  border-radius: 3px; box-shadow: 0 16px 40px rgb(0 0 0 / 0.6); }

/* Loading: what loads now; with several asked for, which one of how many and a plain bar (no sweeps: flat app) */
.cn-progress { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--box); border: 1px solid var(--line); border-radius: 3px; }
.cn-progress-h { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--ink-2); }
.cn-progress-h b { color: var(--ink); font-weight: 600; }
.cn-bar { position: relative; height: 3px; border-radius: 2px; background: var(--well); overflow: hidden; }
.cn-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 2px; transition: width .4s ease; }

/* State line: count, loading, waiting, not saved */
.cn-st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.cn-st b { color: var(--ink-2); font-weight: 600; }
.cn-st.on { color: var(--accent); }
.cn-st.dim { color: var(--ink-4); }
/* A card's action at its right edge: one square button, or the state's own mark */
.cn-act { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 3px; color: var(--ink-3); }
.cn-act.busy { color: var(--accent); }
.cn-act.btn { border: 1px solid var(--line); background: var(--box-hi); color: var(--ink-2); cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.cn-act.btn:hover { color: var(--accent); border-color: rgb(var(--c-accent) / 0.5); background: rgb(var(--c-accent) / 0.08); }
.cn-act.btn:active { transform: scale(0.94); }
.cn-act.btn.danger { color: var(--danger); }
.cn-act.btn.danger:hover { border-color: rgb(var(--c-danger) / 0.5); background: rgb(var(--c-danger) / 0.08); }

/* Cards (the main view, and phones): icon, name, its state, and its action on the right */
.cn-glabel { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); }
.cn-glabel b { color: var(--accent); font-weight: 600; }
.cn-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; min-width: 0; overflow: hidden; background: var(--box); border: 1px solid var(--line); border-radius: 3px;
  text-decoration: none; transition: background .12s, border-color .12s; }
.cn-card:hover { background: var(--box-hi); }
.cn-card { padding-right: 8px; }
.cn-card.none, .cn-card.failed, .cn-card.queued { background: transparent; border-color: var(--line-soft); }
.cn-card.none .cn-cname, .cn-card.failed .cn-cname, .cn-card.queued .cn-cname { color: var(--ink-2); }
.cn-card.loading { border-color: rgb(var(--c-accent) / 0.45); }
.cn-cmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cn-cname { font-size: 12px; font-weight: 500; color: var(--ink); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-card:hover .cn-cname { color: var(--accent-hi); }

/* Rail (desktop): All consoles, then each group's consoles with their count or state */
.cn-rail { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.cn-rlabel { padding: 6px 8px 3px; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }
.cn-rrow { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 3px; background: none;
  color: var(--ink-2); font: 500 12px var(--font); text-align: left; cursor: pointer; overflow: hidden; }
.cn-rrow:hover { background: var(--box); color: var(--ink); }
.cn-rrow.on { background: var(--box-hi); color: var(--ink); }
.cn-rrow.on::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); }
.cn-rrow.none .cn-rname, .cn-rrow.failed .cn-rname { color: var(--ink-3); }
.cn-rrow.all { border-bottom: 1px solid var(--line-soft); border-radius: 3px 3px 0 0; }
.cn-rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Search field */
.cn-search { position: relative; }
.cn-search input { width: 100%; height: 40px; padding: 0 34px; background: var(--box); border: 1px solid var(--line); border-radius: 3px; outline: 0; color: var(--ink); font: 400 13px var(--font); transition: border-color .15s; }
.cn-search input:focus { border-color: var(--accent); }
.cn-search input::placeholder { color: var(--ink-3); }
.cn-search input::-webkit-search-cancel-button { display: none; }
.cn-search-i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.cn-search-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 3px; background: none; color: var(--ink-3); cursor: pointer; }
.cn-search-x:hover { color: var(--ink); }

/* Games */
.cn-count { margin-bottom: 6px; padding: 0 2px; font-size: 11px; color: var(--ink-3); }
.cn-count b { color: var(--ink-2); font-weight: 600; }
.cn-game { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 12px; background: var(--box); border-radius: 2px; text-decoration: none; transition: background .12s; }
.cn-game:hover { background: var(--box-hi); }
.cn-gicon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 2px; border: 1px solid var(--well); object-fit: cover; background: var(--bar); }
.cn-gph { display: grid; place-items: center; }
.cn-gmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cn-gt { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.cn-game:hover .cn-gt { color: var(--accent-hi); }
.cn-tag { flex-shrink: 0; padding: 1px 4px; border-radius: 2px; font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.cn-gsub { font-size: 11px; color: var(--gold-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-gmeta { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.cn-mine { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 11px; color: var(--ink-2); font-weight: 600; }
.cn-mine small { color: var(--ink-3); font-weight: 500; }
.cn-none { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px; text-align: center; font-size: 12px; color: var(--ink-3); }
.cn-none b { color: var(--ink-2); font-size: 13px; font-weight: 600; }

/* ── Social page (social/app.js) ─────────────────────────────────────────────────────────────────────── */
/* The header reuses the Consoles title row (.cn-title); under the phone's tab bar, the open tab's sync state */
.soc-sync { display: flex; align-items: center; min-height: 28px; margin-bottom: 8px; }
/* Day headings pin under the phone's tab bar (.tl-tabs, 43px); on desktop there's no tab bar, only the top bar */
@media (min-width: 768px) { .soc .tl-tabs .tday { top: 37px; } }
