:root {
    /* Configuration alignement vertical vidéo loop (0-100%, défini par JS) */
    --loop-vertical-alignment: 90%;

    /* Palette bleue givrée */
    --frost-blue-light: #e0f2fe;
    --frost-blue: #60a5fa;
    --frost-cyan: #0ea5e9;
    --frost-deep: #0284c7;
    --frost-dark: #0c4a6e;
    --ice-white: #f0f9ff;
    --ice-shimmer: rgba(255, 255, 255, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Empêcher la sélection de texte/images et le zoom au double-tap */
body, img, video, * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    touch-action: manipulation;
}

img, video {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* Écran de rotation - affiché uniquement en portrait sur mobile/tablet */
#rotate-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.rotate-content {
    text-align: center;
    color: white;
    font-family: 'Montserrat', sans-serif;
}

.rotate-icon {
    font-size: 80px;
    margin-bottom: 10px;
    animation: tilt 1s ease-in-out infinite alternate;
}

.rotate-arrow {
    font-size: 50px;
    margin-bottom: 20px;
    animation: rotate-hint 2s ease-in-out infinite;
}

.rotate-content p {
    font-size: 1.2em;
    opacity: 0.9;
}

@keyframes tilt {
    from { transform: rotate(-15deg); }
    to { transform: rotate(15deg); }
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); opacity: 1; }
    50% { transform: rotate(90deg); opacity: 0.5; }
}

/* Afficher uniquement sur appareils tactiles en mode portrait */
@media (orientation: portrait) and (hover: none) and (pointer: coarse) {
    #rotate-screen {
        display: flex;
    }
}

/* Alternative: afficher si hauteur > largeur et écran < 1024px */
@media (max-width: 1024px) and (orientation: portrait) {
    #rotate-screen {
        display: flex;
    }
}

html {
    background: #000;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: #000;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

/* === LOADER STYLES === */
#loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 25%, #155e75 50%, #0c4a6e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    position: relative;
    overflow: hidden;
}

/* Effet cristaux de glace en arrière-plan */
#loader-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(96, 165, 250, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
    animation: frostedRotate 20s linear infinite;
}

@keyframes frostedRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Particules de glace flottantes */
#loader-container::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.25), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.25), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 15% 90%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: sparkle 8s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { background-position: 0% 0%; opacity: 0.6; }
    50% { background-position: 100% 100%; opacity: 1; }
}

#loader-container.hidden {
    display: none;
}

.loader-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    z-index: 10;
}

.loader-icon {
    font-size: 72px;
    margin-bottom: 32px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 24px rgba(14, 165, 233, 0.6))
            drop-shadow(0 0 40px rgba(96, 165, 250, 0.4));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.loader-title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    text-shadow:
        0 0 20px rgba(96, 165, 250, 0.8),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(14, 165, 233, 0.6);
    letter-spacing: 1px;
}

.loader-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    color: rgba(240, 249, 255, 0.9);
    margin-bottom: 40px;
    font-weight: 400;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(14, 165, 233, 0.3);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,
        #0ea5e9 0%,
        #38bdf8 25%,
        #60a5fa 50%,
        #0ea5e9 75%,
        #0284c7 100%
    );
    background-size: 200% 100%;
    border-radius: 100px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow:
        0 0 30px rgba(14, 165, 233, 0.8),
        0 0 60px rgba(96, 165, 250, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Effet verre givré avec shimmer amélioré */
.progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%
    );
    animation: frostedShimmer 2s infinite;
}

@keyframes frostedShimmer {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

/* Cristaux de glace sur la barre */
.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.4) 0%, transparent 3px),
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5) 0%, transparent 2px),
        radial-gradient(circle at 70% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 3px),
        radial-gradient(circle at 90% 50%, rgba(255, 255, 255, 0.4) 0%, transparent 2px);
    background-size: 100% 100%;
    animation: iceSparkle 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes iceSparkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.progress-text {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(240, 249, 255, 0.95);
    font-size: 13px;
    font-weight: 600;
}

.progress-percentage {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #60a5fa;
    text-shadow:
        0 0 20px rgba(96, 165, 250, 0.8),
        0 2px 8px rgba(14, 165, 233, 0.6);
}

.progress-message {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: rgba(240, 249, 255, 0.8);
    font-style: italic;
}

/* Flocons de neige dans le loader */
.loader-snowflake {
    position: absolute;
    color: rgba(240, 249, 255, 0.8);
    opacity: 0.4;
    animation: loaderSnowfall linear infinite;
    pointer-events: none;
    font-size: 20px;
    user-select: none;
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.6));
}

@keyframes loaderSnowfall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* === END LOADER STYLES === */

/* === WELCOME SCREEN === */
#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c1929 0%, #1a365d 50%, #0f172a 100%);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#welcome-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(2px 2px at 10% 20%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.25), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.25), transparent);
    background-size: 200% 200%;
    animation: sparkle 8s ease-in-out infinite;
}

#welcome-screen.visible {
    opacity: 1;
    visibility: visible;
}

#welcome-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 24px rgba(255, 215, 0, 0.6));
}

.welcome-title {
    font-family: 'Cinzel', serif;
    font-size: 42px;
    font-weight: 800;
    color: white;
    margin: 0 0 8px 0;
    text-shadow:
        0 0 20px rgba(96, 165, 250, 0.8),
        0 4px 12px rgba(0, 0, 0, 0.4);
    letter-spacing: 2px;
}

.welcome-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    color: rgba(255, 215, 0, 0.9);
    margin: 0 0 48px 0;
    font-weight: 600;
    font-style: italic;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow:
        0 8px 32px rgba(16, 185, 129, 0.4),
        0 0 20px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: pulse-glow 2s ease-in-out infinite;
}

.welcome-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 12px 40px rgba(16, 185, 129, 0.5),
        0 0 30px rgba(16, 185, 129, 0.4);
}

.welcome-btn:active {
    transform: scale(0.98);
}

.welcome-btn-icon {
    font-size: 24px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow:
            0 8px 32px rgba(16, 185, 129, 0.4),
            0 0 20px rgba(16, 185, 129, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 8px 40px rgba(16, 185, 129, 0.6),
            0 0 40px rgba(16, 185, 129, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* === END WELCOME SCREEN === */

#mainContainer {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

.calendar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0 auto;
    opacity: 1;
    transition: opacity 1s ease;
}

.calendar-container:first-child {
    position: relative;
}

.calendar-container.fade-out {
    opacity: 0;
    pointer-events: none;
}

.calendar-container.fade-in {
    opacity: 1;
}

.background-image {
    width: 100%;
    height: auto;
    display: none;
}

.background-image.visible {
    display: block;
}

.intro-video {
    width: 100%;
    height: auto;
    display: block;
    z-index: 10;
}

.intro-video.hidden {
    display: none;
}

.calendar-container.intro-playing .background-image {
    position: absolute;
    top: 0;
    left: 0;
}

.animation-zone {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
}

.animation-zone.ready {
    opacity: 1;
    pointer-events: auto;
}

.animation-zone video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.animation-zone.active video {
    opacity: 1;
}

.animation-zone .end-frame-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.animation-zone.active .end-frame-image {
    opacity: 1;
}

.animation-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.animation-zone:hover::before {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Jours verrouillés */
.animation-zone.locked {
    cursor: not-allowed;
    filter: grayscale(50%);
}

.animation-zone.locked.ready {
    opacity: 0.4;
}

.animation-zone.locked.ready::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 15;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.animation-zone.locked:hover::before {
    border-color: rgba(255, 100, 100, 0.6);
}

/* Animation shake pour feedback */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Animation pulse pour déblocage */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Numéro de la case */
.animation-zone .day-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 255, 255, 0.8);
    color: #2c3e50;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    pointer-events: none;
    line-height: 1;
    padding-bottom: 1px;
}

/* Zoom container */
.zoom-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 500;
    display: none;
    overflow: hidden;
}

.zoom-container.active {
    display: block;
}

.village-zoom {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4096px;
    height: 4096px;
    transform-origin: center center;
    transition: transform 1.5s ease-in;
}

/* Video container (door animation) */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 600;
    display: none;
    overflow: hidden;
}

.video-container.active {
    display: block;
}

.door-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: object-position 2000ms ease-out;
}

.endframe-image {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center var(--loop-vertical-alignment);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.endframe-image.visible {
    opacity: 1;
}

/* Modal - Refonte latérale */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
}

.modal.active {
    display: flex;
    animation: modalBackdropFadeIn 0.4s ease;
}

@keyframes modalBackdropFadeIn {
    from {
        opacity: 0;
        -webkit-backdrop-filter: blur(0px);
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

.modal-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 0;
    padding: 0;
    max-width: 580px;
    width: 40%;
    min-width: 420px;
    height: 100vh;
    position: relative;
    animation: modalSlideInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: -30px 0 60px -15px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes modalSlideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 24px;
    left: 24px;
    background: rgba(255, 255, 255, 0.98);
    color: #dc2626;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1002;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-weight: 300;
    line-height: 1;
}

.modal-close:hover {
    background: #dc2626;
    color: white;
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.modal-video {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
    display: none;
}

.modal-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    padding: 50px 32px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(10%, 10%);
    }
}

.modal-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
}

.modal-day-number {
    font-family: 'Cinzel', serif;
    font-size: 84px;
    font-weight: 900;
    color: white;
    margin: 12px 0 0 0;
    text-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    line-height: 1;
    letter-spacing: -3px;
}

.modal-description {
    display: none;
}

.modal-activity {
    padding: 40px 32px 40px;
}

.modal-activity h3 {
    margin: 0 0 12px 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

.modal-activity-title-main {
    font-family: 'Cinzel', serif;
    font-size: 36px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 20px 0;
    line-height: 1.15;
    letter-spacing: -1px;
}

.modal-activity-description {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    margin-bottom: 32px;
    line-height: 1.7;
    color: #475569;
    font-weight: 400;
}

.modal-activity-section {
    margin-top: 36px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
}

.modal-activity-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-activity-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.modal-activity-detail {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
    padding: 20px 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.modal-activity-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #dc2626, #ef4444);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.modal-activity-detail:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.modal-activity-detail:hover::before {
    transform: scaleY(1);
}

.modal-activity-detail strong {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    flex-shrink: 0;
}

.modal-activity-detail span {
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

/* Bouton Jouer au Jeu - Design festif */
.play-game-btn {
    width: 100%;
    padding: 20px 32px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.play-game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.play-game-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.play-game-btn:hover::before {
    left: 100%;
}

.play-game-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.play-game-btn-icon {
    display: inline-block;
    margin-right: 12px;
    font-size: 24px;
    vertical-align: middle;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Overlay Jeu - Plein écran */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.4s ease;
}

.game-overlay.active {
    display: flex;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.game-overlay-content {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1400px;
    max-height: 900px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: overlayContentSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes overlayContentSlideIn {
    from {
        transform: scale(0.9) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.game-overlay iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 24px;
}

.game-overlay-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: 4px solid rgba(0, 0, 0, 0.95);
    border-radius: 50%;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    line-height: 1;
}

.game-overlay-close:hover {
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.game-overlay-close:active {
    transform: rotate(90deg) scale(1.05);
}

/* Bouton discret "Écouter la consigne" à côté du titre */
.story-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    font-size: 14px;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.story-btn-inline:hover {
    background: rgba(14, 165, 233, 0.3);
    transform: scale(1.1);
}

.story-btn-inline:active {
    transform: scale(0.95);
}

/* Story Video Overlay - Plein écran pour vidéos natives */
.story-video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.4s ease;
}

.story-video-overlay.active {
    display: flex;
}

.story-video-overlay-content {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1600px;
    max-height: 1000px;
    background: #000;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: overlayContentSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-video-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.story-video-overlay-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: 4px solid rgba(0, 0, 0, 0.98);
    border-radius: 50%;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    line-height: 1;
}

.story-video-overlay-close:hover {
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.story-video-overlay-close:active {
    transform: rotate(90deg) scale(1.05);
}

.modal-separator {
    display: none;
}

/* Snowflakes decoration in modal */
.modal-header::after {
    content: '';
    position: absolute;
    font-size: 40px;
    opacity: 0.15;
    top: 20px;
    left: 20px;
    animation: float 3s ease-in-out infinite;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 20px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(255, 255, 255, 0.7) 100%
    );
    mix-blend-mode: multiply;
    z-index: 100;
    pointer-events: none;
}

.header h1 {
    font-family: 'Cinzel', serif;
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
}

/* Effet de neige - Optimisé pour performance */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    background: white;
    border-radius: 50%;
    user-select: none;
    pointer-events: none;
    will-change: transform;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% {
        transform: translateY(-10px) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

@keyframes controlSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* Contrôles */
.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(100, 150, 200, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.control-btn.active {
    background: rgba(100, 200, 255, 0.9);
    border-color: rgba(100, 200, 255, 1);
}

.control-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.control-btn.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: rgba(14, 165, 233, 0.9);
    animation: controlSpinner 0.8s linear infinite;
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.skip-btn {
    display: none;
}

.skip-btn.visible {
    display: flex;
}

/* Lecteur YouTube masqué (uniquement audio) */
#youtubePlayer,
.youtube-background-player {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Navigation entre scènes */
.scene-navigation {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.scene-nav-btn {
    background: rgba(100, 150, 200, 0.8);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    color: white;
}

.scene-nav-btn:hover {
    background: rgba(100, 150, 200, 1);
    transform: scale(1.1);
}

.scene-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.scene-indicator {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    min-width: 200px;
    text-align: center;
}

@media (max-width: 1024px) {
    .modal-content {
        width: 50%;
        min-width: 380px;
    }

    .modal-activity-title-main {
        font-size: 30px;
    }

    .game-overlay-content {
        width: 92%;
        height: 92%;
    }

    .game-overlay-close {
        top: -12px;
        right: -12px;
        width: 52px;
        height: 52px;
        font-size: 28px;
    }

    .story-video-overlay-content {
        width: 92%;
        height: 92%;
    }

    .story-video-overlay-close {
        top: -12px;
        right: -12px;
        width: 52px;
        height: 52px;
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .animation-zone .day-number {
        font-size: 18px;
        width: 30px;
        height: 30px;
    }

    .header h1 {
        font-size: 28px;
    }

    .controls {
        top: 10px;
        right: 10px;
    }

    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .scene-navigation {
        bottom: 15px;
        padding: 10px 15px;
    }

    .scene-indicator {
        font-size: 14px;
        min-width: 150px;
    }

    .scene-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Modal responsive - centrée sur mobile */
    .modal {
        justify-content: center;
        padding: 20px;
    }

    .modal-content {
        width: 90%;
        min-width: unset;
        max-width: 480px;
        height: auto;
        max-height: 90vh;
        border-radius: 24px;
        animation: modalSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes modalSlideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-header {
        padding: 36px 24px 28px;
    }

    .modal-day-number {
        font-size: 64px;
    }

    .modal-activity {
        padding: 32px 24px 32px;
    }

    .modal-activity-title-main {
        font-size: 28px;
    }

    .modal-activity-description {
        font-size: 16px;
    }

    .modal-activity-section {
        margin-top: 28px;
        padding-top: 24px;
    }

    .modal-activity-details {
        gap: 12px;
    }

    .modal-activity-detail {
        padding: 16px;
    }

    .modal-close {
        top: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
        font-size: 26px;
    }

    .play-game-btn {
        padding: 18px 28px;
        font-size: 16px;
    }

    .play-game-btn-icon {
        font-size: 20px;
        margin-right: 10px;
    }

    .game-overlay-content {
        width: 95%;
        height: 90%;
        border-radius: 16px;
    }

    .game-overlay iframe {
        border-radius: 16px;
    }

    .game-overlay-close {
        top: -10px;
        right: -10px;
        width: 48px;
        height: 48px;
        font-size: 26px;
        border-width: 3px;
    }

    .story-video-overlay-content {
        width: 95%;
        height: 90%;
        border-radius: 16px;
    }

    .story-video-overlay-close {
        top: -10px;
        right: -10px;
        width: 48px;
        height: 48px;
        font-size: 26px;
        border-width: 3px;
    }

    /* Loader responsive */
    .loader-icon {
        font-size: 56px;
        margin-bottom: 24px;
    }

    .loader-title {
        font-size: 26px;
    }

    .loader-subtitle {
        font-size: 14px;
    }
}
