/* ==========================================================================
   Thème de Noël — activé via la globale Twig `theme_noel` (config/packages/twig.yaml)
   Tout est scopé sous body.theme-noel : retirer la globale suffit à tout désactiver.
   ========================================================================== */

:root {
    --noel-red: #d62839;
    --noel-red-dark: #a4161a;
    --noel-green: #1f7a4d;
    --noel-green-dark: #14532d;
    --noel-gold: #ffd166;
    --noel-gold-dark: #f4a300;
    --noel-snow: #f2f6fb;
}

/* --------------------------------------------------------------------------
   Fond : léger halo « nuit d'hiver »
   -------------------------------------------------------------------------- */
body.theme-noel::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(255, 209, 102, .07), transparent 60%),
        radial-gradient(1100px 700px at 10% 110%, rgba(31, 122, 77, .10), transparent 60%);
    will-change: transform; /* calque à part : pas de repeinture au scroll */
}

/* --------------------------------------------------------------------------
   Neige (canvas plein écran, ne capte jamais les clics)
   -------------------------------------------------------------------------- */
#noel-snow {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1039; /* sous les modales Bootstrap (1050) */
    transition: opacity .6s ease;
}

#noel-snow.is-off {
    opacity: 0;
}

/* --------------------------------------------------------------------------
   Navbar : logo avec bonnet
   -------------------------------------------------------------------------- */
.theme-noel .navbar img.navbar-logo {
    height: 38px;
    margin-top: 0;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
    transform-origin: 20% 80%;
}

.theme-noel .navbar a.navbar-logo:hover img.navbar-logo {
    transform: rotate(-4deg) scale(1.06);
}

.theme-noel .navbar a.navbar-logo {
    height: auto;
    margin-top: 0;
    display: flex;
    align-items: center;
    height: 54px;
}

/* --------------------------------------------------------------------------
   Guirlande rouge sous la navbar (statique, scintillement via data-phase)
   -------------------------------------------------------------------------- */
.theme-noel nav.navbar {
    position: relative;
}

.noel-garland {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 24px;
    margin: 0;
    padding: 0 0 0 10px; /* centre de la 1re ampoule à 14px = 1er point d'accroche */
    list-style: none;
    display: flex;
    gap: 20px; /* 8px d'ampoule + 20px = un feston de 28px */
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
    transition: opacity .4s ease;
}

/* Neige coupée par l'utilisateur : la guirlande s'éteint aussi */
.noel-deco-off .noel-garland {
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease, visibility 0s .4s;
}

.noel-garland::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='12' viewBox='0 0 28 12'%3E%3Cpath d='M0 1.5 Q14 12 28 1.5' fill='none' stroke='%23324238' stroke-width='1.8'/%3E%3C/svg%3E") repeat-x;
    background-size: 28px 12px;
    background-position: 14px 0;
}

.noel-garland li {
    width: 8px;
    height: 13px;
    margin-top: 5px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: radial-gradient(circle at 35% 30%, #ff8a8a, var(--noel-red) 55%, var(--noel-red-dark));
    box-shadow: 0 0 6px 1px rgba(214, 40, 57, .75);
    flex-shrink: 0;
    transform-origin: 50% -3px;
    transition: opacity .35s ease;
}

.noel-garland li:nth-child(odd)  { transform: rotate(9deg); }
.noel-garland li:nth-child(even) { transform: rotate(-9deg); }

.noel-garland[data-phase="0"] li:nth-child(3n),
.noel-garland[data-phase="1"] li:nth-child(3n+1),
.noel-garland[data-phase="2"] li:nth-child(3n+2),
.noel-garland[data-phase="3"] li:nth-child(4n) {
    opacity: .35;
}

/* --------------------------------------------------------------------------
   Outils navbar : compte à rebours + interrupteur neige
   -------------------------------------------------------------------------- */
.theme-noel .navbar #user-menu {
    margin-left: 14px;
}

.noel-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.noel-countdown,
.noel-snow-toggle {
    border: 0;
    background: #f4f6fb;
    color: #12142a;
    border-radius: 999px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-family: camptonsemibold, camptonlight, sans-serif;
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
    user-select: none;
}

.noel-countdown {
    padding: 0 12px 0 10px;
}

.noel-countdown i {
    font-size: 16px;
    --fa-primary-color: var(--noel-red);
    --fa-secondary-color: var(--noel-gold);
    --fa-secondary-opacity: 1;
}

.noel-countdown:hover {
    background: #fff2d1;
    box-shadow: 0 2px 10px rgba(244, 163, 0, .25);
}

.noel-countdown:hover i {
    animation: noel-wiggle .6s ease-in-out;
}

.noel-snow-toggle {
    width: 32px;
    justify-content: center;
    font-size: 15px;
    color: #4a7fd6;
}

.noel-snow-toggle:hover {
    background: #e3ecfb;
    transform: rotate(60deg);
}

.noel-snow-toggle.is-off {
    color: #9aa3b5;
    background: #f4f6fb;
}

.noel-snow-toggle.is-off::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 2px;
    background: #9aa3b5;
    transform: rotate(-45deg);
    border-radius: 2px;
}

.noel-snow-toggle {
    position: relative;
}

@keyframes noel-wiggle {
    0%, 100% { transform: rotate(0); }
    20%      { transform: rotate(-14deg) scale(1.1); }
    40%      { transform: rotate(12deg) scale(1.1); }
    60%      { transform: rotate(-8deg); }
    80%      { transform: rotate(5deg); }
}

/* Confettis / paillettes générés au clic sur le compte à rebours */
.noel-sparkle {
    position: fixed;
    pointer-events: none;
    z-index: 2000;
    font-size: 14px;
    will-change: transform, opacity;
    animation: noel-sparkle-fly 1.1s cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes noel-sparkle-fly {
    0%   { transform: translate(0, 0) scale(.4) rotate(0); opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Menu latéral : liseré sucre d'orge, survol doré, scène enneigée
   -------------------------------------------------------------------------- */
.theme-noel #side-menu {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #12142a 0%, #12162e 55%, #10203a 100%);
}

.theme-noel #side-menu::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: 276px;
    width: 4px;
    background: repeating-linear-gradient(-45deg, var(--noel-red) 0 7px, #fff 7px 14px);
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    z-index: 3;
}

.theme-noel #side-menu.open::after {
    opacity: .9;
}

.theme-noel #side-menu > ul a {
    display: inline-block;
    transition: color .2s, transform .2s, text-shadow .2s;
}

.theme-noel #side-menu > ul a:hover {
    color: var(--noel-gold);
    text-shadow: 0 0 10px rgba(255, 209, 102, .45);
    transform: translateX(4px);
}

.noel-scene {
    contain: layout paint;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
    width: 280px;
    line-height: 0;
    pointer-events: none;
}

.noel-scene svg {
    width: 100%;
    height: auto;
    display: block;
}

.noel-big-tree {
    pointer-events: auto;
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transition: transform .2s;
}

.noel-big-tree:hover {
    transform: scale(1.04);
}

.noel-big-tree.is-shaking {
    animation: noel-tree-shake .7s ease-in-out;
}

@keyframes noel-tree-shake {
    0%, 100% { transform: rotate(0); }
    15%      { transform: rotate(-4deg); }
    30%      { transform: rotate(3.5deg); }
    45%      { transform: rotate(-2.5deg); }
    60%      { transform: rotate(2deg); }
    80%      { transform: rotate(-1deg); }
}

.noel-star {
    filter: drop-shadow(0 0 5px rgba(255, 209, 102, .9));
}

/* Scintillements de la scène, pilotés par le même chenillard (data-phase sur .noel-scene) */
.noel-scene[data-phase="0"] .noel-bulb:nth-of-type(odd),
.noel-scene[data-phase="2"] .noel-bulb:nth-of-type(even),
.noel-scene[data-phase="1"] .noel-sky-stars circle:nth-child(2n),
.noel-scene[data-phase="3"] .noel-sky-stars circle:nth-child(3n),
.noel-scene[data-phase="0"] .noel-drift-glints circle:nth-child(odd),
.noel-scene[data-phase="2"] .noel-drift-glints circle:nth-child(even) {
    opacity: .3;
}

.noel-scene[data-phase="2"] .noel-star {
    opacity: .8;
}




@keyframes noel-svg-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

@keyframes noel-steps-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .3; }
}


.noel-moon {
    filter: drop-shadow(0 0 6px rgba(255, 243, 196, .6));
}

.noel-snowman-arm {
    transform-box: view-box;
    transform-origin: 86px 126px;
}

.noel-snowman-arm.is-waving {
    animation: noel-wave 1.2s ease-in-out;
}

@keyframes noel-wave {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-18deg); }
    50%      { transform: rotate(4deg); }
    75%      { transform: rotate(-14deg); }
}


/* --------------------------------------------------------------------------
   Neige accumulée sur les cartes du dashboard et le formulaire de connexion
   -------------------------------------------------------------------------- */
.theme-noel .dashboard-part .card.m-3,
.theme-noel #login-form {
    position: relative;
    overflow: visible;
}

.theme-noel .dashboard-part .card.m-3::before,
.theme-noel #login-form::before {
    content: "";
    position: absolute;
    top: -9px;
    left: -3px;
    right: -3px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 22' preserveAspectRatio='none'%3E%3Cpath d='M6 10 C6 3 14 1 30 3 C52 0 70 6 96 2 C120 -1 140 5 168 3 C196 1 214 6 240 2 C266 -1 290 4 318 2 C346 0 370 5 388 3 C396 2 400 6 400 10 L400 12 C394 12 392 15 388 15 C384 15 384 20 380 20 C376 20 376 14 370 13 L300 13 C292 13 292 18 288 18 C284 18 284 13 278 13 L170 13 C162 13 163 21 158 21 C153 21 154 13 146 13 L60 13 C54 13 54 17 50 17 C46 17 46 13 40 13 L12 13 C8 13 6 12 6 10 Z' fill='%23f7faff'/%3E%3C/svg%3E") no-repeat;
    background-size: 100% 100%;
    filter: drop-shadow(0 2px 2px rgba(10, 15, 40, .25));
    pointer-events: none;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Loader de page aux couleurs de Noël
   -------------------------------------------------------------------------- */
/* Les deux rideaux = papier cadeau vert sapin + ruban doré en croix */
.theme-noel #loader-page #top-part,
.theme-noel #loader-page #bottom-part {
    background-color: var(--noel-green-dark);
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .55) 1.6px, transparent 2.2px),
        radial-gradient(circle, rgba(255, 255, 255, .3) 1px, transparent 1.6px);
    background-size: 46px 46px, 30px 30px;
    background-position: 0 0, 15px 21px;
}

/* Ruban vertical */
.theme-noel #loader-page #top-part::before,
.theme-noel #loader-page #bottom-part::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 44px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--noel-gold-dark) 0 3px, var(--noel-gold) 3px calc(100% - 3px), var(--noel-gold-dark) calc(100% - 3px));
}

/* Ruban horizontal (moitié dans chaque rideau, ils se rejoignent au centre) */
.theme-noel #loader-page #top-part::after,
.theme-noel #loader-page #bottom-part::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 22px;
    background: var(--noel-gold);
}

.theme-noel #loader-page #top-part::after {
    bottom: 0;
    border-top: 3px solid var(--noel-gold-dark);
}

.theme-noel #loader-page #bottom-part::after {
    top: 0;
    border-bottom: 3px solid var(--noel-gold-dark);
}

/* Le cercle = étiquette du cadeau, bordure rouge / verte qui tourne */
.theme-noel #loader-page #top-part .circle-top,
.theme-noel #loader-page #bottom-part .circle-bottom {
    border-width: 4px;
    border-color: #f2e6c9;
    box-shadow: 0 0 0 6px rgba(255, 209, 102, .35);
}

.theme-noel #loader-page #top-part .circle-top {
    border-top-color: var(--noel-red);
    border-right-color: var(--noel-red);
}

.theme-noel #loader-page #bottom-part .circle-bottom {
    border-bottom-color: var(--noel-green);
    border-left-color: var(--noel-green);
}

/* Nœud doré posé au-dessus de l'étiquette */
.theme-noel #loader-page .noel-loader-bow {
    position: absolute;
    bottom: 90px;
    left: 50%;
    width: 128px;
    height: 72px;
    transform: translateX(-50%);
    z-index: 2;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 52'%3E%3Cpath d='M46 30 C30 4 4 2 6 20 C8 36 30 34 46 30 Z' fill='%23ffd166' stroke='%23f4a300' stroke-width='2.5'/%3E%3Cpath d='M46 30 C62 4 88 2 86 20 C84 36 62 34 46 30 Z' fill='%23ffd166' stroke='%23f4a300' stroke-width='2.5'/%3E%3Cpath d='M42 31 L28 52 L36 50 L46 34 Z M50 31 L64 52 L56 50 L46 34 Z' fill='%23f4a300'/%3E%3Cellipse cx='46' cy='30' rx='9' ry='8' fill='%23f4b400' stroke='%23e09000' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / contain;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25));
    opacity: 0;
    transition: opacity .2s .25s, transform .35s .25s cubic-bezier(.34, 1.56, .64, 1);
    transform: translateX(-50%) scale(.4);
}

.theme-noel #loader-page.htmx-request .noel-loader-bow {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    animation: noel-bow-bounce 1.2s ease-in-out .6s infinite;
}

@keyframes noel-bow-bounce {
    0%, 100% { transform: translateX(-50%) scale(1) rotate(0); }
    50%      { transform: translateX(-50%) scale(1.06) rotate(-3deg); }
}

/* --------------------------------------------------------------------------
   Page de connexion
   -------------------------------------------------------------------------- */
.theme-noel #login-form .button-login {
    background: linear-gradient(135deg, var(--noel-red) 0%, var(--noel-red-dark) 100%);
    border-color: var(--noel-red-dark);
    transition: filter .2s, transform .2s;
}

.theme-noel #login-form .button-login:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* Doodles du fond en doré */
.theme-noel .background-login {
    filter: hue-rotate(178deg) saturate(1.1) brightness(1.35);
}

.theme-noel #login-form .text-purple-2 {
    color: var(--noel-green) !important;
}

/* --------------------------------------------------------------------------
   Accessibilité : on coupe les animations si l'utilisateur le demande
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .theme-noel *,
    .theme-noel *::before,
    .theme-noel *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media screen and (max-width: 850px) {
    .noel-countdown span {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Lune cliquable (fait passer le traîneau)
   -------------------------------------------------------------------------- */
.noel-moon-hit {
    pointer-events: auto;
    cursor: pointer;
}

.noel-moon {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .3s;
}

.noel-scene:has(.noel-moon-hit:hover) .noel-moon {
    transform: scale(1.15) rotate(-10deg);
}

/* --------------------------------------------------------------------------
   Congère qui monte au fil de la journée
   -------------------------------------------------------------------------- */
.noel-drift {
    --noel-drift-max: 44px;
    transform: translateY(calc((1 - var(--noel-drift, 0)) * var(--noel-drift-max)));
    transition: transform 2.5s cubic-bezier(.22, .8, .3, 1);
}


/* --------------------------------------------------------------------------
   Traîneau du Père Noël
   -------------------------------------------------------------------------- */
.noel-sleigh {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    z-index: 1041;
    cursor: pointer;
    will-change: transform;
    filter: drop-shadow(0 6px 8px rgba(5, 8, 25, .35));
}

.noel-sleigh svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.noel-reindeer .noel-legs-front path,
.noel-reindeer .noel-legs-back path {
    stroke: #6d4423;
    stroke-width: 2.6;
    stroke-linecap: round;
    fill: none;
}

.noel-legs-front,
.noel-legs-back {
    transform-box: fill-box;
    animation: noel-gallop .45s ease-in-out infinite alternate;
}

.noel-legs-front { transform-origin: 0 0; }
.noel-legs-back  { transform-origin: 100% 0; animation-delay: -.22s; }

.noel-reindeer:nth-of-type(2) .noel-legs-front,
.noel-reindeer:nth-of-type(2) .noel-legs-back { animation-delay: -.12s; }

@keyframes noel-gallop {
    from { transform: rotate(-22deg); }
    to   { transform: rotate(18deg); }
}

.noel-rudolph-glow {
    transform-box: fill-box;
    transform-origin: center;
    animation: noel-rudolph 1s ease-in-out infinite;
}

@keyframes noel-rudolph {
    0%, 100% { transform: scale(1);   opacity: .35; }
    50%      { transform: scale(1.8); opacity: .65; }
}

.noel-sleigh-bubble {
    position: absolute;
    top: -30px;
    left: 30px;
    padding: 4px 12px;
    border-radius: 14px;
    background: #fff;
    color: var(--noel-red);
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 15px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(5, 8, 25, .25);
    opacity: 0;
    transform: translateY(6px) scale(.8);
    transition: opacity .25s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

.noel-sleigh-bubble::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 26px;
    border: 6px solid transparent;
    border-top-color: #fff;
    border-bottom: 0;
}

.noel-sleigh.is-talking .noel-sleigh-bubble {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.noel-trail {
    position: fixed;
    pointer-events: none;
    z-index: 1040;
    line-height: 1;
    text-shadow: 0 0 6px rgba(255, 209, 102, .9);
    animation: noel-trail-fade 1.4s ease-out forwards;
}

@keyframes noel-trail-fade {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(-14px, 26px) scale(.3); }
}

/* --------------------------------------------------------------------------
   Bonnet qui se pose sur la pastille au survol d'un apprenant (listes)
   -------------------------------------------------------------------------- */
.theme-noel .card[id^="apprenant-"] > a > .row > .col-1:first-child {
    position: relative;
}

.theme-noel .card[id^="apprenant-"] > a > .row > .col-1:first-child::before {
    content: "";
    position: absolute;
    top: -19px;
    left: -2px;
    width: 38px;
    height: 29px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -36 104 56'%3E%3Cpath fill='%23d62839' d='M14,5 C14,-16 32,-31 54,-31 C76,-31 86,-14 86,5 Z'/%3E%3Cpath fill='%23d62839' d='M46,-30 C22,-31 2,-22 -10,-6 L0,1 C8,-10 20,-15 36,-12 Z'/%3E%3Cpath fill='%23a4161a' opacity='.5' d='M54,-31 C76,-31 86,-14 86,5 L74,5 C74,-12 68,-26 54,-31 Z'/%3E%3Crect x='6' y='-3' width='80' height='18' rx='9' fill='%23fff' stroke='%23c7d3e0' stroke-width='3'/%3E%3Ccircle cx='-6' cy='-4' r='10' fill='%23fff' stroke='%23c7d3e0' stroke-width='3'/%3E%3C/svg%3E") no-repeat center / contain;
    transform-origin: 60% 100%;
    transform: translateY(-10px) rotate(-30deg) scale(.4);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
    transition: opacity .15s, transform .35s cubic-bezier(.34, 1.8, .64, 1);
}

.theme-noel .card[id^="apprenant-"]:hover > a > .row > .col-1:first-child::before {
    opacity: 1;
    transform: translateY(0) rotate(-14deg) scale(1);
}

/* --------------------------------------------------------------------------
   Bonhomme de neige bavard
   -------------------------------------------------------------------------- */
.noel-snowman {
    pointer-events: auto;
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: 50% 100%;
}

.noel-snowman.is-boing {
    animation: noel-boing .45s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes noel-boing {
    0%   { transform: scale(1, 1); }
    30%  { transform: scale(1.12, .88); }
    60%  { transform: scale(.94, 1.08); }
    100% { transform: scale(1, 1); }
}

.noel-snowman-hat {
    transform-box: view-box;
    transform-origin: 72px 101px;
}

/* Le chapeau s'envole, tournoie et retombe dans la neige à gauche */
.noel-snowman-hat.is-off {
    animation: noel-hat-off 1.1s cubic-bezier(.3, .6, .4, 1) forwards;
}

@keyframes noel-hat-off {
    0%   { transform: translate(0, 0) rotate(0); }
    35%  { transform: translate(-14px, -38px) rotate(-200deg); }
    100% { transform: translate(-38px, 30px) rotate(-380deg); }
}

.noel-snowman-hat.is-back {
    animation: noel-hat-back .8s cubic-bezier(.34, 1.4, .64, 1);
}

@keyframes noel-hat-back {
    0%   { transform: translate(-38px, 30px) rotate(-20deg); }
    55%  { transform: translate(-12px, -30px) rotate(200deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

.noel-snowman-bubble {
    position: absolute;
    left: 10px;
    bottom: 96px;
    max-width: 210px;
    padding: 7px 11px;
    border-radius: 12px;
    background: #fff;
    color: #12142a;
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 12.5px;
    line-height: 1.3;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateY(8px) scale(.85);
    transform-origin: 30% 100%;
    transition: opacity .2s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
    pointer-events: none;
}

.noel-snowman-bubble::after {
    content: "";
    position: absolute;
    left: 52px;
    bottom: -7px;
    border: 7px solid transparent;
    border-top-color: #fff;
    border-bottom: 0;
}

.noel-snowman-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------------------
   Mini-jeu « Attrape les cadeaux »
   -------------------------------------------------------------------------- */
.noel-jeu {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 8, 24, .72);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .25s;
}

.noel-jeu.is-open {
    opacity: 1;
}

.noel-jeu[hidden] {
    display: none;
}

.noel-jeu-panel {
    width: min(1040px, 100%);
    max-height: 100%;
    overflow: auto;
    background: #12142a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);
    color: #fff;
    transform: translateY(16px) scale(.97);
    transition: transform .3s cubic-bezier(.34, 1.4, .64, 1);
    position: relative;
}

.noel-jeu.is-open .noel-jeu-panel {
    transform: none;
}

/* Liseré sucre d'orge en haut du panneau */
.noel-jeu-panel::before {
    content: "";
    display: block;
    height: 6px;
    border-radius: 16px 16px 0 0;
    background: repeating-linear-gradient(-45deg, var(--noel-red) 0 10px, #fff 10px 20px);
}

.noel-jeu-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.noel-jeu-header h2 {
    margin: 0;
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 20px;
    white-space: nowrap;
}

.noel-jeu-header h2 i {
    --fa-primary-color: var(--noel-red);
    --fa-secondary-color: var(--noel-gold);
    --fa-secondary-opacity: 1;
    margin-right: 6px;
}

.noel-jeu-hud {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 15px;
}

.noel-jeu-hud > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
}

.noel-jeu-score i { color: var(--noel-gold); }

.noel-jeu-combo {
    color: #9aa3c7;
    transition: color .2s, background .2s;
}

.noel-jeu-combo.is-hot {
    color: #12142a;
    background: var(--noel-gold) !important;
    animation: noel-wiggle .5s;
}

.noel-jeu-timer.is-urgent {
    color: #ff6b6b;
    animation: noel-svg-blink .8s infinite;
}

.noel-jeu-vies i {
    color: #ff4d5e;
    transition: transform .3s, color .3s;
}

.noel-jeu-vies i.is-lost {
    color: rgba(255, 255, 255, .18);
    transform: scale(.8);
}

.noel-jeu-close {
    border: 0;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.noel-jeu-close:hover {
    background: var(--noel-red);
    transform: rotate(90deg);
}

.noel-jeu-body {
    display: flex;
    gap: 16px;
    padding: 16px;
}

.noel-jeu-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: none;
    touch-action: none;
}

.noel-jeu-stage canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 720 / 420;
}

.noel-jeu-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    text-align: center;
    background: rgba(10, 13, 38, .78);
    cursor: default;
}

.noel-jeu-screen[hidden] {
    display: none;
}

.noel-jeu-screen p {
    margin: 0;
}

.noel-jeu-title {
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 24px;
    color: var(--noel-gold);
    margin-bottom: 4px !important;
}

.noel-jeu-rules {
    list-style: none;
    padding: 0;
    margin: 10px 0 6px;
    text-align: left;
    font-size: 14px;
    line-height: 1.9;
}

.noel-jeu-rules i {
    color: #ff8c42;
    width: 18px;
    text-align: center;
    margin-right: 4px;
}

.noel-jeu-ico {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -2px;
}

.noel-jeu-ico.gift { background: linear-gradient(90deg, transparent 40%, #ffd166 40% 60%, transparent 60%), #d62839; }
.noel-jeu-ico.gold { background: linear-gradient(90deg, transparent 40%, #d62839 40% 60%, transparent 60%), #ffd166; box-shadow: 0 0 8px #ffd166; }
.noel-jeu-ico.coal { background: #2a2a30; border-radius: 40% 60% 45% 55%; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .2); }

.noel-jeu-controls {
    color: #9aa3c7;
    font-size: 13px;
    margin-bottom: 10px !important;
}

.noel-jeu-controls kbd {
    background: rgba(255, 255, 255, .12);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
}

.noel-jeu-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 28px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--noel-red), var(--noel-red-dark));
    color: #fff;
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(214, 40, 57, .4);
    transition: transform .2s, box-shadow .2s;
}

.noel-jeu-btn:hover,
.noel-jeu-btn:focus-visible {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 24px rgba(214, 40, 57, .55);
    outline: none;
}

.noel-jeu-final {
    font-size: 18px;
}

.noel-jeu-final b {
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 54px;
    line-height: 1;
    color: #fff;
}

.noel-jeu-record {
    color: #12142a;
    background: var(--noel-gold);
    border-radius: 999px;
    padding: 3px 14px;
    font-family: camptonsemibold, camptonlight, sans-serif;
    animation: noel-wiggle .7s ease-in-out 2;
}

.noel-jeu-record[hidden] {
    display: none;
}

.noel-jeu-rank {
    color: #c9d1f0;
    min-height: 1.4em;
}

/* Classement */
.noel-jeu-board {
    flex: 0 0 260px;
    background: rgba(255, 255, 255, .04);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.noel-jeu-board h3 {
    font-family: camptonsemibold, camptonlight, sans-serif;
    font-size: 16px;
    margin: 0 0 10px;
}

.noel-jeu-board h3 i {
    --fa-primary-color: var(--noel-gold);
    --fa-secondary-color: var(--noel-gold-dark);
    --fa-secondary-opacity: 1;
    margin-right: 4px;
}

.noel-jeu-saison {
    color: #9aa3c7;
    font-size: 13px;
}

.noel-jeu-top {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.noel-jeu-top li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 14px;
}

.noel-jeu-top li:nth-child(odd):not(.noel-jeu-empty) {
    background: rgba(255, 255, 255, .03);
}

.noel-jeu-top li.is-moi {
    background: rgba(255, 209, 102, .16) !important;
    box-shadow: inset 3px 0 0 var(--noel-gold);
}

.noel-jeu-rang {
    width: 24px;
    text-align: center;
    color: #9aa3c7;
    font-family: camptonsemibold, camptonlight, sans-serif;
}

.noel-jeu-nom {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.noel-jeu-nom small {
    color: var(--noel-gold);
}

.noel-jeu-pts {
    font-family: camptonsemibold, camptonlight, sans-serif;
    color: var(--noel-gold);
}

.noel-jeu-empty {
    color: #9aa3c7;
    text-align: center;
    padding: 20px 8px !important;
    line-height: 1.5;
}

.noel-jeu-moi {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 13px;
    color: #c9d1f0;
}

.noel-jeu-moi-rang {
    margin-bottom: 4px;
}

@media screen and (max-width: 900px) {
    .noel-jeu-body {
        flex-direction: column;
    }

    .noel-jeu-board {
        flex-basis: auto;
    }

    .noel-jeu-header {
        flex-wrap: wrap;
    }

    .noel-jeu-header h2 {
        font-size: 17px;
    }

    .noel-jeu-hud {
        order: 3;
        width: 100%;
        margin-left: 0;
        font-size: 13px;
    }

    .noel-jeu-close {
        margin-left: auto;
    }
}

/* Une partie par jour */
.noel-jeu-daily {
    color: var(--noel-gold);
    font-size: 13px;
}

.noel-jeu-daily i,
.noel-jeu-tomorrow i {
    margin-right: 4px;
}

.noel-jeu-limit,
.noel-jeu-tomorrow {
    color: #c9d1f0;
    font-size: 13px;
    margin-top: 6px !important;
}

.noel-jeu-limit[hidden] {
    display: none;
}

.noel-jeu-btn:disabled {
    background: rgba(255, 255, 255, .1);
    color: #c9d1f0;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Mobile : l'écran d'intro ne tient pas dans le petit canvas, on va à l'essentiel */
@media screen and (max-width: 600px) {
    .noel-jeu-rules,
    .noel-jeu-controls {
        display: none;
    }

    .noel-jeu-screen {
        gap: 2px;
        padding: 10px;
        font-size: 13px;
    }

    .noel-jeu-title {
        font-size: 17px;
    }

    .noel-jeu-final b {
        font-size: 34px;
    }

    .noel-jeu-btn {
        padding: 7px 20px;
        font-size: 14px;
        margin-top: 4px;
    }

    .noel-jeu-limit,
    .noel-jeu-tomorrow,
    .noel-jeu-daily {
        font-size: 12px;
    }
}
