:root {
    --blue: #0ea5e9;
    --blue-dark: #0284c7;
    --blue-soft: #f0f9ff;
    --gold: #f59e0b;
    --gold-soft: #fef3c7;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --card: rgba(255, 255, 255, 0.82);
    --shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    font-family: 'Nunito', sans-serif;
    color: var(--ink);
    background-color: transparent;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(120deg, rgba(248, 250, 252, 0.58), rgba(254, 243, 199, 0.52)), var(--site-bg-image, url('../images/bg.jpg')) center/cover fixed no-repeat;
}

button, input, .form-control, .custom-dropdown-btn {
    font: inherit;
    touch-action: manipulation;
}

.fw-black {
    font-weight: 900 !important;
}

.login-wrapper {
    width: min(100%, 1040px);
    max-width: 1040px !important;
    padding: 24px;
    animation: slideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

.login-wrapper::before {
    content: "";
    position: fixed;
    inset: -12vh 0 0;
    z-index: 60;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.4px),
        radial-gradient(circle, rgba(255, 255, 255, 0.52) 0 1.8px, transparent 2.3px);
    background-size: 120px 120px, 260px 260px;
    background-position: 22px 54px, 140px 10px;
    opacity: 0.38;
    animation: gmSnowDrift 34s linear infinite;
    will-change: transform;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 24px;
    align-items: stretch;
}

.game-intro {
    min-height: 520px;
    border: 1px solid rgba(255,255,255,0.78);
    border-radius: 30px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    position: relative;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(14, 116, 144, 0.46)),
        var(--site-bg-image, url('../images/bg.jpg')) center/cover no-repeat;
    box-shadow: var(--shadow);
}

.game-intro::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 46%;
    background: linear-gradient(180deg, transparent, rgba(7, 89, 133, 0.8));
}

.intro-content {
    position: relative;
    z-index: 1;
    color: #fff;
    max-width: 560px;
}

.intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.38);
    backdrop-filter: blur(8px);
    font-weight: 900;
    margin-bottom: 14px;
}

.intro-title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 0 12px;
    text-shadow: 0 10px 28px rgba(8, 47, 73, 0.32);
}

.intro-text {
    margin: 0;
    color: rgba(255,255,255,0.9);
    font-weight: 800;
    max-width: 460px;
}

.card-custom {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    background: var(--card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto;
}

.btn-switch-wrap {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.btn-toggle {
    border: 0;
    min-height: 48px;
    border-radius: 12px !important;
    color: var(--muted);
    font-weight: 900;
    padding: 10px 12px;
    transition: all 0.3s ease;
}

.btn-toggle:hover {
    color: var(--blue-dark);
    transform: translateY(-1px);
}

.btn-toggle.active {
    background: #fff;
    color: var(--blue-dark);
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.16);
}

.form-floating > .form-control,
.custom-dropdown-btn {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.75);
    font-weight: 800;
    min-height: 60px;
    color: #334155;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-floating > .form-control:focus,
.custom-dropdown-btn.active {
    border-color: var(--blue) !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15) !important;
    background: #fff;
    transform: translateY(-1px);
}

.form-floating > label {
    color: #7890aa;
    font-weight: 900;
}

.custom-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding-top: 1.625rem;
    padding-bottom: .625rem;
}

.custom-dropdown-menu {
    border-radius: 16px;
    overflow: hidden;
    padding: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    background: #fff;
}

.custom-dropdown-menu .dropdown-item {
    padding: 12px 18px;
    font-weight: 700;
    color: #475569;
    border-radius: 10px;
    transition: 0.2s;
    margin-bottom: 2px;
}

.custom-dropdown-menu .dropdown-item:hover {
    background: #f0f9ff;
    color: #0ea5e9;
    padding-left: 24px;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    text-align: center;
}

.logo-img {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    object-fit: cover;
    background: #fff;
    padding: 6px;
    box-shadow: 0 12px 28px rgba(14, 116, 144, 0.22);
}

.brand-title {
    margin: 0;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0;
    color: #0f172a;
}

.brand-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--blue-soft), #fff7ed);
    color: var(--blue-dark);
    border: 1px solid rgba(125, 211, 252, 0.7);
    font-size: 0.82rem;
    font-weight: 900;
}

.btn-gradient {
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff;
    padding: 16px;
    font-weight: 900;
    font-size: 1.05rem;
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.35);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.45);
    color: #fff;
}

.btn-download {
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: transparent;
    color: #64748b;
    padding: 14px;
    font-weight: 800;
    transition: all 0.3s ease;
}

.btn-download:hover {
    border-color: var(--blue);
    background: #f0f9ff;
    color: var(--blue-dark);
    transform: translateY(-2px);
}

.login-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.benefit-chip {
    min-height: 70px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(255,255,255,0.72);
    color: var(--blue-dark);
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.benefit-chip i {
    color: var(--gold);
    font-size: 1.05rem;
}

.account-field {
    position: relative;
}

.account-info-btn {
    position: absolute;
    end: 0;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--blue);
    padding: 0;
    margin-right: 15px;
    font-size: 1.15rem;
    line-height: 1;
    z-index: 5;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.account-info-btn:hover {
    opacity: 1;
}

/* Custom Popover */
.popover {
    --bs-popover-border-color: rgba(14, 165, 233, 0.2);
    --bs-popover-border-radius: 16px;
    --bs-popover-box-shadow: 0 10px 30px rgba(14, 116, 144, 0.16);
    --bs-popover-font-size: 0.88rem;
    background-color: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.25) !important;
    box-shadow: 0 10px 30px rgba(14, 116, 144, 0.16) !important;
    font-family: 'Nunito', sans-serif;
    border-radius: 16px !important;
    max-width: 280px;
}
.popover-body {
    color: #0369a1;
    font-weight: 800;
    padding: 12px 16px;
    line-height: 1.4;
}

/* Modal and options */
.modal-content {
    border: 0;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.download-option {
    border-radius: 14px;
    padding: 14px;
    font-weight: 800;
    transition: all 0.2s;
    border-width: 2px;
}

.download-option:hover {
    transform: scale(1.02);
}

/* Responsive */
@media (max-width: 900px) {
    body {
        align-items: flex-start;
        background-attachment: scroll;
    }
    .login-wrapper {
        padding: 16px;
        max-width: 480px;
        margin: 0 auto;
    }
    .login-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .game-intro {
        min-height: 170px;
        border-radius: 24px;
        padding: 20px;
        display: flex !important;
    }
    .intro-title {
        font-size: 1.85rem;
    }
    .intro-text {
        font-size: 0.94rem;
        display: none; /* Hide description on mobile to fit nicely */
    }
    .logo-img {
        width: 66px;
        height: 66px;
        border-radius: 20px;
    }
    .brand-title {
        font-size: 1.3rem;
    }
}

/* Download modal glass and platform card layout */
.download-modal-header {
    border-bottom: 0;
    padding: 24px 28px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.download-modal-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 0.5px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-modal-title i {
    color: var(--blue);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(14,165,233,0.4)); }
    50% { filter: drop-shadow(0 0 8px rgba(14,165,233,0.8)); }
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 28px 28px;
}

.download-item-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.download-item-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.download-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-right: 18px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.download-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}

.platform-title {
    font-weight: 900;
    font-size: 1.05rem;
    line-height: 1.2;
    margin-bottom: 2px;
    transition: color 0.2s ease;
}

.platform-subtitle {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
}

.status-badge {
    font-size: 0.72rem;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 99px;
    letter-spacing: 0.5px;
}

/* Android Platform Style */
.download-item-card.android {
    border-color: rgba(16, 185, 129, 0.15);
}
.download-item-card.android .download-icon-box {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.download-item-card.android .platform-title {
    color: #111827;
}
.download-item-card.android .status-badge.available {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.download-item-card.android:not(.disabled-card):hover {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(255,255,255,0.9));
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
    transform: translateY(-3px);
}
.download-item-card.android:not(.disabled-card):hover .download-icon-box {
    background: #10b981;
    color: #ffffff;
    transform: scale(1.1) rotate(5deg);
}

/* Windows/PC Platform Style */
.download-item-card.windows {
    border-color: rgba(14, 165, 233, 0.15);
}
.download-item-card.windows .download-icon-box {
    background: rgba(14, 165, 233, 0.1);
    color: var(--blue);
}
.download-item-card.windows .platform-title {
    color: #111827;
}
.download-item-card.windows .status-badge.available {
    background: rgba(14, 165, 233, 0.1);
    color: var(--blue);
}
.download-item-card.windows:not(.disabled-card):hover {
    border-color: var(--blue);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.04), rgba(255,255,255,0.9));
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.15);
    transform: translateY(-3px);
}
.download-item-card.windows:not(.disabled-card):hover .download-icon-box {
    background: var(--blue);
    color: #ffffff;
    transform: scale(1.1) rotate(-5deg);
}

/* iOS Platform Style */
.download-item-card.ios {
    border-color: #e2e8f0;
    background: #f8fafc;
    opacity: 0.75;
    cursor: not-allowed;
}
.download-item-card.ios .download-icon-box {
    background: #f1f5f9;
    color: #94a3b8;
}
.download-item-card.ios .platform-title {
    color: #64748b;
}
.download-item-card.ios .status-badge.coming-soon {
    background: #f1f5f9;
    color: #94a3b8;
}
.download-item-card.ios.is-available {
    border-color: rgba(245, 158, 11, 0.22);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(255,255,255,0.94));
    opacity: 1;
    cursor: pointer;
}
.download-item-card.ios.is-available:hover {
    border-color: var(--gold);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.16);
    transform: translateY(-3px);
}
.download-item-card.ios.is-available .download-icon-box {
    background: rgba(245, 158, 11, 0.12);
    color: var(--gold);
}
.download-item-card.ios.is-available:hover .download-icon-box {
    background: var(--gold);
    color: #ffffff;
    transform: scale(1.1) rotate(5deg);
}

/* Disabled/Fallback Platform Style */
.download-item-card.disabled-card {
    border-color: #e2e8f0;
    background: #f8fafc;
    opacity: 0.75;
    cursor: not-allowed;
}
.download-item-card.disabled-card .download-icon-box {
    background: #f1f5f9;
    color: #94a3b8;
}
.download-item-card.disabled-card .platform-title {
    color: #64748b;
}
.download-item-card.disabled-card .status-badge.coming-soon {
    background: #f1f5f9;
    color: #94a3b8;
}

/* Explicit Alert Colors for Safety */
#alert-box.alert-success {
    color: #047857 !important;
    background-color: #dcfce7 !important;
    border-color: #86efac !important;
}
#alert-box.alert-danger {
    color: #b91c1c !important;
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
}


/* Rounded uploaded logos and item icons */
.logo-img,
.brand img,
.download-icon-box {
    border-radius: 10px !important;
    overflow: hidden;
}

.logo-img,
.brand img {
    object-fit: cover;
    background: #fff;
}

/* Login visual + stability patch */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body.modal-open {
    padding-right: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
}

.modal {
    padding-right: 0 !important;
}

body {
    align-items: flex-start !important;
    padding: 24px 0;
    isolation: isolate;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(125deg, rgba(248, 250, 252, 0.60), rgba(236, 253, 245, 0.18) 40%, rgba(239, 246, 255, 0.64)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.03)),
        var(--site-bg-image, url('../images/bg.jpg')) center/cover fixed no-repeat;
    filter: saturate(0.94) contrast(1.02);
}



.login-wrapper {
    position: relative;
    z-index: 4;
    animation: loginFadeStable 0.34s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

.card-custom {
    min-height: 612px;
}

.auth-panel {
    min-height: 300px;
}

#loginBox,
#registerBox,
#recoverBox {
    animation: loginPanelFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-shared-actions {
    display: grid;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    position: relative;
}

.login-shared-actions::before {
    content: "";
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.26), rgba(20, 184, 166, 0.22), transparent);
}

.login-action-btn {
    min-height: 58px;
    border-radius: 18px !important;
    padding: 10px 12px;
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 10px;
    text-align: left;
    border: 1px solid rgba(226, 232, 240, 0.92);
    transition:
        border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.22s cubic-bezier(0.16, 1, 0.3, 1),
        color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-action-btn .action-icon,
.login-action-btn .action-cue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.login-action-btn .action-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.login-action-btn .action-cue {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-action-btn .action-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.login-action-btn .action-title,
.login-action-btn .action-subtitle {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-action-btn .action-title {
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.12;
}

.login-action-btn .action-subtitle {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.15;
    opacity: 0.86;
}

.login-action-download {
    color: #ffffff !important;
    border-color: rgba(125, 211, 252, 0.46) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.36), transparent 34%),
        linear-gradient(135deg, #0ea5e9, #0284c7 54%, #075985) !important;
    box-shadow:
        0 16px 34px rgba(14, 165, 233, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.38) !important;
}

.login-action-download .action-icon {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.login-action-download .action-cue {
    background: rgba(255, 255, 255, 0.16);
}

.login-action-recover {
    color: #334155 !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.72)) !important;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
}

.login-action-recover .action-icon {
    color: #0369a1;
    background: rgba(224, 242, 254, 0.9);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.32);
}

.login-action-recover .action-cue {
    color: #64748b;
    background: rgba(241, 245, 249, 0.94);
}

.login-action-btn:hover {
    transform: translateY(-2px);
}

.login-action-download:hover {
    color: #ffffff !important;
    border-color: rgba(186, 230, 253, 0.76) !important;
    box-shadow:
        0 20px 42px rgba(2, 132, 199, 0.42),
        0 0 0 4px rgba(14, 165, 233, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.login-action-recover:hover {
    color: #075985 !important;
    border-color: rgba(14, 165, 233, 0.34) !important;
    background:
        radial-gradient(circle at 14% 0%, rgba(224, 242, 254, 0.94), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.86)) !important;
    box-shadow:
        0 14px 30px rgba(14, 165, 233, 0.13),
        0 0 0 4px rgba(14, 165, 233, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

.login-action-btn:hover .action-cue {
    transform: translateX(2px);
}

.login-action-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .login-shared-actions {
        margin-top: 18px;
        padding-top: 16px;
        gap: 10px;
    }
    .login-action-btn {
        min-height: 54px;
        grid-template-columns: 36px minmax(0, 1fr) 26px;
        gap: 9px;
    }
    .login-action-btn .action-icon {
        width: 36px;
        height: 36px;
    }
    .login-action-btn .action-cue {
        width: 26px;
        height: 26px;
    }
    .login-action-btn .action-title {
        font-size: 0.9rem;
    }
    .login-action-btn .action-subtitle {
        font-size: 0.7rem;
    }
}

.login-layout,
.game-intro,
.card-custom {
    transform: none !important;
}

.game-intro,
.card-custom,
.modal-content,
.download-item-card,
.benefit-chip,
.btn-switch-wrap {
    border-color: rgba(255, 255, 255, 0.68) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.72)) !important;
    box-shadow:
        0 28px 82px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(22px) saturate(136%);
    -webkit-backdrop-filter: blur(22px) saturate(136%);
}

.game-intro {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(7, 89, 133, 0.42)),
        var(--site-bg-image, url('../images/bg.jpg')) center/cover no-repeat !important;
}

.card-custom::before,
.game-intro::before,
.modal-content::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.72), rgba(20, 184, 166, 0.72), rgba(217, 154, 34, 0.58), transparent);
    background-size: 220% 100%;
    animation: loginEdgeLight 6.8s linear infinite;
    pointer-events: none;
}

.card-custom,
.game-intro,
.modal-content {
    position: relative;
    overflow: hidden;
}

.card-custom:hover,
.game-intro:hover {
    transform: none !important;
    box-shadow:
        0 32px 90px rgba(15, 23, 42, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.82) !important;
}

.btn-toggle:hover,
.form-floating > .form-control:focus,
.custom-dropdown-btn.active {
    transform: none !important;
}

.form-floating > .form-control,
.custom-dropdown-btn {
    transition:
        box-shadow 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-gradient,
.btn-download,
.btn-toggle,
.download-item-card {
    position: relative;
    overflow: hidden;
}

.btn-gradient::after,
.btn-download::after,
.btn-toggle::after,
.download-item-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.46) 46%, transparent 58%);
    background-size: 230% 100%;
    opacity: 0;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-gradient:hover::after,
.btn-download:hover::after,
.btn-toggle:hover::after,
.download-item-card:hover::after {
    opacity: 1;
    animation: loginButtonSheen 1.2s linear;
}

.logo-img {
    animation: loginLogoFloat 4.8s ease-in-out infinite;
}

.download-modal-title i {
    animation: loginIconPulse 2s ease-in-out infinite !important;
}

@keyframes loginFadeStable {
    from { opacity: 0; filter: blur(2px); }
    to { opacity: 1; filter: blur(0); }
}

@keyframes loginPanelFade {
    from { opacity: 0; filter: blur(1px); }
    to { opacity: 1; filter: blur(0); }
}


@keyframes loginEdgeLight {
    0% { background-position: -120% 0; }
    100% { background-position: 120% 0; }
}

@keyframes loginButtonSheen {
    0% { background-position: -160% 0; }
    100% { background-position: 160% 0; }
}

@keyframes loginLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes loginIconPulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(14, 165, 233, 0.32)); }
    50% { filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.72)); }
}

@media (max-width: 900px) {
    body {
        padding: 14px 0;
    }

    .card-custom {
        min-height: auto;
    }

    .auth-panel {
        min-height: 0;
    }


}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
