/* LaughTale. Poppins for everything, Alfa Slab One for titles; the card art is the content. */

@font-face { font-family: "Alfa Slab One"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/AlfaSlabOne-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/Poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/Poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/Poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/Poppins-700.woff2") format("woff2"); }

:root {
  --ground: #f4f2ee;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #6a6a6a;
  --rule: #e6e3dd;
  --control: #8f8880;
  --accent: #e30000;
  --accent-text: #c90000;
  --accent-deep: #b91d22;
  --accent-soft: rgba(227, 0, 0, 0.12);
  --backdrop: rgba(8, 8, 8, 0.92);
  --scrollbar: #c9c5bd;
  --c-red: #d0342c;
  --c-green: #2b8151;
  --c-blue: #2f6fb7;
  --c-purple: #7b4b9e;
  --c-black: #303030;
  --c-yellow: #e0a800;
  --display: "Alfa Slab One", "Rockwell", "Georgia", serif;
  --text: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --gutter: 24px;
  --filter-w: 250px;
  --list-gap: 32px;
  /* one row-column width: the browse results track, and lists on pages with no sidebar */
  --list-w: calc(100% - var(--filter-w) - var(--list-gap));
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 16, 8, 0.06), 0 8px 24px -12px rgba(20, 16, 8, 0.25);
  --shadow-up: 0 2px 4px rgba(20, 16, 8, 0.06), 0 18px 36px -14px rgba(20, 16, 8, 0.35);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --band-text: rgba(255, 255, 255, 0.9);
  --scrim: rgba(0, 0, 0, 0.35);
  --scrim-strong: rgba(0, 0, 0, 0.5);
  --shade: rgba(0, 0, 0, 0.6);
  --lb-control: rgba(10, 9, 8, 0.7);
  --lb-control-hover: rgba(10, 9, 8, 0.95);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--scrollbar) transparent; scrollbar-gutter: stable; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.6 var(--text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

a { color: inherit; text-decoration: none; }
/* in-content links are underlined at rest: hover is not an affordance on a phone */
main :where(a:not(.deck-row):not(.button):not(.filter-list a)) { color: var(--accent-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
main :where(a:not(.deck-row):not(.button):not(.filter-list a)):hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
time, .count, .qty, .fl-n, .card-tile-code { font-variant-numeric: tabular-nums; }

/* viewport-fit=cover is site wide, so the gutter has to clear a notch in landscape */
.wrap { --pad-l: max(var(--gutter), env(safe-area-inset-left)); --pad-r: max(var(--gutter), env(safe-area-inset-right));
  max-width: 1180px; margin: 0 auto; padding: 0 var(--pad-r) 0 var(--pad-l); }
.page { padding-top: 32px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Type ---------- */
h1 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.15; margin: 0; text-wrap: balance; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.25; margin: 0 0 14px; }
h2 .count { color: var(--ink-2); font-weight: 500; font-size: 15px; margin-left: 8px; }
h3, .group-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.sub { color: var(--ink-2); margin: 6px 0 0; font-size: 15px; }
.quiet { color: var(--ink-2); }
.small { font-size: 13px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rank { color: var(--accent-text); font-weight: 700; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02); }
.header-row { display: flex; align-items: center; gap: 28px; height: 68px; }
.wordmark { font-family: var(--display); font-size: 24px; line-height: 1; display: inline-flex; align-items: center; min-height: 24px; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; height: 100%; }
.nav-links a { display: inline-flex; align-items: center; height: 100%; padding: 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); border-bottom: 3px solid transparent; padding-top: 3px; white-space: nowrap; outline-offset: -2px; transition: color 160ms var(--ease-out), background 160ms var(--ease-out); }
.nav-links a:hover { background: var(--ground); }
.nav-links a.active { border-bottom-color: var(--accent); }
/* Currency toggle: right of the nav on desktop, beside the wordmark once the nav wraps. */
.currency { display: inline-flex; align-items: stretch; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.currency > * { display: inline-flex; align-items: center; padding: 0 12px; min-height: 30px; }
.currency b { background: var(--ink); color: var(--surface); }
.currency a { color: var(--ink-2); text-decoration: none; }
.currency a:hover { color: var(--ink); background: var(--ground); text-decoration: none; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.list-head .result-count { margin: 0; }
.value-currency { margin: 10px 0 0; }
.price-note { margin: 8px 0 0; max-width: 42ch; line-height: 1.45; }
/* Pill input: the header search and the sidebar leader box, same part at two sizes. */
.search, .leader-search { display: flex; align-items: center; background: var(--ground); border: 1px solid var(--control); border-radius: 999px; height: var(--pill-h); padding: 0 4px 0 var(--pill-pad); transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out); }
.search:focus-within, .leader-search:focus-within { border-color: var(--ink); background: var(--surface); }
.search input, .leader-search input { align-self: stretch; flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: var(--pill-font); color: var(--ink); outline: none; }
.search input::placeholder, .leader-search input::placeholder { color: var(--ink-2); }
.search input::-webkit-search-cancel-button, .leader-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search button, .leader-search button { width: var(--pill-btn); height: var(--pill-btn); border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; flex-shrink: 0; }
.search button:hover, .leader-search button:hover { background: var(--accent); }
.search { --pill-h: 40px; --pill-pad: 16px; --pill-font: 14px; --pill-btn: 32px; margin-left: auto; flex: 0 1 340px; min-width: 0; }

/* Suggestion dropdown (header search + sidebar leader box) */
.suggest { position: relative; }
.suggest-menu { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-up); max-height: 340px; overflow-y: auto; }
.suggest-menu li a { text-decoration: none; display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; align-items: center; padding: 6px 8px; border-radius: 4px; color: var(--ink); }
.suggest-menu li a:hover, .suggest-menu li a:focus-visible { background: var(--ground); }
.suggest-menu li a:focus-visible { outline-offset: -2px; }
.suggest-menu img { grid-row: 1 / 3; width: 32px; height: auto; aspect-ratio: 600 / 838; object-fit: cover; border-radius: 2px; background: var(--ground); }
.sg-label { font-weight: 600; font-size: 14px; line-height: 1.25; }
.sg-meta { color: var(--ink-2); font-size: 12px; line-height: 1.3; }

/* ---------- Footer ---------- */
.site-footer { padding: 36px 0 48px; }
.site-footer .wrap { border-top: 1px solid var(--rule); padding-top: 16px; color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); display: inline-block; padding: 4px 0; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Colour dots + tags ---------- */
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.28); }
.dot-red { background: var(--c-red); }
.dot-green { background: var(--c-green); }
.dot-blue { background: var(--c-blue); }
.dot-purple { background: var(--c-purple); }
.dot-black { background: var(--c-black); }
.dot-yellow { background: var(--c-yellow); }
.tag { font-size: 12px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 7px; white-space: nowrap; line-height: 1.5; }
.tag-ink { color: var(--ink); border-color: var(--ink); }

/* ---------- Hero band ---------- */
/* Bandai's current key visual (templates/_band_art.html, scripts/fetch_art.py); the red wash carries the title and closes both edges */
.band { position: relative; color: #fff; overflow: hidden; background: var(--accent-deep); }
.band-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.band::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(185, 29, 34, 0.96) 0%, rgba(185, 29, 34, 0.86) 50%, rgba(185, 29, 34, 0.35) 70%, rgba(185, 29, 34, 0.96) 88%); }
.band-inner { position: relative; z-index: 1; display: flex; align-items: center; min-height: 260px; }
.band-text { padding: 40px 0; max-width: 560px; }
.band h1 { font-size: 46px; color: #fff; text-shadow: 0 2px 8px var(--scrim); overflow-wrap: anywhere; }
.band p { margin: 8px 0 0; color: var(--band-text); font-size: 15px; font-weight: 500; text-shadow: 0 1px 4px var(--scrim); }

/* ---------- Browse: sidebar + grid ---------- */
.result-count, .freshness { color: var(--ink-2); font-size: 13px; margin: 0 0 10px; }
.browse { display: grid; scroll-margin-top: 80px; grid-template-columns: var(--filter-w) minmax(0, 1fr); gap: var(--list-gap); padding-top: 32px; padding-bottom: 56px; align-items: start; }
.filters, .sections { position: sticky; top: 92px; }
.browse .results > section + section { margin-top: 36px; }
.browse > .results[id], .browse .results :is(section, h2)[id] { scroll-margin-top: 92px; }
/* One panel for both widths: at desktop the <details> is forced open and its summary hidden */
@media (min-width: 681px) {
  .filters > summary { display: none; }
  .filters > .filters-panel { display: block; }
  .filters::details-content { content-visibility: visible; }
}
.filters-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px 18px; }
.filters-clear { margin: 14px 0 0; font-size: 13px; }
.pager { display: flex; gap: 16px; margin: 20px 0 0; font-size: 14px; font-weight: 600; }
.filter-group { padding: 0 0 14px; margin: 0 0 14px; border-bottom: 1px solid var(--rule); }
.filter-group:last-child, .filter-group:last-of-type { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.fg-note { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 4px; font-size: 14px; font-weight: 500; color: var(--ink); transition: background 120ms var(--ease-out); }
.filter-list a:hover { background: var(--ground); }
.filter-list a.on { background: var(--ink); color: #fff; }
.filter-list a.on .fl-n { color: rgba(255, 255, 255, 0.7); }
.filter-list a.on .dot-black { outline: 1px solid rgba(255, 255, 255, 0.5); }
.fl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-n { color: var(--ink-2); font-size: 12.5px; }
.filter-list img { width: 28px; height: auto; aspect-ratio: 600 / 838; object-fit: cover; border-radius: 2px; background: var(--ground); flex-shrink: 0; }
.leader-search { --pill-h: 38px; --pill-pad: 12px; --pill-font: 13.5px; --pill-btn: 28px; gap: 6px; margin: 4px 0 0; }
.filter-matches, .filter-selected { margin-top: 12px; }
.filter-matches + .filter-selected { margin-top: 6px; }
.filter-hint { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.filter-selected a.on .fl-x { color: rgba(255, 255, 255, 0.7); font-size: 16px; line-height: 1; }
.filter-selected a.on:hover .fl-x { color: #fff; }


/* ---------- Rows (events, profile, admin) ---------- */
.deck-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; list-style: none; margin: 0; padding: 0; }
.page .deck-list, .page .list-head { max-width: var(--list-w); }
.deck-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--rule); transition: background 120ms var(--ease-out); }
.deck-list > :last-child .deck-row, .deck-list > .deck-row:last-child { border-bottom: 0; }
a.deck-row:hover, .deck-row:has(.deck-link):hover { background: var(--ground); }
/* the title link covers the row, so the store and tags inside it can be their own links */
.deck-link { color: inherit; text-decoration: none; }
.deck-link::after { content: ""; position: absolute; inset: 0; }
.deck-sub a, .deck-tags a { position: relative; color: inherit; text-decoration: none; }
.deck-sub a:hover { text-decoration: underline; text-underline-offset: 3px; }
.deck-tags a.tag:hover { color: var(--ink); border-color: var(--ink); }
.deck-row .thumb { width: 52px; height: auto; aspect-ratio: 600 / 838; object-fit: cover; border-radius: 2px; flex-shrink: 0; background: var(--ground); }
.deck-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.deck-title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-title .rank { margin-right: 4px; }
.deck-sub { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-tags { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.deck-tags .count { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.deck-value { min-width: 4.5em; text-align: right; color: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
.deck-list > .prog-row:last-child { border-bottom: 0; }
.prog-row .deck-title { white-space: normal; }
.sub-region { display: none; }
.page > section { margin-top: 36px; }
.page > section:first-child, .page > .hero + section { margin-top: 0; }
.hero { padding: 0 0 20px; }
.hero + section { margin-top: 12px; }
.official h2 { margin-top: 22px; }

/* ---------- Deck page ---------- */
.deck-page { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; padding-top: 36px; padding-bottom: 56px; align-items: start; }
.deck-side { position: sticky; top: 92px; }
.thumb-btn { display: block; width: 100%; border-radius: 4.2% / 3%; transition: transform 220ms var(--ease-out); }
.thumb-btn:hover { transform: translateY(-3px); }
.portrait { width: 100%; height: auto; aspect-ratio: 600 / 838; border-radius: 4.2% / 3%; box-shadow: var(--shadow-up); }
.deck-side h1 { font-size: 28px; margin-top: 18px; }
.deck-side h1 a { color: inherit; font-weight: inherit; }
.deck-side h1 a:hover { color: var(--accent); }
.deck-side .sub { margin-top: 4px; }
.deck-side .sub a { color: inherit; font-weight: inherit; }
.deck-side .sub a:hover { color: var(--accent); }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.value { margin: 12px 0 0; font-size: 15px; }
.value b { font-size: 20px; }
.value .nowrap { white-space: nowrap; }
.value .as-of { display: block; margin-top: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; }
.button { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; transition: background 160ms var(--ease-out); }
.button:hover { background: var(--accent); text-decoration: none; }
.button-light { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); }
.button-light:hover { background: var(--ink); color: #fff; }
.deck-body > section + section { margin-top: 36px; }
.cards h2, .recent h2, .official h2 { padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px 14px; }
.card-tile { display: block; width: 100%; text-align: left; position: relative; }
.card-tile img, .thumb-missing { width: 100%; height: auto; aspect-ratio: 600 / 838; object-fit: cover; border-radius: 4.2% / 3%; box-shadow: var(--shadow); background: var(--surface); display: block; transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.card-tile:hover img { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.thumb-missing { border: 1px dashed var(--rule); }
.card-tile .qty { position: absolute; left: 8px; top: 8px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 4px; box-shadow: 0 4px 12px -4px var(--scrim-strong); }
.card-tile-name { display: block; margin-top: 8px; font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tile-code { display: block; color: var(--ink-2); font-size: 12px; }
.card-tile-missing .card-tile-name { color: var(--ink-2); }

.text-list summary { cursor: pointer; list-style: none; }
.text-list summary::-webkit-details-marker { display: none; }
.text-list summary h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.text-list summary h2::after { content: ""; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--ink-2); transition: transform 200ms var(--ease-out); }
.text-list[open] summary h2::after { transform: rotate(180deg); }
.text-list-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; }
/* The list is a 10 character column, so the sheet is measured to it, not to the page. */
.text-list pre { margin: 14px 0 8px; padding: 14px 16px; max-width: calc(22ch + 32px); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); font: 14px/1.5 ui-monospace, "SF Mono", Menlo, monospace; overflow-x: auto; user-select: all; -webkit-user-select: all; }

/* ---------- Lightbox: the site's only popover ---------- */
/* It covers the whole viewport so a click-off lands on its own close button, never on the
   card underneath, and it only fades: the card inside does the rise, so no edge peeks through. */
.lightbox { border: 0; padding: 0; margin: auto; background: transparent; color: var(--ink); }
.lightbox:popover-open { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; inset: 0; margin: 0; display: grid; place-items: safe center; overflow: auto; background: var(--backdrop);
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
/* An open lightbox is modal: the page behind it must not scroll away under the card. */
html:has(.lightbox:popover-open) { overflow: hidden; }
@supports (transition-behavior: allow-discrete) {
  .lightbox { opacity: 0; transition: opacity 180ms var(--ease-out), overlay 240ms allow-discrete, display 240ms allow-discrete; }
  .lightbox:popover-open { opacity: 1; }
  .lightbox-body { transition: transform 260ms var(--ease-out), opacity 200ms var(--ease-out); }
  @starting-style {
    .lightbox:popover-open { opacity: 0; }
    .lightbox:popover-open .lightbox-body { transform: translateY(10px) scale(0.96); opacity: 0; }
    .lightbox.stepping:popover-open .lightbox-body { transform: translateX(var(--step-x, 16px)); opacity: 0; }
  }
}
.lightbox.stepping { transition: none; }
.lightbox:not(:popover-open) { display: none; }
.lightbox::backdrop { background: transparent; }
.lightbox-close { position: absolute; inset: 0; cursor: zoom-out; }
/* One dark panel holds card and info. The panel and the card are click-through, so a tap on
   the card lands on the close layer behind it; the card is capped by height for landscape. */
.lightbox-body { position: relative; display: grid; grid-template-columns: minmax(0, min(400px, max(180px, calc((100vh - 100px) * 0.716)))) minmax(0, 220px); grid-template-columns: minmax(0, min(400px, max(180px, calc((100dvh - 100px) * 0.716)))) minmax(0, 220px); gap: 20px; align-items: center; max-width: min(94vw, 680px); pointer-events: none; }
.lightbox-info > *, .lightbox-x, .lightbox-nav { pointer-events: auto; }
/* Card and step arrows share the first cell, so the arrows ride the card's edges. */
.lightbox-body > img { grid-area: 1 / 1; width: 100%; height: auto; aspect-ratio: 600 / 838; border-radius: 4.2% / 3%; box-shadow: 0 30px 60px -20px var(--shade); }
.lightbox-x { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; background: var(--lb-control); color: #fff; font-size: 22px; line-height: 1; transition: background 160ms var(--ease-out); }
.lightbox-x:hover { background: var(--lb-control-hover); }
/* Step arrows sit in the card's grid cell, so they stay on its edges in both layouts. */
.lightbox-nav { grid-area: 1 / 1; align-self: center; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; background: var(--lb-control); color: #fff; font-size: 24px; line-height: 1; transition: background 160ms var(--ease-out); }
.lightbox-nav:hover { background: var(--lb-control-hover); }
.lightbox-prev { justify-self: start; margin-left: -8px; }
.lightbox-next { justify-self: end; margin-right: -8px; }
.lightbox-info { color: #fff; padding: 4px 0; display: flex; flex-direction: column; align-items: flex-start; }
.lightbox-info h2 { font-size: 20px; margin: 0 0 2px; color: #fff; text-shadow: 0 1px 6px var(--scrim-strong); }
.lb-meta { margin: 0; color: rgba(255, 255, 255, 0.7); font-size: 13px; }
.price-pill { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; width: 208px; height: 44px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.35); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.price-pill:hover { background: rgba(255, 255, 255, 0.22); border-color: #fff; text-decoration: none; }
.price-pill b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-pill img { width: 16px; height: 16px; border-radius: 3px; }
.price-pill + .price-pill { margin-top: 10px; }

/* ---------- Forms / profile / empty / legal ---------- */
.submit-form input[type="text"], .submit-form input[type="number"], .submit-form select, .submit-form textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius); padding: 10px 12px; caret-color: var(--accent); }
.submit-form input:focus, .submit-form select:focus, .submit-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.submit-form button[type="submit"] { align-self: flex-start; font-size: 14px; font-weight: 600; line-height: 1; padding: 12px 22px; border-radius: 999px; transition: background 160ms var(--ease-out), color 160ms var(--ease-out); }
.submit-form button[type="submit"] { color: #fff; background: var(--ink); }
.submit-form button[type="submit"]:hover { background: var(--accent); }
.submit-form button[type="submit"]:disabled, .submit-form button[type="submit"]:disabled:hover { background: var(--ink-2); cursor: not-allowed; }
.submit-form button.button-light { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); }
.submit-form button.button-light:hover { background: var(--ink); color: #fff; }
.submit-form { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; max-width: 560px; }
.submit-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.submit-form input[type="file"] { font-size: 14px; font-weight: 400; }
.submit-form textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }
.required-note { color: var(--ink-2); font-weight: 400; font-size: 13px; }
.submit-form .consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; max-width: 62ch; }
.submit-form .consent input { margin: 2px 0 0; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-errors { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; margin-top: 20px; }
.form-errors p { margin: 4px 0; color: var(--accent); font-size: 14px; font-weight: 500; }
.profile-hero { display: flex; align-items: center; gap: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.user-code { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.balance { font-family: var(--display); font-size: 36px; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.credit-terms { max-width: 62ch; }
.status-pending { color: var(--ink-2); }
.status-approved { color: var(--c-green); border-color: var(--c-green); }
.status-rejected { color: var(--accent); border-color: var(--accent); }
.empty { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 44px 24px; text-align: center; }
.empty :where(h1, h2) { margin-bottom: 6px; overflow-wrap: anywhere; }
.empty p { color: var(--ink-2); margin: 0; }
/* a search that found nothing: the leaders that do have decks, as chips */
.empty-leaders { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 18px 0 0; }
.empty-leaders a { margin: 0; border: 1px solid var(--rule); }
.empty-leaders a:hover { border-color: var(--ink); }
.legal { max-width: calc(62ch + 64px); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.legal h2 { margin-top: 28px; }
.legal ul { padding-left: 20px; margin: 0; }
.legal li { margin: 8px 0; }

/* admin review: the screenshots on the left, everything you do on the right */
.review-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 12px; }
/* a screenshot fills the column but is never upscaled past its own pixels */
.shot { width: auto; max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); display: block; margin-bottom: 14px; }
.review-panel h3 { margin-top: 16px; }
.review-panel .card-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px 8px; }
.review-panel .qty { left: 4px; top: 4px; font-size: 12px; padding: 1px 5px; }
.review-panel .card-tile-code { margin-top: 4px; }
.review-panel .form-errors p:first-child { color: var(--ink); font-weight: 700; }
.review-status { margin: 14px 0 0; }
.review-fold > summary { cursor: pointer; margin-top: 20px; font-size: 14px; font-weight: 600; }
.queue-foot { margin-top: 26px; color: var(--ink-2); font-size: 13px; }
.new-event { display: flex; flex-direction: column; gap: 12px; }
/* the working panel stays on screen while the screenshots scroll past it */
@media (min-width: 961px) {
  .review-split { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 40px; }
  /* the panel is first in the source so a phone lands on the work, not on the evidence */
  .review-shots { grid-area: 1 / 1; }
  .review-panel { grid-area: 1 / 2; position: sticky; top: 92px; }
}

/* ---------- Tablet: the header stacks, so the search keeps its full width ---------- */
@media (max-width: 960px) {
  .deck-sub { white-space: normal; }
  :root { --filter-w: 220px; --list-gap: 24px; }
  .browse, .browse > .results[id] { scroll-margin-top: 122px; }
  .deck-page { grid-template-columns: 240px minmax(0, 1fr); gap: 28px; }
  .band h1 { font-size: 38px; }
  .band-inner { min-height: 220px; }
  .header-row { height: auto; flex-wrap: wrap; gap: 0 16px; padding-top: 10px; padding-bottom: 10px; }
  .wordmark { font-size: 22px; }
  .nav-links { order: 3; width: calc(100% + var(--pad-l) + var(--pad-r)); margin: 6px calc(var(--pad-r) * -1) 0 calc(var(--pad-l) * -1); padding: 0 calc(var(--pad-r) - 10px) 0 calc(var(--pad-l) - 10px); border-top: 1px solid var(--rule); height: 44px; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 0 10px; font-size: 14px; }
  .search { flex: 1 1 auto; max-width: 340px; --pill-pad: 14px; }
  /* 16px keeps iOS Safari from zooming the page when a pill input is tapped */
  .search, .leader-search { --pill-font: 16px; }
}

/* ---------- Small tablet: the 240px sidebar leaves under 424px, so 132px tiles drop to two ---------- */
@media (min-width: 681px) and (max-width: 739px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ---------- Mobile ---------- */
@media (max-width: 680px) {
  :root { --gutter: 16px; --list-w: 100%; }
  .search { flex-basis: 100%; max-width: none; margin-top: 8px; }
  .band-art { object-position: center; }
  .band::before { background: linear-gradient(180deg, rgba(185, 29, 34, 0.6) 0%, rgba(185, 29, 34, 0.8) 55%, rgba(185, 29, 34, 0.94) 70%); }
  .band-inner { min-height: 240px; align-items: flex-end; }
  .band-text { padding: 110px 0 22px; }
  .band h1 { font-size: 32px; }
  .browse { display: block; padding-top: 32px; scroll-margin-top: 152px; }
  .browse > .results[id] { scroll-margin-top: 152px; }
  .filters { position: static; margin-bottom: 16px; }
  .sections { display: none; }
  .filters summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--ink); font-size: 14px; font-weight: 600; }
  .filters summary::-webkit-details-marker { display: none; }
  .filters[open] summary { background: var(--ink); color: #fff; }
  .filters[open] summary .fl-n { color: rgba(255, 255, 255, 0.7); }
  .filters .filters-panel { margin-top: 12px; }
  /* every control in the panel is a 44px thumb target on a phone */
  .filter-list a { min-height: 44px; }
  .filters-clear a { display: inline-flex; align-items: center; min-height: 44px; }
  .leader-search { --pill-h: 48px; --pill-btn: 44px; }
  .search { --pill-h: 44px; --pill-btn: 40px; }
  .deck-page { display: block; padding-top: 24px; }
  .deck-side { position: static; display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 16px; align-items: start; }
  .deck-side .thumb-btn { grid-row: 1 / 6; }
  .deck-side h1 { font-size: 24px; margin-top: 0; }
  .deck-side .meta, .deck-side .value, .deck-side .value-currency, .deck-side .price-note, .deck-side .actions { grid-column: 1 / -1; }
  .deck-body { margin-top: 28px; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
  .lightbox-body { grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(92vw, max(180px, calc((100vh - 200px) * 0.716))); width: min(92vw, max(180px, calc((100dvh - 200px) * 0.716))); max-width: 92vw; }
  /* The panel is card-width here, so the close button moves off the art to the screen corner. */
  .lightbox-x { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); }
  .lightbox-info { padding: 0; min-width: 0; align-items: stretch; }
  .lightbox-info h2 { font-size: 15px; }
  .lb-meta { font-size: 12px; }
  .price-pill { width: 100%; height: 44px; padding: 0 8px; gap: 5px; font-size: 13px; margin-top: 10px; }
  .price-pill + .price-pill { margin-top: 8px; }
  .price-pill b { font-size: 13px; }
  .price-pill img { width: 14px; height: 14px; }
  .card-tile-name { font-size: 12.5px; }
  .deck-title { white-space: normal; }
  .deck-tags .tag:not(.tag-ink) { display: none; }
  /* the value costs the sub-line a whole line beside the format tag, so stack them */
  .deck-tags { flex-direction: column; align-items: flex-end; gap: 6px; }
  .sub-region { display: inline; }
  .legal { padding: 22px 18px; }
}

/* ---------- Touch targets, on phones and on any coarse pointer (tablets) ---------- */
@media (max-width: 680px), (pointer: coarse) {
  .site-footer a { padding: 12px 0; }
  /* the small row links keep their size and grow an invisible 44px thumb target */
  .deck-sub { white-space: normal; overflow: visible; }
  .deck-sub a { padding: 13px 2px; }
  .deck-tags a.tag::after { content: ""; position: absolute; inset: -12px -3px; }
  .currency > * { min-height: 44px; padding: 0 14px; }
  .deck-page .button { min-height: 44px; }
}

/* Phone in landscape: height caps the card, so the info sits beside it instead of under it. */
@media (min-width: 560px) and (max-width: 680px) and (max-height: 500px) {
  .lightbox-body { grid-template-columns: minmax(0, min(400px, max(180px, calc((100vh - 32px) * 0.716)))) minmax(0, 200px); grid-template-columns: minmax(0, min(400px, max(180px, calc((100dvh - 32px) * 0.716)))) minmax(0, 200px); gap: 16px; width: auto; max-width: 94vw; }
}

/* Short viewport (a phone in landscape): header and band together took the whole screen. */
@media (max-height: 480px) {
  .header-row { height: 56px; flex-wrap: nowrap; gap: 0 16px; padding-top: 0; padding-bottom: 0; }
  .nav-links { order: 0; width: auto; margin: 0; padding: 0; border-top: 0; height: 100%; }
  .search { order: 1; flex: 0 1 240px; margin: 0 0 0 auto; }
  .band-inner { min-height: 120px; align-items: center; }
  .band-text { padding: 16px 0; }
  .band h1 { font-size: 26px; }
  .page, .browse { padding-top: 20px; }
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition: none !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
