/* ───────────────────────────────────────────────
   SOLEWA Splash Screen — "Lever de soleil solaire"
   ─────────────────────────────────────────────── */

body fuse-splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #FFFEED 0%, #EBF5FE 50%, #FFFFFF 100%);
    z-index: 999999;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 900ms;
}

/* ── Logo ── */
body fuse-splash-screen .splash-logo {
    width: 140px;
    opacity: 0;
    transform: translateY(20px);
    animation: splashFadeInUp 0.6s cubic-bezier(0, 0, 0.2, 1) 0.2s forwards;
}

@keyframes splashFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Sun container ── */
body fuse-splash-screen .splash-sun {
    position: relative;
    width: 80px;
    height: 80px;
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sun circle */
body fuse-splash-screen .splash-sun-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #FFF042;
    opacity: 0;
    transform: scale(0);
    animation: sunScaleIn 0.5s cubic-bezier(0, 0, 0.2, 1) 0.5s forwards;
    position: relative;
    z-index: 2;
}

@keyframes sunScaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Halo */
body fuse-splash-screen .splash-sun-halo {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 240, 66, 0.35) 0%, rgba(255, 240, 66, 0) 70%);
    opacity: 0;
    animation: haloAppear 0.5s ease 0.7s forwards, haloPulse 2.5s ease-in-out 1.2s infinite;
    z-index: 1;
}

@keyframes haloAppear {
    to { opacity: 1; }
}

@keyframes haloPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50%      { transform: scale(1.35); opacity: 1; }
}

/* ── Sun rays ── */
body fuse-splash-screen .splash-ray {
    position: absolute;
    width: 3px;
    height: 14px;
    background-color: #FFF042;
    border-radius: 2px;
    opacity: 0;
    /* Center horizontally, position so ray top is 4px from container top */
    left: calc(50% - 1.5px);
    top: 4px;
    /* Pivot at parent center: x=center of ray, y=distance from ray top to container center */
    transform-origin: 1.5px 36px;
    animation: rayAppear 0.35s cubic-bezier(0, 0, 0.2, 1) forwards;
}

body fuse-splash-screen .splash-ray:nth-child(3)  { transform: rotate(0deg);   animation-delay: 0.7s; }
body fuse-splash-screen .splash-ray:nth-child(4)  { transform: rotate(45deg);  animation-delay: 0.78s; }
body fuse-splash-screen .splash-ray:nth-child(5)  { transform: rotate(90deg);  animation-delay: 0.86s; }
body fuse-splash-screen .splash-ray:nth-child(6)  { transform: rotate(135deg); animation-delay: 0.94s; }
body fuse-splash-screen .splash-ray:nth-child(7)  { transform: rotate(180deg); animation-delay: 1.02s; }
body fuse-splash-screen .splash-ray:nth-child(8)  { transform: rotate(225deg); animation-delay: 1.1s; }
body fuse-splash-screen .splash-ray:nth-child(9)  { transform: rotate(270deg); animation-delay: 1.18s; }
body fuse-splash-screen .splash-ray:nth-child(10) { transform: rotate(315deg); animation-delay: 1.26s; }

@keyframes rayAppear {
    to { opacity: 1; }
}

/* ── Panel grid (3×2) ── */
body fuse-splash-screen .splash-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 28px);
    grid-template-rows: repeat(2, 20px);
    gap: 4px;
    margin-top: 28px;
}

body fuse-splash-screen .splash-panel-cell {
    border-radius: 3px;
    background-color: #D1E4F0;
    opacity: 0;
    animation: panelLight 0.4s cubic-bezier(0, 0, 0.2, 1) forwards;
}

/* Sequential illumination */
body fuse-splash-screen .splash-panel-cell:nth-child(1) { animation-delay: 1.1s; }
body fuse-splash-screen .splash-panel-cell:nth-child(2) { animation-delay: 1.2s; }
body fuse-splash-screen .splash-panel-cell:nth-child(3) { animation-delay: 1.3s; }
body fuse-splash-screen .splash-panel-cell:nth-child(4) { animation-delay: 1.4s; }
body fuse-splash-screen .splash-panel-cell:nth-child(5) { animation-delay: 1.5s; }
body fuse-splash-screen .splash-panel-cell:nth-child(6) { animation-delay: 1.6s; }

@keyframes panelLight {
    to {
        opacity: 1;
        background-color: #1976D2;
    }
}

/* ── Energy pulse ring ── */
body fuse-splash-screen .splash-energy-pulse {
    margin-top: 32px;
    width: 40px;
    height: 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: splashFadeIn 0.4s ease 1.7s forwards;
}

body fuse-splash-screen .splash-energy-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid #1976D2;
    border-radius: 50%;
    animation: energyPulse 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

body fuse-splash-screen .splash-energy-ring:nth-child(2) {
    animation-delay: 0.7s;
}

@keyframes energyPulse {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

@keyframes splashFadeIn {
    to { opacity: 1; }
}

/* ── Existing hide mechanism (preserved) ── */
body:not(.fuse-splash-screen-hidden) {
    overflow: hidden;
}

body.fuse-splash-screen-hidden fuse-splash-screen {
    opacity: 0;
    visibility: hidden;
}
