/* ============ Tokens ============ */
:root {
  --night: #17153b;
  --night-2: #1e1b4b;
  --panel: #24205a;
  --line: #2d2970;
  --line-2: #4a4590;
  --ink: #f5f3ff;
  --muted: #c4bff0;
  --muted-2: #a9a3e0;
  --cream: #fffaf0;
  --gold: #ffd23f;
  --gold-dark: #b8941a;
  --pink: #ff8fc4;
  --blue: #7cc4ff;
  --green: #7ee2a8;
  --lilac: #c9b6ff;
  --orange: #ffc27a;
  --red: #ff6b6b;
  --shadow: #0c0a26;
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: var(--body); line-height: 1.5; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--gold); }
a:hover { color: #fff; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--night); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 900; }
.skip:focus { left: 8px; }

.wrap { max-width: 1200px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 32px; }
.section { padding: 88px 24px; }
.section--alt { background: var(--night-2); }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; }
.kicker { display: block; font-size: 14px; font-weight: 900; letter-spacing: 2px; margin-bottom: 8px; }
.h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 9vw, 52px); line-height: 1.05; }
.h2--big { font-size: clamp(38px, 10vw, 58px); }
.muted { color: var(--muted); font-size: 18px; margin: 8px 0 0; }
.strong { font-weight: 800; margin: 0; }
.gold { color: var(--gold); } .blue { color: var(--blue); } .green { color: var(--green); } .orange { color: var(--orange); } .pink { color: var(--pink); }
.num { font-family: var(--display); font-weight: 800; font-size: 22px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }

.tag { display: inline-block; font-size: 12px; font-weight: 900; letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; }
.tag--dark { background: var(--night); color: var(--gold); }
.tag--dark-pink { background: var(--night); color: var(--pink); font-family: var(--display); font-size: 15px; align-self: flex-start; padding: 2px 10px; }
.pill { align-self: flex-start; background: var(--line); border: 2px solid var(--pink); color: var(--pink); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 900; letter-spacing: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 26px; border-radius: 16px; font-family: var(--display); font-weight: 800; font-size: 21px; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.btn--gold { background: var(--gold); color: var(--night); border: 0; box-shadow: 0 6px 0 var(--gold-dark); }
.btn--gold:hover { color: var(--night); transform: translateY(-2px); box-shadow: 0 8px 0 var(--gold-dark); }
.btn--gold:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-dark); }
.btn--ghost { background: transparent; color: var(--ink); border: 3px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--night); }
.btn-small { background: transparent; border: 2px solid var(--line-2); color: var(--muted); border-radius: 12px; padding: 10px 16px; font-weight: 800; font-size: 14px; cursor: pointer; min-height: 44px; }
.btn-small:hover { border-color: var(--gold); color: var(--gold); }

/* ============ Animations ============ */
@keyframes deal { from { opacity: 0; transform: translateY(60px) rotate(-10deg) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes shine { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes fall { 0% { transform: translate3d(0, -40px, 0) rotate(0); opacity: 1; } 100% { transform: translate3d(var(--dx), 900px, 0) rotate(var(--rot)); opacity: 0; } }
@keyframes holo { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.4) rotate(-20deg); } 70% { opacity: 1; transform: scale(1.06) rotate(3deg); } 100% { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ============ Nav ============ */
.nav { border-bottom: 2px solid var(--line); padding: 16px 24px; }
.nav__row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__title { font-family: var(--display); font-weight: 800; font-size: 22px; }
.nav__links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-weight: 800; font-size: 15px; }
.nav__links a { color: var(--ink); text-decoration: none; }
.nav__links a:hover { color: var(--gold); }
.nav__links .nav__cta { color: var(--gold); }
.logo { width: 40px; height: 52px; padding: 0; border-radius: 8px; background: var(--gold); border: 3px solid var(--cream); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--night); cursor: pointer; transition: transform .15s; transform: rotate(var(--logo-rot, -6deg)) scale(var(--logo-scale, 1)); }
.sound { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 14px; min-height: 40px; font-weight: 900; font-size: 14px; cursor: pointer; background: transparent; color: var(--muted); border: 2px solid var(--line-2); }
.sound .sound__on { display: none; }
.sound[aria-pressed="true"] { background: var(--gold); color: var(--night); border-color: var(--gold); }
.sound[aria-pressed="true"] .sound__on { display: block; }
.sound[aria-pressed="true"] .sound__off { display: none; }

/* ============ Hero ============ */
.hero { padding: 72px 24px 88px; }
.hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.hero__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.display { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(50px, 13vw, 84px); line-height: 1.05; letter-spacing: -1px; }
.lead { margin: 0; font-size: 21px; line-height: 1.6; color: var(--muted); max-width: 560px; }
.hero__btns { display: flex; gap: 14px; flex-wrap: wrap; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 0; padding-top: 8px; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 14px; font-weight: 800; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.1; }

.hero__card { flex: 0 1 360px; min-width: 0; display: flex; justify-content: center; }
.player { width: 340px; max-width: 100%; background: var(--gold); border-radius: 26px; padding: 12px; box-shadow: 0 16px 0 var(--shadow); animation: bob 5s ease-in-out infinite; }
.player__inner { position: relative; overflow: hidden; background: var(--cream); border-radius: 18px; padding: 16px; color: var(--night); display: flex; flex-direction: column; gap: 12px; }
.player__shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.7) 50%, transparent 60%); background-size: 200% 100%; animation: shine 4s linear infinite; }
.player__top { display: flex; justify-content: space-between; align-items: center; }
.player img { width: 100%; height: 250px; object-fit: cover; border-radius: 14px; border: 4px solid var(--night); }
.player__name { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; }
.player__class { font-size: 14px; font-weight: 800; color: #4a4570; margin-top: -8px; }
.player__stats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.player__stats li { display: flex; justify-content: space-between; gap: 8px; border-top: 2px dashed #d8d2f0; padding-top: 6px; }
.player__stats b { font-weight: 900; text-align: right; }

/* ============ Collection ============ */
.collection { position: relative; overflow: hidden; padding-top: 80px; }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.confetti span { position: absolute; top: 0; animation: fall var(--dur, 2s) cubic-bezier(.2,.6,.4,1) var(--delay, 0s) both; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter { border-radius: 999px; padding: 10px 18px; font-weight: 900; font-size: 15px; cursor: pointer; min-height: 44px; background: transparent; color: var(--ink); border: 2px solid var(--line-2); }
.filter span { opacity: .7; }
.filter[aria-pressed="true"] { background: var(--gold); color: var(--night); border-color: var(--gold); }

.pack { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 40px 0; }
.pack__btn { width: 260px; height: 360px; border-radius: 24px; border: 6px solid var(--cream); background: repeating-linear-gradient(135deg, var(--pink) 0 24px, #ff6fae 24px 48px); box-shadow: 0 14px 0 var(--shadow); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; animation: bob 2.4s ease-in-out infinite; padding: 0; }
.pack__label { background: var(--night); color: var(--gold); font-family: var(--display); font-weight: 800; font-size: 30px; padding: 6px 22px; border-radius: 14px; }
.pack__count { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--night); }
.pack__hint { font-family: var(--display); font-weight: 800; font-size: 24px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: clamp(14px, 3vw, 22px); }
.card {
  --c: var(--gold); --rx: 0deg; --ry: 0deg; --lift: 0px; --scale: 1;
  position: relative; overflow: hidden; display: block; width: 100%; min-height: 340px; padding: 16px; text-align: left; cursor: pointer;
  border-radius: 20px; border: 6px solid var(--c); background: var(--cream); color: var(--night);
  box-shadow: 0 8px 0 var(--shadow);
  transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift)) scale(var(--scale));
  transition: transform .35s ease-out, box-shadow .2s;
  animation: deal .55s cubic-bezier(.2,.9,.3,1.2) backwards; animation-delay: var(--deal-delay, 0ms);
}
.card.is-tilting { transition: transform .08s ease-out, box-shadow .2s; --scale: 1.04; }
.card[aria-pressed="true"] { --lift: -8px; box-shadow: 0 0 0 5px var(--gold), 0 14px 0 var(--shadow); }
.card__body { position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.card__top { display: flex; justify-content: space-between; align-items: center; }
.card__rarity { background: var(--c); color: var(--night); font-size: 11px; font-weight: 900; letter-spacing: 1px; padding: 4px 8px; border-radius: 999px; border: 2px solid var(--night); }
.card__no { font-family: var(--display); font-weight: 800; font-size: 20px; }
.card__art { width: 100%; height: 130px; object-fit: cover; border-radius: 14px; background: var(--c); border: 3px solid var(--night); }
.card__name { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.05; }
.card__type { font-size: 14px; font-weight: 800; color: #4a4570; }
.card__foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 13px; font-weight: 900; border-top: 2px solid var(--night); padding-top: 8px; }
.holo { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .38; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 20%, var(--pink) 35%, var(--gold) 45%, var(--green) 55%, var(--blue) 65%, transparent 80%);
  background-size: 250% 100%; animation: holo 4s linear infinite; }
.card.is-tilting .holo { animation: none; background-position: var(--gx, 50%) 50%; }

.reseal-row { display: flex; justify-content: flex-end; margin: 24px 0; }

.detail { --c: var(--gold); display: flex; flex-wrap: wrap; gap: 40px; align-items: center; background: var(--panel); border: 3px solid var(--c); border-radius: 28px; padding: clamp(18px, 5vw, 36px); scroll-margin-top: 24px; }
.detail__cardwrap { flex: 0 1 300px; min-width: 0; display: flex; justify-content: center; }
.bigcard { position: relative; overflow: hidden; width: 280px; max-width: 100%; background: var(--cream); color: var(--night); border: 8px solid var(--c); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 0 var(--shadow); transform: rotate(-3deg); }
.bigcard .card__rarity { font-size: 12px; padding: 4px 10px; }
.bigcard__art { width: 100%; height: 160px; object-fit: cover; border-radius: 16px; background: var(--c); border: 3px solid var(--night); }
.bigcard__name { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.05; }
.label-dark { font-size: 13px; font-weight: 900; letter-spacing: 1px; }
.power { background: var(--night); color: var(--gold); border-radius: 12px; padding: 12px; font-weight: 900; font-size: 16px; }
.detail__info { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.detail__kicker { font-size: 14px; font-weight: 900; letter-spacing: 2px; color: var(--c); }
.detail__name { margin: 6px 0 10px; font-family: var(--display); font-weight: 800; font-size: clamp(30px, 8vw, 44px); line-height: 1.05; }
.detail__desc { margin: 0; font-size: 19px; line-height: 1.6; color: #dcd8fb; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.facts div { background: var(--night); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.facts dt { font-size: 12px; font-weight: 900; letter-spacing: 1px; color: var(--muted-2); }
.facts dd { margin: 0; font-weight: 800; font-size: 16px; }
.gains { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gains li { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; line-height: 1.5; }
.gains li::before { content: ""; flex-shrink: 0; width: 12px; height: 12px; border-radius: 3px; margin-top: 7px; transform: rotate(45deg); background: var(--c); }
.label-muted { font-size: 13px; font-weight: 900; letter-spacing: 1px; color: var(--muted-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.chips li { border: 2px solid var(--line-2); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; }
.detail__visit { align-self: flex-start; font-size: 19px; min-height: 48px; padding: 10px 20px; }
.detail__hero { flex: 1 1 100%; min-width: 0; }
.detail__hero img { width: 100%; aspect-ratio: 3 / 2; max-height: 620px; object-fit: cover; border-radius: 20px; border: 4px solid var(--night); background: var(--night); }

/* ============ Seasons ============ */
.seasons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.season { background: var(--panel); border: 3px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.season__when { font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--muted-2); }
.season__title { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.15; }
.season__text { font-size: 16px; color: var(--muted); }
.season--active { background: var(--pink); color: var(--night); border-color: var(--cream); box-shadow: 0 8px 0 var(--shadow); }
.season--active .season__text { color: var(--night); font-weight: 700; }

/* ============ Badges ============ */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); } .badge { padding: 16px; } .badge__title { font-size: 19px; } }
.badge { --c: var(--gold); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 3px solid var(--c); }
.badge__medal { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--c); color: var(--night); }
.badge__title { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; }
.badge__desc { font-size: 14px; line-height: 1.45; opacity: .85; }
.badge--locked { background: transparent; border: 3px dashed var(--line-2); color: var(--muted-2); }
.badge--locked .badge__medal { background: var(--panel); color: var(--muted-2); }

/* ============ Skills ============ */
.skills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.skill { --c: var(--gold); display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: 14px; background: var(--cream); color: var(--night); box-shadow: inset 0 -6px 0 var(--c), 0 6px 0 var(--shadow); min-width: 120px; }
.skill b { font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1.2; }
.skill span { font-size: 12px; font-weight: 900; letter-spacing: 1px; opacity: .8; }

/* ============ Contact ============ */
.contact { padding: 0 24px 96px; }
.contact__box { background: var(--gold); color: var(--night); border-radius: 32px; padding: clamp(28px, 6vw, 56px) clamp(20px, 5vw, 48px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; box-shadow: 0 14px 0 var(--gold-dark); }
.contact__text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.contact__text p { margin: 0; font-size: 20px; line-height: 1.55; font-weight: 700; }
.contact__links { flex: 0 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.contact__mail { background: var(--night); color: var(--gold); text-decoration: none; border-radius: 16px; padding: 16px 18px; font-family: var(--display); font-weight: 800; font-size: clamp(14px, 4.1vw, 21px); text-align: center; overflow-wrap: anywhere; }
.contact__mail:hover { color: #fff; }
.contact__social { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contact__social a { border: 3px solid var(--night); color: var(--night); text-decoration: none; border-radius: 14px; padding: 13px 4px; font-size: 14px; font-weight: 900; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.contact__social a:hover { background: var(--night); color: var(--gold); }
.contact__handle { font-size: 15px; font-weight: 800; text-align: center; }
.footer-note { margin: 28px auto 0; text-align: center; font-size: 14px; color: #8a84c4; font-weight: 700; }

/* ============ Secret modal ============ */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(12,10,38,.88); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadein .3s ease both; overflow-y: auto; }
.modal__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; max-width: 100%; }
.modal__title { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--gold); text-align: center; }
.modal__btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.secret-card { position: relative; overflow: hidden; width: 320px; max-width: 100%; background: var(--cream); border: 8px solid var(--night); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; color: var(--night); box-shadow: 0 0 0 6px var(--gold), 0 18px 0 var(--shadow); animation: pop .7s cubic-bezier(.2,.9,.3,1.3) both; }
.secret-card > * { position: relative; }
.secret-card .secret-card__holo { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .45; mix-blend-mode: multiply; background: linear-gradient(115deg, var(--pink), var(--gold), var(--green), var(--blue), var(--lilac), var(--pink)); background-size: 200% 100%; animation: holo 3s linear infinite; }
.secret-card__art { height: 150px; border-radius: 16px; background: var(--night); display: flex; align-items: center; justify-content: center; }
.secret-card__name { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; }
.secret-card__text { font-size: 15px; line-height: 1.5; font-weight: 700; }
.secret-card .power { font-size: 15px; padding: 10px; }

/* ============ Small screens ============ */
@media (max-width: 640px) {
  .nav__links { gap: 14px 18px; }
  .hero { padding-top: 48px; }
  .hero__row { gap: 44px; }
  .lead { font-size: 18px; }
  .section { padding: 64px 20px; }
  .collection { padding-top: 64px; }
  .card { min-height: 300px; padding: 12px; border-width: 5px; }
  .card__art { height: 100px; }
  .card__name { font-size: 20px; }
  .card__type { font-size: 13px; }
  .detail { gap: 28px; }
  .detail__desc { font-size: 17px; }
  .contact { padding: 0 20px 72px; }
  .contact__text p { font-size: 18px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .confetti { display: none; }
}
