/* Déco temporaire de Noël, chargée seulement quand elle est active
   (réglage ROUE_NOEL). Pour la supprimer : ce fichier,
   templates/roue/_noel.html et les lignes {% if noel %}. */

body.noel {
    --xm-red: #d62a35;
    --xm-gold: #f0c94a;
    --xm-night: #0f1a33;
    --xm-text: #f4efe2;
    background: var(--xm-night);
    background-image:
        radial-gradient(circle at 50% 38%, rgba(240, 201, 74, 0.14), transparent 55%),
        linear-gradient(180deg, #0a1228 0%, #15264a 65%, #1d3360 100%);
    color: var(--xm-text);
    padding-bottom: clamp(90px, 20vw, 150px);
    position: relative;
    overflow-x: hidden;
}

/* Le contenu passe au-dessus du décor. */
body.noel main { position: relative; z-index: 1; }

body.noel .title-arc text {
    fill: var(--xm-red);
    stroke: #fff4dc;
}

/* Les chats noirs restent visibles sur la nuit grâce à un halo doré. */
body.noel .cat-deco,
body.noel .cat-trigger:hover .cat-deco {
    filter: drop-shadow(0 0 6px rgba(240, 201, 74, 0.8)) drop-shadow(0 0 18px rgba(240, 201, 74, 0.3));
}

/* Bonnet de Père Noël posé sur la tête des chats. Le chat de droite a la
   tête à gauche de l'image ; celui de gauche est mirroré, donc le bonnet aussi. */
body.noel .cat-trigger { position: relative; }
body.noel .cat-trigger::after {
    content: "";
    position: absolute;
    top: -9%;
    left: -1%;
    width: 40%;
    aspect-ratio: 1 / 1;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M14 74 C22 40 44 14 74 12 C88 12 94 24 92 40 C86 30 78 28 72 34 C70 50 76 64 84 72 Z' fill='%23d62a35' stroke='%237d0f17' stroke-width='2.5'/%3E%3Ccircle cx='92' cy='44' r='9' fill='%23fff' stroke='%23cfcfcf' stroke-width='2'/%3E%3Cpath d='M8 70 Q48 60 90 72 L88 88 Q48 76 10 86 Z' fill='%23fff' stroke='%23cfcfcf' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: rotate(-12deg);
    pointer-events: none;
}
body.noel .cat-trigger:has(.cat-left)::after {
    left: auto;
    right: -1%;
    transform: scaleX(-1) rotate(-12deg);
}

body.noel .status { color: var(--xm-gold); }

/* Dos de cartes : le profil du chat sur fond rouge. L'image a un fond jaune
   intégré ; en le multipliant par du rouge on obtient un rouge chaud,
   et le chat reste noir. */
body.noel .ring-face { border-color: #0d0a06; }
body.noel .ring-back {
    background-color: #d8323c;
    background-blend-mode: multiply;
    box-shadow:
        inset 0 0 0 calc(0.6 * var(--u)) #b01e28,
        inset 0 0 0 calc(0.85 * var(--u)) var(--xm-gold),
        0 0 calc(1 * var(--u)) rgba(240, 201, 74, 0.45);
}

/* Emplacements des 3 cartes, lisibles sur fond sombre. */
body.noel .draw-slot { border-color: rgba(240, 201, 74, 0.45); }
body.noel .draw-slot.filled { border-color: var(--xm-gold); box-shadow: 0 0 10px rgba(240, 201, 74, 0.4); }
body.noel .draw-slot-title { color: var(--xm-gold); }
body.noel .draw-slot-text { color: var(--xm-text); }

/* ---- Décor ---- */
.xm-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Guirlande lumineuse en haut de la page. */
.xm-lights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 46px;
    display: flex;
    justify-content: space-around;
    background:
        radial-gradient(ellipse 52% 26px at 50% -6px, transparent 96%, #3f5a38 97% 100%, transparent 101%) 0 0 / calc(100% / 10) 100% repeat-x;
}
.xm-lights span {
    width: 10px;
    height: 16px;
    margin-top: 14px;
    border-radius: 50% 50% 45% 45%;
    background: var(--c);
    box-shadow: 0 0 10px 2px var(--c);
    animation: xm-blink 1.6s ease-in-out infinite;
}
.xm-lights span::before {
    content: "";
    display: block;
    width: 6px;
    height: 4px;
    margin: -4px auto 0;
    background: #3a3a2a;
    border-radius: 1px;
}
.xm-lights span:nth-child(4n+1) { --c: #ff4b55; }
.xm-lights span:nth-child(4n+2) { --c: #ffd94a; animation-delay: -0.4s; }
.xm-lights span:nth-child(4n+3) { --c: #4be38a; animation-delay: -0.8s; }
.xm-lights span:nth-child(4n+4) { --c: #5aa8ff; animation-delay: -1.2s; }
.xm-lights span:nth-child(even) { margin-top: 22px; }
/* Sur téléphone, une ampoule sur deux suffit. */
@media (max-width: 479px) {
    .xm-lights span:nth-child(n+11) { display: none; }
    .xm-holly { width: 17vw; height: 11.3vw; top: 34px; }
}

@keyframes xm-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; box-shadow: 0 0 3px 0 var(--c); }
}

/* Branches de houx dans les coins, sous la guirlande. */
.xm-holly {
    position: absolute;
    top: 30px;
    width: min(130px, 24vw);
    height: min(87px, 16vw);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}
.xm-holly-left { left: 4px; transform: rotate(-18deg); }
.xm-holly-right { right: 4px; transform: scaleX(-1) rotate(-18deg); }

/* Neige qui tombe. */
.xm-snow span {
    position: absolute;
    top: -30px;
    color: #fff;
    opacity: 0.8;
    font-size: 14px;
    line-height: 1;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
    animation: xm-fall 14s linear infinite;
}
.xm-snow span:nth-child(1)  { left: 3%;  animation-duration: 13s; animation-delay: -2s; }
.xm-snow span:nth-child(2)  { left: 8%;  font-size: 10px; animation-duration: 17s; animation-delay: -9s; }
.xm-snow span:nth-child(3)  { left: 13%; font-size: 18px; animation-duration: 11s; animation-delay: -5s; }
.xm-snow span:nth-child(4)  { left: 18%; font-size: 9px;  animation-duration: 19s; animation-delay: -14s; }
.xm-snow span:nth-child(5)  { left: 23%; animation-duration: 15s; animation-delay: -7s; }
.xm-snow span:nth-child(6)  { left: 28%; font-size: 11px; animation-duration: 16s; animation-delay: -1s; }
.xm-snow span:nth-child(7)  { left: 33%; font-size: 16px; animation-duration: 12s; animation-delay: -10s; }
.xm-snow span:nth-child(8)  { left: 38%; font-size: 8px;  animation-duration: 20s; animation-delay: -4s; }
.xm-snow span:nth-child(9)  { left: 43%; animation-duration: 14s; animation-delay: -12s; }
.xm-snow span:nth-child(10) { left: 48%; font-size: 12px; animation-duration: 18s; animation-delay: -6s; }
.xm-snow span:nth-child(11) { left: 53%; font-size: 17px; animation-duration: 12s; animation-delay: -3s; }
.xm-snow span:nth-child(12) { left: 58%; font-size: 9px;  animation-duration: 21s; animation-delay: -16s; }
.xm-snow span:nth-child(13) { left: 63%; animation-duration: 15s; animation-delay: -8s; }
.xm-snow span:nth-child(14) { left: 68%; font-size: 11px; animation-duration: 17s; animation-delay: -13s; }
.xm-snow span:nth-child(15) { left: 73%; font-size: 15px; animation-duration: 13s; animation-delay: -1s; }
.xm-snow span:nth-child(16) { left: 78%; font-size: 8px;  animation-duration: 22s; animation-delay: -11s; }
.xm-snow span:nth-child(17) { left: 83%; animation-duration: 14s; animation-delay: -5s; }
.xm-snow span:nth-child(18) { left: 88%; font-size: 12px; animation-duration: 16s; animation-delay: -15s; }
.xm-snow span:nth-child(19) { left: 93%; font-size: 18px; animation-duration: 11s; animation-delay: -9s; }
.xm-snow span:nth-child(20) { left: 97%; font-size: 10px; animation-duration: 18s; animation-delay: -2s; }
.xm-snow span:nth-child(21) { left: 26%; font-size: 13px; animation-duration: 24s; animation-delay: -19s; }
.xm-snow span:nth-child(22) { left: 46%; font-size: 7px;  animation-duration: 23s; animation-delay: -17s; }
.xm-snow span:nth-child(23) { left: 66%; font-size: 14px; animation-duration: 25s; animation-delay: -20s; }
.xm-snow span:nth-child(24) { left: 86%; font-size: 7px;  animation-duration: 24s; animation-delay: -22s; }

@keyframes xm-fall {
    0%   { translate: 0 0;     rotate: 0deg; }
    25%  { translate: 18px 25vh; }
    50%  { translate: -12px 50vh; }
    75%  { translate: 14px 75vh; }
    100% { translate: 0 calc(100vh + 40px); rotate: 360deg; }
}

/* Congère en bas de page, avec sapins et cadeau. */
.xm-ground {
    position: absolute;
    left: -5%;
    right: -5%;
    bottom: 0;
    height: clamp(40px, 8vw, 70px);
    background: #eef4fb;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    box-shadow: inset 0 6px 10px rgba(160, 190, 230, 0.6);
}

.xm-tree {
    position: absolute;
    bottom: clamp(14px, 3vw, 26px);
    width: clamp(70px, 15vw, 120px);
    height: clamp(84px, 18vw, 144px);
    filter: drop-shadow(0 0 10px rgba(240, 201, 74, 0.3));
}
.xm-tree-left { left: 3vw; }
.xm-tree-right { right: 3vw; width: clamp(56px, 12vw, 96px); height: clamp(67px, 14.4vw, 115px); }

.xm-star { animation: xm-twinkle 2.2s ease-in-out infinite; transform-origin: 50px 10px; }
@keyframes xm-twinkle {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

.xm-gift {
    position: absolute;
    bottom: clamp(14px, 3vw, 26px);
    left: calc(3vw + clamp(62px, 13.5vw, 108px));
    width: clamp(30px, 6vw, 50px);
    height: clamp(28px, 5.6vw, 47px);
}

@media (prefers-reduced-motion: reduce) {
    .xm-snow { display: none; }
    .xm-lights span, .xm-star { animation: none; }
}
