/* ==========================================================================
   Cobblemon Academy — thème Noël (maquette)
   S'ajoute par-dessus style.css / family.css / academy.css, comme halloween.css :
   même structure, mêmes codes (vert sapin = jouer, doré = acheter), ambiance nuit d'hiver.
   ========================================================================== */

body.theme-noel {
  /* nuit d'hiver bleu nuit */
  --navy-950: #06101f;
  --navy-900: #0a1a30;
  --navy-850: #0e2140;
  --navy-800: #13294d;
  --navy-700: #1a3560;
  --line: rgba(200, 230, 255, .16);
  --line-strong: rgba(200, 230, 255, .42);
  --sky: #bfe6ff;
  --text-soft: #eaf5ff;
  --text-muted: #b7cfe6;
  --text-dim: #8aa6c4;
  --outline: #0a1a30;

  /* doré de fête (reste la couleur « acheter ») */
  --gold-hi: #ffe58a;
  --gold: #ffd24a;
  --gold-lo: #e8a317;
  --gold-edge: #6e4a00;
  --gold-ink: #332200;

  /* vert sapin (reste la couleur « jouer ») */
  --green-hi: #5fd67a;
  --green: #34b556;
  --green-lo: #1f8a3c;
  --green-edge: #0d4a1e;

  --xmas-red: #e53b3b;
  --xmas-red-lo: #b0202a;
  --snow: #ffffff;
  background: var(--navy-950);
}

.theme-noel .hl,
.theme-noel .section-title .hl,
.theme-noel .hero__title .hl { color: var(--xmas-red); }
.theme-noel .hero__title .hl { -webkit-text-stroke-color: #3a0610; text-shadow: 0 6px 0 #3a0610, 0 10px 30px rgba(0, 0, 0, .35); }
.theme-noel .eyebrow { color: #9fd8ff; }

/* ---------- Neige ---------------------------------------------------------- */

.xm-snow { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.xm-snow i {
  position: absolute; top: -12px; left: var(--x); width: var(--s, 6px); height: var(--s, 6px); border-radius: 50%;
  background: #fff; opacity: var(--o, .9); box-shadow: 0 0 6px rgba(255, 255, 255, .7);
  animation: snowFall var(--t, 12s) linear var(--d, 0s) infinite;
}
@keyframes snowFall {
  0% { transform: translate(0, 0); }
  25% { transform: translate(18px, 25vh); }
  50% { transform: translate(-12px, 50vh); }
  75% { transform: translate(14px, 75vh); }
  100% { transform: translate(-6px, 105vh); }
}

/* ---------- Guirlande lumineuse sous la barre de navigation -------------- */

.xm-lights { position: absolute; top: 96px; left: 0; right: 0; height: 44px; z-index: 4; pointer-events: none; }
.xm-lights svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.xm-lights span {
  position: absolute; top: calc(var(--y) * 1px); left: var(--x); width: 12px; height: 18px; border-radius: 50% 50% 45% 45%;
  background: var(--c); box-shadow: 0 0 14px 3px var(--c); transform: translateX(-50%);
  animation: twinkle 1.6s ease-in-out var(--d, 0s) infinite;
}
.xm-lights span::before { content: ""; position: absolute; top: -5px; left: 3px; width: 6px; height: 6px; border-radius: 2px; background: #2b3a4a; }
@keyframes twinkle { 50% { opacity: .35; box-shadow: 0 0 4px 1px var(--c); } }

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

.theme-noel .hero::before {
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(6, 16, 31, 0) 0%, rgba(6, 16, 31, .45) 70%),
    linear-gradient(180deg, rgba(8, 20, 48, .78) 0%, rgba(20, 40, 80, .3) 35%, rgba(6, 16, 31, .65) 66%, var(--navy-950) 100%);
}
.theme-noel .hero__bg { filter: saturate(.5) brightness(.72) contrast(1.05); }
.theme-noel .hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(190, 225, 255, .12), transparent 40%);
}
.theme-noel .hero__inner { position: relative; z-index: 3; }
.xm-hat-wrap { position: relative; display: inline-block; }
.xm-hat {
  position: absolute; left: 50%; top: -12%; width: 30%; transform: translateX(-52%) rotate(12deg);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); animation: hatSway 5s ease-in-out infinite;
}
@keyframes hatSway { 50% { transform: translateX(-52%) translateY(-6px) rotate(6deg); } }
.theme-noel .xm-hat-wrap .hero__logo { filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5)) drop-shadow(0 0 30px rgba(190, 225, 255, .25)); }

.xm-hills { position: absolute; left: 0; right: 0; bottom: -1px; height: 150px; z-index: 2; pointer-events: none; }
.xm-hills svg { width: 100%; height: 100%; display: block; }
.xm-deco { position: absolute; left: 0; right: 0; bottom: 56px; z-index: 3; pointer-events: none; }
.xm-tree { position: absolute; bottom: 0; width: 130px; }
.xm-tree svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .45)); }
.xm-tree .bulb { animation: twinkle 1.8s ease-in-out infinite; }
.xm-tree .bulb:nth-of-type(2n) { animation-delay: -.6s; }
.xm-tree .bulb:nth-of-type(3n) { animation-delay: -1.1s; }
.xm-tree .star { transform-origin: 50px 10px; animation: starPulse 2.4s ease-in-out infinite; }
@keyframes starPulse { 50% { transform: scale(1.18); filter: drop-shadow(0 0 8px #ffd24a); } }
.xm-tree--l { left: 3%; }
.xm-tree--r { right: 4%; width: 100px; }
.xm-gift { position: absolute; bottom: 0; width: 64px; animation: giftHop 3.2s ease-in-out infinite; }
.xm-gift svg { width: 100%; height: auto; display: block; }
.xm-gift--1 { left: calc(3% + 120px); }
.xm-gift--2 { left: calc(3% + 170px); width: 48px; animation-delay: -1.2s; }
.xm-gift--3 { right: calc(4% + 96px); width: 56px; animation-delay: -.6s; }
@keyframes giftHop { 0%, 80%, 100% { transform: none; } 86% { transform: translateY(-10px) rotate(-4deg); } 92% { transform: translateY(0) rotate(3deg); } }
@media (max-width: 760px) { .xm-tree { width: 80px; } .xm-tree--r { width: 64px; } .xm-gift--2, .xm-gift--3 { display: none; } .xm-gift--1 { left: calc(3% + 74px); width: 44px; } .xm-lights { top: 88px; } }

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

/* ---------- Bandeau événement : calendrier de l'Avent -------------------- */

.theme-noel .promo__card {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(229, 59, 59, .45), transparent 55%),
    radial-gradient(80% 120% at 100% 100%, rgba(52, 181, 86, .22), transparent 60%),
    linear-gradient(135deg, #3a0c16, #0e1f3a);
  border-color: rgba(255, 210, 74, .6);
}
.theme-noel .promo__card .tag--rise { background: rgba(255, 210, 74, .16); color: #ffe58a; border-color: rgba(255, 210, 74, .5); }
.theme-noel .countdown__unit { border-color: rgba(255, 210, 74, .35); background: rgba(6, 16, 31, .55); }
.theme-noel .countdown__unit span { color: #ffe58a; }
.xm-advent { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 92px; height: 92px; padding: 6px; border-radius: 18px; background: #6e1420; border: 2px solid rgba(255, 210, 74, .6); }
.xm-advent i { display: grid; place-items: center; border-radius: 4px; background: #b0202a; color: #ffe58a; font-style: normal; font-size: 9px; font-weight: 900; }
.xm-advent i:nth-child(3n) { background: #1f6b35; }
.xm-advent i.is-open { background: #ffd24a; color: #6e1420; animation: twinkle 1.6s ease-in-out infinite; }

/* ---------- Neige posée sur les cartes ----------------------------------- */

.theme-noel .product,
.theme-noel .news-card,
.theme-noel .discord,
.theme-noel .stat,
.theme-noel .launcher-card { position: relative; }
.xm-cap {
  /* posée à l'intérieur du bord haut : les cartes coupent ce qui dépasse (overflow: hidden) */
  position: absolute; top: 0; left: 0; right: 0; height: 12px; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, #fff 70%, #e6f2ff); border-radius: 22px 22px 0 0;
  filter: drop-shadow(0 2px 0 rgba(150, 190, 230, .7));
}
.theme-noel .product .product__ribbon { top: 24px; }
/* Gouttes de neige qui pendent sous la couche */
.xm-cap::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: 100%; height: 12px; margin-top: -3px;
  background:
    radial-gradient(circle at 12px 0, #e6f2ff 8px, transparent 8.5px) 0 0 / 52px 12px repeat-x,
    radial-gradient(circle at 36px 0, #e6f2ff 5px, transparent 5.5px) 0 0 / 52px 12px repeat-x;
}
.theme-noel .product__ribbon { z-index: 4; }
.theme-noel .product__ribbon--xm { background: var(--xmas-red); color: #fff; border-color: #5a0a12; box-shadow: 0 3px 0 #5a0a12; }
.theme-noel .product--featured { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 210, 74, .15), 0 0 40px rgba(255, 210, 74, .12); }
/* Ruban de cadeau sur la carte mise en avant */
.theme-noel .product--featured::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 14px; transform: translateX(-50%);
  background: linear-gradient(90deg, #b0202a, #e53b3b 50%, #b0202a); opacity: .9; pointer-events: none; z-index: 2;
  -webkit-mask: linear-gradient(#000 0 58%, transparent 58%); mask: linear-gradient(#000 0 58%, transparent 58%);
}

/* ---------- Bande « Rejoindre » : ciel givré ----------------------------- */

.theme-noel .band-sky { background: linear-gradient(180deg, #7cc8f2 0%, #3d8fd0 40%, #1d4f93 80%, #13294d 100%); }
.theme-noel .band-sky .section-title { text-shadow: 0 4px 0 #0a2a52; }
.theme-noel .stat { background: #f4fbff; box-shadow: 0 6px 0 #0a2a52; }
.theme-noel .stat b { color: var(--xmas-red-lo); }
.theme-noel .launcher-card .sticker { z-index: 5; background: var(--xmas-red); color: #fff; border-color: #5a0a12; box-shadow: 0 4px 0 #5a0a12; }
@media (max-width: 760px) { .xm-lights span:nth-of-type(2n) { display: none; } }

/* ---------- The Rise : aurore boréale ------------------------------------- */

.theme-noel .band-rise {
  background:
    radial-gradient(70% 45% at 30% 0%, rgba(80, 255, 170, .22), transparent 70%),
    radial-gradient(60% 40% at 80% 10%, rgba(140, 110, 255, .25), transparent 70%),
    linear-gradient(180deg, #0a1f33, #06101f);
}
.xm-aurora { position: absolute; inset: 0 0 auto; height: 320px; pointer-events: none; overflow: hidden; z-index: 0; }
.xm-aurora i {
  position: absolute; top: -40px; width: 60%; height: 260px; border-radius: 50%; filter: blur(40px); opacity: .45;
  background: linear-gradient(90deg, transparent, #4dffb0, #7c6bff, transparent);
  animation: aurora 14s ease-in-out infinite alternate;
}
.xm-aurora i:nth-child(2) { left: 40%; top: 0; opacity: .3; animation-duration: 20s; animation-direction: alternate-reverse; background: linear-gradient(90deg, transparent, #7c6bff, #4dffb0, transparent); }
@keyframes aurora { from { transform: translateX(-10%) skewX(-12deg); } to { transform: translateX(30%) skewX(12deg); } }
.theme-noel .band-rise > .wrap { position: relative; z-index: 1; }
.theme-noel .tour--rise .stage { background: radial-gradient(70% 60% at 50% 110%, rgba(77, 255, 176, .25), transparent 70%), linear-gradient(180deg, #0e2140, #081528); }
.theme-noel .tour--rise .tour__tab.is-active { background: linear-gradient(180deg, #13294d, #0e2140); }
.theme-noel .stage__pixels i { border-radius: 50%; background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, .8); }
.theme-noel .catch__wild { background: radial-gradient(circle at 35% 35%, #9fd8ff, #3d6fa8 70%); box-shadow: 0 0 40px rgba(190, 230, 255, .5); }
.theme-noel .tour__tab.is-active .tour__icon { box-shadow: 0 4px 0 var(--gold-edge), 0 0 18px rgba(255, 210, 74, .45); }

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

.theme-noel .nav__bar { background: rgba(10, 26, 48, .8); border-color: rgba(200, 230, 255, .35); }
.theme-noel .topnav.is-scrolled .nav__bar { background: rgba(6, 16, 31, .92); }
.theme-noel .final::before { filter: saturate(.5) brightness(.8); }
.theme-noel .final .wrap { position: relative; z-index: 3; }
.theme-noel .footer { background: #040b16; }

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

/* Couleurs dérivées de la nuit d'hiver (le site en définit aussi : body.theme-… passe après body.v-…) */
body.theme-noel {
  --accent-rgb: 200, 230, 255; --navy-950-rgb: 6, 16, 31; --navy-900-rgb: 10, 26, 48;
  --navy-btn-hi: #25497a; --navy-btn-lo: #1a355d; --card-hi: #0f2a4f;
  --glow-hi: #1f4f8a; --well: #061529; --lip: #050f1f;
  /* ManiaSky : le lagon devient ciel givré */
  --ms-accent: #7cc8f2; --ms-accent-lo: #3d8fd0; --ms-accent-edge: #0a2a52; --ms-accent-ink: #06101f;
}

/* Bandes colorées de ManiaSky (lagon) et Pixelcraft (violet) : même ciel givré que la bande Academy */
.theme-noel .band-lagoon,
.theme-noel .band-pixel { background: linear-gradient(180deg, #7cc8f2 0%, #3d8fd0 40%, #1d4f93 80%, #13294d 100%); }
.theme-noel .band-lagoon .section-title,
.theme-noel .band-pixel .section-title { text-shadow: 0 4px 0 #0a2a52; }
.theme-noel .band-lagoon .step { background: rgba(6, 16, 31, .22); }
.theme-noel .band-lagoon .step::before { color: #1d4f93; box-shadow: 0 4px 0 #0a2a52; }
.theme-noel .wave-top path { fill: #7cc8f2; }
.theme-noel .wave-bottom path { fill: #13294d; }

/* Visites animées (launcher, OneBlock, boutique) : même scène d'hiver que la visite The Rise */
.theme-noel .tour .stage { background: radial-gradient(70% 60% at 50% 110%, rgba(77, 255, 176, .25), transparent 70%), linear-gradient(180deg, #0e2140, #081528); }
.theme-noel .tour .tour__tab.is-active { background: linear-gradient(180deg, #13294d, #0e2140); }

/* 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-noel .shop-hero > .wrap { position: relative; z-index: 3; }
.theme-noel .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; }

/* ==========================================================================
   Noël 2026 (01/12 → 03/01) : logo de Noël dessiné, neige sur les boutons, Avent 24 cases
   (noel-2026/site : ajouté à la suite, rien au-dessus n'a changé)
   ========================================================================== */

/* Logo Academy dessiné pour Noël (img/academy-logo-wide-noel.webp, elements/season/logo) :
   pas de bonnet SVG, l'enveloppe flotte, halo givré + or. */
.xm-hat-wrap--drawn .xm-hat { display: none; }
.theme-noel .xm-hat-wrap--drawn { animation: float 6s ease-in-out infinite; }
.theme-noel .xm-hat-wrap--drawn .hero__logo {
  width: min(450px, 80vw); animation: none;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .55)) drop-shadow(0 0 42px rgba(160, 215, 255, .30)) drop-shadow(0 0 2px rgba(255, 229, 138, .35));
}
/* Rien ne dépasse au-dessus du logo dessiné : l'étiquette peut s'en rapprocher */
.xm-event-tag.xm-event-tag--drawn { margin-bottom: 0; }
.theme-noel .hero__inner:has(.xm-hat-wrap--drawn) { gap: 16px; }

/* Étiquette de l'événement : rouge de Noël liseré d'or */
.theme-noel .xm-event-tag {
  background: linear-gradient(180deg, rgba(229, 59, 59, .34), rgba(176, 32, 42, .34));
  border-color: rgba(255, 210, 74, .65); color: #fff1c9;
  box-shadow: 0 0 0 1px rgba(58, 6, 16, .6), 0 6px 18px rgba(0, 0, 0, .35);
}
.theme-noel .xm-event-tag svg { color: #ffe58a; }

/* Petit logo de Noël dans la barre de menu (img/academy-logo-noel.webp, plus large que haut) */
.theme-noel.v-academy .nav__logo img { height: 54px; margin: -2px 0; }

/* Neige posée sur les gros boutons (accueil et bandeau) : une couche fine qui suit le bouton */
.theme-noel .hero__ctas .pbtn::after,
.theme-noel .final .pbtn--lg::after,
.theme-noel .promo__side .pbtn::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: -7px; height: 11px; pointer-events: none;
  border-radius: 8px 8px 4px 4px;
  background:
    radial-gradient(circle at 50% 100%, #fff 5.5px, transparent 6px) 0 0 / 17px 11px repeat-x,
    linear-gradient(#fff, #e9f4ff) 0 100% / 100% 6px no-repeat;
  filter: drop-shadow(0 1px 0 rgba(120, 170, 220, .8));
}
.theme-noel .promo__side .pbtn::after { top: -6px; height: 10px; }

/* Calendrier de l'Avent du bandeau : 24 cases (6 x 4), celle du jour entourée */
.theme-noel .xm-advent { grid-template-columns: repeat(6, 1fr); width: 132px; height: 92px; gap: 3px; padding: 6px; }
.theme-noel .xm-advent i { font-size: 9px; border-radius: 3px; }
.theme-noel .xm-advent i.is-today { outline: 2px solid #fff; outline-offset: 1px; z-index: 1; }
@media (max-width: 520px) { .theme-noel .xm-advent { display: none; } }

/* Mouvement réduit (réglage du système) : base.css arrête déjà toutes les animations ;
   on retire en plus la neige et l'aurore (flocons figés) et on garde la guirlande allumée. */
@media (prefers-reduced-motion: reduce) {
  .xm-snow, .xm-aurora { display: none !important; }
  .xm-lights span { opacity: 1; }
}

/* Offre mise en avant : le ruban vertical barrait l'image de l'offre (pièce) → retiré, le liseré d'or suffit */
.theme-noel .product--featured::after { content: none; }
/* Étiquette de l'événement sur une seule ligne au téléphone */
@media (max-width: 520px) { .theme-noel .xm-event-tag { font-size: 11px; letter-spacing: .08em; padding: 6px 12px; } }

/* Bonnet en pixel art (01/12/2026) : remplace le bonnet vectoriel arrondi sur les logos sans version dessinée
   (Pixelcraft, ManiaSky). Posé sur la pointe de l'icône, légèrement penché, se balance doucement. */
.xm-hat.xm-hat--px {
  left: 43%; top: -13%; width: 36%; height: auto; transform: rotate(-8deg); transform-origin: 30% 90%;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); animation: hatPxSway 5s ease-in-out infinite;
}
@keyframes hatPxSway { 50% { transform: translateY(-4px) rotate(-4deg); } }

/* Sans bonnet (01/12/2026, demande de Narkoo) : les logos sans version dessinée (Pixelcraft, ManiaSky) n'ont plus
   de bonnet ; le logo flotte doucement comme le logo dessiné de l'Academy, l'étiquette se rapproche.
   Pour remettre le bonnet pixel art : supprimer ce bloc. */
.theme-noel .xm-hat-wrap:not(.xm-hat-wrap--drawn) .xm-hat { display: none; }
.theme-noel .xm-event-tag { margin-bottom: 0; }
.theme-noel .hero__inner:has(.xm-hat-wrap) { gap: 16px; }
.theme-noel .xm-hat-wrap:not(.xm-hat-wrap--drawn) { animation: float 6s ease-in-out infinite; }
