/* ============================================================ base */
:root {
  --bg: #0d0f16;
  --bg2: #151824;
  --panel: #1a1e2c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9ecf4;
  --muted: #8d95ab;
  --accent: #ff7a59;
  --accent2: #ffd29a;
  --radius: 14px;
  --card-r: 4.5%;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --v-normal: #a3acbd;
  --v-holo: #9fd7ff;
  --v-reverse: #2fd4e8;
  --v-pokeball: #ef4444;
  --v-masterball: #9b5cf6;
}
body[data-set='white-flare'] { --accent: #ff7a59; --accent2: #ffe1b8; --binder: #2a1f22; --binder2: #3a2a2c; }
body[data-set='journey-together'] { --accent: #4fb3ff; --accent2: #ffd36e; --binder: #182333; --binder2: #213046; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 15% -10%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, color-mix(in oklab, var(--accent2) 8%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 var(--font);
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s;
}
body.modal-open { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
kbd { font: 11px/1 var(--font); padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; margin: 0 1px; }
[hidden] { display: none !important; }
body:not(.can-edit) .edit-only { display: none; }

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.11); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #140b08; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 6px 12px; font-size: 18px; line-height: 1; }
.btn.danger:hover { color: #ff8a8a; border-color: #ff8a8a55; }

/* ============================================================ top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: 0.2px; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; color: var(--accent); }
.set-tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.set-tab {
  display: flex; align-items: baseline; gap: 8px;
  border: 1px solid transparent; background: none; padding: 7px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
.set-tab small { font-size: 12px; opacity: 0.75; }
.set-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.set-tab.active { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: color-mix(in oklab, var(--accent) 60%, transparent); }
.top-actions { display: flex; gap: 8px; align-items: center; }
body:not(.can-edit) #packBtn { opacity: 0.6; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 270px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.menu button, .menu-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; padding: 9px 12px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.menu button:hover, .menu-toggle:hover { background: rgba(255, 255, 255, 0.06); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu input { accent-color: var(--accent); }

/* ============================================================ hero */
.set-hero {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  max-width: 1440px; margin: 0 auto; padding: 18px 26px 6px;
}
.hero-set { display: flex; align-items: center; gap: 16px; min-width: 0; }
.set-logo { height: 58px; max-width: 220px; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5)); }
.hero-meta { display: flex; flex-direction: column; }
.hero-meta span:first-child { font-weight: 800; font-size: 18px; }
.hero-meta span:last-child { color: var(--muted); font-size: 13px; }
.hero-rings { display: flex; gap: 26px; }
.ring { display: flex; align-items: center; gap: 10px; position: relative; }
.ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: rgba(255, 255, 255, 0.08); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring.complete .fill { stroke: #ffd36e; filter: drop-shadow(0 0 6px #ffd36e); }
.ring-text { position: absolute; left: 0; width: 56px; text-align: center; font-size: 13px; }
.ring-label { display: flex; flex-direction: column; line-height: 1.25; }
.ring-label strong { font-size: 14px; }
.ring-label span { color: var(--muted); font-size: 12.5px; }
.hero-variants { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.vstat { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.vstat b { color: var(--text); }
.vstat div { display: flex; flex-direction: column; align-items: flex-start; min-width: 54px; }
.vstat i { display: block; width: 100%; height: 3px; border-radius: 3px; margin-top: 3px; background: linear-gradient(90deg, var(--vc, var(--accent)) var(--p), rgba(255, 255, 255, 0.08) var(--p)); }
.vstat.v-normal { --vc: var(--v-normal); } .vstat.v-holo { --vc: var(--v-holo); } .vstat.v-reverse { --vc: var(--v-reverse); }
.vstat.v-pokeball { --vc: var(--v-pokeball); } .vstat.v-masterball { --vc: var(--v-masterball); }

/* ============================================================ view bar */
.viewbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1440px; margin: 0 auto; padding: 10px 26px; flex-wrap: wrap; }
.seg { display: inline-flex; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg button.active { background: rgba(255, 255, 255, 0.11); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
.seg.small button { padding: 5px 12px; font-size: 13px; }

main { max-width: 1440px; margin: 0 auto; padding: 4px 16px 60px; }

/* ============================================================ badges */
.badge {
  --c: var(--v-normal);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 24px; height: 19px; padding: 0 6px;
  border-radius: 6px; border: 1px dashed rgba(255, 255, 255, 0.22);
  background: transparent; color: rgba(255, 255, 255, 0.38);
  font: 800 10.5px/1 var(--font); letter-spacing: 0.3px; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.badge.v-holo { --c: var(--v-holo); }
.badge.v-reverse { --c: var(--v-reverse); }
.badge.v-pokeball { --c: var(--v-pokeball); }
.badge.v-masterball { --c: var(--v-masterball); }
.badge.owned { border-style: solid; border-color: color-mix(in oklab, var(--c) 70%, transparent); color: var(--c); background: color-mix(in oklab, var(--c) 16%, transparent); }
.badge.owned.v-pokeball { background: linear-gradient(180deg, color-mix(in oklab, var(--c) 30%, transparent) 50%, rgba(255, 255, 255, 0.1) 50%); }
.badge.owned.v-masterball { background: linear-gradient(180deg, color-mix(in oklab, var(--c) 34%, transparent) 50%, rgba(255, 255, 255, 0.08) 50%); }
.badge.owned.v-holo { background: linear-gradient(110deg, #9fd7ff33, #f0abfc33, #fde68a33); }
.badge.active { color: #10131c; background: var(--c); border-color: var(--c); box-shadow: 0 0 10px color-mix(in oklab, var(--c) 60%, transparent); }
.badge.active.v-pokeball { background: linear-gradient(180deg, var(--c) 50%, #f4f4f5 50%); }
.badge.active.v-masterball { background: linear-gradient(180deg, var(--c) 50%, #f4f4f5 50%); color: #fff; text-shadow: 0 1px 2px #0008; }
.badge.active.v-holo { background: linear-gradient(110deg, #9fd7ff, #f0abfc, #fde68a); }
button.badge.owned:not(.active):hover { background: color-mix(in oklab, var(--c) 30%, transparent); transform: translateY(-1px); }

/* ============================================================ binder */
.binder-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; }
.turn {
  flex: none; width: 44px; height: 88px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); font-size: 30px; color: var(--muted);
}
.turn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.turn:disabled { opacity: 0.2; cursor: default; }

.binder {
  --pad: clamp(10px, 1.4vw, 20px);
  --gap: clamp(6px, 0.9vw, 12px);
  position: relative;
  perspective: 2200px;
  padding: 14px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, var(--binder2), var(--binder));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 2px 0 rgba(255, 255, 255, 0.05) inset;
}
.binder.spread {
  display: grid; grid-template-columns: 1fr 28px 1fr;
  width: min(1380px, calc(100vw - 150px), max(860px, calc((100svh - 255px) * 1.34)));
}
.binder.single { width: min(560px, calc(100vw - 110px)); }
.page {
  position: relative;
  background: linear-gradient(180deg, #1b1e29, #171a24);
  border-radius: 12px;
  padding: var(--pad);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 8px 18px rgba(0, 0, 0, 0.35);
  backface-visibility: hidden;
}
.page.left { border-radius: 12px 4px 4px 12px; }
.page.right { border-radius: 4px 12px 12px 4px; }
.page.left::after, .page.right::after { content: ''; position: absolute; top: 0; bottom: 0; width: 26px; pointer-events: none; }
.page.left::after { right: 0; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.35)); }
.page.right::after { left: 0; background: linear-gradient(270deg, transparent, rgba(0, 0, 0, 0.35)); }
.page-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.empty-page .page-inner { min-height: 100%; }
.page-no { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 10px; color: rgba(255, 255, 255, 0.22); }
.spine { display: flex; flex-direction: column; justify-content: space-around; align-items: center; padding: 30px 0; }
.spine i { width: 14px; height: 40px; border-radius: 8px; background: linear-gradient(90deg, #6d7180, #d7dae3 45%, #8a8e9c); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }

.pocket { position: relative; display: flex; flex-direction: column; gap: 5px; width: 100%; min-width: 0; cursor: pointer; }
.pocket.blank { cursor: default; }
.sleeve {
  position: relative; width: 100%; aspect-ratio: 63 / 88;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
  perspective: 700px;
}
/* the plastic sleeve gloss */
.sleeve::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 22%, transparent 40%, transparent 70%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 -2px 0 rgba(255, 255, 255, 0.05) inset;
}
.card3d { position: absolute; inset: 3px; transform-style: preserve-3d; }
.card-tilt {
  position: absolute; inset: 0; border-radius: var(--card-r) / calc(var(--card-r) * 63 / 88);
  overflow: hidden; transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, filter 0.3s;
}
.tilting .card-tilt { transition: transform 0.06s linear, box-shadow 0.2s; }
.card-tilt img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }

.pocket.owned .card-tilt { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }
.pocket.owned:hover .card-tilt { box-shadow: 0 14px 28px rgba(0, 0, 0, 0.55); z-index: 2; }
.pocket.owned:hover { z-index: 5; }

/* missing = grayed-out placeholder */
.pocket.missing .card-tilt img { filter: grayscale(1) brightness(0.7) contrast(0.85); opacity: 0.22; transition: opacity 0.25s, filter 0.25s; }
.pocket.missing:hover .card-tilt img { opacity: 0.42; }
.pocket.missing .sleeve { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0 8px, transparent 8px 16px), rgba(0, 0, 0, 0.3); }
.missing-tag {
  position: absolute; inset: auto 0 0 0; padding: 18% 6% 7%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: linear-gradient(0deg, rgba(10, 12, 18, 0.85), transparent);
  color: rgba(255, 255, 255, 0.6); font-size: clamp(9px, 0.85vw, 12px); line-height: 1.2;
}
.missing-tag b { font-size: 1.5em; color: rgba(255, 255, 255, 0.45); }
.missing-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.pocket-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 20px; }
.pnum { font-size: 10.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.badges { display: flex; gap: 3px; flex-wrap: nowrap; overflow: hidden; }
.pocket .badge { height: 17px; min-width: 20px; padding: 0 4px; font-size: 9.5px; border-radius: 5px; }
.pocket[data-variant] .badge { font-size: 9px; padding: 0 5px; }
.pocket.missing .pocket-foot { opacity: 0.85; }

.upgrade-btn {
  position: absolute; z-index: 6; top: -7px; right: -7px;
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #10131c;
  background: linear-gradient(135deg, #ffe08a, #ffb020); color: #2a1800; font-weight: 900; font-size: 14px; line-height: 1;
  box-shadow: 0 4px 12px rgba(255, 176, 32, 0.5);
  animation: nudge 1.8s ease-in-out infinite;
}
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.pocket.just-added .card-tilt { animation: slot-in 1.1s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.pocket.just-added .sleeve::before {
  content: ''; position: absolute; inset: -6px; border-radius: 10px; z-index: 0;
  box-shadow: 0 0 0 2px var(--accent), 0 0 30px var(--accent);
  animation: glow-out 1.1s ease-out forwards;
}
@keyframes slot-in {
  0% { transform: translateY(-40%) scale(1.25) rotate(-4deg); filter: brightness(2); }
  60% { transform: translateY(3%) scale(0.98); filter: brightness(1.2); }
  100% { transform: none; filter: none; }
}
@keyframes glow-out { from { opacity: 1; } to { opacity: 0; } }
.pocket.just-swapped .sleeve::before {
  content: ''; position: absolute; inset: -5px; border-radius: 10px;
  box-shadow: 0 0 0 2px #ffd36e, 0 0 24px #ffd36e;
  animation: glow-out 0.9s ease-out forwards;
}

/* page strip */
.page-strip { display: flex; gap: 3px; justify-content: center; margin: 16px auto 0; max-width: 900px; flex-wrap: wrap; }
.page-strip button {
  width: 30px; height: 12px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; position: relative;
}
.page-strip i { position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 75%, transparent) var(--p), transparent var(--p)); }
.page-strip button.done i { background: #ffd36e; }
.page-strip button.active { outline: 2px solid var(--text); outline-offset: 2px; }
.page-strip button:hover { filter: brightness(1.4); }
.binder-hint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 10px; }

/* page-turn sheet */
.sheet { position: absolute; z-index: 20; transform-style: preserve-3d; pointer-events: none; }
.sheet.from-right { transform-origin: left center; }
.sheet.from-left { transform-origin: right center; }
.sheet-face { position: absolute; inset: 0; backface-visibility: hidden; }
.sheet-face > .page { height: 100%; }
.sheet-face.back { transform: rotateY(180deg); }
.sheet-shade { position: absolute; inset: 0; pointer-events: none; border-radius: 8px; animation: sheet-shade 0.62s ease-in-out; opacity: 0; }
.from-right .sheet-shade { background: linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent 60%); }
.from-left .sheet-shade { background: linear-gradient(270deg, rgba(0, 0, 0, 0.5), transparent 60%); }
@keyframes sheet-shade { 0% { opacity: 0; } 45% { opacity: 1; } 55% { opacity: 0; } 100% { opacity: 0; } }

/* ============================================================ foil finishes */
.foil { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0; transition: opacity 0.3s; }
.owned .foil, .revealed .foil, .detail-card.owned .foil { opacity: 0.35; }
.tilting .foil { opacity: calc(0.45 + var(--hyp, 0) * 0.45); }
.foil-none { display: none; }

/* reverse holo: everything but the art window shines */
.foil-reverse, .foil-pokeball, .foil-masterball {
  -webkit-mask: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) 0 0 / 100% 100% no-repeat, linear-gradient(#000 0 0) 50% 23% / 86% 41% no-repeat;
  mask-composite: exclude;
  -webkit-mask-size: 100% 100%, 86% 41%;
  -webkit-mask-position: 0 0, 50% 23%;
  -webkit-mask-repeat: no-repeat;
}
.foil-reverse {
  background:
    linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.9) calc(var(--mx, 40%) - 5%), transparent calc(var(--mx, 40%) + 18%)),
    repeating-linear-gradient(115deg, #7dd3fc 0 4%, #c4b5fd 8%, #fbcfe8 12%, #a7f3d0 16%, #7dd3fc 20%);
  background-size: 100% 100%, 300% 300%;
  background-position: 0 0, var(--mx, 30%) var(--my, 30%);
}
.foil-pokeball {
  background:
    linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.85) var(--mx, 45%), transparent calc(var(--mx, 45%) + 20%)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cg fill='none' stroke='%23ff6b6b' stroke-width='1.6'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M4 11h4.5M13.5 11H18'/%3E%3Ccircle cx='11' cy='11' r='2.2'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 14% auto,
    linear-gradient(135deg, #fecaca, #fff, #fca5a5);
  opacity: 0.45;
}
.foil-masterball {
  background:
    linear-gradient(115deg, transparent 25%, rgba(255, 220, 255, 0.95) var(--mx, 45%), transparent calc(var(--mx, 45%) + 20%)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cg fill='none' stroke='%23c084fc' stroke-width='1.6'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M4 11h4.5M13.5 11H18'/%3E%3Ccircle cx='11' cy='11' r='2.2'/%3E%3C/g%3E%3Ccircle cx='7.5' cy='7' r='1.4' fill='%23f472b6'/%3E%3Ccircle cx='14.5' cy='7' r='1.4' fill='%23f472b6'/%3E%3C/svg%3E") 0 0 / 14% auto,
    linear-gradient(135deg, #c084fc, #f0abfc, #818cf8, #e879f9);
}
.owned .foil-pokeball, .owned .foil-masterball { opacity: 0.5; }

/* holo rare: the art window shines */
.foil-holo {
  -webkit-mask: linear-gradient(#000 0 0) 50% 23% / 86% 41% no-repeat;
  mask: linear-gradient(#000 0 0) 50% 23% / 86% 41% no-repeat;
  background:
    radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 40%), rgba(255, 255, 255, 0.8) 0%, transparent 45%),
    repeating-linear-gradient(110deg, #f87171 0%, #fbbf24 6%, #a3e635 12%, #22d3ee 18%, #a78bfa 24%, #f472b6 30%, #f87171 36%);
  background-size: 100% 100%, 250% 250%;
  background-position: 0 0, var(--mx, 50%) var(--my, 50%);
}
/* full-art: whole card shines */
.foil-rainbow, .foil-silver, .foil-gold, .foil-bw {
  background-size: 100% 100%, 280% 280%, 100% 100%;
  background-position: 0 0, var(--mx, 50%) var(--my, 50%), 0 0;
}
.foil-rainbow {
  background:
    radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.7) 0%, transparent 50%),
    repeating-linear-gradient(125deg, #ff9a9e 0%, #fad0c4 5%, #fbc2eb 10%, #a1c4fd 15%, #c2e9fb 20%, #d4fc79 25%, #ff9a9e 30%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 3 -1.6'/%3E%3C/filter%3E%3Crect width='60' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
}
.foil-silver {
  background:
    radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.75) 0%, transparent 45%),
    repeating-linear-gradient(135deg, #e5e7eb 0%, #a5b4fc 6%, #f5d0fe 12%, #e5e7eb 18%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.25) 0 1px, transparent 1px 5px);
}
.foil-gold {
  background:
    radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 230, 0.9) 0%, transparent 45%),
    repeating-linear-gradient(120deg, #fde68a 0%, #f59e0b 6%, #fff7d6 12%, #d97706 18%, #fde68a 24%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .5 0 0 0 3 -1.6'/%3E%3C/filter%3E%3Crect width='60' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
}
.foil-bw {
  background:
    radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, 0.95) 0%, transparent 40%),
    repeating-linear-gradient(130deg, #fff 0%, #555 5%, #fff 10%, #999 15%, #fff 20%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 4px);
}
/* gentle ambient sweep on the big hits sitting in the binder */
.pocket.owned:not(.tilting) .foil-rainbow,
.pocket.owned:not(.tilting) .foil-gold,
.pocket.owned:not(.tilting) .foil-bw,
.pocket.owned:not(.tilting) .foil-silver { animation: ambient 7s ease-in-out infinite alternate; }
@keyframes ambient { from { background-position: 0 0, 0% 0%, 0 0; } to { background-position: 0 0, 100% 100%, 0 0; } }
.pocket.owned.finish-rainbow .card-tilt, .pocket.owned.finish-gold .card-tilt, .pocket.owned.finish-bw .card-tilt { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 230, 160, 0.25); }
.less-motion .foil { animation: none !important; }

/* ============================================================ missing list */
.missing { max-width: 1100px; margin: 0 auto; }
.missing-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 6px 0 12px; }
.missing-tools input[type='search'], .missing-tools select, .drawer input[type='search'], .login-box input {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; outline: none;
}
.missing-tools input[type='search'] { flex: 1; min-width: 180px; }
.missing-tools select option { background: var(--panel); }
input:focus, select:focus { border-color: color-mix(in oklab, var(--accent) 70%, transparent) !important; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chips .badge { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; cursor: pointer; }
.check { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.check input { accent-color: var(--accent); }
.missing-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.missing-summary small { display: block; color: var(--muted); font-size: 12px; }
.missing-actions { display: flex; gap: 6px; }
.mlist { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: grid; grid-template-columns: 52px minmax(160px, 1fr) auto; gap: 14px; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.025); border: 1px solid transparent; }
.mrow:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.045); }
.mthumb { padding: 0; border: 0; background: none; width: 52px; aspect-ratio: 63/88; border-radius: 4px; overflow: hidden; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); opacity: 0.55; transition: 0.2s; }
.mthumb.partial img { filter: none; opacity: 0.9; }
.mrow:hover .mthumb img { filter: none; opacity: 1; }
.mname { display: flex; flex-direction: column; min-width: 0; }
.mname span { color: var(--muted); font-size: 13px; }
.mname em { color: var(--accent2); font-style: normal; }
.mvars { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mvar { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); border-radius: 9px; padding: 5px 8px 5px 6px; font-size: 13px; }
.mvar .price { color: var(--muted); font-variant-numeric: tabular-nums; }
.mvar .plus { opacity: 0; width: 0; transition: 0.15s; color: var(--accent); font-weight: 800; }
body.can-edit .mvar:hover { border-color: color-mix(in oklab, var(--accent) 60%, transparent); }
body.can-edit .mvar:hover .plus { opacity: 1; width: 12px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 17px; }
.empty.small { padding: 16px; font-size: 14px; }

/* ============================================================ modal */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 10, 0.72); backdrop-filter: blur(6px); animation: fade 0.2s; }
.modal-box { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); animation: rise 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1); max-height: calc(100svh - 32px); overflow: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal-x { position: absolute; top: 10px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.07); font-size: 22px; line-height: 1; }
.modal-x:hover { background: rgba(255, 255, 255, 0.14); }
.card-modal { display: grid; grid-template-columns: minmax(240px, 360px) minmax(280px, 400px); gap: 28px; padding: 28px; }
.detail-card { position: relative; aspect-ratio: 63/88; perspective: 900px; }
.detail-card .card-tilt { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
.detail-card.missing img { filter: grayscale(1) brightness(0.8); opacity: 0.45; }
.detail-info { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.detail-head small { color: var(--muted); }
.detail-head h2 { margin: 2px 0 8px; font-size: 26px; line-height: 1.15; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.vrows { display: flex; flex-direction: column; gap: 8px; }
.vrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.vrow.own { background: rgba(255, 255, 255, 0.045); }
.vrow.shown { border-color: color-mix(in oklab, var(--accent) 50%, transparent); }
.vrow .badge { min-width: 34px; height: 24px; font-size: 11px; }
.vname { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.vname span { color: var(--muted); font-size: 12.5px; }
.in-binder { font-size: 12px; font-weight: 700; color: var(--accent); padding: 0 6px; }
.detail-nav { display: flex; justify-content: space-between; margin-top: auto; }

.login-box { padding: 28px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.login-box h2 { margin: 0; }
.login-box p { margin: 0; color: var(--muted); font-size: 14px; }
.login-err { color: #ff8a8a; font-size: 13px; min-height: 1em; }

/* ============================================================ drawer */
.drawer {
  position: fixed; z-index: 150; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  padding: 20px; overflow: auto; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; }
.drawer-head .modal-x { position: static; }
.drawer-tip { color: var(--muted); font-size: 13.5px; margin: 6px 0 12px; }
.drawer-set { display: flex; gap: 6px; margin-bottom: 10px; }
.drawer-set button { flex: 1; border: 1px solid var(--line); background: none; border-radius: 9px; padding: 7px; color: var(--muted); font-weight: 600; font-size: 13px; }
.drawer-set button.active { color: var(--text); border-color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }
.drawer input[type='search'] { width: 100%; font-size: 17px; padding: 11px 14px; }
.drawer-results { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 18px; }
.dres { display: flex; gap: 12px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.dres img { width: 64px; aspect-ratio: 63/88; object-fit: cover; border-radius: 4px; cursor: pointer; }
.dres-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dres-info span { color: var(--muted); font-size: 12.5px; }
.dres-vars { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.dres-vars .badge { height: 28px; padding: 0 9px; font-size: 11.5px; cursor: pointer; border-style: solid; border-color: color-mix(in oklab, var(--c) 45%, transparent); color: var(--c); }
.dres-vars .badge:not(.owned):hover, .dres-vars .badge:focus-visible { background: var(--c); color: #10131c; outline: none; }
.dres-vars .badge.owned { opacity: 0.6; cursor: default; }
.drawer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 10px 0 8px; }
.recent { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.recent-item { position: relative; padding: 0; border: 0; background: none; }
.recent-item img { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 4px; display: block; }
.recent-item .badge { position: absolute; bottom: 3px; right: 3px; height: 15px; min-width: 18px; font-size: 8.5px; padding: 0 3px; }

/* ============================================================ toasts */
.toasts { position: fixed; z-index: 300; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: #23283a; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); animation: rise 0.22s; font-size: 14px; max-width: calc(100vw - 32px); }
.toast.error { border-color: #ff8a8a66; }
.toast.out { opacity: 0; transform: translateY(8px); transition: 0.25s; }

/* ============================================================ celebration */
.celebrate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; cursor: pointer; user-select: none; }
.celebrate.closing { opacity: 0; transition: opacity 0.35s; }
.cb-backdrop { position: absolute; inset: 0; background: radial-gradient(circle at 50% 44%, rgba(10, 12, 20, 0.55), rgba(3, 4, 8, 0.92)); opacity: 0; transition: opacity 0.4s; }
.celebrate.in .cb-backdrop { opacity: calc(0.55 + var(--tier) * 0.06); }
.cb-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cb-rays {
  --ray: rgba(255, 255, 255, 0.12);
  position: absolute; left: 50%; top: 44%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, var(--ray) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 38%);
  mask: radial-gradient(circle, #000 0%, transparent 38%);
  opacity: 0; transform: scale(0.4) rotate(0deg); transition: opacity 0.6s, transform 1.2s cubic-bezier(0.2, 0.9, 0.3, 1);
  animation: spin 24s linear infinite;
}
.celebrate.revealed .cb-rays { opacity: 1; transform: scale(1); }
.tier-pop .cb-rays, .tier-shimmer .cb-rays { display: none; }
.tier-holo .cb-rays { --ray: rgba(165, 243, 252, 0.1); }
.tier-pokeball .cb-rays { --ray: rgba(255, 90, 90, 0.18); }
.tier-ex .cb-rays { --ray: rgba(255, 200, 60, 0.22); }
.tier-ultra .cb-rays { --ray: rgba(220, 225, 255, 0.22); }
.tier-masterball .cb-rays { --ray: rgba(190, 110, 255, 0.28); }
.tier-sir .cb-rays { background: repeating-conic-gradient(from 0deg, #f472b655 0 5deg, transparent 5deg 12deg, #60a5fa55 12deg 17deg, transparent 17deg 24deg, #fbbf2455 24deg 29deg, transparent 29deg 36deg); }
.tier-legend .cb-rays { background: repeating-conic-gradient(from 0deg, #ffffff55 0 7deg, transparent 7deg 14deg, #fbbf2444 14deg 21deg, transparent 21deg 28deg); animation-duration: 14s; }
@keyframes spin { to { rotate: 360deg; } }
.cb-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.celebrate.revealed:not(.tier-pop):not(.tier-shimmer):not(.tier-holo) .cb-flash { animation: flash 0.6s ease-out; }
.tier-masterball.revealed .cb-flash { background: #e9d5ff; }
.tier-legend.revealed .cb-flash { animation: flash-bw 0.9s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes flash-bw { 0% { opacity: 1; background: #fff; } 30% { opacity: 1; background: #000; } 60% { opacity: 0.8; background: #fff; } 100% { opacity: 0; } }

.cb-stage { position: relative; width: min(300px, 58vw, 42svh); aspect-ratio: 63/88; perspective: 1400px; translate: 0 -5svh; }
.cb-card { position: absolute; inset: 0; transform-style: preserve-3d; opacity: 0; transform: scale(0.5) translateY(30px); transition: opacity 0.35s, transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.celebrate.in .cb-card { opacity: 1; transform: none; }
.cb-face { position: absolute; inset: 0; border-radius: 4.5% / 3.2%; overflow: hidden; backface-visibility: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
.cb-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cb-front .foil { opacity: 0.28; animation: sweep 2.4s ease-in-out 0.3s infinite alternate; }
@keyframes sweep { from { background-position: 0 0, 0% 0%, 0 0; } to { background-position: 0 0, 100% 100%, 0 0; } }
.cb-back { transform: rotateY(180deg); }
.cardback {
  position: absolute; inset: 0; border: 7px solid #e8e4da; border-radius: inherit;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in oklab, var(--accent) 70%, #fff) 0 9%, #10131c 9.5% 12%, transparent 12.5%),
    radial-gradient(circle at 50% 50%, transparent 0 26%, rgba(255, 255, 255, 0.14) 26.5% 27.5%, transparent 28%),
    repeating-conic-gradient(from 0deg at 50% 50%, #1d2a6b 0 10deg, #24348a 10deg 20deg),
    #1d2a6b;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}
/* flip reveal */
.cb-card.face-down { transform: rotateY(-180deg) scale(0.6); }
.celebrate.in .cb-card.face-down { transform: rotateY(-180deg); }
.celebrate.suspense .cb-card.face-down { animation: suspense 0.6s ease-in-out infinite; }
.celebrate.suspense .cb-back { box-shadow: 0 0 40px color-mix(in oklab, var(--accent) 70%, transparent), 0 30px 80px rgba(0, 0, 0, 0.7); }
.tier-sir.suspense .cb-back, .tier-legend.suspense .cb-back { box-shadow: 0 0 60px #fde68a, 0 0 120px #f472b6; }
@keyframes suspense { 0%, 100% { translate: 0 0; } 25% { translate: -3px 1px; } 75% { translate: 3px -1px; } }
.celebrate.revealed .cb-card.face-down { animation: none; transform: rotateY(0deg) scale(1.04); transition: transform 0.9s cubic-bezier(0.3, 1.4, 0.4, 1); }

/* ball catch */
.cb-ball { position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 1; margin: -23% 0 0 -23%; z-index: 3; opacity: 0; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.6)); }
.cb-ball svg { width: 100%; height: 100%; display: block; }
.tier-pokeball .cb-card, .tier-masterball .cb-card { opacity: 0 !important; transform: scale(0.15) !important; }
.ball-drop .cb-ball { animation: ball-drop 0.6s cubic-bezier(0.3, 0, 0.6, 1) forwards, wobble 1.05s ease-in-out 0.65s; }
@keyframes ball-drop {
  0% { opacity: 1; transform: translateY(-70svh) rotate(-200deg); }
  70% { transform: translateY(0) rotate(0); }
  85% { transform: translateY(-8%); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes wobble {
  0%, 30%, 60%, 100% { opacity: 1; rotate: 0deg; }
  10% { rotate: -22deg; } 20% { rotate: 14deg; }
  40% { rotate: -22deg; } 50% { rotate: 14deg; }
  70% { rotate: -22deg; } 80% { rotate: 14deg; }
}
.ball-open .cb-ball { animation: ball-open 0.45s ease-out forwards; }
@keyframes ball-open { 0% { opacity: 1; transform: scale(1); filter: brightness(1); } 40% { filter: brightness(3); } 100% { opacity: 0; transform: scale(2.2); filter: brightness(4); } }
.tier-pokeball.revealed .cb-card, .tier-masterball.revealed .cb-card { opacity: 1 !important; transform: none !important; transition: opacity 0.3s, transform 0.7s cubic-bezier(0.25, 1.5, 0.4, 1); }

/* light tiers */
.tier-pop .cb-card, .tier-shimmer .cb-card, .tier-holo .cb-card { transition: opacity 0.25s, transform 0.55s cubic-bezier(0.25, 1.6, 0.4, 1); }
.tier-shimmer .cb-front::after, .tier-holo .cb-front::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.75) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 1.1s ease-in-out 0.35s;
}
@keyframes shine { to { transform: translateX(120%); } }

/* big tiers: glow halo */
.tier-ex .cb-front, .tier-ultra .cb-front, .tier-masterball .cb-front, .tier-sir .cb-front, .tier-legend .cb-front { box-shadow: 0 0 60px var(--halo, #fde68a99), 0 30px 80px rgba(0, 0, 0, 0.7); }
.tier-ultra { --halo: #c7d2fe99; }
.tier-masterball { --halo: #c084fcbb; }
.tier-sir { --halo: #f9a8d4aa; }
.tier-legend { --halo: #ffffffbb; }

.shake .cb-stage { animation: shake 0.5s; }
.shake-small .cb-stage { animation: shake 0.35s; }
@keyframes shake {
  0%, 100% { transform: none; }
  15% { transform: translate(-10px, 4px) rotate(-1deg); } 30% { transform: translate(9px, -5px) rotate(1deg); }
  45% { transform: translate(-7px, 3px); } 60% { transform: translate(5px, -2px); } 80% { transform: translate(-2px, 1px); }
}

.cb-title { position: absolute; left: 0; right: 0; bottom: max(7svh, 40px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; transform: translateY(20px); transition: 0.5s 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); pointer-events: none; padding: 0 16px; }
.celebrate.revealed .cb-title { opacity: 1; transform: none; }
.cb-title small { color: rgba(255, 255, 255, 0.7); font-size: 13px; letter-spacing: 0.5px; }
.cb-title strong { font-size: clamp(28px, 6vw, 54px); font-weight: 900; letter-spacing: -0.5px; line-height: 1.05; background: linear-gradient(180deg, #fff, #cbd5e1); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.6)); }
.tier-pokeball .cb-title strong { background-image: linear-gradient(180deg, #fff 30%, #fca5a5); }
.tier-ex .cb-title strong { background-image: linear-gradient(180deg, #fff7d6, #fbbf24); }
.tier-ultra .cb-title strong { background-image: linear-gradient(180deg, #fff, #a5b4fc); }
.tier-masterball .cb-title strong { background-image: linear-gradient(180deg, #f5d0fe, #a855f7); }
.tier-sir .cb-title strong { background-image: linear-gradient(90deg, #f472b6, #fbbf24, #34d399, #60a5fa, #a78bfa); }
.tier-legend .cb-title strong { background-image: linear-gradient(90deg, #fff, #9ca3af, #fff, #fbbf24, #fff); background-size: 200% 100%; animation: slide-bg 2s linear infinite; }
@keyframes slide-bg { to { background-position: 200% 0; } }
.cb-title span { font-size: 16px; font-weight: 600; }
.cb-title em { color: rgba(255, 255, 255, 0.6); font-style: normal; }
.cb-skip { position: absolute; bottom: 14px; font-size: 12px; color: rgba(255, 255, 255, 0.4); }
.celebrate.reduced .cb-card { transition: opacity 0.3s; transform: none !important; }
.celebrate.reduced .cb-rays, .celebrate.reduced .cb-ball { display: none; }

/* ============================================================ responsive */
@media (max-width: 979px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .brand span { display: none; }
  .set-tabs { order: 3; flex-basis: 100%; }
  .top-actions { margin-left: auto; }
  .set-hero { padding: 14px 16px 2px; gap: 16px; }
  .hero-variants { margin-left: 0; display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; gap: 8px; }
  .vstat { flex-direction: column; align-items: stretch; gap: 3px; font-size: 12px; }
  .vstat div { min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; }
  .vstat i { flex-basis: 100%; }
  .viewbar { padding: 10px 16px; }
  .card-modal { grid-template-columns: 1fr; padding: 20px; }
  .detail-card { width: min(260px, 70vw); margin: 0 auto; }
  .mrow { grid-template-columns: 44px 1fr; }
  .mthumb { width: 44px; }
  .mvars { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 600px) {
  .binder-wrap { gap: 0; }
  .turn { display: none; }
  .binder.single { width: calc(100vw - 20px); padding: 8px; border-radius: 16px; }
  .binder { --pad: 8px; --gap: 6px; }
  .pocket .badge { min-width: 16px; padding: 0 3px; font-size: 8.5px; height: 15px; }
  .pnum { font-size: 9px; }
  .hero-rings { gap: 14px; width: 100%; }
  .ring svg { width: 46px; height: 46px; }
  .ring-text { width: 46px; font-size: 11.5px; }
  .ring-label strong { font-size: 13px; }
  .ring-label span { font-size: 11.5px; }
  .hero-meta span:first-child { font-size: 16px; }
  .viewbar { flex-wrap: nowrap; gap: 6px; }
  .seg button { padding: 6px 10px; font-size: 13px; }
  .seg.small button { padding: 5px 8px; font-size: 12px; }
  .set-logo { height: 42px; }
  .mlabel { display: none; }
  #packBtn { padding: 8px 10px; }
}

/* ============================================================ print (missing list) */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .viewbar, .set-hero, .missing-tools, .missing-actions, .toasts { display: none !important; }
  .mrow { break-inside: avoid; border: 0; border-bottom: 1px solid #ddd; border-radius: 0; background: none; }
  .mthumb img { filter: none; opacity: 1; }
  .mname span, .mvar .price { color: #333; }
  .mvar { border-color: #ccc; }
  .badge { color: #000 !important; border-color: #000 !important; }
  .missing-summary { background: none; border: 1px solid #ccc; }
}
