﻿#global-boot-splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rz-base-50, #fff);
    z-index: 2147483647; /* สูงสุด ทับทุกอย่าง */
}

    #global-boot-splash.hidden {
        display: none;
    }

.boot-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.boot-progress {
    width: 220px;
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
    position: relative;
}

    .boot-progress::after {
        content: "";
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        animation: boot-indet 1.2s linear infinite;
        background: linear-gradient(90deg, transparent, var(--rz-primary, #2d6cdf), transparent);
    }

@keyframes boot-indet {
    to {
        transform: translateX(100%);
    }
}

/* กล่องขาวลอย */
.splash-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 420px; /* ปรับขนาดตามต้องการ */
    padding: 2rem 2rem 2.5rem;
    background: #fff;
    border-radius: 20px; /* ขอบโค้งมน */
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin: auto;
}

/* คง layout ภายใน */
.splash-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Container ของเรือและทะเล */
.ship-container {
    position: relative;
    width: 300px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* ทะเล: อยู่ต่ำกว่าเรือ & กว้างกว่าเรือ + คลื่นขยับ */
.sea {
    position: absolute;
    bottom: 18px; /* ลดระดับน้ำลง ให้เรือลอยชัด */
    left: -28px;
    width: calc(100% + 56px);
    height: 60px;
    background: linear-gradient(180deg, #66d0ff 0%, #3bb9ff 100%);
    border-radius: 30px;
    box-shadow: inset 0 6px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

    .sea::before,
    .sea::after {
        content: "";
        position: absolute;
        inset: auto -200% 0 -200%; /* ให้แถบคลื่นกว้างมากพอ */
        height: 100%;
        background: radial-gradient(90px 32px at 15% 32%, rgba(255,255,255,.9) 34%, rgba(255,255,255,0) 35%), radial-gradient(90px 32px at 45% 42%, rgba(255,255,255,.75) 34%, rgba(255,255,255,0) 35%), radial-gradient(90px 32px at 75% 28%, rgba(255,255,255,.9) 34%, rgba(255,255,255,0) 35%);
        background-size: 260px 70px;
        opacity: .65;
        animation: wave-slide 7s linear infinite;
    }

    .sea::after {
        opacity: .85;
        filter: blur(0.3px);
        animation-duration: 5.5s;
        animation-direction: reverse;
        transform: translateY(-6px); /* เลเยอร์คลื่นด้านบน */
    }

@keyframes wave-slide {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* เรือลอยและโยก */
.ship-svg {
    width: 270px;
    height: auto;
    z-index: 2;
    transform: translateY(-6px); /* ยกเรือให้สูงกว่าระดับน้ำ */
    animation: ship-bob 3s ease-in-out infinite;
}

@keyframes ship-bob {
    0%,100% {
        transform: translateY(-6px) rotate(-1deg);
    }

    50% {
        transform: translateY(-16px) rotate(1deg);
    }
}

/* ควัน */
.smoke {
    opacity: 0;
}

    .smoke.s1 {
        animation: smoke 2.4s ease-out infinite;
    }

    .smoke.s2 {
        animation: smoke 2.4s ease-out .6s infinite;
    }

    .smoke.s3 {
        animation: smoke 2.4s ease-out 1.2s infinite;
    }

@keyframes smoke {
    0% {
        opacity: 0;
        transform: translateY(0) scale(.6);
    }

    20% {
        opacity: .9;
    }

    100% {
        opacity: 0;
        transform: translateY(-26px) scale(1.2);
    }
}

/* ข้อความโหลด */
.loading-text {
    margin-top: 18px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--rz-primary-dark, #1f2937);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
}
