/* ============================================================
   inferencecards.com — RISE OF THE INFERENCE ENGINE
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg: #06070d;
  --bg-2: #0c1122;
  --ink: #e8e4d8;
  --ink-dim: #9a96a8;
  --gold: #d8b25a;
  --gold-bright: #f5d98a;
  --gold-deep: #8a6a24;

  /* frame palettes (mottled, per reference) */
  --frame-monster-1: #c98a45; --frame-monster-2: #8a5222; --frame-monster-3: #6e3d14;
  --frame-spell-1: #3fa38c;   --frame-spell-2: #1e6f5c;   --frame-spell-3: #14503f;
  --frame-trap-1: #b65a9d;    --frame-trap-2: #8c3d72;    --frame-trap-3: #63264f;
  --frame-frontier-1: #4a3a78; --frame-frontier-2: #2c2050; --frame-frontier-3: #180f33;

  --parchment: #ede1c4;
  --parchment-ink: #241a0e;
  --box-border: #8a5a22;

  /* mottled noise texture used on every frame */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.055' numOctaves='4' seed='7'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  .6 .6 .6 0 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

html { height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Spectral', Georgia, serif;
  overflow-x: hidden;
}

/* ============================================================
   AMBIENT BACKGROUND — velvet vault
   ============================================================ */
.bg-base {
  position: fixed; inset: 0; z-index: -4;
  background:
    radial-gradient(ellipse 90% 60% at 50% -15%, rgba(63,74,140,.32), transparent 62%),
    radial-gradient(ellipse 55% 45% at 12% 105%, rgba(216,178,90,.07), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 100%, rgba(120,70,160,.09), transparent 60%),
    linear-gradient(180deg, #0b0e1c 0%, #06070d 50%, #040409 100%);
}
/* faint diamond lattice, like a binder page */
.bg-base::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 55px, rgba(180,190,255,.028) 55px 56px),
    repeating-linear-gradient(-45deg, transparent 0 55px, rgba(180,190,255,.028) 55px 56px);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 30%, transparent 75%);
}
/* slow-sweeping display-case beams */
.bg-beams {
  position: fixed; inset: -20%; z-index: -3; pointer-events: none;
  background:
    conic-gradient(from 200deg at 30% -10%, transparent 0deg, rgba(140,160,255,.06) 18deg, transparent 40deg),
    conic-gradient(from 160deg at 72% -10%, transparent 0deg, rgba(245,217,138,.05) 15deg, transparent 36deg);
  animation: beams-drift 26s ease-in-out infinite alternate;
}
@keyframes beams-drift {
  from { transform: translateX(-2.5%) rotate(-1.2deg); }
  to   { transform: translateX(2.5%) rotate(1.2deg); }
}
/* floating gold dust (particles injected by JS) */
.bg-dust { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.bg-dust span {
  position: absolute; bottom: -3vh;
  width: var(--s, 3px); height: var(--s, 3px); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,232,170,.9), rgba(216,178,90,.15) 70%, transparent);
  opacity: 0;
  animation: dust-rise var(--d, 18s) linear infinite;
  animation-delay: var(--delay, 0s);
  filter: blur(.4px);
}
@keyframes dust-rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  8%   { opacity: var(--o, .5); }
  85%  { opacity: var(--o, .5); }
  100% { transform: translate(var(--x, 0px), -108vh); opacity: 0; }
}
.bg-vignette {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.6) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .bg-beams, .bg-dust span { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(1rem, 3.5vw, 2.6rem);
  border-bottom: 1px solid transparent;
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s ease, box-shadow .35s;
}
.site-nav.scrolled {
  background: rgba(7, 9, 18, .82);
  border-bottom-color: rgba(216,178,90,.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(0,0,0,.45);
}
.nav-brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink);
}
.nav-crest {
  color: var(--gold); font-size: .9rem;
  text-shadow: 0 0 12px rgba(216,178,90,.7);
}
.nav-wordmark {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: .78rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold-bright);
  white-space: nowrap;
}
.nav-links { display: flex; gap: clamp(.9rem, 2.4vw, 2rem); }
.nav-links a {
  font-family: 'Spectral', serif; font-size: .86rem; letter-spacing: .08em;
  color: var(--ink-dim); text-decoration: none;
  padding: .3rem 0; position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  transition: right .3s ease;
}
.nav-links a:hover { color: var(--gold-bright); }
.nav-links a:hover::after { right: 0; }
.nav-edition {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: .62rem;
  letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  color: var(--gold-bright);
  border: 1px solid rgba(245,217,138,.45); border-radius: 999px;
  padding: .34rem .85rem;
  background: linear-gradient(180deg, rgba(216,178,90,.14), rgba(216,178,90,.04));
  box-shadow: inset 0 1px 0 rgba(255,240,200,.18);
}
@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 5.5rem 1.5rem 3rem;
}
.hero-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%;
}
.logo { display: flex; flex-direction: column; line-height: 1.05; user-select: none; }
.logo-top {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: clamp(.72rem, 1.4vw, .95rem);
  letter-spacing: .6em; color: var(--ink-dim); text-indent: .6em;
}
.logo-main {
  font-family: 'Cinzel Decorative', 'Cinzel', serif; font-weight: 900;
  font-size: clamp(2.3rem, 6.5vw, 4.6rem);
  background: linear-gradient(100deg, #f7e3a1 0%, #d8b25a 30%, #fff3c4 50%, #b8892e 70%, #f7e3a1 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: logo-shimmer 6s linear infinite;
  filter: drop-shadow(0 2px 12px rgba(216,178,90,.35));
}
@keyframes logo-shimmer { to { background-position: 200% 0; } }
.logo-sub {
  font-size: .7rem; letter-spacing: .38em; color: var(--ink-dim);
  text-transform: uppercase; margin-top: .6rem; text-indent: .38em;
}
.tagline {
  margin-top: 1.1rem; font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: #c9c4b4; font-style: italic;
}

/* --- the fanned card spread --- */
.hero-fan {
  display: flex; justify-content: center; align-items: flex-end;
  margin: clamp(1.6rem, 4vh, 3rem) auto 0;
  perspective: 1500px;
  min-height: clamp(230px, 34vw, 400px);
}
.fan-slot {
  width: clamp(140px, 15.5vw, 235px);
  margin: 0 clamp(-2.6rem, -3.4vw, -1.4rem);
  transform:
    rotate(var(--rot, 0deg))
    translateY(var(--ty, 0px));
  transform-origin: 50% 120%;
  transition: transform .45s cubic-bezier(.2,.9,.3,1.2), filter .45s, z-index 0s;
  position: relative;
  z-index: var(--z, 1);
  opacity: 0;
  animation: fan-deal .7s cubic-bezier(.2,.85,.3,1.1) forwards;
  animation-delay: var(--deal, 0s);
  filter: drop-shadow(0 18px 26px rgba(0,0,0,.55));
}
@keyframes fan-deal {
  from {
    opacity: 0;
    transform: rotate(0deg) translateY(120px) scale(.7);
  }
  to {
    opacity: 1;
    transform: rotate(var(--rot, 0deg)) translateY(var(--ty, 0px));
  }
}
.fan-slot.dealt { animation: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .fan-slot { animation: none; opacity: 1; }
}
.fan-slot:hover {
  transform: rotate(0deg) translateY(calc(var(--ty, 0px) - 34px)) scale(1.07);
  z-index: 10;
  filter: drop-shadow(0 30px 44px rgba(0,0,0,.7)) drop-shadow(0 0 26px rgba(216,178,90,.22));
}
.fan-slot .ygo-card { box-shadow: 0 0 0 1px rgba(0,0,0,.5); }

/* --- hero stats strip --- */
.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(.8rem, 2.4vw, 1.7rem);
  margin-top: clamp(5rem, 11vh, 7.5rem);
  padding: .95rem clamp(1.2rem, 3vw, 2.4rem);
  border-top: 1px solid rgba(216,178,90,.28);
  border-bottom: 1px solid rgba(216,178,90,.28);
  background: linear-gradient(90deg, transparent, rgba(216,178,90,.06) 20%, rgba(216,178,90,.06) 80%, transparent);
  flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; align-items: center; min-width: 3.4rem; }
.stat-num {
  font-family: 'Cinzel', serif; font-weight: 900;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem); color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(216,178,90,.35);
  font-variant-numeric: tabular-nums;
}
.stat-cap {
  font-size: .64rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-dim); margin-top: .15rem; text-indent: .26em;
}
.stat-sep { color: rgba(216,178,90,.45); font-size: .55rem; }

.hero-cta {
  display: inline-flex; align-items: center; gap: .6rem;
  margin-top: clamp(1.4rem, 3vh, 2.2rem);
  font-family: 'Cinzel', serif; font-weight: 700; font-size: .8rem;
  letter-spacing: .22em; text-transform: uppercase; text-decoration: none;
  color: var(--gold-bright);
  padding: .8rem 1.9rem; border-radius: 999px;
  border: 1px solid rgba(245,217,138,.5);
  background: linear-gradient(180deg, rgba(216,178,90,.16), rgba(216,178,90,.03));
  box-shadow: inset 0 1px 0 rgba(255,240,200,.2), 0 0 24px rgba(216,178,90,.12);
  transition: box-shadow .25s, transform .25s, background .25s;
}
.hero-cta:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(216,178,90,.26), rgba(216,178,90,.08));
  box-shadow: inset 0 1px 0 rgba(255,240,200,.25), 0 6px 34px rgba(216,178,90,.3);
}
.hero-cta .cta-arrow { transition: transform .25s; }
.hero-cta:hover .cta-arrow { transform: translateY(3px); }

/* ============================================================
   SECTION HEADERS + REVEAL
   ============================================================ */
.section-head { text-align: center; margin-bottom: clamp(1.8rem, 4vh, 2.8rem); }
.ornament {
  display: flex; align-items: center; justify-content: center; gap: .8rem;
  margin-bottom: 1rem;
}
.ornament i {
  display: block; width: clamp(60px, 10vw, 130px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216,178,90,.75));
}
.ornament i:last-child { transform: scaleX(-1); }
.ornament span {
  color: var(--gold); font-size: .7rem;
  text-shadow: 0 0 10px rgba(216,178,90,.8);
}
.section-title {
  font-family: 'Cinzel', serif; font-weight: 900;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem); letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(100deg, #f7e3a1, #d8b25a 45%, #fff3c4 60%, #c59a3e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 8px rgba(216,178,90,.22));
}
.section-sub { margin-top: .55rem; font-size: .95rem; font-style: italic; color: var(--ink-dim); }

.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   THE CHASE
   ============================================================ */
.chase-section {
  max-width: 1300px; margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) clamp(1.2rem, 4vw, 3rem) 2rem;
}
.chase-row {
  display: flex; justify-content: center; align-items: flex-end;
  gap: clamp(1.4rem, 4vw, 3.6rem);
  flex-wrap: wrap;
}
.chase-item {
  display: flex; flex-direction: column; align-items: center;
  width: clamp(215px, 22vw, 300px);
}
.chase-item.is-center { width: clamp(250px, 26vw, 355px); }
.chase-holder {
  width: 100%; position: relative;
  perspective: 1200px;
  animation: chase-float 7s ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}
@keyframes chase-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) { .chase-holder { animation: none; } }
.chase-holder .ygo-card {
  box-shadow:
    0 26px 60px rgba(0,0,0,.7),
    0 0 46px var(--aura, rgba(216,178,90,.16));
}
/* pedestal glow */
.chase-pedestal {
  width: 82%; height: 26px; margin-top: 1.6rem;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--aura, rgba(216,178,90,.4)), transparent 70%);
  filter: blur(6px);
}
.chase-label {
  margin-top: .9rem; text-align: center;
}
.chase-rarity {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: .68rem;
  letter-spacing: .3em; text-transform: uppercase; display: block;
}
.chase-rarity.r-ultra { color: var(--gold-bright); }
.chase-rarity.r-secret {
  background: linear-gradient(90deg,#ff8a8a,#ffd98a,#b6ff9e,#8ad9ff,#c39aff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chase-pull {
  display: block; margin-top: .3rem;
  font-size: .8rem; font-style: italic; color: var(--ink-dim);
}

/* ============================================================
   RARITY GUIDE
   ============================================================ */
.rarity-section {
  max-width: 1300px; margin: 0 auto;
  padding: clamp(3rem, 8vh, 5rem) clamp(1.2rem, 4vw, 3rem) 1.5rem;
}
.rarity-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.rarity-tile {
  position: relative; overflow: hidden;
  border-radius: 14px;
  padding: 1.4rem 1.3rem 1.3rem;
  background: linear-gradient(180deg, rgba(20,24,44,.75), rgba(10,12,24,.85));
  border: 1px solid var(--tile-edge, rgba(255,255,255,.12));
  box-shadow: 0 14px 36px rgba(0,0,0,.45);
  transition: transform .3s cubic-bezier(.2,.8,.3,1.1), box-shadow .3s;
}
.rarity-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(0,0,0,.6), 0 0 30px var(--tile-glow, rgba(255,255,255,.06));
}
.rarity-tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--tile-bar, rgba(255,255,255,.25));
}
.rarity-tile-name {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: .95rem;
  letter-spacing: .14em; text-transform: uppercase;
}
.rarity-tile-pull {
  margin-top: .45rem; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim);
}
.rarity-tile-count {
  margin-top: .15rem; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim);
}
.rarity-tile-blurb {
  margin-top: .8rem; font-size: .88rem; font-style: italic; line-height: 1.45; color: #c2beb0;
}
.rarity-tile.t-common  { --tile-bar: #b8bcc8; --tile-edge: rgba(184,188,200,.28); --tile-glow: rgba(184,188,200,.12); }
.rarity-tile.t-common  .rarity-tile-name { color: #c9cdd8; }
.rarity-tile.t-rare    { --tile-bar: linear-gradient(90deg,#9fb4d8,#e6eeff,#9fb4d8); --tile-edge: rgba(200,215,240,.32); --tile-glow: rgba(180,205,245,.14); }
.rarity-tile.t-rare    .rarity-tile-name { color: #dfe8f8; }
.rarity-tile.t-super   { --tile-bar: linear-gradient(90deg,#57b8e8,#c9f2ff,#57b8e8); --tile-edge: rgba(120,200,240,.36); --tile-glow: rgba(120,200,255,.16); }
.rarity-tile.t-super   .rarity-tile-name { color: #a8e2ff; }
.rarity-tile.t-ultra   { --tile-bar: linear-gradient(90deg,#c69a3e,#ffe9ae,#c69a3e); --tile-edge: rgba(216,178,90,.45); --tile-glow: rgba(216,178,90,.2); }
.rarity-tile.t-ultra   .rarity-tile-name { color: var(--gold-bright); }
.rarity-tile.t-secret  { --tile-bar: linear-gradient(90deg,#ff8a8a,#ffd98a,#b6ff9e,#8ad9ff,#c39aff); --tile-edge: rgba(195,154,255,.4); --tile-glow: rgba(195,154,255,.18); }
.rarity-tile.t-secret  .rarity-tile-name {
  background: linear-gradient(90deg,#ff8a8a,#ffd98a,#b6ff9e,#8ad9ff,#c39aff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   FILTER TOOLBAR
   ============================================================ */
.view {
  max-width: 1580px; margin: 0 auto;
  padding: clamp(3rem, 8vh, 5rem) clamp(1.2rem, 4vw, 3.5rem) 3.5rem;
}
.filters {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .7rem;
  margin: .6rem auto 2.4rem;
  padding: .85rem 1.1rem;
  max-width: 1000px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20,24,44,.6), rgba(10,12,24,.7));
  border: 1px solid rgba(216,178,90,.22);
  box-shadow: 0 14px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,240,200,.06);
  backdrop-filter: blur(8px);
}
.filter-group { display: flex; gap: .35rem; }
.pill {
  font-family: 'Spectral', serif; font-size: .88rem;
  padding: .45rem 1.05rem; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.04); color: var(--ink-dim);
  border: 1px solid rgba(255,255,255,.1); transition: all .2s;
}
.pill:hover { color: var(--ink); }
.pill.active { background: rgba(216,178,90,.16); color: var(--gold-bright); border-color: rgba(216,178,90,.55); }
.search {
  font-family: 'Spectral', serif; font-size: .88rem;
  background: rgba(255,255,255,.05); color: var(--ink);
  border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  padding: .48rem .75rem; outline: none;
}
.search { min-width: 210px; }
.search:focus { border-color: rgba(216,178,90,.6); }

/* --- themed dropdowns --- */
.dropdown { position: relative; }
.dropdown-btn {
  display: flex; align-items: center; gap: .8rem;
  font-family: 'Spectral', serif; font-size: .88rem;
  background: rgba(255,255,255,.05); color: var(--ink);
  border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  padding: .48rem .85rem; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropdown-btn:hover, .dropdown.open .dropdown-btn {
  border-color: rgba(216,178,90,.55); background: rgba(216,178,90,.08);
}
.dropdown-chevron {
  width: 10px; height: 10px; flex: 0 0 auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%239a96a8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  transition: transform .25s ease;
}
.dropdown.open .dropdown-chevron { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: max(100%, 170px);
  list-style: none; padding: .35rem;
  background: linear-gradient(180deg, rgba(22,27,50,.98), rgba(11,14,28,.98));
  border: 1px solid rgba(216,178,90,.35);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.4);
  backdrop-filter: blur(10px);
  transform-origin: top;
  animation: dropdown-in .18s cubic-bezier(.25,.9,.35,1.1);
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scaleY(.92); }
}
.dropdown-menu li {
  position: relative;
  padding: .45rem .8rem .45rem 1.7rem;
  font-family: 'Spectral', serif; font-size: .87rem;
  color: var(--ink-dim); border-radius: 6px; cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.dropdown-menu li:hover { background: rgba(216,178,90,.13); color: var(--gold-bright); }
.dropdown-menu li.selected { color: var(--gold-bright); }
.dropdown-menu li.selected::before {
  content: "◆"; position: absolute; left: .6rem; top: 50%; translate: 0 -50%;
  font-size: .6rem; color: var(--gold);
}
.empty-msg { color: var(--ink-dim); font-style: italic; padding: 3rem 0; text-align: center; }

/* ============================================================
   THE CARD  (modeled on printed TCG cards)
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 2.4rem 1.9rem;
}

.card-slot { perspective: 1400px; position: relative; }

.ygo-card {
  position: relative;
  aspect-ratio: 59 / 86;
  width: 100%;
  container-type: inline-size;
  border-radius: 3.6% / 2.5%;
  transform-style: preserve-3d;
  transition: transform .18s ease-out, box-shadow .3s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,.6);
  cursor: pointer;
}
.card-slot:hover .ygo-card { box-shadow: 0 20px 48px rgba(0,0,0,.75), 0 0 26px rgba(216,178,90,.12); }

.card-face {
  position: absolute; inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  overflow: hidden;
}
.card-back-face { transform: rotateY(180deg); background: #0c0a18; }
.card-back-face img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.card-back-face::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 2px solid rgba(216,178,90,.35);
  box-shadow: inset 0 0 0 6px rgba(0,0,0,.35);
}

/* --- the mottled frame --- */
.card-front {
  display: flex; flex-direction: column;
  padding: 3.2% 4.4% 3% 4.4%;
  background:
    radial-gradient(130% 90% at 25% 0%, rgba(255,255,255,.18), transparent 50%),
    radial-gradient(120% 90% at 80% 105%, rgba(0,0,0,.3), transparent 55%),
    linear-gradient(158deg, var(--f1) 0%, var(--f2) 55%, var(--f3) 100%);
  box-shadow: inset 0 0 0 2px rgba(20,10,4,.55), inset 0 0 0 3.5px rgba(255,240,200,.18);
}
/* grain over the frame color */
.card-front::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--noise); background-size: 62cqw;
  opacity: .5; mix-blend-mode: overlay;
}
.type-monster  { --f1: var(--frame-monster-1);  --f2: var(--frame-monster-2);  --f3: var(--frame-monster-3); }
.type-spell    { --f1: var(--frame-spell-1);    --f2: var(--frame-spell-2);    --f3: var(--frame-spell-3); }
.type-trap     { --f1: var(--frame-trap-1);     --f2: var(--frame-trap-2);     --f3: var(--frame-trap-3); }
.type-frontier { --f1: var(--frame-frontier-1); --f2: var(--frame-frontier-2); --f3: var(--frame-frontier-3); }
.type-frontier .card-front, .card-front.type-frontier { box-shadow: inset 0 0 0 2px rgba(216,178,90,.6), inset 0 0 0 3.5px rgba(255,240,200,.2); }

/* --- name row: recessed plate + attribute orb --- */
.name-row {
  position: relative;
  display: flex; align-items: stretch; gap: 2.4%;
  margin-bottom: 1.6cqw;
}
.name-plate {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  padding: 1.5cqw 3cqw;
  min-height: 10cqw;
  border-radius: 1.6cqw;
  background:
    linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.16) 45%, rgba(0,0,0,.3));
  border: 1px solid rgba(20,10,4,.65);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.55),
    0 1px 0 rgba(255,240,200,.22);
}
.card-name {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 5.6cqw; letter-spacing: .02em;
  color: #fdfaf1;
  text-shadow:
    0 1px 0 rgba(0,0,0,.85), 0 -1px 0 rgba(0,0,0,.55),
    1px 0 0 rgba(0,0,0,.55), -1px 0 0 rgba(0,0,0,.55),
    0 2px 5px rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; flex: 1;
}
/* rarity tints — always bright, always outlined */
.rarity-rare .card-name   { color: #eef3ff; }
.rarity-super .card-name  { color: #eafaff; }
.rarity-ultra .card-name  { color: #ffeeb2; }
.rarity-secret .card-name {
  background: linear-gradient(90deg, #ffd7d7, #fff3c9, #dcffd2, #d2f0ff, #ecd9ff, #ffd7ef);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: secret-name 5s linear infinite;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.9)) drop-shadow(0 0 3px rgba(0,0,0,.55));
  text-shadow: none;
}
@keyframes secret-name { to { background-position: 300% 0; } }

.attr-orb {
  flex: 0 0 auto; align-self: center;
  width: 9.6cqw; height: 9.6cqw; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 5cqw; line-height: 1;
  background: radial-gradient(circle at 32% 28%, #5b6180, #191c2e 72%);
  border: 1px solid rgba(255,240,200,.4);
  box-shadow: 0 2px 4px rgba(0,0,0,.55), inset 0 0 7px rgba(0,0,0,.7);
}

/* --- stars (monsters) / kind line (spells & traps) --- */
.stars-row {
  display: flex; gap: 1cqw;
  padding: .5cqw .8cqw 1.3cqw;
  min-height: 8.2cqw;
}
.star {
  width: 6.2cqw; height: 6.2cqw; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffe9a0, #e8862c 55%, #9c4a06);
  border: 1px solid rgba(60,20,0,.6);
  box-shadow: 0 1px 3px rgba(0,0,0,.6), inset 0 -1px 3px rgba(0,0,0,.35);
  display: grid; place-items: center;
  color: #ffd23e; font-size: 4.6cqw; line-height: 0;
}
.star::before { content: "★"; text-shadow: 0 1px 1px rgba(90,40,0,.8); }
.kind-line {
  width: 100%; align-self: center; text-align: right;
  padding: 2cqw 1cqw 2.6cqw;
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 4cqw;
  letter-spacing: .1em; color: #fdfaf1;
  text-shadow: 0 1px 0 rgba(0,0,0,.85), 0 2px 4px rgba(0,0,0,.5);
}

/* --- art window: double bevel like a printed card --- */
.art-box {
  position: relative; margin: 0 4.5%;
  aspect-ratio: 1 / 1;
  border: 1.7cqw solid #191420;
  outline: 1px solid rgba(255,240,200,.35);
  outline-offset: -0.4cqw;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.6),
    0 2px 8px rgba(0,0,0,.45),
    inset 0 0 16px rgba(0,0,0,.65);
  background: #101020;
  overflow: hidden;
}
.art-box img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: translateZ(0);
}
.art-holo { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.rarity-super .art-holo, .rarity-ultra .art-holo {
  opacity: .5;
  background:
    linear-gradient(115deg,
      transparent 20%, rgba(140,255,255,.16) 36%, rgba(255,160,255,.22) 46%,
      rgba(255,240,160,.20) 54%, rgba(160,190,255,.16) 64%, transparent 80%);
  background-size: 260% 260%;
  background-position: calc(50% + var(--gx, 0%) * -1.4) calc(50% + var(--gy, 0%) * -1.4);
  mix-blend-mode: color-dodge;
}

/* secret rare: rainbow foil across the whole card */
.foil-layer { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; }
.rarity-secret .foil-layer {
  opacity: .32;
  background:
    repeating-linear-gradient(112deg,
      rgba(255,120,120,.5) 0 6%, rgba(255,220,120,.5) 6% 12%, rgba(150,255,150,.5) 12% 18%,
      rgba(120,220,255,.5) 18% 24%, rgba(190,140,255,.5) 24% 30%);
  background-size: 300% 300%;
  background-position: calc(50% + var(--gx, 0%) * -1.8) calc(50% + var(--gy, 0%) * -1.8);
  mix-blend-mode: color-dodge;
}

/* pointer glare */
.glare-layer {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at calc(50% + var(--gx, 0%)) calc(50% + var(--gy, 0%)),
    rgba(255,255,255,.26) 0%, rgba(255,255,255,.07) 22%, transparent 45%);
  mix-blend-mode: screen;
}
.card-slot:hover .glare-layer, .inspect-holder .glare-layer { opacity: 1; }

/* --- effect box: parchment with ornate double border --- */
.effect-box {
  flex: 1; margin-top: 2.2%;
  background: linear-gradient(180deg, #f4e9cd, var(--parchment) 25%, #dfcfa8);
  border: .8cqw solid var(--box-border);
  box-shadow:
    inset 0 0 0 1px rgba(255,235,190,.8),
    inset 0 0 10px rgba(92,74,38,.3),
    0 0 0 1px rgba(30,15,5,.55);
  border-radius: .8cqw;
  padding: 1.3cqw 2.4cqw 1.2cqw;
  color: var(--parchment-ink);
  display: flex; flex-direction: column;
  min-height: 0;
}
.type-line {
  font-family: 'Spectral', serif; font-weight: 600; font-size: 3.1cqw;
  letter-spacing: .02em; margin-bottom: .6cqw;
}
.box-body {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.effect-text { font-size: 1em; line-height: 1.34; }
.box-divider {
  height: 1px; background: rgba(60,40,10,.55);
  margin: 1.4cqw .4cqw 1.1cqw;
  flex: 0 0 auto;
}
.flavor-line {
  font-size: .92em; font-style: italic; text-align: center;
  color: #3d2f1a; line-height: 1.3;
}
.atkdef-row {
  border-top: 1px solid rgba(60,40,10,.55);
  margin-top: 1.1cqw; padding-top: .9cqw;
  display: flex; justify-content: flex-end; gap: 4cqw;
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 3.4cqw;
  flex: 0 0 auto;
}

/* --- footer: set code + edition stamp --- */
.card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.7cqw .6cqw 0;
}
.set-id {
  font-size: 2.9cqw; letter-spacing: .1em; color: rgba(255,250,240,.85);
  text-shadow: 0 1px 1px rgba(0,0,0,.7);
}
.edition-stamp {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 2.7cqw;
  letter-spacing: .12em; text-transform: uppercase;
  color: #ffe9b0; text-shadow: 0 1px 1px rgba(0,0,0,.75);
  border: 1px solid rgba(255,233,176,.55); border-radius: .8cqw;
  padding: .5cqw 1.6cqw;
  background: rgba(0,0,0,.22);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
}

/* ============================================================
   INSPECT OVERLAY
   ============================================================ */
.inspect-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(4,6,12,.86);
  backdrop-filter: blur(14px);
  animation: overlay-in .3s ease;
}
@keyframes overlay-in { from { opacity: 0; } }
.inspect-close {
  position: absolute; top: 1.2rem; right: 1.6rem; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
  color: var(--ink); background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18);
  transition: all .2s;
}
.inspect-close:hover { background: rgba(255,255,255,.16); transform: rotate(90deg); }

.inspect-layout {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  width: 100%; max-width: 1200px; padding: 0 2rem;
  flex-wrap: wrap;
}
.inspect-stage { perspective: 1600px; touch-action: none; }
.inspect-holder {
  width: min(400px, 80vw);
  transform-style: preserve-3d;
  animation: card-enter .55s cubic-bezier(.2, .9, .25, 1.2);
}
@keyframes card-enter {
  from { transform: translateY(60px) rotateY(-32deg) scale(.7); opacity: 0; }
}
.inspect-holder .ygo-card {
  transition: none; cursor: grab;
  box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 60px var(--aura, rgba(216,178,90,.14));
}
.inspect-holder .ygo-card:active { cursor: grabbing; }
.inspect-holder .glare-layer { opacity: 1; }

.rarity-super  { --aura: rgba(120,200,255,.20); }
.rarity-ultra  { --aura: rgba(255,205,95,.26); }
.rarity-secret { --aura: rgba(220,140,255,.30); }

.inspect-hint {
  margin-top: 1.4rem; font-size: .78rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-dim);
}

/* stat panel */
.inspect-panel {
  width: min(340px, 90vw);
  background: linear-gradient(180deg, rgba(20,24,44,.9), rgba(10,12,24,.9));
  border: 1px solid rgba(216,178,90,.25);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.panel-rarity {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: .72rem;
  letter-spacing: .3em; text-transform: uppercase; margin-bottom: .4rem;
}
.panel-rarity.r-common { color: #b8bcc8; }
.panel-rarity.r-rare { color: #cfd9ea; }
.panel-rarity.r-super { color: #8fd4ff; }
.panel-rarity.r-ultra { color: #f5d98a; }
.panel-rarity.r-secret {
  background: linear-gradient(90deg,#ff8a8a,#ffd98a,#b6ff9e,#8ad9ff,#c39aff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.panel-name { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 700; margin-bottom: .2rem; }
.panel-meta { font-size: .8rem; color: var(--ink-dim); margin-bottom: 1.1rem; }

.stat-rows { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.1rem; }
.stat-row { font-size: .78rem; }
.stat-row .stat-label {
  display: flex; justify-content: space-between; margin-bottom: .28rem;
  color: var(--ink-dim); letter-spacing: .06em; text-transform: uppercase; font-size: .68rem;
}
.stat-row .stat-value { color: var(--ink); font-weight: 600; }
.stat-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.stat-bar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #4f7cff, #8ad9ff);
  transform-origin: left; animation: bar-grow .8s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes bar-grow { from { transform: scaleX(0); } }
.stat-bar.gold i { background: linear-gradient(90deg, #c69a3e, #f5d98a); }

.panel-effect {
  font-size: .88rem; line-height: 1.5; color: #d8d4c8;
  border-top: 1px solid rgba(255,255,255,.1); padding-top: .9rem;
}
.panel-flavor { font-style: italic; color: var(--ink-dim); margin-top: .6rem; font-size: .84rem; }
.panel-cta {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: 1.2rem; padding: .68rem 1.2rem;
  font-family: 'Cinzel', serif; font-weight: 700; font-size: .82rem; letter-spacing: .08em;
  color: #1d1503; text-decoration: none;
  background: linear-gradient(180deg, #f2d787, #c69a3e);
  border: 1px solid #f5d98a; border-radius: 999px;
  box-shadow: 0 0 18px rgba(216,178,90,.25);
  transition: transform .2s, box-shadow .2s;
}
.panel-cta:hover { transform: translateY(-2px); box-shadow: 0 4px 26px rgba(216,178,90,.45); }
.panel-cta .cta-arrow { transition: transform .2s; }
.panel-cta:hover .cta-arrow { transform: translateX(3px); }

/* ============================================================
   PRODUCT / BOOSTER
   ============================================================ */
.product-section {
  max-width: 1020px; margin: 0 auto;
  padding: clamp(3rem, 8vh, 5rem) clamp(1.2rem, 4vw, 3rem) 1rem;
  text-align: center;
}
.product-stage {
  position: relative;
  border-radius: 18px;
  padding: 6px;
  background: linear-gradient(140deg, rgba(245,217,138,.55), rgba(138,90,34,.35) 30%, rgba(245,217,138,.12) 55%, rgba(245,217,138,.55));
  box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 70px rgba(216,178,90,.12);
}
.product-stage::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -34px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(216,178,90,.3), transparent 70%);
  filter: blur(10px);
}
.product-stage img {
  width: 100%; border-radius: 13px; display: block;
}
.product-figure figcaption {
  margin-top: 2.4rem; font-size: .82rem; font-style: italic; color: var(--ink-dim);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center; padding: 3.2rem 1rem 2.6rem;
  color: #565b70; font-size: .8rem; font-style: italic; letter-spacing: .04em;
  line-height: 1.7;
  border-top: 1px solid rgba(216,178,90,.14);
  margin-top: 3rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.35));
}
.site-footer .credits { margin-top: .6rem; font-style: normal; }
.site-footer a {
  color: #9aa4c8; text-decoration: none; border-bottom: 1px solid rgba(154,164,200,.35);
  transition: color .2s;
}
.site-footer a:hover { color: var(--gold-bright); border-color: rgba(245,217,138,.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .hero { padding-top: 4.5rem; }
  .hero-fan { min-height: 200px; }
  .fan-slot { width: clamp(108px, 24vw, 150px); margin: 0 -1.4rem; }
  .hero-stats { gap: .7rem; }
  .stat-sep { display: none; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.4rem 1rem; }
  .inspect-layout { flex-direction: column; padding-bottom: 2rem; }
  .inspect-panel { margin-bottom: 2rem; }
  .chase-item, .chase-item.is-center { width: clamp(200px, 62vw, 260px); }
}
