/* ============================================================
   CATI RIPS — dark, high-contrast, neon/holo pack-opener UI
   ============================================================ */

:root {
  --bg: #05060a;
  --bg-2: #0b0d15;
  --panel: #12141d;
  --panel-2: #171a25;
  --line: #262a38;
  --text: #eef1f8;
  --muted: #9aa4b2;
  --accent: #b45cff;
  --accent-2: #2fa7ff;

  --r-common: #9aa4b2;
  --r-uncommon: #3ddc84;
  --r-rare: #2fa7ff;
  --r-epic: #b45cff;
  --r-legendary: #ffb31a;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(180, 92, 255, 0.16), transparent 60%),
    radial-gradient(1100px 700px at 100% 0%, rgba(47, 167, 255, 0.14), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Sora", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: "Space Grotesk", "Sora", sans-serif; letter-spacing: -0.02em; }
button { font-family: inherit; cursor: pointer; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------------- Buttons ---------------- */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 30px rgba(180, 92, 255, 0.35);
}
.btn--primary:hover { box-shadow: 0 14px 40px rgba(180, 92, 255, 0.5); }
.btn--ghost { background: transparent; }
.btn--danger { border-color: #ff5470; color: #ff92a5; }
.btn--lg { padding: 16px 30px; font-size: 17px; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  width: 100%;
}
.input--sm { padding: 7px 10px; font-size: 13px; width: auto; }
.input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.pill {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ---------------- Age gate ---------------- */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(900px 600px at 50% 0%, rgba(180, 92, 255, 0.18), transparent), var(--bg);
}
.age-gate__card {
  max-width: 460px;
  width: 100%;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.age-gate__logo { font-family: "Space Grotesk"; font-weight: 700; font-size: 22px; letter-spacing: 4px; color: var(--muted); }
.age-gate__logo span { color: var(--accent); }
.age-gate__card h1 { font-size: 30px; margin: 16px 0 10px; }
.age-gate__card p { color: var(--muted); line-height: 1.6; font-size: 15px; }
.age-gate__actions { display: flex; gap: 12px; justify-content: center; margin: 22px 0 14px; flex-wrap: wrap; }
.age-gate__remember { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

/* ---------------- App shell ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(5, 6, 10, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: "Space Grotesk";
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  background: none;
  border: none;
  color: var(--text);
}
.brand span { color: var(--accent); }
.topnav { display: flex; gap: 6px; margin-left: auto; }
.navbtn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.navbtn:hover { color: var(--text); background: var(--panel); }
.navbtn.is-active { color: #fff; background: var(--panel-2); border-color: var(--line); }
.stripe-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.stripe-badge--demo { color: #ffce6b; border-color: rgba(255, 179, 26, 0.5); background: rgba(255, 179, 26, 0.08); }
.stripe-badge--test { color: #9ecbff; border-color: rgba(100, 180, 255, 0.5); background: rgba(100, 180, 255, 0.08); }
.stripe-badge--live { color: #7dffb0; border-color: rgba(61, 220, 132, 0.5); background: rgba(61, 220, 132, 0.08); }

.main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 26px 18px 60px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 22px; border-top: 1px solid var(--line); }
.footer__link { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(154, 164, 178, 0.35); }
.footer__link:hover { color: var(--text); border-bottom-color: var(--accent); }

.hero { text-align: center; margin: 10px 0 26px; }
.hero__title { font-size: clamp(30px, 7vw, 52px); margin: 0 0 8px; }
.hero__sub { color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.6; }

/* ---------------- Pack cards ---------------- */
.packs {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.pack {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  padding: 20px;
  overflow: hidden;
  isolation: isolate;
}
.pack::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 200px at 50% -10%, var(--pack-accent, var(--accent)), transparent 70%);
  opacity: 0.18;
  z-index: -1;
}
.pack__art {
  height: 190px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, var(--pack-accent, var(--accent)), #05060a 85%);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
}
.pack__art::after {
  content: "";
  position: absolute;
  inset: -40% -10%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  transform: translateX(-30%);
  animation: sheen 4.5s ease-in-out infinite;
}
.pack__art-label { font-family: "Space Grotesk"; font-weight: 800; font-size: 26px; text-shadow: 0 2px 20px rgba(0,0,0,0.6); letter-spacing: 1px; z-index: 1; position: relative; }
.pack__art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.92;
}
.pack__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  backdrop-filter: blur(6px);
}
@keyframes sheen { 0%, 65% { transform: translateX(-60%); } 100% { transform: translateX(160%); } }

/* Branded pack themes (placeholder until custom art) */
.pack--theme-classic .pack__art {
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #2fa7ff, #05060a 85%);
}
.pack--theme-spicy-warrior .pack__art {
  background:
    radial-gradient(120px 80px at 20% 80%, rgba(255,80,120,0.35), transparent 70%),
    linear-gradient(145deg, #ff4d8d 0%, #b45cff 45%, #05060a 90%);
}
.pack--theme-spicy-warrior .pack__badge {
  background: linear-gradient(135deg, #ff4d8d, #b45cff);
  border-color: rgba(255,255,255,0.35);
}
.pack--theme-diamond-chase .pack__art {
  background:
    radial-gradient(140px 100px at 75% 20%, rgba(255,215,0,0.4), transparent 70%),
    linear-gradient(155deg, #ffd700 0%, #b8860b 35%, #05060a 88%);
}
.pack--theme-diamond-chase .pack__badge {
  background: linear-gradient(135deg, #ffd700, #b8860b);
  color: #1a1200;
  border-color: rgba(255,255,255,0.4);
}
.pack--theme-nsfw .pack__art {
  background:
    radial-gradient(100px 100px at 50% 30%, rgba(255,60,100,0.45), transparent 70%),
    linear-gradient(160deg, #ff2060, #05060a 85%);
}
.pack--theme-nsfw .pack__badge {
  background: #ff2060;
  border-color: rgba(255,255,255,0.3);
}

.pack__name { font-size: 22px; margin: 0; }
.pack__tag { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.pack__price { font-family: "Space Grotesk"; font-weight: 800; font-size: 30px; }
.pack__price small { font-size: 14px; color: var(--muted); font-weight: 500; }

.odds { margin: 14px 0; border-top: 1px dashed var(--line); padding-top: 12px; }
.odds__title { font-size: 12px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.odds__row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.odds__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.odds__name { width: 84px; flex: none; }
.odds__bar { flex: 1; height: 7px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.odds__bar > i { display: block; height: 100%; border-radius: 999px; }
.odds__pct { width: 52px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.pack .btn { width: 100%; margin-top: 6px; }

/* ---------------- Rip stage ---------------- */
.rip-stage { min-height: 68vh; display: grid; place-items: center; text-align: center; position: relative; }
.rip-wrap { display: grid; place-items: center; gap: 22px; width: 100%; }

.wrapper {
  --accent: var(--pack-accent, var(--accent));
  width: min(300px, 78vw);
  aspect-ratio: 3 / 4.2;
  border-radius: 20px;
  position: relative;
  cursor: grab;
  user-select: none;
  touch-action: none;
  background:
    repeating-linear-gradient(120deg, rgba(255,255,255,0.06) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, var(--pack-accent, #b45cff), #0a0b12 92%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 40px rgba(0,0,0,0.4);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.wrapper:active { cursor: grabbing; }
.wrapper__sheen {
  position: absolute; inset: -30%;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,0.4) 50%, transparent 58%);
  animation: sheen 3.5s ease-in-out infinite;
}
.wrapper__logo {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px;
}
.wrapper__logo b { font-family: "Space Grotesk"; font-size: 30px; letter-spacing: 3px; text-shadow: 0 3px 24px rgba(0,0,0,0.7); }
.wrapper__logo span { font-size: 13px; letter-spacing: 5px; color: rgba(255,255,255,0.75); }
.wrapper__tearline {
  position: absolute; top: 16%; left: 0; right: 0; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.85) 0 6px, transparent 6px 12px);
  opacity: 0.7;
}
.wrapper__hint {
  position: absolute; bottom: 14px; left: 0; right: 0; text-align: center;
  font-size: 12px; letter-spacing: 3px; color: rgba(255,255,255,0.85);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

.wrapper__foil {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 40%, rgba(255,255,255,0.12) 60%, transparent 100%);
  mix-blend-mode: overlay;
  pointer-events: none;
}
.wrapper__crinkle {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(255,255,255,0.03) 8px 9px);
  opacity: 0.6;
  pointer-events: none;
}
.wrapper.is-torn .wrapper__peel-top { animation: peelTop 0.75s cubic-bezier(.4,0,.2,1) forwards; }
.wrapper.is-torn .wrapper__peel-bottom { animation: peelBottom 0.75s cubic-bezier(.4,0,.2,1) forwards; }
.wrapper__peel-top, .wrapper__peel-bottom {
  position: absolute; left: 0; right: 0;
  background:
    repeating-linear-gradient(120deg, rgba(255,255,255,0.06) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, var(--pack-accent, #b45cff), #0a0b12 92%);
}
.wrapper__peel-top {
  top: 0; height: 18%;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 92% 100%, 84% 82%, 76% 100%, 68% 84%, 60% 100%, 52% 83%, 44% 100%, 36% 85%, 28% 100%, 20% 82%, 12% 100%, 4% 84%, 0 100%);
  border-bottom: 2px dashed rgba(255,255,255,0.5);
}
.wrapper__peel-bottom { top: 18%; bottom: 0; }
.wrapper__shred {
  position: absolute; top: 16%; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(90deg, #fff 0 4px, transparent 4px 8px);
  opacity: 0.5;
  animation: shredFade 0.6s ease-out forwards;
}
@keyframes peelTop { to { transform: translateY(-160%) rotate(-12deg) scale(1.05); opacity: 0; } }
@keyframes peelBottom { to { transform: translateY(160%) rotate(8deg) scale(1.02); opacity: 0; } }
@keyframes shredFade { to { opacity: 0; transform: scaleX(1.2); } }

.rip-title { font-size: clamp(22px, 5vw, 34px); margin: 0; }
.rip-sub { color: var(--muted); margin: 0; }

/* Reveal fan */
.reveal-fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  perspective: 1400px;
  min-height: 360px;
}
.rcard {
  --glow: #9aa4b2;
  width: min(180px, 40vw);
  aspect-ratio: 3 / 4.2;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), box-shadow 0.4s;
  cursor: pointer;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(30px) scale(0.9);
  perspective: 900px;
}
.rcard.is-in { opacity: 1; transform: translateY(0) scale(1); }
.rcard__inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(.2,.8,.2,1); }
.rcard.is-flipped .rcard__inner { transform: rotateY(180deg); }
.rcard__face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.rcard__back {
  background:
    repeating-linear-gradient(120deg, rgba(255,255,255,0.06) 0 12px, transparent 12px 24px),
    linear-gradient(160deg, #2a2d3d, #0a0b12);
  display: grid; place-items: center;
}
.rcard__back b { font-family: "Space Grotesk"; letter-spacing: 3px; color: rgba(255,255,255,0.5); }
.rcard__front { transform: rotateY(180deg); background: #05060a; }
.rcard__front img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.rcard.is-flipped { box-shadow: 0 0 0 2px var(--glow), 0 0 40px var(--glow); }
.rcard__badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 4px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.6); border: 1px solid var(--glow); color: var(--glow);
}
.rcard__value {
  position: absolute; bottom: 8px; right: 8px; z-index: 3;
  font-size: 10px; font-weight: 800; letter-spacing: 0.3px; padding: 4px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.72); border: 1px solid rgba(255, 212, 121, 0.45); color: #ffd479;
}
.rcard.rarity-diamond_rare.is-flipped.is-flashy,
.rcard.rarity-epic.is-flipped.is-flashy,
.rcard.rarity-legendary.is-flipped.is-flashy,
.rcard.rarity-ssr.is-flipped.is-flashy { animation: floaty 3s ease-in-out infinite; }
.rcard.is-ssr.is-flipped { box-shadow: 0 0 0 3px #ffd700, 0 0 60px #e8b4ff, 0 0 100px rgba(255,215,0,0.4); }
.rcard__ssr-burst {
  position: absolute; inset: -20%; z-index: 0;
  background: radial-gradient(circle, rgba(255,215,0,0.5) 0%, rgba(180,92,255,0.3) 40%, transparent 70%);
  animation: ssrBurst 1.8s ease-out infinite;
  pointer-events: none;
}
.rcard.ssr-reveal-active .rcard__ssr-burst { animation: ssrBurstPop 1.4s ease-out; }
@keyframes ssrBurst { 0%,100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.08); } }
@keyframes ssrBurstPop { 0% { opacity: 0; transform: scale(0.5); } 30% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0.5; transform: scale(1); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---- Per-card holographic foil (is-holographic) ---- */
.is-holographic {
  --holo-x: 0.5;
  --holo-y: 0.5;
  --holo-tilt-x: 0deg;
  --holo-tilt-y: 0deg;
  transform-style: preserve-3d;
}
.rcard.is-holographic.is-in {
  transform: translateY(0) scale(1) rotateX(var(--holo-tilt-x)) rotateY(var(--holo-tilt-y));
}
.vcard.is-holographic,
.modal__card.is-holographic {
  transform: rotateX(var(--holo-tilt-x)) rotateY(var(--holo-tilt-y));
}

.holo-stack {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
  mix-blend-mode: color-dodge;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.is-holographic.is-flipped .holo-stack,
.vcard.is-holographic .holo-stack,
.modal__card.is-holographic .holo-stack {
  opacity: 1;
}

.holo-foil {
  position: absolute;
  inset: -50%;
  background:
    conic-gradient(
      from calc(var(--holo-x) * 360deg) at calc(var(--holo-x) * 100%) calc(var(--holo-y) * 100%),
      #ff6b6b 0deg,
      #ffd93d 55deg,
      #6bff95 110deg,
      #6bc5ff 165deg,
      #b46bff 220deg,
      #ff6bd4 275deg,
      #ff6b6b 360deg
    );
  opacity: 0.42;
  filter: blur(1px) saturate(1.35);
  animation: holoFoilShift 5s linear infinite;
}
.holo-sparkle {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at calc(var(--holo-x) * 100%) calc(var(--holo-y) * 100%), rgba(255,255,255,0.85) 0%, transparent 28%),
    repeating-linear-gradient(
      125deg,
      transparent 0 3px,
      rgba(255,255,255,0.12) 3px 4px,
      transparent 4px 11px
    );
  background-size: 100% 100%, 220% 220%;
  opacity: 0.55;
  animation: holoSparkleDrift 3.2s ease-in-out infinite;
}
.holo-glare {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255,255,255,0.65) 48%,
    rgba(180,220,255,0.45) 52%,
    transparent 65%
  );
  background-size: 280% 280%;
  background-position: calc(var(--holo-x) * 100%) calc(var(--holo-y) * 100%);
  mix-blend-mode: soft-light;
  opacity: 0.7;
}

@keyframes holoFoilShift {
  0% { transform: translate(-8%, -6%) rotate(0deg) scale(1.1); }
  50% { transform: translate(6%, 8%) rotate(180deg) scale(1.15); }
  100% { transform: translate(-8%, -6%) rotate(360deg) scale(1.1); }
}
@keyframes holoSparkleDrift {
  0%, 100% { background-position: calc(var(--holo-x) * 100%) calc(var(--holo-y) * 100%), 0% 0%; }
  50% { background-position: calc(var(--holo-x) * 100%) calc(var(--holo-y) * 100%), 100% 100%; }
}

/* Extra shimmer burst on pack reveal */
.holo-reveal-burst .holo-stack { opacity: 1; }
.holo-reveal-burst .holo-foil { animation: holoRevealPop 1.2s ease-out; opacity: 0.75; }
.holo-reveal-burst .holo-sparkle { animation: holoRevealSparkle 1.2s ease-out; opacity: 0.95; }
@keyframes holoRevealPop {
  0% { transform: scale(0.6); opacity: 0; filter: blur(6px) saturate(2); }
  35% { transform: scale(1.25); opacity: 1; filter: blur(0) saturate(1.8); }
  100% { transform: scale(1.1); opacity: 0.42; filter: blur(1px) saturate(1.35); }
}
@keyframes holoRevealSparkle {
  0% { opacity: 0; transform: scale(0.8); }
  25% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.55; transform: scale(1); }
}

.holo-tag {
  font-size: 0.65em;
  letter-spacing: 2px;
  color: #ffe08a;
  vertical-align: middle;
}
.ssr-tag {
  font-size: 0.65em;
  letter-spacing: 2px;
  color: #ffd700;
  vertical-align: middle;
  text-shadow: 0 0 12px #e8b4ff;
}

/* Gold holographic variant */
.holo-gold .holo-foil {
  background:
    conic-gradient(
      from calc(var(--holo-x) * 360deg) at calc(var(--holo-x) * 100%) calc(var(--holo-y) * 100%),
      #fff8dc 0deg,
      #ffd700 45deg,
      #ffb31a 90deg,
      #ffe08a 135deg,
      #ffffff 180deg,
      #ffd700 225deg,
      #c9a227 270deg,
      #fff8dc 360deg
    );
  opacity: 0.55;
  filter: blur(0.5px) saturate(1.6) brightness(1.15);
}
.holo-gold .holo-sparkle {
  background:
    radial-gradient(circle at calc(var(--holo-x) * 100%) calc(var(--holo-y) * 100%), rgba(255,248,220,0.95) 0%, transparent 32%),
    repeating-linear-gradient(125deg, transparent 0 4px, rgba(255,215,0,0.18) 4px 5px, transparent 5px 12px);
}
.holo-gold.is-holographic { border-color: rgba(255, 215, 0, 0.55); }

.reveal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.reveal-actions .btn--quick { order: -1; }
.reveal-tap-hint { color: var(--muted); font-size: 14px; letter-spacing: 1px; animation: pulse 1.6s ease-in-out infinite; }
.rcard.is-flipped.is-expandable { cursor: zoom-in; }
.rcard.is-flipped.is-expandable:hover { transform: translateY(-4px) scale(1.03); }

.btn--quick {
  background: linear-gradient(135deg, #ff6bd4 0%, #b45cff 45%, #2fa7ff 100%);
  border: none;
  color: #fff;
  box-shadow: 0 10px 34px rgba(255, 107, 212, 0.42), 0 0 24px rgba(180, 92, 255, 0.25);
  animation: quickRipPulse 2.6s ease-in-out infinite;
}
.btn--quick:hover {
  box-shadow: 0 14px 42px rgba(255, 107, 212, 0.55), 0 0 32px rgba(47, 167, 255, 0.35);
}
@keyframes quickRipPulse {
  0%, 100% { box-shadow: 0 10px 34px rgba(255, 107, 212, 0.42), 0 0 24px rgba(180, 92, 255, 0.25); }
  50% { box-shadow: 0 14px 44px rgba(255, 107, 212, 0.58), 0 0 36px rgba(47, 167, 255, 0.4); }
}

/* Screen shake for big pulls */
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%,90% { transform: translate(-2px, 0); }
  20%,80% { transform: translate(4px, 0); }
  30%,50%,70% { transform: translate(-8px, 0); }
  40%,60% { transform: translate(8px, 0); }
}

/* Particle canvas overlay */
#fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* Flash overlay for legendary */
.flash { position: fixed; inset: 0; background: #fff; z-index: 55; pointer-events: none; opacity: 0; }
.flash.go { animation: flash 0.6s ease-out; }
@keyframes flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }

/* ---------------- Vault ---------------- */
.vault-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.vault-head h1 { margin: 0; }
.vault-head__actions { display: flex; gap: 10px; align-items: center; }
.vault-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.vcard {
  --glow: #9aa4b2;
  border-radius: 14px; overflow: hidden; position: relative; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); aspect-ratio: 3 / 4.2;
  transition: transform 0.15s, box-shadow 0.2s;
  transform-style: preserve-3d;
}
.vcard:hover { transform: translateY(-3px) rotateX(var(--holo-tilt-x, 0deg)) rotateY(var(--holo-tilt-y, 0deg)); box-shadow: 0 0 0 1px var(--glow), 0 10px 30px rgba(0,0,0,0.5); }
.vcard__art { position: absolute; inset: 0; }
.vcard__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard.is-holographic { border-color: rgba(255, 224, 138, 0.45); }
.vcard__holo-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-size: 9px; font-weight: 800; letter-spacing: 1px; padding: 2px 6px; border-radius: 999px;
  background: rgba(0,0,0,0.75); border: 1px solid #ffe08a; color: #ffe08a;
}
.vcard__ssr-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  font-size: 9px; font-weight: 800; letter-spacing: 1px; padding: 2px 6px; border-radius: 999px;
  background: rgba(0,0,0,0.8); border: 1px solid #ffd700; color: #ffd700;
  box-shadow: 0 0 12px rgba(232,180,255,0.5);
}
.vcard__meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.vcard__name { font-size: 13px; font-weight: 700; }
.vcard__row { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.vcard__rar { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--glow); text-transform: uppercase; }
.vcard__val { font-size: 12px; color: #ffd479; font-weight: 700; }
.vcard__qty { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.7); border: 1px solid var(--glow); color: var(--glow); font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.vault-empty { text-align: center; color: var(--muted); padding: 60px 20px; grid-column: 1 / -1; }

/* ---------------- Admin ---------------- */
.admin { display: grid; gap: 22px; }
.admin h1 { margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h2 { margin: 0 0 4px; font-size: 18px; }
.panel .hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); font-size: 12px; }
.admin-table td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table .thumb { width: 34px; height: 46px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: var(--bg-2); }
.admin-table input, .admin-table select { padding: 6px 8px; font-size: 13px; }
.rarity-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.rarity-chip--hidden { background: rgba(255,100,100,0.15); color: #ff8a8a; margin-left: 4px; }
.rarity-chip--ssr { background: rgba(255,215,0,0.15); color: #ffd700; margin-left: 4px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.weight-rows { display: grid; gap: 10px; }
.weight-row { display: grid; grid-template-columns: 120px 1fr 70px; gap: 10px; align-items: center; }
.pack-editor { display: grid; gap: 10px; }
.pack-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; align-items: center; }

/* ---------------- Modal / lightbox ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
.modal:not([hidden]) {
  pointer-events: auto;
}
.modal--open {
  opacity: 1;
}
.modal--closing {
  opacity: 0;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 3, 8, 0.88);
  backdrop-filter: blur(10px);
}
.modal__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(520px 420px at 50% 42%, var(--glow, rgba(180, 92, 255, 0.35)), transparent 68%);
  opacity: 0.55;
  transition: opacity 0.4s ease;
}
.modal--ssr .modal__glow {
  background:
    radial-gradient(560px 480px at 50% 40%, rgba(255, 215, 0, 0.35), transparent 62%),
    radial-gradient(420px 360px at 50% 50%, rgba(232, 180, 255, 0.28), transparent 70%);
  opacity: 0.85;
  animation: modalSsrGlow 2.4s ease-in-out infinite;
}
@keyframes modalSsrGlow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.modal__body {
  position: relative;
  max-width: min(380px, calc(100vw - 40px));
  width: 100%;
  background: linear-gradient(180deg, rgba(18, 20, 29, 0.98), rgba(5, 6, 10, 0.98));
  border: 1px solid var(--glow, var(--line));
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 50px color-mix(in srgb, var(--glow, #b45cff) 35%, transparent), var(--shadow);
  transform: translate(var(--modal-dx, 0), var(--modal-dy, 0)) scale(var(--modal-scale, 0.35));
  opacity: 0;
  transition:
    transform 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease,
    box-shadow 0.4s ease;
}
.modal--from-source .modal__body {
  opacity: 0.85;
}
.modal--open .modal__body {
  transform: translate(0, 0) scale(1);
  opacity: 1;
}
.modal--ssr .modal__body {
  border-color: rgba(255, 215, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.25), 0 0 70px rgba(232, 180, 255, 0.45), 0 0 120px rgba(255, 215, 0, 0.2), var(--shadow);
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.15s;
}
.modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}
.modal__card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glow, var(--line));
  box-shadow: 0 0 30px color-mix(in srgb, var(--glow, transparent) 50%, transparent);
  position: relative;
  transform-style: preserve-3d;
  aspect-ratio: 3 / 4.2;
}
.modal__card.is-ssr {
  border-color: rgba(255, 215, 0, 0.65);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.45), 0 0 80px rgba(232, 180, 255, 0.25);
}
.modal__ssr-burst {
  position: absolute;
  inset: -25%;
  z-index: 0;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.45) 0%, rgba(180, 92, 255, 0.25) 45%, transparent 72%);
  animation: ssrBurst 2s ease-in-out infinite;
  pointer-events: none;
}
.modal__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.modal__name {
  font-size: clamp(18px, 4.5vw, 22px);
  margin: 14px 0 8px;
  padding-right: 28px;
}
.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.modal__rarity {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.modal__variant {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.modal__variant--holo {
  color: #ffe08a;
  border-color: rgba(255, 224, 138, 0.45);
  background: rgba(255, 224, 138, 0.08);
}
.modal__ssr-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(232, 180, 255, 0.6);
}
.modal__desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 8px 0 0;
}
.modal__stats {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.modal__stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.modal__value {
  color: #ffd479;
  font-size: 18px;
}

/* ---------------- Marketplace ---------------- */
.market-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.market-head h1 { margin: 0 0 6px; font-size: clamp(26px, 5vw, 38px); }
.market-tabs {
  display: flex;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.market-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}
.market-tab.is-active {
  background: linear-gradient(135deg, rgba(180, 92, 255, 0.35), rgba(47, 167, 255, 0.25));
  color: #fff;
  border: 1px solid rgba(180, 92, 255, 0.45);
}
.market-safety {
  font-size: 12px;
  color: #ff92a5;
  background: rgba(255, 84, 112, 0.08);
  border: 1px solid rgba(255, 84, 112, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 18px;
  line-height: 1.5;
}
.market-safety--inline { margin-top: 14px; margin-bottom: 0; }
.market-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.market-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.market-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.market-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.mlisting {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 12px 40px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, box-shadow 0.2s;
}
.mlisting:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--glow) 35%, transparent), 0 16px 50px rgba(0,0,0,0.45);
}
.mlisting__art {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.mlisting__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mlisting__ssr, .mlisting__holo {
  position: absolute;
  z-index: 3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
}
.mlisting__ssr { top: 8px; left: 8px; color: #ffd700; border: 1px solid rgba(255,215,0,0.5); }
.mlisting__holo { top: 8px; right: 8px; color: #ffe08a; border: 1px solid rgba(255,224,138,0.45); }
.mlisting__body { padding: 14px; }
.mlisting__name { margin: 0 0 6px; font-size: 16px; }
.mlisting__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
}
.mlisting__est { color: #ffd479; font-weight: 700; }
.mlisting__price {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.mlisting__seller {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.mlisting__date { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.mlisting__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.market-form {
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}
.market-form h2 { margin: 0 0 6px; }
.market-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.market-field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.market-field em { font-weight: 400; font-size: 11px; }
.market-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.market-or { text-align: center; font-size: 12px; margin: 4px 0 12px; }
.market-notes { resize: vertical; min-height: 72px; }

.market-contact {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 20px;
}
.market-contact__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}
.market-contact__panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.market-contact--open .market-contact__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.market-contact__title { margin: 0 0 8px; }
.market-contact__card { margin: 0 0 16px; font-size: 14px; }
.market-contact__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.market-contact__label { font-size: 12px; color: var(--muted); min-width: 56px; }
.market-contact__val {
  flex: 1;
  font-size: 14px;
  background: var(--bg-2);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  word-break: break-all;
}
.market-contact__notes {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 12px;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 999px; z-index: 90; box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600;
}

@media (max-width: 620px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topnav .navbtn { padding: 8px 10px; font-size: 13px; }
  .brand { font-size: 17px; }
  .weight-row { grid-template-columns: 90px 1fr 60px; }
  .pack-row { grid-template-columns: 1fr; }
  .reveal-actions { flex-direction: column; align-items: stretch; }
  .reveal-actions .btn { width: 100%; }
  .reveal-actions .btn--quick { order: 0; }
  .modal { padding: 14px; }
  .modal__body { padding: 14px; border-radius: 18px; }
  .modal__close { top: 8px; right: 8px; width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
