/* Vault: collection tracker (Collectr-style), built on the site's dark theme. */
.vault { --up: #3ddc84; --down: #ff5c7a; --panel: #171c3a; --panel2: #1e2448; padding: 18px 0 40px; min-height: 70vh; }
.vault-body .newsletter { display: none; }
.v-view { min-height: 50vh; }
.vault section { padding: 0; }

/* Top bar */
.v-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.v-brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); text-decoration: none; font: 700 26px var(--pixel); }
.v-brand small { font: 600 13px var(--body); color: var(--muted); }
.v-vault-icon { width: 26px; height: 26px; align-self: center; border-radius: 7px; background: radial-gradient(circle at 50% 50%, #0f1226 28%, transparent 30%), conic-gradient(from 0deg, #f5c542, #ff9a5a, #f5c542, #ffe9a8, #f5c542); box-shadow: 0 0 0 2px #2b2140, 0 0 16px rgba(245, 197, 66, 0.45); }
.v-tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.v-tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.v-tabs a i { font-style: normal; font-size: 15px; }
.v-tabs a:hover { color: var(--text); }
.v-tabs a.on { background: var(--gold); color: #1d1d2b; }
.v-cur { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.v-cur select, .v-sort select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; }
@media (max-width: 760px) {
  .v-top { gap: 10px; }
  .v-brand { font-size: 22px; }
  .v-brand small { display: none; }
  /* Tabs become an app-style bottom bar with a big scan button in the middle. */
  .v-tabs { position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 50; justify-content: space-around; padding: 6px 4px; border-radius: 18px; background: rgba(23, 28, 58, 0.96); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
  .v-tabs a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 10px; flex: 1; text-align: center; }
  .v-tabs a i { font-size: 18px; }
  .v-tabs a[data-tab="sets"] { display: none; }
  .v-tabs a.v-tab-scan { flex: none; width: 58px; height: 58px; margin-top: -26px; border-radius: 50%; background: linear-gradient(160deg, #ffd966, #f5a623); color: #1d1d2b; box-shadow: 0 6px 16px rgba(245, 166, 35, 0.5); justify-content: center; }
  .v-tabs a.v-tab-scan i { font-size: 22px; }
  .vault { padding-bottom: 110px; }
  .vault-body .site-foot { padding-bottom: 110px; }
}

.v-h1 { font: 700 clamp(26px, 4vw, 38px) var(--pixel); margin: 0 0 6px; line-height: 1.1; }
.v-h2 { font: 700 20px var(--pixel); margin: 28px 0 12px; color: var(--muted); }
.v-h3 { font: 700 16px var(--pixel); margin: 20px 0 10px; }
.v-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.v-fine { color: var(--muted); font-size: 12px; line-height: 1.5; }
.v-empty { color: var(--muted); text-align: center; padding: 40px 10px; }
.v-link { background: none; border: 0; color: var(--gold); font: 600 14px var(--body); cursor: pointer; text-decoration: underline; margin-top: 12px; }
.v-credits { color: var(--muted); font-size: 11px; margin-top: 40px; line-height: 1.6; opacity: 0.8; }
.v-credits a { color: var(--muted); }
.sr-only-desktop { position: absolute; left: -9999px; }

/* Loading */
.v-loading { display: flex; justify-content: center; gap: 8px; padding: 80px 0; }
.v-loading span { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); animation: vDot 1s infinite ease-in-out; }
.v-loading span:nth-child(2) { animation-delay: 0.15s; }
.v-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes vDot { 0%, 100% { transform: scale(0.5); opacity: 0.4; } 50% { transform: scale(1); opacity: 1; } }
.v-error { text-align: center; padding: 50px 10px; }

/* Chips, values */
.v-big { font: 700 clamp(38px, 7vw, 58px)/1.05 var(--pixel); letter-spacing: -0.5px; }
.v-big.small { font-size: 32px; }
.v-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.v-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 9px; border-radius: 999px; font: 700 13px var(--body); }
.v-chip small { font-weight: 600; opacity: 0.75; }
.v-chip.up { background: rgba(61, 220, 132, 0.14); color: var(--up); }
.v-chip.down { background: rgba(255, 92, 122, 0.14); color: var(--down); }
.v-chip.flat { background: var(--panel2); color: var(--muted); }

/* Portfolio */
.v-port-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.v-port-stats { display: flex; gap: 10px; }
.v-port-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; text-align: center; min-width: 76px; }
.v-port-stats b { display: block; font: 700 22px var(--pixel); }
.v-port-stats small { color: var(--muted); font-size: 12px; }
.v-chart-wrap { margin: 18px 0 6px; background: linear-gradient(180deg, var(--panel), transparent); border-radius: 16px; padding: 10px 6px 4px; }
.v-chart-wrap.small { margin: 10px 0 4px; }
.v-chart { width: 100%; height: 170px; display: block; }
.v-chart-wrap.small .v-chart { height: 110px; }
.v-chart-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 2px 8px; }
.v-pl { margin: 10px 0; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.v-pl.up { background: rgba(61, 220, 132, 0.1); color: var(--up); }
.v-pl.down { background: rgba(255, 92, 122, 0.1); color: var(--down); }
.v-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
@media (max-width: 820px) { .v-cols { grid-template-columns: 1fr; } }
.v-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.v-panel h2 { font: 700 17px var(--pixel); margin: 0 0 8px; }
.v-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-radius: 10px; color: var(--text); text-decoration: none; }
.v-row:hover { background: var(--panel2); }
.v-row img { width: 44px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 4px; background: #0b0d1c; }
.v-row-main { min-width: 0; display: flex; flex-direction: column; }
.v-row-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-row-main small, .v-row-val small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-row-val { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.v-sell { display: block; margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(100deg, #2b2140, #3d2f5c); color: #e8e4ff; text-decoration: none; }
.v-sell b { color: var(--gold); }

/* Empty state */
.v-hero-empty { text-align: center; padding: 40px 10px 20px; max-width: 640px; margin: 0 auto; }
.v-hero-empty.small { padding: 30px 10px; }
.v-hero-empty h1 { font: 700 clamp(28px, 5vw, 44px)/1.1 var(--pixel); margin: 10px 0; }
.v-hero-empty p { color: var(--muted); }
.v-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.v-empty-art { position: relative; height: 150px; margin: 0 auto; width: 220px; }
.v-empty-art span { position: absolute; left: 50%; top: 10px; width: 92px; height: 128px; margin-left: -46px; border-radius: 8px; border: 3px solid #fff; background: repeating-linear-gradient(45deg, #2a3060, #2a3060 8px, #343a70 8px, #343a70 16px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); animation: vFloat 5s ease-in-out infinite; }
.v-empty-art span:nth-child(1) { transform: rotate(-16deg) translateX(-50px); animation-delay: -1s; }
.v-empty-art span:nth-child(3) { transform: rotate(16deg) translateX(50px); animation-delay: -2s; background: linear-gradient(160deg, #f5c542, #e07a1f); }
@keyframes vFloat { 50% { translate: 0 -8px; } }

/* Search */
.v-search { display: flex; gap: 8px; margin-bottom: 14px; }
.v-search input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; }
.v-search input:focus { outline: 2px solid var(--gold); }
.v-count { color: var(--muted); font-size: 14px; }
.v-tips { color: var(--muted); }
.v-tips a { color: var(--gold); }
.v-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.v-quick a { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--text); text-decoration: none; font-weight: 600; }
.v-quick a:hover { border-color: var(--gold); }

/* Card grid */
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .v-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } .v-tile-sub { display: none !important; } .v-tile-name { font-size: 12px !important; } }
.v-tile { display: flex; flex-direction: column; gap: 3px; color: var(--text); text-decoration: none; min-width: 0; }
.v-tile-img { position: relative; display: block; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden; background: #0b0d1c; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); transition: transform 0.25s cubic-bezier(.2, 1.3, .4, 1), box-shadow 0.25s; }
.v-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-tile:hover .v-tile-img { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 14px 26px rgba(0, 0, 0, 0.5); }
.v-tile:not(.owned) .v-tile-img img { opacity: 0.88; }
.v-tile.owned .v-tile-img { box-shadow: 0 0 0 2px var(--gold), 0 6px 16px rgba(245, 197, 66, 0.25); }
.v-own { position: absolute; right: 5px; bottom: 5px; background: var(--gold); color: #1d1d2b; font: 800 11px var(--body); padding: 2px 6px; border-radius: 999px; }
.v-wishmark { position: absolute; left: 5px; top: 5px; color: #ff6b8a; font-size: 15px; text-shadow: 0 1px 3px #000; }
.v-tile-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-tile-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-tile-price { color: var(--up); font: 700 13px var(--body); }
.v-tile-price.none { color: var(--muted); font-weight: 600; }
.v-noimg { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; color: var(--muted); font-size: 12px; }
.v-noimg.big { font-size: 20px; aspect-ratio: 63 / 88; }

/* Filters */
.v-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; }
.v-filter a { padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13px; }
.v-filter a.on { background: var(--text); color: #0f1226; border-color: var(--text); }
.v-filter.small a { font-size: 12px; padding: 4px 10px; }
.v-bar { display: block; height: 6px; border-radius: 99px; background: var(--panel2); overflow: hidden; margin: 6px 0 2px; }
.v-bar.big { height: 10px; max-width: 420px; }
.v-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f5c542, #ffe9a8); }

/* Sets */
.v-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.v-set { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.v-set:hover { border-color: var(--gold); transform: translateY(-2px); }
.v-set-logo { height: 64px; display: grid; place-items: center; margin-bottom: 6px; }
.v-set-logo img { max-height: 64px; max-width: 100%; object-fit: contain; }
.v-set small { color: var(--muted); font-size: 12px; }
.v-set-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.v-set-head > img { max-width: min(320px, 80vw); max-height: 120px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5)); }
.v-set-head p { color: var(--muted); margin: 4px 0; }

/* Pokédex */
.v-dex-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.v-dex-head p { color: var(--muted); margin: 0; }
.v-dex-find { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 10px 14px; font: inherit; min-width: 220px; }
.v-dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
@media (max-width: 480px) { .v-dexgrid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .v-mon .v-sprite { margin: -12px -8px -10px; scale: 0.84; } }
.v-mon { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 4px 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); text-decoration: none; transition: transform 0.2s, border-color 0.2s; }
.v-mon[hidden] { display: none; }
.v-mon small { font-size: 10px; opacity: 0.7; }
.v-mon b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.v-sprite { display: block; width: 96px; height: 96px; margin: -6px 0 -4px; background-image: url('/vault/img/dex-sprites.webp'); background-repeat: no-repeat; image-rendering: pixelated; filter: brightness(0) invert(1) opacity(0.12); transition: filter 0.3s, transform 0.3s; }
.v-mon:hover { transform: translateY(-3px); border-color: var(--line); }
.v-mon:hover .v-sprite { filter: brightness(0) invert(1) opacity(0.3); animation: vHop 0.5s ease; }
.v-mon.got { color: var(--text); background: radial-gradient(circle at 50% 35%, rgba(245, 197, 66, 0.16), var(--panel) 70%); border-color: rgba(245, 197, 66, 0.35); }
.v-mon.got .v-sprite { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45)); animation: vIdle 2.6s ease-in-out infinite; }
.v-mon.got:hover .v-sprite { animation: vHop 0.5s ease; }
@keyframes vIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes vHop { 30% { transform: translateY(-10px) scale(1.08); } 60% { transform: translateY(0) scale(0.96, 1.04); } }
.v-mon-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.v-mon-head .v-sprite.big { width: 192px; height: 192px; filter: brightness(0) invert(1) opacity(0.18); }
.v-mon-head.got .v-sprite.big { filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.5)); animation: vIdle 2.6s ease-in-out infinite; }
.v-mon-head small { color: var(--muted); }
.v-mon-head p { color: var(--muted); margin: 0; }
.v-pn { display: flex; gap: 16px; margin-top: 8px; }
.v-pn a { color: var(--gold); text-decoration: none; font-weight: 700; font-size: 14px; }

/* Card page */
.v-card { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 36px; align-items: start; }
@media (max-width: 820px) { .v-card { grid-template-columns: 1fr; gap: 18px; } }
.v-card-art { position: sticky; top: 130px; perspective: 1000px; }
@media (max-width: 820px) { .v-card-art { position: static; max-width: 340px; margin: 0 auto; width: 100%; } }
.v-other-print { text-align: center; margin: 10px 0 0; }
.v-card-img { position: relative; border-radius: 4.5%/3.2%; overflow: hidden; transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transition: transform 0.5s ease; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55); }
.v-card-img.tilting { transition: transform 0.06s linear; }
.v-card-img img { width: 100%; display: block; }
.v-glare { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.4), transparent 50%); mix-blend-mode: overlay; opacity: 0; transition: opacity 0.3s; }
.v-card-img.tilting .v-glare { opacity: 1; }
.v-card-set { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; font-weight: 700; }
.v-card-set img { height: 34px; max-width: 120px; object-fit: contain; }
.v-meta { color: var(--muted); margin: 0 0 6px; }
.v-price-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 10px 0 16px; }
.v-pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.v-pgrid div { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.v-pgrid small { display: block; color: var(--muted); font-size: 11px; }
.v-pgrid b { font-size: 15px; }
.v-add { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.v-add h2, .v-owned h2 { font: 700 18px var(--pixel); margin: 0; }
.v-add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.v-add label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.v-add select, .v-add input { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 10px; font: inherit; font-size: 15px; }
.v-add.inline { flex-direction: row; flex-wrap: wrap; align-items: center; background: none; border: 0; padding: 0; margin-top: 10px; }
.v-owned { margin-top: 16px; }
.v-owned-row, .v-list-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.v-qty { display: inline-flex; align-items: center; gap: 8px; }
.v-qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 16px; cursor: pointer; }
.v-del { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; }
.v-del:hover { color: var(--down); }
.v-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Binder */
.v-binder-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.v-binder-top .v-filter { margin: 0; }
.v-sort { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.v-total { margin-left: auto; color: var(--muted); }
.v-total b { color: var(--text); }
.v-book { position: relative; margin: 0 auto; max-width: 980px; aspect-ratio: 2 / 1.36; perspective: 2200px; outline: none; touch-action: pan-y; user-select: none; }
.v-book.single { max-width: 460px; aspect-ratio: 1 / 1.36; }
.v-spread { position: absolute; inset: 0; display: flex; border-radius: 12px; background: #1a1430; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 10px #2b2140; padding: 10px; }
.v-page { position: relative; flex: 1; height: 100%; padding: 4%; background: linear-gradient(90deg, #232a52, #1c2246); border-radius: 6px; overflow: hidden; }
.v-page.left { box-shadow: inset -18px 0 24px -12px rgba(0, 0, 0, 0.6); border-radius: 6px 0 0 6px; }
.v-page.right { box-shadow: inset 18px 0 24px -12px rgba(0, 0, 0, 0.6); border-radius: 0 6px 6px 0; }
.v-book.single .v-page.right { border-radius: 6px; box-shadow: inset 14px 0 20px -12px rgba(0, 0, 0, 0.6); }
.v-pockets { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 4%; height: 100%; }
.v-pockets.cover { display: grid; place-items: center; text-align: center; font: 700 clamp(18px, 3vw, 30px) var(--pixel); color: var(--gold); letter-spacing: 2px; }
.v-pockets.cover small { font-size: 0.6em; color: var(--muted); }
.v-pocket { position: relative; border-radius: 5px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); overflow: hidden; }
.v-pocket.full img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-pocket.full::after { content: ''; position: absolute; inset: 0; background: linear-gradient(125deg, rgba(255, 255, 255, 0.18), transparent 35%); pointer-events: none; }
.v-pocket i { position: absolute; left: 4px; bottom: 4px; background: rgba(15, 18, 38, 0.85); color: var(--up); font: 700 10px var(--body); font-style: normal; padding: 1px 5px; border-radius: 4px; }
.v-pocket .v-own { top: 4px; bottom: auto; right: 4px; }
.v-pg { position: absolute; bottom: 1.2%; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 11px; }
.v-leaf { position: absolute; top: 10px; bottom: 10px; width: calc(50% - 10px); transform-style: preserve-3d; transition: transform 0.75s cubic-bezier(.45, .05, .25, 1); z-index: 5; }
.v-leaf.fwd { left: 50%; transform-origin: left center; }
.v-leaf.back { right: 50%; transform-origin: right center; }
.v-leaf.fwd.go { transform: rotateY(-180deg); }
.v-leaf.back.go { transform: rotateY(180deg); }
.v-leaf.single { left: 10px; right: 10px; width: auto; transform-origin: left center; }
.v-leaf.single.back { transform: rotateY(-180deg); }
.v-leaf.single.back.go { transform: rotateY(0); }
.v-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 4%; }
.v-face.backside { transform: rotateY(180deg); }
.v-leaf.go .v-face.front { box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.4); }
.v-book-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 14px 0; color: var(--muted); }
.v-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.v-tools .v-fine { flex-basis: 100%; margin: 4px 0 0; }
.btn.danger { color: var(--down); }
.v-list-row { grid-template-columns: 48px 1fr auto auto auto auto; }
.v-list-row img { width: 48px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 4px; }
.v-list-main { display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none; }
.v-list-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-list-main small { color: var(--muted); font-size: 12px; }
.v-list-row select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px; }
.v-list-val { display: flex; flex-direction: column; align-items: flex-end; }
.v-list-val small { color: var(--muted); font-size: 11px; }
@media (max-width: 640px) {
  .v-list-row { grid-template-columns: 44px 1fr auto auto; }
  .v-list-row select, .v-list-row .v-del { display: none; }
}

/* Scanner */
.v-scan-stage { position: relative; height: min(64vh, 560px); border-radius: 20px; overflow: hidden; background: #0b0d1c; touch-action: none; }
.v-scan-stage video, .v-scan-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v-scan-guide { position: absolute; left: 50%; top: 50%; height: 82%; aspect-ratio: 63 / 88; transform: translate(-50%, -50%); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(5, 6, 18, 0.55); pointer-events: none; }
.v-scan-guide .c { position: absolute; width: 34px; height: 34px; border: 4px solid var(--gold); }
.v-scan-guide .tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.v-scan-guide .tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.v-scan-guide .bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.v-scan-guide .br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.v-scan-line { position: absolute; left: 6%; right: 6%; height: 3px; top: 10%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 14px var(--gold); opacity: 0; }
.v-scan-stage.scanning .v-scan-line { opacity: 1; animation: vScan 1.2s ease-in-out infinite alternate; }
@keyframes vScan { to { top: 88%; } }
.v-scan-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 2px 6px #000; margin: 0; pointer-events: none; }
.v-scan-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 20px; z-index: 1; }
.v-scan-idle b { font-size: 44px; }
.v-scan-bar { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 14px 0; }
.v-shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; cursor: pointer; padding: 5px; }
.v-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(160deg, #ffd966, #f5a623); transition: transform 0.15s; }
.v-shutter:active span { transform: scale(0.88); }
.v-scan-status { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px; background: var(--panel); border-radius: 12px; margin-bottom: 12px; text-align: center; }
.v-scan-status.ok { color: var(--up); }
.v-scan-status.err { color: var(--down); }
.v-spin { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: vSpin 0.8s linear infinite; flex: none; }
@keyframes vSpin { to { transform: rotate(360deg); } }
.v-match { display: grid; grid-template-columns: auto 1fr; gap: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; align-items: center; animation: vPop 0.35s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes vPop { from { transform: scale(0.95); opacity: 0; } }
@media (max-width: 560px) { .v-match { grid-template-columns: 1fr; } }
.v-match-imgs { display: flex; gap: 8px; }
.v-match-imgs > * { width: 120px; aspect-ratio: 63 / 88; border-radius: 6px; object-fit: cover; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
.v-match-info h2 { font: 700 24px var(--pixel); margin: 4px 0; }
.v-match-info p { color: var(--muted); margin: 0 0 6px; }
.v-match-info .v-twins { color: var(--text); font-size: 14px; background: rgba(245, 197, 66, 0.12); border: 1px solid rgba(245, 197, 66, 0.35); border-radius: 10px; padding: 8px 10px; }
.v-alts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 14px; }
.v-alt { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; color: var(--text); cursor: pointer; text-align: center; }
.v-alt:hover { border-color: var(--gold); }
.v-alt img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 4px; }
.v-alt small { display: block; font-size: 11px; line-height: 1.3; margin-top: 4px; color: var(--muted); }

/* Toast */
.v-toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); z-index: 90; background: #f5c542; color: #1d1d2b; font-weight: 700; padding: 10px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; max-width: 90vw; text-align: center; }
.v-toast.show { opacity: 1; transform: translate(-50%, 0); }
.v-toast.ok { background: var(--up); }
.v-toast.err { background: var(--down); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .v-mon.got .v-sprite, .v-empty-art span, .v-mon-head.got .v-sprite.big { animation: none; }
  .v-leaf { transition-duration: 0.01ms; }
}

/* Phones: filter chips scroll sideways instead of wrapping onto several rows. */
@media (max-width: 760px) {
  .vault .v-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; }
  .vault .v-filter::-webkit-scrollbar { display: none; }
  .vault .v-filter a { flex: none; }
}

/* Trader points for the Pokédex (traders-sync.js) */
.v-trader { margin-left: auto; padding: 7px 12px; border-radius: 99px; background: rgba(245, 197, 66, 0.12); border: 1px solid rgba(245, 197, 66, 0.45); color: var(--gold); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.v-trader:hover { background: rgba(245, 197, 66, 0.22); }
.v-trader + .v-cur { margin-left: 0; }
@media (max-width: 760px) { .v-trader { order: 3; width: 100%; text-align: center; white-space: normal; } }
