/* ========== 📖 КОРАН v3 ========== */
        #quranOverlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: #000; z-index: 99999; display: none; flex-direction: column;
        }
        #quranOverlay.active { display: flex; }
        
        /* Шапка */
        #quranHeader {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px; background: rgba(0,0,0,0.95);
            transition: transform 0.3s;
        }
        #quranHeader.hidden { transform: translateY(-100%); position: absolute; width: 100%; }
        #quranHeader span, #quranHeader button { color: #FFFFFF !important; }
        
        /* Текст */
        #quranTextContainer {
            flex: 1; overflow-y: auto; padding: 20px;
            -webkit-user-select: none; user-select: none;
        }
        #quranText {
            font-family: 'Amiri', serif; font-size: 28px; color: #FFD700;
            line-height: 2.5; text-align: right; direction: rtl;
        }
        #quranText.tajweed-mode { color: #FFFFFF !important; }
        
        /* Таджвид */
        .tajweed-madd { color: #FF4444; }
        .tajweed-ghunna { color: #44FF44; }
        .tajweed-ikhfa { color: #4488FF; }
        .tajweed-idgham { color: #44FF88; }
        .tajweed-qalqala { color: #FF44FF; }
        
        /* Нижний бар */
        #quranFooter {
            display: flex; align-items: center; justify-content: center;
            gap: 20px; padding: 12px 16px 24px;
            background: rgba(0,0,0,0.95);
            border-top: 1px solid rgba(255,255,255,0.1);
            transition: transform 0.3s;
        }
        #quranFooter.hidden { transform: translateY(100%); position: absolute; width: 100%; bottom: 0; }
        #quranFooter button {
            background: rgba(255,255,255,0.1); border: none; color: #FFFFFF;
            font-size: 1rem; padding: 10px 20px; border-radius: 20px; cursor: pointer;
        }
        #quranFooter button.active { background: rgba(255,255,255,0.25); }
        
        /* Список сур */
        #surahList {
            position: fixed; bottom: 0; left: 0; width: 100%; max-height: 60vh;
            background: rgba(20,20,30,0.98); border-radius: 24px 24px 0 0;
            z-index: 100001; display: none; overflow-y: auto; padding: 20px;
        }
        #surahList.active { display: block; }
        .surah-list-item {
            padding: 12px; color: #FFF; border-bottom: 1px solid rgba(255,255,255,0.1);
            cursor: pointer; display: flex; justify-content: space-between;
        }
        
        /* Настройки */
        #quranSettings {
            position: fixed; bottom: 0; left: 0; width: 100%;
            background: rgba(20,20,30,0.98); border-radius: 24px 24px 0 0;
            padding: 24px; z-index: 100001; display: none;
        }
        #quranSettings.active { display: block; }
        #quranSettings h3, #quranSettings label, #quranSettings span { color: #FFFFFF !important; }
        #quranSettings select, #quranSettings input {
            width: 100%; padding: 12px; border-radius: 12px;
            background: rgba(255,255,255,0.1); color: #FFF; border: none; margin: 6px 0 12px;
        }
        
        /* Закладки */
        #quranBookmarks {
            position: fixed; bottom: 0; left: 0; width: 100%; max-height: 50vh;
            background: rgba(20,20,30,0.98); border-radius: 24px 24px 0 0;
            padding: 24px; z-index: 100001; display: none; overflow-y: auto;
        }
        #quranBookmarks.active { display: block; }
        #quranBookmarks h3 { color: #FFFFFF !important; }

        /* ========== 🌙 ДВЕ ЛУНЫ + НАЗВАНИЕ ========== */
        
        .title-moon {
            display: inline-block;
            font-size: 2.2rem;
            animation: moonEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, moonFloat 3s ease-in-out infinite;
            filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.7));
            position: relative;
        }
        .title-moon.left { animation-delay: 0s; }
        .title-moon.right { animation-delay: 0.4s; transform: scaleX(-1); }
        
        @keyframes moonEntrance {
            0% { opacity: 0; transform: scale(0) rotate(-180deg); }
            60% { opacity: 1; transform: scale(1.3) rotate(10deg); }
            100% { opacity: 1; transform: scale(1) rotate(0deg); }
        }
        @keyframes moonFloat {
            0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.7)); }
            50% { transform: translateY(-6px); filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1)); }
        }
        
        .moon-star {
            position: absolute;
            font-size: 0.7rem;
            animation: moonStarTwinkle 1.5s ease-in-out infinite;
        }
        .moon-star.top { top: -5px; right: -5px; animation-delay: 0s; }
        .moon-star.bottom { bottom: 0; left: -8px; animation-delay: 0.8s; }
        
        @keyframes moonStarTwinkle {
            0%, 100% { opacity: 0.2; transform: scale(0.6); }
            50% { opacity: 1; transform: scale(1.3); }
        }
        
        .title-main {
            display: inline-block;
            vertical-align: middle;
            margin: 0 12px;
            font-size: 1.7rem;
            font-weight: 800;
            letter-spacing: 2px;
            background: linear-gradient(135deg, #FFD700, #FFA500, #FFD700, #FF8C00, #FFD700);
            background-size: 300% 300%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: titleShine 3s ease-in-out infinite;
            filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
        }
        
        @keyframes titleShine {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }
        
        .title-arabic {
            font-family: 'Amiri', serif;
            font-size: 1rem;
            color: #FFD700;
            direction: rtl;
            opacity: 0.8;
            margin-top: 4px;
        }

        /* ========== 📱 ЭКРАН ЗАГРУЗКИ ========== */
        #splashScreen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #0a2f1a 0%, #1a4a2a 30%, #0d3b1f 60%, #0a1a0a 100%);
            z-index: 999999;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }
        
        #splashScreen.hidden {
            opacity: 0;
            visibility: hidden;
        }
        
        .splash-moon {
            font-size: 5rem;
            animation: splashFloat 3s ease-in-out infinite;
            filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
        }
        
        @keyframes splashFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-15px); }
        }
        
        .splash-stars {
            position: absolute;
            font-size: 1.5rem;
            animation: splashTwinkle 1.5s ease-in-out infinite;
        }
        
        @keyframes splashTwinkle {
            0%, 100% { opacity: 0.3; }
            50% { opacity: 1; }
        }
        
        .splash-title {
            font-size: 1.8rem;
            font-weight: 700;
            color: #FFD700;
            margin: 20px 0 10px;
            text-align: center;
            text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
        }
        
        .splash-subtitle {
            font-size: 0.9rem;
            color: #81C784;
            margin-bottom: 30px;
            text-align: center;
        }
        
        .splash-progress {
            width: 200px;
            height: 4px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 15px;
        }
        
        .splash-progress-fill {
            width: 0%;
            height: 100%;
            background: linear-gradient(90deg, #FFD700, #FFA500);
            border-radius: 10px;
            transition: width 0.3s ease;
        }
        
        .splash-loading-text {
            color: #A5D6A7;
            font-size: 0.8rem;
            margin-bottom: 30px;
        }
        
        .splash-ayah {
            font-family: 'Amiri', serif;
            font-size: 1.3rem;
            color: #FFD700;
            direction: rtl;
            margin-bottom: 8px;
        }
        
        .splash-ayah-translation {
            color: #81C784;
            font-size: 0.75rem;
            font-style: italic;
            text-align: center;
            max-width: 250px;
            line-height: 1.4;
        }
        
        .splash-particles {
            position: absolute;
            pointer-events: none;
        }
        
        @keyframes splashParticle {
            0% { opacity: 1; transform: translateY(0) scale(1); }
            100% { opacity: 0; transform: translateY(-100px) scale(0); }
        }
        
        .splash-particle {
            position: absolute;
            animation: splashParticle 2s ease-out infinite;
        }
        /* ========== 💧 ИКОНКИ С ВОДНЫМ ЭФФЕКТОМ ========== */
        
        /* Контейнер иконки */
        .icon-item {
            position: relative;
            overflow: visible !important;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        
        /* Сама иконка */
        .icon-circle {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 8px;
            font-size: 1.6rem;
            color: white;
            transition: transform 0.2s ease;
            position: relative;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        
        /* Цвета для разных модулей */
        .icon-khatm { background: linear-gradient(135deg, #34C759, #30B0C0); }
        .icon-tauba { background: linear-gradient(135deg, #007AFF, #5856D6); }
        .icon-names { background: linear-gradient(135deg, #FFD700, #FF9500); }
        .icon-zikr { background: linear-gradient(135deg, #AF52DE, #FF2D55); }
        .icon-tasbih { background: linear-gradient(135deg, #5AC8FA, #007AFF); }
        .icon-fasting { background: linear-gradient(135deg, #1a1a2e, #16213e); }
        .icon-prayer { background: linear-gradient(135deg, #0a2f1a, #1a5a2a); }
        .icon-juma { background: linear-gradient(135deg, #2a6e3f, #1d5a34); }
        .icon-stars { background: linear-gradient(135deg, #FFD700, #FF6B00); }
        .icon-achievements { background: linear-gradient(135deg, #FF2D55, #FF3B30); }
        .icon-collection { background: linear-gradient(135deg, #5856D6, #AF52DE); }
        .icon-quiz { background: linear-gradient(135deg, #FF9500, #FF3B30); }
        .icon-dictionary { background: linear-gradient(135deg, #8B4513, #A0522D); }
        .icon-pillars-iman { background: linear-gradient(135deg, #0d3b1f, #1a4a2a); }
        .icon-pillars-islam { background: linear-gradient(135deg, #0a2f1a, #1a5a2a); }
        .icon-prophet-story { background: linear-gradient(135deg, #1a4a2a, #0d3b1f); }
        .icon-battles { background: linear-gradient(135deg, #8B0000, #A52A2A); }
        .icon-settings { background: linear-gradient(135deg, #8E8E93, #636366); }
        .icon-quran { background: linear-gradient(135deg, #34C759, #007AFF); }
        .icon-social { background: linear-gradient(135deg, #007AFF, #00C6FF); }
        
        /* Водный эффект */
        @keyframes waterRipple {
            0% {
                width: 0;
                height: 0;
                opacity: 0.5;
                margin-left: 0;
                margin-top: 0;
            }
            100% {
                width: 120px;
                height: 120px;
                opacity: 0;
                margin-left: -60px;
                margin-top: -60px;
            }
        }
        
        .water-ripple {
            position: absolute;
            top: 50%;
            left: 50%;
            border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.6);
            animation: waterRipple 0.6s ease-out forwards;
            pointer-events: none;
            z-index: 1;
        }
        
        /* Нажатие — как в воду */
        .icon-circle:active {
            transform: scale(0.9);
        }
        
        /* Подпись */
        .icon-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: #1C1C1E;
            text-align: center;
            margin-top: 4px;
        }
        
        /* Бейдж на иконке */
        .icon-badge-count {
            position: absolute;
            top: -5px;
            right: -5px;
            background: #FF3B30;
            color: white;
            font-size: 0.65rem;
            font-weight: 700;
            min-width: 20px;
            height: 20px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 6px;
            border: 2px solid white;
            z-index: 2;
        }
        .icon-badge-count.green { background: #34C759; }
        .icon-badge-count.orange { background: #FF9500; }
        .icon-badge-count.purple { background: #AF52DE; }

        /* ========== 🌙 НЕБО, СОЛНЦЕ, ЛУНА ========== */
        
        /* Небо */
        #skyContainer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }
        
        /* Солнце и Луна */
        .sky-sun, .sky-moon {
            position: absolute;
            font-size: 4rem;
            transition: all 2s ease;
            filter: drop-shadow(0 0 20px rgba(255,200,0,0.5));
        }
        
        /* Облака */
        @keyframes cloudFloat {
            0% { transform: translateX(-150px); }
            100% { transform: translateX(calc(100vw + 150px)); }
        }
        
        .sky-cloud {
            position: absolute;
            font-size: 3rem;
            opacity: 0.6;
            animation: cloudFloat linear infinite;
            filter: blur(1px);
        }
        
        /* Звёзды */
        @keyframes starTwinkle {
            0%, 100% { opacity: 0.3; transform: scale(0.8); }
            50% { opacity: 1; transform: scale(1.2); }
        }
        
        .sky-star {
            position: absolute;
            font-size: 1rem;
            animation: starTwinkle ease-in-out infinite;
        }
        
        /* Птицы */
        @keyframes birdFly {
            0% { transform: translateX(-50px) translateY(0); }
            25% { transform: translateX(25vw) translateY(-30px); }
            50% { transform: translateX(50vw) translateY(0); }
            75% { transform: translateX(75vw) translateY(-20px); }
            100% { transform: translateX(100vw) translateY(0); }
        }
        
        .sky-bird {
            position: absolute;
            font-size: 1.5rem;
            animation: birdFly 15s ease-in-out infinite;
        }
        /* ========== 🎴 АНИМИРОВАННЫЕ КАРТОЧКИ ========== */
        
        /* Появление карточки */
        @keyframes cardAppear {
            0% { transform: scale(0) rotate(180deg); opacity: 0; }
            60% { transform: scale(1.1) rotate(-10deg); opacity: 1; }
            100% { transform: scale(1) rotate(0deg); opacity: 1; }
        }
        
        /* Голографический блеск */
        @keyframes holographicShine {
            0% { background-position: 0% 50%; }
            100% { background-position: 400% 50%; }
        }
        
        /* Карточка дышит */
        @keyframes cardBreathe {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.03); }
        }
        
        /* Карточка парит */
        @keyframes cardFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-5px); }
        }
        
        /* Частицы */
        @keyframes particleFly {
            0% { opacity: 1; transform: translate(0, 0) scale(1); }
            100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0); }
        }
        
        .card-holographic {
            background: linear-gradient(135deg, #ff0000, #ff7700, #ffff00, #00ff00, #0077ff, #7700ff, #ff0000);
            background-size: 400% 400%;
            animation: holographicShine 3s linear infinite;
        }
        
        .card-rare {
            animation: cardBreathe 3s ease-in-out infinite;
        }
        
        .card-float {
            animation: cardFloat 4s ease-in-out infinite;
        }
        
        .card-new {
            animation: cardAppear 0.6s ease-out;
        }
        
        .card-particle {
            position: fixed;
            pointer-events: none;
            font-size: 1rem;
            z-index: 99999;
            animation: particleFly 1s ease-out forwards;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        body { 
            background: #F2F2F7; 
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif; 
            min-height: 100vh; 
            overflow-x: hidden;
            transition: background 0.3s ease;
        }
        .app-container { max-width: 430px; margin: 0 auto; background: #F2F2F7; min-height: 100vh; position: relative; transition: background 0.3s ease; }
        
        /* ========== Всплывающее окно XP (КОМПАКТНОЕ) ========== */
        .xp-popup {
            position: fixed;
            top: 15px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #1a1a2e 0%, #2d1f00 50%, #1a1a2e 100%);
            border: 2px solid #FFD700;
            border-radius: 50px;
            padding: 8px 16px;
            z-index: 9999;
            display: none;
            align-items: center;
            gap: 8px;
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.4);
            max-width: 95%;
            backdrop-filter: blur(10px);
        }
        .xp-popup.show {
            display: flex;
            animation: xpSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes xpSlideIn {
            0% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.9); }
            100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
        }
        .xp-popup.hiding {
            animation: xpSlideOut 0.2s ease-in forwards;
        }
        @keyframes xpSlideOut {
            0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
            100% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.9); }
        }
        .xp-popup-level {
            background: linear-gradient(135deg, #FFD700, #FFA500);
            color: #1a1a2e;
            padding: 4px 10px;
            border-radius: 30px;
            font-weight: 800;
            font-size: 0.75rem;
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
            white-space: nowrap;
            flex-shrink: 0;
        }
        .xp-popup-bar {
            width: 100px;
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            overflow: hidden;
            border: 1px solid rgba(255, 215, 0, 0.3);
            flex-shrink: 1;
            min-width: 60px;
        }
        .xp-popup-fill {
            height: 100%;
            background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
            background-size: 200% 100%;
            border-radius: 20px;
            width: 0%;
            transition: width 0.5s ease;
            animation: xpBarShine 2s ease-in-out infinite;
        }
        @keyframes xpBarShine {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }
        .xp-popup-text {
            color: #FFD700;
            font-weight: 700;
            font-size: 0.7rem;
            white-space: nowrap;
            flex-shrink: 0;
        }
        /* Верхняя панель (скрыта по умолчанию) */
        .nav-bar { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 12px 16px; display: flex; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; }
        .nav-bar.hidden { display: none; }
        .nav-bar-title { flex: 1; text-align: center; font-weight: 600; font-size: 1.1rem; color: #000; }
        .nav-bar-left { width: 50px; display: flex; align-items: center; }
        .nav-bar-right { width: 50px; }
        .back-button { display: flex; align-items: center; gap: 4px; color: #007AFF; font-size: 1rem; cursor: pointer; background: none; border: none; padding: 8px 0; }
        
        /* Главный экран */
        .home-screen { display: block; padding: 8px 12px 20px; }
        .home-screen.hidden { display: none; }
        
        /* Радужная шапка */
        .rainbow-header { position: relative; padding: 25px 20px; border-radius: 40px; margin: 12px 0 16px; z-index: 1; overflow: hidden; background: #FFFFFF; text-align: center; }
        .rainbow-header::before { content: ''; position: absolute; top: -3px; left: -3px; right: -3px; bottom: -3px; background: linear-gradient(45deg, #ff0000, #ff9900, #ffff00, #33cc33, #3399ff, #6633cc, #ff33cc, #ff0000); background-size: 300% 300%; border-radius: 43px; z-index: -2; animation: rainbowFlow 4s ease infinite; }
        .rainbow-header::after { content: ''; position: absolute; top: 3px; left: 3px; right: 3px; bottom: 3px; background: #FFFFFF; border-radius: 37px; z-index: -1; }
        @keyframes rainbowFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
        .rainbow-header h1 { font-size: 1.8rem; color: #1C1C1E; margin-bottom: 8px; }
        .rainbow-header .arabic { font-family: 'Amiri', serif; font-size: 1.1rem; color: #8E8E93; direction: rtl; }
        
        /* ========== УЛУЧШЕННЫЙ XP-БАР ========== */
        .xp-bar {
            background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 20px;
            padding: 14px 18px;
            margin: 0 0 16px;
            display: flex;
            align-items: center;
            gap: 12px;
            border: 1px solid rgba(255, 215, 0, 0.2);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.1);
            position: relative;
            overflow: hidden;
        }
        
        /* Светящаяся полоска сверху */
        .xp-bar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 10%;
            width: 80%;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,215,0,0.5), transparent);
        }
        
        /* Уровень — золотая кнопка */
        .xp-level {
            background: linear-gradient(135deg, #FFD700, #FFA500);
            color: #1a1a2e;
            padding: 6px 14px;
            border-radius: 30px;
            font-weight: 800;
            font-size: 0.8rem;
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
            white-space: nowrap;
            flex-shrink: 0;
            position: relative;
            z-index: 1;
        }
        
        /* Прогресс-бар */
        .xp-progress {
            flex: 1;
            height: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 100px;
            overflow: hidden;
            position: relative;
            z-index: 1;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .xp-fill {
            width: 35%;
            height: 100%;
            background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
            background-size: 200% 100%;
            border-radius: 100px;
            animation: xpFillShine 2s ease-in-out infinite;
            transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }
        
        /* Блик на баре */
        .xp-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 30px;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
            animation: xpFillGlare 2s ease-in-out infinite;
        }
        
        @keyframes xpFillShine {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }
        
        @keyframes xpFillGlare {
            0% { left: -30px; }
            100% { left: 110%; }
        }
        
        /* Текст XP */
        .xp-text {
            font-size: 0.75rem;
            color: #FFD700;
            font-weight: 700;
            white-space: nowrap;
            flex-shrink: 0;
            position: relative;
            z-index: 1;
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
        }
        
        /* Частицы вокруг бара */
        @keyframes xpParticle {
            0% { opacity: 0; transform: translateY(0) scale(0); }
            50% { opacity: 1; }
            100% { opacity: 0; transform: translateY(-30px) scale(1); }
        }
        
        /* Адаптация */
        @media (max-width: 400px) {
            .xp-bar {
                padding: 12px 14px;
                gap: 8px;
            }
            .xp-level {
                font-size: 0.7rem;
                padding: 5px 10px;
            }
            .xp-text {
                font-size: 0.7rem;
            }
        }
        
        /* Виджеты */
        .widget { background: #FFFFFF; border-radius: 20px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.02); }
        .widget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
        .widget-title { font-weight: 600; color: #8E8E93; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
        .prayer-times { display: flex; justify-content: space-around; }
        .prayer-item { text-align: center; }
        .prayer-name { font-size: 0.75rem; color: #8E8E93; }
        .prayer-time { font-size: 1rem; font-weight: 700; color: #1C1C1E; }
        
        /* Сетка иконок */
        .section-title { font-size: 1.2rem; font-weight: 700; color: #1C1C1E; margin: 20px 0 12px; }
        .icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
        .icon-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; cursor: pointer; border-radius: 16px; transition: all 0.15s; background: #FFFFFF; box-shadow: 0 2px 8px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.02); text-decoration: none; }
        .icon-item:active { background: #E5E5EA; transform: scale(0.96); }
        .icon-badge { position: relative; }
        .icon-emoji { font-size: 2.2rem; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #F2F2F7, #FFFFFF); border-radius: 16px; }
        .icon-label { font-size: 0.65rem; font-weight: 500; color: #1C1C1E; text-align: center; }
        .badge { position: absolute; top: -4px; right: -4px; background: #FF3B30; color: white; font-size: 0.6rem; font-weight: 700; padding: 2px 5px; border-radius: 30px; min-width: 18px; text-align: center; border: 2px solid white; }
        .badge.green { background: #34C759; }
        .badge.orange { background: #FF9500; }
        .badge.purple { background: #AF52DE; }
        
        /* Экраны модулей */
        .module-screen { display: none; padding: 16px; animation: fadeIn 0.2s ease; }
        .module-screen.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
        
        /* Карточки */
        .ios-card { background: #FFFFFF; border-radius: 20px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.02); }
        .ios-card-title { font-size: 1.1rem; font-weight: 600; color: #1C1C1E; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
        
        /* Кнопки */
        .ios-button { background: #007AFF; border: none; border-radius: 14px; padding: 14px 18px; color: white; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: opacity 0.15s; flex: 1; text-align: center; }
        .ios-button:active { opacity: 0.7; }
        .ios-button.secondary { background: #F2F2F7; color: #007AFF; }
        .ios-button.danger { background: #FF3B30; }
        .ios-button.success { background: #34C759; }
        .button-group { display: flex; gap: 8px; flex-wrap: wrap; }
        
        /* Tab Bar */
        .tab-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(0,0,0,0.05); padding: 8px 16px 24px; display: flex; justify-content: space-around; max-width: 430px; margin: 0 auto; z-index: 200; }
        .tab-item { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; background: none; border: none; padding: 6px 14px; border-radius: 10px; color: #8E8E93; transition: all 0.15s; }
        .tab-item.active { color: #007AFF; }
        .tab-item:active { background: rgba(0,122,255,0.1); }
        .tab-icon { font-size: 1.4rem; }
        .tab-label { font-size: 0.6rem; font-weight: 500; }
        
        /* Вкладки внутри модулей */
        .module-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
        .module-tab { padding: 8px 12px; border-radius: 30px; border: none; background: #F2F2F7; color: #1C1C1E; font-weight: 600; font-size: 0.75rem; cursor: pointer; transition: all 0.15s; }
        .module-tab.active { background: #007AFF; color: white; }
        
        /* ========== 🌈 РАДУЖНАЯ РАМКА ДЛЯ ОСОБЫХ КАРТОЧЕК ========== */
        .card-rainbow {
            position: relative;
            border-radius: 20px;
            z-index: 1;
            overflow: hidden;
            background: linear-gradient(145deg, #1a1a2e, #2d1f00);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .card-rainbow:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 30px rgba(255, 215, 0, 0.2);
        }
        .card-rainbow::before {
            content: '';
            position: absolute;
            top: -3px;
            left: -3px;
            right: -3px;
            bottom: -3px;
            background: linear-gradient(
                45deg,
                #ff0000, #ff7700, #ffff00, #00ff00,
                #0077ff, #7700ff, #ff0077, #ff0000
            );
            background-size: 400% 400%;
            border-radius: 23px;
            z-index: -2;
            animation: rainbowFlow 4s linear infinite;
            opacity: 0.8;
        }
        @keyframes rainbowFlow {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .card-rainbow::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            right: 3px;
            bottom: 3px;
            background: inherit;
            border-radius: 17px;
            z-index: -1;
        }
        
        /* ✨ Улучшенная версия — с золотыми искрами */
        @keyframes rainbowSpark {
            0%, 100% { opacity: 0; }
            50% { opacity: 1; }
        }
        .card-rainbow::after {
            box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.1);
        }
        
        /* Модальные окна */
        .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 10000; justify-content: center; align-items: flex-end; }
        .modal-content { background: #FFFFFF; border-radius: 24px 24px 0 0; max-width: 430px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 20px; margin: 0 auto; }
        .close-modal { float: right; background: #F2F2F7; width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.2rem; }
        
        /* ========== 🎆 САЛЮТ ========== */
        .firework-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 99999;
        }
        
        /* Частица салюта */
        @keyframes fireworkBurst {
            0% {
                transform: translate(0, 0) scale(1);
                opacity: 1;
            }
            100% {
                transform: translate(var(--tx), var(--ty)) scale(0);
                opacity: 0;
            }
        }
        .firework-particle {
            position: absolute;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            animation: fireworkBurst 1.5s ease-out forwards;
        }
        
        /* Текст достижения */
        .achievement-center-text {
            position: fixed;
            top: 40%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: linear-gradient(135deg, #1a1a2e, #2d1f00);
            border: 3px solid #FFD700;
            border-radius: 30px;
            padding: 16px 28px;
            color: #FFD700;
            font-weight: 800;
            font-size: 1.5rem;
            box-shadow: 
                0 0 40px rgba(255, 215, 0, 0.4),
                0 0 80px rgba(255, 165, 0, 0.2),
                0 0 120px rgba(255, 215, 0, 0.1);
            z-index: 100000;
            animation: achievementPop 3.5s ease-out forwards;
            white-space: nowrap;
            text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
            letter-spacing: 1px;
        }
        
        @keyframes achievementPop {
            0% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.2) rotate(-10deg);
            }
            10% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1.15) rotate(3deg);
            }
            20% {
                transform: translate(-50%, -50%) scale(0.95) rotate(-2deg);
            }
            25% {
                transform: translate(-50%, -50%) scale(1) rotate(0deg);
            }
            60% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
            100% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.8) translateY(-20px);
            }
        }
        
        /* Золотые кольца вокруг текста */
        @keyframes achievementRing {
            0% {
                transform: translate(-50%, -50%) scale(0.5);
                opacity: 0.8;
            }
            100% {
                transform: translate(-50%, -50%) scale(2);
                opacity: 0;
            }
        }
        .achievement-ring {
            position: fixed;
            top: 40%;
            left: 50%;
            width: 200px;
            height: 200px;
            border: 2px solid #FFD700;
            border-radius: 50%;
            pointer-events: none;
            z-index: 99999;
            animation: achievementRing 2s ease-out forwards;
        }
        
        /* Адаптация */
        @media (max-width: 400px) {
            .achievement-center-text {
                font-size: 1.2rem;
                padding: 12px 20px;
                border-radius: 20px;
            }
        }
        
        /* Адаптация для iPhone */
        @supports (padding-bottom: env(safe-area-inset-bottom)) { .tab-bar { padding-bottom: calc(16px + env(safe-area-inset-bottom)); } body { padding-bottom: env(safe-area-inset-bottom); } .nav-bar { padding-top: calc(12px + env(safe-area-inset-top)); } }
        
        /* Запрет зума */
        button, .icon-item, .tab-item, .ios-button { touch-action: manipulation; user-select: none; }
        
        /* Старые стили для совместимости */
        .card { background: rgba(255,252,240,0.96); border-radius: 24px; padding: 20px; margin-bottom: 20px; border: 1px solid #e6bc7e; }
        .juma-check-item { display: flex; align-items: center; gap: 15px; padding: 15px; background: #f5eddb; border-radius: 20px; margin-bottom: 12px; }
        .mystery-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); z-index: 100000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
        .mystery-overlay.active { opacity: 1; visibility: visible; }
        .mystery-cards { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; padding: 20px; }
        .mystery-card { width: 170px; height: 240px; background: linear-gradient(145deg, #1a1a2e, #16213e); border: 3px solid #d4af37; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; box-shadow: 0 10px 30px rgba(0,0,0,0.5); position: relative; }
        .mystery-card::before { content: "?"; font-size: 5rem; font-weight: bold; color: #d4af37; text-shadow: 0 0 20px #ffd700; }
        .collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 15px; }
        .collection-card { border-radius: 20px; padding: 18px 12px; cursor: pointer; transition: all 0.2s; text-align: center; backdrop-filter: blur(4px); position: relative; overflow: hidden; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .notification-banner { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #1a4a2a, #0d3b1f); border: 3px solid #d4af37; border-radius: 60px; padding: 15px 30px; color: #ffefc0; font-weight: bold; font-size: 1.1rem; box-shadow: 0 0 40px #d4af37; z-index: 99999; animation: slideDown 0.4s ease; cursor: pointer; }
        .story-modal-content { background: linear-gradient(135deg, #1a2a1a, #0d1a0d); border: 3px solid #d4af37; border-radius: 30px; padding: 25px; color: #ffefc0; max-width: 400px; text-align: center; }
        .story-modal-content h3 { color: #ffd700; margin-bottom: 15px; }

