﻿/* ถ้าเป็น post-login ให้ซ่อน UI หลักตั้งแต่แรก (กันกระพริบ) */
html.postlogin .main-shell {
    visibility: hidden;
}

/* ระหว่างกำลังรอ client island (เช่น refresh หลัง login) */
html.boot-splash-pending .main-shell {
    visibility: hidden;
}

#BootSplashFull {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rz-base-50, #fff);
    z-index: 2147483647;
}

    #BootSplashFull.hidden {
        display: none !important;
    }

.boot-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

/* ข้อความโหลด */
.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;
}

/* แถบ progress */
.boot-progress {
    width: 420px;
    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);
    }

/* การเคลื่อนไหว progress */
@keyframes boot-indet {
    to {
        transform: translateX(100%);
    }
}

/* card แสดงผล progress */
.splash-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 520px; /* ความกว้างของ card */
    height: 400px; /* ความสูงของ card */
    padding: 2rem 2rem 2.5rem;
    background: #fff;
    border-radius: 20px; /* ขอบโค้งมน */
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin: auto;
}

/* ภายใน card: จัดกึ่งกลางแนวตั้ง */
.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: -78px; /* กำหนดจุดเริ่มต้นในการแสดงทะเล */
    width: calc(100% + 156px); /* กำหนดความกว้างทะเลให้เกินขอบเรือ */
    height: 60px; /* ความสูงทะเล */
    background: linear-gradient(180deg, #66d0ff 0%, #3bb9ff 100%); /* สี gradient ของทะเล */
    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(-24px) rotate(-1deg);
    }

    50% {
        transform: translateY(-38px) 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;
    }

/* กำหนดจุดหมุนของควัน */
.ship-svg .smoke {
    transform-box: fill-box;
    transform-origin: center;
}

/* การเคลื่อนไหวควัน */
@keyframes smoke {
    0% {
        opacity: 0;
        transform: translateY(0) scale(.6);
    }

    20% {
        opacity: .9;
    }

    100% {
        opacity: 0;
        transform: translateY(-26px) scale(1.2);
    }
}