/* Le viewBox reprend le cadrage center / cover du fond de la scène. */
.scene-lantern {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}
.scene-lantern[data-lantern-ready] { display: block; }
/* Le module remplace le halo antérieur dès que son script est opérationnel. */
.opening-scene.lantern-is-ready > .lantern-light { display: none; }
/* En portrait, la lanterne sort du logo ; chaque calque suit le même décalage. */
@media (max-width: 760px) {
    .opening-scene {
        --lantern-mobile-shift: clamp(0px, calc(50vw - 35px), 200px);
        background-position: calc(50% + var(--lantern-mobile-shift)) center;
    }
    .scene-lantern { transform: translateX(var(--lantern-mobile-shift)); }
    .lantern-light {
        background-position: calc(50% + var(--lantern-mobile-shift)) center;
        -webkit-mask-position: calc(50% + var(--lantern-mobile-shift)) center;
        mask-position: calc(50% + var(--lantern-mobile-shift)) center;
    }
}
/* Sans JavaScript, ou avec réduction des mouvements, le décor peint suffit. */
@media (prefers-reduced-motion: reduce) {
    .scene-lantern[data-lantern-ready] { display: none; }
}

/* La lumière éclaire aussi la roche et les poutres, sans déplacer le décor. */
.mine-warmth, .mine-crystals {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background: inherit;
    filter: brightness(1.65) saturate(1.15);
    opacity: 0;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
.mine-warmth {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1672' height='941' viewBox='0 0 1672 941'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop stop-color='white'/%3E%3Cstop offset='1' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23g)'%3E%3Cellipse cx='187' cy='320' rx='250' ry='330'/%3E%3Cellipse cx='843' cy='320' rx='300' ry='330'/%3E%3Cellipse cx='1450' cy='320' rx='250' ry='330'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1672' height='941' viewBox='0 0 1672 941'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop stop-color='white'/%3E%3Cstop offset='1' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23g)'%3E%3Cellipse cx='187' cy='320' rx='250' ry='330'/%3E%3Cellipse cx='843' cy='320' rx='300' ry='330'/%3E%3Cellipse cx='1450' cy='320' rx='250' ry='330'/%3E%3C/g%3E%3C/svg%3E");
}
.mine-crystals {
    filter: brightness(1.85) saturate(1.3);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1672' height='941' viewBox='0 0 1672 941'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop stop-color='white'/%3E%3Cstop offset='1' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23g)'%3E%3Cellipse cx='20' cy='320' rx='95' ry='100'/%3E%3Cellipse cx='360' cy='310' rx='110' ry='100'/%3E%3Cellipse cx='690' cy='365' rx='120' ry='120'/%3E%3Cellipse cx='1100' cy='345' rx='125' ry='120'/%3E%3Cellipse cx='1630' cy='330' rx='105' ry='110'/%3E%3C/g%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1672' height='941' viewBox='0 0 1672 941'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop stop-color='white'/%3E%3Cstop offset='1' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23g)'%3E%3Cellipse cx='20' cy='320' rx='95' ry='100'/%3E%3Cellipse cx='360' cy='310' rx='110' ry='100'/%3E%3Cellipse cx='690' cy='365' rx='120' ry='120'/%3E%3Cellipse cx='1100' cy='345' rx='125' ry='120'/%3E%3Cellipse cx='1630' cy='330' rx='105' ry='110'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: no-preference) {
    .mine-crystals { animation: crystal-light 6.5s ease-in-out infinite; animation-play-state: paused; }
    .scene-motion-toggle:checked ~ .mine-crystals { animation-play-state: running; }
    .opening-scene.scene-motion-suspended .mine-crystals { animation-play-state: paused; }
}
@keyframes crystal-light { 0%, 100% { opacity: .12; } 45% { opacity: .8; } 74% { opacity: .3; } }
@media (max-width: 760px) {
    .mine-warmth, .mine-crystals {
        background-position: calc(50% + var(--lantern-mobile-shift)) center;
        -webkit-mask-position: calc(50% + var(--lantern-mobile-shift)) center;
        mask-position: calc(50% + var(--lantern-mobile-shift)) center;
    }
}
@media (prefers-reduced-motion: reduce) {
    .mine-warmth, .mine-crystals { display: none; }
}
@media print {
    .scene-lantern, .mine-warmth, .mine-crystals { display: none !important; }
}
