/* ==========================================================================
   Quran bil Quran - User Management & Authentication Styles
   ========================================================================== */

/* ── Color Themes (Global Design System) ── */
:root[data-theme="desert"],
:root.dark-mode:not([data-theme]),
.dark-mode:not([data-theme]) {
    --bg: #1a1612;
    --bg-alt: #231e18;
    --surface: #2a2420;
    --surface-hover: #322b26;
    --surface-card: #25201c;
    --text: #e8dfd5;
    --text-secondary: #c8b9a9;
    --text-muted: #a09080;
    --gold: #d4a020;
    --gold-light: rgba(212, 160, 32, 0.15);
    --gold-hover: rgba(212, 160, 32, 0.10);
    --gold-border: rgba(212, 160, 32, 0.28);
    --gold-glow: rgba(212, 160, 32, 0.22);
    --border: #3a3028;
    --border-light: #443930;
    --panel-bg: #221c16;
    --green: #6aaa80;
}

:root[data-theme="teal"] {
    --bg: #0b1517;
    --bg-alt: #112023;
    --surface: #182c30;
    --surface-hover: #1f383e;
    --surface-card: #142528;
    --text: #e0f2f1;
    --text-secondary: #b2dfdb;
    --text-muted: #80cbc4;
    --gold: #20b2aa;
    --gold-light: rgba(32, 178, 170, 0.15);
    --gold-hover: rgba(32, 178, 170, 0.10);
    --gold-border: rgba(32, 178, 170, 0.28);
    --gold-glow: rgba(32, 178, 170, 0.22);
    --border: #23454b;
    --border-light: #2c545b;
    --panel-bg: #112023;
    --green: #26a69a;
}

:root[data-theme="royal"] {
    --bg: #120e1c;
    --bg-alt: #1a1428;
    --surface: #241c38;
    --surface-hover: #2e2348;
    --surface-card: #1e1730;
    --text: #f3e5f5;
    --text-secondary: #d1c4e9;
    --text-muted: #b39ddb;
    --gold: #ba68c8;
    --gold-light: rgba(186, 104, 200, 0.15);
    --gold-hover: rgba(186, 104, 200, 0.10);
    --gold-border: rgba(186, 104, 200, 0.28);
    --gold-glow: rgba(186, 104, 200, 0.22);
    --border: #382c54;
    --border-light: #463768;
    --panel-bg: #1a1428;
    --green: #81c784;
}

:root[data-theme="emerald"] {
    --bg: #0c1810;
    --bg-alt: #122418;
    --surface: #1a3322;
    --surface-hover: #22422c;
    --surface-card: #152b1d;
    --text: #e8f5e9;
    --text-secondary: #c8e6c9;
    --text-muted: #a5d6a7;
    --gold: #48bb78;
    --gold-light: rgba(72, 187, 120, 0.15);
    --gold-hover: rgba(72, 187, 120, 0.10);
    --gold-border: rgba(72, 187, 120, 0.28);
    --gold-glow: rgba(72, 187, 120, 0.22);
    --border: #264d33;
    --border-light: #306140;
    --panel-bg: #122418;
    --green: #48bb78;
}

:root[data-theme="charcoal"] {
    --bg: #121214;
    --bg-alt: #1a1a1e;
    --surface: #24242a;
    --surface-hover: #2c2c34;
    --surface-card: #1d1d23;
    --text: #f4f4f5;
    --text-secondary: #d4d4d8;
    --text-muted: #a1a1aa;
    --gold: #e4e4e7;
    --gold-light: rgba(228, 228, 231, 0.15);
    --gold-hover: rgba(228, 228, 231, 0.10);
    --gold-border: rgba(228, 228, 231, 0.28);
    --gold-glow: rgba(228, 228, 231, 0.22);
    --border: #383842;
    --border-light: #444450;
    --panel-bg: #1a1a1e;
    --green: #4ade80;
}

/* Modal Form Section Styles */
.auth-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
    margin-top: 10px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-en);
}

.auth-select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 12px;
    font-family: var(--font-en);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    cursor: pointer;
}

.auth-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-light);
}

/* Header User Avatar / Login Button */
.header-auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    text-decoration: none;
}

.header-auth-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 10px var(--gold-light);
    transform: translateY(-1px);
}

.header-user-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex-shrink: 0;
}

.header-user-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-user-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Auth Modal Backdrop */
.auth-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.auth-backdrop.active {
    display: flex;
    animation: authFadeIn 0.25s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Auth Modal Card */
.auth-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: authSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-sizing: border-box;
    direction: ltr !important;
    text-align: left !important;
    font-family: var(--font-en) !important;
}

.auth-modal,
.auth-modal * {
    font-family: var(--font-en);
}

@keyframes authSlideUp {
    from { transform: translateY(24px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Header */
.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
}

.auth-title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--gold);
    font-family: var(--font-en);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.auth-close-btn:hover {
    color: var(--text);
    background: var(--gold-light);
}

/* Auth Mode Navigation Tabs */
.auth-nav-tabs {
    display: flex;
    background: var(--bg);
    padding: 6px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}

.auth-nav-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.auth-nav-tab.active {
    background: var(--surface);
    color: var(--gold);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Body */
.auth-body {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(88vh - 120px);
    overflow-y: auto;
    box-sizing: border-box;
}

/* Social Buttons Grid */
.auth-social-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: var(--font-en);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}

.btn-social:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-social-google:hover {
    border-color: #4285F4;
    color: #4285F4;
}

.btn-social-facebook {
    background: rgba(24, 119, 242, 0.08);
    border-color: rgba(24, 119, 242, 0.3);
}

.btn-social-facebook:hover {
    border-color: #1877F2;
    color: #1877F2;
}

.btn-social-whatsapp {
    background: rgba(37, 211, 102, 0.08);
    border-color: rgba(37, 211, 102, 0.3);
}

.btn-social-whatsapp:hover {
    border-color: #25D366;
    color: #25D366;
}

.btn-social-icon {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-en);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 12px;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-en);
}

.auth-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--font-en);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-light);
}

/* Phone / WhatsApp Input */
.auth-phone-row {
    display: flex;
    gap: 8px;
}

.auth-country-select {
    width: 95px;
    flex-shrink: 0;
}

/* OTP Code Box Grid */
.auth-otp-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 8px 0;
    direction: ltr;
}

.auth-otp-box {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-en);
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--gold);
    outline: none;
    transition: all 0.2s ease;
}

.auth-otp-box:focus {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-light);
    transform: scale(1.05);
}

/* Submit Action Button */
.btn-auth-submit {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--gold) 0%, #8b6508 100%);
    color: #fff;
    font-family: var(--font-en);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(184, 134, 11, 0.25);
    margin-top: 4px;
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, #d4a020 0%, var(--gold) 100%);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
    transform: translateY(-1px);
}

/* Switch View Links */
.auth-switch-text {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-en);
    margin-top: 2px;
}

.auth-switch-link {
    color: var(--gold);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    font-size: inherit;
    padding: 0;
}

/* Error and Alert Notice */
.auth-notice {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: var(--font-en);
    display: none;
    line-height: 1.4;
}

.auth-notice.error {
    display: block;
    background: rgba(224, 96, 96, 0.15);
    border: 1px solid rgba(224, 96, 96, 0.4);
    color: #e06060;
}

.auth-notice.success {
    display: block;
    background: rgba(74, 124, 94, 0.15);
    border: 1px solid rgba(74, 124, 94, 0.4);
    color: var(--green);
}

.auth-notice.info {
    display: block;
    background: var(--gold-light);
    border: 1px solid var(--gold);
    color: var(--gold);
}

/* ==========================================================================
   User Profile Dashboard Modal
   ========================================================================== */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.profile-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gold-light);
    color: var(--gold);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-en);
}

.profile-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-en);
    word-break: break-all;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--gold-light);
    color: var(--gold);
    width: fit-content;
}

/* Profile Sync & Stats Section */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.profile-stat-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-en);
}

.profile-stat-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    font-family: var(--font-en);
}

/* Profile Action Buttons */
.profile-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-profile-action {
    flex: 1;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-profile-action:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-light);
}

.btn-profile-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #8b6508 100%);
    color: #fff;
    border: none;
}

.btn-profile-primary:hover {
    background: linear-gradient(135deg, #d4a020 0%, var(--gold) 100%);
    color: #fff;
}

/* Role & Permissions Badge Card */
.auth-role-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Edit Profile Accordion / Section */
.profile-edit-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    margin-top: 6px;
}

/* Danger Zone */
.profile-danger-zone {
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(224, 96, 96, 0.05);
    border: 1px dashed rgba(224, 96, 96, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-danger-action {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e06060;
    background: transparent;
    color: #e06060;
    font-family: var(--font-en);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-action:hover {
    background: #e06060;
    color: #fff;
}

/* Logout Button */
.btn-auth-logout {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e06060;
    background: rgba(224, 96, 96, 0.08);
    color: #e06060;
    font-family: var(--font-en);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-auth-logout:hover {
    background: #e06060;
    color: #fff;
}

/* ==========================================================================
   Global Leaderboard Styles
   ========================================================================== */
.leaderboard-modal {
    width: 95vw !important;
    max-width: 860px !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    display: flex !important;
    flex-direction: column !important;
    font-family: var(--font-en) !important;
}

.leaderboard-modal,
.leaderboard-modal * {
    font-family: var(--font-en);
}

.leaderboard-tabs {
    display: flex;
    background: var(--bg-alt);
    padding: 10px 24px;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.leaderboard-tab {
    flex: 1;
    padding: 9px 16px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-en);
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.leaderboard-tab svg {
    color: currentColor;
    flex-shrink: 0;
}

.leaderboard-tab:hover {
    color: var(--text);
    background: var(--surface);
}

.leaderboard-tab.active {
    background: var(--surface);
    color: var(--gold);
    border-color: var(--border);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Podium (Top 3 Spotlight Cards) */
.leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--border);
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-sizing: border-box;
    position: relative;
    transition: all 0.2s ease;
}

.podium-item.first {
    order: 2;
    border-color: var(--gold);
    background: var(--gold-hover);
}

.podium-item.second {
    order: 1;
}

.podium-item.third {
    order: 3;
}

.podium-rank-badge {
    position: absolute;
    top: 10px;
    left: 12px;
    font-family: var(--font-en);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.podium-item.first .podium-rank-badge {
    color: var(--gold);
    border-color: var(--gold);
    background: var(--gold-light);
}

.podium-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-en);
    color: var(--gold);
    margin: 8px 0 6px;
    flex-shrink: 0;
}

.podium-item.first .podium-avatar {
    width: 54px;
    height: 54px;
    border-color: var(--gold);
    font-size: 1.3rem;
}

.podium-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-score-row {
    margin-top: 6px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.podium-score {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
    font-family: var(--font-en);
    line-height: 1;
}

.podium-unit {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-en);
    text-transform: uppercase;
}

/* Rankings List */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.leaderboard-item:hover {
    border-color: var(--gold);
}

.leaderboard-item.current-user {
    background: var(--gold-hover);
    border-color: var(--gold);
}

.leaderboard-rank {
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-en);
    color: var(--text-muted);
    width: 26px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.leaderboard-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-en);
    color: var(--gold);
    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.leaderboard-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-you-badge {
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--gold);
    color: #fff;
    padding: 1px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.leaderboard-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-score-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.leaderboard-score-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    font-family: var(--font-en);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.leaderboard-score-unit {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-en);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* User Sticky Rank Card in Modal Footer */
.leaderboard-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 4px;
    box-sizing: border-box;
}

.leaderboard-user-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leaderboard-user-rank-badge {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-en);
}

@media (max-width: 600px) {
    .leaderboard-modal {
        width: 96vw !important;
        max-height: 94vh !important;
        max-height: 94dvh !important;
    }
    .leaderboard-tabs {
        padding: 8px 12px;
    }
    .leaderboard-tab {
        padding: 7px 10px;
        font-size: 0.8rem;
    }
    .leaderboard-podium {
        gap: 6px;
    }
    .podium-item {
        padding: 10px 6px;
    }
    .podium-score {
        font-size: 1.1rem;
    }
    .leaderboard-item {
        padding: 8px 10px;
        gap: 10px;
    }
}

/* RTL Support */
[dir="rtl"] .auth-modal,
[dir="rtl"] .auth-header,
[dir="rtl"] .auth-body,
[dir="rtl"] .leaderboard-list {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .auth-divider {
    direction: rtl;
}

[dir="rtl"] .auth-phone-row {
    direction: ltr; /* Phone numbers remain LTR */
}

[dir="rtl"] .leaderboard-score-badge {
    align-items: flex-start;
}


