/* ==========================================================================
   LINSY-CITY-RP — ÉDITION NOËL  (assets/css/noel.css)
   Chargé après style.css sur toutes les pages. Ne redéfinit aucune règle
   existante : tout est préfixé .xm- et purement décoratif (pointer-events:none).
   Palette Linsy conservée : #0a0014 / #100020 / #ff2bd6 / #9b5cff / #eae6ff.
   ========================================================================== */

:root {
  --xm-gold: #ffc86b;
  --xm-ice: #cfe8ff;
  --xm-pine: #1d8559;
}

/* ---------- Décor purement visuel : jamais d'interaction ---------- */
.xm-cap, .xm-cap::before, .xm-cap::after,
.xm-garland, .xm-garland *, .xm-scene, .xm-scene *, .xm-branch, .xm-branch *,
.xm-hat, .xm-hat *, .xm-wreath-wrap, .xm-wreath-wrap *, .xm-corner-deco, .xm-corner-deco *,
.xm-banner-deco, .xm-banner-deco *, .xm-ambient, #xm-snow, #xm-defs {
  pointer-events: none !important;
  user-select: none;
  -webkit-user-select: none;
}
.xm-host { position: relative; }
.xm-art { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- Neige qui tombe ---------- */
#xm-snow {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 9000;              /* au-dessus du contenu et du header, sous les popups (99999) */
}
html.xm-admin #xm-snow { opacity: .8; }

/* ---------- Ambiance : lueur froide + lueur chaude de cheminée ---------- */
.xm-ambient {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60vw 38vh at 8% 0%, rgba(180, 215, 255, .075), transparent 70%),
    radial-gradient(48vw 34vh at 96% 4%, rgba(255, 43, 214, .06), transparent 70%),
    radial-gradient(70vw 38vh at 50% 108%, rgba(255, 196, 100, .085), transparent 70%),
    radial-gradient(30vw 26vh at 0% 100%, rgba(255, 60, 90, .05), transparent 70%);
}

/* ==========================================================================
   NEIGE ACCUMULÉE (cards, boutons, panneaux…)
   Chaque .xm-cap est un amas de neige composé de :
     - deux bouts arrondis (ils épousent les coins)
     - une bande irrégulière répétée (4 variantes, décalage aléatoire)
     - parfois un petit tas (.xm-l1/2/3) et des glaçons (variante c)
   ========================================================================== */
.xm-cap {
  --xm-h: 36px;
  position: absolute; z-index: 4;
  left: -1px; right: -1px;
  top: calc(var(--xm-h) * -.3);
  height: var(--xm-h);
  background:
    url(../img/noel/end-l.svg) left top / auto 100% no-repeat,
    url(../img/noel/end-r.svg) right top / auto 100% no-repeat;
}
.xm-cap::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: calc(var(--xm-h) * .62); right: calc(var(--xm-h) * .62);
  background: var(--xm-tile, url(../img/noel/snow-a.svg)) var(--xm-off, 0) 0 / auto 100% repeat-x;
}
.xm-cap-md { --xm-h: 28px; }
.xm-cap-sm { --xm-h: 20px; }
.xm-v-a { --xm-tile: url(../img/noel/snow-a.svg); }
.xm-v-b { --xm-tile: url(../img/noel/snow-b.svg); }
.xm-v-c { --xm-tile: url(../img/noel/snow-c.svg); }
.xm-v-d { --xm-tile: url(../img/noel/snow-d.svg); }

/* éléments qui rognent leur contenu (overflow hidden) : la neige reste dedans */
.xm-cap.xm-in { top: calc(var(--xm-h) * -.17); }

/* petits tas de neige posés sur la bordure */
.xm-cap.xm-l1::after, .xm-cap.xm-l2::after, .xm-cap.xm-l3::after {
  content: ""; position: absolute; left: var(--xm-lx, 40%);
  top: calc(var(--xm-h) * -.6);
  transform: translateX(-50%);
  background: center / 100% 100% no-repeat;
}
.xm-cap.xm-l1::after { width: calc(var(--xm-h) * 1.9);  height: calc(var(--xm-h) * .95);  background-image: url(../img/noel/lump-1.svg); }
.xm-cap.xm-l2::after { width: calc(var(--xm-h) * 1.45); height: calc(var(--xm-h) * .82);  background-image: url(../img/noel/lump-2.svg); }
.xm-cap.xm-l3::after { width: calc(var(--xm-h) * 2.2);  height: calc(var(--xm-h) * .98);  background-image: url(../img/noel/lump-3.svg); }

/* ==========================================================================
   GUIRLANDES
   ========================================================================== */
.xm-garland {
  position: absolute; z-index: 3; overflow: visible;
  contain: layout style;
}
.xm-garland-svg { display: block; overflow: visible; max-width: none; }
.xm-g-header  { left: 0; right: 0; top: 100%; margin-top: -3px; z-index: 1; }
.xm-g-footer  { left: 0; right: 0; top: -1px; }
.xm-g-section { left: 0; right: 0; top: -4px; }
.xm-g-corner  { left: 0; top: -3px; }
.xm-g-corner.xm-right { left: auto; right: 0; transform: scaleX(-1); }
.xm-g-top     { top: -8px; }

/* scintillement : intensité, durée et phase propres à chaque ampoule */
.xm-lit { animation: xmTw1 var(--d, 2s) ease-in-out var(--l, 0s) infinite alternate; }
.xm-t2  { animation-name: xmTw2; animation-direction: normal; }
.xm-t3  { animation-name: xmTw3; animation-direction: normal; }
@keyframes xmTw1 { from { opacity: var(--lo, .5); } to { opacity: 1; } }
@keyframes xmTw2 { 0%, 100% { opacity: 1; } 30% { opacity: var(--lo, .5); } 38% { opacity: 1; } 62% { opacity: .8; } 70% { opacity: var(--lo, .5); } }
@keyframes xmTw3 { 0% { opacity: 1; } 42% { opacity: 1; } 48% { opacity: var(--lo, .5); } 54% { opacity: 1; } 78% { opacity: .85; } 100% { opacity: var(--lo, .55); } }
/* hors écran : on met les clignotements en pause (économie CPU) */
.xm-paused .xm-lit, .xm-paused.xm-lit { animation-play-state: paused; }

/* ==========================================================================
   SCÈNES (pied de page, hero) — décors posés sur une congère
   ========================================================================== */
.xm-scene { position: relative; pointer-events: none; overflow: hidden; }
.xm-scene-footer { height: 160px; margin: 26px -6% -24px; }
.xm-scene-admin  { height: 118px; }
.xm-item {
  position: absolute; bottom: 30px; display: block;
  transform: translateX(-50%); transform-origin: 50% 100%;
}
.xm-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 66px;
  background: url(../img/noel/drift.svg) left bottom / auto 100% repeat-x;
}
.xm-scene-admin .xm-ground { height: 48px; }
.xm-scene-admin .xm-item { bottom: 20px; }
.xm-scene-admin .xm-item:nth-child(n+3) { display: none; }

.xm-scene-hero {
  position: absolute; left: 0; right: 0; bottom: 0; height: 280px; z-index: 1; overflow: hidden;
}
.xm-scene-hero .xm-item { bottom: 28px; }
.xm-ground-hero { height: 78px; }
.hero > .hero-content { position: relative; z-index: 2; }

.xm-glint-pos {
  position: absolute; line-height: 0; opacity: 0;
  animation: xmGlint var(--d, 3s) ease-in-out var(--l, 0s) infinite;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, .9));
}
.xm-glint { display: block; }
@keyframes xmGlint {
  0%, 100% { opacity: 0; transform: scale(.35) rotate(0); }
  50%      { opacity: .95; transform: scale(1) rotate(45deg); }
}

/* ---------- Couronne autour du logo du hero ---------- */
.xm-wreath-wrap {
  position: absolute; z-index: 1; display: block; line-height: 0;
  animation: xmFloat 3s ease-in-out infinite;       /* même mouvement que le logo */
}
@keyframes xmFloat { 0% { transform: translateY(0); } 50% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
.hero-logo.xm-has-wreath { position: relative; z-index: 2; margin-bottom: 3.8rem; }

/* ---------- Branches de sapin accrochées aux coins (grands écrans) ---------- */
.xm-branch { display: none; position: absolute; top: 34px; width: 190px; z-index: 2; line-height: 0; }
.xm-branch-l { left: 0; }
.xm-branch-r { right: 0; transform: scaleX(-1); }
@media (min-width: 1320px) { .xm-branch { display: block; } }

/* ---------- Bonnet de Père Noël sur le logo du header ---------- */
.xm-hat { position: absolute; left: 1.2em; top: -.5em; width: 1.5em; line-height: 0; transform: rotate(16deg); z-index: 3; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }

/* ---------- Brins de houx dans les coins de cards / bannières ---------- */
.xm-corner-deco { position: absolute; top: -13px; right: 14px; width: 46px; line-height: 0; z-index: 5; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.xm-corner-deco.xm-left { right: auto; left: 14px; transform: scaleX(-1); }
.xm-banner-deco { position: absolute; inset: 0; overflow: hidden; z-index: 1; border-radius: inherit; }
.xm-banner-deco .xm-corner-deco.xm-bleft  { top: auto; bottom: 8px; left: 12px; right: auto; width: 54px; transform: rotate(-8deg); }
.xm-banner-deco .xm-corner-deco.xm-bright { top: auto; bottom: 8px; right: 12px; left: auto; width: 54px; transform: scaleX(-1) rotate(-8deg); }

/* ==========================================================================
   BOUTON ❄ (le visiteur peut couper les décorations)
   ========================================================================== */
.xm-toggle {
  position: fixed; left: 16px; bottom: 16px; z-index: 9500;
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #eae6ff; cursor: pointer;
  background: rgba(16, 0, 32, .78);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 43, 214, .45);
  box-shadow: 0 0 14px rgba(255, 43, 214, .28), inset 0 0 8px rgba(155, 92, 255, .2);
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.xm-toggle:hover { transform: scale(1.08) rotate(30deg); box-shadow: 0 0 22px rgba(255, 43, 214, .55); }
.xm-toggle:focus-visible { outline: 2px solid #ff2bd6; outline-offset: 3px; }
html.xm-off .xm-toggle { opacity: .6; color: #b7a6ff; box-shadow: none; }

/* ==========================================================================
   INTERRUPTEUR GLOBAL (html.xm-off) : tout le décor disparaît d'un coup
   ========================================================================== */
html.xm-off .xm-cap, html.xm-off .xm-garland, html.xm-off .xm-scene, html.xm-off .xm-branch,
html.xm-off .xm-hat, html.xm-off .xm-wreath-wrap, html.xm-off .xm-corner-deco,
html.xm-off .xm-banner-deco, html.xm-off .xm-ambient, html.xm-off #xm-snow { display: none !important; }
html.xm-off .hero-logo.xm-has-wreath { margin-bottom: 1.5rem; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1180px) { .xm-hide-lg { display: none !important; } }
@media (max-width: 900px) {
  .xm-hide-md { display: none !important; }
  .xm-scene-footer { height: 140px; }
  .xm-scene-hero { height: 150px; }
  .xm-ground-hero { height: 56px; }
  .xm-cap { --xm-h: 30px; }
  .xm-cap-md { --xm-h: 24px; }
  .xm-cap-sm { --xm-h: 18px; }
}
@media (max-width: 600px) {
  .xm-hide-sm { display: none !important; }
  .xm-scene-footer { height: 124px; }
  .xm-scene-footer .xm-item { transform: translateX(-50%) scale(.82); }
  .xm-scene-footer .xm-item:first-child { left: 14% !important; }
  .xm-scene-footer .xm-item:nth-child(2) { left: 86% !important; }
  .xm-toggle { left: 10px; bottom: 10px; width: 36px; height: 36px; }
  .xm-corner-deco { width: 38px; }
  .xm-g-corner { display: none; }
}

/* ==========================================================================
   ACCESSIBILITÉ : prefers-reduced-motion → plus aucune animation décorative
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .xm-lit, .xm-wreath-wrap, .xm-glint-pos, .xm-toggle { animation: none !important; transition: none !important; }
  .xm-lit { opacity: .9; }
  .xm-glint-pos { opacity: .7; }
}
html.xm-reduce .xm-lit, html.xm-reduce .xm-wreath-wrap, html.xm-reduce .xm-glint-pos { animation: none !important; }

@media print {
  .xm-cap, .xm-garland, .xm-scene, .xm-branch, .xm-hat, .xm-wreath-wrap, .xm-corner-deco,
  .xm-banner-deco, .xm-ambient, #xm-snow, .xm-toggle { display: none !important; }
}
