:root {
    --hbl-bg-light: #ffeef7;
    --hbl-bg-light-secondary: #ffffff;
    --hbl-bg-dark: #120617;
    --hbl-bg-dark-secondary: #2a1034;
    --hbl-primary-light: #ff5fa2;
    --hbl-primary-dark: #ff9ad0;
    --hbl-text-light: #3b0a2a;
    --hbl-text-dark: #fce9ff;
    --hbl-glass-light: rgba(255, 255, 255, 0.65);
    --hbl-glass-dark: rgba(34, 8, 45, 0.75);
    --hbl-shadow-light: 0 18px 60px rgba(255, 105, 180, 0.35);
    --hbl-shadow-dark: 0 24px 70px rgba(0, 0, 0, 0.7);
}

.hbl-loader-wrapper {
    position: fixed;
    inset: 0;
    z-index: 9998;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    font-family: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    direction: rtl;
    background: var(--hbl-bg-light);
    color: var(--hbl-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

@supports (height: 100dvh) {
    .hbl-loader-wrapper {
        height: 100dvh;
    }
}

.hbl-loader-wrapper * {
    font-family: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    box-sizing: border-box;
}

.hbl-loader-wrapper[data-theme="dark"] {
    background: radial-gradient(circle at top, #3b1347 0, #09020d 55%, #000 100%);
    color: var(--hbl-text-dark);
}

.hbl-loader-inner {
    position: relative;
    width: min(1000px, 94vw);
    max-height: 92vh;
    padding: 3rem 2.5rem;
    border-radius: 32px;
    background: radial-gradient(circle at top left, rgba(255, 192, 203, 0.55), transparent 55%),
                radial-gradient(circle at bottom right, rgba(255, 182, 193, 0.65), transparent 60%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--hbl-shadow-light);
    backdrop-filter: blur(26px) saturate(150%);
    -webkit-backdrop-filter: blur(26px) saturate(150%);
    isolation: isolate;
}

.hbl-loader-wrapper[data-theme="dark"] .hbl-loader-inner {
    background: radial-gradient(circle at top left, rgba(142, 68, 173, 0.55), transparent 55%),
                radial-gradient(circle at bottom right, rgba(231, 76, 140, 0.4), transparent 60%);
    box-shadow: var(--hbl-shadow-dark);
}

.hbl-liquid-glass {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.8), transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.35), transparent 55%);
    opacity: 0.9;
    pointer-events: none;
    mix-blend-mode: screen;
}

.hbl-loader-wrapper[data-theme="dark"] .hbl-liquid-glass {
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.35), transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.15), transparent 55%);
    mix-blend-mode: soft-light;
}

.hbl-loading-spinner {
    position: absolute;
    top: 2.2rem;
    left: 2.4rem;
    display: flex;
    gap: 0.55rem;
    z-index: 3;
}

.hbl-loading-spinner .hbl-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--hbl-primary-light);
    animation: hbl-bounce 1.1s infinite ease-in-out;
    transform-origin: center bottom;
}

.hbl-loader-wrapper[data-theme="dark"] .hbl-loading-spinner .hbl-dot {
    background: var(--hbl-primary-dark);
}

.hbl-loading-spinner .hbl-dot:nth-child(2) {
    animation-delay: 0.12s;
}
.hbl-loading-spinner .hbl-dot:nth-child(3) {
    animation-delay: 0.24s;
}

@keyframes hbl-bounce {
    0%, 80%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
    40% { transform: translateY(-6px) scale(1.06); opacity: 1; }
}

.hbl-text-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 620px;
}

/* Logo block */
.hbl-logo-wrap {
    margin-bottom: 1.3rem;
    display: flex;
    width: 100%;
    opacity: 0;
    animation: hbl-logo-fade 0.9s ease-out forwards;
    animation-delay: 0.1s;
}

.hbl-logo-align-center {
    justify-content: center;
}
.hbl-logo-align-right {
    justify-content: flex-end;
}
.hbl-logo-align-left {
    justify-content: flex-start;
}

.hbl-logo-inner img {
    display: block;
    max-height: var(--hbl-logo-height, 90px);
    height: auto;
    width: auto;
}

.hbl-logo-style-simple .hbl-logo-inner img {
    filter: drop-shadow(0 10px 24px rgba(15, 23, 42, 0.22));
}

.hbl-logo-style-glass .hbl-logo-inner {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 36px rgba(248, 113, 181, 0.45);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.hbl-loader-wrapper[data-theme="dark"] .hbl-logo-style-glass .hbl-logo-inner {
    background: rgba(15, 6, 28, 0.96);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.12);
}

@keyframes hbl-logo-fade {
    0% { opacity: 0; transform: translateY(10px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.hbl-welcome-text {
    margin: 0 0 1rem;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    min-height: 2.8em;
}

.hbl-description-text {
    margin: 0 auto 2.1rem;
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    line-height: 2.1;
    max-width: 560px;
    color: rgba(59, 10, 42, 0.86);
    font-weight: 400;
}

.hbl-loader-wrapper[data-theme="dark"] .hbl-description-text {
    color: rgba(252, 233, 255, 0.9);
}

.hbl-enter-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 2.7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6cab, #ffb86c);
    color: #fff;
    font-weight: 600;
    font-size: 1.02rem;
    text-decoration: none;
    overflow: hidden;
    border: none;
    box-shadow: 0 14px 40px rgba(255, 92, 143, 0.45);
    cursor: pointer;
    transform: translateY(0);
    transition: transform 0.18s.ease, box-shadow 0.18s.ease;
}

.hbl-enter-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.6), transparent 60%);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.hbl-enter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 50px rgba(255, 92, 143, 0.6);
}

.hbl-enter-button:hover::before {
    opacity: 1;
}

.hbl-enter-button .hbl-btn-text {
    position: relative;
    z-index: 1;
    min-width: 8ch;
    text-align: center;
    white-space: nowrap;
}

.hbl-enter-button::after {
    content: "‹";
    position: relative;
    margin-right: 0.7rem;
    font-size: 1.2rem;
    opacity: 0.98;
}

/* Floating elements full-screen */
.hbl-floating-elements {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.hbl-floating-item {
    position: absolute;
    opacity: 0.35;
    animation: hbl-float 22s ease-in-out infinite alternate;
    filter: blur(12px);
    transform-origin: center center;
}

.hbl-floating-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.05);
}

@keyframes hbl-float {
    0%   { transform: translate3d(0, 0, 0) scale(1.1) rotate(-4deg); }
    50%  { transform: translate3d(18px, -24px, 0) scale(1.18) rotate(3deg); }
    100% { transform: translate3d(-20px, -10px, 0) scale(1.12) rotate(-2deg); }
}

/* Theme toggle */
.hbl-theme-toggle {
    position: fixed;
    top: 1.6rem;
    right: 1.6rem;
    z-index: 5;
    width: 60px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 7px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.hbl-loader-wrapper[data-theme="dark"] .hbl-theme-toggle {
    background: rgba(13, 0, 32, 0.9);
    color: var(--hbl-text-dark);
}

.hbl-theme-toggle span {
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hbl-loader-wrapper[data-theme="dark"] .hbl-icon-sun {
    opacity: 0.35;
    transform: translateX(-4px) scale(0.9);
}
.hbl-loader-wrapper:not([data-theme="dark"]) .hbl-icon-moon {
    opacity: 0.35;
    transform: translateX(4px) scale(0.9);
}

/* Screen off effect */
.hbl-screen-off {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
}

.hbl-screen-off.hbl-active {
    opacity: 1;
    pointer-events: auto;
    animation: hbl-screen-off-anim 0.6s ease-in forwards;
}

@keyframes hbl-screen-off-anim {
    0%   { opacity: 0; transform: scaleY(1); transform-origin: center; }
    40%  { opacity: 1; transform: scaleY(0.03); }
    100% { opacity: 1; transform: scaleY(0); }
}

/* Typing caret */
.hbl-welcome-text::after,
.hbl-description-text::after,
.hbl-enter-button .hbl-btn-text::after {
    content: "|";
    display: inline-block;
    margin-right: 2px;
    opacity: 0;
    animation: hbl-caret 0.95s steps(1) infinite;
}

@keyframes hbl-caret {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .hbl-loader-inner {
        width: 94vw;
        padding: 2.1rem 1.6rem 2.4rem;
        border-radius: 26px;
    }

    .hbl-loading-spinner {
        top: 1.4rem;
        left: 1.6rem;
    }

    .hbl-floating-item {
        opacity: 0.32;
    }
}

@media (max-width: 480px) {
    .hbl-loader-inner {
        padding: 1.8rem 1.3rem 2rem;
        border-radius: 22px;
    }

    .hbl-welcome-text {
        font-size: 1.5rem;
    }

    .hbl-enter-button {
        width: 100%;
        justify-content: center;
    }
}
