/* ==========================================================================
   Kayden's Binder
   A dark collector's desk, rainbow foil, and cream card stock.
   ========================================================================== */

@property --mx { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --my { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

:root {
  --ink: #0c0a1d;
  --ink-2: #15122e;
  --ink-3: #1e1a44;
  --line: rgba(255, 255, 255, 0.13);
  --text: #f5f2ff;
  --muted: #b8b2dc;
  --cream: #fff8e7;
  --card-ink: #1c1836;
  --cyan: #5ef2ff;
  --pink: #ff6bd6;
  --yellow: #ffe66b;
  --mint: #6bffb0;
  --violet: #8b7bff;
  --foil: linear-gradient(115deg, #5ef2ff 0%, #8b7bff 26%, #ff6bd6 50%, #ffe66b 74%, #6bffb0 100%);
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tab: var(--cyan);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--ink);
  color: var(--text);
  font: 500 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* the desk: soft coloured lights and a few sparkles */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    radial-gradient(60vmax 60vmax at 8% -12%, rgba(94, 242, 255, 0.17), transparent 62%),
    radial-gradient(52vmax 52vmax at 104% 12%, rgba(255, 107, 214, 0.15), transparent 60%),
    radial-gradient(64vmax 64vmax at 50% 112%, rgba(139, 123, 255, 0.2), transparent 62%);
}
body::after {
  opacity: 0.55;
  background-image:
    radial-gradient(1.6px 1.6px at 24px 34px, #fff, transparent),
    radial-gradient(1.2px 1.2px at 118px 92px, #fff, transparent),
    radial-gradient(1.6px 1.6px at 176px 58px, var(--cyan), transparent),
    radial-gradient(1.2px 1.2px at 66px 172px, var(--pink), transparent),
    radial-gradient(1.4px 1.4px at 204px 196px, var(--yellow), transparent);
  background-size: 240px 240px;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--card-ink);
  font-weight: 800;
  text-decoration: none;
  transition: top 0.15s;
}
.skip:focus { top: 12px; }

.noscript { margin: 24px auto; max-width: 40ch; text-align: center; font-weight: 800; }

/* ---------- top bar with binder tabs ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 12px 0;
  background: rgba(12, 10, 29, 0.84);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
  font: 400 1.3rem/1 var(--display);
  text-decoration: none;
}
.brand__chip {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--foil);
  color: var(--card-ink);
  font-size: 1.5rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}
.brand__name { display: none; }

.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding-right: 22px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  --c: var(--cyan);
  flex: none;
  padding: 10px 12px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--c);
  font-weight: 800;
  font-size: 0.93rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.tabs a:nth-child(5n + 2) { --c: var(--pink); }
.tabs a:nth-child(5n + 3) { --c: var(--yellow); }
.tabs a:nth-child(5n + 4) { --c: var(--mint); }
.tabs a:nth-child(5n + 5) { --c: var(--violet); }
.tabs a:hover { background: rgba(255, 255, 255, 0.12); }
.tabs a[aria-current] { background: var(--c); border-color: var(--c); color: var(--card-ink); }

@media (min-width: 900px) {
  .topbar { padding: 10px 28px 0; }
  .brand__name { display: inline; }
  .tabs { padding-right: 0; -webkit-mask-image: none; mask-image: none; }
  .tabs a { padding: 10px 15px 9px; font-size: 1rem; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  font: 800 1.08rem/1.1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background-position 0.4s;
}
.btn--foil {
  background: var(--foil);
  background-size: 190% 100%;
  color: var(--card-ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.42), 0 12px 28px rgba(139, 123, 255, 0.35);
}
.btn--foil:hover { transform: translateY(-2px); background-position: 100% 0; }
.btn--foil:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.42); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.15); }
.btn--small { min-height: 42px; padding: 8px 18px; font-size: 0.95rem; }

.textbtn {
  justify-self: start;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 700 0.92rem var(--body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.textbtn:hover { color: var(--text); }
.textbtn.is-armed { color: var(--pink); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  gap: 34px;
  align-items: center;
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 68px) 0 clamp(20px, 4vw, 44px);
}
.eyebrow {
  margin-bottom: 10px;
  color: var(--cyan);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1 {
  margin-bottom: 18px;
  font: 400 clamp(2.2rem, 7.4vw, 3.6rem)/1 var(--display);
  letter-spacing: 0.01em;
}
.foil-text {
  display: block;
  width: -moz-fit-content;
  width: fit-content;
  padding-bottom: 0.06em;
  background: linear-gradient(100deg, #5ef2ff, #8b7bff 20%, #ff6bd6 40%, #ffe66b 60%, #6bffb0 80%, #5ef2ff);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(4.2rem, 19vw, 8.4rem);
  line-height: 0.95;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.4));
  animation: foil-slide 7s linear infinite;
}
.hero__lead { max-width: 34ch; color: var(--text); font-size: clamp(1.1rem, 3.4vw, 1.3rem); font-weight: 700; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.hero__card { display: grid; justify-items: center; gap: 16px; }
.hero__hint { color: var(--muted); font-weight: 800; font-size: 0.95rem; }

@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; gap: 48px; }
}

/* ---------- the big holo card ---------- */

.card3d {
  --rx: 6deg;
  --ry: -14deg;
  --flip: 0deg;
  width: min(330px, 82vw);
  animation: shimmer 6s ease-in-out infinite alternate;
}
.card3d.is-tracking { animation: none; }
.card3d.is-flipped { --flip: 180deg; }
.card3d__float { perspective: 1100px; animation: float 5.5s ease-in-out infinite; }
.card3d__inner {
  display: grid;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip)));
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}
.card3d.is-tracking .card3d__inner { transition-duration: 0.12s; }
.card3d.is-flipping .card3d__inner { transition-duration: 0.75s; }
.card3d__inner:focus-visible { outline-offset: 8px; }

.face {
  position: relative;
  grid-area: 1 / 1;
  overflow: hidden;
  padding: 10px;
  border-radius: 20px;
  background: var(--foil);
  background-size: 220% 220%;
  background-position: var(--mx) var(--my);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: 0 26px 44px rgba(0, 0, 0, 0.5);
}
.face--back { transform: rotateY(180deg); }

.card-stock {
  display: flex;
  flex-direction: column;
  gap: 9px;
  height: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--card-ink);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-name { font: 400 1.9rem/1 var(--display); }
.card-lv {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--card-ink);
  color: var(--yellow);
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.card-art {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(135deg, #2c2468, #6a4be0);
  box-shadow: 0 0 0 3px var(--card-ink);
}
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.card-art__k {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  font: 400 7rem/1 var(--display);
}
.card-art.has-photo .card-art__k { display: none; }
.holo-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 26%, rgba(94, 242, 255, 0.55) 38%, rgba(255, 107, 214, 0.5) 50%, rgba(255, 230, 107, 0.55) 62%, transparent 74%);
  background-size: 300% 300%;
  background-position: var(--mx) var(--my);
  mix-blend-mode: overlay;
  opacity: 0.8;
}
.holo-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.15) 28%, rgba(0, 0, 0, 0.22) 95%);
  mix-blend-mode: overlay;
  opacity: 0.55;
}
.card-types { display: flex; flex-wrap: wrap; gap: 4px; }
.type-chip {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(28, 24, 54, 0.1);
  font-weight: 900;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card-powers { display: grid; gap: 6px; }
.power { display: grid; grid-template-columns: 6.4em 1fr 1.6em; align-items: center; gap: 8px; font-weight: 800; font-size: 0.8rem; line-height: 1.1; }
.power__bar { height: 9px; overflow: hidden; border-radius: 99px; background: rgba(28, 24, 54, 0.13); }
.power__bar i { display: block; height: 100%; border-radius: inherit; background: var(--c, #7a5cff); }
.power:nth-child(4n + 1) { --c: #12b5c9; }
.power:nth-child(4n + 2) { --c: #e24bb5; }
.power:nth-child(4n + 3) { --c: #7a5cff; }
.power:nth-child(4n + 4) { --c: #ff9f1c; }
.power__val { text-align: right; font-weight: 900; }
.card-foot {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 2px;
  font-weight: 800;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.card-back {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 18px 16px 14px;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, #1a1640 0 14px, #211c50 14px 28px);
  color: var(--text);
}
.file-title { color: var(--yellow); font: 400 1.6rem/1 var(--display); }
.file-rows { display: grid; gap: 9px; }
.file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
  font-size: 0.92rem;
  line-height: 1.25;
}
.file-row span { color: var(--muted); font-weight: 700; }
.file-row strong { font-weight: 900; text-align: right; }
.file-row .is-secret { color: var(--pink); letter-spacing: 0.12em; }
.file-note { margin-top: auto; color: var(--muted); font-size: 0.78rem; font-weight: 700; text-align: center; }

/* ---------- binder pages ---------- */

.page {
  position: relative;
  width: min(1120px, 100% - 20px);
  margin: 64px auto 0;
  padding: 26px 14px 22px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--tab);
  border-radius: 0 22px 22px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.028));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  scroll-margin-top: 96px;
}
.page__no {
  position: absolute;
  left: -1px;
  top: -5px;
  transform: translateY(-100%);
  padding: 7px 14px 5px;
  border-radius: 11px 11px 0 0;
  background: var(--tab);
  color: var(--card-ink);
  font-weight: 900;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.page__head { margin-bottom: 20px; }
.page__head h2 { font: 400 clamp(2.1rem, 8vw, 3.1rem)/1 var(--display); letter-spacing: 0.01em; }
.page__head h2::after {
  content: "";
  display: block;
  width: 68px;
  height: 6px;
  margin: 12px 0 12px;
  border-radius: 99px;
  background: var(--tab);
}
.page__head p { max-width: 58ch; color: var(--muted); font-weight: 700; }

@media (min-width: 900px) {
  .page { padding: 34px 38px 34px 78px; }
  /* three punched ring holes */
  .page::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 30px;
    bottom: 30px;
    width: 26px;
    background: radial-gradient(circle, #06050f 0 8px, rgba(255, 255, 255, 0.22) 8.5px 10px, transparent 10.5px) center / 26px 33.34% repeat-y;
  }
}

.split { display: grid; gap: 18px; }
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(280px, 350px) 1fr; align-items: start; gap: 26px; }
}

/* ---------- plastic sleeves ---------- */

.sleeves { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 680px) { .sleeves { grid-template-columns: repeat(4, 1fr); gap: 14px; } }

.sleeves--photos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); align-items: start; }
@media (min-width: 680px) { .sleeves--photos { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); } }

.sleeve {
  position: relative;
  display: grid;
  padding: 8px;
  border-top: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px 6px 16px 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04) 46%, rgba(255, 255, 255, 0.09));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 22px rgba(0, 0, 0, 0.26);
}
/* the shine on the plastic */
.sleeve::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0) 24%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.1) 100%);
}

.fact {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 100%;
  padding: 12px 12px 14px;
  border-top: 7px solid var(--c, #7a5cff);
  border-radius: 10px;
  background: var(--cream);
  color: var(--card-ink);
}
.sleeve:nth-child(5n + 1) .fact { --c: #12b5c9; }
.sleeve:nth-child(5n + 2) .fact { --c: #e24bb5; }
.sleeve:nth-child(5n + 3) .fact { --c: #ff9f1c; }
.sleeve:nth-child(5n + 4) .fact { --c: #19b36b; }
.fact__icon { font-size: 1.9rem; line-height: 1.15; }
.fact__label { font-weight: 900; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.66; }
.fact__value { font: 400 1.4rem/1.08 var(--display); }
.fact__note { font-weight: 700; font-size: 0.86rem; line-height: 1.3; opacity: 0.82; }
.fact--mystery {
  border-top-color: var(--yellow);
  background: repeating-linear-gradient(135deg, #1a1640 0 12px, #231d55 12px 24px);
  color: var(--text);
}
.fact--mystery .fact__icon { color: var(--yellow); font-family: var(--display); }

.sleeve--photo { gap: 8px; align-content: start; }
.photo {
  display: block;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--cream);
  cursor: zoom-in;
  transition: transform 0.18s;
}
.photo:hover { transform: rotate(-1.2deg) scale(1.02); }
.photo img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.sleeve--photo figcaption { padding: 0 4px 4px; font-weight: 800; font-size: 0.92rem; line-height: 1.25; text-align: center; }

.empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  aspect-ratio: 3 / 4.4;
  padding: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.25;
  text-align: center;
}
.empty__icon { font-size: 1.7rem; filter: grayscale(0.3); }

/* ---------- play: rip a pack ---------- */

.play { display: grid; gap: 22px; }
@media (min-width: 900px) {
  .play { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; gap: 30px; }
}

.stage {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  min-height: 372px;
  padding: 22px 6px;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: radial-gradient(closest-side at 50% 45%, rgba(139, 123, 255, 0.3), transparent), rgba(0, 0, 0, 0.26);
}
@media (min-width: 900px) { .stage { min-height: 452px; position: sticky; top: 84px; } }
.stage__hint { min-height: 1.5em; font-weight: 800; font-size: 1.05rem; text-align: center; }

.pack {
  display: block;
  width: clamp(150px, 46vw, 196px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--card-ink);
  cursor: pointer;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.55));
  animation: pack-idle 2.8s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.pack > span { display: block; }
.pack:hover { animation-duration: 0.9s; }
.pack__top,
.pack__bottom { height: 18px; background: repeating-linear-gradient(90deg, #f3f5ff 0 2px, #a9b0ea 2px 5px); }
.pack__top { border-radius: 5px 5px 0 0; transform-origin: 0 100%; }
.pack__bottom { border-radius: 0 0 5px 5px; }
.pack > .pack__body {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  aspect-ratio: 5 / 6.5;
  overflow: hidden;
  padding: 14px;
  background: var(--foil);
  background-size: 230% 230%;
  text-align: center;
  animation: foil-drift 5s ease-in-out infinite alternate;
}
.pack__body::before {
  content: "";
  position: absolute;
  inset: -40% -70%;
  background: linear-gradient(105deg, transparent 43%, rgba(255, 255, 255, 0.8) 50%, transparent 57%);
  animation: streak 3.4s ease-in-out infinite;
}
.pack__body::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(28, 24, 54, 0.55);
  border-radius: 10px;
}
.pack__star,
.pack__title,
.pack__sub { position: relative; }
.pack__star { font-size: 2.3rem; line-height: 1; }
.pack__title { font: 400 clamp(1.6rem, 7.4vw, 2.05rem)/0.95 var(--display); text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6); }
.pack__sub {
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--card-ink);
  color: var(--yellow);
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pack.is-new { animation: pack-in 0.26s ease-out; }
.pack.is-ripping { animation: shake 0.45s; }
.pack.is-ripping .pack__top { animation: tear 0.45s 0.08s ease-in forwards; }
.pack.is-gone { animation: pack-out 0.24s ease-in forwards; }

.reveal { display: flex; justify-content: center; gap: clamp(7px, 2.2vw, 14px); width: 100%; padding: 10px 2px 2px; }
.flipcard {
  position: relative;
  flex: 1 1 0;
  max-width: 132px;
  perspective: 700px;
  cursor: pointer;
  animation: deal 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  animation-delay: calc(var(--i, 0) * 110ms);
  -webkit-tap-highlight-color: transparent;
}
.flipcard__inner {
  display: grid;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  transition: transform 0.6s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.flipcard:not(.is-flipped):hover .flipcard__inner { transform: rotateY(180deg) translateY(-7px); }
.flipcard.is-flipped .flipcard__inner { transform: rotateY(0deg); }
.flipcard__front,
.flipcard__back {
  position: relative;
  grid-area: 1 / 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flipcard__back { transform: rotateY(180deg); }
.flipcard.is-flipped.r-epic .mini__face { animation: glow-epic 1.5s ease-out 0.3s both; }
.flipcard.is-flipped.r-legendary .mini__face { animation: glow-legend 1.3s ease-in-out 0.3s infinite alternate; }

.badge-new {
  position: absolute;
  right: -7px;
  top: -9px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--pink);
  color: var(--card-ink);
  font-weight: 900;
  font-size: 0.72rem;
  line-height: 1.4;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(9deg) scale(0);
  transition: transform 0.3s 0.4s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.flipcard.is-flipped .badge-new { transform: rotate(9deg) scale(1); }

/* ---------- collectible cards (one design, any size) ---------- */

.r-common { --rb: linear-gradient(135deg, #d5dbf0, #98a2c9); --art: linear-gradient(135deg, #eef2ff, #c6d1f7); }
.r-rare { --rb: linear-gradient(135deg, #5ef2ff, #3b82f6); --art: linear-gradient(135deg, #c9fbff, #8cc4ff); }
.r-epic { --rb: linear-gradient(135deg, #b78bff, #ff6bd6); --art: linear-gradient(135deg, #ead9ff, #ffc0ec); }
.r-legendary { --rb: var(--foil); --art: linear-gradient(135deg, #fff3b0, #ffd166 48%, #ffb3ec); }

.mini { display: block; width: 100%; container-type: inline-size; }
.mini__face,
.mini__back {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 5 / 7;
  overflow: hidden;
  border: 3px solid transparent;
  border-width: 2.8cqw;
  border-radius: 8px;
  border-radius: 7cqw;
}
.mini__face {
  gap: 4px;
  gap: 3.4cqw;
  padding: 5px;
  padding: 5cqw;
  background: linear-gradient(var(--cream), var(--cream)) padding-box, var(--rb, var(--foil)) border-box;
  color: var(--card-ink);
  text-align: left;
}
.mini__name {
  display: none;
  align-items: center;
  min-height: 2.1em;
  font: 400 11px/1.05 var(--display);
  font-size: 10.4cqw;
}
.mini__art {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 4px;
  border-radius: 4.5cqw;
  background: var(--art, #eef2ff);
  box-shadow: inset 0 0 0 1px rgba(28, 24, 54, 0.7);
  font-size: 40px;
  font-size: 46cqw;
  line-height: 1;
}
.mini__text { display: none; font-weight: 700; font-size: 6.2cqw; line-height: 1.25; min-height: 2.5em; }
.mini__foot { display: none; justify-content: space-between; font-weight: 900; font-size: 4.4cqw; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.72; }
@container (min-width: 90px) {
  .mini__name { display: flex; }
  .mini__art { font-size: 40cqw; }
}
@container (min-width: 150px) { .mini__foot { display: flex; } }
@container (min-width: 200px) { .mini__text { display: block; } }

/* a foil sheen on the best cards */
.r-epic .mini__face::after,
.r-legendary .mini__face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.7) 46%, rgba(94, 242, 255, 0.45) 52%, transparent 66%);
  background-size: 260% 260%;
  mix-blend-mode: overlay;
  animation: foil-drift 3.6s ease-in-out infinite alternate;
}

.mini__back {
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, #1a1640 0 6px, #241e58 6px 12px) padding-box, var(--foil) border-box;
}
.mini__back span {
  display: grid;
  place-items: center;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--foil);
  color: var(--card-ink);
  font: 400 26px/1 var(--display);
  font-size: 32cqw;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

/* ---------- collection ---------- */

.collection { display: grid; gap: 14px; align-content: start; }
.collection__bar { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px 12px; }
.collection__count { font: 400 1.3rem/1.1 var(--display); }
.collection__count strong { color: var(--yellow); font-weight: 400; font-size: 1.9rem; }
.collection__packs { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.meter { grid-column: 1 / -1; height: 12px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.11); }
.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--foil);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.coll-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 520px) { .coll-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; } }

.slot {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: transform 0.15s;
}
.slot:hover { transform: translateY(-4px) rotate(-1.5deg); }
.slot.is-pop { animation: pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.slot--locked {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  aspect-ratio: 5 / 7;
  border: 2px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.42);
  cursor: default;
}
.slot--locked:hover { transform: none; }
.slot__q { font: 400 clamp(1.3rem, 5.4vw, 1.9rem)/1 var(--display); }
.slot__no { font-weight: 800; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.slot--secret { border-color: rgba(255, 230, 107, 0.55); background: rgba(255, 230, 107, 0.07); color: var(--yellow); }
.slot__count {
  position: absolute;
  right: -5px;
  top: -6px;
  min-width: 26px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--card-ink);
  color: var(--yellow);
  font-weight: 900;
  font-size: 0.74rem;
  line-height: 1.6;
  box-shadow: 0 0 0 2px var(--yellow);
}

/* ---------- videos ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px;
  padding: 6px 15px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 99px;
  background: transparent;
  color: var(--text);
  font: 800 0.95rem var(--body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--tab); }
.chip[aria-pressed="true"] { border-color: var(--tab); background: var(--tab); color: var(--card-ink); }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
@media (min-width: 680px) { .vgrid { grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 16px; } }

.vcard {
  /* a column, so a card stretched to its row keeps the picture at the top */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--ink-3);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.18s, box-shadow 0.18s;
}
.vcard:hover { transform: translateY(-4px) rotate(-0.6deg); box-shadow: inset 0 0 0 2px var(--yellow), 0 14px 26px rgba(0, 0, 0, 0.42); }
.vcard > span { display: block; width: 100%; }
.vcard__thumb { position: relative; flex: none; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.vcard__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vcard__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(12, 10, 29, 0.74);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.88);
  transition: transform 0.18s, background 0.18s;
}
.vcard__play::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 13px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #fff;
}
.vcard:hover .vcard__play { transform: scale(1.12); background: #e5484d; }
.vcard__len {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(12, 10, 29, 0.86);
  font-weight: 800;
  font-size: 0.74rem;
  line-height: 1.5;
}
.vcard .vcard__body { display: grid; gap: 8px; padding: 11px 12px 14px; }
.vcard__tag {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--c, var(--cyan));
  color: var(--card-ink);
  font-weight: 900;
  font-size: 0.66rem;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.t-pokemon { --c: var(--yellow); }
.t-roblox { --c: var(--pink); }
.t-games { --c: var(--mint); }
.t-diy { --c: var(--cyan); }
.t-video { --c: var(--cream); }
.vcard__title { font-weight: 800; font-size: 0.92rem; line-height: 1.3; }
@media (min-width: 680px) { .vcard__title { font-size: 1rem; } }

/* ---------- baseball ---------- */

.bbcard {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 6px solid var(--violet);
  border-radius: 20px;
  background: var(--cream);
  color: var(--card-ink);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.38);
  transform: rotate(-1.4deg);
}
.bbcard__art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: repeating-conic-gradient(from 0deg at 50% 56%, #ffd69a 0 12deg, #ffe9c6 12deg 24deg);
  box-shadow: inset 0 0 0 3px var(--card-ink);
}
.bbcard__ball { width: 42%; margin-bottom: 12%; filter: drop-shadow(0 7px 0 rgba(28, 24, 54, 0.2)); animation: ball-bob 3.2s ease-in-out infinite; }
.bbcard__banner {
  position: absolute;
  left: 50%;
  bottom: 9%;
  padding: 6px 20px 8px;
  border-radius: 7px;
  background: #e5484d;
  color: #fff;
  font: 400 1.55rem/1 var(--display);
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(28, 24, 54, 0.32);
  transform: translateX(-50%) rotate(-3deg);
}
.stats { display: grid; margin: 0; }
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 4px;
  border-bottom: 2px dotted rgba(28, 24, 54, 0.26);
}
.stat:last-child { border-bottom: 0; }
.stat dt { font-weight: 900; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
.stat dd { font: 400 1.15rem/1.1 var(--display); text-align: right; }
.stat dd.is-secret { color: #8f88b8; letter-spacing: 0.14em; }

/* ---------- ski: a little snow on the page ---------- */

#ski {
  background-image:
    radial-gradient(2px 2px at 22px 30px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.6px 1.6px at 104px 86px, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(2.2px 2.2px at 150px 132px, rgba(255, 255, 255, 0.4), transparent),
    linear-gradient(180deg, rgba(94, 242, 255, 0.1), rgba(255, 255, 255, 0.03));
  background-size: 188px 188px, 232px 232px, 172px 172px, auto;
}

/* ---------- roblox ---------- */

.rbx {
  display: grid;
  gap: 22px;
  align-items: center;
  justify-items: center;
  padding: 22px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
}
@media (min-width: 780px) {
  .rbx { grid-template-columns: auto 1fr 1fr; justify-items: start; gap: 34px; padding: 30px 34px; text-align: left; }
}
.blocky { position: relative; flex: none; width: 124px; height: 164px; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.3)); }
.blocky span { position: absolute; border-radius: 7px; }
.blocky__head { left: 39px; top: 0; width: 46px; height: 46px; background: var(--yellow); }
.blocky__head::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 15px;
  width: 6px;
  height: 8px;
  border-radius: 3px;
  background: var(--card-ink);
  box-shadow: 18px 0 0 var(--card-ink);
}
.blocky__head::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 26px;
  width: 20px;
  height: 9px;
  border: 3px solid var(--card-ink);
  border-top: 0;
  border-radius: 0 0 12px 12px;
}
.blocky__body { left: 33px; top: 50px; width: 58px; height: 58px; background: var(--cyan); }
.blocky__arm { top: 50px; width: 24px; height: 58px; background: var(--yellow); }
.blocky__arm--l { left: 6px; }
.blocky__arm--r { left: 94px; transform-origin: 50% 8px; animation: wave 2.4s ease-in-out infinite; }
.blocky__leg { top: 111px; width: 27px; height: 50px; background: var(--violet); }
.blocky__leg--l { left: 33px; }
.blocky__leg--r { left: 64px; }

.rbx__info { display: grid; gap: 10px; justify-items: inherit; }
.rbx__label { color: var(--muted); font-weight: 900; font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; }
.rbx__user { font: 400 clamp(1.8rem, 8vw, 2.5rem)/1 var(--display); overflow-wrap: anywhere; }
.rbx__safe { max-width: 30ch; color: var(--muted); font-weight: 700; font-size: 0.9rem; line-height: 1.35; }
.rbx__games { display: grid; gap: 10px; justify-items: inherit; width: 100%; }
.rbx__games ul { display: grid; gap: 8px; width: 100%; }
.rbx__games li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 800;
  text-align: left;
}
.rbx__games li::before {
  content: counter(game);
  counter-increment: game;
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--pink);
  color: var(--card-ink);
  font: 400 1rem/1 var(--display);
}
.rbx__games ul { counter-reset: game; }
.rbx__games li.is-secret { color: var(--muted); }

/* ---------- twin ---------- */

.twin { display: grid; gap: 18px; }
@media (min-width: 780px) { .twin { grid-template-columns: minmax(200px, 270px) 1fr; align-items: center; gap: 30px; } }
.twin .sleeves--photos { grid-template-columns: minmax(0, 270px); justify-content: center; }
/* Ayden's ballpark colours, so the link looks like a door to his site */
.twin__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 20px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 34px, transparent 34px 68px),
    linear-gradient(135deg, #1f7a43, #2f9a57);
  color: #fff;
  text-decoration: none;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85), 0 16px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s;
}
.twin__link:hover { transform: translateY(-4px) rotate(0.6deg); }
.twin__chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #c8693c;
  font: 400 2.2rem/1 var(--display);
  box-shadow: inset 0 0 0 3px #fff;
}
.twin__text { display: grid; gap: 2px; min-width: 0; }
.twin__text strong { font: 400 clamp(1.35rem, 5.4vw, 2rem)/1.08 var(--display); }
.twin__text span { font-weight: 800; opacity: 0.9; overflow-wrap: anywhere; }
.twin__arrow { margin-left: auto; font: 400 2.2rem/1 var(--display); transition: transform 0.18s; }
.twin__link:hover .twin__arrow { transform: translateX(6px); }

/* ---------- footer ---------- */

.footer { display: grid; gap: 6px; margin-top: 64px; padding: 30px 20px 44px; border-top: 1px solid var(--line); text-align: center; font-weight: 800; }
.footer__small { color: var(--muted); font-weight: 700; font-size: 0.88rem; }

/* ---------- pop-ups ---------- */

.dialog {
  width: 100%;
  max-width: min(94vw, 900px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.dialog[open] { animation: pop 0.28s cubic-bezier(0.3, 1.4, 0.5, 1); }
.dialog::backdrop { background: rgba(6, 5, 15, 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog__box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--ink-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog__bar h3 { font: 400 1.25rem/1.2 var(--display); }
.dialog__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}
.dialog__close:hover { background: var(--pink); color: var(--card-ink); }
.dialog__frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #000; }
.dialog__frame.is-short { aspect-ratio: 9 / 16; max-height: 70vh; margin-inline: auto; }
.dialog__frame iframe { display: block; width: 100%; height: 100%; border: 0; }

.dialog--photo { max-width: min(94vw, 540px); }
.dialog--photo img { width: 100%; max-height: 74vh; object-fit: contain; border-radius: 12px; }

.dialog--card { max-width: min(94vw, 600px); }
.cardview { display: grid; gap: 18px; justify-items: center; padding: 4px 6px 10px; text-align: center; }
.cardview__card { width: min(240px, 62vw); }
.cardview__info { display: grid; gap: 12px; justify-items: center; }
.cardview__text { font-weight: 800; font-size: 1.15rem; line-height: 1.35; }
.cardview__count { color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.rarity-chip {
  padding: 6px 13px;
  border-radius: 99px;
  background: var(--rb);
  color: var(--card-ink);
  font-weight: 900;
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
@media (min-width: 560px) {
  .cardview { grid-template-columns: 240px 1fr; align-items: center; gap: 24px; text-align: left; }
  .cardview__info { justify-items: start; }
}

/* ---------- confetti ---------- */

.confetti { position: fixed; inset: 0; z-index: 200; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -24px; border-radius: 2px; animation: confetti-fall linear both; }

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

@keyframes foil-slide { to { background-position: -250% 0; } }
@keyframes foil-drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@keyframes shimmer { from { --mx: 12%; --my: 18%; } to { --mx: 88%; --my: 82%; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes streak { 0%, 55% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
@keyframes pack-idle { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-6px); } }
@keyframes pack-in { from { transform: translateY(-36px) scale(0.9); opacity: 0; } }
@keyframes pack-out { to { transform: translateY(26px) scale(0.9); opacity: 0; } }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-5deg); }
  40% { transform: rotate(5deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(3deg); }
}
@keyframes tear { to { transform: translate(-22px, -44px) rotate(-24deg); opacity: 0; } }
@keyframes deal { from { transform: translateY(42px) scale(0.7); opacity: 0; } }
@keyframes pop { from { transform: scale(0.82); opacity: 0; } }
@keyframes glow-epic {
  0% { box-shadow: 0 0 0 0 rgba(183, 139, 255, 0); }
  30% { box-shadow: 0 0 26px 6px rgba(200, 130, 255, 0.95); }
  100% { box-shadow: 0 0 12px 1px rgba(200, 130, 255, 0.5); }
}
@keyframes glow-legend {
  from { box-shadow: 0 0 14px 2px rgba(255, 230, 107, 0.65); }
  to { box-shadow: 0 0 34px 10px rgba(255, 180, 60, 0.95); }
}
@keyframes ball-bob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-7px) rotate(8deg); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 70%, 90% { transform: rotate(-150deg); } 80% { transform: rotate(-125deg); } }
@keyframes confetti-fall { to { transform: translate(var(--dx, 0), 108vh) rotate(var(--rot, 360deg)); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .card3d { animation: none; }
}
