/* vault.css — Your cards (profile.html) on the v2 house style. Loads after ui-v2.css.
   Order of the page: the three best copies you own, the three God packs as rings, then Cards / Decks / Trophies.
   A card opens its sheet (sell, offers, burn); "Sell several" turns the grid into a picker with a dock. */

@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
.vault { max-width: 1320px; margin: 0 auto; padding: 4px var(--pad) 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(22px, 3.2vh, 38px); }
#app { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(22px, 3.2vh, 38px); }
#app[hidden] { display: none !important; }

.gatebox { max-width: 560px; margin: 8vh auto 0; padding: clamp(24px, 5vw, 44px); display: grid; gap: 14px; text-align: center; justify-items: center; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

/* hero */
.vault-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 4vw, 64px); }
.vault-hero.solo { grid-template-columns: minmax(0, 1fr); }
.vault-hero.solo .showcase { display: none; }
.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; justify-items: start; min-width: 0; }
.hero-num { margin: 0; font: 900 clamp(72px, 10vw, 150px)/.85 var(--display); max-width: 100%;
  background: linear-gradient(180deg, #fff 8%, var(--hi) 55%, color-mix(in srgb, var(--c) 85%, #000)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 10px 34px color-mix(in srgb, var(--c) 32%, transparent)); }
.stats { display: flex; flex-wrap: wrap; gap: 10px clamp(18px, 3vw, 36px); margin: 4px 0 0; padding: 0; }
.stats div { display: grid; gap: 2px; }
.stats dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.stats dd { margin: 0; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; max-width: 100%; }
.hero-actions .v2-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.showcase { position: relative; height: clamp(280px, 46vh, 440px); display: grid; place-items: center; }
.fan3 { position: relative; width: clamp(150px, 15vw, 210px); aspect-ratio: 813 / 1185; }
.fan3 .slot { position: absolute; inset: 0; transition: transform .7s var(--ease); }
.fan3 .slot.s1 { transform: translateX(-62%) translateY(6%) rotate(-13deg) scale(.84); }
.fan3 .slot.s0 { z-index: 2; }
.fan3 .slot.s2 { transform: translateX(62%) translateY(6%) rotate(13deg) scale(.84); }
.showcase:hover .slot.s1 { transform: translateX(-78%) translateY(3%) rotate(-17deg) scale(.86); }
.showcase:hover .slot.s2 { transform: translateX(78%) translateY(3%) rotate(17deg) scale(.86); }
.fan3 .v2-tilt { position: absolute; inset: 0; border-radius: 12px; cursor: pointer; }
.fan3 .v2-tilt > img, .fan3 .gloss, .fan3 .v2-foil { border-radius: 12px; }
.fan3 .tag { position: absolute; left: 50%; bottom: -16px; translate: -50% 0; z-index: 3; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: #160f03; background: linear-gradient(180deg, #fff, var(--r-ultra)); box-shadow: 0 8px 20px rgba(0,0,0,.5); white-space: nowrap; }

/* the three God packs */
.sets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.set { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; box-shadow: none; text-align: left; min-width: 0; transition: border-color .3s; }
.set:hover { border-color: color-mix(in srgb, var(--sc) 50%, var(--hair)); }
.ring { --p: 0; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; transition: --p 1.4s var(--ease);
  background: conic-gradient(var(--sc) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); box-shadow: 0 0 22px color-mix(in srgb, var(--sc) 30%, transparent); }
.ring > span { width: 48px; height: 48px; border-radius: 50%; background: #0c0b0a; display: grid; place-items: center; overflow: hidden; }
.ring img { width: 22px; max-width: none; border-radius: 2px; }
.set-t { min-width: 0; }
.set b { display: block; font: 900 15px/1.1 var(--display); letter-spacing: .06em; color: var(--sh); }
.set small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.set .pct { margin-left: auto; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chase { margin: 10px 2px 0; font-size: 13.5px; color: var(--ink-2); }
.chase a { color: var(--hi); font-weight: 600; }

/* the bar */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bar .v2-seg { width: min(340px, 100%); }
.bar .v2-seg small { display: inline; margin: 0 0 0 5px; font-size: 11.5px; }
.search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--hair); }
.search svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: 15px var(--ui); }
.search input::placeholder { color: var(--faint); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #160f03; background: var(--hi); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--glass); border: 1px solid var(--hair) !important; transition: all .2s; }
.chips button.on { color: #160f03; background: var(--hi); border-color: transparent !important; }
.coll-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 6px 0 14px; }
.coll-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* the grid: one tile per physical copy */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px 14px; }
.tile { display: grid; gap: 7px; text-align: left; min-width: 0; }
.tile .art { position: relative; aspect-ratio: 813 / 1185; border-radius: 8px; overflow: hidden; box-shadow: 0 12px 24px rgba(0,0,0,.45); transition: transform .35s var(--ease), box-shadow .35s, filter .3s; background: rgba(255,255,255,.04); }
.tile:hover .art { transform: translateY(-4px); box-shadow: 0 18px 34px rgba(0,0,0,.55), 0 0 26px color-mix(in srgb, var(--rc) 45%, transparent); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .fin { position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #160f03; background: linear-gradient(180deg, #fff, var(--rc)); }
.tile .mint { position: absolute; right: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.72); }
.tile .mint.low { color: #160f03; background: var(--r-ultra); }
.tile .offer { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: rgba(0,0,0,.72); color: var(--ok); }
.tile .tick { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.6); box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.tile .tick svg { width: 14px; height: 14px; fill: none; stroke: #160f03; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tile.picked .tick { background: var(--hi); box-shadow: none; }
.tile.picked .tick svg { opacity: 1; }
.tile.picked .art { box-shadow: 0 0 0 3px var(--hi), 0 12px 24px rgba(0,0,0,.45); }
.tile.locked .art { filter: grayscale(.8) brightness(.5); }
.tile .nm { font-size: 12.5px; line-height: 1.25; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-common { --rc: var(--r-common); } .r-rare { --rc: var(--r-rare); } .r-super { --rc: var(--r-super); } .r-ultra { --rc: var(--r-ultra); } .r-god { --rc: var(--r-god); }
.empty { grid-column: 1 / -1; display: grid; gap: 12px; justify-items: center; padding: 40px 12px; text-align: center; color: var(--muted); }
.more { grid-column: 1 / -1; padding: 12px; text-align: center; font-size: 13px; color: var(--muted); }

/* decks */
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.deckbox { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; }
.deckbox.active { border-color: color-mix(in srgb, var(--c) 50%, var(--hair)); }
.db-stack { position: relative; width: 86px; aspect-ratio: 813 / 1185; margin: 6px 0 6px 10px; }
.db-stack > * { position: absolute; inset: 0; border-radius: 7px; box-shadow: 0 10px 20px rgba(0,0,0,.5); }
.db-stack .v2-cardback:nth-child(1) { transform: rotate(-9deg) translate(-8px, 4px); }
.db-stack .v2-cardback:nth-child(2) { transform: rotate(-4deg) translate(-3px, 2px); }
.db-stack img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.deckbox:hover .db-stack img { transform: translateY(-6px) rotate(2deg); }
.db-info { display: grid; gap: 6px; min-width: 0; }
.db-info h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.08); }
.tag.ok { color: var(--ok); } .tag.warn { color: var(--warn); } .tag.hi { color: #160f03; background: var(--hi); }
.db-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.newdeck { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 170px; padding: 18px; text-align: center; border: 1.5px dashed rgba(255,255,255,.16) !important; background: transparent; }
.newdeck .plus { font-size: 40px; line-height: 1; color: var(--hi); }

/* trophies */
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 12px; margin-top: 12px; }
.trophy { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 12px; row-gap: 3px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--hair); color: var(--muted); }
.trophy .medal { grid-row: span 3; width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.14); }
.trophy b { font-size: 14px; color: var(--ink-2); }
.trophy small { font-size: 12.5px; line-height: 1.35; }
.trophy .v2-bar { grid-column: 2; margin-top: 6px; }
.trophy .frac { grid-column: 2; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.trophy.earned { background: linear-gradient(180deg, rgba(255,214,110,.1), rgba(255,255,255,.03)); border-color: rgba(255,214,110,.28); color: var(--ink-2); }
.trophy.earned b { color: var(--hi); }
.trophy.earned .medal { box-shadow: none; background: radial-gradient(circle at 35% 30%, #fff6d8, #ffcc4d 45%, #a0701a); }

/* the card sheet */
.cardmodal { width: min(820px, calc(100vw - 24px)); padding: 28px; }
.cm-x { position: absolute; right: 16px; top: 16px; z-index: 2; display: grid; place-items: center; }
.cm-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; }
.cm-card { aspect-ratio: 813 / 1185; border-radius: 14px; }
.cm-card > img, .cm-card .gloss, .cm-card .v2-foil { border-radius: 14px; }
.cm-info { display: grid; gap: 14px; min-width: 0; }
.cm-info .tier { display: block; margin-bottom: 4px; }
.cm-info .v2-h2 { font-size: clamp(24px, 3vw, 36px); padding-right: 36px; }
.mintline { margin: 0; font-size: 14px; color: var(--hi); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.facts div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--glass); min-width: 0; }
.facts small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.facts b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.facts span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); max-height: 9.5em; overflow: auto; }
.market-line { font-size: 13.5px; color: var(--ink-2); }
.pchart { margin: 0; }
.pchart svg { display: block; width: 100%; height: 84px; }
.pchart .ln { fill: none; stroke: var(--hi); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pchart .avg { fill: none; stroke: rgba(255,255,255,.3); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.pchart figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.cm-actions { display: grid; gap: 10px; }
.cm-actions .row { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-actions .row > * { flex: 1 1 auto; }
.cm-note { margin: 0; font-size: 13px; color: var(--muted); }
.warnline { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; color: #ffd9a8; background: rgba(255,150,40,.1); }
.err { margin: 0; min-height: 1.2em; font-size: 13px; color: #ff9a8a; }
.pricebox { display: flex; align-items: center; gap: 6px; height: 54px; padding: 0 16px; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--hair); }
.pricebox span { font-size: 22px; color: var(--muted); }
.pricebox input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: 650 22px var(--ui); font-variant-numeric: tabular-nums; }
.sellform { display: grid; gap: 10px; }
.sellform label small { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.row2 { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.danger { background: linear-gradient(180deg, #ffb3a8, #ff6b5b 60%, #d9443a) !important; box-shadow: 0 12px 32px rgba(217,68,58,.35) !important; }

/* sheets */
.v2-sheet.wide { width: min(620px, calc(100vw - 20px)); }
.sheet-foot { position: sticky; bottom: -22px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px -22px -22px; padding: 14px 22px 22px;
  background: linear-gradient(180deg, rgba(18,16,14,0), rgba(18,16,14,.96) 30%); }
.filter-group { display: grid; gap: 8px; margin-bottom: 16px; }
.filter-group > small, .filter-group.two small { font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-group.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.filter-group.two > div { display: grid; gap: 8px; }
.filter-group select { width: 100%; height: 42px; padding: 0 12px; border-radius: 12px; font: 600 14px var(--ui); color: var(--ink); background: var(--glass-2); border: 1px solid var(--hair); }
.filter-group select option { color: #111; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--glass); border: 1px solid var(--hair) !important; }
.pills button.on { color: #160f03; background: var(--hi); border-color: transparent !important; }

.bulk-rows { display: grid; gap: 8px; margin: 4px 0 12px; }
.bulk-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: var(--glass); }
.bulk-row img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.bulk-row .nm b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-row .nm small { display: block; font-size: 12px; color: var(--muted); }
.bulk-row .ctl { display: flex; align-items: center; gap: 6px; }
.bulk-row input { width: 86px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--hair); background: rgba(0,0,0,.3); color: var(--ink); font: 600 14px var(--ui); }
.bulk-row input.q { width: 52px; }
.bulk-row .rm { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); }

.dock { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 50; display: flex; align-items: center; gap: 10px;
  width: min(560px, calc(100vw - 20px)); padding: 8px 8px 8px 18px; border-radius: 24px; background: rgba(18,16,14,.94); border: 1px solid var(--hair); backdrop-filter: blur(22px); box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.dock #selCount { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }

.you-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 14px; }
.you-head .v2-avatar { width: 64px; height: 64px; }
.you-head b { display: block; font: 900 20px/1.15 var(--display); letter-spacing: .03em; overflow-wrap: anywhere; }
.you-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.you-stats div { padding: 10px; border-radius: 14px; background: var(--glass); text-align: center; }
.you-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.you-stats small { font-size: 11.5px; color: var(--muted); }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin: 6px 0 14px; }
.av-grid button { aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 2px transparent; opacity: .82; }
.av-grid button img { width: 100%; height: 100%; object-fit: cover; }
.av-grid button.on { opacity: 1; box-shadow: 0 0 0 3px var(--hi); }
.namefield { width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--hair); background: rgba(0,0,0,.3); color: var(--ink); font: 600 15px var(--ui); }

/* tablet */
@media (max-width: 1000px) { .cm-grid { grid-template-columns: 200px minmax(0, 1fr); gap: 22px; } }
/* phone, upright */
@media (max-width: 760px) {
  .vault-hero { grid-template-columns: minmax(0, 1fr); text-align: center; gap: 8px; }
  .showcase { order: -1; height: 270px; }
  .fan3 { width: 150px; }
  .fan3 .slot.s1, .showcase:hover .slot.s1 { transform: translateX(-48%) translateY(6%) rotate(-12deg) scale(.8); }
  .fan3 .slot.s2, .showcase:hover .slot.s2 { transform: translateX(48%) translateY(6%) rotate(12deg) scale(.8); }
  .hero-copy { justify-items: center; }
  .stats, .hero-actions { justify-content: center; }
  .sets { gap: 8px; }
  .set { flex-direction: column; gap: 6px; padding: 12px 6px; text-align: center; }
  .set .pct { margin: 0; font-size: 14px; }
  .ring { width: 50px; height: 50px; } .ring > span { width: 41px; height: 41px; }
  .bar .v2-seg { width: 100%; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .cardmodal { padding: 22px 16px; }
  .cm-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cm-art { width: min(52vw, 210px); justify-self: center; }
  .dock { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .filter-group.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* phone, sideways */
@media (orientation: landscape) and (max-height: 500px) {
  .vault { gap: 16px; }
  .vault-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); text-align: left; }
  .showcase { order: 0; height: 62vh; }
  .fan3 { width: 118px; }
  .hero-copy { justify-items: start; gap: 8px; }
  .hero-num { font-size: 60px; }
  .stats, .hero-actions { justify-content: flex-start; }
  .stats dd { font-size: 19px; }
  .set { flex-direction: row; padding: 8px 10px; text-align: left; }
  .ring { width: 44px; height: 44px; } .ring > span { width: 36px; height: 36px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .cardmodal { padding: 16px 18px; }
  .cm-grid { grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
  .cm-art { width: 150px; }
  .v2-sheet { max-height: calc(100dvh - 16px); bottom: 8px; }
}

/* the signed-out panel in the house key art: a lit card, gold edge, the same two buttons as the front door */
.gatebox { position: relative; isolation: isolate; overflow: clip; overflow-clip-margin: 20px; border: 1px solid rgba(231,198,107,.28);
  background: linear-gradient(180deg, rgba(38,30,20,.86), rgba(12,10,7,.92)); box-shadow: inset 0 1px 0 rgba(255,230,163,.12), 0 30px 70px rgba(0,0,0,.5); }
.gatebox .v2-keylight { --kl: #ffd98d; --kl-size: 760px; top: 44%; opacity: .32; z-index: -1; }
.gatebox .v2-engrave { justify-content: center; white-space: nowrap; }
.gate-actions .v2-gold, .gate-actions .v2-obsidian { min-width: 210px; }
