:root {
    --auth-glass-bg: rgba(10, 15, 30, 0.65);
    --auth-glass-border: rgba(139, 92, 246, 0.3);
    --auth-primary: #8b5cf6;
    --auth-primary-dark: #4c1d95;
    --auth-accent: #f59e0b;
    --auth-success: #10b981;
    --auth-danger: #f43f5e;
    --auth-slate: #94a3b8;
    --auth-deep: #020617;
}

.auth-game-page,
.auth-game-page * {
    box-sizing: border-box;
}

.auth-game-page {
    position: fixed;
    inset: 0;
    z-index: 10;
    width: 100%;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
    direction: rtl;
    color: #fff;
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: radial-gradient(circle at 50% 0%, #2e0d4a 0%, #09090b 50%, #020617 100%);
}

.auth-game-page a {
    color: inherit;
    text-decoration: none;
}

.auth-game-page button,
.auth-game-page input {
    font: inherit;
}

.auth-game-page button,
.auth-game-page a {
    touch-action: manipulation;
}

.auth-game-page button {
    border: 0;
    cursor: pointer;
}

.auth-game-page svg {
    display: block;
}

.auth-font-display {
    font-family: Lalezar, Vazirmatn, Tahoma, Arial, sans-serif;
    font-weight: 400;
}

.auth-bg-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: authGridMove 20s linear infinite;
    will-change: transform;
}

@keyframes authGridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px) translateZ(-200px); }
}

.auth-orb {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(100px);
    mix-blend-mode: screen;
    animation: authOrbFloat 15s infinite alternate ease-in-out;
    will-change: transform;
    transform: translateZ(0);
}

.auth-orb-1 {
    width: 45vw;
    height: 45vw;
    top: -10%;
    left: -10%;
    background: rgba(124, 58, 237, 0.25);
}

.auth-orb-2 {
    width: 55vw;
    height: 55vw;
    right: -10%;
    bottom: -20%;
    background: rgba(245, 158, 11, 0.1);
    animation-delay: -5s;
}

.auth-orb-3 {
    width: 35vw;
    height: 35vw;
    top: 30%;
    left: 30%;
    background: rgba(219, 39, 119, 0.15);
    animation-delay: -10s;
}

@keyframes authOrbFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(2vw, 2vh, 0) scale(1.1); }
    100% { transform: translate3d(-2vw, 4vh, 0) scale(0.9); }
}

.auth-note {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.04);
    animation: authFloatNote linear infinite;
}

@keyframes authFloatNote {
    0% { transform: translateY(100vh) rotate(0deg) scale(0.8); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-20vh) rotate(360deg) scale(1.2); opacity: 0; }
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
}

.auth-header {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
    width: 100%;
    padding: 16px 12px 8px;
}

.auth-header-line {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    opacity: 0.6;
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
}

.auth-header-glow {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 48px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1), transparent);
}

.auth-topbar {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-round-button,
.auth-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(129, 140, 248, 0.30);
    box-shadow: 0 8px 20px rgba(0,0,0,0.60);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: transform .25s ease, border-color .25s ease, color .25s ease, background-color .25s ease;
}

.auth-round-button {
    width: 42px;
    height: 42px;
    border-radius: 999px;
}

.auth-back-button {
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 900;
}

.auth-round-button svg,
.auth-back-button svg {
    width: 21px;
    height: 21px;
    color: #c4b5fd;
    transition: transform .25s ease, color .25s ease;
}

.auth-round-button:hover,
.auth-back-button:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.32);
    transform: translateY(-1px);
}

.auth-back-button:hover svg {
    transform: translateX(-4px);
    color: #fff;
}

.auth-main {
    position: relative;
    z-index: 10;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px 78px;
}

.auth-card-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
}

.auth-card {
    position: relative;
    width: 100%;
    overflow: visible;
    border-radius: 32px;
    padding: 28px;
    background: var(--auth-glass-bg);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid var(--auth-glass-border);
    box-shadow: 0 30px 60px rgba(0,0,0,0.70), inset 0 2px 15px rgba(139,92,246,0.10);
    animation: authBorderGlow 3s ease-in-out infinite alternate;
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.auth-card-light {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 128px;
    height: 128px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.4);
    filter: blur(42px);
    pointer-events: none;
}

.auth-card-topshine {
    position: absolute;
    top: 0;
    left: 24px;
    width: 64px;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, #a78bfa, transparent);
}

@keyframes authBorderGlow {
    0% {
        border-color: rgba(139, 92, 246, 0.3);
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.2), inset 0 0 10px rgba(139, 92, 246, 0.1), 0 30px 60px rgba(0,0,0,0.70);
    }
    100% {
        border-color: rgba(168, 85, 247, 0.8);
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.55), inset 0 0 20px rgba(168, 85, 247, 0.25), 0 30px 60px rgba(0,0,0,0.70);
    }
}

.auth-brand {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.auth-logo-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: 20px;
}

.auth-logo-glow {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    opacity: .6;
    background: linear-gradient(135deg, #8b5cf6, #c026d3);
    filter: blur(20px);
    animation: authPulse 2.3s ease-in-out infinite;
}

@keyframes authPulse {
    0%, 100% { opacity: .45; transform: scale(.98); }
    50% { opacity: .78; transform: scale(1.04); }
}

.auth-logo {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0a0a0f;
    border: 2px solid rgba(139, 92, 246, 0.6);
    box-shadow: inset 0 0 25px rgba(139,92,246,0.5);
    transition: transform .45s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-logo svg {
    width: 42px;
    height: 42px;
    color: #fbbf24;
    filter: drop-shadow(0 0 15px rgba(245,158,11,0.6));
}

.auth-register-page .auth-logo svg {
    color: #34d399;
    filter: drop-shadow(0 0 15px rgba(16,185,129,0.62));
}

.auth-title {
    margin: 0 0 2px;
    font-size: 42px;
    line-height: 1;
    letter-spacing: .02em;
    background: linear-gradient(to bottom, #fff, #fde047, #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 10px 40px rgba(245,158,11,0.5), 0 2px 5px rgba(255,255,255,0.5);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.auth-subtitle {
    margin: 6px 0 0;
    color: rgba(226, 232, 240, .66);
    font-size: 12px;
    font-weight: 800;
}

.auth-landscape-divider {
    display: none;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.3), transparent);
}

.auth-form-side {
    position: relative;
    z-index: 2;
    margin-top: 24px;
}

.auth-step-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    transition: height .3s ease;
}

.auth-form-step {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
}

.auth-form-step.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(18px);
}

.auth-step-title {
    margin: 0 0 4px;
    color: #fff;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 950;
}

.auth-step-help {
    margin: 0;
    color: rgba(148, 163, 184, .88);
    font-size: 12px;
    line-height: 1.8;
    font-weight: 700;
}

.auth-form-head {
    margin-bottom: 18px;
    text-align: right;
}

.auth-otp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    text-align: right;
}

.auth-edit-phone {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    color: #cbd5e1;
    background: rgba(255,255,255,0.05);
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.auth-edit-phone:hover {
    color: #fff;
    background: rgba(255,255,255,0.10);
    transform: translateY(-1px);
}

.auth-edit-phone svg {
    width: 20px;
    height: 20px;
}

.auth-display-phone {
    display: inline-block;
    color: #c4b5fd;
    font-weight: 950;
    letter-spacing: .08em;
}

.auth-step-title-success {
    color: #34d399;
}

.auth-profile-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: #34d399;
    background: rgba(16,185,129,0.18);
    border: 1px solid rgba(16,185,129,0.32);
    box-shadow: 0 10px 24px rgba(16,185,129,0.18);
}

.auth-profile-badge svg {
    width: 22px;
    height: 22px;
}

.auth-field {
    position: relative;
    margin-bottom: 20px;
}

.auth-field-icon {
    position: absolute;
    inset-inline-start: auto;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #a78bfa;
}

.auth-field-icon svg {
    width: 20px;
    height: 20px;
}

.auth-input {
    width: 100%;
    min-height: 54px;
    padding: 12px 48px 12px 16px;
    border-radius: 18px;
    text-align: left;
    direction: ltr;
    color: #fff;
    font-size: 19px;
    line-height: 1.5;
    font-weight: 950;
    letter-spacing: .14em;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-bottom: 2px solid rgba(139, 92, 246, 0.5);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
    transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease, transform .25s ease;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.7);
    border-bottom-color: #a855f7;
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2), inset 0 2px 4px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

.auth-input::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.auth-input.auth-input-rtl {
    direction: rtl;
    text-align: right;
    letter-spacing: 0;
    font-size: 18px;
}

.auth-otp-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
    direction: ltr;
}

.auth-otp-input {
    width: 48px;
    height: 56px;
    border-radius: 14px;
    text-align: center;
    direction: ltr;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    font-weight: 950;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-bottom: 3px solid rgba(139, 92, 246, 0.5);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
    transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease, transform .25s ease;
}

.auth-otp-input:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.6);
    border-bottom-color: #f59e0b;
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.25), inset 0 2px 4px rgba(0,0,0,0.4);
}

.auth-otp-input.is-filled,
.auth-otp-input:valid {
    border-color: rgba(16, 185, 129, 0.5);
    border-bottom-color: #10b981;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2), inset 0 2px 4px rgba(0,0,0,0.4);
}

.auth-btn-primary,
.auth-btn-secondary,
.auth-resend-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 18px;
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease, opacity .25s ease;
}

.auth-btn-primary {
    min-height: 54px;
    margin-bottom: 18px;
    color: #fff;
    padding: 12px 18px;
    font-size: 24px;
    line-height: 1;
    background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-top-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(76, 29, 149, 0.5), inset 0 1px 1px rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.auth-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-25deg);
    transition: left .6s ease;
}

.auth-btn-primary:hover::after {
    left: 200%;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #8b5cf6 0%, #5b21b6 100%);
    border-color: rgba(216, 180, 254, 0.6);
    box-shadow: 0 12px 30px rgba(109, 40, 217, 0.6), inset 0 1px 2px rgba(255,255,255,0.3);
}

.auth-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 4px 15px rgba(76, 29, 149, 0.5), inset 0 4px 10px rgba(0,0,0,0.4);
    border-top-color: rgba(167, 139, 250, 0.3);
}

.auth-btn-primary.auth-btn-success {
    background: linear-gradient(180deg, #10b981 0%, #047857 100%);
    border-color: rgba(52, 211, 153, 0.32);
    border-top-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 20px rgba(4, 120, 87, 0.5), inset 0 1px 1px rgba(255,255,255,0.15);
}

.auth-btn-primary.auth-btn-success:hover {
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
    box-shadow: 0 12px 30px rgba(5, 150, 105, 0.6), inset 0 1px 2px rgba(255,255,255,0.3);
}

.auth-btn-primary[disabled],
.auth-resend-button[disabled] {
    opacity: .65;
    cursor: not-allowed;
    transform: none !important;
}

.auth-btn-secondary {
    min-height: 48px;
    color: #e2e8f0;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 950;
    background: rgba(30, 41, 59, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.05);
}

.auth-btn-secondary svg {
    width: 20px;
    height: 20px;
    color: #a78bfa;
}

.auth-btn-secondary:hover {
    color: #fff;
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.25), inset 0 1px 1px rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.auth-btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    animation: authSpin 1s ease-in-out infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.is-loading .auth-btn-spinner {
    display: inline-block;
}

.is-loading .auth-btn-text {
    display: none;
}

.auth-otp-submit {
    margin-bottom: 12px;
}

.auth-timer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 24px;
    text-align: center;
}

.auth-countdown {
    color: #fbbf24;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .04em;
}

.auth-resend-button {
    width: auto;
    color: #cbd5e1;
    background: transparent;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 950;
    text-decoration: underline;
    text-decoration-color: rgba(148,163,184,.55);
}

.auth-resend-button:hover {
    color: #fff;
}

.auth-resend-button.is-hidden {
    display: none;
}

.auth-inline-flash {
    position: relative;
    z-index: 3;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.8;
    background: rgba(244, 63, 94, .15);
    border: 1px solid rgba(244, 63, 94, .35);
}

.auth-inline-flash.is-success {
    background: rgba(16, 185, 129, .15);
    border-color: rgba(16, 185, 129, .35);
}

.auth-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.7));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.auth-footer-meta,
.auth-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-footer-meta {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 950;
}

.auth-footer-meta svg {
    width: 16px;
    height: 16px;
    color: #d946ef;
}

.auth-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auth-footer-version {
    color: #64748b;
    font-size: 14px;
    line-height: 1;
    letter-spacing: .08em;
}

.auth-footer-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #475569;
}

.auth-footer-links {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.5;
}

.auth-footer-links a,
.auth-footer-links button {
    padding: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    transition: color .2s ease;
}

.auth-footer-links a:hover,
.auth-footer-links button:hover {
    color: #a78bfa;
}

.auth-toast {
    position: fixed;
    z-index: 50;
    top: 24px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(92vw, 520px);
    padding: 12px 22px;
    border-radius: 18px;
    color: #fff;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.7;
    text-align: right;
    background: rgba(244, 63, 94, .92);
    border: 1px solid rgba(251, 113, 133, .8);
    box-shadow: 0 10px 30px rgba(225,29,72,0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translate(-50%, -150%);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.auth-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.auth-toast.is-success {
    background: rgba(16, 185, 129, .92);
    border-color: rgba(52, 211, 153, .82);
    box-shadow: 0 10px 30px rgba(16,185,129,0.45);
}

.auth-toast.is-info {
    background: rgba(124, 58, 237, .92);
    border-color: rgba(167, 139, 250, .82);
    box-shadow: 0 10px 30px rgba(139,92,246,0.45);
}

.auth-toast svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.auth-fade-up {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    animation: authFadeUp .8s cubic-bezier(.16, 1, .3, 1) forwards;
}

.auth-delay-100 { animation-delay: .1s; }
.auth-delay-200 { animation-delay: .2s; }

@keyframes authFadeUp {
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (min-width: 768px) {
    .auth-header {
        padding: 24px 24px 8px;
    }

    .auth-main {
        padding: 20px 32px 78px;
    }

    .auth-card {
        padding: 40px;
    }

    .auth-logo-wrap {
        width: 128px;
        height: 128px;
        margin-bottom: 22px;
    }

    .auth-logo svg {
        width: 56px;
        height: 56px;
    }

    .auth-title {
        font-size: 52px;
    }

    .auth-footer {
        flex-direction: row;
        padding: 12px 32px;
    }

    .auth-footer-links {
        font-size: 12px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .auth-header {
        padding: 8px 16px 4px;
    }

    .auth-main {
        padding: 8px 8px 48px;
    }

    .auth-card-wrap {
        max-width: 672px;
    }

    .auth-card {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 28px;
        padding: 20px;
        border-radius: 28px;
    }

    .auth-brand,
    .auth-form-side {
        width: 50%;
    }

    .auth-form-side {
        margin-top: 0;
        display: flex;
        align-items: center;
    }

    .auth-landscape-divider {
        display: block;
    }

    .auth-logo-wrap {
        width: 80px;
        height: 80px;
        margin-bottom: 8px;
    }

    .auth-logo svg {
        width: 34px;
        height: 34px;
    }

    .auth-title {
        font-size: 34px;
    }

    .auth-subtitle {
        display: none;
    }

    .auth-step-container {
        min-height: 238px;
    }

    .auth-step-title {
        font-size: 19px;
    }

    .auth-input {
        min-height: 50px;
        font-size: 18px;
    }

    .auth-btn-primary {
        min-height: 48px;
        font-size: 21px;
        margin-bottom: 14px;
    }

    .auth-btn-secondary {
        min-height: 44px;
        padding: 10px 14px;
    }

    .auth-footer {
        padding: 8px 16px;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 22px;
        border-radius: 26px;
    }

    .auth-main {
        padding-inline: 12px;
    }

    .auth-logo-wrap {
        width: 86px;
        height: 86px;
        margin-bottom: 14px;
    }

    .auth-title {
        font-size: 36px;
    }

    .auth-step-container {
        min-height: 244px;
    }

    .auth-otp-row {
        gap: 6px;
    }

    .auth-otp-input {
        width: 42px;
        height: 52px;
        font-size: 24px;
    }

    .auth-footer-links {
        gap: 8px;
        font-size: 10px;
    }
}

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

.auth-game-page .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-resend-form {
    display: none;
}

@media (max-height: 500px) and (orientation: landscape) {
    .auth-form-side {
        flex-direction: column;
        justify-content: center;
    }
}

/* Graphics quality integration for /login and /register
   The value is saved by assets/play_graphics_quality.js on the main game menu. */
html[data-graphics-quality="low"] .auth-game-page,
html.graphics-quality-low .auth-game-page {
    background: linear-gradient(180deg, #0b0914 0%, #070611 52%, #020617 100%);
}

html[data-graphics-quality="low"] .auth-bg-grid,
html.graphics-quality-low .auth-bg-grid,
html[data-graphics-quality="low"] .auth-orb,
html.graphics-quality-low .auth-orb,
html[data-graphics-quality="low"] [data-notes-container],
html.graphics-quality-low [data-notes-container] {
    display: none !important;
}

html[data-graphics-quality="low"] .auth-card,
html.graphics-quality-low .auth-card,
html[data-graphics-quality="low"] .auth-round-button,
html.graphics-quality-low .auth-round-button,
html[data-graphics-quality="low"] .auth-back-button,
html.graphics-quality-low .auth-back-button,
html[data-graphics-quality="low"] .auth-btn-secondary,
html.graphics-quality-low .auth-btn-secondary,
html[data-graphics-quality="low"] .auth-footer,
html.graphics-quality-low .auth-footer,
html[data-graphics-quality="low"] .auth-toast,
html.graphics-quality-low .auth-toast {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html[data-graphics-quality="low"] .auth-card,
html.graphics-quality-low .auth-card {
    background: rgba(10, 15, 30, 0.94);
    border-color: rgba(139, 92, 246, 0.22);
    box-shadow: 0 16px 34px rgba(0,0,0,0.58);
    animation: none !important;
    will-change: auto;
}

html[data-graphics-quality="low"] .auth-card-light,
html.graphics-quality-low .auth-card-light,
html[data-graphics-quality="low"] .auth-header-glow,
html.graphics-quality-low .auth-header-glow,
html[data-graphics-quality="low"] .auth-logo-glow,
html.graphics-quality-low .auth-logo-glow {
    display: none !important;
}

html[data-graphics-quality="low"] .auth-title,
html.graphics-quality-low .auth-title,
html[data-graphics-quality="low"] .auth-logo svg,
html.graphics-quality-low .auth-logo svg,
html[data-graphics-quality="low"] .auth-register-page .auth-logo svg,
html.graphics-quality-low .auth-register-page .auth-logo svg {
    text-shadow: none !important;
    filter: none !important;
}

html[data-graphics-quality="low"] .auth-logo,
html.graphics-quality-low .auth-logo {
    box-shadow: inset 0 0 0 1px rgba(139,92,246,0.28);
    transition: none;
}

html[data-graphics-quality="low"] .auth-input,
html.graphics-quality-low .auth-input,
html[data-graphics-quality="low"] .auth-otp-input,
html.graphics-quality-low .auth-otp-input {
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.48);
    transition: border-color .12s ease, background-color .12s ease;
}

html[data-graphics-quality="low"] .auth-input:focus,
html.graphics-quality-low .auth-input:focus,
html[data-graphics-quality="low"] .auth-otp-input:focus,
html.graphics-quality-low .auth-otp-input:focus {
    box-shadow: 0 0 0 2px rgba(139,92,246,0.14), inset 0 1px 4px rgba(0,0,0,0.48);
    transform: none;
}

html[data-graphics-quality="low"] .auth-btn-primary,
html.graphics-quality-low .auth-btn-primary,
html[data-graphics-quality="low"] .auth-btn-primary.auth-btn-success,
html.graphics-quality-low .auth-btn-primary.auth-btn-success,
html[data-graphics-quality="low"] .auth-btn-secondary,
html.graphics-quality-low .auth-btn-secondary,
html[data-graphics-quality="low"] .auth-round-button,
html.graphics-quality-low .auth-round-button,
html[data-graphics-quality="low"] .auth-back-button,
html.graphics-quality-low .auth-back-button {
    box-shadow: 0 8px 18px rgba(0,0,0,0.34);
    transition: background-color .12s ease, border-color .12s ease, color .12s ease, opacity .12s ease;
}

html[data-graphics-quality="low"] .auth-btn-primary::after,
html.graphics-quality-low .auth-btn-primary::after {
    display: none;
}

html[data-graphics-quality="low"] .auth-btn-primary:hover,
html.graphics-quality-low .auth-btn-primary:hover,
html[data-graphics-quality="low"] .auth-btn-secondary:hover,
html.graphics-quality-low .auth-btn-secondary:hover,
html[data-graphics-quality="low"] .auth-round-button:hover,
html.graphics-quality-low .auth-round-button:hover,
html[data-graphics-quality="low"] .auth-back-button:hover,
html.graphics-quality-low .auth-back-button:hover,
html[data-graphics-quality="low"] .auth-logo:hover,
html.graphics-quality-low .auth-logo:hover {
    transform: none;
}

html[data-graphics-quality="low"] .auth-fade-up,
html.graphics-quality-low .auth-fade-up {
    opacity: 1;
    transform: none;
    animation: none !important;
}

html[data-graphics-quality="low"] .auth-form-step,
html.graphics-quality-low .auth-form-step,
html[data-graphics-quality="low"] .auth-step-container,
html.graphics-quality-low .auth-step-container,
html[data-graphics-quality="low"] .auth-toast,
html.graphics-quality-low .auth-toast {
    transition-duration: .12s !important;
}

html[data-graphics-quality="low"] .auth-footer,
html.graphics-quality-low .auth-footer {
    background: rgba(2, 6, 23, 0.96);
    box-shadow: 0 -6px 18px rgba(0,0,0,0.38);
}

html[data-graphics-quality="low"] .auth-toast,
html.graphics-quality-low .auth-toast {
    box-shadow: 0 8px 18px rgba(0,0,0,0.34);
}

html[data-graphics-quality="medium"] .auth-game-page,
html.graphics-quality-medium .auth-game-page {
    --auth-glass-bg: rgba(10, 15, 30, 0.65);
    --auth-glass-border: rgba(139, 92, 246, 0.3);
}

html[data-graphics-quality="high"] .auth-game-page,
html.graphics-quality-high .auth-game-page {
    --auth-glass-bg: rgba(10, 15, 30, 0.58);
    --auth-glass-border: rgba(167, 139, 250, 0.42);
}

html[data-graphics-quality="high"] .auth-card,
html.graphics-quality-high .auth-card {
    -webkit-backdrop-filter: blur(30px) saturate(1.12);
    backdrop-filter: blur(30px) saturate(1.12);
}

html[data-graphics-quality="high"] .auth-orb,
html.graphics-quality-high .auth-orb {
    opacity: 1;
}

html[data-graphics-quality="high"] .auth-note,
html.graphics-quality-high .auth-note {
    color: rgba(255, 255, 255, 0.055);
}


/* Auth performance tuning v3.4.8
   High quality keeps the original premium look; medium/low avoid costly mobile paints. */
html[data-graphics-quality="medium"] .auth-game-page,
html.graphics-quality-medium .auth-game-page {
    background: radial-gradient(circle at 50% 0%, rgba(46, 13, 74, .82) 0%, #09090b 48%, #020617 100%);
}

html[data-graphics-quality="medium"] [data-notes-container],
html.graphics-quality-medium [data-notes-container] {
    display: none !important;
}

html[data-graphics-quality="medium"] .auth-bg-grid,
html.graphics-quality-medium .auth-bg-grid {
    opacity: .26;
    transform: none;
    animation: none !important;
    will-change: auto;
    background-size: 52px 52px;
}

html[data-graphics-quality="medium"] .auth-orb,
html.graphics-quality-medium .auth-orb {
    opacity: .32;
    filter: blur(58px);
    mix-blend-mode: normal;
    animation: none !important;
    will-change: auto;
}

html[data-graphics-quality="medium"] .auth-card,
html.graphics-quality-medium .auth-card {
    background: rgba(10, 15, 30, .90);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: rgba(139, 92, 246, .28);
    box-shadow: 0 20px 44px rgba(0,0,0,.58), inset 0 1px 10px rgba(139,92,246,.08);
    animation: none !important;
    will-change: auto;
}

html[data-graphics-quality="medium"] .auth-card-light,
html.graphics-quality-medium .auth-card-light {
    opacity: .34;
    filter: blur(28px);
}

html[data-graphics-quality="medium"] .auth-round-button,
html.graphics-quality-medium .auth-round-button,
html[data-graphics-quality="medium"] .auth-back-button,
html.graphics-quality-medium .auth-back-button,
html[data-graphics-quality="medium"] .auth-btn-secondary,
html.graphics-quality-medium .auth-btn-secondary,
html[data-graphics-quality="medium"] .auth-footer,
html.graphics-quality-medium .auth-footer,
html[data-graphics-quality="medium"] .auth-toast,
html.graphics-quality-medium .auth-toast {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

html[data-graphics-quality="medium"] .auth-logo-glow,
html.graphics-quality-medium .auth-logo-glow {
    opacity: .38;
    filter: blur(14px);
    animation: none !important;
}

html[data-graphics-quality="medium"] .auth-logo,
html.graphics-quality-medium .auth-logo {
    box-shadow: inset 0 0 16px rgba(139,92,246,.32);
}

html[data-graphics-quality="medium"] .auth-logo svg,
html.graphics-quality-medium .auth-logo svg,
html[data-graphics-quality="medium"] .auth-register-page .auth-logo svg,
html.graphics-quality-medium .auth-register-page .auth-logo svg {
    filter: drop-shadow(0 0 8px rgba(245,158,11,.35));
}

html[data-graphics-quality="medium"] .auth-title,
html.graphics-quality-medium .auth-title {
    text-shadow: 0 8px 26px rgba(245,158,11,.28);
    filter: none;
}

html[data-graphics-quality="medium"] .auth-input,
html.graphics-quality-medium .auth-input,
html[data-graphics-quality="medium"] .auth-otp-input,
html.graphics-quality-medium .auth-otp-input {
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

html[data-graphics-quality="medium"] .auth-input:focus,
html.graphics-quality-medium .auth-input:focus,
html[data-graphics-quality="medium"] .auth-otp-input:focus,
html.graphics-quality-medium .auth-otp-input:focus {
    transform: none;
    box-shadow: 0 0 0 3px rgba(139,92,246,.16), inset 0 1px 4px rgba(0,0,0,.44);
}

html[data-graphics-quality="medium"] .auth-btn-primary,
html.graphics-quality-medium .auth-btn-primary,
html[data-graphics-quality="medium"] .auth-btn-secondary,
html.graphics-quality-medium .auth-btn-secondary,
html[data-graphics-quality="medium"] .auth-round-button,
html.graphics-quality-medium .auth-round-button,
html[data-graphics-quality="medium"] .auth-back-button,
html.graphics-quality-medium .auth-back-button {
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease, box-shadow .16s ease;
}

html[data-graphics-quality="medium"] .auth-btn-primary:hover,
html.graphics-quality-medium .auth-btn-primary:hover,
html[data-graphics-quality="medium"] .auth-btn-secondary:hover,
html.graphics-quality-medium .auth-btn-secondary:hover,
html[data-graphics-quality="medium"] .auth-round-button:hover,
html.graphics-quality-medium .auth-round-button:hover,
html[data-graphics-quality="medium"] .auth-back-button:hover,
html.graphics-quality-medium .auth-back-button:hover,
html[data-graphics-quality="medium"] .auth-logo:hover,
html.graphics-quality-medium .auth-logo:hover {
    transform: none;
}

html[data-graphics-quality="medium"] .auth-fade-up,
html.graphics-quality-medium .auth-fade-up {
    animation-duration: .28s;
    transform: translate3d(0, 10px, 0);
}

html[data-graphics-quality="medium"] .auth-form-step,
html.graphics-quality-medium .auth-form-step,
html[data-graphics-quality="medium"] .auth-step-container,
html.graphics-quality-medium .auth-step-container,
html[data-graphics-quality="medium"] .auth-toast,
html.graphics-quality-medium .auth-toast {
    transition-duration: .16s !important;
}

@media (pointer: coarse), (hover: none) {
    html[data-graphics-quality="medium"] .auth-bg-grid,
    html.graphics-quality-medium .auth-bg-grid,
    html[data-graphics-quality="medium"] .auth-orb,
    html.graphics-quality-medium .auth-orb,
    html[data-graphics-quality="medium"] .auth-card-light,
    html.graphics-quality-medium .auth-card-light,
    html[data-graphics-quality="medium"] .auth-card-topshine,
    html.graphics-quality-medium .auth-card-topshine {
        display: none !important;
    }

    html[data-graphics-quality="medium"] .auth-game-page,
    html.graphics-quality-medium .auth-game-page {
        background: linear-gradient(180deg, #140b24 0%, #09090b 50%, #020617 100%);
    }

    html[data-graphics-quality="medium"] .auth-card,
    html.graphics-quality-medium .auth-card {
        background: rgba(10, 15, 30, .96);
        box-shadow: 0 14px 30px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.04);
    }

    html[data-graphics-quality="medium"] .auth-logo-glow,
    html.graphics-quality-medium .auth-logo-glow,
    html[data-graphics-quality="medium"] .auth-header-glow,
    html.graphics-quality-medium .auth-header-glow,
    html[data-graphics-quality="medium"] .auth-btn-primary::after,
    html.graphics-quality-medium .auth-btn-primary::after {
        display: none !important;
    }

    html[data-graphics-quality="medium"] .auth-fade-up,
    html.graphics-quality-medium .auth-fade-up {
        opacity: 1;
        transform: none;
        animation: none !important;
    }

    html[data-graphics-quality="medium"] .auth-btn-primary,
    html.graphics-quality-medium .auth-btn-primary,
    html[data-graphics-quality="medium"] .auth-btn-secondary,
    html.graphics-quality-medium .auth-btn-secondary,
    html[data-graphics-quality="medium"] .auth-round-button,
    html.graphics-quality-medium .auth-round-button,
    html[data-graphics-quality="medium"] .auth-back-button,
    html.graphics-quality-medium .auth-back-button,
    html[data-graphics-quality="medium"] .auth-input,
    html.graphics-quality-medium .auth-input,
    html[data-graphics-quality="medium"] .auth-otp-input,
    html.graphics-quality-medium .auth-otp-input {
        transition-duration: .08s !important;
    }

    html[data-graphics-quality="medium"] .auth-footer,
    html.graphics-quality-medium .auth-footer {
        background: rgba(2, 6, 23, .96);
        box-shadow: 0 -6px 18px rgba(0,0,0,.34);
    }
}
