/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Theme A — Home (black + gold) */
    --home-bg: #0a0a0a;
    --home-bg-2: #141414;
    --home-card: #1a1a1a;
    --home-gold: #d4af37;
    --home-gold-bright: #ffd700;
    --home-gold-soft: #fbbf24;

    /* Theme B — Other tabs (purple) */
    --purple-bg: #1a0f2e;
    --purple-bg-2: #241540;
    --purple-card: #2d1b4e;
    --purple: #a855f7;
    --purple-bright: #c084fc;
    --purple-soft: #8b5cf6;

    /* Shared */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --top-bar-height: 60px;
    --bottom-nav-height: 70px;

    --transition: 0.3s ease;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--purple-bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    transition: background var(--transition);
    user-select: none;
    -webkit-user-select: none;
}

/* ==================== TOP BAR ==================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--purple-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.logo-text {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.balance-box {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 6px 10px;
    border-radius: 20px;
}

.balance-icon {
    font-size: 14px;
}

.balance-amount {
    font-weight: 700;
    font-size: 14px;
    color: var(--home-gold);
}

.balance-unit {
    font-size: 10px;
    color: var(--text-secondary);
    display: none;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--purple-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    position: fixed;
    top: var(--top-bar-height);
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transition: background var(--transition);
}

/* Home tab gets black background */
body.theme-home .main-content {
    background: var(--home-bg);
}

body.theme-home {
    background: var(--home-bg);
}

/* ==================== TABS ==================== */
.tab-content {
    display: none;
    padding: 20px 16px;
    min-height: 100%;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== PLACEHOLDER (for empty tabs) ==================== */
.placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.placeholder h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.placeholder p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    padding: 8px 4px;
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 22px;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.nav-btn.active {
    color: var(--home-gold);
}

.nav-btn.active .nav-icon {
    transform: scale(1.15);
}

.nav-btn.active .nav-label {
    opacity: 1;
    font-weight: 700;
}

/* Active nav color depends on theme */
body:not(.theme-home) .nav-btn.active {
    color: var(--purple-bright);
}

/* ==================== SCROLLBAR ==================== */
.main-content::-webkit-scrollbar {
    width: 4px;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ==================== RESPONSIVE ==================== */
@media (min-width: 768px) {
    .main-content {
        max-width: 500px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
    }
    .top-bar, .bottom-nav {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
    }
}


/* ==================== FARSI TEXT (RTL) ==================== */
/* فقط متن‌های فارسی RTL می‌شوند، نه layout */

.nav-label,
.placeholder h2,
.placeholder p {
    direction: rtl;
    font-family: 'Vazirmatn', 'Tahoma', 'Iranian Sans', 
                 -apple-system, BlinkMacSystemFont, sans-serif;
}

/* نوار بالا: چپ = لوگو، راست = موجودی */
.top-bar-left {
    direction: ltr;
}

.top-bar-right {
    direction: ltr;
}

/* نوار پایین: از چپ به راست */
.bottom-nav {
    direction: ltr;
}


/* ==================== PHASE 2: HOME TAB ==================== */

/* ---------- Game Area ---------- */
.game-area {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 20px;
    overflow: visible;
}

/* ---------- Bull Image ---------- */
.bull-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.bull-image {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(212, 175, 55, 0.4));
    animation: bull-breathe 4s ease-in-out infinite;
    user-select: none;
}

@keyframes bull-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.005); }
}

/* ---------- Coin Container ---------- */
.coin-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- Coin ---------- */
.coin {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #ffe680 0%, #ffd700 25%, #d4af37 55%, #8b6914 100%);
    box-shadow:
        inset 0 -8px 16px rgba(139, 105, 20, 0.6),
        inset 0 8px 16px rgba(255, 255, 255, 0.4),
        0 8px 24px rgba(212, 175, 55, 0.5),
        0 0 40px rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.08s ease, box-shadow 0.2s ease;
    border: 4px solid #b8860b;
}

.coin::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 2px dashed rgba(139, 105, 20, 0.5);
    pointer-events: none;
}

.coin::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 25%;
    width: 30%;
    height: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.8), transparent 70%);
    pointer-events: none;
    filter: blur(4px);
}

.coin-inner {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 40% 35%, #fff8dc 0%, #ffd700 40%, #b8860b 100%);
    box-shadow:
        inset 0 -4px 8px rgba(139, 105, 20, 0.5),
        inset 0 4px 8px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #8b6914;
}

.coin-logo {
    font-size: 56px;
    font-weight: 900;
    color: #4a3000;
    text-shadow:
        0 1px 0 #ffd700,
        0 2px 0 #b8860b,
        0 3px 6px rgba(0, 0, 0, 0.4);
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1;
    letter-spacing: -2px;
}

/* Coin tap animation */
.coin.tapped {
    animation: coin-tap 0.15s ease;
}

@keyframes coin-tap {
    0% { transform: scale(1); }
    40% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* ---------- TAP TO EARN Hint ---------- */
.tap-hint {
    font-size: 13px;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    animation: tap-pulse 2s ease-in-out infinite;
    margin-top: 4px;
}

@keyframes tap-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---------- Floating Reward ---------- */
.floating-reward {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 900;
    color: #ffd700;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    opacity: 0;
    z-index: 10;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.floating-reward.show {
    animation: float-up 0.8s ease-out;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -180%) scale(1);
    }
}

/* ---------- Energy Section ---------- */
.energy-section {
    width: 100%;
    padding: 12px 0;
}

.energy-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fbbf24;
}

.energy-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

.energy-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #ffd700);
    border-radius: 10px;
    width: 99.9%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ---------- Action Buttons ---------- */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 8px;
    border-radius: 14px;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    color: #ffd700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.action-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    direction: rtl;
}

/* ---------- Stats Card ---------- */
.stats-card {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #141414 0%, #0a0a0a 100%);
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.stats-title {
    font-size: 13px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 12px;
    direction: rtl;
    text-align: right;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.stat-value {
    font-size: 18px;
    font-weight: 900;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #a1a1aa;
    direction: rtl;
}

/* ---------- Balance Updates ---------- */
.balance-amount.pulse {
    animation: balance-pulse 0.3s ease;
}

@keyframes balance-pulse {
    0%, 100% { transform: scale(1); color: #d4af37; }
    50% { transform: scale(1.15); color: #ffd700; }
}

/* ---------- Bull reaction on tap ---------- */
.bull-image.tapped {
    animation: bull-hit 0.2s ease;
}

@keyframes bull-hit {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-3px) scale(1.01); }
    100% { transform: translateY(0) scale(1); }
}



/* ==================== PHASE 3: XP & LEVEL UP ==================== */

/* ---------- XP Box in Top Bar ---------- */
.xp-box {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 5px 8px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
}

.xp-icon {
    font-size: 12px;
}

.xp-level {
    color: #c084fc;
}

/* ---------- XP Section (under energy) ---------- */
.xp-section {
    width: 100%;
    padding: 10px 0 0 0;
}

.xp-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #c084fc;
}

.xp-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 11px;
}

.xp-bar {
    width: 100%;
    height: 8px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #c084fc, #e9d5ff);
    border-radius: 10px;
    width: 52%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.6);
}

/* ---------- XP Floating Feedback ---------- */
.xp-float {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 900;
    color: #c084fc;
    text-shadow:
        0 0 8px rgba(192, 132, 252, 0.9),
        0 0 16px rgba(192, 132, 252, 0.5);
    pointer-events: none;
    opacity: 0;
    z-index: 9;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.xp-float.show {
    animation: xp-float-up 0.7s ease-out;
}

@keyframes xp-float-up {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.6);
    }
    20% {
        opacity: 1;
        transform: translate(20%, -100%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(60%, -180%) scale(0.9);
    }
}

/* ---------- Level Up Celebration ---------- */
.level-up-celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.level-up-celebration.show {
    opacity: 1;
}

.level-up-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 30px 40px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(168, 85, 247, 0.15));
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 60px rgba(212, 175, 55, 0.6),
        inset 0 0 40px rgba(212, 175, 55, 0.1);
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-up-celebration.show .level-up-content {
    transform: scale(1);
}

.level-up-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 60%);
    animation: level-glow 1s ease-out;
    pointer-events: none;
}

@keyframes level-glow {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.3; transform: scale(1.5); }
}

.level-up-star {
    font-size: 64px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9));
    animation: level-star-spin 1.5s ease-in-out infinite;
}

@keyframes level-star-spin {
    0%, 100% { transform: rotate(0) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
}

.level-up-text {
    font-size: 22px;
    font-weight: 900;
    color: #ffd700;
    letter-spacing: 3px;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.9),
        0 0 20px rgba(255, 215, 0, 0.5);
    direction: ltr;
}

.level-up-level {
    font-size: 32px;
    font-weight: 900;
    color: #c084fc;
    text-shadow:
        0 0 10px rgba(192, 132, 252, 0.9),
        0 0 20px rgba(192, 132, 252, 0.5);
    font-family: 'Courier New', monospace;
}

/* ---------- Bull Level Visual Changes ---------- */
.bull-image.level-1 {
    filter: drop-shadow(0 0 20px rgba(150, 150, 150, 0.4))
            saturate(0.6) brightness(0.85);
    transform: scale(0.75);
}

.bull-image.level-2 {
    filter: drop-shadow(0 0 25px rgba(180, 180, 180, 0.4))
            saturate(0.75) brightness(0.9);
    transform: scale(0.82);
}

.bull-image.level-3 {
    filter: drop-shadow(0 0 30px rgba(200, 200, 200, 0.5))
            saturate(0.85) brightness(0.95);
    transform: scale(0.89);
}

.bull-image.level-4 {
    filter: drop-shadow(0 0 35px rgba(212, 175, 55, 0.4))
            saturate(1) brightness(1);
    transform: scale(0.95);
}

.bull-image.level-5 {
    filter: drop-shadow(0 0 40px rgba(212, 175, 55, 0.5))
            saturate(1.1) brightness(1.05);
    transform: scale(1);
}

.bull-image.level-6 {
    filter: drop-shadow(0 0 50px rgba(212, 175, 55, 0.65))
            saturate(1.2) brightness(1.1)
            drop-shadow(0 0 30px rgba(255, 215, 0, 0.4));
    transform: scale(1.05);
}

.bull-image.level-7 {
    filter: drop-shadow(0 0 60px rgba(212, 175, 55, 0.8))
            saturate(1.3) brightness(1.15)
            drop-shadow(0 0 40px rgba(255, 215, 0, 0.6));
    transform: scale(1.1);
}

.bull-image.level-8 {
    filter: drop-shadow(0 0 70px rgba(255, 215, 0, 1))
            saturate(1.4) brightness(1.2)
            drop-shadow(0 0 60px rgba(255, 215, 0, 0.8))
            drop-shadow(0 0 100px rgba(255, 215, 0, 0.5));
    transform: scale(1.15);
    animation: bull-breathe 4s ease-in-out infinite,
               legendary-glow 3s ease-in-out infinite;
}

@keyframes legendary-glow {
    0%, 100% {
        filter: drop-shadow(0 0 70px rgba(255, 215, 0, 1))
                saturate(1.4) brightness(1.2)
                drop-shadow(0 0 60px rgba(255, 215, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 100px rgba(255, 215, 0, 1))
                saturate(1.5) brightness(1.3)
                drop-shadow(0 0 80px rgba(255, 215, 0, 1));
    }
}

/* ---------- Level Badge next to bull (optional) ---------- */
.bull-level-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #0a0a0a;
    font-size: 12px;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
    font-family: 'Courier New', monospace;
    z-index: 5;
}



/* ==================== PHASE 4: COIN HEAT SYSTEM ==================== */

/* ---------- Coin Base (already defined, will add transitions) ---------- */
.coin {
    transition: transform 0.08s ease,
                box-shadow 0.4s ease,
                background 0.4s ease;
    position: relative;
    overflow: visible;
}

/* ---------- Heat Glow Layer (inside coin) ---------- */
.coin-heat-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease, box-shadow 0.4s ease;
    z-index: 1;
}

/* ---------- Heat Particles Layer ---------- */
.coin-particles {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    overflow: visible;
    z-index: 2;
}

.heat-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, #ff8800, transparent);
    box-shadow: 0 0 6px #ffaa00;
    animation: particle-fly 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes particle-fly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--px, 30px), var(--py, -50px)) scale(0.2);
    }
}

/* ---------- Heat Level 1: Warm ---------- */
.coin.heat-1 {
    background:
        radial-gradient(circle at 35% 30%, #fff0a0 0%, #ffd966 25%, #e6b800 55%, #a67c00 100%);
    box-shadow:
        inset 0 -8px 16px rgba(139, 105, 20, 0.6),
        inset 0 8px 16px rgba(255, 255, 255, 0.5),
        0 8px 24px rgba(255, 200, 50, 0.6),
        0 0 50px rgba(255, 200, 50, 0.5);
}

.coin.heat-1 .coin-heat-glow {
    opacity: 0.3;
    box-shadow: 0 0 30px rgba(255, 170, 0, 0.7);
}

/* ---------- Heat Level 2: Hot ---------- */
.coin.heat-2 {
    background:
        radial-gradient(circle at 35% 30%, #ffdd80 0%, #ffbb33 25%, #dd8800 55%, #994400 100%);
    box-shadow:
        inset 0 -8px 16px rgba(139, 80, 20, 0.7),
        inset 0 8px 16px rgba(255, 220, 130, 0.5),
        0 8px 30px rgba(255, 140, 0, 0.7),
        0 0 70px rgba(255, 140, 0, 0.6);
    animation: coin-vibrate 0.1s ease-in-out infinite;
}

.coin.heat-2 .coin-heat-glow {
    opacity: 0.6;
    box-shadow: 0 0 50px rgba(255, 120, 0, 0.9);
}

.coin.heat-2 .heat-particle {
    width: 5px;
    height: 5px;
    box-shadow: 0 0 8px #ffcc00;
}

/* ---------- Heat Level 3: Very Hot ---------- */
.coin.heat-3 {
    background:
        radial-gradient(circle at 35% 30%, #ffb060 0%, #ff8800 25%, #cc5500 55%, #662200 100%);
    box-shadow:
        inset 0 -8px 16px rgba(139, 60, 20, 0.8),
        inset 0 8px 16px rgba(255, 180, 80, 0.5),
        0 8px 40px rgba(255, 80, 0, 0.8),
        0 0 100px rgba(255, 80, 0, 0.7);
    animation: coin-vibrate 0.08s ease-in-out infinite;
}

.coin.heat-3 .coin-heat-glow {
    opacity: 0.85;
    box-shadow: 0 0 70px rgba(255, 80, 0, 1);
}

.coin.heat-3 .heat-particle {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #fff, #ff5500, transparent);
    box-shadow: 0 0 10px #ff5500;
}

/* ---------- Heat Level 4: Red Hot ---------- */
.coin.heat-4 {
    background:
        radial-gradient(circle at 35% 30%, #ff8040 0%, #ff3300 25%, #aa1100 55%, #440000 100%);
    box-shadow:
        inset 0 -8px 16px rgba(150, 30, 0, 0.9),
        inset 0 8px 16px rgba(255, 120, 60, 0.5),
        0 8px 50px rgba(255, 40, 0, 1),
        0 0 130px rgba(255, 40, 0, 0.9);
    animation: coin-vibrate 0.06s ease-in-out infinite,
               coin-red-pulse 0.5s ease-in-out infinite;
}

.coin.heat-4 .coin-heat-glow {
    opacity: 1;
    box-shadow: 0 0 90px rgba(255, 30, 0, 1),
                0 0 40px rgba(255, 100, 0, 0.8);
}

.coin.heat-4 .heat-particle {
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, #fff, #ff2200, transparent);
    box-shadow: 0 0 12px #ff2200;
}

/* ---------- Coin Vibrate Animation ---------- */
@keyframes coin-vibrate {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-1px, 0) rotate(-0.5deg); }
    50% { transform: translate(1px, 0) rotate(0.5deg); }
    75% { transform: translate(0, -1px) rotate(-0.3deg); }
}

/* ---------- Coin Red Hot Pulse ---------- */
@keyframes coin-red-pulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* ---------- Coin Tapped (existing) — override for hot ---------- */
.coin.tapped {
    animation: coin-tap 0.15s ease;
}

.coin.heat-2.tapped,
.coin.heat-3.tapped,
.coin.heat-4.tapped {
    animation: coin-tap 0.15s ease;
}

/* ---------- Tap Hint changes color with heat ---------- */
.tap-hint.heat-2 {
    color: #ffaa00;
    text-shadow: 0 0 15px rgba(255, 140, 0, 0.8);
}

.tap-hint.heat-3 {
    color: #ff6600;
    text-shadow: 0 0 20px rgba(255, 80, 0, 0.9);
}

.tap-hint.heat-4 {
    color: #ff3300;
    text-shadow: 0 0 25px rgba(255, 30, 0, 1);
    animation: tap-pulse 0.8s ease-in-out infinite;
}

/* ---------- Heat Warning Text ---------- */
.heat-warning {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 900;
    color: #ff2200;
    text-shadow: 0 0 10px rgba(255, 40, 0, 0.9);
    letter-spacing: 1px;
    direction: rtl;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.heat-warning.show {
    opacity: 1;
    animation: warning-blink 0.6s ease-in-out infinite;
}

@keyframes warning-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}



/* ==================== PHASE 5: COIN DAMAGE SYSTEM ==================== */

/* ---------- Damage Layer (on coin) ---------- */
.coin-damage {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ---------- Integrity 80% — Small scratches ---------- */
.coin.integrity-80 .coin-damage {
    opacity: 0.4;
    background:
        radial-gradient(ellipse 2px 20px at 30% 40%, rgba(0,0,0,0.7), transparent 80%),
        radial-gradient(ellipse 2px 15px at 65% 55%, rgba(0,0,0,0.6), transparent 80%),
        radial-gradient(ellipse 2px 18px at 45% 70%, rgba(0,0,0,0.5), transparent 80%);
}

/* ---------- Integrity 60% — Visible cracks ---------- */
.coin.integrity-60 .coin-damage {
    opacity: 0.7;
    background:
        radial-gradient(ellipse 3px 30px at 30% 40%, rgba(0,0,0,0.85), transparent 80%),
        radial-gradient(ellipse 3px 25px at 65% 55%, rgba(0,0,0,0.8), transparent 80%),
        radial-gradient(ellipse 3px 28px at 45% 70%, rgba(0,0,0,0.75), transparent 80%),
        radial-gradient(ellipse 2px 20px at 75% 35%, rgba(0,0,0,0.7), transparent 80%);
}

/* ---------- Integrity 40% — Major cracks ---------- */
.coin.integrity-40 .coin-damage {
    opacity: 0.85;
    background:
        radial-gradient(ellipse 4px 40px at 25% 30%, rgba(0,0,0,0.9), transparent 80%),
        radial-gradient(ellipse 4px 45px at 70% 50%, rgba(0,0,0,0.9), transparent 80%),
        radial-gradient(ellipse 4px 38px at 50% 75%, rgba(0,0,0,0.85), transparent 80%),
        radial-gradient(ellipse 3px 30px at 80% 30%, rgba(0,0,0,0.8), transparent 80%),
        radial-gradient(ellipse 3px 25px at 15% 65%, rgba(0,0,0,0.8), transparent 80%),
        radial-gradient(ellipse 3px 22px at 60% 15%, rgba(0,0,0,0.75), transparent 80%);
}

/* ---------- Integrity 20% — Deep cracks ---------- */
.coin.integrity-20 .coin-damage {
    opacity: 1;
    background:
        radial-gradient(ellipse 5px 55px at 20% 25%, rgba(0,0,0,1), transparent 75%),
        radial-gradient(ellipse 5px 60px at 75% 45%, rgba(0,0,0,1), transparent 75%),
        radial-gradient(ellipse 5px 50px at 45% 80%, rgba(0,0,0,1), transparent 75%),
        radial-gradient(ellipse 4px 40px at 85% 25%, rgba(0,0,0,0.95), transparent 80%),
        radial-gradient(ellipse 4px 35px at 10% 60%, rgba(0,0,0,0.95), transparent 80%),
        radial-gradient(ellipse 4px 30px at 55% 15%, rgba(0,0,0,0.9), transparent 80%),
        radial-gradient(ellipse 3px 25px at 35% 45%, rgba(0,0,0,0.9), transparent 80%),
        radial-gradient(ellipse 3px 20px at 70% 70%, rgba(0,0,0,0.85), transparent 80%);
}

/* ---------- Coin shake when integrity low ---------- */
.coin.integrity-20 {
    animation: coin-vibrate 0.06s ease-in-out infinite,
               coin-integrity-danger 0.6s ease-in-out infinite !important;
}

@keyframes coin-integrity-danger {
    0%, 100% { 
        box-shadow: 
            inset 0 -8px 16px rgba(150, 30, 0, 0.9),
            inset 0 8px 16px rgba(255, 120, 60, 0.5),
            0 8px 50px rgba(255, 40, 0, 1),
            0 0 130px rgba(255, 40, 0, 0.9);
    }
    50% { 
        box-shadow: 
            inset 0 -8px 16px rgba(150, 30, 0, 0.9),
            inset 0 8px 16px rgba(255, 120, 60, 0.5),
            0 8px 50px rgba(255, 0, 0, 1),
            0 0 160px rgba(255, 0, 0, 1);
    }
}

/* ==================== BROKEN OVERLAY ==================== */

.broken-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    border-radius: 0;
}

.broken-overlay.show {
    display: flex;
    animation: broken-fade-in 0.4s ease;
}

@keyframes broken-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.broken-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px 40px;
    background: linear-gradient(135deg, rgba(255, 40, 0, 0.15), rgba(80, 0, 0, 0.3));
    border: 2px solid rgba(255, 60, 0, 0.6);
    border-radius: 20px;
    box-shadow:
        0 0 60px rgba(255, 40, 0, 0.7),
        inset 0 0 40px rgba(255, 40, 0, 0.1);
    text-align: center;
}

.broken-icon {
    font-size: 60px;
    animation: broken-shake 0.3s ease-in-out infinite;
}

@keyframes broken-shake {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(1.05); }
    75% { transform: rotate(8deg) scale(1.05); }
}

.broken-title {
    font-size: 20px;
    font-weight: 900;
    color: #ff3300;
    letter-spacing: 2px;
    text-shadow:
        0 0 10px rgba(255, 40, 0, 0.9),
        0 0 20px rgba(255, 40, 0, 0.6);
    direction: ltr;
}

.broken-subtitle {
    font-size: 13px;
    color: #ff8866;
    direction: rtl;
    font-weight: 600;
}

.broken-timer {
    font-size: 16px;
    color: #ffd700;
    font-weight: 700;
    direction: rtl;
    font-family: 'Courier New', monospace;
    margin-top: 4px;
}

.broken-timer span {
    font-size: 24px;
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.7);
}

.broken-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 40, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.broken-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff2200, #ff6600, #ffaa00);
    border-radius: 10px;
    width: 0%;
    transition: width 1s linear;
    box-shadow: 0 0 10px rgba(255, 100, 0, 0.8);
}

/* ==================== DAMAGE WARNING ==================== */

.damage-warning {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    font-weight: 900;
    color: #ff2200;
    text-shadow: 0 0 12px rgba(255, 40, 0, 1);
    letter-spacing: 1.5px;
    direction: rtl;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 8;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 40, 0, 0.5);
}

.damage-warning.show {
    opacity: 1;
    animation: warning-blink 0.5s ease-in-out infinite;
}



/* ---------- Coin Disabled (Broken) ---------- */
.coin.disabled {
    pointer-events: none;
    opacity: 0.4;
    filter: grayscale(0.5) brightness(0.6);
}



/* ==================== DEBUG PANEL (remove in production) ==================== */

.debug-panel {
    position: fixed;
    top: 80px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 9997;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.debug-panel:hover,
.debug-panel:active {
    opacity: 1;
}

.debug-btn {
    padding: 8px 12px;
    background: rgba(255, 40, 0, 0.85);
    color: #fff;
    border: 1px solid #ff2200;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    direction: rtl;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.debug-btn:active {
    transform: scale(0.95);
}

.debug-btn.success {
    background: rgba(16, 185, 129, 0.85);
    border-color: #10b981;
}



/* ==================== PHASE 6: ANTI-BOT WARNING ==================== */

.antibot-warning {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 
        0 0 12px rgba(255, 200, 0, 1),
        0 0 24px rgba(255, 140, 0, 0.7);
    letter-spacing: 1px;
    direction: rtl;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    background: rgba(20, 10, 0, 0.9);
    padding: 10px 20px;
    border-radius: 24px;
    border: 2px solid rgba(255, 200, 0, 0.7);
    box-shadow: 
        0 4px 20px rgba(255, 140, 0, 0.4),
        inset 0 0 20px rgba(255, 200, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translate(-50%, -20px);
}

.antibot-warning.show {
    opacity: 1;
    transform: translate(-50%, 0);
    animation: antibot-pulse 0.6s ease-in-out infinite;
}

@keyframes antibot-pulse {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(255, 140, 0, 0.4),
            inset 0 0 20px rgba(255, 200, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 4px 30px rgba(255, 200, 0, 0.8),
            inset 0 0 30px rgba(255, 200, 0, 0.2);
    }
}



/* ==================== PHASE 7: FRIENDS TAB ==================== */

/* ---------- Friends Header ---------- */
.friends-header {
    margin-bottom: 20px;
    direction: rtl;
    text-align: right;
}

.friends-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.friends-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------- Referral Card ---------- */
.referral-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.referral-label {
    font-size: 13px;
    color: #c084fc;
    font-weight: 600;
    margin-bottom: 10px;
    direction: rtl;
    text-align: right;
}

.referral-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
}

.referral-link-text {
    flex: 1;
    font-size: 12px;
    color: #e9d5ff;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
}

.copy-btn {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #10b981, #34d399);
}

/* ---------- Friends Stats ---------- */
.friends-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.friend-stat-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 16px 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.friend-stat-card:active {
    transform: scale(0.97);
}

.friend-stat-value {
    font-size: 20px;
    font-weight: 900;
    color: #c084fc;
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
    text-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

.friend-stat-value.gold-text {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.friend-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    direction: rtl;
}

/* ---------- Friends List Card ---------- */
.friends-list-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.friends-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    direction: rtl;
}

.friends-list-title {
    font-size: 14px;
    font-weight: 700;
    color: #c084fc;
}

.view-all {
    font-size: 12px;
    color: #a855f7;
    cursor: pointer;
    font-weight: 600;
}

.view-all:active {
    opacity: 0.6;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease;
    direction: rtl;
}

.friend-item:active {
    background: rgba(168, 85, 247, 0.15);
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #c084fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.friend-details {
    display: flex;
    flex-direction: column;
}

.friend-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.friend-status {
    font-size: 10px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

.friend-reward {
    font-size: 13px;
    font-weight: 800;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ---------- Send Invite Button ---------- */
.send-invite-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    transition: all 0.2s ease;
    direction: rtl;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.send-invite-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.6);
}

/* ---------- Toast Notification ---------- */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    direction: rtl;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}



/* ==================== PHASE 7: EDUCATION TAB ==================== */

/* ---------- Education Header ---------- */
.education-header {
    margin-bottom: 16px;
    direction: rtl;
    text-align: right;
}

.education-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.education-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------- Education Progress Card ---------- */
.education-progress-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.education-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #c084fc;
    margin-bottom: 10px;
    direction: rtl;
}

.education-progress-count {
    font-family: 'Courier New', monospace;
    color: #e9d5ff;
    font-size: 12px;
}

.education-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.education-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #c084fc, #e9d5ff);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

/* ---------- Lessons List ---------- */
.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Lesson Card ---------- */
.lesson-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.lesson-card:active {
    transform: scale(0.98);
    border-color: rgba(168, 85, 247, 0.6);
}

.lesson-card.completed {
    border-color: rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #1e2d3e 0%, #0f1e2e 100%);
}

.lesson-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(113, 113, 122, 0.3);
}

.lesson-card.locked:active {
    transform: none;
}

/* Lesson Icon */
.lesson-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7, #c084fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.lesson-card.completed .lesson-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.lesson-card.locked .lesson-icon {
    background: linear-gradient(135deg, #52525b, #3f3f46);
    box-shadow: none;
}

/* Lesson Content */
.lesson-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.lesson-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lesson-card.completed .lesson-title {
    color: #a7f3d0;
}

.lesson-card.locked .lesson-title {
    color: #71717a;
}

.lesson-reward-badge {
    font-size: 11px;
    color: #ffd700;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lesson-card.locked .lesson-reward-badge {
    color: #71717a;
}

/* Lesson Action */
.lesson-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lesson-read-btn {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    direction: rtl;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lesson-read-btn:active {
    transform: scale(0.95);
}

.lesson-card.completed .lesson-read-btn {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.lesson-card.locked .lesson-read-btn {
    background: linear-gradient(135deg, #52525b, #3f3f46);
    opacity: 0.6;
    cursor: not-allowed;
}

.lesson-check {
    font-size: 18px;
    color: #10b981;
}

.lesson-lock {
    font-size: 16px;
    color: #a1a1aa;
}

/* ---------- Lesson Modal ---------- */
.lesson-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lesson-modal.show {
    display: flex;
    animation: lesson-fade-in 0.3s ease;
}

@keyframes lesson-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lesson-modal-content {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 20px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
    direction: rtl;
    animation: lesson-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lesson-slide-up {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.lesson-modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lesson-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
}

.lesson-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.lesson-modal-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.lesson-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    flex: 1;
}

.lesson-modal-body {
    font-size: 14px;
    line-height: 1.8;
    color: #d4d4d8;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.lesson-modal-reward {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    color: #ffd700;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
}

.lesson-modal-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    direction: rtl;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.lesson-modal-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.6);
}

.lesson-modal-btn.completed {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.lesson-modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* ==================== PHASE 7: PREDICTIONS TAB ==================== */

/* ---------- Predictions Header ---------- */
.predictions-header {
    margin-bottom: 16px;
    direction: rtl;
    text-align: right;
}

.predictions-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.predictions-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------- Section Title ---------- */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #c084fc;
    margin-bottom: 10px;
    margin-top: 16px;
    direction: rtl;
}

.section-title:first-of-type {
    margin-top: 0;
}

.dot-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ---------- Matches List ---------- */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Match Card ---------- */
.match-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    padding: 14px;
    direction: rtl;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.match-card.live {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.match-card:active {
    transform: scale(0.99);
}

/* Match Header */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 11px;
}

.match-league {
    color: #a1a1aa;
    font-weight: 600;
}

.match-time {
    color: #c084fc;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Courier New', monospace;
}

.match-card.live .match-time {
    color: #ef4444;
    animation: live-blink 1s ease-in-out infinite;
}

@keyframes live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Match Teams */
.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.match-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.team-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #52525b, #3f3f46);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.team-logo.team-a {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.team-logo.team-b {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.team-name {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    direction: ltr;
}

.vs-label {
    font-size: 12px;
    font-weight: 900;
    color: #a1a1aa;
    padding: 0 8px;
    font-family: 'Courier New', monospace;
}

/* Match Options (Bets) */
.match-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

.match-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.match-option:active {
    transform: scale(0.96);
}

.match-option.selected {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border-color: #c084fc;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5);
}

.match-option-name {
    font-size: 10px;
    color: #a1a1aa;
    font-weight: 600;
    direction: ltr;
}

.match-option.selected .match-option-name {
    color: #fff;
}

.match-option-odd {
    font-size: 14px;
    font-weight: 900;
    color: #c084fc;
    font-family: 'Courier New', monospace;
}

.match-option.selected .match-option-odd {
    color: #fff;
}

.match-option.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- My Bets ---------- */
.my-bets-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 14px;
    margin-top: 20px;
    direction: rtl;
}

.my-bets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #c084fc;
    margin-bottom: 12px;
}

.my-bets-count {
    background: rgba(168, 85, 247, 0.2);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.my-bets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.my-bet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    font-size: 12px;
    gap: 8px;
}

.my-bet-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.my-bet-match {
    font-weight: 700;
    color: #fff;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-bet-details {
    font-size: 10px;
    color: #a1a1aa;
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: right;
}

.my-bet-status {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.my-bet-status.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.my-bet-status.won {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.my-bet-status.lost {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.my-bets-empty {
    text-align: center;
    color: #71717a;
    font-size: 12px;
    padding: 12px;
}

/* ---------- Leaderboard ---------- */
.leaderboard-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 14px;
    margin-top: 16px;
    direction: rtl;
}

.leaderboard-header {
    font-size: 14px;
    font-weight: 700;
    color: #c084fc;
    margin-bottom: 12px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 13px;
}

.leaderboard-item.top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.leaderboard-item.top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), transparent);
    border: 1px solid rgba(192, 192, 192, 0.25);
}

.leaderboard-item.top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.12), transparent);
    border: 1px solid rgba(205, 127, 50, 0.25);
}

.leaderboard-rank {
    width: 26px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #c084fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.leaderboard-name {
    flex: 1;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-points {
    font-size: 12px;
    font-weight: 800;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

/* ---------- Bet Modal ---------- */
.bet-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.bet-modal.show {
    display: flex;
    animation: lesson-fade-in 0.3s ease;
}

.bet-modal-content {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 20px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
    direction: rtl;
    animation: lesson-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bet-modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bet-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.bet-modal-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.bet-modal-match {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    direction: ltr;
}

.bet-modal-time {
    font-size: 12px;
    color: #c084fc;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.bet-modal-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.bet-modal-options .match-option {
    padding: 14px 6px;
}

.bet-modal-amount {
    margin-bottom: 16px;
}

.bet-modal-amount label {
    display: block;
    font-size: 13px;
    color: #c084fc;
    font-weight: 600;
    margin-bottom: 8px;
}

.bet-amount-row {
    display: flex;
    gap: 8px;
}

#bet-amount-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 10px;
    padding: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-align: center;
    direction: ltr;
}

#bet-amount-input:focus {
    outline: none;
    border-color: #c084fc;
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

.bet-max-btn {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    direction: ltr;
}

.bet-max-btn:active {
    transform: scale(0.95);
}

.bet-potential {
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
    color: #a1a1aa;
}

.bet-potential span {
    color: #ffd700;
    font-weight: 800;
    font-family: 'Courier New', monospace;
}

.bet-confirm-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    direction: rtl;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    transition: all 0.2s ease;
}

.bet-confirm-btn:active {
    transform: scale(0.97);
}

.bet-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* ==================== PHASE 7: PROFILE TAB ==================== */

/* ---------- Profile User Card ---------- */
.profile-user-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    direction: rtl;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.profile-user-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #c084fc);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 34px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 1;
}

.profile-name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.profile-username {
    font-size: 13px;
    color: #a1a1aa;
    margin-bottom: 12px;
    direction: ltr;
    position: relative;
    z-index: 1;
}

.profile-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #0a0a0a;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    position: relative;
    z-index: 1;
}

/* ---------- Profile XP Card ---------- */
.profile-xp-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    direction: rtl;
}

.profile-xp-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #c084fc;
    margin-bottom: 10px;
}

.profile-xp-value {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #e9d5ff;
}

.profile-xp-bar {
    width: 100%;
    height: 10px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.profile-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #c084fc, #e9d5ff);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.6);
}

/* ---------- Profile Stats Grid ---------- */
.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.profile-stat-box {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.profile-stat-box:active {
    transform: scale(0.97);
}

.profile-stat-value {
    font-size: 22px;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    margin-bottom: 4px;
}

.profile-stat-value.gold {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.profile-stat-value.purple {
    color: #c084fc;
    text-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

.profile-stat-value.green {
    color: #10b981;
    text-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.profile-stat-value.blue {
    color: #3b82f6;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.profile-stat-label {
    font-size: 11px;
    color: #a1a1aa;
    font-weight: 600;
    direction: rtl;
}

/* ---------- Level Reward Card ---------- */
.level-reward-card {
    background: linear-gradient(135deg, #3d1b5e 0%, #2a0f4e 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    direction: rtl;
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.level-reward-card::before {
    content: '🎁';
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 120px;
    opacity: 0.05;
    transform: rotate(-15deg);
    pointer-events: none;
}

.level-reward-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.level-reward-icon {
    font-size: 22px;
}

.level-reward-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.level-reward-desc {
    font-size: 12px;
    color: #d4d4d8;
    line-height: 1.7;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.level-reward-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a0a;
    font-size: 15px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    direction: rtl;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.level-reward-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
}

/* ---------- Settings Card ---------- */
.settings-card {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    overflow: hidden;
    direction: rtl;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
    transition: background 0.2s ease;
    cursor: pointer;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:active {
    background: rgba(168, 85, 247, 0.08);
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-icon {
    font-size: 18px;
}

.settings-label {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.settings-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-value {
    font-size: 13px;
    color: #a1a1aa;
}

.settings-arrow {
    font-size: 20px;
    color: #71717a;
    font-weight: 300;
}

/* ---------- Toggle Switch ---------- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(113, 113, 122, 0.4);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}



/* ==================== PHASE 8: LEVEL REWARD MODAL ==================== */

.reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    overflow-y: auto;
}

.reward-modal.show {
    display: flex;
    animation: lesson-fade-in 0.3s ease;
}

.reward-modal-content {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 22px;
    padding: 22px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow:
        0 20px 60px rgba(255, 215, 0, 0.2),
        inset 0 0 40px rgba(168, 85, 247, 0.05);
    direction: rtl;
    animation: lesson-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reward-modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.reward-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
}

/* ---------- Header ---------- */
.reward-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-top: 8px;
}

.reward-modal-icon {
    font-size: 48px;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.reward-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffd700;
    text-align: center;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    margin: 0;
}

.reward-modal-desc {
    font-size: 13px;
    color: #d4d4d8;
    text-align: center;
    line-height: 1.8;
    margin-bottom: 16px;
}

.reward-code-hint {
    color: #c084fc;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    direction: ltr;
    display: inline-block;
    margin-top: 4px;
    background: rgba(168, 85, 247, 0.15);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
}

/* ---------- Levels Table ---------- */
.reward-levels-table {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.reward-level-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
    font-size: 13px;
}

.reward-level-row:last-child {
    border-bottom: none;
}

.reward-level-row.highlight {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent);
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.reward-level-name {
    color: #e9d5ff;
    font-weight: 700;
    direction: ltr;
}

.reward-level-row.highlight .reward-level-name {
    color: #ffd700;
}

.reward-level-tokens {
    color: #c084fc;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.reward-level-row.highlight .reward-level-tokens {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ---------- Input ---------- */
.reward-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-align: center;
    direction: ltr;
    letter-spacing: 2px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reward-input:focus {
    outline: none;
    border-color: #c084fc;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.4);
}

.reward-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.reward-error {
    color: #ef4444;
    font-size: 12px;
    text-align: center;
    min-height: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* ---------- Buttons ---------- */
.reward-modal-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a0a;
    font-size: 15px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    direction: rtl;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.2s ease;
}

.reward-modal-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
}

.reward-modal-btn.secondary {
    background: transparent;
    border: 2px solid rgba(168, 85, 247, 0.4);
    color: #c084fc;
    box-shadow: none;
}

.reward-modal-btn.secondary:active {
    background: rgba(168, 85, 247, 0.1);
}

.reward-modal-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
}

/* ---------- Success ---------- */
.reward-success-info {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.reward-success-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.reward-success-row > span:first-child {
    color: #a1a1aa;
    font-weight: 600;
}

.reward-success-value {
    color: #10b981;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    direction: ltr;
}

.reward-pending {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    padding: 16px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.reward-pending-sub {
    font-size: 11px;
    color: #a1a1aa;
    font-weight: 500;
}

/* ---------- Status Badge in Profile ---------- */
.level-reward-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
}

.level-reward-status.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.level-reward-status.approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.level-reward-status.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}



/* ==================== PHASE 9: LANGUAGE PICKER ==================== */

.lang-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 16px;
}

.lang-modal.show {
    display: flex;
    animation: lesson-fade-in 0.3s ease;
}

.lang-modal-content {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 2px solid rgba(168, 85, 247, 0.4);
    border-radius: 22px;
    padding: 22px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.3);
    animation: lesson-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lang-modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
}

.lang-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.lang-modal-icon {
    font-size: 24px;
}

.lang-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #c084fc;
    margin: 0;
    text-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

/* ---------- Language Grid ---------- */
.lang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    direction: ltr;
    font-family: inherit;
    color: #fff;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.lang-item:active {
    transform: scale(0.97);
}

.lang-item.active {
    background: linear-gradient(135deg, #a855f7, #c084fc);
    border-color: #c084fc;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5);
}

.lang-item-flag {
    font-size: 18px;
    flex-shrink: 0;
}

.lang-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-item-check {
    font-size: 14px;
    color: #10b981;
    flex-shrink: 0;
    opacity: 0;
}

.lang-item.active .lang-item-check {
    opacity: 1;
    color: #fff;
}



/* ==================== PHASE 10: FLOATING GOLD PARTICLES ==================== */

.gold-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    opacity: 0.85;
}

.gold-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff8dc 0%, #ffd700 40%, #d4af37 80%, transparent 100%);
    box-shadow: 
        0 0 6px rgba(255, 215, 0, 0.8),
        0 0 12px rgba(255, 215, 0, 0.4);
    animation: gold-float linear infinite;
    opacity: 0;
    pointer-events: none;
}

@keyframes gold-float {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-20vh) translateX(var(--drift, 30px)) scale(1);
        opacity: 0;
    }
}

/* Larger glowing particles (few) */
.gold-particle.big {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #ffffff 0%, #ffd700 30%, #d4af37 70%, transparent 100%);
    box-shadow: 
        0 0 8px rgba(255, 215, 0, 1),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 180, 0, 0.3);
}

/* Sparkle particles (rare) */
.gold-particle.sparkle {
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, #ffffff 0%, #fff5cc 50%, transparent 100%);
    box-shadow: 
        0 0 10px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(255, 215, 0, 0.6);
    animation: gold-float linear infinite,
               sparkle-blink 1.5s ease-in-out infinite;
}

@keyframes sparkle-blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}



/* ==================== PHASE 10: TEAM LOGOS ==================== */

/* Team Logo Image */
.team-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.match-card:active .team-logo-img {
    transform: scale(0.95);
}

/* Team logo container adjustments */
.team-logo {
    overflow: hidden;
    padding: 0;
}

/* If image fails to load, keep the fallback (letter) visible */
.team-logo img {
    display: block;
}

/* ---------- Responsive ---------- */
@media (max-width: 360px) {
    .team-logo {
        width: 38px !important;
        height: 38px !important;
    }
}

@media (min-width: 500px) {
    .team-logo {
        width: 52px !important;
        height: 52px !important;
    }
}



/* ==================== PHASE 10: LEAGUE DROPDOWN + TEAM SEARCH ==================== */

/* ---------- League Filter Container ---------- */
.league-filter {
    position: relative;
    margin-bottom: 12px;
}

/* ---------- Dropdown Button ---------- */
.league-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    direction: rtl;
}

.league-dropdown-btn:active {
    transform: scale(0.98);
    border-color: #a855f7;
}

.league-dropdown-btn.open {
    border-color: #c084fc;
    box-shadow: 0 0 20px rgba(192, 132, 252, 0.4);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.league-flag {
    font-size: 22px;
    flex-shrink: 0;
}

.league-name {
    flex: 1;
    text-align: right;
}

.dropdown-arrow {
    font-size: 12px;
    color: #a855f7;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.league-dropdown-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* ---------- Dropdown Menu ---------- */
.league-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2d1b4e 0%, #1a0f2e 100%);
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    border-top: none;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    direction: rtl;
}

.league-dropdown-menu.open {
    max-height: 500px;
    opacity: 1;
    overflow-y: auto;
}

/* ---------- Dropdown Item ---------- */
.league-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #d4d4d8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
    direction: rtl;
}

.league-item:last-child {
    border-bottom: none;
}

.league-item:active {
    background: rgba(168, 85, 247, 0.15);
}

.league-item.active {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.25), transparent);
    color: #c084fc;
    font-weight: 800;
}

.league-item.active::before {
    content: '✓';
    color: #10b981;
    font-weight: 900;
    margin-left: 4px;
}

.league-item .league-flag {
    font-size: 20px;
}

.league-item .league-name {
    flex: 1;
    text-align: right;
}

.league-item .league-country {
    font-size: 11px;
    color: #71717a;
    font-weight: 500;
    direction: ltr;
}

/* ---------- Team Search Box ---------- */
.team-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(168, 85, 247, 0.25);
    border-radius: 12px;
    margin-bottom: 14px;
    transition: all 0.2s ease;
    direction: rtl;
}

.team-search-box:focus-within {
    border-color: #c084fc;
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.3);
}

.search-icon {
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.team-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
    direction: rtl;
}

.team-search-input::placeholder {
    color: #71717a;
}

.search-clear-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #a1a1aa;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.search-clear-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.9);
}

/* ---------- Empty State for Search ---------- */
.search-empty {
    text-align: center;
    padding: 30px 20px;
    color: #71717a;
    font-size: 13px;
    direction: rtl;
}

.search-empty-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}



/* ==================== PHASE 10: MATCH LAYOUT FIXES ==================== */

/* Force LTR for team layout inside match card */
.match-teams {
    direction: ltr !important;
}

.match-teams .match-team {
    direction: ltr;
}

.match-teams .team-name {
    direction: ltr;
}

/* Time label */
.match-time {
    direction: rtl;
}



/* ═══════════════════════════════════════════════════
   NOTIFICATIONS: Toggle Button
   ═══════════════════════════════════════════════════ */
.notification-toggle-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 12px 0 16px 0;
    background: rgba(139, 92, 246, 0.15);
    border: 1.5px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    color: #c4b5fd;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.notification-toggle-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
    color: #e9d5ff;
}

.notification-toggle-btn.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    color: #86efac;
}

.notification-toggle-btn.active:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.7);
}

.notification-toggle-btn:active {
    transform: scale(0.98);
}


/* ═══════════════════════════════════════════════════
   TELEGRAM: Connect Button
   ═══════════════════════════════════════════════════ */
.telegram-connect-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 0 0 16px 0;
    background: rgba(34, 158, 217, 0.15);
    border: 1.5px solid rgba(34, 158, 217, 0.4);
    border-radius: 12px;
    color: #7dd3fc;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.telegram-connect-btn:hover:not(:disabled) {
    background: rgba(34, 158, 217, 0.25);
    border-color: rgba(34, 158, 217, 0.6);
    color: #bae6fd;
}

.telegram-connect-btn.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    color: #86efac;
}

.telegram-connect-btn.active:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.7);
}

.telegram-connect-btn:disabled,
.telegram-connect-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.15);
    border-color: rgba(100, 100, 100, 0.3);
    color: #71717a;
}

.telegram-connect-btn:active:not(:disabled) {
    transform: scale(0.98);
}


/* ═══════════════════════════════════════════════════
   HEADER LOGO: MHM20 Brand Logo
   ═══════════════════════════════════════════════════ */
.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    background: #000000;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6),
                0 0 4px rgba(168, 85, 247, 0.4) inset;
    border: 1.5px solid rgba(168, 85, 247, 0.5);
}

.logo-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    display: block;
}

/* اگه لوگو لود نشد، حرف M به‌عنوان fallback */
.logo-icon::before {
    content: '';
    position: absolute;
}


/* ============== Stats Modal ============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
}

.stat-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 17px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    color: #a1a1aa;
}


/* ============== Support Modal ============== */
.support-section {
    margin-bottom: 18px;
}

.support-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.faq-item.open {
    border-color: rgba(168, 85, 247, 0.35);
}

.faq-question {
    padding: 12px 14px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.faq-question:hover {
    background: rgba(168, 85, 247, 0.08);
}

.faq-arrow {
    color: #a78bfa;
    transition: transform 0.2s;
    font-size: 12px;
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 14px 12px 14px;
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.5;
}

.support-textarea {
    width: 100%;
    min-height: 90px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    padding: 12px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.support-textarea:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.05);
}

.support-bot-link {
    display: block;
    text-align: center;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #60a5fa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.support-bot-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}


/* ============== Floating Bot ============== */
.floating-bot-container {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    animation: botFloat 3s ease-in-out infinite;
}

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

.floating-bot-img {
    width: 70px;
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(168, 85, 247, 0.5));
    user-select: none;
    pointer-events: none;
}

/* Speech Bubble */
.bot-bubble {
    position: relative;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.95) 0%, rgba(126, 34, 206, 0.95) 100%);
    color: #fff;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    max-width: 180px;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 8px;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.bot-bubble.hidden {
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

.bot-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(126, 34, 206, 0.95);
}

/* Bot reaction when tapped */
.floating-bot-container.bot-scared .floating-bot-img {
    animation: botScared 0.4s ease;
}

@keyframes botScared {
    0% { transform: translateX(0); }
    25% { transform: translateX(-8px) rotate(-5deg); }
    50% { transform: translateX(8px) rotate(5deg); }
    75% { transform: translateX(-5px) rotate(-3deg); }
    100% { transform: translateX(0); }
}

.floating-bot-container.bot-happy .floating-bot-img {
    animation: botHappy 0.5s ease;
}

@keyframes botHappy {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.15) rotate(10deg); }
}

/* Hide bot on non-home tabs */
.tab-content:not(#tab-home) .floating-bot-container {
    display: none;
}


/* ============== Background Video ============== */
.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
    filter: brightness(0.6);
}

/* همه لایه‌های دیگه باید روی ویدیو باشن */
.game-area,
.gold-particles,
.broken-overlay,
.floating-bot-container {
    position: relative;
    z-index: 2;
}

#tab-home {
    position: relative;
    overflow: hidden;
}


/* ============== Generic Modal (Stats, Support, All Friends) ============== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
    display: flex !important;
}

.modal-content {
    background: linear-gradient(160deg, #1a0f2e 0%, #2a1a4a 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 100000;
    animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: #fff;
    font-weight: 600;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.modal-close-btn:hover {
    background: rgba(168, 85, 247, 0.3);
}

.modal-close-btn:active {
    transform: scale(0.9);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    min-height: 100px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(168, 85, 247, 0.15);
    display: flex;
    justify-content: center;
}

.modal-footer .btn-primary {
    padding: 10px 30px;
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
