/* Card Vault: a dark velvet vault with brass accents in dark mode, a warm paper binder in light mode. */
:root {
  --background: #f3eee4;
  --background-deep: #e6dccb;
  --surface: #fffdf8;
  --surface-muted: #f1eadc;
  --border: #ddd0b8;
  --text: #221c14;
  --text-muted: #75695a;
  --accent: #6b3fd1;
  --accent-strong: #522bb0;
  --accent-soft: #ebe3fb;
  --brass: #b9871f;
  --brass-soft: #f6e6bd;
  --good: #23824a;
  --good-soft: #dcf0e2;
  --danger: #b5372a;
  --danger-soft: #f8dcd6;
  --shadow: 0 1px 2px rgba(40, 25, 5, .08), 0 8px 24px rgba(40, 25, 5, .08);
  --heading-font: "Chakra Petch", system-ui, sans-serif;
  --card-ratio: 813 / 1185;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #120f1c;
    --background-deep: #0b0912;
    --surface: #1d1830;
    --surface-muted: #262040;
    --border: #352d55;
    --text: #efeaff;
    --text-muted: #a49cc4;
    --accent: #9b7bff;
    --accent-strong: #b9a3ff;
    --accent-soft: #2d2452;
    --brass: #e3b54a;
    --brass-soft: #3a2f17;
    --good: #5fd08a;
    --good-soft: #17331f;
    --danger: #ff7d6b;
    --danger-soft: #3d1c1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: #120f1c; --background-deep: #0b0912; --surface: #1d1830; --surface-muted: #262040; --border: #352d55;
  --text: #efeaff; --text-muted: #a49cc4; --accent: #9b7bff; --accent-strong: #b9a3ff; --accent-soft: #2d2452;
  --brass: #e3b54a; --brass-soft: #3a2f17; --good: #5fd08a; --good-soft: #17331f; --danger: #ff7d6b; --danger-soft: #3d1c1a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--background); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), var(--background);
  font: 15px/1.45 "Outfit", system-ui, sans-serif;
}
button, input, select { font: inherit; color: inherit; }
h2, h3 { font-family: var(--heading-font); margin: 0; letter-spacing: .02em; }
h2 { font-size: 22px; }
h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.muted { color: var(--text-muted); }
.logo-mark { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
* { scrollbar-color: var(--border) transparent; }

/* ---------- Buttons and inputs ---------- */
.primary-button, .secondary-button {
  border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 800; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.primary-button { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fff; box-shadow: 0 4px 14px rgba(107, 63, 209, .35); }
.secondary-button { background: var(--surface-muted); border: 1px solid var(--border); }
.primary-button:hover:not(:disabled), .secondary-button:hover:not(:disabled) { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.link-button { border: 0; background: none; color: var(--accent-strong); font-weight: 700; cursor: pointer; padding: 2px 4px; text-decoration: underline; text-underline-offset: 3px; }
input, select { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-muted); border: 1px solid var(--border); flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.form-error { color: var(--danger); font-weight: 700; min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.login-logo { font-family: var(--heading-font); font-size: 30px; font-weight: 700; }
.login-intro { color: var(--text-muted); margin: 6px 0 18px; }
.login-tabs { width: 100%; margin-bottom: 14px; }
.login-tabs button { flex: 1; }
#loginForm { display: grid; gap: 12px; }
#loginForm label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
#loginForm input { padding: 11px 12px; font-size: 16px; }
.login-hint { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ---------- Top bar and tabs ---------- */
.app { max-width: 1400px; margin: 0 auto; padding: 14px 16px 40px; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.logo { font-family: var(--heading-font); font-size: 24px; font-weight: 700; margin-right: auto; }
.wallet { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px 6px 16px; box-shadow: var(--shadow); }
.wallet-money { font-family: var(--heading-font); font-size: 22px; font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }
.wallet-money.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.wallet-income { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.income-ring { width: 22px; height: 22px; }
.income-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.income-track { fill: none; stroke: var(--surface-muted); stroke-width: 5; }
.income-fill { fill: none; stroke: var(--good); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 94.25; transition: stroke-dashoffset 1s linear; }
.who { display: flex; align-items: center; gap: 6px; font-weight: 700; }
/* The padding keeps the count badges (which stick out above the tabs) from being cut off by the scroll box. */
.tabs { display: flex; gap: 6px; margin: -8px 0 14px; padding: 8px 8px 2px 0; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 9px 16px; font-weight: 800; cursor: pointer; white-space: nowrap; color: inherit; text-decoration: none; display: inline-block; }
.tab[aria-current="page"] { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fff; border-color: transparent; }
.tab-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; }
.tab-badge.muted { background: var(--brass); color: #2a1d00; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
main { min-width: 0; }
.view { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.view.is-active { display: block; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }
.view-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.view-header p { margin: 4px 0 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"] { flex: 1 1 180px; }
.side { position: sticky; top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); max-height: calc(100vh - 28px); overflow-y: auto; }
.side h3 { margin-bottom: 10px; }

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li { font-size: 13px; padding: 8px 10px; border-radius: 12px; background: var(--surface-muted); border-left: 3px solid var(--border); }
.feed li.pull { border-left-color: var(--brass); }
.feed li.sale { border-left-color: var(--good); }
.feed li.join { border-left-color: var(--accent); }
.feed time { display: block; font-size: 11px; color: var(--text-muted); }
.mobile-feed-heading, .mobile-feed { display: none; }

/* ---------- Rarity ---------- */
.rarity-chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; }
.rarity-chip.rarity-short-print { color: var(--text); }
.rarity-chip.rarity-super-short-print { color: var(--text); border-style: dashed; border-color: var(--text-muted); }
.rarity-chip.rarity-rare { background: linear-gradient(135deg, #e9edf2, #b9c2cc); color: #2e3640; border-color: #9aa5b1; }
.rarity-chip.rarity-super-rare { background: linear-gradient(135deg, #b8e6ff, #c6b3ff); color: #1d2a5a; border-color: #8fa6e8; }
.rarity-chip.rarity-ultra-rare { background: linear-gradient(135deg, #ffe7a3, #e2a72c); color: #4a3100; border-color: #c9952a; }
.rarity-chip.rarity-secret-rare { background: linear-gradient(135deg, #ff9ad5, #ffe48a, #8affc8, #8ac7ff, #c79aff); color: #2a1440; border-color: #c79aff; }

/* ---------- Cards ---------- */
.card-face { position: relative; aspect-ratio: var(--card-ratio); border-radius: 4.5% / 3.1%; overflow: hidden; background: #000; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.card-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Foil: a moving light band over the art for Super, Ultra and Secret Rares. */
.card-face.foil::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .55;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .55) 40%, rgba(150, 200, 255, .4) 50%, transparent 65%);
  background-size: 250% 250%; animation: foil-shine 4s ease-in-out infinite;
}
.card-face.foil-ultra::after { background-image: linear-gradient(115deg, transparent 20%, rgba(255, 230, 150, .7) 40%, rgba(255, 190, 80, .45) 50%, transparent 65%); }
.card-face.foil-secret::after { opacity: .65; background-image: linear-gradient(115deg, rgba(255, 120, 200, .35), rgba(255, 230, 120, .35), rgba(120, 255, 190, .35), rgba(120, 190, 255, .35), rgba(200, 140, 255, .35)); }
@keyframes foil-shine { 0% { background-position: 100% 100%; } 50% { background-position: 0% 0%; } 100% { background-position: 100% 100%; } }

/* Our own card back: a violet vault door with brass rings. */
.card-back {
  position: absolute; inset: 0; border-radius: 4.5% / 3.1%; overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 18%, rgba(227, 181, 74, .9) 18.5% 20%, transparent 20.5% 29%, rgba(227, 181, 74, .55) 29.5% 30.5%, transparent 31%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #3b1f8f, #170b3d);
  border: 3px solid #c99a35;
  box-shadow: inset 0 0 0 3px #170b3d, inset 0 0 0 5px rgba(227, 181, 74, .6);
}
.card-back::after { content: "🃏"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2em; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); }

/* ---------- Shop ---------- */
/* Three packs side by side; two on narrower screens, one on phones. */
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.shop-set { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 16px 16px; border-radius: 18px; background: var(--surface-muted); border: 1px solid var(--border); text-align: center; }
.shop-pack { position: relative; perspective: 900px; width: min(100%, 220px); }
.shop-pack img { width: 100%; display: block; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .35)); transition: transform .25s ease; animation: float 5s ease-in-out infinite; }
.shop-pack:hover img { transform: rotateY(-10deg) rotateX(4deg) scale(1.02); }
@keyframes float { 50% { translate: 0 -8px; } }
.shop-info { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: auto; width: 100%; }
.shop-set-name { margin: 0; font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--text); min-height: 2.6em; display: flex; align-items: center; }
.shop-price { font-family: var(--heading-font); font-size: 30px; font-weight: 700; color: var(--good); margin: 2px 0 10px; }
.buy-pack-button { font-size: 16px; padding: 11px 22px; width: 100%; max-width: 220px; }
.shop-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); margin-bottom: 6px; }
.shop-tag.featured { background: var(--brass-soft); border-color: var(--brass); color: var(--text); }
.shop-set.mystery { background: linear-gradient(160deg, var(--accent-soft), var(--surface-muted)); border-color: var(--accent); }
.modal-card.mystery-reveal-card { width: min(380px, 100%); display: grid; justify-items: center; text-align: center; gap: 8px; }
.mystery-reveal-card h2 { margin: 6px 0 0; }
.mystery-reveal-card p { margin: 0 0 8px; }
.mystery-reveal-stage { width: 170px; perspective: 800px; }
.mystery-reveal-pack { width: 100%; display: block; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .45)); }
.mystery-reveal-stage.shaking .mystery-reveal-pack { animation: mystery-shake .45s ease-in-out infinite; }
.mystery-reveal-stage.revealed .mystery-reveal-pack { animation: mystery-turn .6s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes mystery-shake { 25% { transform: rotate(-4deg) scale(1.02); } 75% { transform: rotate(4deg) scale(1.02); } }
@keyframes mystery-turn { from { transform: rotateY(90deg) scale(.9); filter: brightness(2.5); } }
.shop-rotation { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-left: auto; }

/* ---------- The daily Booster Voucher ---------- */
.voucher-banner { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 14px; margin-bottom: 16px; border-radius: 12px; font-size: 14px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-muted); min-height: 42px; }
.voucher-banner.claim { background: linear-gradient(90deg, var(--brass-soft), var(--accent-soft)); border-color: var(--brass); }
.voucher-banner.ready { border-color: var(--brass); }
.voucher-banner.used { color: var(--text-muted); font-weight: 500; }
.voucher-icon { font-size: 18px; }
.voucher-text { flex: 1; }
.voucher-claim { padding: 6px 18px; font-size: 14px; }
.voucher-button { width: 100%; max-width: 220px; margin-top: 6px; padding: 8px 16px; font-size: 14px; border-color: var(--brass); }
.voucher-item { border-color: var(--brass); background: linear-gradient(160deg, var(--brass-soft), var(--surface-muted)); }
.voucher-item .inventory-picture img { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); }
.voucher-expiry { font-size: 12px; font-weight: 800; color: var(--brass); }
@media (max-width: 1100px) { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .shop-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Opening a pack ---------- */
.opening { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 40%, rgba(60, 30, 140, .92), rgba(5, 3, 12, .97)); display: grid; place-items: center; overflow-y: auto; padding: 20px 16px; animation: fade-in .25s ease; }
.opening-stage { width: min(1100px, 100%); display: grid; justify-items: center; gap: 18px; }
.opening-title { color: #f2ecff; font-family: var(--heading-font); font-size: 22px; text-align: center; min-height: 1.4em; }
.sealed-pack { border: 0; background: none; cursor: pointer; position: relative; padding: 0; animation: pack-wiggle 1.6s ease-in-out infinite; }
.sealed-pack img { height: min(56vh, 460px); filter: drop-shadow(0 20px 40px rgba(155, 123, 255, .5)); }
.tear-hint { position: absolute; left: 50%; bottom: -34px; translate: -50% 0; color: #e8defe; font-weight: 800; white-space: nowrap; }
.sealed-pack.tearing { animation: pack-tear .5s ease-in forwards; }
@keyframes pack-wiggle { 0%, 100% { rotate: 0deg; } 10% { rotate: -2deg; } 20% { rotate: 2deg; } 30% { rotate: 0deg; } }
@keyframes pack-tear { to { transform: scale(1.25); opacity: 0; filter: brightness(2.5); } }
/* One card at a time: the current card is big in the middle, the turned ones line up below it. */
.reveal-area { display: grid; justify-items: center; gap: 12px; width: 100%; }
.reveal-counter { color: #cfc2f5; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; min-height: 1.2em; }
.reveal-counter.last { color: #ffe08a; animation: pulse-text 1.2s ease-in-out infinite; }
@keyframes pulse-text { 50% { opacity: .55; } }
.reveal-card { position: relative; border: 0; padding: 0; background: none; cursor: pointer; perspective: 1200px; height: min(50vh, 430px); aspect-ratio: var(--card-ratio); }
.reveal-card.entering { animation: deal .4s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes deal { from { opacity: 0; transform: translateY(70px) rotate(-6deg) scale(.85); } }
.reveal-card.leaving { animation: to-row .28s ease-in forwards; }
@keyframes to-row { to { opacity: 0; transform: translateY(160px) scale(.3); } }
.pack-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .8, .3, 1); }
.reveal-card.flipped .pack-card-inner { transform: rotateY(180deg); }
.reveal-card .card-back, .reveal-card .card-face { position: absolute; inset: 0; backface-visibility: hidden; }
.reveal-card .card-face { transform: rotateY(180deg); }
.reveal-card:not(.flipped):hover .pack-card-inner { transform: rotateY(-8deg) translateY(-4px); }
.reveal-card.last-card:not(.flipped) .card-back { animation: last-card-shake 1.4s ease-in-out infinite; }
@keyframes last-card-shake { 0%, 100% { rotate: 0deg; } 8% { rotate: -1.5deg; } 16% { rotate: 1.5deg; } 24% { rotate: 0deg; } }
.reveal-card.glow-rare.flipped .card-face { box-shadow: 0 0 26px 5px rgba(220, 230, 245, .8); }
.reveal-card.glow-super-rare.flipped .card-face { box-shadow: 0 0 40px 10px rgba(140, 180, 255, .9); }
.reveal-card.glow-ultra-rare.flipped .card-face { box-shadow: 0 0 50px 14px rgba(255, 200, 80, .95); }
.reveal-card.glow-secret-rare.flipped .card-face { animation: secret-glow 2s linear infinite; }
@keyframes secret-glow { 0% { box-shadow: 0 0 50px 14px #ff7ccf; } 25% { box-shadow: 0 0 50px 14px #ffe17a; } 50% { box-shadow: 0 0 50px 14px #7affc0; } 75% { box-shadow: 0 0 50px 14px #7ac0ff; } 100% { box-shadow: 0 0 50px 14px #ff7ccf; } }
.reveal-card .new-ribbon { opacity: 0; transition: opacity .3s .5s; }
.reveal-card.flipped .new-ribbon { opacity: 1; }
.reveal-hint { color: #e8defe; font-weight: 700; min-height: 1.4em; text-align: center; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.revealed-row { display: grid; grid-template-columns: repeat(9, 64px); gap: 8px; justify-content: center; min-height: 94px; }
.revealed-card { position: relative; border: 0; padding: 0; background: none; cursor: zoom-in; animation: land .3s ease-out both; }
@keyframes land { from { opacity: 0; transform: translateY(-30px) scale(1.4); } }
.revealed-card.glow-super-rare .card-face { box-shadow: 0 0 10px 2px rgba(140, 180, 255, .9); }
.revealed-card.glow-ultra-rare .card-face { box-shadow: 0 0 12px 3px rgba(255, 200, 80, .95); }
.revealed-card.glow-secret-rare .card-face { box-shadow: 0 0 12px 3px #ff9ad5; }
.revealed-card .new-ribbon { top: 2px; right: -3px; font-size: 8px; padding: 1px 4px; opacity: 1; }
.new-ribbon { position: absolute; top: 8px; right: -5px; z-index: 2; background: var(--good); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px 0 0 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.opening-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.opening-summary { color: #e8defe; text-align: center; font-weight: 700; }

/* ---------- Collection ---------- */
.completion { display: flex; align-items: center; gap: 10px; min-width: 240px; font-weight: 800; font-variant-numeric: tabular-nums; }
.completion-bar { flex: 1; height: 12px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; border: 1px solid var(--border); }
.completion-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--brass)); border-radius: 999px; transition: width .6s ease; }
.rarity-progress { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rarity-progress .rarity-chip { font-size: 12px; padding: 4px 10px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.grid-card { position: relative; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; }
.grid-card .card-face { transition: transform .15s ease; }
.grid-card:hover .card-face { transform: translateY(-3px) scale(1.02); }
.grid-card.missing .card-face img { filter: grayscale(1) brightness(.25) contrast(.8); }
.grid-card.missing .card-face::after, .panel-face.missing::after { display: none; } /* No foil shine on cards you do not have. */
.grid-card.missing .card-face::before { content: "?"; position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-family: var(--heading-font); font-size: 40px; color: rgba(255, 255, 255, .5); }
.grid-card-label { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; margin-top: 4px; color: var(--text-muted); }
.grid-card-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-badge { position: absolute; top: 5px; right: 5px; z-index: 2; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; padding: 1px 7px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.listed-badge { position: absolute; top: 5px; left: 5px; z-index: 2; background: var(--brass); color: #2a1d00; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }
.empty-note { padding: 30px 10px; text-align: center; color: var(--text-muted); grid-column: 1 / -1; }

/* ---------- Market ---------- */
.market-list { display: grid; gap: 8px; }
.market-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--surface-muted); border: 1px solid var(--border); }
.market-row.mine { border-color: var(--brass); background: var(--brass-soft); }
.market-row .card-face { width: 52px; cursor: zoom-in; }
.market-card-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.missing-tag { color: var(--good); font-weight: 800; }
.market-price { font-family: var(--heading-font); font-size: 20px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.market-price small { display: block; font-family: "Outfit", sans-serif; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.market-list.compact .market-row { grid-template-columns: minmax(0, 1fr) auto auto; }

/* ---------- Leaderboard ---------- */
.leaderboard { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.leaderboard th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 6px; }
.leaderboard td { padding: 10px 6px; border-top: 1px solid var(--border); }
.leaderboard .number { text-align: right; }
.leaderboard tr.me td { background: var(--accent-soft); }
.leaderboard .set-progress { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.leaderboard .collection-value { color: var(--good); font-variant-numeric: tabular-nums; }
.leaderboard .set-progress .completion-bar { height: 8px; }

/* ---------- Dialogs ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 3, 12, .72); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: fade-in .2s ease; }
.modal-card { position: relative; width: min(860px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }

/* ---------- Collection: the grid and the card panel side by side ---------- */
/* The collection needs the room, so the chronicle steps aside on this page. */
body[data-view="collection"] .layout { grid-template-columns: minmax(0, 1fr); }
body[data-view="collection"] .side { display: none; }
.collection-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 20px; align-items: start; }
.collection-browser { min-width: 0; }
.keyboard-hint { font-size: 12px; margin: -6px 0 10px; }
.grid-card { border-radius: 8px; }
.grid-card.selected .card-face { outline: 3px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 7px var(--accent-soft), 0 10px 24px rgba(0, 0, 0, .35); transform: translateY(-3px) scale(1.03); }
.grid-card.selected .grid-card-label { color: var(--text); font-weight: 800; }
.grid-card:focus-visible { outline: none; }
.grid-card:focus-visible .card-face { outline: 3px dashed var(--accent); outline-offset: 3px; }
.card-panel { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; padding: 18px; border-radius: 18px; background: var(--surface-muted); border: 1px solid var(--border); }
.card-panel h3 { margin: 16px 0 8px; }
.panel-heading h2 { margin: 2px 0 6px; font-size: 22px; }
.card-detail-number { font-family: var(--heading-font); color: var(--brass); font-weight: 700; letter-spacing: .08em; }
.panel-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 8px; align-items: center; margin: 14px 0 6px; }
.panel-face { width: 100%; max-width: 290px; justify-self: center; touch-action: pan-y; }
.panel-face.missing img { filter: grayscale(1) brightness(.35); }
.panel-face.changing { animation: panel-in .22s ease; }
@keyframes panel-in { from { opacity: .3; transform: scale(.97); } }
.panel-step { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 3px; }
.panel-step:disabled { opacity: .35; cursor: default; }
.card-detail-owned { font-weight: 800; font-size: 17px; margin: 10px 0 2px; }
.card-detail-owned.missing { color: var(--danger); }
.panel-last-sale { margin: 0; }
.sell-box { margin-top: 4px; }
.sell-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.sell-form label { display: grid; gap: 3px; font-size: 13px; font-weight: 700; }
.sell-form input { width: 100px; }

/* ---------- Confirming a purchase ---------- */
.confirm-card { width: min(440px, 100%); display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 18px; align-items: center; }
.confirm-pack { width: 90px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .35)); }
.confirm-card h2 { font-size: 20px; }
.confirm-card p { margin: 6px 0 14px; color: var(--text-muted); }
.confirm-card p strong { color: var(--text); }
.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Tooltips ---------- */
.tooltip { position: fixed; z-index: 90; max-width: min(280px, calc(100vw - 16px)); padding: 8px 11px; border-radius: 10px; background: #1b1530; color: #f3eeff; border: 1px solid #4a3d7a; font-size: 13px; font-weight: 500; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); pointer-events: none; animation: tooltip-in .12s ease; }
@keyframes tooltip-in { from { opacity: 0; transform: translateY(3px); } }
span[data-tooltip], th[data-tooltip], div[data-tooltip], small[data-tooltip], h3[data-tooltip], label[data-tooltip] { cursor: help; }
.rarity-chip[data-tooltip] { cursor: help; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column-reverse; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); font-weight: 700; font-size: 14px; animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.3) both; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--good); }
.toast.pull { border-left-color: var(--brass); }
.toast.leaving { opacity: 0; transform: translateX(20px); transition: all .35s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* ---------- Money held in offers, price hints ---------- */
.wallet-held { font-size: 12px; font-weight: 700; color: var(--brass); white-space: nowrap; }
.sell-price-hint { font-size: 12px; margin: 6px 0 0; }
.sell-price-hint:empty { display: none; }

/* ---------- Notifications: the bell and its menu ---------- */
.notifications { position: relative; }
.bell-button { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); font-size: 19px; cursor: pointer; display: grid; place-items: center; }
.bell-button:hover { transform: translateY(-1px); }
.bell-button.has-new { animation: bell-ring 1.2s ease 1; }
@keyframes bell-ring { 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } 50% { transform: none; } }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.notification-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); padding: 10px; animation: fade-in .15s ease; }
.notification-menu-header h3 { margin: 4px 6px 8px; }
.notification-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notification-empty { padding: 18px 8px; color: var(--text-muted); font-size: 13px; text-align: center; }
.notification { border-radius: 12px; background: var(--surface-muted); border: 1px solid transparent; }
.notification.unread { border-color: var(--accent); background: var(--accent-soft); }
.notification-content { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; padding: 8px 10px; border: 0; background: none; text-align: left; font-size: 13px; }
div.notification-content { grid-template-columns: minmax(0, 1fr); }
button.notification-content { cursor: pointer; }
button.notification-content:hover { background: rgba(127, 127, 127, .08); border-radius: 12px; }
.notification-content .card-face { width: 40px; }
.notification-text { display: grid; gap: 3px; }
.notification-text time { font-size: 11px; color: var(--text-muted); }
.notification-tag { justify-self: start; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.notification-tag.open { background: var(--brass); color: #2a1d00; border-color: transparent; }

/* ---------- Collectors: search, one collector's vault, your offers ---------- */
.leaderboard tr.clickable { cursor: pointer; }
.leaderboard tr.clickable:hover td { background: var(--surface-muted); }
.collector-link { color: var(--accent-strong); font-weight: 800; text-decoration: none; }
.collector-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-link { display: inline-block; margin: 0 0 10px; padding: 0; text-decoration: none; }
.profile-hint { font-size: 13px; margin: -6px 0 12px; }
.grid-card.offerable:hover .card-face { outline: 2px solid var(--brass); outline-offset: 3px; }
.mine-badge { position: absolute; bottom: 24px; left: 5px; z-index: 2; background: var(--good); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }
.my-offers { margin-top: 22px; }
.my-offers h3 { margin-bottom: 10px; }

/* ---------- Offer dialog ---------- */
.modal-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-muted); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 2px; }
.offer-card { width: min(620px, 100%); display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.offer-face { display: grid; gap: 8px; justify-items: start; }
.offer-face .card-face { width: 180px; }
.offer-body h2 { font-size: 22px; margin: 0 36px 4px 0; }
.offer-lead { margin: 0 0 12px; }
.offer-amount { font-family: var(--heading-font); font-size: 22px; color: var(--good); }
.offer-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 14px; margin: 0 0 14px; font-size: 14px; }
.offer-facts dt { color: var(--text-muted); }
.offer-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.offer-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.offer-form label { display: grid; gap: 3px; font-size: 13px; font-weight: 700; }
.offer-form input { width: 120px; }
.offer-note { font-size: 13px; margin: 10px 0 0; }
.offer-note:empty { display: none; }

/* ---------- Market: one row per card, opening its market page ---------- */
.segment-count { font-weight: 600; opacity: .75; }
.market-stack-row { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; grid-template-columns: 52px minmax(0, 1fr) auto minmax(90px, auto); transition: border-color .15s ease, transform .15s ease; }
.market-stack-row:hover { border-color: var(--accent); transform: translateY(-1px); }
.market-stack-row .card-face { cursor: pointer; }
.market-stack-quantity { display: grid; justify-items: end; font-variant-numeric: tabular-nums; }
.market-stack-quantity strong { font-size: 17px; }
.market-stack-quantity small { font-size: 11px; color: var(--text-muted); }
.market-price .price-from { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* ---------- A card's market page ---------- */
.market-dialog { width: min(900px, 100%); display: grid; gap: 16px; }
.market-dialog h3 { margin: 0 0 8px; }
.market-dialog-top { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: start; }
.market-dialog-face .card-face { width: 200px; }
.market-dialog-heading h2 { margin: 2px 40px 6px 0; font-size: 24px; }
.market-dialog-heading > p { margin: 8px 0 14px; }
.market-dialog-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.market-dialog-box { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: grid; gap: 10px; align-content: start; justify-items: center; text-align: center; }
.market-dialog-box p { margin: 0; }
.market-dialog-headline { font-size: 15px; }
.headline-price { color: var(--good); }
.price-levels { border-collapse: collapse; min-width: 220px; font-variant-numeric: tabular-nums; font-size: 14px; }
.price-levels th { font-size: 12px; color: var(--text-muted); padding: 4px 14px; border-bottom: 1px solid var(--border); }
.price-levels td { padding: 5px 14px; text-align: center; }
.price-levels tbody tr:nth-child(odd) td { background: var(--surface); }
.buy-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.buy-form label { display: grid; gap: 3px; font-size: 13px; font-weight: 700; text-align: left; }
.buy-form input { width: 110px; }
.buy-total { font-size: 14px; }
.buy-short { color: var(--danger); font-weight: 700; }
.buy-button { min-width: 180px; }

/* ---------- Price history chart ---------- */
.price-chart { display: grid; gap: 8px; }
.price-chart-note { font-size: 13px; margin: 0; }
.price-chart-summary { display: flex; gap: 16px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.price-chart-summary span { display: grid; }
.price-chart-summary small { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.price-chart-plot { position: relative; border-radius: 10px; max-width: 640px; }
.price-chart-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.price-chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; opacity: .6; }
.chart-baseline { stroke: var(--text-muted); stroke-width: 1; opacity: .7; }
.chart-axis-label { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-focus { fill: var(--accent); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.chart-guide { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.price-chart-tip { position: absolute; transform: translate(10px, -50%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; box-shadow: var(--shadow); font-size: 12px; display: grid; white-space: nowrap; pointer-events: none; z-index: 3; }
.price-chart-tip.flip { transform: translate(calc(-100% - 10px), -50%); }
.price-chart-tip span { color: var(--text-muted); }

/* ---------- Chronicle links and card previews ---------- */
.feed a { color: inherit; font-weight: 700; text-decoration: none; }
.feed .feed-collector { color: var(--accent-strong); }
.feed .feed-card { text-decoration: underline dotted; text-underline-offset: 3px; cursor: zoom-in; }
.feed a:hover { text-decoration: underline; }
.card-preview { position: fixed; z-index: 95; width: 190px; padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); pointer-events: none; animation: tooltip-in .12s ease; display: grid; gap: 6px; }
.card-preview .card-face { width: 100%; }
.card-preview-caption { display: grid; gap: 3px; justify-items: start; font-size: 12px; }
.card-preview-caption strong { font-size: 13px; }

/* ---------- Settings ---------- */
#settingsButton { font-size: 18px; }
.settings-card { width: min(460px, 100%); display: grid; gap: 14px; }
.settings-card h2 { margin: 0 40px 0 0; }
.settings-section { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-muted); border: 1px solid var(--border); }
.settings-section h3 { margin: 0; }
.settings-note { font-size: 12px; margin: 0; }
.switch-row, .slider-row { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.slider-row input { flex: 1; accent-color: var(--accent); padding: 0; border: 0; background: none; }
.slider-row span { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.settings-section .secondary-button { justify-self: start; }
.game-choices { display: grid; gap: 8px; }
.game-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.game-choice input { grid-row: span 2; width: 18px; height: 18px; accent-color: var(--accent); }
.game-choice span { font-size: 12px; }

/* ---------- Shop grouped by game ---------- */
.shop-game + .shop-game { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.shop-game-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.shop-game-heading h2 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--brass); }

/* ---------- Buying several packs ---------- */
.pack-quantity { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; font-weight: 700; }
.pack-quantity input { width: 70px; text-align: center; font-weight: 800; font-size: 18px; }
.buy-pack-total { margin: 0 0 4px !important; color: var(--text) !important; }
.buy-pack-note { font-size: 12px; margin: 0 0 12px !important; }

/* ---------- Inventory ---------- */
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.inventory-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 10px 14px; padding: 14px; border-radius: 16px; background: var(--surface-muted); border: 1px solid var(--border); }
.inventory-item.not-collected { opacity: .75; }
.inventory-picture { position: relative; grid-row: span 2; align-self: center; }
.inventory-picture img { width: 100%; display: block; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }
.inventory-count { position: absolute; top: -6px; right: -8px; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; padding: 2px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.inventory-info { display: grid; gap: 3px; align-content: start; font-size: 13px; }
.inventory-info h3 { margin: 0; font-size: 17px; }
.inventory-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--brass); font-weight: 800; }
.inventory-warning { font-size: 12px; }
.inventory-actions { display: flex; gap: 8px; flex-wrap: wrap; align-self: end; }

/* ---------- Booster packs on the market ---------- */
.pack-face { width: 52px; display: grid; place-items: center; }
.pack-face img { width: 100%; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.market-row .pack-face { cursor: pointer; }
.market-dialog-face .pack-face { width: 170px; margin: 0 auto; }
.pack-chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent); white-space: nowrap; }
.sell-pack-card .sell-form input { width: 110px; }

/* ---------- Collection: a shelf of binders, one per set ---------- */
.binder-game-shelf + .binder-game-shelf { margin-top: 26px; }
.binder-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; padding: 6px 4px 18px; border-bottom: 10px solid var(--brass-soft); border-radius: 0 0 6px 6px; box-shadow: 0 8px 10px -8px rgba(0, 0, 0, .35); }
.binder { display: grid; gap: 10px; color: inherit; text-decoration: none; }
.binder-cover { position: relative; aspect-ratio: 3 / 4; border-radius: 6px 14px 14px 6px; overflow: hidden; background: linear-gradient(135deg, #3a2a6e, #1c1438); box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset -6px 0 12px rgba(0, 0, 0, .25); transition: transform .2s ease, box-shadow .2s ease; }
.binder:hover .binder-cover, .binder:focus-visible .binder-cover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 16px 32px rgba(0, 0, 0, .45), inset -6px 0 12px rgba(0, 0, 0, .25); }
.binder:focus-visible { outline: none; }
.binder:focus-visible .binder-cover { outline: 3px solid var(--accent); outline-offset: 3px; }
.binder-spine { position: absolute; inset: 0 auto 0 0; width: 18px; z-index: 2; background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 255, 255, .08) 60%, rgba(0, 0, 0, .25)); }
.binder-spine::before, .binder-spine::after { content: ""; position: absolute; left: 5px; width: 8px; height: 8px; border-radius: 50%; background: #c9c3d8; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.binder-spine::before { top: 22%; }
.binder-spine::after { bottom: 22%; }
.binder-cover img { position: absolute; left: 50%; top: 10%; width: 56%; transform: translateX(-42%) rotate(-4deg); filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .45)); }
.binder-label { position: absolute; left: 18px; right: 0; bottom: 0; z-index: 1; padding: 22px 12px 10px; background: linear-gradient(180deg, transparent, rgba(10, 6, 24, .92) 45%); color: #fff; display: grid; gap: 2px; }
.binder-label strong { font-size: 15px; line-height: 1.2; }
.binder-badge { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--brass); color: #2a1d00; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.binder.complete .binder-cover { box-shadow: 0 0 0 3px var(--brass), 0 10px 24px rgba(0, 0, 0, .35); }
.binder-progress { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.binder-progress .completion-bar { height: 8px; }
.binder-game { font-family: var(--heading-font); font-size: 12px; letter-spacing: .1em; color: var(--brass); text-transform: uppercase; }
.collection-header h2 { margin: 2px 0; }
@media (max-width: 520px) {
  .binder-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .binder-label { padding: 18px 8px 8px; }
  .binder-label strong { font-size: 13px; }
}

/* ---------- Changelog and version ---------- */
.version-footer { text-align: center; padding: 0 16px 24px; font-size: 12px; }
.version-footer .link-button { color: var(--text-muted); font-weight: 600; }
.changelog-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.changelog-card h2 { margin: 0 40px 12px 0; }
.changelog-release h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.changelog-release h3 time { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.changelog-current { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.changelog-release ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  /* The details come first on narrow screens; the grid follows below. */
  .collection-layout { grid-template-columns: minmax(0, 1fr); }
  .card-panel { position: static; max-height: none; order: -1; }
  .panel-face { max-width: min(240px, 60vw); }
  .keyboard-hint { display: none; }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mobile-feed-heading { display: block; margin: 22px 0 10px; }
  .mobile-feed { display: grid; }

}
@media (max-width: 720px) {
  .app { padding: 10px 12px 30px; }
  .topbar { gap: 8px; }
  .logo { font-size: 20px; }
  .wallet { order: 3; width: 100%; justify-content: space-between; }
  .tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; overflow: visible; }
  .tab { display: grid; justify-items: center; gap: 1px; padding: 7px 2px; font-size: 18px; }
  .tab span:not(.tab-badge) { font-size: 11px; }
  .view { padding: 14px; border-radius: 16px; }
  .revealed-row { grid-template-columns: repeat(5, 52px); gap: 6px; }
  .reveal-card { height: min(46vh, 360px); }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .market-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .market-row .card-face { width: 44px; }
  .market-row .market-action { grid-column: 2 / -1; justify-self: end; }
  .completion { min-width: 0; width: 100%; }
  .leaderboard th:nth-child(5), .leaderboard td:nth-child(5) { display: none; }
  .market-stack-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .market-stack-row .market-stack-quantity { display: none; }
  .market-dialog-top { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .market-dialog-face .card-face { width: min(150px, 42vw); }
  .market-dialog-heading { width: 100%; text-align: center; }
  .market-dialog-heading .price-chart-summary { justify-content: center; }
  .market-dialog-columns { grid-template-columns: minmax(0, 1fr); }
  .offer-card { grid-template-columns: minmax(0, 1fr); }
  .offer-face { justify-items: center; }
  .offer-face .card-face { width: min(160px, 45vw); }
  .notification-menu { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
