/* ==========================================================================
   Agora — sports card collection
   Palette lifted straight from the logo: coral / sky / yellow on warm paper,
   ink borders and hard offset shadows for a sticker-sheet feel.
   Colour fills always carry ink text — white on coral only hits 3.05:1.
   ========================================================================== */

:root {
  --paper:      #FFFDF6;
  --paper-2:    #FFFFFF;
  --paper-3:    #F6F2E8;

  --ink:        #17161A;  /* text only */
  --ink-soft:   #55525C;
  --ink-mute:   #6F6C78;
  /* Borders and shadows use a softer charcoal so the grid reads less
     like a wireframe. Still ~9:1 on paper, so edges stay clearly defined. */
  --edge:       #3D3A45;

  --coral:      #ED6C59;
  --coral-deep: #D9503A;
  --coral-tint: #FDECE9;
  --sky:        #76C2F1;
  --sky-deep:   #4FA8E0;
  --sky-tint:   #E7F4FD;
  --yellow:     #FDFB67;
  --yellow-deep:#F2EE2E;
  --yellow-tint:#FEFDDC;
  --blush:      #FBDFDB;

  --radius:     5px;   /* was 8px originally, then 0 */
  --radius-lg:  9px;   /* was 14px */
  --border:     2px solid var(--edge);
  --border-thin: 1.5px solid var(--edge);
  /* Translucent rather than solid, and shorter throws -- present but not
     heavy. --shadow-col is the single place to retune the weight. */
  --shadow-col: rgba(61, 58, 69, .42);
  --pop:        2px 2px 0 var(--shadow-col);
  --pop-sm:     1.5px 1.5px 0 var(--shadow-col);
  --pop-lg:     4px 4px 0 var(--shadow-col);

  --display: Anton, Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Bold", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.wrap { width: min(1280px, 100% - 2.5rem); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--yellow); color: var(--ink); padding: .6rem 1rem;
  border: var(--border); border-top: 0; z-index: 100; font-weight: 700;
  text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 0; }

/* Display type: Anton is all-caps by nature, so let it be loud. */
.display {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  letter-spacing: .01em; line-height: .95;
}

/* Stat tiles -- they live in the results bar and describe the current view. */

.stat-row {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin: 0; padding: 0; margin-right: auto;
}
.stat {
  margin: 0; padding: .22rem .55rem; display: flex; flex-direction: column;
  border: var(--border-thin); border-radius: var(--radius); box-shadow: var(--pop-sm);
}
.stat-coral  { background: var(--coral); }
.stat-cyan   { background: var(--sky); }
.stat-yellow { background: var(--yellow); }
.stat-blush  { background: var(--blush); }
.stat dt {
  font-size: .52rem; letter-spacing: .11em; text-transform: uppercase;
  font-weight: 800; white-space: nowrap;
}
.stat dd {
  margin: 0; font-family: var(--display); font-size: 1.05rem; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

/* --- Layout ------------------------------------------------------------- */

/* --- Top bar ------------------------------------------------------------ */
/* Three tracks so the search field is centred on the PAGE, not merely in the
   space left over between the logo and the buttons. */

.topbar { background: var(--paper); }
.topbar-inner {
  display: grid; align-items: center; gap: 1rem;
  grid-template-columns: 1fr minmax(240px, 560px) 1fr;
  padding: .6rem 0;
}

/* The first track is free-width so the search can centre on the page; the
   logo is boxed to the rail's width inside it so it centres over the rail. */
.topbar-brand {
  justify-self: start; width: 210px;
  display: grid; place-items: center; line-height: 0;
}
.topbar-brand img {
  height: 92px; width: auto; transform: rotate(-1.5deg);
  transition: transform .2s cubic-bezier(.2,.8,.3,1.4);
}
.topbar-brand:hover img { transform: rotate(0) scale(1.04); }

.topbar-search {
  justify-self: stretch; position: relative;
  display: flex; align-items: center;
}
.topbar-search svg { position: absolute; left: .95rem; pointer-events: none; color: var(--ink-mute); }
.topbar-search input {
  width: 100%; padding: .52rem 1.1rem .52rem 2.4rem;
  background: var(--paper-2); border: var(--border); border-radius: 100px;
  box-shadow: var(--pop-sm); font-size: .9rem; font-weight: 500;
}
.topbar-search input::placeholder { color: var(--ink-mute); font-weight: 600; }
.topbar-search input:focus { outline: none; background: var(--yellow-tint); }

.topbar-actions { justify-self: end; display: flex; gap: .45rem; align-items: stretch; }

/* All three actions share one height and pill shape. */
.action-btn, .view-toggle {
  height: 38px; flex: none;
  border: var(--border); border-radius: 100px; box-shadow: var(--pop-sm);
  background: var(--paper-2);
}

/* Icon-only, square-ish, so the row stays compact. */
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; padding: 0; cursor: pointer;
  transition: transform .14s, box-shadow .14s, background .14s;
}
.action-btn:hover { background: var(--sky); transform: translate(-1px, -1px); box-shadow: var(--pop); }
.action-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow-col); }
.action-btn-primary { background: var(--coral); }
.action-btn-primary:hover { background: var(--coral-deep); }

.layout {
  display: grid; grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.5rem; align-items: start; padding: 1rem 0 4rem;
}

.results { min-width: 0; }

/* Mobile-only; on desktop the filter rail is always open beside the grid. */
.filter-toggle { display: none; }

/* --- Filters ------------------------------------------------------------ */

.filters {
  position: sticky; top: 1rem;
  background: var(--paper-2); border: var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--pop); padding: .8rem .8rem .3rem;
}


.filters-close, .filters-done { display: none; }

.link-btn {
  background: var(--yellow); border: var(--border-thin); border-radius: 100px;
  padding: .1rem .6rem; cursor: pointer; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
}
.link-btn:hover { background: var(--yellow-deep); }

.field { border: 0; padding: 0; margin: 0 0 .5rem; min-width: 0; }

/* The fieldset's own heading -- :not(.facet) keeps this off the checkbox rows,
   which are also <label> children of .field. */
.field > label:not(.facet),
.field > legend {
  display: block; padding: 0; margin-bottom: .5rem;
  font-size: .64rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink); font-weight: 800;
}
.field-value {
  float: right; letter-spacing: 0; text-transform: none;
  color: var(--ink); background: var(--sky-tint);
  border: 1.5px solid var(--edge); border-radius: 100px; padding: 0 .4rem;
  font-size: .68rem;
}

.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: .6rem; pointer-events: none; }
.search-wrap input {
  width: 100%; padding: .5rem .7rem .5rem 2rem;
  background: var(--paper); border: var(--border-thin);
  border-radius: var(--radius); font-size: .88rem; font-weight: 500;
}
.search-wrap input::placeholder { color: var(--ink-mute); font-weight: 400; }
.search-wrap input:focus { outline: none; background: var(--yellow-tint); }

/* Facet checkboxes */
.facet {
  display: flex; align-items: center; gap: .45rem;
  padding: .1rem 0; cursor: pointer; font-size: .8rem; font-weight: 500;
  color: var(--ink-soft);
}
.facet:hover { color: var(--ink); }
.facet input { position: absolute; opacity: 0; width: 0; height: 0; }
.facet-box {
  width: 14px; height: 14px; flex: none; border-radius: 3px;
  border: 2px solid var(--edge); background: var(--paper-2);
  display: grid; place-items: center; transition: background .12s;
}
.facet-box::after {
  content: ""; width: 8px; height: 4px; margin-top: -2px;
  border-left: 2.5px solid var(--edge); border-bottom: 2.5px solid var(--edge);
  transform: rotate(-45deg) scale(0); transition: transform .14s cubic-bezier(.2,.8,.3,1.6);
}
.facet input:checked + .facet-box { background: var(--coral); }
.facet input:checked + .facet-box::after { transform: rotate(-45deg) scale(1); }
.facet input:focus-visible + .facet-box { outline: 3px solid var(--ink); outline-offset: 2px; }
.facet input:checked ~ .facet-label { color: var(--ink); font-weight: 700; }
.facet-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-n {
  font-size: .66rem; font-weight: 700; color: var(--ink-mute);
  font-variant-numeric: tabular-nums; flex: none;
}
.facet.is-empty { opacity: .35; }

.facet-more {
  background: none; border: 0; padding: .3rem 0 0; cursor: pointer;
  color: var(--ink-mute); font-size: .74rem; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
.facet-more:hover { color: var(--coral-deep); }

input[type="range"] { width: 100%; margin: .3rem 0 0; accent-color: var(--coral); }

.range-pair { display: flex; align-items: center; gap: .4rem; }
.range-pair input {
  width: 100%; min-width: 0; padding: .4rem .5rem; font-size: .84rem;
  background: var(--paper); border: var(--border-thin); border-radius: var(--radius);
}
.range-pair input:focus { outline: none; background: var(--yellow-tint); }

/* --- Results bar -------------------------------------------------------- */

.results-bar {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin-bottom: 0;
}
.result-line { margin: 0; font-size: .84rem; color: var(--ink-soft); }
.result-line strong {
  font-family: var(--display); font-weight: 400; font-size: 1.05rem;
  color: var(--ink); letter-spacing: .02em;
}
.result-count { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.result-count strong {
  font-family: var(--display); font-weight: 400; font-size: 1.15rem;
  color: var(--ink); letter-spacing: .02em;
}

.results-controls { display: flex; align-items: center; gap: .5rem; }

#sort {
  padding: .42rem 2rem .42rem .7rem; font-size: .82rem; font-weight: 600;
  background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%2317161A' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .55rem center/11px;
  border: var(--border-thin); border-radius: var(--radius);
  box-shadow: var(--pop-sm); appearance: none; cursor: pointer;
}
#sort:focus { outline: none; background-color: var(--yellow-tint); }

.view-toggle { min-width: 92px; }
.view-toggle { display: flex; overflow: hidden; }
.view-toggle button { flex: 1; }
.view-toggle button {
  background: none; border: 0; padding: 0 .85rem; cursor: pointer;
  display: grid; place-items: center;
}
.view-toggle button + button { border-left: var(--border-thin); }
.view-toggle button:hover { background: var(--paper-3); }
.view-toggle button.is-active { background: var(--sky); }

.chips-row {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-bottom: .8rem;
}
/* display:flex would otherwise beat the [hidden] attribute. */
.chips-row[hidden] { display: none; }
.active-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-clear {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .18rem .5rem .18rem .6rem; font-size: .76rem; font-weight: 700;
  background: var(--yellow); color: var(--ink);
  border: var(--border-thin); border-radius: 100px; cursor: pointer;
}
.chip-clear:hover { background: var(--coral); }

/* --- Card grid ---------------------------------------------------------- */

.grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.card {
  display: flex; flex-direction: column; text-align: left; padding: 0;
  background: var(--paper-2); color: inherit; cursor: pointer;
  border: var(--border); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--pop);
  transition: transform .16s cubic-bezier(.2,.8,.3,1.4), box-shadow .16s;
}
.card:hover { transform: translate(-2px, -2px) rotate(-.5deg); box-shadow: var(--pop-lg); }
.card:active { transform: translate(1px, 1px); box-shadow: var(--pop-sm); }

.card-img {
  /* eBay's photos are 3:4 (a 5:7 card shot with padding), so matching that
     ratio removes the letterbox bars a taller container would create. */
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--paper-3);
}
/* Sport tint cycles through the logo's three colours so the grid reads as a fan. */
.card.tint-1 .card-img { background: var(--coral-tint); }
.card.tint-2 .card-img { background: var(--sky-tint); }
.card.tint-3 .card-img { background: var(--yellow-tint); }

.card-img img { width: 100%; height: 100%; object-fit: contain; }

.card-flag {
  position: absolute; top: .5rem; left: .5rem; transform: rotate(-5deg);
  padding: .1rem .34rem; border: 2px solid var(--edge); border-radius: 3px;
  font-size: .55rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 800; background: var(--yellow); color: var(--ink);
}
.card-slab {
  position: absolute; top: .5rem; right: .5rem;
  padding: .1rem .34rem; border: 2px solid var(--edge); border-radius: 3px;
  font-size: .62rem; font-weight: 800; letter-spacing: .01em;
  background: var(--paper-2); color: var(--ink);
}

.card-body { padding: .5rem .55rem .55rem; display: flex; flex-direction: column; flex: 1; gap: .3rem; }

.card-player {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: .95rem; line-height: 1.02; margin: 0; letter-spacing: .01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Two lines instead of one truncated line -- set, number, insert and parallel
   all fit now rather than being cut off at the first ellipsis. */
.card-meta {
  margin: 0; font-size: .68rem; font-weight: 500; color: var(--ink-mute);
  line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}

.tags { display: flex; flex-wrap: wrap; gap: .2rem; }
.tag {
  font-size: .56rem; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 800; padding: .06rem .28rem; border-radius: 3px;
  border: 1.5px solid var(--edge); background: var(--paper-2); color: var(--ink);
}
.tag-rc    { background: var(--coral); }
.tag-auto  { background: var(--sky); }
.tag-patch { background: var(--blush); }
.tag-num   { background: var(--yellow); }

.card-foot {
  margin-top: auto; padding-top: .15rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.card-price {
  font-family: var(--display); font-weight: 400; font-size: 1.08rem;
  line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.card-type { font-size: .58rem; font-weight: 600; color: var(--ink-mute); text-align: right; line-height: 1.25; }

/* List view */
.grid.is-list { grid-template-columns: 1fr; gap: .7rem; }
.grid.is-list .card { flex-direction: row; align-items: stretch; }
.grid.is-list .card:hover { transform: translate(-3px, -3px) rotate(0); }
.grid.is-list .card-img {
  width: 84px; flex: none; aspect-ratio: auto;
  border-bottom: 0; border-right: var(--border);
}
.grid.is-list .card-flag, .grid.is-list .card-slab { display: none; }
.grid.is-list .card-body { flex-direction: row; align-items: center; gap: 1.2rem; padding: .7rem 1rem; }
.grid.is-list .card-main { flex: 1; min-width: 0; }
.grid.is-list .card-foot { margin: 0; padding: 0; flex-direction: column; align-items: flex-end; flex: none; }
@media (max-width: 560px) {
  .grid.is-list .card-body { flex-direction: column; align-items: stretch; gap: .45rem; }
  .grid.is-list .card-foot { flex-direction: row; align-items: center; }
}

/* Skeletons */
.skeleton { pointer-events: none; }
.skeleton .sk {
  background: linear-gradient(90deg, var(--paper-3) 25%, var(--blush) 50%, var(--paper-3) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 3px;
}
.skeleton .sk-img { aspect-ratio: 3/4; border-radius: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton .sk { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .card:hover { transform: none; }
}

/* Empty / error */
.empty, .load-error {
  grid-column: 1 / -1; text-align: center; padding: 3rem 1.5rem;
  background: var(--paper-2); border: var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--pop);
}
.empty-emoji { font-size: 2.6rem; margin: 0 0 .3rem; line-height: 1; }
.empty h3, .load-error h3 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 1.5rem; margin: 0 0 .4rem; letter-spacing: .02em;
}
.empty p, .load-error p { color: var(--ink-soft); margin: 0 0 1.1rem; }
.load-error code {
  font-family: var(--mono); font-size: .82rem; background: var(--yellow);
  border: 1.5px solid var(--edge); padding: .1rem .4rem; border-radius: var(--radius);
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.15rem; border-radius: var(--radius); border: var(--border);
  font-size: .9rem; font-weight: 800; cursor: pointer; text-decoration: none;
  box-shadow: var(--pop); background: var(--paper-2); color: var(--ink);
  transition: transform .14s cubic-bezier(.2,.8,.3,1.4), box-shadow .14s, background .14s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-lg); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-col); }
.btn-primary { background: var(--coral); }
.btn-primary:hover { background: var(--coral-deep); }

/* --- Stats popup -------------------------------------------------------- */

.modal {
  width: min(460px, calc(100vw - 2rem));
  padding: 1.4rem; border: var(--border); border-radius: var(--radius-lg);
  background: var(--paper-2); color: var(--ink); box-shadow: var(--pop-lg);
  overflow: visible;
}
.modal::backdrop { background: rgba(23, 22, 26, .5); }
.modal-title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 1.5rem; margin: 0 0 .15rem; letter-spacing: .02em;
}
.modal-sub { margin: 0 0 1rem; font-size: .82rem; color: var(--ink-mute); }
.modal .stat-row { margin-bottom: 1rem; }
.modal .stat { flex: 1; min-width: 88px; }

.stat-list { margin: 0; display: grid; gap: .35rem; }
.stat-list div {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .84rem; padding: .18rem 0;
}
.stat-list dt { color: var(--ink-mute); }
.stat-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- Request form ------------------------------------------------------- */

.req-form { display: grid; gap: .7rem; }
.req-row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.req-field { display: grid; gap: .25rem; min-width: 0; }
.req-field > span {
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 800;
}
.req-field em { font-style: normal; color: var(--ink-mute); letter-spacing: 0; }
.req-field input, .req-field textarea {
  width: 100%; padding: .5rem .6rem; font: inherit; font-size: .86rem;
  background: var(--paper); border: var(--border-thin); border-radius: var(--radius);
  resize: vertical;
}
.req-field input:focus, .req-field textarea:focus {
  outline: none; background: var(--yellow-tint);
}
.req-actions { margin: .2rem 0 0; }
.req-note { margin: 0; font-size: .76rem; color: var(--ink-mute); line-height: 1.5; }

@media (max-width: 520px) {
  .req-row { grid-template-columns: 1fr; }
}

/* --- Detail dialog ------------------------------------------------------ */

.detail {
  width: min(900px, calc(100vw - 2rem)); max-height: min(88vh, 900px);
  padding: 0; border: var(--border); border-radius: var(--radius-lg);
  background: var(--paper-2); color: var(--ink);
  box-shadow: var(--pop-lg); overflow: visible;
}
.detail::backdrop { background: rgba(23, 22, 26, .55); }

.detail-close {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: var(--yellow); border: var(--border); color: var(--ink);
  font-size: 1.5rem; line-height: 1; box-shadow: var(--pop-sm);
  display: grid; place-items: center; padding: 0 0 3px;
}
.detail-close:hover { background: var(--coral); }

.detail-body {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 1.8rem; padding: 1.8rem; max-height: min(88vh, 900px); overflow-y: auto;
}

.detail-gallery { position: sticky; top: 0; }
.detail-hero {
  aspect-ratio: 3/4; background: var(--coral-tint);
  border: var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--pop); overflow: hidden;
}
.detail-hero img { width: 100%; height: 100%; object-fit: contain; }
.detail-thumbs { display: flex; gap: .4rem; margin-top: .8rem; flex-wrap: wrap; }
.detail-thumbs button {
  width: 46px; height: 62px; padding: 0; cursor: pointer; overflow: hidden;
  border: var(--border-thin); border-radius: 4px; background: var(--paper-3);
}
.detail-thumbs button.is-active { box-shadow: var(--pop-sm); }
.detail-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: .95; margin: 0 0 .4rem;
}
.detail-sub { color: var(--ink-soft); margin: 0 0 1.1rem; font-size: .95rem; font-weight: 500; }

.detail-price {
  display: inline-block; font-family: var(--display); font-weight: 400;
  font-size: 2.1rem; line-height: 1; letter-spacing: .01em; margin: 0;
  background: var(--yellow); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--pop-sm); padding: .3rem .7rem; transform: rotate(-1.5deg);
}
.detail-price-note { color: var(--ink-mute); font-size: .8rem; font-weight: 600; margin: .8rem 0 0; }

.spec { width: 100%; border-collapse: collapse; margin: 1.4rem 0 0; font-size: .87rem; }
.spec th, .spec td { text-align: left; padding: .4rem 0; }
.spec th { color: var(--ink-mute); font-weight: 600; width: 40%; }
.spec td { font-weight: 600; }

.detail-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.3rem; }
.detail-raw {
  margin-top: 1.2rem; font-size: .76rem; color: var(--ink-mute); line-height: 1.5;
}

@media (max-width: 720px) {
  .detail-body { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.2rem; }
  .detail-gallery { position: static; max-width: 210px; }
  .detail-close { top: -12px; right: -8px; }
}

/* --- Footer ------------------------------------------------------------- */

.footer { background: var(--coral); padding: 2.2rem 0 2.6rem; }
.footer-inner { display: flex; gap: 2.5rem; justify-content: space-between; flex-wrap: wrap; }
.footer-brand {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 2rem; letter-spacing: .04em; margin: 0; line-height: 1;
  color: var(--blush);
}
.footer-note { margin: .3rem 0 0; font-size: .78rem; font-weight: 700; color: var(--ink); }
.footer-legal { margin: 0; max-width: 52ch; font-size: .74rem; color: var(--ink); line-height: 1.6; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 900px) {
  .wrap { width: min(1280px, 100% - 1.75rem); }
  .layout { grid-template-columns: 1fr; gap: .7rem; padding-top: .8rem; }

  /* Icon-only actions fit beside the logo again; search takes its own row. */
  .topbar-inner {
    grid-template-columns: auto 1fr;
    grid-template-areas: "brand actions" "search search";
    gap: .5rem 1rem;
  }
  /* No rail on mobile, so the logo box has nothing to centre over. */
  .topbar-brand { grid-area: brand; width: auto; justify-items: start; }
  .topbar-search { grid-area: search; }
  .topbar-actions { grid-area: actions; }
  .topbar-brand img { height: 62px; }

  .results-bar { margin-bottom: .7rem; }

  .filter-toggle {
    display: inline-flex; align-items: center; gap: .45rem; flex: none;
    padding: .42rem .75rem; background: var(--sky); border: var(--border-thin);
    border-radius: var(--radius); box-shadow: var(--pop-sm); cursor: pointer;
    font-size: .84rem; font-weight: 800;
  }
  .filter-count {
    background: var(--ink); color: var(--yellow); border-radius: 100px;
    font-size: .68rem; font-weight: 800; padding: 0 .35rem; min-width: 18px; text-align: center;
  }

  /* Filter rail becomes a full-screen sheet: the toggle lives in the results
     bar, so an inline panel would open off-screen above it. */
  .filters { display: none; }
  .filters.is-open {
    display: block; position: fixed; inset: 0; z-index: 60;
    border: 0; border-radius: 0; box-shadow: none;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem 6rem;
  }
  .filters-close {
    position: absolute; top: .9rem; right: 1.1rem; z-index: 1;
    display: grid; place-items: center; width: 30px; height: 30px; padding: 0 0 3px;
    background: var(--paper-2); border: var(--border-thin); border-radius: 0;
    font-size: 1.35rem; line-height: 1; cursor: pointer;
  }
  .filters-close:hover { background: var(--coral); }
  .filters.is-open .filters-done {
    display: block; position: fixed; left: 1.25rem; right: 1.25rem; bottom: 1.25rem;
    padding: .8rem 1rem; background: var(--coral); color: var(--ink);
    border: var(--border); border-radius: var(--radius); box-shadow: var(--pop);
    font-size: .95rem; font-weight: 800; cursor: pointer;
  }
  body.filters-open { overflow: hidden; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
  .stat-row { flex: 1 0 100%; }
  .stat { flex: 1; min-width: 0; }
  .card-player { font-size: 1rem; }
  /* Narrow cards: keep "or best offer" from wrapping onto a third line. */
  .card-type { font-size: .58rem; }
}

@media (max-width: 560px) {
  .layout { padding-top: 1rem; }
  .stat { padding: .24rem .5rem; }
  .stat dt { font-size: .5rem; }
  .stat dd { font-size: 1.1rem; }
}

/* --- Direct (off-eBay) checkout ------------------------------------------ */

/* Savings stamp: ink on yellow is the highest-contrast pair in the palette
   (16.4:1), and it is the only tag that inverts, so it reads as a deal. */

.card-price-direct {
  display: block; font-family: var(--sans); font-size: .6rem; font-weight: 700;
  color: var(--ink-mute); letter-spacing: 0; margin-top: .1rem;
}

.card-sold {
  position: absolute; inset: auto 0 0 0; padding: .3rem;
  background: var(--ink); color: var(--yellow); text-align: center;
  font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.card.is-sold .card-img img { opacity: .45; filter: grayscale(1); }
.card.is-sold .card-price { text-decoration: line-through; color: var(--ink-mute); }

.direct {
  margin-top: 1.1rem; padding: .9rem 1rem 1rem;
  background: var(--yellow-tint); border: var(--border);
  border-radius: var(--radius); box-shadow: var(--pop-sm);
}

.direct-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem;
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 1.15rem; letter-spacing: .02em;
}
.direct-save {
  font-family: var(--sans); font-size: .7rem; font-weight: 800;
  text-transform: none; letter-spacing: 0;
  background: var(--ink); color: var(--yellow);
  border-radius: 100px; padding: .1rem .5rem;
}

.direct-price {
  margin: 0 0 .8rem; font-family: var(--display); font-weight: 400;
  font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums;
}
.direct-price s {
  font-family: var(--sans); font-size: .9rem; font-weight: 600;
  color: var(--ink-mute); margin-left: .5rem;
}

.direct-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-pay { flex: 1; min-width: 120px; }
.btn-paypal { background: var(--sky); }
.btn-paypal:hover { background: var(--sky-deep); }
.btn-venmo { background: var(--blush); }
.btn-venmo:hover { background: var(--coral); }

.direct-ref {
  margin: .8rem 0 0; font-size: .8rem; font-weight: 600; line-height: 1.5;
}
.direct-ref b {
  font-family: var(--mono); font-weight: 700; background: var(--yellow);
  border: 1.5px solid var(--edge); border-radius: 4px; padding: .05rem .35rem;
}

.direct-note {
  margin: .6rem 0 0; font-size: .76rem; line-height: 1.55; color: var(--ink-soft);
}
.direct-warn { margin-top: .8rem; }

.direct-sold { background: var(--paper-3); }
.direct-sold .direct-head { margin-bottom: .3rem; }

.direct-nope {
  margin: 1rem 0 0; padding: .6rem .8rem; font-size: .8rem; color: var(--ink-soft);
  background: var(--paper-3); border: 1.5px dashed var(--ink-mute);
  border-radius: var(--radius);
}

@media (max-width: 420px) {
  .btn-pay { flex: 1 0 100%; }
}

/* --- Collapsible filter groups ------------------------------------------ */

.filters-title {
  margin: 0 0 .6rem; font-family: var(--display); font-weight: 400;
  font-size: 1.02rem; text-transform: uppercase; letter-spacing: .02em;
  line-height: 1.1;
}

.facet-group { padding-top: .2rem; }

.facet-head {
  display: flex; align-items: center; gap: .4rem; width: 100%;
  padding: .25rem 0; background: none; border: 0; cursor: pointer;
  font-size: .64rem; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 800; color: var(--ink); text-align: left;
}
.facet-head:hover { color: var(--coral-deep); }
.facet-title { flex: 1; min-width: 0; }

.facet-caret {
  width: 0; height: 0; flex: none;
  border-left: 4px solid var(--edge); border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform .14s;
}
.facet-head[aria-expanded="true"] .facet-caret { transform: rotate(90deg); }

/* Count of options when idle; count of active picks when filtering. */
.facet-total { font-size: .62rem; font-weight: 700; color: var(--ink-mute); letter-spacing: 0; }
.facet-badge {
  font-size: .6rem; font-weight: 800; letter-spacing: 0;
  background: var(--coral); color: var(--ink);
  border: 1.5px solid var(--edge); border-radius: 100px; padding: 0 .34rem; min-width: 16px; text-align: center;
}

.facet-body { padding: .15rem 0 .4rem; }

.pay-saving {
  margin: .3rem 0 1rem; font-size: .82rem; color: var(--ink-soft);
}
#pay .direct-price { margin-bottom: 0; }
#pay .direct-actions { margin-bottom: .2rem; }

/* --- Content pages (faq.html) -------------------------------------------- */

.topbar-inner-plain {
  grid-template-columns: 1fr auto;
  gap: 1rem;
}
.action-btn-wide {
  width: auto; padding: 0 1.1rem; gap: .4rem;
  font-size: .82rem; font-weight: 800; text-decoration: none;
}

.page { padding: 1.6rem 0 4rem; max-width: 760px; }

.page-title {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3rem); line-height: .95;
  margin: 0 0 .5rem; letter-spacing: .01em;
}
.page-lead { margin: 0 0 1.6rem; font-size: 1.02rem; color: var(--ink-soft); max-width: 56ch; }

.page-toc { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 2.4rem; }
.page-toc a {
  padding: .28rem .7rem; font-size: .78rem; font-weight: 700;
  background: var(--paper-2); border: var(--border-thin); border-radius: 100px;
  box-shadow: var(--pop-sm); text-decoration: none;
}
.page-toc a:hover { background: var(--sky); }

.qa { margin-bottom: 2.6rem; scroll-margin-top: 1rem; }
.qa h2 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: 1.5rem; letter-spacing: .02em; margin: 0 0 1rem;
  padding: .3rem .7rem; background: var(--yellow);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--pop-sm); display: inline-block;
}
.qa h3 {
  font-size: .95rem; font-weight: 800; margin: 1.4rem 0 .35rem;
}
.qa p { margin: 0 0 .7rem; color: var(--ink-soft); line-height: 1.65; }
.qa code {
  font-family: var(--mono); font-size: .84em; background: var(--yellow-tint);
  border: 1.5px solid var(--edge); border-radius: 4px; padding: .02rem .3rem;
}
.qa-callout {
  background: var(--sky-tint); border: var(--border-thin);
  border-radius: var(--radius); padding: .7rem .85rem; color: var(--ink) !important;
}

.glossary { margin: 1.2rem 0 0; display: grid; gap: .5rem; }
.glossary > div {
  display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: .9rem;
  align-items: baseline;
}
.glossary dt {
  font-weight: 800; font-size: .82rem; text-align: right;
  background: var(--blush); border: 1.5px solid var(--edge);
  border-radius: 100px; padding: .1rem .5rem;
}
.glossary dd { margin: 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.6; }

.page-foot { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.footer-note a { color: inherit; }

@media (max-width: 620px) {
  .glossary > div { grid-template-columns: 1fr; gap: .15rem; }
  .glossary dt { text-align: left; justify-self: start; }
}
