/* --- Bouton flottant ---
   Positionné à droite, empilé AU-DESSUS du bouton du jeu puzzle (qui occupe
   déjà bottom:24px / right:24px) pour que les deux coexistent sans se
   superposer. Le bouton puzzle est bleu, celui-ci est rouge/vert sapin. */
#sladv-floating-btn {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 999997;
    background: linear-gradient(180deg, #0f5132 0%, #b3001f 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(179,0,31,.4);
    animation: sladv-pulse 2.2s ease-in-out infinite;
}
#sladv-floating-btn:hover {
    animation-play-state: paused;
    transform: scale(1.05);
}

@keyframes sladv-pulse {
    0%   { box-shadow: 0 4px 14px rgba(179,0,31,.4), 0 0 0 0 rgba(255,216,77,.55); }
    70%  { box-shadow: 0 4px 14px rgba(179,0,31,.4), 0 0 0 14px rgba(255,216,77,0); }
    100% { box-shadow: 0 4px 14px rgba(179,0,31,.4), 0 0 0 0 rgba(255,216,77,0); }
}

@media (prefers-reduced-motion: reduce) {
    #sladv-floating-btn { animation: none; }
}

@media (max-width: 480px) {
    /* Sur mobile l'écart entre les deux boutons peut être resserré */
    #sladv-floating-btn { bottom: 88px; padding: 13px 18px; font-size: 13px; }
}

/* --- Overlay + modal (pop-up calendrier) --- */
#sladv-overlay, #sladv-video-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.65);
    opacity: 0; visibility: hidden; transition: opacity .25s ease;
    z-index: 999998;
}
.sladv-overlay-visible { opacity: 1 !important; visibility: visible !important; }

#sladv-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.95);
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.5) 1px, transparent 1px),
        radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,.4) 1px, transparent 1px),
        radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,.5) 1px, transparent 1px),
        radial-gradient(1px 1px at 30% 85%, rgba(255,255,255,.4) 1px, transparent 1px),
        radial-gradient(1.5px 1.5px at 90% 60%, rgba(255,255,255,.45) 1px, transparent 1px),
        radial-gradient(1px 1px at 45% 40%, rgba(255,255,255,.35) 1px, transparent 1px),
        linear-gradient(160deg, #0b1c33 0%, #15284a 100%);
    border-radius: 14px;
    border: 3px solid #c9a227;
    max-width: 500px;
    width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 18px 24px;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease;
}
.sladv-modal-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

#sladv-modal-close, #sladv-video-close {
    position: absolute; top: 8px; right: 14px;
    background: none; border: none; font-size: 26px; cursor: pointer; line-height: 1;
    color: #fff;
    z-index: 2;
}

/* --- Guirlande lumineuse en haut de la pop-up --- */
.sladv-garland {
    display: flex;
    justify-content: space-between;
    padding: 0 6px 14px;
    margin-bottom: 6px;
}
.sladv-garland span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px 2px currentColor;
    animation: sladv-twinkle 1.6s ease-in-out infinite;
}
.sladv-garland span:nth-child(1) { color: #ff4d4d; animation-delay: 0s; }
.sladv-garland span:nth-child(2) { color: #ffd84d; animation-delay: .2s; }
.sladv-garland span:nth-child(3) { color: #4dff88; animation-delay: .4s; }
.sladv-garland span:nth-child(4) { color: #4dc3ff; animation-delay: .6s; }
.sladv-garland span:nth-child(5) { color: #ff4d4d; animation-delay: .8s; }
.sladv-garland span:nth-child(6) { color: #ffd84d; animation-delay: 1s; }
.sladv-garland span:nth-child(7) { color: #4dff88; animation-delay: 1.2s; }
.sladv-garland span:nth-child(8) { color: #4dc3ff; animation-delay: 1.4s; }
.sladv-garland span { background: currentColor; }

@keyframes sladv-twinkle {
    0%, 100% { opacity: .35; transform: scale(.85); }
    50%      { opacity: 1;   transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .sladv-garland span { animation: none; opacity: .9; }
}

/* --- Lightbox vidéo --- */
#sladv-video-lightbox {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.95);
    background: #000;
    border-radius: 10px;
    width: 92vw;
    max-width: 720px;
    z-index: 1000001;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease;
    padding: 4px;
}
#sladv-video-lightbox.sladv-modal-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
}
#sladv-video-player {
    width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 6px;
    background: #000;
}

/* --- Contenu du calendrier --- */
.sladv-calendar-instance {
    text-align: center;
    color: #fff;
    font-family: inherit;
    position: relative;
}
.sladv-intro h3 {
    margin: 0 0 4px;
    color: #ffd84d;
    font-size: 19px;
    text-shadow: 0 1px 6px rgba(255,216,77,.35);
}
.sladv-intro p {
    margin: 0 0 18px;
    color: #d8dcef;
    font-size: 13px;
}

.sladv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Cases façon "timbres" postaux festifs, avec icône + numéro */
.sladv-case {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 2px dashed rgba(255,255,255,.55);
    cursor: pointer;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #fff;
    background: linear-gradient(150deg, #1b7a4d, #0f5132);
    box-shadow: 0 3px 0 rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.08);
    transition: transform .15s ease, box-shadow .15s ease;
}
.sladv-case:nth-child(3n) {
    background: linear-gradient(150deg, #d6173a, #8e0022);
}
.sladv-case:nth-child(5n) {
    background: linear-gradient(150deg, #e3b23c, #a1791f);
}
.sladv-case:nth-child(7n) {
    background: linear-gradient(150deg, #d6173a, #8e0022);
}

.sladv-case-icon {
    font-size: 15px;
    line-height: 1;
}
.sladv-case-num {
    font-size: 19px;
    line-height: 1;
}

.sladv-case.is-locked {
    opacity: .5;
    cursor: not-allowed;
    filter: grayscale(.5);
}
.sladv-case.is-locked .sladv-case-icon,
.sladv-case.is-locked .sladv-case-num { opacity: .6; }

.sladv-case-lock {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 11px;
}
.sladv-case-play {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 9px;
    background: rgba(255,255,255,.85);
    color: #0f5132;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 1px;
}

.sladv-case.is-open:hover {
    transform: scale(1.08) rotate(-1deg);
    box-shadow: 0 5px 0 rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.15);
}

.sladv-case.is-today {
    border-style: solid;
    border-color: #ffd84d;
    box-shadow: 0 0 0 3px #ffd84d, inset 0 0 0 1px rgba(255,255,255,.15);
    animation: sladv-today-glow 1.8s ease-in-out infinite;
}
@keyframes sladv-today-glow {
    0%, 100% { box-shadow: 0 0 0 3px #ffd84d, 0 0 10px 2px rgba(255,216,77,.3); }
    50%      { box-shadow: 0 0 0 3px #ffd84d, 0 0 18px 8px rgba(255,216,77,.65); }
}

.sladv-shake {
    animation: sladv-shake-anim .4s ease;
}
@keyframes sladv-shake-anim {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

.sladv-message {
    min-height: 18px;
    margin: 14px 0 0;
    font-size: 13px;
    color: #ffd84d;
    opacity: 0;
    transition: opacity .2s ease;
}
.sladv-message.is-visible { opacity: 1; }

/* --- Calendrier affiché en direct sur une page via [calendrier_avent] --- */
.sladv-calendar-instance.sladv-inline-embed {
    background:
        radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,.4) 1px, transparent 1px),
        radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,.35) 1px, transparent 1px),
        radial-gradient(1.5px 1.5px at 55% 75%, rgba(255,255,255,.4) 1px, transparent 1px),
        linear-gradient(160deg, #0b1c33 0%, #15284a 100%);
    border: 3px solid #c9a227;
    border-radius: 14px;
    padding: 24px 18px 26px;
    max-width: 500px;
    margin: 20px auto;
    box-shadow: 0 6px 24px rgba(0,0,0,.3);
}

@media (max-width: 480px) {
    #sladv-modal { padding: 18px 12px 18px; }
    .sladv-case-num { font-size: 16px; }
}

/* ------------------------------------------------------------------
   FLOCONS DE NEIGE — décor léger site-wide, ne capte jamais les clics.
   ------------------------------------------------------------------ */
#sladv-snow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 999990; /* sous les pop-ups, au-dessus du contenu normal */
}
.sladv-flake {
    position: absolute;
    top: -10vh;
    color: #fff;
    text-shadow: 0 0 4px rgba(255,255,255,.7);
    animation-name: sladv-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
}
@keyframes sladv-fall {
    0%   { transform: translate(0, -10vh) rotate(0deg); }
    50%  { transform: translate(18px, 55vh) rotate(180deg); }
    100% { transform: translate(-10px, 110vh) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    #sladv-snow { display: none; }
}
@media (max-width: 480px) {
    /* un peu moins dense visuellement sur mobile */
    .sladv-flake { font-size: 12px !important; }
}
