/* ============================================================
   /vault. Owns the vt- prefix and nothing else.

   The wireframe ground has to stay visible through this page, and
   the vault is the densest page on the site, so the budget is spent
   carefully:

     - glass-refract on exactly two surfaces, the stat header and the
       catalogue panel. Both are large, both sit still.
     - the grid itself has no background at all, so slabs float over
       the lattice.
     - tiles are translucent but carry NO backdrop-filter. Thirty
       blurred tiles over a blurred panel is the fill-rate cliff, and
       a tile is small enough that a plain translucent fill reads the
       same anyway.
   ============================================================ */

.vt-page { padding-bottom: 8px; }
.vt-shell { display: flex; flex-direction: column; gap: 20px; }

/* ---------- head ---------- */
.vt-head { padding: 44px 0 4px; }
.vt-head .display { line-height: .92; }
.vt-head-sub { max-width: 56ch; margin: 12px 0 0; font-size: 14px; }

/* ---------- signed out / nothing held ---------- */
.vt-gate {
  display: grid; justify-items: center; text-align: center;
  gap: 12px; padding: 64px 24px;
}
.vt-gate-ico { color: var(--muted-fg); opacity: .55; }
.vt-gate-copy { max-width: 46ch; margin: 0; font-size: 14px; }
.vt-gate .btn { margin-top: 6px; }
.vt-gate-note { margin: 2px 0 0; font-size: 11.5px; max-width: 42ch; }

/* ---------- stat header ---------- */
.vt-stats { padding: 22px; display: flex; flex-direction: column; gap: 20px; }

/* Explicit counts rather than auto-fit: five figures auto-fitting into a
   mid-width shell lands on four-plus-one, which reads as a mistake. */
.vt-stat-grid {
  display: grid;
  gap: 18px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vt-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vt-stat-k {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-fg);
}
.vt-stat-v {
  font-size: clamp(26px, 3.4vw, 38px); line-height: 1.05; color: var(--fg);
  overflow-wrap: anywhere;
}
.vt-stat-s { font-size: 11.5px; line-height: 1.35; }

/* ---------- level bar ---------- */
.vt-level {
  display: flex; flex-direction: column; gap: 9px;
  padding-top: 18px; border-top: 1px solid var(--glass-border);
}
.vt-level-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.vt-level-num {
  font-family: var(--font-display); font-size: 20px;
  letter-spacing: .02em; text-transform: uppercase;
}
.vt-level-title { font-size: 12.5px; }
.vt-level-exp { font-size: 12px; color: var(--muted-fg); }

.vt-bar {
  position: relative; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--glass-bg-faint);
  border: 1px solid var(--glass-border);
}
.vt-bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--primary-grad);
  box-shadow: 0 0 14px oklch(54.9% .2055 286.94 / .45);
  transition: width .5s cubic-bezier(.2, .9, .3, 1);
}
.vt-level-note { margin: 0; font-size: 11.5px; }

/* ---------- toolbar ---------- */
.vt-tools { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.vt-tools-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.vt-search { position: relative; flex: 1 1 220px; min-width: 0; display: flex; }
.vt-search-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  display: inline-flex; color: var(--muted-fg); pointer-events: none;
}
.vt-search .vt-input { padding-left: 37px; width: 100%; }

.vt-input,
.vt-select {
  appearance: none; -webkit-appearance: none;
  min-width: 0;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-faint);
  color: var(--fg);
  font-family: inherit; font-size: 14px; line-height: 1.4;
}
.vt-input::placeholder { color: var(--muted-fg); }
.vt-input:hover, .vt-select:hover { border-color: var(--muted-fg); }
.vt-input:focus, .vt-select:focus { outline: none; border-color: var(--primary-soft); }
.vt-input:focus-visible, .vt-select:focus-visible { outline: 2px solid var(--primary-soft); outline-offset: 1px; }
/* The native option popup takes its palette from color-scheme, not from
   our tokens, so it has to be told which way round the site is. */
.vt-input, .vt-select { color-scheme: light; }
:root.dark .vt-input,
:root.dark .vt-select { color-scheme: dark; }

/* Chevron drawn from two gradient triangles rather than an SVG data URI,
   so it inherits currentColor and stays correct in both themes. */
.vt-select {
  padding-right: 34px; cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15.5px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.vt-select::-ms-expand { display: none; }

.vt-bulk-toggle.on {
  background: var(--glass-bg-strong);
  border-color: var(--primary-soft);
  color: var(--primary-soft);
}
.vt-btn-ico { display: inline-flex; }

/* rarity multi select */
.vt-rarities { display: flex; flex-wrap: wrap; gap: 7px; }
.vt-rchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px; cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-faint);
  color: var(--muted-fg);
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.vt-rchip:hover { color: var(--fg); border-color: var(--muted-fg); }
.vt-rchip.on { color: var(--fg); background: var(--glass-bg-strong); border-color: var(--muted-fg); }
.vt-rchip.on[data-rarity="common"]    { border-color: color-mix(in oklab, var(--rarity-common) 60%, transparent); background: color-mix(in oklab, var(--rarity-common) 14%, transparent); }
.vt-rchip.on[data-rarity="uncommon"]  { border-color: color-mix(in oklab, var(--rarity-uncommon) 60%, transparent); background: color-mix(in oklab, var(--rarity-uncommon) 14%, transparent); }
.vt-rchip.on[data-rarity="rare"]      { border-color: color-mix(in oklab, var(--rarity-rare) 60%, transparent); background: color-mix(in oklab, var(--rarity-rare) 14%, transparent); }
.vt-rchip.on[data-rarity="mythic"]    { border-color: color-mix(in oklab, var(--rarity-mythic) 60%, transparent); background: color-mix(in oklab, var(--rarity-mythic) 14%, transparent); }
.vt-rchip.on[data-rarity="legendary"] { border-color: color-mix(in oklab, var(--rarity-legendary) 60%, transparent); background: color-mix(in oklab, var(--rarity-legendary) 14%, transparent); }

.vt-tools-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vt-count { margin: 0; font-size: 12.5px; }
.vt-clear { margin-left: auto; }

/* ---------- the grid ---------- */
.vt-grid {
  display: grid;
  gap: 16px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vt-grid.is-empty { display: block; }

.vt-tile {
  display: flex; flex-direction: column;
  width: 100%; min-width: 0;
  margin: 0; padding: 10px 10px 12px;
  text-align: left; cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.vt-tile:hover { background: var(--glass-bg-faint); border-color: var(--glass-border); }
.vt-tile:active { transform: translateY(1px); }

.vt-tile-art { position: relative; display: block; }
/* slabNode ships a fixed pixel width. Inside a grid cell it has to fill
   the cell instead. This sheet loads after slab.css, so the later rule
   wins at equal specificity. */
.vt-tile .sl-slab { width: 100%; max-width: 100%; }
.vt-tile .sl-cap { margin-top: 12px; }
.vt-cap-val { margin-left: auto; color: var(--fg); font-weight: 600; }

/* stack count + status flags.
   The grading label runs from y=16 to y=108 of the 576 unit plate, and the
   grade itself is set in 42pt at the right end of it, so a badge pinned to
   top:6px lands square on the number the whole site is about. .vt-tile-art is
   exactly the plate box, so a percentage clears the label at every tile size:
   108/576 = 18.75%, plus a little air. */
.vt-flags {
  position: absolute; top: 21%; right: 6px; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  pointer-events: none;
}
.vt-stack-count {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--fg);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 2px 8px oklch(0% 0 0 / .35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.vt-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  color: var(--fg);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 2px 8px oklch(0% 0 0 / .35);
}

/* bulk pick affordance */
.vt-check {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  display: none; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px;
  color: transparent;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.vt-tile.is-picking .vt-check { display: inline-flex; }
.vt-tile.is-picking { cursor: copy; }
.vt-tile.is-picked { background: var(--glass-bg); border-color: var(--primary-soft); }
.vt-tile.is-picked .vt-check {
  color: var(--primary-fg);
  background: var(--primary-grad);
  border-color: transparent;
}
.vt-tile.is-locked { opacity: .45; cursor: not-allowed; }
.vt-tile.is-locked .vt-check { display: none; }

.vt-noresult { padding: 56px 20px; }
.vt-noresult .btn { margin-top: 4px; }
.vt-more { display: flex; justify-content: center; padding: 4px 0 2px; }

/* ---------- bulk bar ----------
   Sticky, and a child of the page rather than of any glass panel:
   backdrop-filter establishes a containing block, so a pinned element
   inside one anchors to the panel instead of the viewport. Sticky is
   safe here because nothing above it filters. */
.vt-bulkbar {
  position: sticky; bottom: 18px; z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-2);
}
.vt-bb-fig { display: inline-flex; align-items: baseline; gap: 7px; padding-left: 6px; }
.vt-bb-count { font-size: 26px; line-height: 1; }
.vt-bb-word { font-size: 12px; color: var(--muted-fg); }
.vt-bb-sep { width: 1px; height: 18px; background: var(--glass-border); }
.vt-bb-total { font-size: 14px; font-weight: 600; }

/* ---------- catalogue progress ---------- */
.vt-collection { padding: 22px; }
.vt-collection .section-title { margin-bottom: 18px; }
.vt-coll-meta { font-size: 12.5px; text-align: right; }
/* Five sets, so the counts below are chosen to avoid a lone orphan on a
   second row. Every step is a min-width at or above 640px, which keeps it
   clear of the max-width block at the end of this file. */
.vt-sets { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.vt-set { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.vt-set-head { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.vt-set-code {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: var(--muted-fg);
  padding: 2px 7px; border-radius: 6px;
  background: var(--glass-bg-faint); border: 1px solid var(--glass-border);
}
.vt-set-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.vt-set-count { display: inline-flex; align-items: baseline; }
.vt-set-count .serif { font-size: 20px; line-height: 1; }
.vt-set-of { font-size: 12px; }

.vt-pips { display: flex; flex-wrap: wrap; gap: 5px; }
.vt-pip {
  width: 13px; height: 13px; border-radius: 4px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-faint);
}
.vt-pip[data-state="held"][data-rarity="common"]    { background: var(--rarity-common); border-color: transparent; }
.vt-pip[data-state="held"][data-rarity="uncommon"]  { background: var(--rarity-uncommon); border-color: transparent; }
.vt-pip[data-state="held"][data-rarity="rare"]      { background: var(--rarity-rare); border-color: transparent; }
.vt-pip[data-state="held"][data-rarity="mythic"]    { background: var(--rarity-mythic); border-color: transparent; }
.vt-pip[data-state="held"][data-rarity="legendary"] { background: var(--rarity-legendary); border-color: transparent; }
.vt-pip[data-state="past"][data-rarity="common"]    { border-color: color-mix(in oklab, var(--rarity-common) 70%, transparent); }
.vt-pip[data-state="past"][data-rarity="uncommon"]  { border-color: color-mix(in oklab, var(--rarity-uncommon) 70%, transparent); }
.vt-pip[data-state="past"][data-rarity="rare"]      { border-color: color-mix(in oklab, var(--rarity-rare) 70%, transparent); }
.vt-pip[data-state="past"][data-rarity="mythic"]    { border-color: color-mix(in oklab, var(--rarity-mythic) 70%, transparent); }
.vt-pip[data-state="past"][data-rarity="legendary"] { border-color: color-mix(in oklab, var(--rarity-legendary) 70%, transparent); }

.vt-set-bar {
  height: 4px; border-radius: 999px; overflow: hidden;
  background: var(--glass-bg-faint); border: 1px solid var(--glass-border);
}
.vt-set-bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--primary-grad);
  transition: width .5s cubic-bezier(.2, .9, .3, 1);
}
.vt-set-past { margin: 0; font-size: 11px; }
.vt-coll-note { margin: 18px 0 0; font-size: 11.5px; }

/* ---------- detail modal ---------- */
.vt-detail {
  position: relative;
  display: grid; gap: 26px;
  grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
  padding: 26px;
}
.vt-detail-close { position: absolute; top: 13px; right: 13px; z-index: 3; }
.vt-detail-art { display: flex; align-items: flex-start; justify-content: center; }
.vt-detail-art .sl-slab { width: 100%; max-width: 290px; }
.vt-detail-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-right: 34px; }
.vt-detail-info .display { margin: 0; line-height: 1; }
.vt-detail-info .eyebrow { margin: 0; }
.vt-detail-chips { display: flex; flex-wrap: wrap; gap: 7px; }

.vt-lore {
  margin: 0; font-size: 17px; line-height: 1.45;
  color: var(--fg); opacity: .88;
}

.vt-facts {
  display: grid; gap: 1px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--glass-border);
  border: 1px solid var(--glass-border);
}
.vt-fact {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 13px;
  background: var(--glass-bg-faint);
}
.vt-fact-k { font-size: 12px; color: var(--muted-fg); }
.vt-fact-v { font-size: 12.5px; text-align: right; overflow-wrap: anywhere; }

.vt-value { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.vt-value-k {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-fg);
}
.vt-value-v { font-size: 34px; line-height: 1; }
.vt-value-s { font-size: 12px; }

.vt-actions { margin-top: 2px; }
.vt-action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.vt-action-row .btn { flex: 1 1 auto; }
.vt-locked { margin: 0; font-size: 13px; }

.vt-confirm { display: flex; flex-direction: column; gap: 12px; }
.vt-confirm-line { margin: 0; font-size: 13px; color: var(--muted-fg); }
.vt-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vt-confirm-actions .btn { flex: 1 1 auto; }

.vt-confirm-modal { display: flex; flex-direction: column; gap: 12px; padding: 26px; }
.vt-confirm-modal .display { margin: 0; }
.vt-confirm-modal p { margin: 0; font-size: 13.5px; }
.vt-confirm-fig { font-size: 44px; line-height: 1; }

/* ---------- redemption form ---------- */
.vt-form { display: flex; flex-direction: column; gap: 14px; }
.vt-form-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vt-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.vt-field.wide { grid-column: 1 / -1; }
.vt-field-k {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted-fg);
}
.vt-field .vt-input { border-radius: 10px; }
.vt-form-note { margin: 0; font-size: 11.5px; line-height: 1.5; }

.vt-done { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vt-done-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; border-radius: 999px;
  color: var(--primary-fg); background: var(--primary-grad);
}
.vt-done-t { margin: 0; font-weight: 700; }
.vt-done p { margin: 0; font-size: 12.5px; }
.vt-done .btn { margin-left: auto; }

/* ============================================================
   responsive. Base is the narrow case, then columns are added.
   Ascending min-width only, so nothing in this file can be
   out-ranked by source order later in the same sheet.
   ============================================================ */
@media (min-width: 520px) {
  .vt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; }
}
@media (min-width: 640px) {
  .vt-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vt-sets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .vt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vt-form-grid { gap: 12px; }
}
@media (min-width: 900px) {
  .vt-sets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1040px) {
  .vt-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 18px; }
  .vt-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
  .vt-sets { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 14px; }
}
@media (min-width: 1300px) {
  .vt-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* The mobile tab bar is fixed 12px off the bottom and about 62px tall,
   so the sticky bulk bar has to clear it. */
@media (max-width: 900px) {
  .vt-bulkbar { bottom: 88px; }
}

@media (max-width: 760px) {
  .vt-detail { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 22px 18px; }
  .vt-detail-art .sl-slab { max-width: 230px; }
  .vt-detail-info { padding-right: 0; }
  .vt-value-v { font-size: 30px; }
  .vt-form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .vt-head { padding-top: 30px; }
  .vt-stats, .vt-collection { padding: 18px 15px; }
  .vt-stat-grid { gap: 14px 10px; }
  .vt-stat-v { font-size: 25px; }
  .vt-tools { padding: 12px; }
  .vt-tools-row > .vt-select { flex: 1 1 130px; }
  .vt-tools-row > .vt-bulk-toggle { flex: 0 0 auto; }
  .vt-bulkbar { border-radius: 18px; gap: 8px; padding: 10px 12px; }
  .vt-bb-count { font-size: 21px; }
  .vt-bulkbar .btn { flex: 1 1 auto; }
  .vt-bb-sep { display: none; }
  .vt-confirm-fig { font-size: 34px; }
  .vt-tile { padding: 7px 7px 10px; }
}

/* Reduced transparency: the tiles and the bulk bar are the two surfaces
   in this file that carry their own translucency, so they need the same
   treatment app.css gives the shared ones. */
@media (prefers-reduced-transparency: reduce) {
  .vt-bulkbar, .vt-stack-count, .vt-flag, .vt-check {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--card);
  }
  .vt-tile:hover, .vt-tile.is-picked { background: var(--muted); }
  .vt-input, .vt-select, .vt-rchip, .vt-fact { background: var(--input); }
}

@media (prefers-reduced-motion: reduce) {
  .vt-bar-fill, .vt-set-bar-fill { transition: none; }
  .vt-tile { transition: none; }
  .vt-tile:active { transform: none; }
}
