/* =========================================================
   Dead Good Cards — links page
   Dark by default. Cards behave like cards.
   ========================================================= */

:root {
  --bg: #0a0a0a;
  --bg-soft: #131310;
  --surface: #18171a;
  --surface-2: #221f24;
  --ink: #fafafa;
  --ink-mute: #a8a298;
  --ink-faint: #6b675e;

  --yellow: #fbc52e;
  --yellow-deep: #e0a91a;
  --pink: #ff6b8b;
  --pink-deep: #d94668;
  --line: rgba(251, 197, 46, 0.18);

  --card-w: clamp(220px, 24vw, 280px);
  --card-r: 16px;
  --bezel-r: 12px;
  --bezel-pad: 12px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-snap: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ---- Background grain + radial wash ---- */

body::before {
  content: "";
  position: fixed;
  inset: -10vmax;
  background:
    radial-gradient(60vmax 50vmax at 50% -10%, rgba(251, 197, 46, 0.10), transparent 60%),
    radial-gradient(50vmax 40vmax at 90% 110%, rgba(255, 107, 139, 0.08), transparent 60%),
    radial-gradient(40vmax 40vmax at 0% 100%, rgba(251, 197, 46, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* ---- Stage layout ---- */

.stage {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(20px, 3.5vh, 40px) clamp(20px, 5vw, 48px) clamp(20px, 3vh, 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3vh, 32px);
  min-height: 100dvh;
}

/* ---- Hero ---- */

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 16px);
}

.mascot {
  position: relative;
  width: clamp(200px, 28vh, 280px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  isolation: isolate;
  transition: transform .6s var(--ease-snap);
}

.mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter:
    drop-shadow(0 0 18px rgba(251, 197, 46, .35))
    drop-shadow(0 6px 14px rgba(0, 0, 0, .55));
  animation: bob 6s ease-in-out infinite;
}

.mascot__halo {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(251, 197, 46, 0.55), transparent 70%);
  filter: blur(18px);
  z-index: 0;
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite;
}

.mascot:hover { transform: rotate(-2deg) scale(1.02); }
.mascot:active { transform: scale(.97); }

.mascot.is-dizzy img { animation: dizzy 1.2s ease-in-out 1; }

/* Idle wiggle — fires after 30s of no input */
.mascot.is-idle img { animation: shake-awake 1.6s ease-in-out 1; }

@keyframes shake-awake {
  0%   { transform: rotate(0)    scale(1); }
  10%  { transform: rotate(-4deg) scale(1.02); }
  20%  { transform: rotate(3deg)  scale(1.04); }
  30%  { transform: rotate(-3deg) scale(1.02); }
  40%  { transform: rotate(2deg)  scale(1); }
  50%  { transform: scale(1.07, 0.93); }    /* yawn squash */
  62%  { transform: scale(0.94, 1.07); }    /* yawn stretch */
  76%  { transform: scale(1.02, 0.99); }
  100% { transform: scale(1)      rotate(0); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes pulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.04); }
}
@keyframes dizzy {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-12deg) scale(1.02); }
  50%  { transform: rotate(12deg)  scale(1.05); }
  75%  { transform: rotate(-8deg)  scale(1.03); }
  100% { transform: rotate(0deg); }
}

/* ---- Brand wordmark ---- */

.brand {
  font-family: 'Anton', 'Helvetica Neue', sans-serif;
  font-size: clamp(36px, 6.5vw, 68px);
  line-height: .9;
  letter-spacing: .02em;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 .25em;
  text-transform: uppercase;
}

.brand__line {
  display: inline-block;
  background: linear-gradient(180deg, var(--ink) 0%, #cfcabf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}

.brand__line--yellow {
  background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: rotate(-1.5deg);
}

.brand__line--pink {
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: rotate(1deg);
}

.tagline {
  margin: 4px 0 0;
  color: var(--ink-mute);
  font-size: clamp(14px, 1.6vw, 16px);
  letter-spacing: .04em;
  text-transform: uppercase;
  min-height: 1.2em;            /* avoid layout jump while text changes */
  font-variant-numeric: tabular-nums;
}

.t-scramble {
  color: var(--yellow);
  display: inline-block;
}

/* ---- Hand of cards (grid) ---- */

.hand {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-w), 1fr));
  gap: clamp(20px, 2.4vw, 28px);
  width: 100%;
  align-items: stretch;
  justify-items: center;
  perspective: 1200px;
}

/* ---- Card base ---- */

.card {
  --mx: 50%;
  --my: 50%;
  --hue: 0deg;
  --rx: 0deg;
  --ry: 0deg;

  position: relative;
  width: var(--card-w);
  aspect-ratio: 0.715;            /* TCG card proportions (63 x 88) */
  border-radius: var(--card-r);
  cursor: pointer;
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  box-shadow:
    0 18px 30px -12px rgba(0, 0, 0, .55),
    0 4px 10px -4px rgba(0, 0, 0, .4);
  outline: none;
  /* slight individual tilt for "held in hand" feel */
  rotate: -1deg;
}

.card:nth-child(2) { rotate: 1.5deg; }
.card:nth-child(3) { rotate: -2deg; }

.card:focus-visible {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px var(--yellow),
    0 18px 30px -12px rgba(0, 0, 0, .6);
}

.card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--card-r);
  background: linear-gradient(160deg, var(--yellow) 0%, var(--yellow-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .15) inset,
    0 0 0 1px rgba(0, 0, 0, .35);
  transform-style: preserve-3d;
  transition: transform .55s var(--ease-snap);
}

.card.is-flipping .card__inner { transform: rotateY(180deg); }

.card__face {
  position: absolute;
  inset: 6px;                                  /* sit inside the rim */
  border-radius: calc(var(--card-r) - 6px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.card__face--back {
  transform: rotateY(180deg);
  /* no background — the rim comes from .card__inner */
}

/* Inner frame on the back — dark surface inside the yellow rim */
.card__back-frame {
  position: absolute;
  inset: 0;
  border-radius: var(--bezel-r);
  background: radial-gradient(closest-side, #1f1d1a 0%, #0f0e0c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .6),
    inset 0 0 0 3px rgba(251, 197, 46, .4),
    inset 0 0 0 4px rgba(0, 0, 0, .8);
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Radiating sun-rays behind the logo */
.card__back-rays {
  position: absolute;
  inset: -10%;
  background:
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      rgba(251, 197, 46, 0)    0deg,
      rgba(251, 197, 46, 0)    10deg,
      rgba(251, 197, 46, 0.10) 10deg,
      rgba(251, 197, 46, 0.10) 12deg
    );
  filter: blur(.4px);
  opacity: .8;
  z-index: 0;
}

.card__back-logo {
  position: relative;
  z-index: 1;
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 14px rgba(251, 197, 46, .55))
    drop-shadow(0 4px 8px rgba(0, 0, 0, .6));
}

/* Tiny "DGC" text in opposite corners — playing-card touch */
.card__back-corner {
  position: absolute;
  z-index: 2;
  font-family: 'Anton', sans-serif;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--yellow);
  text-transform: uppercase;
}
.card__back-corner--tl { top: 12px; left: 14px; }
.card__back-corner--br { bottom: 12px; right: 14px; }

/* ---- Card bezel (the printed area inside the yellow border) ---- */

.card__bezel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--bezel-r);
  background:
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6) inset,
    0 0 0 2px rgba(251, 197, 46, .25) inset;
  padding: var(--bezel-pad);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 10px;
  isolation: isolate;
  overflow: hidden;
}

/* ---- Card head: name + HP ---- */

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.card__name {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--ink);
}

.card__hp {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: var(--pink);
}
.card__hp-num { font-size: clamp(18px, 2.2vw, 22px); }
.card__hp-lbl { font-size: 11px; color: var(--ink-faint); }

/* ---- Art window ---- */

.card__art {
  position: relative;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(251, 197, 46, 0.18) 0%, rgba(251, 197, 46, 0.04) 100%);
  box-shadow: inset 0 0 0 1px rgba(251, 197, 46, .25);
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 110px;
}

.card__art::after {
  /* subtle sun-rays inside the art window */
  content: "";
  position: absolute;
  inset: -20%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(251, 197, 46, 0) 0deg,
      rgba(251, 197, 46, 0) 12deg,
      rgba(251, 197, 46, 0.10) 12deg,
      rgba(251, 197, 46, 0.10) 14deg
    );
  filter: blur(.4px);
  opacity: .6;
  z-index: 0;
}

.card__art svg {
  width: 56%;
  height: 56%;
  z-index: 1;
  color: var(--yellow);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .5));
}

.card__art--instagram svg { color: var(--pink); }
.card__art--youtube   svg { color: var(--ink); opacity: .7; }

/* Image-as-art cards (e.g. Instagram preview, Casual Mode logo) */
.card__art--image {
  padding: 0;
  min-height: 0;
  position: relative;
}
.card__art--image::after { display: none; }
.card__art--image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Subtle gradient overlay so the platform badge always reads */
.card__art--image::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .55) 100%);
  border-radius: 0 0 8px 8px;
  pointer-events: none;
  z-index: 1;
}

/* Platform indicator badge — corner overlay (YouTube, Instagram, etc.) */
.card__platform {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  width: 38px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, .5),
    0 0 0 1px rgba(0, 0, 0, .3);
}

.card__platform svg {
  width: 100%;
  height: 100%;
}

.card__platform--youtube {
  background: #ff0033;
  color: #ff0033;       /* paints the SVG path color */
  padding: 4px 6px;
}

.card__platform--instagram {
  width: 32px;
  height: 32px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  padding: 6px;
  border-radius: 8px;
}

/* ---- Card meta ---- */

.card__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card__rule {
  height: 1px;
  background:
    linear-gradient(90deg, transparent, rgba(251, 197, 46, .5), transparent);
}

.card__handle {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--yellow);
  letter-spacing: .01em;
}

.card__flavor {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-mute);
  font-style: italic;
}

/* ---- Card foot ---- */

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.card__rarity {
  color: var(--yellow);
  font-size: 14px;
  filter: drop-shadow(0 0 6px rgba(251, 197, 46, .6));
}

/* ---- Foil + shine layers (the holographic effect) ---- */

.card__foil,
.card__shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--bezel-r);
  opacity: 0;
  transition: opacity .3s var(--ease);
  z-index: 3;
}

.card__foil {
  background:
    conic-gradient(
      from var(--hue) at 50% 50%,
      hsla(0,   90%, 70%, .55),
      hsla(45,  95%, 65%, .55),
      hsla(90,  90%, 65%, .55),
      hsla(180, 90%, 70%, .55),
      hsla(260, 90%, 70%, .55),
      hsla(320, 95%, 70%, .55),
      hsla(0,   90%, 70%, .55)
    );
  mix-blend-mode: color-dodge;
  filter: blur(.5px);
}

.card__shine {
  background:
    radial-gradient(
      circle at var(--mx) var(--my),
      rgba(255, 255, 255, .55),
      rgba(255, 255, 255, 0) 35%
    );
  mix-blend-mode: overlay;
}

.card:hover .card__foil  { opacity: .55; }
.card:hover .card__shine { opacity: 1; }

.card:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .25) inset,
    0 0 0 1px rgba(0, 0, 0, .5),
    0 30px 60px -15px rgba(0, 0, 0, .65),
    0 8px 18px -6px rgba(251, 197, 46, .25);
}

/* ---- Featured card (Instagram) — slightly bigger emphasis ---- */

.card--featured .card__inner {
  background: linear-gradient(160deg, var(--yellow) 0%, var(--pink) 120%);
}

.card--featured .card__bezel {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6) inset,
    0 0 0 2px rgba(255, 107, 139, .35) inset;
}

/* ---- Casual Mode YouTube card — coral border to match channel brand ---- */

.card--casual .card__inner {
  background: linear-gradient(160deg, #ff6f6c 0%, #c64340 100%);
}

.card--casual .card__bezel {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6) inset,
    0 0 0 2px rgba(255, 111, 108, .35) inset;
}

.card--casual .card__handle { color: #ff8a87; }
.card--casual .card__rarity { color: #ff8a87; filter: drop-shadow(0 0 6px rgba(255, 111, 108, .6)); }

/* ---- "Live" pulse pill ---- */

.card__pulse {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 0 12px rgba(255, 107, 139, .8);
}

.card__pulse::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-right: 6px;
  vertical-align: 1px;
  animation: blink 1.6s ease-in-out infinite;
}

.card__pulse--watch {
  background: #0a0a0a;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), 0 0 12px rgba(255, 0, 51, .55);
}

.card__pulse--watch::before {
  background: #ff0033;
  box-shadow: 0 0 6px rgba(255, 0, 51, .9);
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* ---- Coming soon card ---- */

.card--soon {
  background: linear-gradient(160deg, #3a3733 0%, #1f1d1a 100%);
  cursor: not-allowed;
}

.card--soon .card__bezel {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6) inset,
    0 0 0 2px rgba(255, 255, 255, .08) inset;
}

.card--soon .card__name,
.card--soon .card__handle,
.card--soon .card__flavor {
  color: var(--ink-mute);
}

.card--soon .card__art svg { opacity: .35; }

.card__ribbon {
  position: absolute;
  top: 18px;
  right: -52px;
  z-index: 4;
  width: 180px;
  text-align: center;
  background: var(--pink);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 6px 0;
  transform: rotate(35deg);
  box-shadow:
    0 6px 12px -4px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(0, 0, 0, .25);
}

/* ---- Footer ---- */

.foot {
  margin-top: auto;
  padding-top: 8px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.foot p { margin: 4px 0; }

/* Hidden "re-rip" trigger — looks like a decorative diamond next to the
   copyright, glows subtly on hover so the curious can find it. */
.foot__rip {
  display: inline-block;
  margin-left: 6px;
  padding: 0 2px;
  font: inherit;
  color: rgba(251, 197, 46, .25);
  cursor: pointer;
  transition: color .25s var(--ease), text-shadow .25s var(--ease), transform .2s var(--ease);
  vertical-align: 1px;
}

.foot__rip:hover {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(251, 197, 46, .65);
  transform: translateY(-1px);
}

.foot__rip:active { transform: scale(.9); }
.foot__rip:focus-visible { outline: 1px dashed var(--yellow); outline-offset: 2px; }

.foot__tiny {
  font-size: 10px;
  text-transform: none;
  font-style: italic;
  color: rgba(107, 103, 94, .8);
}

/* ---- Sparkles (mascot easter egg) ---- */

.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 12px 2px rgba(251, 197, 46, .9);
  animation: spark 1.4s ease-out forwards;
}

.sparkle.pink { background: var(--pink); box-shadow: 0 0 12px 2px rgba(255, 107, 139, .9); }
.sparkle.white { background: #fff; box-shadow: 0 0 12px 2px rgba(255, 255, 255, .8); }

@keyframes spark {
  0%   { transform: translate(0, 0) scale(.4); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.4); opacity: 0; }
}

/* ---- Pack-opening overlay (first visit only) ---- */

body.pack-locked { overflow: hidden; touch-action: none; }

.pack-opening {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  background: var(--bg);
  cursor: pointer;
  isolation: isolate;
}

.pack-opening[hidden] { display: none; }

.pack-opening::before {
  /* same yellow wash as the page hero — keeps continuity once it fades */
  content: "";
  position: absolute;
  inset: -10vmax;
  background:
    radial-gradient(60vmax 50vmax at 50% 30%, rgba(251, 197, 46, 0.18), transparent 60%);
  pointer-events: none;
}

.pack-opening.is-leaving {
  pointer-events: none;
  animation: pack-overlay-out .6s ease forwards;
  animation-delay: .55s;
}

@keyframes pack-overlay-out {
  to { opacity: 0; visibility: hidden; }
}

.pack {
  position: relative;
  width: clamp(220px, 26vw, 320px);
  aspect-ratio: 0.715;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transform-origin: center bottom;
  filter:
    drop-shadow(0 30px 50px rgba(0, 0, 0, .6))
    drop-shadow(0 0 50px rgba(251, 197, 46, .18));
  animation: pack-float 4s ease-in-out infinite;
}

.pack:hover  { filter:
  drop-shadow(0 30px 50px rgba(0, 0, 0, .6))
  drop-shadow(0 0 70px rgba(251, 197, 46, .35));
}

@keyframes pack-float {
  0%, 100% { transform: translateY(0)    rotate(-1deg); }
  50%      { transform: translateY(-6px) rotate(1deg); }
}

/* ---- Strip + body share the same yellow stock + outer shadow ---- */

.pack__strip,
.pack__body {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--yellow) 0%, var(--yellow-deep) 100%);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 0 0 2px rgba(0, 0, 0, .35);
}

/* The seam runs across at y=18%–26% of the pack with interlocking teeth.
   Both pieces share the *same* zigzag — they fit together like a torn page. */

.pack__strip {
  z-index: 2;
  clip-path: polygon(
    0% 0%, 100% 0%,
    100% 26%,
    92% 18%, 84% 26%, 76% 18%, 68% 26%,
    60% 18%, 52% 26%, 44% 18%, 36% 26%,
    28% 18%, 20% 26%, 12% 18%, 4% 26%,
    0% 18%
  );
}

.pack__body {
  z-index: 1;
  clip-path: polygon(
    0% 18%,
    4% 26%, 12% 18%, 20% 26%, 28% 18%, 36% 26%, 44% 18%, 52% 26%, 60% 18%, 68% 26%, 76% 18%, 84% 26%, 92% 18%, 100% 26%,
    100% 100%, 0% 100%
  );
}

/* ---- Strip content: the title bar above the perforation ---- */

.pack__strip-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18%;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  color: #0a0a0a;
  padding: 0 14px;
}

.pack__brand {
  display: block;
  font-size: clamp(16px, 1.8vw, 22px);
  letter-spacing: .04em;
  line-height: 1;
}

.pack__sub {
  display: block;
  font-size: 9px;
  letter-spacing: .22em;
  margin-top: 4px;
  opacity: .6;
}

/* ---- Body content: art + footer below the perforation ---- */

.pack__body-content {
  position: absolute;
  top: 30%;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pack__art {
  flex: 1;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .15);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.pack__art::before {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(0, 0, 0, .07) 0deg, rgba(0, 0, 0, .07) 10deg,
      transparent 10deg, transparent 12deg
    );
}

.pack__art img {
  position: relative;
  z-index: 1;
  width: 72%;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, .35));
}

.pack__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Anton', sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #0a0a0a;
  font-size: 11px;
}

.pack__hint {
  background: #0a0a0a;
  color: #fafafa;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .14em;
}

.pack__hint::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow);
  margin-right: 6px;
  vertical-align: 1px;
  animation: blink 1.4s ease-in-out infinite;
}

/* ---- Cards fly out of the pack on reveal ---- */

body.is-revealing .card {
  animation: card-flyin .7s cubic-bezier(.2, .8, .25, 1) both;
}

body.is-revealing .card.card--featured {
  animation-delay: .5s;
  --rev-x: 80px;
  --rev-y: -200px;
  --rev-rot: -12deg;
}

body.is-revealing .card.card--casual {
  animation-delay: .6s;
  --rev-x: -80px;
  --rev-y: -200px;
  --rev-rot: 12deg;
}

@keyframes card-flyin {
  0% {
    opacity: 0;
    transform:
      translate(var(--rev-x, 0), var(--rev-y, -150px))
      scale(.32)
      rotate(var(--rev-rot, 0deg));
  }
  18%  { opacity: 1; }
  78%  {
    transform: translate(0, -10px) scale(1.04) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0);
  }
}

@media (max-width: 640px) {
  body.is-revealing .card.card--featured { --rev-x: 0;  --rev-y: -160px; }
  body.is-revealing .card.card--casual   { --rev-x: 0;  --rev-y: -160px; animation-delay: .65s; }
}

/* ---- Tear animation ---- */

.pack-opening.is-leaving .pack {
  animation: none;                /* stop the bob so the tear is clean */
}

.pack-opening.is-leaving .pack__strip {
  animation: strip-tear .7s cubic-bezier(.4, .05, .35, 1) forwards;
}

@keyframes strip-tear {
  0%   { transform: translateY(0)     rotate(0);    filter: brightness(1); }
  15%  { transform: translateY(-4px)  rotate(-1deg);  filter: brightness(1.15); }
  100% { transform: translateY(-180%) rotate(-14deg); opacity: 0; filter: brightness(1.4); }
}

.pack-opening.is-leaving .pack__body {
  animation: body-fall .65s cubic-bezier(.45, 0, .9, .55) forwards;
  animation-delay: .2s;
}

@keyframes body-fall {
  0%   { transform: translateY(0)    scale(1);   opacity: 1; }
  100% { transform: translateY(50%)  scale(.88); opacity: 0; }
}

@media (max-width: 480px) {
  .pack { width: min(74vw, 260px); }
  .pack__brand { font-size: 16px; }
}

/* ---- Mini-game modal ---- */

body.game-locked {
  overflow: hidden;
  touch-action: none;
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: gm-fade .25s var(--ease) both;
}

.game-modal.is-open {
  display: flex;
}

.game-modal[hidden] { display: none; }
.game-modal.is-open[hidden] { display: flex; }

@keyframes gm-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.game-modal__panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  box-shadow:
    0 0 0 2px var(--yellow),
    0 0 0 6px rgba(251, 197, 46, .18),
    0 24px 60px -10px rgba(0, 0, 0, .8);
  animation: gm-pop .35s var(--ease-snap) both;
}

@keyframes gm-pop {
  from { transform: translateY(20px) scale(.92); opacity: 0; }
  to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.game-modal__title {
  margin: 0;
  font-family: 'Anton', sans-serif;
  font-size: 28px;
  letter-spacing: .04em;
  color: var(--yellow);
  text-transform: uppercase;
}

.game-canvas {
  display: block;
  background: #0a0a0a;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(251, 197, 46, .25);
  width: min(360px, calc(100vw - 56px));
  aspect-ratio: 360 / 540;
  max-height: calc(100dvh - 220px);
  touch-action: none;
  cursor: pointer;
}

.game-canvas[hidden] { display: none; }

/* ---- Game tab switcher ---- */

.game-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, .4);
  border-radius: 999px;
  border: 1px solid rgba(251, 197, 46, .2);
}

.game-tab {
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-mute);
  font-family: 'Anton', sans-serif;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}

.game-tab:hover { color: var(--ink); }

.game-tab.is-active {
  background: var(--yellow);
  color: var(--bg);
}

.game-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 360px;
}

/* ---- Match the Pack — 4x4 memory grid ---- */

.match-grid {
  position: relative;          /* for the win overlay */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  perspective: 800px;
  background: #0a0a0a;
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(251, 197, 46, .25);
}

.match-grid[hidden] { display: none; }

.match-card {
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1);
  aspect-ratio: 0.9 / 1;
  min-width: 0;            /* let grid item shrink to fit column */
  min-height: 0;
}

.match-card.is-flipped { transform: rotateY(180deg); }

/* one-shot celebration on the moment a pair is matched */
.match-card.is-just-matched {
  animation: match-celebrate .8s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 4;
}

@keyframes match-celebrate {
  0%   { transform: rotateY(180deg) scale(1)    rotate(0); }
  30%  { transform: rotateY(180deg) scale(1.22) rotate(-5deg); }
  60%  { transform: rotateY(180deg) scale(1.08) rotate(4deg); }
  100% { transform: rotateY(180deg) scale(1)    rotate(0); }
}

/* persistent yellow glow on matched cards */
.match-card.is-matched .match-card__face--back {
  animation: match-glow 1.6s ease-in-out infinite;
}

@keyframes match-glow {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px rgba(251, 197, 46, .55),
      0 0 0 rgba(251, 197, 46, 0);
  }
  50% {
    box-shadow:
      inset 0 0 0 2px rgba(251, 197, 46, 1),
      0 0 16px rgba(251, 197, 46, .35);
  }
}

.match-card__face {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.match-card__face--front {
  background: linear-gradient(160deg, var(--yellow) 0%, var(--yellow-deep) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .6),
    inset 0 0 0 2px rgba(251, 197, 46, .3);
}

.match-card__face--front::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      rgba(0, 0, 0, .07) 0deg, rgba(0, 0, 0, .07) 14deg,
      transparent 14deg, transparent 16deg
    );
}

.match-card__face--front::after {
  content: "DGC";
  position: relative;
  z-index: 1;
  font-family: 'Anton', sans-serif;
  font-size: 10px;
  letter-spacing: .14em;
  color: rgba(0, 0, 0, .55);
}

.match-card__face--back {
  transform: rotateY(180deg);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px rgba(251, 197, 46, .35);
}

.match-card__face--back svg {
  width: 60%;
  height: 60%;
}

.match-card.is-matched .match-card__face--back {
  background: rgba(251, 197, 46, .14);
  box-shadow: inset 0 0 0 2px rgba(251, 197, 46, .8);
}

/* ---- Match HUD: moves + best ---- */

.match-hud {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: -2px;
}

.match-hud[hidden] { display: none; }

.match-hud strong { color: var(--ink); font-size: 14px; }
.match-hud__sep { opacity: .4; }

/* ---- Match win overlay (nested inside .match-grid) ---- */

.match-win {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, .92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-align: center;
  z-index: 10;
  padding: 20px;
  animation: match-win-in .35s ease both;
}

@keyframes match-win-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* sparkle particles spawned in JS on match */
.match-spark {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px 2px rgba(251, 197, 46, .9);
  pointer-events: none;
  z-index: 200;
  transform: translate(-50%, -50%);
  animation: match-spark-fly .7s ease-out forwards;
}

.match-spark.pink {
  background: var(--pink);
  box-shadow: 0 0 10px 2px rgba(255, 107, 139, .9);
}

@keyframes match-spark-fly {
  0%   { transform: translate(-50%, -50%) scale(.5); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(1.4); opacity: 0; }
}

.match-win[hidden] { display: none; }

.match-win__title {
  font-family: 'Anton', sans-serif;
  font-size: 32px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 16px;
  text-shadow: 0 0 20px rgba(251, 197, 46, .6);
}

.match-win__stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--ink-mute);
  font-size: 14px;
  letter-spacing: .08em;
}

.match-win__stats strong { color: var(--ink); font-size: 24px; }

.match-win__best { font-size: 12px; }

.match-win__again {
  background: var(--yellow);
  color: var(--bg);
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 10px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s var(--ease-snap);
}

.match-win__again:hover { transform: scale(1.05); }
.match-win__again:active { transform: scale(.95); }

@media (max-width: 480px) {
  .match-win__title { font-size: 24px; }
}

.game-modal__hint {
  margin: 0;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.game-modal__hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(251, 197, 46, .35);
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
  color: var(--yellow);
  background: rgba(251, 197, 46, .06);
}

.game-modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 0 0 3px var(--bg),
    0 6px 14px -2px rgba(0, 0, 0, .6);
  transition: transform .2s var(--ease-snap);
}
.game-modal__close:hover { transform: scale(1.08) rotate(90deg); }
.game-modal__close:active { transform: scale(.95); }

@media (max-width: 480px) {
  .game-modal__panel { padding: 12px; gap: 8px; }
  .game-modal__title { font-size: 22px; }
  .game-modal__hint  { font-size: 10px; }
}

/* ---- Smaller screens ---- */

@media (max-width: 640px) {
  :root { --card-w: min(86vw, 320px); }

  .card { rotate: 0deg; }      /* no rotation noise on mobile */
  .card:nth-child(2),
  .card:nth-child(3) { rotate: 0deg; }

  .hand { perspective: none; }

  .brand { font-size: clamp(64px, 18vw, 96px); }
}

/* ---- Reduce motion ---- */

@media (prefers-reduced-motion: reduce) {
  .mascot img,
  .mascot__halo,
  .card__pulse::before { animation: none !important; }

  .card,
  .card__inner,
  .card__foil,
  .card__shine { transition: none !important; }
}
