/* =====================================================================
   THÈME NOËL 🎄 — actif quand <html> a la classe .theme-noel
   (réglage : Réglages › Paramètres › Thème du site)
   ===================================================================== */
html.theme-noel {
  --crown: url(/img/crown-noel-sm.png);
  --xm-red: #e3263f;
  --xm-red2: #a3122a;
  --xm-green: #1f9d5a;
  --xm-gold: #ffcf5a;
  --p-btn: linear-gradient(180deg, #ff6a8e 0%, #e3263f 50%, #a3122a 100%);
  --p-pinkg: linear-gradient(180deg, #ffffff 0%, #ffd6df 40%, #ff5f86 75%, #d51f45 100%);
}

/* ---------- fond : halos rouge et vert en plus du rose ---------- */
html.theme-noel body,
html.theme-noel #shell,
html.theme-noel .login-container {
  background:
    radial-gradient(900px 420px at 50% -140px, rgba(255, 79, 163, .16), transparent 70%),
    radial-gradient(700px 380px at -5% 10%, rgba(227, 38, 63, .13), transparent 70%),
    radial-gradient(700px 380px at 105% 20%, rgba(31, 157, 90, .11), transparent 70%),
    #070507;
}

/* ---------- neige qui tombe (créée par crowns.js) ---------- */
#crown-sky i.flake {
  bottom: auto; top: -20px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 40%, rgba(255, 255, 255, .5) 55%, transparent 70%);
  animation-name: x-fall; animation-timing-function: linear;
}
#crown-sky i.xcrown { bottom: auto; top: -60px; animation-name: x-fall; }
@keyframes x-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; }
  8% { opacity: var(--o, .8); }
  50% { transform: translate3d(var(--sway, 30px), 55vh, 0) rotate(160deg); }
  92% { opacity: var(--o, .8); }
  100% { transform: translate3d(0, 112vh, 0) rotate(330deg); opacity: 0; }
}

/* ---------- guirlande lumineuse sous la barre du haut ---------- */
html.theme-noel .hdr { border-bottom-color: rgba(255, 207, 90, .25); }
html.theme-noel .hdr::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 16px; pointer-events: none; z-index: 2;
  background:
    radial-gradient(circle at 15px 9px, #ff3b4f 0 4px, rgba(255, 59, 79, .45) 5px, transparent 9px),
    radial-gradient(circle at 45px 9px, #3ee07f 0 4px, rgba(62, 224, 127, .45) 5px, transparent 9px),
    radial-gradient(circle at 75px 9px, #ffcf5a 0 4px, rgba(255, 207, 90, .45) 5px, transparent 9px),
    radial-gradient(circle at 105px 9px, #5ab4ff 0 4px, rgba(90, 180, 255, .45) 5px, transparent 9px);
  background-size: 120px 16px;
  animation: x-twinkle 1.6s steps(2, jump-none) infinite;
}
html.theme-noel .hdr::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 6px; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse 32px 6px at 30px 0, transparent 4px, rgba(40, 70, 40, .9) 5px, transparent 6px);
  background-size: 30px 6px;
}
@keyframes x-twinkle { 0% { filter: brightness(1.25) saturate(1.2); } 100% { filter: brightness(.55) saturate(.7); } }
html.theme-noel .hdr { position: sticky; }

/* ---------- logo : texte sucre d'orge ---------- */
html.theme-noel .brand-t b {
  background-image: linear-gradient(90deg, #ff5f86 0%, #ffffff 25%, #e3263f 50%, #ffffff 75%, #ff5f86 100%);
}
html.theme-noel .brand-t i::after { content: " · 🎄"; letter-spacing: 0; }

/* ---------- onglet actif et boutons : rouge sucre d'orge ---------- */
html.theme-noel #shell .nav > a.on,
html.theme-noel .ngroup.on > .ng-btn,
html.theme-noel .tabs button.on {
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .14) 0 8px, transparent 8px 16px), var(--p-btn);
  box-shadow: 0 6px 20px rgba(227, 38, 63, .4), inset 0 1px 0 rgba(255, 255, 255, .35);
}
html.theme-noel .bt.primary,
html.theme-noel .login-btn,
html.theme-noel .instbar .go {
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .13) 0 9px, transparent 9px 18px), var(--p-btn);
  box-shadow: 0 10px 28px rgba(227, 38, 63, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
}
html.theme-noel .tabbar .on svg, html.theme-noel .tabbar .on .burger { color: #ff5f86; }
html.theme-noel .tabbar .on::before { background: var(--p-btn); box-shadow: 0 0 12px rgba(227, 38, 63, .8); }
html.theme-noel .page-head .eyebrow { border-color: rgba(255, 207, 90, .35); background: rgba(227, 38, 63, .1); color: #ffe7b0; }
html.theme-noel .topbar .eyebrow, html.theme-noel .dlg-sub, html.theme-noel .ng-title, html.theme-noel .me-menu-t { color: #ff8aa3; }

/* ---------- neige posée en haut des cadres ---------- */
html.theme-noel .panel, html.theme-noel .kpi, html.theme-noel .announce, html.theme-noel .login-card, html.theme-noel .dlg-box { position: relative; }
html.theme-noel .panel::before,
html.theme-noel .login-card::before,
html.theme-noel .dlg-box::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; pointer-events: none; z-index: 1;
  border-radius: var(--p-r) var(--p-r) 0 0;
  /* paquets de neige de tailles différentes, répétés à des pas différents : pas de motif visible */
  background:
    linear-gradient(#fff, #fff) top / 100% 3px no-repeat,
    radial-gradient(ellipse 26px 9px at 50% 0, #fff 96%, transparent 100%) 0 0 / 83px 12px repeat-x,
    radial-gradient(ellipse 16px 6px at 50% 0, #f3f7ff 96%, transparent 100%) 31px 0 / 59px 12px repeat-x,
    radial-gradient(ellipse 40px 7px at 50% 0, #fbfdff 96%, transparent 100%) 12px 0 / 137px 12px repeat-x,
    radial-gradient(circle 3px at 50% 9px, #fff 96%, transparent 100%) 20px 0 / 101px 12px repeat-x;
  opacity: .9; filter: drop-shadow(0 2px 3px rgba(150, 180, 255, .3));
}
html.theme-noel .warnbox::before, html.theme-noel .quotacard.late::before { opacity: .55; }
html.theme-noel .panel-h { padding-top: 18px; }

/* ---------- annonce : petite boule de Noël au lieu de la couronne ---------- */
html.theme-noel .announce::after { background-image: var(--crown); }

/* ---------- pied de page : congère + « Joyeuses fêtes » ---------- */
html.theme-noel .foot { position: relative; border-top: 0; padding-top: 44px; }
html.theme-noel .foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px; pointer-events: none;
  background:
    radial-gradient(60px 26px at 40px 26px, #f4f7ff 98%, transparent 100%),
    radial-gradient(90px 30px at 130px 30px, #ffffff 98%, transparent 100%),
    radial-gradient(70px 24px at 230px 26px, #eef3ff 98%, transparent 100%);
  background-size: 300px 26px; background-repeat: repeat-x; opacity: .14;
}
html.theme-noel .foot::after { content: "🎄 Joyeuses fêtes"; margin-left: 4px; color: #ffcf5a; letter-spacing: .2em; }

/* ---------- page de connexion / candidature ---------- */
html.theme-noel .login-brand::after {
  content: "🎄 Joyeuses fêtes · Prime RP"; color: #ffe7b0;
  border-color: rgba(255, 207, 90, .4); background: rgba(227, 38, 63, .14);
}
html.theme-noel .login-brand::before { border-color: rgba(255, 207, 90, .35); }
html.theme-noel .login-logo { width: 170px; filter: drop-shadow(0 18px 30px rgba(227, 38, 63, .4)); }

/* ---------- divers ---------- */
html.theme-noel ::selection { background: rgba(227, 38, 63, .45); }
html.theme-noel * { scrollbar-color: rgba(227, 38, 63, .45) transparent; }
html.theme-noel ::-webkit-scrollbar-thumb { background: rgba(227, 38, 63, .4); }
html.theme-noel .c-burst { filter: drop-shadow(0 2px 6px rgba(227, 38, 63, .6)); }
@media (prefers-reduced-motion: reduce) { html.theme-noel .hdr::after { animation: none; } }

/* =====================================================================
   ENCORE PLUS NOËL : sapin, cadeaux, traîneau, boules, flocons, compte à rebours
   ===================================================================== */
/* vrais flocons ❄ */
#crown-sky i.flake.star { width: auto !important; background: none; color: #fff; font-style: normal; line-height: 1; text-shadow: 0 0 8px rgba(180, 210, 255, .8); }

/* décor fixe derrière le contenu */
.xm-deco { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.login-container .xm-deco { position: absolute; z-index: 0; }
.xm-tree { position: absolute; left: max(6px, calc(50% - 760px)); bottom: 8px; width: 150px; filter: drop-shadow(0 0 24px rgba(47, 191, 114, .25)); }
.xm-tree .star { transform-origin: 80px 22px; animation: xm-star 2.4s ease-in-out infinite; filter: drop-shadow(0 0 8px #ffcf5a); }
.xm-tree .tl circle { animation: xm-blink 1.8s ease-in-out infinite; }
.xm-tree .tl circle:nth-child(2n) { animation-delay: -.9s; }
.xm-tree .tl circle:nth-child(3n) { animation-delay: -.45s; }
@keyframes xm-star { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(8deg); } }
@keyframes xm-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.xm-gifts { position: absolute; right: max(6px, calc(50% - 770px)); bottom: 10px; width: 170px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .5)); }
.xm-drift {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px; opacity: .22;
  background:
    radial-gradient(100px 26px at 115px 40px, #f2f6ff 97%, transparent 100%) 0 0 / 230px 40px repeat-x,
    radial-gradient(70px 20px at 85px 40px, #ffffff 97%, transparent 100%) 60px 0 / 170px 40px repeat-x,
    linear-gradient(#fff, #fff) bottom / 100% 10px no-repeat;
  filter: blur(1px);
}
.xm-sleigh { position: absolute; top: 120px; left: -320px; width: 260px; opacity: 0; filter: drop-shadow(0 0 10px rgba(255, 207, 90, .55)); animation: xm-fly 28s linear infinite 3s; }
@keyframes xm-fly {
  0% { transform: translate(0, 40px) rotate(-6deg); opacity: 0; }
  2% { opacity: .9; }
  28% { opacity: .9; }
  30% { transform: translate(calc(100vw + 640px), -60px) rotate(-6deg); opacity: 0; }
  100% { transform: translate(calc(100vw + 640px), -60px); opacity: 0; }
}
@media (max-width: 1100px) { .xm-tree, .xm-gifts { width: 96px; opacity: .55; } }
@media (max-width: 760px) {
  .xm-tree, .xm-gifts { display: none; }
  .xm-drift { bottom: calc(68px + env(safe-area-inset-bottom)); height: 22px; opacity: .5; }
  .xm-sleigh { top: 90px; width: 170px; }
}
.login-container .xm-tree, .login-container .xm-gifts { opacity: 1; }

/* boules qui pendent sous la barre du haut */
.xm-baubles { position: absolute; left: 0; right: 0; top: 100%; height: 0; pointer-events: none; z-index: 3; }
.xm-baubles i { position: absolute; top: 0; width: 26px; transform-origin: 50% 0; animation: xm-swing 3.4s ease-in-out infinite; }
.xm-baubles i::before { content: ""; display: block; width: 1px; height: var(--len); margin: 0 auto; background: rgba(255, 207, 90, .7); }
.xm-baubles svg { display: block; width: 26px; margin-top: -2px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); }
@keyframes xm-swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@media (max-width: 1000px) { .xm-baubles i { width: 20px; } .xm-baubles svg { width: 20px; } }

/* compte à rebours à côté du logo */
.xm-count {
  justify-self: start; align-self: center; margin-left: 6px; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px; font: 800 12px var(--font); letter-spacing: .04em; color: #fff;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .16) 0 7px, transparent 7px 14px), linear-gradient(180deg, #e3263f, #a3122a);
  border: 1px solid rgba(255, 207, 90, .55); box-shadow: 0 6px 18px rgba(227, 38, 63, .35);
  animation: xm-pop 3s ease-in-out infinite;
}
@keyframes xm-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@media (max-width: 520px) { .xm-count { font-size: 10.5px; padding: 5px 10px; margin-left: 0; } }

/* bonnet de Père Noël sur la photo de profil */
html.theme-noel .me-chip .avatar::after {
  width: 34px; top: -15px; left: 58%; aspect-ratio: 842 / 652;
  background: url(/img/hat-noel.png) center / contain no-repeat; transform: translateX(-50%) rotate(12deg);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}

/* touches dorées */
html.theme-noel .panel-h h2, html.theme-noel .kpi .l { color: #ffe7b0; }
html.theme-noel .panel, html.theme-noel .kpi { border-color: rgba(255, 207, 90, .14); }
html.theme-noel .kpi.hot { border-color: rgba(227, 38, 63, .45); background: linear-gradient(160deg, rgba(227, 38, 63, .18), rgba(22, 14, 20, .72) 60%); }
html.theme-noel .kpi.hot::after { background: repeating-linear-gradient(-45deg, #fff 0 6px, #e3263f 6px 12px); }
html.theme-noel .page-head h1 { background: linear-gradient(180deg, #ffffff 0%, #fff1f4 50%, #ff8aa3 100%); -webkit-background-clip: text; background-clip: text; }

html.theme-noel .bars i, html.theme-noel .chart .bar { background: linear-gradient(180deg, #ff5f86, #8a1230); }
html.theme-noel .chart .bar:nth-child(odd), html.theme-noel .bars i:nth-child(3n) { background: linear-gradient(180deg, #3ee07f, #0d6b3a); }
html.theme-noel .cal .d.ev, html.theme-noel .pcal-big .pev { background: linear-gradient(160deg, #c81d3a, #5a0f20); }
html.theme-noel .cal .d.ev2, html.theme-noel .pcal-big .pev.mine { background: linear-gradient(160deg, #1f9d5a, #0d5530); }
