/* ==========================================================================
   Cobblemon Academy — thème Halloween (maquette)
   S'ajoute par-dessus style.css / family.css / academy.css, sans rien casser :
   même structure, mêmes codes (vert = jouer, doré = acheter), ambiance nuit hantée.
   ========================================================================== */

body.theme-halloween {
  /* nuit violette au lieu du marine */
  --navy-950: #0b0613;
  --navy-900: #140a22;
  --navy-850: #1a0e2c;
  --navy-800: #221236;
  --navy-700: #2d1846;
  --line: rgba(255, 138, 31, .16);
  --line-strong: rgba(255, 138, 31, .42);
  --sky: #ffb45c;
  --text-soft: #f3e6ff;
  --text-muted: #cdb8e6;
  --text-dim: #9d86bd;
  --outline: #1d0b33;

  /* doré → citrouille (reste la couleur « acheter ») */
  --gold-hi: #ffc15e;
  --gold: #ffa53a;
  --gold-lo: #e8620c;
  --gold-edge: #6e2600;
  --gold-ink: #2b0f00;

  /* vert → vert « slime » (reste la couleur « jouer ») */
  --green-hi: #a6f25a;
  --green: #7ee23a;
  --green-lo: #4fb81c;
  --green-edge: #245c0b;

  --slime: #7ee23a;
  --pumpkin: #ff8a1f;
  background: var(--navy-950);
}

.theme-halloween .hl,
.theme-halloween .section-title .hl,
.theme-halloween .hero__title .hl { color: var(--pumpkin); }
.theme-halloween .eyebrow { color: #ffb45c; }

/* ---------- Décor fixe : lune, chauves-souris, brume -------------------- */

.hw-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hw-moon {
  position: absolute; top: 90px; right: 9%; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff8dc 0 30%, #ffe8a3 55%, #f6c96a 100%);
  box-shadow: 0 0 60px 20px rgba(255, 214, 120, .35), 0 0 160px 60px rgba(255, 170, 60, .18);
}
.hw-moon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 62% 60%, rgba(180, 130, 60, .25) 0 9%, transparent 10%),
              radial-gradient(circle at 34% 68%, rgba(180, 130, 60, .2) 0 6%, transparent 7%),
              radial-gradient(circle at 56% 30%, rgba(180, 130, 60, .18) 0 5%, transparent 6%);
}
.hw-bat { position: absolute; width: 64px; height: 32px; color: #12081f; filter: drop-shadow(0 0 6px rgba(255, 170, 60, .35)); animation: batFly var(--t, 14s) linear var(--d, 0s) infinite; }
.hw-bat svg { width: 100%; height: 100%; overflow: visible; }
.hw-bat svg path { fill: currentColor; }
.hw-wing { transform-box: view-box; animation: wingL .32s ease-in-out infinite alternate; }
.hw-wing--l { transform-origin: 30px 12px; }
.hw-wing--r { transform-origin: 34px 12px; animation-name: wingR; }
@keyframes wingL { from { transform: rotate(22deg); } to { transform: rotate(-28deg); } }
@keyframes wingR { from { transform: rotate(-22deg); } to { transform: rotate(28deg); } }
@keyframes batFly {
  0% { transform: translate(-120px, 0) scale(var(--s, 1)); }
  25% { transform: translate(28vw, -40px) scale(var(--s, 1)); }
  50% { transform: translate(55vw, 20px) scale(var(--s, 1)); }
  75% { transform: translate(80vw, -30px) scale(var(--s, 1)); }
  100% { transform: translate(110vw, 10px) scale(var(--s, 1)); }
}

.hw-fog { position: absolute; left: -20%; right: -20%; bottom: 0; height: 240px; pointer-events: none; z-index: 1; }
.hw-fog i {
  position: absolute; inset: 0; opacity: .55;
  background:
    radial-gradient(40% 60% at 20% 80%, rgba(210, 190, 255, .35), transparent 70%),
    radial-gradient(35% 50% at 55% 90%, rgba(200, 255, 190, .18), transparent 70%),
    radial-gradient(45% 55% at 85% 85%, rgba(210, 190, 255, .3), transparent 70%);
  animation: fog 18s ease-in-out infinite alternate;
}
.hw-fog i:nth-child(2) { animation-duration: 26s; animation-direction: alternate-reverse; opacity: .4; }
@keyframes fog { from { transform: translateX(-6%); } to { transform: translateX(6%); } }

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

.theme-halloween .hero::before {
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(11, 6, 19, 0) 0%, rgba(11, 6, 19, .45) 70%),
    linear-gradient(180deg, rgba(20, 8, 40, .82) 0%, rgba(40, 14, 60, .35) 35%, rgba(11, 6, 19, .7) 65%, var(--navy-950) 100%);
}
.theme-halloween .hero__bg { filter: saturate(.55) hue-rotate(-25deg) brightness(.7); }
.hw-hat-wrap { position: relative; display: inline-block; }
.hw-hat {
  position: absolute; left: 52%; top: -12%; width: 24%; transform: translateX(-50%) rotate(-8deg); transform-origin: 50% 90%;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); animation: hatBob 6s ease-in-out infinite;
}
@keyframes hatBob { 50% { transform: translateX(-50%) rotate(-5deg); } }
/* Le logo et son chapeau flottent ensemble : l'animation du logo passe sur l'enveloppe. */
.theme-halloween .hw-hat-wrap { margin-top: 26px; animation: float 6s ease-in-out infinite; }
.theme-halloween .hw-hat-wrap .hero__logo { animation: none; }
/* Logo redessiné avec le chapeau (img/logo-halloween.png) : pas de chapeau SVG, rien ne dépasse au-dessus. */
.theme-halloween .hw-hat-wrap--drawn { margin-top: 8px; }
.hw-hat-wrap--drawn .hw-hat { display: none; }
.hw-pumpkins { position: absolute; left: 0; right: 0; bottom: 70px; z-index: 2; pointer-events: none; }
.hw-pumpkin { position: absolute; bottom: 0; width: 110px; filter: drop-shadow(0 0 22px rgba(255, 138, 31, .55)); }
.hw-pumpkin svg { width: 100%; height: auto; display: block; }
.hw-pumpkin .glow { animation: flicker 2.6s infinite; }
.hw-pumpkin--l { left: 4%; }
.hw-pumpkin--l2 { left: calc(4% + 90px); width: 70px; }
.hw-pumpkin--r { right: 5%; width: 130px; }
@keyframes flicker { 0%, 100% { opacity: 1; } 42% { opacity: .75; } 45% { opacity: 1; } 70% { opacity: .85; } 72% { opacity: .6; } 74% { opacity: 1; } }
@media (max-width: 760px) { .hw-pumpkin { width: 70px; } .hw-pumpkin--l2 { display: none; } .hw-pumpkin--r { width: 80px; } .hw-moon { width: 90px; height: 90px; top: 110px; } }
@media (max-width: 520px) { .hw-moon { width: 70px; height: 70px; top: 190px; right: -16px; } }

.hw-event-tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 138, 31, .16); border: 1px solid rgba(255, 165, 58, .55); color: #ffc98a;
  font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
}
.hw-event-tag svg { width: 16px; height: 16px; }

/* ---------- Bandeau événement -------------------------------------------- */

.theme-halloween .promo__card {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 138, 31, .45), transparent 55%),
    radial-gradient(80% 120% at 100% 100%, rgba(126, 226, 58, .18), transparent 60%),
    linear-gradient(135deg, #2a1040, #140822);
  border-color: rgba(255, 165, 58, .6);
}
.theme-halloween .promo__card .tag--rise { background: rgba(255, 138, 31, .2); color: #ffc98a; border-color: rgba(255, 165, 58, .5); }
.theme-halloween .countdown__unit span { color: #ffb45c; }
.theme-halloween .countdown__unit { border-color: rgba(255, 165, 58, .35); }
.hw-promo-art { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 18px; background: radial-gradient(circle, #3a1a55, #1b0c2c); border: 2px solid rgba(255, 165, 58, .5); }
.hw-promo-art svg { width: 70px; height: 62px; }

/* ---------- Bande « Rejoindre » : crépuscule au lieu du ciel bleu --------- */

.theme-halloween .band-sky { background: linear-gradient(180deg, #ff8a1f 0%, #c24a2a 35%, #5a1f5c 75%, #2d1846 100%); }
.theme-halloween .band-sky .section-title { text-shadow: 0 4px 0 #4a1400; }
.theme-halloween .band-sky .step { background: rgba(30, 6, 30, .3); }
.theme-halloween .band-sky .step::before { color: #c24a2a; box-shadow: 0 4px 0 #4a1400; }
.theme-halloween .stat { background: #fff4e6; box-shadow: 0 6px 0 #4a1400; }
.theme-halloween .stat b { color: #e8620c; }
.theme-halloween .stat span { color: #6b3a4a; }
.theme-halloween .launcher-card { border-color: #4a1400; box-shadow: 0 0 0 2px #ffb45c inset, 0 24px 60px rgba(30, 6, 30, .6); }

/* ---------- Toiles d'araignée sur les cartes ------------------------------ */

.theme-halloween .product,
.theme-halloween .news-card,
.theme-halloween .discord,
.theme-halloween .stage { position: relative; }
.hw-web { position: absolute; top: -1px; right: -1px; width: 90px; height: 90px; pointer-events: none; z-index: 3; opacity: .8; }
.hw-web--l { right: auto; left: -1px; transform: scaleX(-1); }
.hw-spider { position: absolute; top: 0; right: 34px; z-index: 4; width: 2px; height: 46px; background: rgba(255, 255, 255, .4); animation: spider 5s ease-in-out infinite; transform-origin: top; }
.hw-spider::after { content: ""; position: absolute; left: -7px; bottom: -10px; width: 16px; height: 14px; border-radius: 50%; background: #120818; box-shadow: 0 0 0 2px rgba(255, 138, 31, .4); }
@keyframes spider { 50% { height: 80px; } }

/* ---------- The Rise : fantômes qui flottent ----------------------------- */

.theme-halloween .band-rise {
  background:
    radial-gradient(60% 50% at 85% 10%, rgba(126, 226, 58, .18), transparent 70%),
    radial-gradient(50% 40% at 10% 90%, rgba(255, 138, 31, .16), transparent 70%),
    linear-gradient(180deg, #1a0a2e, #0b0613);
}
.hw-ghost { position: absolute; width: 54px; opacity: .8; pointer-events: none; z-index: 0; animation: ghost 7s ease-in-out infinite; }
.hw-ghost svg { width: 100%; height: auto; display: block; }
@keyframes ghost { 0%, 100% { transform: translate(0, 0); opacity: .75; } 50% { transform: translate(18px, -26px); opacity: .35; } }
.theme-halloween .tour__tab.is-active .tour__icon { box-shadow: 0 4px 0 var(--gold-edge), 0 0 18px rgba(255, 138, 31, .45); }
.theme-halloween .stage__pixels i { background: var(--pumpkin); box-shadow: 0 0 14px rgba(255, 138, 31, .8); }
.theme-halloween .stage__pixels i:nth-child(2n) { background: var(--slime); box-shadow: 0 0 14px rgba(126, 226, 58, .8); }
.theme-halloween .pokeball { background: linear-gradient(180deg, #7b3fe4 0 46%, #1b1b1b 46% 54%, #f4f4f4 54%); }
.theme-halloween .catch__wild { background: radial-gradient(circle at 35% 35%, #8a5ab8, #2a1446 70%); box-shadow: 0 0 40px rgba(126, 226, 58, .45); }
.theme-halloween .tour--rise .stage { background: radial-gradient(70% 60% at 50% 110%, rgba(255, 138, 31, .35), transparent 70%), linear-gradient(180deg, #221236, #120820); }

/* ---------- Divers ------------------------------------------------------- */

.theme-halloween .product__ribbon--hw { background: #7b3fe4; color: #fff; border-color: #2a1057; box-shadow: 0 3px 0 #2a1057; }
.theme-halloween .product--featured { border-color: var(--pumpkin); box-shadow: 0 0 0 4px rgba(255, 138, 31, .15), 0 0 40px rgba(255, 138, 31, .15); }
.theme-halloween .nav__bar { background: rgba(20, 8, 34, .78); border-color: rgba(255, 165, 58, .35); }
.theme-halloween .topnav.is-scrolled .nav__bar { background: rgba(11, 6, 19, .92); }
.theme-halloween .final::before { filter: saturate(.5) hue-rotate(-25deg); }
.theme-halloween .footer { background: #07030d; }

/* Bonbons qui tombent dans le CTA final */
.hw-candies { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.hw-candies i {
  position: absolute; top: -30px; width: 22px; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--c) 0 30%, #fff 30% 40%, var(--c) 40% 60%, #fff 60% 70%, var(--c) 70%);
  animation: candy var(--t, 9s) linear var(--d, 0s) infinite;
}
.hw-candies i::before, .hw-candies i::after { content: ""; position: absolute; top: 2px; width: 8px; height: 8px; background: var(--c); clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.hw-candies i::before { left: -7px; }
.hw-candies i::after { right: -7px; transform: scaleX(-1); }
@keyframes candy { to { transform: translateY(760px) rotate(540deg); } }

/* Le contenu passe devant le décor */
.theme-halloween .hero__inner { position: relative; z-index: 3; }
.theme-halloween .final .wrap { position: relative; z-index: 1; }
.theme-halloween .band-rise > .wrap { position: relative; z-index: 1; }
.theme-halloween .hw-hat-wrap .hero__logo { filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)) drop-shadow(0 0 30px rgba(255, 138, 31, .25)); }

/* ==========================================================================
   Thème Azuriom : compléments (tools/build_assets.py)
   ========================================================================== */

/* Couleurs dérivées de la nuit hantée (le site en définit aussi : body.theme-… passe après body.v-…) */
body.theme-halloween {
  --accent-rgb: 255, 138, 31; --navy-950-rgb: 11, 6, 19; --navy-900-rgb: 20, 10, 34;
  --navy-btn-hi: #3b1d5e; --navy-btn-lo: #2a1446; --card-hi: #241237;
  --glow-hi: #4a1f5e; --well: #10081c; --lip: #0a0512;
  /* ManiaSky : le lagon devient citrouille */
  --ms-accent: #ffa53a; --ms-accent-lo: #e8620c; --ms-accent-edge: #6e2600; --ms-accent-ink: #2b0f00;
}

/* Bandes colorées de ManiaSky (lagon) et Pixelcraft (violet) : même crépuscule que la bande Academy */
.theme-halloween .band-lagoon,
.theme-halloween .band-pixel { background: linear-gradient(180deg, #ff8a1f 0%, #c24a2a 35%, #5a1f5c 75%, #2d1846 100%); }
.theme-halloween .band-lagoon .section-title,
.theme-halloween .band-pixel .section-title { text-shadow: 0 4px 0 #4a1400; }
.theme-halloween .band-lagoon .step { background: rgba(30, 6, 30, .3); }
.theme-halloween .band-lagoon .step::before { color: #c24a2a; box-shadow: 0 4px 0 #4a1400; }
.theme-halloween .wave-top path { fill: #ff8a1f; }
.theme-halloween .wave-bottom path { fill: #2d1846; }

/* Visites animées (launcher, OneBlock, boutique) : même scène que la visite The Rise */
.theme-halloween .tour .stage { background: radial-gradient(70% 60% at 50% 110%, rgba(255, 138, 31, .35), transparent 70%), linear-gradient(180deg, #221236, #120820); }

/* Décor des grandes bandes (elements/season/band) et hauts de page compacts (boutique, pages) */
.season-band { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.season-band ~ .wrap { position: relative; z-index: 1; }
.theme-halloween .shop-hero > .wrap { position: relative; z-index: 3; }
.theme-halloween .page-top { position: relative; overflow: hidden; }
/* Étiquette de l'événement : laisse la place au chapeau posé sur le logo (il ne doit pas cacher le texte) */
.hw-event-tag, .xm-event-tag { margin-bottom: 34px; }
.page-top .hw-moon { top: 70px; right: 8%; width: 64px; height: 64px; box-shadow: 0 0 30px 10px rgba(255, 214, 120, .3); }
.page-top .hw-fog { height: 120px; }
.shop-hero .hw-moon { top: 110px; right: 5%; width: 110px; height: 110px; }
