* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-text-size-adjust: none;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
}

body {
    background: radial-gradient(circle at center, #090314 0%, #020104 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    letter-spacing: -0.4px;
}

.app-container {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    display: flex;
            flex-direction: column;
    padding: calc(env(safe-area-inset-top, 0px) + 55px) 16px 125px 16px;
    position: relative;
}

/* ЗАГРУЗОЧНЫЙ ЭКРАН */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at center, #090314 0%, #020104 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
#splash-screen.hidden { opacity: 0; visibility: hidden; }
.splash-content { text-align: center; }
.splash-logo { width: 240px; will-change: transform; animation: floatStone 0s ease-in-out infinite; filter: drop-shadow(0 0 50px rgba(168, 85, 247, 0.5)); }

.splash-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 24px;
    letter-spacing: 12px;
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 15px;
    color: #ffffff;
    opacity: 0.9;
}

.modern-loader { width: 160px; height: 3px; background: rgba(255, 255, 255, 0.02); margin: 30px auto; border-radius: 10px; overflow: hidden; }
.loader-bar { width: 50%; height: 100%; background: #c084fc; animation: loadingMove 1.5s infinite ease-in-out; }

/* КОНТЕНТНАЯ ЗОНА */
.content-viewport { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.app-page { display: none; flex-direction: column; height: 100%; justify-content: center; will-change: transform, opacity; }
.app-page.active { 
    display: flex; 
    justify-content: flex-start;
    box-sizing: border-box;
    animation: pageFadeIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes pageFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
.page-title-block { text-align: center; margin-bottom: 20px; }
.page-title-block h2 { font-family: 'Syncopate', sans-serif; font-size: 14px; letter-spacing: 5px; font-weight: 900; color: rgba(255, 255, 255, 0.6); }

/* Telegram Fullscreen Safe Area — page-specific top offsets */
#page-reactor .reactor-dashboard { margin-top: calc(env(safe-area-inset-top, 0px) + 90px) !important; }
#page-shop .page-title-block,
#page-tasks .page-title-block,
#page-profile .page-title-block { margin-top: 20px; }
#home-page-container { padding-top: 20px; }

/* МОНОЛИТ РЕАКТОРА */
.reactor-monolith {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 36px;
    padding: 28px 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
}

.page-profile-card { 
    background: rgba(255, 255, 255, 0.015); 
    border-color: rgba(255, 255, 255, 0.06); 
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* БАЛАНС И ИНВЕНТАРЬ (PILL STYLE) */
.reactor-dashboard { display: flex; width: 100%; justify-content: center; gap: 8px; z-index: 10; }
.balance-pill {
    background: rgba(255, 255, 255, 0.02);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0 22px;
    border-radius: 24px;
    font-weight: 800;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center; /* Центрируем цифры и звезду */
    gap: 2px; /* Аккуратный отступ по твоему ТЗ */
    width: 100px; /* Заменил жесткий width на min-width, чтобы звезда поместилась */
    height: 50px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.08), 0 4px 12px rgba(0,0,0,0.2);
}

.balance-star-icon { 
    width: 24px; /* Размер под высоту шрифта баланса */
    height: 24px; 
    object-fit: contain; 
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.3)); 
    display: block !important; /* Принудительно показываем звезду */
}

.btn-inventory { 
    background: rgba(255, 255, 255, 0.02); 
    border: 0.5px solid rgba(255, 255, 255, 0.08); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.8); 
    height: 50px; 
    width: 100px; 
    border-radius: 24px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.08), 0 4px 12px rgba(0,0,0,0.2); 
    transition: background 0.2s, transform 0.1s; 
}
.btn-inventory:active { transform: scale(0.96); background: rgba(255, 255, 255, 0.06); }

/* ЗОНА КОЛЕСА */
.reactor-space { position: relative; width: 310px; height: 310px; display: flex; align-items: center; justify-content: center; }
.pointer-arrow { position: absolute; top: -14px; font-size: 14px; color: #ff007a; z-index: 10; text-shadow: 0 0 12px #ff007a; }
.orbital-ring { position: absolute; width: 310px; height: 310px; border-radius: 50%; z-index: 2; }
#wheel-canvas { position: absolute; top: 0; left: 0; display: block; z-index: 1; transform: translateZ(0); will-change: transform; }

/* ОБНОВЛЕННЫЙ ВЕЛИЧЕСТВЕННЫЙ ОНИКС */
.core-nucleus.majestic-mode {
    position: relative;
    width: 100%;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    margin: 10px 0 5px 0;
}
.glow-underlayer { 
    position: absolute; 
    width: 170px; 
    height: 170px; 
    background: radial-gradient(circle, #6d28d9 0%, rgba(91, 28, 212, 0) 72%); 
    border-radius: 50%; 
    filter: blur(45px); 
    opacity: 0.75; 
}
.onyx-stone { 
    width: 210px; 
    height: auto; 
    z-index: 11; 
    animation: floatStone 4s ease-in-out infinite; will-change: transform; 
    filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 25px rgba(168, 85, 247, 0.25)); 
}

/* КНОПКА ЗАПУСТИТЬ */
.action-zone { width: 100%; z-index: 10; }
.btn-core-spin {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 22px; 
    color: #ffffff;
    width: 100%;
    padding: 16px 0;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1.5px;
    cursor: pointer;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.4), 
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}
.btn-core-spin:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.08); }

/* ==========================================================================
   🧪 ЭФФЕКТ ЖИДКОГО СТЕКЛА ДЛЯ ИНВЕНТАРЯ (GLASSMORPHISM С ПРЕЛОМЛЕНИЕМ)
   ========================================================================== */
.inventory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(2, 1, 4, 0.15); /* Делаем подложку прозрачной, чтобы видеть колесо */
    /* Эффект преломления и глубокого размытия всей задней полусферы */
    backdrop-filter: blur(8px) brightness(65%) contrast(110%);
    -webkit-backdrop-filter: blur(8px) brightness(65%) contrast(110%);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.inventory-modal.open { opacity: 1; visibility: visible; }

.inventory-modal-content {
    /* Абсолютное жидкое стекло как в нижнем меню */
    background: rgba(10, 5, 20, 0.45);
    backdrop-filter: blur(8px) contrast(130%) brightness(105%);
    -webkit-backdrop-filter: blur(8px) contrast(130%) brightness(105%);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px;
    width: calc(100% - 32px);
    max-width: 360px;
    padding: 26px 24px;
    position: relative;
    /* Объемные стеклянные блики и тени */
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 0.7), 
        inset 0 1.5px 2px rgba(255, 255, 255, 0.25),
        inset 0 -4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.inventory-modal.open .inventory-modal-content { transform: translateY(0) scale(1); }

.inventory-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.inventory-modal-header h3 { font-family: 'Syncopate', sans-serif; font-size: 13px; font-weight: 900; letter-spacing: 2px; color: #ffffff; }

.btn-close-modal { 
    background: rgba(255, 255, 255, 0.03); 
    border: 0.5px solid rgba(255, 255, 255, 0.08); 
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: rgba(255,255,255,0.5); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s; 
}
.btn-close-modal:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); transform: rotate(90deg); }
.inventory-empty-state { text-align: center; padding: 45px 0; color: rgba(255,255,255,0.35); font-size: 13px; font-weight: 600; line-height: 1.6; }

/* КАРТОЧКИ И МАРКЕТ */
.premium-card {
    transform: translateZ(0); border: 0.5px solid rgba(255, 255, 255, 0.06); border-radius: 36px; padding: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.dashboard-grid { display: flex; flex-direction: column; gap: 12px; }
.card-label { display: block; font-size: 11px; color: rgba(255,255,255,0.3); text-transform: uppercase; font-weight: 800; letter-spacing: 0.5px; }
.card-value { display: block; font-size: 22px; font-weight: 900; margin-top: 3px; }
.tasks-list { display: flex; flex-direction: column; gap: 10px; }
.task-card { background: rgba(255, 255, 255, 0.012); border: 0.5px solid rgba(255, 255, 255, 0.04); border-radius: 20px; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; }
.task-name { font-size: 14px; font-weight: 800; }
.task-reward { font-size: 12px; color: #00ffa6; font-weight: 900; text-shadow: 0 0 8px rgba(0,255,166,0.2); }
.btn-task-action {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 32px;
    font-size: 13px;
    font-weight: 800;
    transition: background 0.2s, transform 0.1s;
}
.btn-task-action:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.18);
}
#shop-container, #market-container, .shop-grid {
    height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    width: 100%;
    padding: 20px 0 120px 0;
}

.donate-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px) contrast(120%) brightness(110%);
    -webkit-backdrop-filter: blur(8px) contrast(120%) brightness(110%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 36px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 320px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5), 
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.donate-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.donate-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-donate {
    transform: translateZ(0);
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 32px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s, transform 0.1s, border-color 0.2s;
    width: 100%;
}

.btn-donate:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.2);
}

.donate-star-icon {
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.shop-item-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px) contrast(120%) brightness(110%);
    -webkit-backdrop-filter: blur(8px) contrast(120%) brightness(110%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 320px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5), 
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.shop-item-card:active {
    transform: scale(0.98);
}

.shop-item-emoji {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 15px rgba(192, 132, 252, 0.4));
}

.shop-item-name {
    font-family: 'Syncopate', sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.shop-item-desc {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
    line-height: 1.4;
}

.btn-shop-buy {
    transform: translateZ(0);
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 32px;
    padding: 12px 24px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.btn-shop-buy:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.18);
}

.shop-buy-star {
    width: 25px;
    height: 25px;
    object-fit: contain;
}
.profile-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.02); font-size: 14px; }
.profile-row:last-child { border-bottom: none; }
.highlight { color: #c084fc; font-weight: 700; }

/* ==========================================================================
   💎 АРХИТЕКТУРА ОСТРОВНОГО МЕНЮ
   ========================================================================== */
.nav-island-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 396px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 1000;
}

.nav-island-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #554e66;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    transition: color 0.3s, transform 0.2s;
    padding: 0;
}
.nav-island-circle.active {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.nav-island-circle.active .nav-svg { stroke: rgba(255, 255, 255, 0.9); }

.bottom-nav-capsule {
    position: relative;
    flex: 1;
    height: 68px;
    min-width: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 34px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 4px;                 /* равномерный зазор между пунктами */
    padding: 0 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.nav-indicator-lens {
    position: absolute;
    top: 5px;
    left: 6px;
    height: calc(100% - 10px);
    background: transparent;
    border: none;
    border-radius: 30px;
    z-index: 1;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.65),
        0 2px 5px rgba(0, 0, 0, 0.4),
        inset 0px 1.5px 1.5px 0px rgba(255, 255, 255, 0.45),
        inset 0px -4px 10px rgba(0, 0, 0, 0.3);
    transition: left 0.42s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                width 0.35s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.nav-item {
    transform: translateZ(0);
    /* Каждый пункт занимает РОВНО одну долю бара: flex:1 1 0 + min-width:0
       не дают длинной подписи («ЗАДАНИЯ») распирать соседей и липнуть к ним. */
    flex: 1 1 0;
    min-width: 0;
    padding: 0 2px;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    z-index: 2;
    transition: color 0.3s, transform 0.2s;
}
.nav-svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    transition: stroke 0.3s;
    stroke: rgba(255, 255, 255, 0.4);
}
/* Подпись: nowrap + ellipsis не дают тексту вылезти за свою колонку и
   «слипнуться» с соседней подписью в одну строку. */
.nav-text {
    flex: 0 0 auto;
    /* width:100% центрирует подпись ровно под иконкой, min-width:0 + ellipsis
       не дают длинному слову вылезти за свою колонку в соседнюю. */
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}

.nav-item.active { color: rgba(255, 255, 255, 0.9); }
.nav-item.active .nav-svg { stroke: rgba(255, 255, 255, 0.9); }

.nav-island-profile {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    padding: 0;
    transition: transform 0.2s, border-color 0.3s;
}
.nav-island-profile.active {
    border-color: #c084fc;
    box-shadow: 0 0 20px rgba(192, 132, 252, 0.3), 0 25px 50px rgba(0,0,0,0.8);
}
.avatar-frame {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.1);
    background: #110c1f;
    transition: border-color 0.3s;
}
.nav-island-profile.active .avatar-frame { border-color: #c084fc; }
.user-tg-avatar { width: 100%; height: 100%; object-fit: cover; }

.nav-island-circle:active, .nav-island-profile:active, .nav-item:active { transform: scale(0.93); }

@keyframes floatStone { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes loadingMove { 0% { transform: translateX(-150%); } 50% { transform: translateX(150%); } 100% { transform: translateX(-150%); } }

/* Precision Lens Elements */
.onyx-nav-button {
    position: relative;
    overflow: hidden; /* Ensure the lens is clipped to the border radius */
}
.onyx-active-banner {
    overflow: hidden;
}

.onyx-nav-button .onyx-lens-inner,
.onyx-active-banner .onyx-lens-inner {
    position: absolute;
    /* We make it slightly larger than the container so that distortion doesn't reveal transparent edges before clipping */
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.3), 0 10px 20px rgba(0,0,0,0.5);
    border-radius: inherit;
    z-index: 0;
}

.onyx-nav-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 4px;
    backdrop-filter: blur(px);
    -webkit-backdrop-filter: blur(px);
}
#page-reactor.premium-mode .reactor-monolith {
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    border-color: rgba(255, 215, 0, 0.3);
}
#page-reactor.premium-mode .btn-core-spin {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, rgba(0,0,0,0.2) 100%);
}
#page-reactor.premium-mode .page-title-block h2 {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.reactor-monolith {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#mode-switch-btn { 
    color: #ffd700; 
    transition: all 0.3s ease;
}
#page-reactor.premium-mode #mode-switch-btn {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

#premium-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: #000; z-index: 9999; display: flex;
    justify-content: center; align-items: center;
    transition: opacity 0.4s ease;
}
#premium-loader.hidden { opacity: 0; pointer-events: none; }
.premium-loader-content { text-align: center; }
.premium-loader-logo { width: 120px; filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5)); }
.premium-loader-title { font-family: 'Syncopate', sans-serif; color: #ffd700; margin-top: 20px; letter-spacing: 4px; }

/* Фикс центрирования */
.reactor-monolith { justify-content: flex-start !important; }

/* ПРЕМИУМ РЕЖИМ: Черный матовый и белый */
#page-reactor.premium-mode .reactor-monolith {
    background: #000000 !important;
    border: 1px solid #333333 !important;
}

#page-reactor.premium-mode .btn-core-spin {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   🧬 ROULETTE V2 OVERRIDES (ATMOSPHERIC SLIDER)
   (Безопасно переопределяет старые стили колеса, не ломая верстку)
   ========================================================================== */
.reactor-space.roulette-v2 {
    display: flex !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 200px !important;
    width: 100% !important;
    position: relative !important;
    justify-content: center !important;
    align-items: center !important;
    /* Убедитесь, что нет абсолютного позиционирования, скрывающего блок */
}

.roulette-mask {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    width: 100% !important;
    overflow: hidden !important;
    position: relative;
}
.roulette-track {
    display: flex;
    align-items: center;
    height: 100%;
    width: max-content;
    will-change: transform;
}
.roulette-item {
    width: 100px; /* Увеличенная сетка шага под масштаб призов */
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    
}
.roulette-item-inner {
    will-change: transform;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    will-change: transform;
}
.roulette-item-inner img {
    width: 76px; /* Картинки призов сделаны намного крупнее и дороже */
    height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6));
}
.roulette-item-emoji {
    font-size: 46px; /* Масштаб текстовых эмодзи-заглушек увеличен */
    text-shadow: 0 6px 14px rgba(0,0,0,0.6);
}
#page-reactor.premium-mode .reactor-space.roulette-v2 .pointer-arrow {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* --- 1. Новая шапка: Оникс по центру --- */
.reactor-dashboard {
    display: flex;
    justify-content: space-between; /* Распределяет элементы по краям */
    align-items: center;            /* Выравнивает всё по вертикали */
    width: 100%;
}

.balance-pill {
    order: 1; /* Баланс будет первым слева */
}

.splash-logo {
    order: 2; /* Оникс будет вторым (по центру) */
    left: 50%;
    transform: translateX(0%); /* Это принудительно центрирует логотип */
    margin-top: 10px
}

.btn-inventory {
    order: 3; /* Инвентарь будет третьим справа */
}

/* Скрываем лишнее */
.star-icon-class, .extra-header-icons {
    display: none !important;
}

/* Принудительно центрируем логотип через order */
.core-nucleus.majestic-mode {
    order: 2 !important;
    margin: 0 auto !important;
    width: auto !important;
}
.balance-pill { order: 1 !important; }
.btn-inventory { order: 3 !important; }

/* --- 1.5 Live Recent Wins Bar --- */
.live-wins-bar {
    width: 100%;
    max-width: 420px;
    margin: 6px auto 12px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 0.5px solid rgba(168, 85, 247, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06),
                0 2px 8px rgba(0, 0, 0, 0.2);
}

.live-wins-label {
    font-family: 'Syncopate', sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #fca5a8;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(252, 165, 168, 0.5);
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-wins-label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fca5a8;
    box-shadow: 0 0 6px rgba(252, 165, 168, 0.8);
    animation: pulse-win 1.5s infinite;
}

.live-wins-ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.live-wins-ticker-inner {
    display: flex;
    align-items: center;
    width: max-content;
    animation: scroll-wins 30s linear infinite;
}

.live-wins-item {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.win-emoji {
    font-size: 13px;
}

.win-stars {
    color: #fbbf24;
    text-shadow: 0 0 4px rgba(251, 191, 36, 0.6);
}

.live-wins-separator {
    color: rgba(168, 85, 247, 0.4);
    margin: 0 8px;
    flex-shrink: 0;
}

@keyframes scroll-wins {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes pulse-win {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* Mobile isolation — prevent overlap on small screens */
@media (max-width: 480px) {
    .live-wins-bar {
        max-width: 95vw;
        margin: 15px auto 10px;
        padding: 5px 12px;
    }

    .live-wins-label {
        font-size: 11px;
    }

    .live-wins-item {
        font-size: 11px;
    }

    .reactor-dashboard {
        margin-top: 50px !important;
    }

    #page-reactor.premium-mode .live-wins-bar {
        margin: 4px auto 10px;
    }
}

/* --- 2. Рулетка в геометрический центр и расширение --- */
.reactor-space.roulette-v2 {
    width: 100% !important; /* На всю ширину */
    max-width: 100% !important;
    height: 180px !important;
    background: transparent !important;
    margin: auto 0 !important; /* Центрируем вертикально */
    overflow: visible !important;
}

/* Укрупнение карточек */
.roulette-item {
    width: 180px !important;
    height: 180px !important;
}
.roulette-item-inner img {
    width: 120px !important;
    height: 120px !important;
}

/* --- 3. Очистка визуального шума --- */
.pointer-arrow {
    display: none !important; /* Скрываем треугольник */
}

.roulette-mask {
    mask-image: none !important;
    -webkit-mask-image: none !important;
    backdrop-filter: none !important;
}

.roulette-item {
    filter: none !important; /* Убираем блюр */
    opacity: 1 !important;
}

/* ==========================================================================
   🌌 LUXURY NEON BACKGROUND
   ========================================================================== */

/* Переопределяем базовый фон body на глубокий ониксовый */
body {
    background: #040108 !important; 
}

/* Контейнер фона, жестко зафиксированный на заднем плане */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Строго позади всех элементов игры */
    overflow: hidden;
    pointer-events: none; /* Чтобы фон не перехватывал клики */
}

/* Общие стили для неоновых сфер */
.neon-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px); /* Сильное размытие для эффекта свечения */
    will-change: transform, opacity;
}

/* Сфера 1: Глубокий фиолетовый */
.orb-1 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #6d28d9 0%, transparent 70%);
    top: -10%;
    left: -20%;
    animation: drift1 14s infinite alternate ease-in-out;
}

/* Сфера 2: Яркий пурпурный/малиновый (Neon Magenta) */
.orb-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #c026d3 0%, transparent 70%);
    bottom: -15%;
    right: -15%;
    opacity: 0.5;
    animation: drift2 19s infinite alternate ease-in-out;
}

/* Сфера 3: Акцентный неоново-синий/индиго */
.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
    top: 45%;
    left: 55%;
    opacity: 0.4;
    animation: drift3 16s infinite alternate ease-in-out;
}

/* --- Ключевые кадры для хаотичного «живого» движения и пульсации --- */

@keyframes drift1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    50% { transform: translate(15vw, 15vh) scale(1.3); opacity: 0.7; }
    100% { transform: translate(-10vw, 25vh) scale(0.9); opacity: 0.5; }
}

@keyframes drift2 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    50% { transform: translate(-25vw, -20vh) scale(1.4); opacity: 0.6; }
    100% { transform: translate(15vw, -30vh) scale(0.8); opacity: 0.3; }
}

@keyframes drift3 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(-15vw, 25vh) scale(0.8); opacity: 0.6; }
    100% { transform: translate(20vw, -15vh) scale(1.2); opacity: 0.4; }
}

/* ==========================================================================
   🔮 УНИВЕРСАЛЬНАЯ ПЛАШКА (MODAL WINDOW)
   ========================================================================== */
#modal-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 1, 4, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 6000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#modal-window.open {
    opacity: 1;
    visibility: visible;
}

.modal-window-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px) contrast(120%) brightness(110%);
    -webkit-backdrop-filter: blur(8px) contrast(120%) brightness(110%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    width: calc(100% - 32px);
    max-width: 340px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.6), 
        inset 0 1px 2px rgba(255, 255, 255, 0.25);
    transform: translateY(15px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-window.open .modal-window-content {
    transform: translateY(0) scale(1);
}

.modal-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 2.5px;
    color: #ffffff;
    margin-bottom: 16px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.modal-desc {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 24px;
}

.btn-modal-action {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 20px;
    width: 100%;
    padding: 14px 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-modal-action:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   👤 TELEGRAM PROFILE STYLE (#profile-container)
   ========================================================================== */
#profile-container {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.tg-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.tg-avatar-container {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tg-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.tg-fullname {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-username {
    font-size: 13px;
    font-weight: 600;
    color: #c084fc;
    margin: 0;
}

.tg-userid {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    font-family: monospace, system-ui;
}

/* Статистика: Премиальные карточки (Glassmorphism) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.stat-glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 26px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.stat-glass-card:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.06);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

.stat-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
}

/* Системные кнопки Telegram (Settings / Support) */
.tg-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.tg-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 36px;
    padding: 14px 16px;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, transform 0.1s, border-color 0.2s;
}

.tg-menu-item:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.tg-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    margin-right: 12px;
}

.tg-menu-text {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 700;
}

.tg-menu-arrow {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   🏠 ISOLATED HOME PAGE STYLES (#home-page-container)
   ========================================================================== */
#home-page-container {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    padding: 24px 20px 100px 20px;
    box-sizing: border-box;
    align-items: center;
    background: transparent !important;
    contain: layout;
    position: relative;
}

#home-page-container::-webkit-scrollbar {
    display: none;
}

#home-page-container .onyx-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(1.5px 1.5px at 10% 20%, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 30% 50%, #a855f7, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 70% 30%, #ec4899, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 80% 80%, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 90% 10%, #a855f7, rgba(0,0,0,0));
    background-size: 200px 200px;
    opacity: 0.6;
    animation: onyx-particle-drift 20s linear infinite;
    z-index: 0;
}

#home-page-container .onyx-main-title {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 1;
}

#home-page-container .onyx-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
    z-index: 1;
}

#home-page-container .onyx-card {
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.2, 1), filter 0.2s ease;
    contain: layout;
    border-radius: 32px;
}

#home-page-container .onyx-card:active {
    transform: scale(0.97);
    filter: brightness(130%);
}

#home-page-container .onyx-outer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.2);
}

#home-page-container .onyx-inner {
    position: absolute;
    top: -40px; left: -20px; right: -20px; bottom: -20px;
    backdrop-filter: blur(8px) brightness(65%) contrast(110%);
    -webkit-backdrop-filter: blur(8px) brightness(65%) contrast(110%);
    filter: url(#onyx-liquid-filter);
    z-index: 1;
}

@keyframes onyx-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

#home-page-container .onyx-breathe {
    animation: onyx-breathe 4s ease-in-out infinite;
}

#home-page-container .onyx-breathe:hover {
    animation-play-state: paused;
}

#home-page-container .onyx-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
    position: relative;
    padding: 0 24px;
    width: 100%;
}

#home-page-container .onyx-card-title {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#home-page-container .onyx-3d-asset {
    position: absolute;
    right: -80px;
    top: -25px;
    width: 220px;
    z-index: 3;
    filter: drop-shadow(-10px 10px 20px rgba(0, 0, 0, 0.5));
    animation: onyx-asset-float 4s ease-in-out infinite alternate;
}

@keyframes onyx-asset-float {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-8px) rotate(5deg); }
}

#home-page-container .onyx-dossier-content {
    gap: 8px;
}

#home-page-container .onyx-progress-container {
    width: 80%;
    max-width: 80px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

#home-page-container .onyx-progress-bar {
    width: 75%;
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.8);
    border-radius: 3px;
}
/* Particle Explosion Animation */
.particle-explosion {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 100;
}

.particle {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    animation: explode ease-out forwards;
    will-change: transform, opacity;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}

/* Win Modal Image Styling */
.onyx-win-image {
    max-width: 120px;
    height: auto;
    margin: 0 auto 15px auto;
    display: none;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}
.onyx-win-image.show {
    display: block;
}

/* Win Modal Impulse Animation */
/* Импульс картинки выигрыша. filter: drop-shadow в кадре — Repaint на iOS,
   поэтому свечение стало СТАТИЧНЫМ на ::after, а кадр крутит только scale+opacity. */
@keyframes onyx-impulse {
    0%   { transform: scale(1);   opacity: 1; }
    40%  { transform: scale(1.2); opacity: 1; }
    70%  { transform: scale(0.9); opacity: 0.85; }
    100% { transform: scale(1);   opacity: 1; }
}

/* Confetti Styles */
.confetti-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 101;
}

.confetti-particle {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    animation: confetti-burst 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    will-change: transform, opacity;
}

@keyframes confetti-burst {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--ctx)), calc(-50% + var(--cty))) scale(0.2);
        opacity: 0;
    }
}

/* STAR IMPULSE ANIMATIONS */
.star-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
}

.spin-star-icon {
    width: 25px;
    height: 25px;
    position: relative;
    z-index: 2;
    animation: star-breathe 1.5s ease-in-out infinite;
}

.star-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.9) 0%, rgba(255, 215, 0, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    animation: star-impulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes star-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes star-impulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3.5);
        opacity: 0;
    }
}

/* «Ripple»-пульс кнопки «КУПИТЬ STARS» (и ещё 4 места).
   Анимируем ТОЛЬКО transform + opacity: расходящееся кольцо ::after едет
   масштабом и гаснет, вместо анимации box-shadow (на iOS это Repaint). */
@keyframes pulse {
  0%   { transform: scale(1); }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.45; }
  70%  { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}
/* Статичная «тень-кольцо» для всех, кто раньше звал animation: pulse */
#buy-stars-btn, .pulse-ring-host { position: relative; isolation: isolate; }
#buy-stars-btn::after,
.pulse-ring-host::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4);
    opacity: 0.45;
    pointer-events: none;
    will-change: transform, opacity;
    animation: pulse-ring 2s infinite;
}

/* ==========================================================================
   ИНВЕНТАРЬ: CSS GRID 2 колонки (3 на широких экранах) + премиальные карточки
   ========================================================================== */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    /* Прокрутка длинного списка — без подрезания теней карточек */
    max-height: 52vh;
    overflow-y: auto;
    padding: 2px 4px 2px 2px;
    margin-bottom: 10px;
}

/* 3 колонки на планшетах/широких экранах (>480px) */
@media (min-width: 480px) {
    .inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Карточка предмета: колонка «иконка -> название -> кнопки» */
.inventory-card,
.inventory-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 180px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    min-width: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.inventory-card:hover,
.inventory-item-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(168, 85, 247, 0.35);
    transform: translateY(-2px);
}

/* Иконка предмета: ЖЁСТКО ограничена — не вылезает за карточку и не
   перекрывает кнопки (картинки NFT бывают 512x512 и более). */
.inventory-card .item-icon,
.inventory-card img,
.inventory-item-card .item-icon,
.inventory-item-asset {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 8px auto;
    flex-shrink: 0;
    filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.4));
}

/* Название предмета под иконкой (в одну строку с многоточием) */
.inventory-item-name {
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
    margin: 2px 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопки — СТРОГО снизу под картинкой и названием, прижаты к низу карточки */
.inventory-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-top: auto;
}

/* Компактные кнопки карточки (Продать / Подарить / legacy) */
.inventory-actions button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
    transition: transform 0.1s ease, filter 0.2s ease, background 0.2s ease;
}

.inventory-actions button:active { transform: scale(0.97); }

/* «💰 Продать за N ⭐» — акцентная фиолетовая */
.inventory-actions .btn-item-sell {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: none;
    color: #fff;
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.35);
}
.inventory-actions .btn-item-sell:disabled {
    opacity: 0.6;
    cursor: default;
}

/* «🎁 Подарить другу» — второстепенная стеклянная */
.inventory-actions .btn-item-gift {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

/* Legacy-кнопки demo-предметов (Обменять/Вывести) — тот же компактный стиль */
.inventory-actions .btn-item-ghost {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.placeholder-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    position: relative;
}

.placeholder-item::after {
    content: '!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.2);
    font-size: 24px;
    font-weight: 700;
}

/* Узкие экраны iPhone (375–390px): карточки компактнее, ничего не слипается */
@media (max-width: 390px) {
    .inventory-grid { gap: 10px; }
    .inventory-card,
    .inventory-item-card { padding: 10px; min-height: 172px; }
    .inventory-card .item-icon,
    .inventory-card img,
    .inventory-item-asset { max-width: 72px; max-height: 72px; }
    .inventory-item-name { font-size: 11px; margin-bottom: 8px; }
    .inventory-actions button { padding: 8px 10px; font-size: 12px; }
}

#home-page-container #img-inventory {
    right: -40px;
    top: -40px;
    width: 125px;
}

#home-page-container #img-roulette {
    right: -15px;
    top: -15px;
    width: 80px;
}
/* ==========================================
   ФИКС РАЗМЕРА И ПЛОТНОСТИ КАРТОЧЕК РУЛЕТКИ
   ========================================== */

/* 1. Делаем контейнер крупнее и сжимаем межэлементный отступ */
.track-item, 
.roulette-item, 
[class*="track-item"], 
[class*="roulette-item"] {
    min-width: 130px !important;
    width: 130px !important;
    height: 130px !important;
    padding: 0 !important;
    margin: 0 4px !important; /* Уменьшаем зазор, чтобы элементы стояли кучнее */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 2. Картинка растягивается на весь контейнер и визуально увеличивается */
.track-item img, 
.roulette-item img, 
[class*="track-item"] img, 
[class*="roulette-item"] img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    transform: scale(1.15) !important; /* Напрямую увеличивает сами иконки */
}
/* ==========================================
   НАСТРОЙКА РУЛЕТКИ (ОТСТУПЫ И ЗАТЕМНЕНИЕ)
   ========================================== */

/* 1. Контейнер всей рулетки: добавляем затемнение по краям */
.roulette-container, 
.roulette-track-wrapper,
[class*="roulette-container"] {
    position: relative !important;
    overflow: hidden !important;
    /* Плавный размытый градиент по левому и правому краю */
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%) !important;
}

/* 2. Карточки предметов: увеличиваем расстояние между ними */
.track-item, 
.roulette-item, 
[class*="track-item"], 
[class*="roulette-item"] {
    min-width: 140px !important;
    width: 140px !important;
    height: 140px !important;
    margin: 0 12px !important; /* Увеличили боковой зазор с 4px до 12px */
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 3. Картинки внутри */
.track-item img, 
.roulette-item img, 
[class*="track-item"] img, 
[class*="roulette-item"] img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    transform: scale(1.1) !important;
}
/* ==========================================================================
   🔥 DAILY STREAK (ЕЖЕДНЕВНАЯ СЕРИЯ): БЕЙДЖ ПОД LIVE-ТИКЕРОМ,
   КАРТОЧКА В ГЛАВНОМ МЕНЮ И МОДАЛКА С НАГРАДАМИ
   ========================================================================== */

/* --- 1. Бейдж «Дней серии» прямо под LIVE-тикером --- */
.streak-live-badge {
    width: fit-content;
    margin: 0 auto 12px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    background: rgba(24, 10, 6, 0.55);
    border: 0.5px solid rgba(255, 140, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffc38a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.15s ease, border-color 0.25s ease;
    animation: streak-badge-pulse 2.6s ease-in-out infinite;
}

.streak-live-badge:active { transform: scale(0.96); }

.streak-live-badge .fire-icon {
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 140, 0, 0.8));
    animation: streak-fire-flicker 1.2s ease-in-out infinite alternate;
}

/* Награда доступна — усиленное свечение + пульсирующая точка */
.streak-live-badge.can-claim {
    border-color: rgba(255, 170, 60, 0.85);
    animation: streak-badge-pulse-strong 1.8s ease-in-out infinite;
}

.streak-live-badge.can-claim::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff8c00;
    box-shadow: 0 0 8px #ff8c00;
    animation: pulse-win 1.2s infinite;
}

/* --- 2. Карточка «Ежедневная серия» в списке главного меню --- */
#home-page-container .menu-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 96px;
    padding: 18px 22px;
    border-radius: 32px;
    cursor: pointer;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px) brightness(80%) contrast(115%);
    -webkit-backdrop-filter: blur(8px) brightness(80%) contrast(115%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
    transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.2, 1),
                filter 0.2s ease, box-shadow 0.3s ease;
}

#home-page-container .menu-card:active {
    transform: scale(0.97);
    filter: brightness(130%);
}

#home-page-container .menu-card-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#home-page-container .menu-card-info h3 {
    font-family: 'Syncopate', sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

#home-page-container .menu-card-info p {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

#home-page-container .menu-card-icon {
    position: relative;
    z-index: 2;
    font-size: 34px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(255, 140, 0, 0.75));
    animation: streak-fire-flicker 1.4s ease-in-out infinite alternate;
}

/* Оранжевое свечение карточки серии (в тёмно-фиолетовой палитре Onyx) */
#home-page-container .streak-card {
    border-color: rgba(255, 140, 0, 0.28);
    background: linear-gradient(135deg,
                rgba(255, 140, 0, 0.10) 0%,
                rgba(168, 85, 247, 0.14) 60%,
                rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35),
                inset 0 1px 1px rgba(255, 255, 255, 0.18),
                0 0 14px rgba(255, 140, 0, 0.22);
}

/* --- 3. Модалка «Ежедневный бонус» (backdrop blur + жидкое стекло) --- */
.streak-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 1, 4, 0.5);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    z-index: 6500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.streak-modal.open { opacity: 1; visibility: visible; }

.streak-modal-content {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 26px 20px 22px;
    border-radius: 32px;
    overflow: hidden;
    background: rgba(14, 6, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px) contrast(125%) brightness(105%);
    -webkit-backdrop-filter: blur(16px) contrast(125%) brightness(105%);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7),
                inset 0 1px 2px rgba(255, 255, 255, 0.22),
                0 0 28px rgba(255, 140, 0, 0.14);
    transform: translateY(18px) scale(0.94);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-modal.open .streak-modal-content { transform: translateY(0) scale(1); }

.streak-modal-glow {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 180px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.32) 0%, rgba(255, 140, 0, 0) 70%);
}

.streak-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

.streak-header {
    position: relative;
    text-align: center;
    margin-bottom: 16px;
}

.streak-fire-big {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 14px rgba(255, 140, 0, 0.8));
    animation: streak-fire-flicker 1.3s ease-in-out infinite alternate;
}

.streak-modal-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0 0 6px;
    text-shadow: 0 0 12px rgba(255, 140, 0, 0.35);
}

.streak-modal-sub {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

/* --- 4. Сетка 7 дней (текущий день подсвечен, полученные — с галочкой) --- */
.streak-days-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0 2px;
}

.streak-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 62px;
    padding: 10px 4px 9px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease, border-color 0.3s ease,
                box-shadow 0.3s ease, transform 0.3s ease;
}

/* День 7+ (максимальная награда) занимает две колонки */
.streak-day-final { grid-column: span 2; }

.streak-day-label {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.streak-day-reward {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12.5px;
    font-weight: 900;
    color: #ffffff;
}

.streak-day-star { font-size: 9.5px; opacity: 0.9; }

.streak-day-check {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    font-weight: 900;
    color: #00ffa6;
    text-shadow: 0 0 8px rgba(0, 255, 166, 0.7);
}

.streak-day.claimed {
    background: rgba(0, 255, 166, 0.08);
    border-color: rgba(0, 255, 166, 0.28);
}

.streak-day.claimed .streak-day-label { color: rgba(160, 255, 205, 0.7); }
.streak-day.claimed .streak-day-reward { color: rgba(190, 255, 220, 0.85); }

.streak-day.current {
    background: linear-gradient(160deg, rgba(255, 140, 0, 0.24), rgba(168, 85, 247, 0.20));
    border-color: rgba(255, 170, 60, 0.7);
    animation: streak-current-pulse 2s ease-in-out infinite;
}

.streak-day.current .streak-day-label { color: rgba(255, 214, 160, 0.85); }

.streak-day.current .streak-day-reward {
    color: #ffd7a1;
    text-shadow: 0 0 10px rgba(255, 160, 0, 0.6);
}

/* --- 5. Текст серии и большая кнопка получения награды --- */
.streak-progress {
    margin-top: 14px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.5);
}

.btn-claim-streak {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 15px 0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #1c0d00;
    background: linear-gradient(135deg, #ffc46b 0%, #ff8c00 55%, #ff4d00 100%);
    box-shadow: 0 10px 26px rgba(255, 120, 0, 0.35),
                inset 0 1px 1px rgba(255, 255, 255, 0.55);
    animation: streak-btn-glow 2.4s ease-in-out infinite;
    transition: transform 0.1s ease, filter 0.2s ease, background 0.3s ease;
}

.btn-claim-streak:active { transform: scale(0.97); filter: brightness(115%); }

/* Награда уже забрана сегодня — кнопка неактивна */
.btn-claim-streak:disabled,
.btn-claim-streak.claimed {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.42);
    box-shadow: none;
    animation: none;
    cursor: default;
    filter: none;
}

/* --- 6. Праздничный тост после получения награды --- */
.streak-toast {
    position: fixed;
    left: 50%;
    bottom: 128px;
    z-index: 7000;
    max-width: 90vw;
    padding: 11px 20px;
    border-radius: 18px;
    background: rgba(20, 8, 32, 0.88);
    border: 1px solid rgba(255, 140, 0, 0.4);
    color: #ffe0b8;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 18px rgba(255, 140, 0, 0.3),
                0 12px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 18px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.streak-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* --- 7. Анимации серии --- */
@keyframes streak-fire-flicker {
    0%   { transform: scale(1) rotate(-2deg); }
    100% { transform: scale(1.12) rotate(3deg); }
}

/* --- 8. Мобильная адаптация --- */
@media (max-width: 480px) {
    .streak-live-badge {
        margin-bottom: 10px;
        font-size: 11px;
        padding: 5px 12px;
    }

    .streak-modal-content { padding: 24px 16px 20px; }

    #home-page-container .menu-card {
        min-height: 88px;
        padding: 16px 18px;
    }

    #home-page-container .menu-card-info h3 { font-size: 14px; }
}

/* ============================================
   🤝 РЕФЕРАЛЬНАЯ ПРОГРАММА (REFERRALS)
   ============================================ */

/* Меню-карточка на главной */
#home-page-container .referral-card .menu-card-icon {
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.45));
}

/* Экран Referrals */
.referral-screen {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 16px 40px;
    max-width: 480px;
    margin: 0 auto;
}

/* --- Hero: статистика --- */
.referral-hero {
    position: relative;
    overflow: hidden;
    background: rgba(25, 20, 40, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    padding: 22px 20px;
    text-align: center;
}

.referral-hero-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 160px;
    background: radial-gradient(ellipse, rgba(168, 85, 247, 0.35), transparent 70%);
    pointer-events: none;
}

.referral-hero-icon {
    font-size: 38px;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 14px rgba(168, 85, 247, 0.6));
}

.referral-hero-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
}

.referral-hero-sub {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.55);
}

.referral-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 16px;
}

.referral-hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.referral-hero-value {
    font-size: 26px;
    font-weight: 900;
    color: #a855f7;
    text-shadow: 0 0 16px rgba(168, 85, 247, 0.55);
    font-variant-numeric: tabular-nums;
}

.referral-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

.referral-hero-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
}

/* --- Карточка ссылки --- */
.referral-link-card {
    background: rgba(25, 20, 40, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-link-label {
    font-size: 10.5px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
}

.referral-invite-row {
    display: flex;
    gap: 8px;
}

.referral-link-input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 12px;
    color: #e9d5ff;
    font-size: 12px;
    padding: 11px 12px;
    text-overflow: ellipsis;
    outline: none;
    font-family: inherit;
}

.referral-link-input:focus {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.btn-copy-link {
    flex-shrink: 0;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    color: #d8b4fe;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 0 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-copy-link:active {
    transform: scale(0.95);
    background: rgba(168, 85, 247, 0.35);
}

.btn-share-link {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 14px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-share-link:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

/* --- Milestone --- */
.referral-milestone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 14px 16px;
}

.referral-milestone.ready {
    border-color: rgba(0, 255, 166, 0.45);
    box-shadow: 0 0 14px rgba(0, 255, 166, 0.15);
}

.referral-milestone-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.referral-milestone-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.referral-milestone-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.btn-milestone-claim {
    flex-shrink: 0;
    background: rgba(0, 255, 166, 0.15);
    border: 1px solid rgba(0, 255, 166, 0.5);
    border-radius: 12px;
    color: #00ffa6;
    font-size: 12px;
    font-weight: 800;
    padding: 9px 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

/* --- Список друзей --- */
.referral-friends-block {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px;
}

.referral-friends-title {
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ref-friends-badge {
    background: rgba(168, 85, 247, 0.25);
    border-radius: 10px;
    color: #d8b4fe;
    font-size: 11px;
    padding: 2px 9px;
}

.referral-friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.referral-friend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 10px 12px;
}

.referral-friend-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #581c87, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.referral-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.referral-friend-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.referral-friend-date {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.4);
}

.referral-friend-profit {
    flex-shrink: 0;
    text-align: right;
    font-size: 12.5px;
    font-weight: 800;
    color: #00ffa6;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 8px rgba(0, 255, 166, 0.4);
}

.referral-empty {
    text-align: center;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 18px 10px;
    line-height: 1.6;
}

/* Мобильная адаптация */
@media (max-width: 380px) {
    .referral-screen { padding: 0 12px 32px; }
    .referral-hero { padding: 18px 14px; }
    .referral-hero-value { font-size: 22px; }
    .referral-invite-row { flex-direction: column; }
    .btn-copy-link { padding: 11px 14px; }
}

.btn-milestone-claim:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-milestone-claim:not(:disabled):active {
    transform: scale(0.95);
    background: rgba(0, 255, 166, 0.3);
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ: светящиеся карточки +
   glassmorphic кнопка «назад» (спецификация)
   ============================================ */

/* Главная меню-карточка «Пригласи друзей» — пурпурный стеклянный фон */
#home-page-container .referral-card,
.menu-card.referral-card {
    background: rgba(25, 20, 40, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Суб-LIVE fire badge уже стилизован выше; плотность для referral-card иконки */
.referral-card .menu-card-icon {
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.45));
}

/* Кнопка «назад» на экране рефералов — прозрачный «стеклянный» стиль.
   Никакого сплошного белого фона: только полупрозрачный rgba + blur.
   appearance: none убирает дефолтную (в ряде WebView — белую) отрисовку
   системной <button>. */
.referral-back-btn {
    margin: 6px auto 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

.referral-back-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
}

.referral-back-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.14);
}

/* ============================================================
   👑 ADMIN PANEL (модалка админки; кнопка видна только админу)
   Цвета берём из CSS-переменных Telegram с фолбэком на палитру Onyx:
   если тема не передана (браузер/старый клиент), используется
   тёмная неоновая схема проекта.
   ============================================================ */

.tg-menu-item-admin {
    border-color: rgba(168, 85, 247, 0.35);
}

.admin-crown-icon {
    font-size: 20px;
    line-height: 1;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.admin-modal-content {
    width: 100%;
    max-width: 460px;
    max-height: 86vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 18px;
    border-radius: 20px;
    color: var(--tg-theme-text-color, #ffffff);
    background: var(--tg-theme-bg-color, rgba(25, 20, 40, 0.96));
    border: 1px solid rgba(168, 85, 247, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.admin-modal-header h3 {
    margin: 0;
    font-family: 'Syncopate', sans-serif;
    font-size: 15px;
    letter-spacing: 1.5px;
    color: var(--tg-theme-text-color, #ffffff);
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;  /* 4 вкладки: на узких экранах переносим на новую строку */
    gap: 6px;
    margin-bottom: 14px;
}

.admin-tab {
    flex: 1;
    padding: 9px 6px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--tg-theme-hint-color, rgba(255, 255, 255, 0.6));
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.admin-tab.active {
    color: var(--tg-theme-button-text-color, #ffffff);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.85), rgba(99, 102, 241, 0.85));
    border-color: rgba(168, 85, 247, 0.9);
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.admin-stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-stat-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--tg-theme-hint-color, rgba(255, 255, 255, 0.55));
}

.admin-stat-value {
    font-size: 18px;
    font-weight: 900;
    color: #a855f7;
    font-variant-numeric: tabular-nums;
}

.admin-hint {
    margin: 8px 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--tg-theme-hint-color, rgba(255, 255, 255, 0.55));
}

.admin-hint.is-error { color: #ff6b81; }
.admin-hint.is-success { color: #00ffa6; }

.admin-btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.2s, transform 0.1s;
}

.admin-btn:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.16); }
.admin-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.admin-btn-primary {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border-color: rgba(168, 85, 247, 0.8);
}

.admin-chances-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-chance-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-chance-row.is-disabled { opacity: 0.45; }

.admin-chance-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-chance-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--tg-theme-text-color, #ffffff);
}

.admin-chance-percent {
    font-size: 10.5px;
    font-weight: 700;
    color: #00ffa6;
    font-variant-numeric: tabular-nums;
}

.admin-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 13px;
    color: var(--tg-theme-text-color, #ffffff);
    background: var(--tg-theme-secondary-bg-color, rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    outline: none;
}

.admin-input:focus {
    border-color: rgba(168, 85, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.admin-weight-input {
    width: 74px;
    margin-bottom: 0;
    text-align: center;
}

.admin-save-btn {
    width: auto;
    margin-top: 0;
    padding: 9px 12px;
    font-size: 11px;
}

.admin-field-label {
    display: block;
    margin: 0 0 6px 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--tg-theme-hint-color, rgba(255, 255, 255, 0.5));
}

@media (max-width: 380px) {
    .admin-stats-grid { grid-template-columns: 1fr; }
}


/* --- Вкладка «👥 Игроки»: поиск, таблица, пагинация --- */

.admin-users-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.admin-users-head .admin-hint {
    flex: 1;
    margin: 0;
}

.admin-users-refresh {
    width: auto;
    margin: 0;
    padding: 8px 12px;
}

.admin-users-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 11px;
}

.admin-users-table th {
    padding: 6px 4px;
    text-align: left;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--tg-theme-hint-color, rgba(255, 255, 255, 0.55));
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Фиксированные доли колонок: ID / Username / Баланс / Действие */
.admin-users-table th:nth-child(1) { width: 31%; }
.admin-users-table th:nth-child(2) { width: 25%; }
.admin-users-table th:nth-child(3) { width: 23%; }
.admin-users-table th:nth-child(4) { width: 21%; }

.admin-users-table td {
    padding: 8px 4px;
    color: var(--tg-theme-text-color, #ffffff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-row:hover { background: rgba(255, 255, 255, 0.04); }

.admin-user-id {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.admin-user-name { color: var(--tg-theme-hint-color, rgba(255, 255, 255, 0.65)); }

.admin-user-balance {
    color: #00ffa6;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.admin-users-empty {
    padding: 14px 6px;
    text-align: center;
    color: var(--tg-theme-hint-color, rgba(255, 255, 255, 0.55));
}

.admin-users-empty.is-error { color: #ff6b81; }

.admin-grant-row-btn {
    width: auto;
    margin: 0;
    padding: 6px 8px;
    font-size: 10px;
    border-radius: 10px;
}

.admin-users-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.admin-users-pager .admin-btn {
    width: auto;
    margin: 0;
    padding: 8px 12px;
}

.admin-users-pager .admin-hint {
    margin: 0;
    font-weight: 700;
}

@media (max-width: 380px) {
    .admin-users-table { font-size: 10px; }
    .admin-grant-row-btn { padding: 5px 6px; }
    .admin-user-name { max-width: 60px; }
}

/* ==========================================================================
   ПОДАРИТЬ ПРЕДМЕТ (gift-модалка): премиальная раскладка без слипшихся отступов.
   База — .streak-modal (стекло/анимация), раскладка — flex-колонка с gap 14px,
   чтобы заголовок, поля и кнопка никогда не «слипались» на iPhone (375–390px).
   ========================================================================== */
.streak-modal-content.transfer-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

/* Заголовок + иконка подарка сверху, аккуратный отступ снизу */
.transfer-modal .streak-header {
    margin-bottom: 8px;
}
.transfer-modal .streak-fire-big {
    animation: none;               /* без мерцания в рабочем окне */
    margin-bottom: 8px;
}
.transfer-modal .streak-modal-title {
    margin-bottom: 8px;
}

/* Описание: читаемое, спокойное */
.transfer-modal .streak-modal-sub {
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.8;
    margin-bottom: 6px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

/* Селект друга и инпут Telegram ID — единый премиальный стиль */
.gift-field {
    width: 100%;
    box-sizing: border-box;
    margin: 0;                     /* отступы делает gap контейнера */
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 14px;
    outline: none;
    color: #fff;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gift-field:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

/* Стрелка у select (иконка шеврона) — после -webkit-appearance: none она пропала */
.transfer-modal select.gift-field {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.gift-field option {
    background: #14101f;
    color: #fff;
}

.gift-field::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* Убираем стрелки number-инпута в Telegram WebView */
.gift-field[type="number"]::-webkit-outer-spin-button,
.gift-field[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.gift-field[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Статочная строка (ошибка/успех под полями) */
.gift-result {
    min-height: 18px;
    margin: 0;                     /* отступы — за gap контейнера */
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    color: #ff6b81;
}

.gift-result.ok {
    color: #00ffa6;
}

.gift-result:empty {
    display: none;
}

/* Кнопка «🎁 ПОДАРИТЬ» — крупная, акцентная, на всю ширину */
.transfer-modal #gift-submit-btn {
    width: 100%;
    padding: 14px;
    margin-top: 6px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: none;
    color: #fff;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 22px rgba(168, 85, 247, 0.35);
}

.transfer-modal #gift-submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

/* Узкие экраны iPhone (375–390px): модалка компактнее, ничего не слипается */
@media (max-width: 390px) {
    .streak-modal-content.transfer-modal { padding: 18px 16px; gap: 12px; }
    .transfer-modal .streak-modal-sub { font-size: 12.5px; }
    .gift-field { padding: 11px 12px; font-size: 13.5px; }
    .transfer-modal #gift-submit-btn { padding: 13px; font-size: 14px; }
}

/* ==========================================================================
   🫳 HAPTIC / PRESS FEEDBACK — физика нажатия (Spring / Bounce) для кнопок,
   нижнего меню (Bottom Nav), карточек и всех кликабельных элементов.
   Пружина = быстрый вход (transition 0.08s ease-out в :active) + упругий
   возврат: cubic-bezier(0.34, 1.56, 0.64, 1) выходит за 1 и «догоняет» форму.
   .card-item / .quest-card — имена из ТЗ; в этом проекте им соответствуют
   .inventory-card / .task-card (квесты) / .shop-item-card, поэтому перечислены
   оба набора. Цвета, тени, размеры и раскладка НЕ меняются: там, где у элемента
   уже были свои transition-свойства (цвет / фон / бордер), они сохранены ниже.
   Тактильная часть — main.js: triggerHaptic().
   ========================================================================== */
.btn,
button,
.card,
.card-item,
.onyx-card,
.menu-card,
.quest-card,
.task-card,
.nav-item,
.nav-island-circle,
.nav-island-profile,
.stat-glass-card,
.tg-menu-item,
.shop-item-card,
.inventory-card,
.inventory-item-card,
.streak-live-badge,
.admin-tab,
.admin-btn,
.admin-save-btn,
.admin-grant-row-btn,
#buy-stars-btn {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
    will-change: transform;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Прежние transition-свойства элементов + пружинный transform/opacity */
.nav-item { transition: color 0.3s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.nav-island-circle { transition: color 0.3s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.nav-island-profile { transition: border-color 0.3s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-inventory { transition: background 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-core-spin { transition: background 0.3s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-close-modal { transition: color 0.2s, background 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-task-action { transition: background 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-donate { transition: background 0.2s, border-color 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-shop-buy { transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-modal-action { transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.shop-item-card { transition: border-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.stat-glass-card { transition: background-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.tg-menu-item { transition: background 0.2s, border-color 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.inventory-card,
.inventory-item-card { transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.inventory-actions button { transition: filter 0.2s ease, background 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.streak-live-badge { transition: border-color 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.admin-tab { transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.admin-btn { transition: background 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-claim-streak { transition: filter 0.2s ease, background 0.3s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-copy-link { transition: background 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-share-link { transition: box-shadow 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }
.btn-milestone-claim { transition: background 0.2s, opacity 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.referral-back-btn { transition: background 0.2s, border-color 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease; }

/* Само нажатие: единый scale(0.96) на все кнопки / меню / карточки */
.btn:active,
button:active,
.card:active,
.onyx-card:active,
.menu-card:active,
.nav-item:active,
.nav-island-circle:active,
.nav-island-profile:active,
.stat-glass-card:active,
.tg-menu-item:active,
.shop-item-card:active,
.inventory-card:active,
.inventory-item-card:active,
.streak-live-badge:active,
.btn-inventory:active,
.btn-core-spin:active,
.btn-close-modal:active,
.btn-task-action:active,
.btn-donate:active,
.btn-shop-buy:active,
.btn-modal-action:active,
.btn-claim-streak:active,
.btn-copy-link:active,
.btn-share-link:active,
.btn-milestone-claim:not(:disabled):active,
.referral-back-btn:active,
.inventory-actions button:active,
.admin-tab:active,
.admin-btn:active {
    transform: scale(0.93);
    /* Вход в нажатие быстрый: пружина отрабатывает при отпускании. */
    transition: transform 0.08s ease-out;
}

/* Карточки главного экрана «дышат» (@keyframes onyx-breathe анимирует
   transform) — без отключения анимации нажатие было бы не видно, поэтому на
   время тапа дыхание снимаем (как это делает существующее правило :hover). */
#home-page-container .onyx-card:active,
#home-page-container .menu-card:active {
    transform: scale(0.93);
    transition: transform 0.08s ease-out;
}
#home-page-container .onyx-card:active {
    animation: none;
}

/* «КУПИТЬ STARS» пульсирует инлайновой @keyframes pulse (index.html), которая
   тоже анимирует transform и перебивала бы :active — глушим её на время тапа. */
#buy-stars-btn:active {
    transform: scale(0.93);
    transition: transform 0.08s ease-out;
    animation: none !important;
}

/* ==========================================================================
   🎞️ PAGE TRANSITIONS — плавное переключение экранов (Bottom Nav / switchScreen).
   Класс .page-view добавлен к каждому .app-page в index.html. Показывает
   страницу по-прежнему .active (display: flex — как в .app-page.active, иначе
   flex-раскладка страниц поехала бы), а «всплытие снизу вверх» делает уже
   существующая анимация pageFadeIn на .app-page.active (она перезапускается
   при display: none -> flex). Этот transition нужен для ухода старой страницы:
   main.js (navigateTo) вешает ей .page-leaving, держит её отрисованной
   100-150 мс и только потом включает .active у новой.
   ========================================================================== */
.page-view {
    display: none;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.25s cubic-bezier(0.2, 0, 0, 1),
                transform 0.25s cubic-bezier(0.2, 0, 0, 1);
    pointer-events: none;
}

.page-view.active {
    display: flex;
    opacity: 1;
    /* translateY(0) scale(1) из ТЗ — это единичный transform, записываем его
       как none: активная (постоянно видимая) страница не создаёт лишний
       containing block / backdrop root и не ломает backdrop-filter
       стеклянных карточек. Результат визуально тот же. */
    transform: none;
    pointer-events: auto;
}

/* Уходящая страница: остаётся отрисованной, пока гаснет (display:none не дал бы
   transition отработать) и уезжает вверх, чтобы новая всплыла снизу.
   justify-content/box-sizing повторяют .app-page.active — иначе при угасании
   контент прыгнул бы в вертикальный центр (.app-page по умолчанию center).
   Быстрее, чем 0.25s, — чтобы затухание успело завершиться за паузу 130 мс. */
.page-view.page-leaving {
    display: flex;
    justify-content: flex-start;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.12s ease-out, transform 0.12s ease-out;
}

/* ==========================================================================
   🃏 STAGGER — каскадное появление карточек при переключении на страницу
   (инвентарь / квесты / товары маркета). .quest-card и .card-item — имена из
   ТЗ; в этом проекте это .task-card (квесты), .shop-item-card (маркет) и
   .inventory-card (инвентарь), поэтому перечислены оба набора.
   fill-mode — backwards, а не forwards: по завершении анимация отпускает
   transform/opacity, иначе она перебивала бы пружинное :active карточек.
   ========================================================================== */
.page-view.active :is(.card-item, .inventory-card, .task-card, .quest-card, .shop-item-card) {
    animation: fadeUp 0.3s cubic-bezier(0.2, 0, 0, 1) backwards;
}

.page-view.active :is(.card-item, .inventory-card, .task-card, .quest-card, .shop-item-card):nth-child(1) { animation-delay: 0.05s; }
.page-view.active :is(.card-item, .inventory-card, .task-card, .quest-card, .shop-item-card):nth-child(2) { animation-delay: 0.08s; }
.page-view.active :is(.card-item, .inventory-card, .task-card, .quest-card, .shop-item-card):nth-child(3) { animation-delay: 0.11s; }
.page-view.active :is(.card-item, .inventory-card, .task-card, .quest-card, .shop-item-card):nth-child(4) { animation-delay: 0.14s; }
.page-view.active :is(.card-item, .inventory-card, .task-card, .quest-card, .shop-item-card):nth-child(5) { animation-delay: 0.17s; }
.page-view.active :is(.card-item, .inventory-card, .task-card, .quest-card, .shop-item-card):nth-child(6) { animation-delay: 0.20s; }

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

/* Инвентарь — модалка, а не .page-view: тот же каскад по классу .stagger-in,
   который openInventory() (main.js) переставляет при каждом открытии. */
.inventory-modal.open.stagger-in .inventory-card {
    animation: fadeUp 0.3s cubic-bezier(0.2, 0, 0, 1) backwards;
}
.inventory-modal.open.stagger-in .inventory-card:nth-child(1) { animation-delay: 0.05s; }
.inventory-modal.open.stagger-in .inventory-card:nth-child(2) { animation-delay: 0.08s; }
.inventory-modal.open.stagger-in .inventory-card:nth-child(3) { animation-delay: 0.11s; }
.inventory-modal.open.stagger-in .inventory-card:nth-child(4) { animation-delay: 0.14s; }
.inventory-modal.open.stagger-in .inventory-card:nth-child(5) { animation-delay: 0.17s; }
.inventory-modal.open.stagger-in .inventory-card:nth-child(6) { animation-delay: 0.20s; }



/* ==========================================================================
   🎁 ПОДАРОЧНЫЕ КОРОБКИ (Mines 5x5)
   Экран повторяет «стеклянный» язык проекта: тёмные панели со свечением,
   кнопка старта — фиолетовая (действие), кнопка «ЗАБРАТЬ» — крупная зелёная
   (класс .mines-cashout, вешает main.js). Ячейки — 3D-flip карточки:
   .flipped переворачивает .mines-cell-inner на 180° (backface-visibility),
   .revealed-gift подсвечивает подарок зелёным, .revealed-mine — красным.
   .mines-grid.mines-lost красит всё поле в тёмно-красный (мина найдена).
   ========================================================================== */

#page-mines .page-title-block { margin-top: 20px; }

.mines-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 0 14px 30px;
}

/* --- Верхняя панель: ставка + количество мин ------------------------------ */
.mines-controls {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(30, 30, 46, 0.85), rgba(16, 16, 28, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

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

.mines-label {
    min-width: 62px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.mines-bet-input {
    flex: 1;
    min-width: 0;
    padding: 11px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: Syncopate, sans-serif;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: border-color 0.25s;
}
.mines-bet-input:focus { border-color: rgba(168, 85, 247, 0.65); }
.mines-bet-input:disabled { opacity: 0.45; }

.mines-quick-btn {
    padding: 10px 11px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s, background 0.2s;
}
.mines-quick-btn:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.12); }
.mines-quick-btn:disabled { opacity: 0.45; cursor: default; }

.mines-mines-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-family: Syncopate, sans-serif;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.mines-mines-btn.active {
    border-color: rgba(168, 85, 247, 0.7);
    background: rgba(168, 85, 247, 0.18);
    color: #fff;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.35);
}
.mines-mines-btn:disabled { opacity: 0.45; cursor: default; }

/* --- Множитель и выигрыш ------------------------------------------------- */
.mines-stats { display: flex; gap: 10px; width: 100%; max-width: 420px; }

.mines-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mines-stat-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.mines-stat-value {
    font-family: Syncopate, sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

#mines-multiplier { color: #c084fc; text-shadow: 0 0 16px rgba(168, 85, 247, 0.4); }
#mines-win { color: #ffd45e; text-shadow: 0 0 16px rgba(255, 212, 94, 0.4); }

/* --- Игровое поле 5x5 ---------------------------------------------------- */
.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 420px;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

/* Мина найдена: всё поле — тёмно-красное (класс навешивает minesRevealCell) */
.mines-grid.mines-lost {
    background: linear-gradient(160deg, rgba(96, 10, 20, 0.88), rgba(28, 4, 8, 0.96));
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: inset 0 0 40px rgba(220, 38, 38, 0.35);
}

.mines-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: none;
    background: none;
    perspective: 620px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mines-cell:disabled { cursor: default; }

.mines-cell-inner {
    position: absolute;
    inset: 0;
    display: block;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.2, 0.85, 0.25, 1);
    border-radius: 14px;
}

/* Переворот «лицом вниз -> лицом вверх» */
.mines-cell.flipped .mines-cell-inner { transform: rotateY(180deg); }
/* Восстановление игры / старт нового раунда — без анимации переворота */
.mines-cell.mines-no-anim .mines-cell-inner,
.mines-grid.mines-instant .mines-cell-inner { transition: none; }

.mines-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: clamp(16px, 5vw, 24px);
    line-height: 1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Закрытая коробка */
.mines-face-front {
    background: linear-gradient(155deg, rgba(63, 63, 92, 0.95), rgba(24, 24, 38, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 14px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s;
}
.mines-cell:active .mines-face-front { transform: translateY(1px) scale(0.97); }
.mines-box-mark { opacity: 0.28; }

/* Открытая ячейка (подарок / мина) */
.mines-face-back {
    transform: rotateY(180deg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mines-cell.revealed-gift .mines-face-back {
    background: radial-gradient(circle at 50% 40%, rgba(74, 222, 128, 0.35), rgba(18, 58, 38, 0.92));
    border-color: rgba(74, 222, 128, 0.75);
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.45);
}

.mines-cell.revealed-mine .mines-face-back {
    background: radial-gradient(circle at 50% 40%, rgba(248, 113, 113, 0.4), rgba(70, 10, 14, 0.95));
    border-color: rgba(248, 113, 113, 0.8);
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.5);
}

.mines-cell.revealed-gift { animation: minesCellPop 0.32s ease; }
.mines-cell.revealed-mine { animation: minesCellShake 0.38s ease; }

@keyframes minesCellPop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.09); }
    100% { transform: scale(1); }
}
@keyframes minesCellShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
}

/* Пока раунд не начат, карточки заблокированы (button[disabled]) */
.mines-cell:disabled .mines-face-front {
    opacity: 0.5;
    filter: grayscale(0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.mines-cell:disabled .mines-box-mark { opacity: 0.16; }

/* Всплывающий множитель над открытой коробкой */
.mines-float-multiplier {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    transform: translate(-50%, -50%);
    font-family: Syncopate, sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: #86efac;
    text-shadow: 0 0 14px rgba(74, 222, 128, 0.9);
    pointer-events: none;
    white-space: nowrap;
    animation: minesFloatMultiplier 0.9s ease-out forwards;
}
@keyframes minesFloatMultiplier {
    0%   { opacity: 0; transform: translate(-50%, -40%) scale(0.7); }
    25%  { opacity: 1; transform: translate(-50%, -60%) scale(1.12); }
    100% { opacity: 0; transform: translate(-50%, -150%) scale(1); }
}

/* --- Главная кнопка: ИГРАТЬ / ЗАБРАТЬ X STARS --------------------------- */
.mines-action-btn {
    width: 100%;
    max-width: 420px;
    padding: 17px 18px;
    border: none;
    border-radius: 18px;
    font-family: Syncopate, sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.5px;
    cursor: pointer;
    color: #f2e9ff;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 60%, #4c1d95 100%);
    box-shadow: 0 8px 26px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: transform 0.12s, box-shadow 0.25s, background 0.3s;
}
.mines-action-btn:active { transform: scale(0.97); }

/* «ЗАБРАТЬ [X] STARS» — крупная ЗЕЛЁНАЯ кнопка с пульсацией */
.mines-action-btn.mines-cashout {
    color: #04180c;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 55%, #15803d 100%);
    animation: minesCashoutPulse 1.8s ease-in-out infinite;
}
.mines-action-btn:disabled { opacity: 0.5; cursor: default; animation: none; }

.mines-hint {
    max-width: 340px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    min-height: 15px;
}

/* Подсветка карточки «Подарочные коробки» на главной */
.mines-menu-card .menu-card-icon { filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.55)); }

/* Мобильная адаптация: меньше гэпы на узких экранах */
@media (max-width: 380px) {
    .mines-screen { padding: 0 10px 26px; gap: 12px; }
    .mines-grid { gap: 6px; padding: 8px; }
    .mines-label { min-width: 54px; font-size: 9px; }
    .mines-action-btn { font-size: 13px; padding: 15px 12px; }
}

/* ==========================================================================
   🚀 CRYPTO ROCKET (Crash) — мультиплеерный режим «Ракета»
   Общий язык с остальным проектом: тёмное «стекло» (backdrop-filter),
   неоновый фиолетовый #9D00FF и изумрудный #00FF88, золото #FFD700 для
   крупных иксов. Полёт рисуется на Canvas (webapp/main.js), здесь — каркас:
   лента истории, HUD, панель ставки, главная кнопка и live-таблица.
   ========================================================================== */

#page-rocket .page-title-block { margin-top: 18px; }

.rocket-screen {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding-bottom: 24px;
}

/* --- 1. Лента истории иксов ---------------------------------------------- */
.rocket-history {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
}
.rocket-history::-webkit-scrollbar { display: none; }

.rocket-hist {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #cdd3e0;
}
.rocket-hist.hot {                        /* >= 2.00x — изумруд */
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.34);
    background: rgba(0, 255, 136, 0.09);
}
.rocket-hist.cold {                       /* < 1.50x — красный */
    color: #ff6b81;
    border-color: rgba(255, 107, 129, 0.32);
    background: rgba(255, 107, 129, 0.09);
}
.rocket-hist.jack {                       /* >= 10.00x — золото с свечением */
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.45);
    background: rgba(255, 215, 0, 0.10);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.34);
    animation: rocketJackPulse 1.5s ease-in-out infinite;
}
/* --- 2. Сцена полёта ----------------------------------------------------- */
.rocket-stage {
    position: relative;
    height: 232px;
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 50% 118%, rgba(157, 0, 255, 0.30) 0%, rgba(9, 3, 20, 0) 62%),
        linear-gradient(180deg, #0B0E14 0%, #12091f 100%);
    border: 1px solid rgba(157, 0, 255, 0.24);
    box-shadow: inset 0 0 46px rgba(157, 0, 255, 0.13);
}
.rocket-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Красная вспышка «RUG PULL» поверх сцены */
.rocket-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 60%, rgba(255, 60, 92, 0.55) 0%, rgba(255, 20, 60, 0) 70%);
    opacity: 0;
    pointer-events: none;
}
.rocket-flash.on { animation: rocketFlashOut 620ms ease-out; }
@keyframes rocketFlashOut {
    0%   { opacity: 0.95; }
    100% { opacity: 0; }
}

/* Тряска экрана при падении */
.rocket-stage.shake { animation: rocketShake 560ms cubic-bezier(.36, .07, .19, .97); }
@keyframes rocketShake {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(6px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-9px, 0, 0); }
    40%, 60% { transform: translate3d(9px, 0, 0); }
}

/* HUD: фаза, счётчик икса, подпись таймера */
.rocket-hud {
    position: absolute;
    left: 0;
    right: 0;
    top: 12px;
    text-align: center;
    pointer-events: none;
}
.rocket-phase {
    font-size: 10px;
    letter-spacing: 2.4px;
    color: rgba(255, 255, 255, 0.58);
}
.rocket-mult {
    margin-top: 2px;
    font-size: 42px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.4px;
    color: #ffffff;
    text-shadow: 0 0 22px rgba(157, 0, 255, 0.65);
    transform-origin: center;
}
/* Пульсация на каждом шаге роста икса (класс ставит JS) */
.rocket-mult.beat { animation: rocketMultBeat 260ms ease-out; }
@keyframes rocketMultBeat {
    0%   { transform: scale(1.11); }
    100% { transform: scale(1); }
}
.rocket-mult.up   { color: #00ff88; text-shadow: 0 0 26px rgba(0, 255, 136, 0.75); }
.rocket-mult.won  { color: #ffd700; text-shadow: 0 0 26px rgba(255, 215, 0, 0.75); }
.rocket-mult.dead { color: #ff5d73; text-shadow: 0 0 26px rgba(255, 60, 92, 0.8); }

.rocket-sub {
    font-size: 10px;
    letter-spacing: 1.6px;
    color: rgba(255, 255, 255, 0.66);
}
.rocket-sub.warn { color: #ffb648; }

/* Салют из монет при заборе выигрыша */
.rocket-coins { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.rocket-coin {
    position: absolute;
    bottom: -24px;
    opacity: 0;
    animation: rocketCoinFly 1.5s ease-out forwards;
}
@keyframes rocketCoinFly {
    0%   { opacity: 0; transform: translateY(0) scale(0.6); }
    18%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-190px) scale(1.1); }
}

/* --- 3. Панель ставки и авто-забора -------------------------------------- */
.rocket-panel {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.rocket-field { display: flex; align-items: center; gap: 9px; }
.rocket-label {
    flex: 0 0 82px;
    font-size: 10px;
    letter-spacing: 1.3px;
    color: rgba(255, 255, 255, 0.52);
}
.rocket-input {
    flex: 1;
    min-width: 0;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(6, 8, 14, 0.62);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    outline: none;
}
.rocket-input:focus { border-color: rgba(157, 0, 255, 0.62); }
.rocket-input:disabled { opacity: 0.45; }
.rocket-suffix { font-size: 13px; color: rgba(255, 255, 255, 0.55); }

.rocket-quick { display: flex; gap: 6px; padding-left: 91px; }
.rocket-chip-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.055);
    color: #d5dae6;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease;
}
.rocket-chip-btn:active { transform: scale(0.95); }
.rocket-chip-btn:disabled { opacity: 0.4; }
.rocket-chip-max { color: #ffd700; border-color: rgba(255, 215, 0, 0.34); }

/* --- 4. Главная динамическая кнопка -------------------------------------- */
.rocket-main-btn {
    width: 100%;
    padding: 17px 0;
    border: none;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #9D00FF 0%, #6a00c4 100%);
    box-shadow: 0 10px 26px rgba(157, 0, 255, 0.34);
    transition: transform 120ms ease;
}
.rocket-main-btn:active { transform: scale(0.975); }
.rocket-main-btn:disabled { cursor: default; animation: none; opacity: 0.62; }

.rocket-main-btn.is-bet    { animation: rocketBetPulse 1.8s ease-in-out infinite; }
.rocket-main-btn.is-cashout {
    background: linear-gradient(135deg, #00FF88 0%, #00b86b 100%);
    color: #032014;
    animation: rocketCashPulse 900ms ease-in-out infinite;
}
.rocket-main-btn.is-wait { background: linear-gradient(135deg, #3a3f52 0%, #262a38 100%); box-shadow: none; }
.rocket-main-btn.is-done { background: linear-gradient(135deg, #1d7a55 0%, #145a41 100%); box-shadow: none; }
.rocket-main-btn.is-dead { background: linear-gradient(135deg, #c8304a 0%, #8d1c31 100%); box-shadow: none; }

.rocket-tip {
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
    color: rgba(255, 255, 255, 0.50);
    min-height: 16px;
}

/* --- 5. Live-таблица ставок раунда --------------------------------------- */
.rocket-live {
    border-radius: 16px;
    padding: 11px 12px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.rocket-live-head {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.48);
    padding-bottom: 8px;
}
.rocket-live-list { max-height: 172px; overflow-y: auto; }
.rocket-live-list::-webkit-scrollbar { width: 3px; }
.rocket-live-list::-webkit-scrollbar-thumb { background: rgba(157, 0, 255, 0.5); border-radius: 3px; }

.rocket-bet {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 6px;
    border-radius: 10px;
}
.rocket-bet + .rocket-bet { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.rocket-bet.me { background: rgba(157, 0, 255, 0.10); }

.rocket-bet-av {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.07);
}
.rocket-bet-av img { width: 100%; height: 100%; object-fit: cover; }
.rocket-bet-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    color: #e7ebf3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rocket-bet-sum { font-size: 11px; color: rgba(255, 255, 255, 0.42); }
.rocket-bet-tag {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    color: #ffd75e;
    background: rgba(255, 215, 94, 0.13);
}
.rocket-bet-tag.won  { color: #04180c; background: #00ff88; }
.rocket-bet-tag.lost { color: #ff8a8a; background: rgba(255, 60, 92, 0.15); }
.rocket-live-empty { font-size: 11px; color: rgba(255, 255, 255, 0.35); padding: 6px 0 8px; }

/* Карточка режима на главной */
.rocket-card .menu-card-icon { filter: drop-shadow(0 0 12px rgba(157, 0, 255, 0.72)); }

/* ==========================================================================
   🔥 PREMIUM WEB3 — НИЖНИЕ КАРТОЧКИ ГЛАВНОГО МЕНЮ
   Вертикальный список на всю ширину сохранён (это те же .menu-card, что были):
   карточки «Подарочные коробки», «Ежедневная серия», «Пригласи друзей»,
   «Crypto Rocket» получают уникальный неоновый акцент, бегущий блик,
   градиентные заголовки, микро-анимацию иконок и пружинный тап.
   ВЕРХНИЕ блоки (Инвентарь .onyx-card и Рулетка) НЕ ТРОГАЕМ — правил для
   .onyx-card здесь нет намеренно.
   ========================================================================== */

/* --- Базовый слой: блик + пружинный тап ---------------------------------- */
#home-page-container .menu-card.card-mines,
#home-page-container .menu-card.card-streak,
#home-page-container .menu-card.card-referral,
#home-page-container .menu-card.card-rocket {
    position: relative;
    overflow: hidden;               /* клипует бегущий блик и не даёт ему «уехать» */
    isolation: isolate;             /* блик не смешивается с фоном родителя */
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.2s ease;
}

/* Бегущий блик по диагонали: световая полоса едет transform'ом (GPU-слой),
   а не background-position — он перерисовывал карточку каждый кадр.
   Период 3.6 с, внешне полоса выглядит ровно так же, только на skewX-плоскости. */
#home-page-container .menu-card.card-mines::before,
#home-page-container .menu-card.card-streak::before,
#home-page-container .menu-card.card-referral::before,
#home-page-container .menu-card.card-rocket::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    /* Полоса шириной 34% и ездит трансформом — фон не перерисовывается. */
    width: 34%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(115deg,
        transparent 0%,
        rgba(255, 255, 255, 0.14) 38%,
        rgba(255, 255, 255, 0.30) 50%,
        rgba(255, 255, 255, 0.14) 62%,
        transparent 100%);
    transform: translate3d(-160%, 0, 0) skewX(-25deg);
    will-change: transform;
    animation: cardShimmer 3.6s ease-in-out infinite;
}

@keyframes cardShimmer {
    0%       { transform: translate3d(-160%, 0, 0) skewX(-25deg); }
    55%      { transform: translate3d(360%, 0, 0) skewX(-25deg); }
    100%     { transform: translate3d(360%, 0, 0) skewX(-25deg); }
}

/* Пружинный тап: сжатие до 0.97 и возврат с «перелётом» (transition выше). */
#home-page-container .menu-card.card-mines:active,
#home-page-container .menu-card.card-streak:active,
#home-page-container .menu-card.card-referral:active,
#home-page-container .menu-card.card-rocket:active {
    transform: scale(0.97);
    filter: brightness(125%);
    transition: transform 0.08s ease-out, filter 0.08s ease-out;
}

/* --- Градиентные заголовки ------------------------------------------------ */
#home-page-container .menu-card-info h3 {
    background: linear-gradient(100deg, #ffffff 0%, #ffffff 42%, var(--card-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0;              /* Safari иногда рисует контур */
    text-shadow: none;                   /* иначе виден «ореол» из старого правила */
    filter: drop-shadow(0 2px 10px var(--card-accent-soft));
}

/* Подпись чуть ярче — на тёмном неоне читается плохо. */
#home-page-container .menu-card-info p {
    color: rgba(255, 255, 255, 0.68);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* --- Плашки-бейджи ------------------------------------------------------- */
.card-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 3;
    padding: 4px 9px;
    border-radius: 9px;
    font-family: 'Syncopate', sans-serif;
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: 1.1px;
    line-height: 1;
    color: #0B0614;
    text-transform: uppercase;
    pointer-events: none;
    animation: cardBadgePulse 2.2s ease-in-out infinite;
}
.card-badge-violet  { background: linear-gradient(135deg, #C77DFF 0%, #9D00FF 100%); box-shadow: 0 0 14px rgba(157, 0, 255, 0.6); }
.card-badge-gold    { background: linear-gradient(135deg, #FFE29A 0%, #FFB300 100%); box-shadow: 0 0 14px rgba(255, 179, 0, 0.6); }
.card-badge-fire    { background: linear-gradient(135deg, #FF9A6C 0%, #FF3B2F 100%); box-shadow: 0 0 14px rgba(255, 59, 47, 0.6); }
.card-badge-emerald { background: linear-gradient(135deg, #7CFFC4 0%, #00E58A 100%); box-shadow: 0 0 14px rgba(0, 229, 138, 0.6); }

@keyframes cardBadgePulse {
    /* Раньше filter: brightness(1..1.35) — на iOS это Repaint плашки каждый
       кадр. opacity даёт тот же «мигающий свет» без перерисовки текста. */
    0%, 100% { opacity: 0.78; }
    50%      { opacity: 1; }
}

/* --- Микро-анимации иконок ----------------------------------------------- */
/* Ракета: левитация вверх-вниз с лёгким наклоном. */
.card-icon-float { animation: cardFloat 3s ease-in-out infinite; }
@keyframes cardFloat {
    0%, 100% { transform: translateY(2px) rotate(0deg); }
    50%      { transform: translateY(-6px) rotate(4deg); }
}

/* Огонь: пульсация размера (существующий streak-fire-flicker заменяем). */
.card-icon-pulse { animation: cardPulse 1.5s ease-in-out infinite; }
@keyframes cardPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.16); }
}

/* Коробка: покачивание влево-вправо раз в 2 с. */
.card-icon-sway { animation: cardSway 2s ease-in-out infinite; }
@keyframes cardSway {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25%      { transform: translateX(-4px) rotate(-7deg); }
    75%      { transform: translateX(4px) rotate(7deg); }
}

/* Рукопожатие: двойной «удар» — читается как приглашение. */
.card-icon-beat { animation: cardBeat 1.8s ease-in-out infinite; }
@keyframes cardBeat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    30%      { transform: scale(1.1) rotate(-6deg); }
    60%      { transform: scale(1.05) rotate(6deg); }
}

/* ==========================================================================
   ПРОИЗВОДИТЕЛЬНОСТЬ (iOS WebKit): пульсирующее свечение карточек
   Раньше @keyframes neonGlow* анимировали box-shadow — на iOS это вызывает
   Repaint всей карточки каждый кадр (и это главный источник просадок FPS).
   Теперь тень СТАТИЧНА на псевдоэлементе ::after, а анимируется только
   opacity — операция, которую WebKit выполняет на отдельном GPU-слое.
   Внешний вид сохранён: диапазон прозрачности 0.32..1 соответствует прежнему
   14px..26px свечения.
   ========================================================================== */
#home-page-container .menu-card[class*="card-"]::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;                 /* под контентом (menu-card-info имеет z-index 2) */
    border-radius: inherit;
    opacity: 0.32;
    pointer-events: none;
    will-change: opacity;
    transform: translateZ(0);
}

/* --- Crypto Rocket: фиолетово-синий неон -------------------------------- */
#home-page-container .card-rocket {
    --card-accent: #B388FF;
    --card-accent-soft: rgba(157, 0, 255, 0.35);
    border-color: rgba(157, 0, 255, 0.55);
    background:
        linear-gradient(135deg,
            rgba(157, 0, 255, 0.22) 0%,
            rgba(88, 86, 214, 0.18) 55%,
            rgba(10, 6, 24, 0.55) 100%);
}
#home-page-container .card-rocket::after {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 26px rgba(157, 0, 255, 0.72);
    animation: neonGlowViolet 3.2s ease-in-out infinite;
}
#home-page-container .card-rocket .menu-card-icon {
    filter: drop-shadow(0 0 14px rgba(157, 0, 255, 0.8));
    font-size: 36px;
}
@keyframes neonGlowViolet {
    0%, 100% { opacity: 0.32; }
    50%      { opacity: 1; }
}

/* --- Подарочные коробки: золото-оранжевый -------------------------------- */
#home-page-container .card-mines {
    --card-accent: #FFC46B;
    --card-accent-soft: rgba(255, 179, 0, 0.35);
    border-color: rgba(255, 176, 32, 0.5);
    background:
        linear-gradient(135deg,
            rgba(255, 176, 32, 0.20) 0%,
            rgba(255, 122, 0, 0.14) 55%,
            rgba(26, 14, 2, 0.55) 100%);
}
#home-page-container .card-mines::after {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 26px rgba(255, 176, 32, 0.68);
    animation: neonGlowGold 3.6s ease-in-out infinite;
}
#home-page-container .card-mines .menu-card-icon {
    filter: drop-shadow(0 0 14px rgba(255, 176, 32, 0.75));
    font-size: 34px;
}
@keyframes neonGlowGold {
    0%, 100% { opacity: 0.32; }
    50%      { opacity: 1; }
}

/* --- Ежедневная серия: огненно-красный ---------------------------------- */
#home-page-container .card-streak {
    --card-accent: #FF8A5C;
    --card-accent-soft: rgba(255, 59, 47, 0.35);
    border-color: rgba(255, 59, 47, 0.5);
    background:
        linear-gradient(135deg,
            rgba(255, 59, 47, 0.22) 0%,
            rgba(255, 140, 0, 0.14) 55%,
            rgba(26, 6, 2, 0.55) 100%);
}
#home-page-container .card-streak::after {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 28px rgba(255, 59, 47, 0.72);
    animation: neonGlowFire 3.4s ease-in-out infinite;
}
#home-page-container .card-streak .menu-card-icon {
    filter: drop-shadow(0 0 14px rgba(255, 90, 40, 0.8));
    font-size: 34px;
}
@keyframes neonGlowFire {
    0%, 100% { opacity: 0.32; }
    50%      { opacity: 1; }
}

/* --- Пригласи друзей: изумрудно-зелёный --------------------------------- */
#home-page-container .card-referral {
    --card-accent: #7CFFC4;
    --card-accent-soft: rgba(0, 229, 138, 0.35);
    border-color: rgba(0, 229, 138, 0.48);
    background:
        linear-gradient(135deg,
            rgba(0, 229, 138, 0.20) 0%,
            rgba(0, 138, 138, 0.14) 55%,
            rgba(2, 20, 16, 0.55) 100%);
}
#home-page-container .card-referral::after {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 26px rgba(0, 229, 138, 0.66);
    animation: neonGlowEmerald 3.5s ease-in-out infinite;
}
#home-page-container .card-referral .menu-card-icon {
    filter: drop-shadow(0 0 14px rgba(0, 229, 138, 0.72));
    font-size: 32px;
}
@keyframes neonGlowEmerald {
    0%, 100% { opacity: 0.32; }
    50%      { opacity: 1; }
}

/* ==========================================================================
   ⚡ ПРОИЗВОДИТЕЛЬНОСТЬ (iOS WebKit / Telegram Mini Apps)
   Блок применяется ПОСЛЕ всех стилей и ничего не меняет визуально:
   1) тяжёлые backdrop-filter (10/12/16px) урезаны до 6px — размытие на A-серии
      стоит отдельного прохода композитора на каждый слой;
   2) бесконечно анимируемые блоки получают will-change/translateZ/backface —
      браузер поднимает их в отдельный GPU-слой и не перерисовывает при скролле;
   3) скролл-контейнеры изолированы (contain) — перерисовка шапки/подвала
      не задевает длинные списки, а content-visibility выключает рендер
      экранов, которых не видно.
   ========================================================================== */

/* --- 1. Обрезка тяжёлого blur ------------------------------------------- */
/* backdrop-filter: blur(10|12|16)px -> blur(6px) списком селекторов.
   Список ПОЛНЫЙ (найден скриптом-аудитом): сюда входят в т.ч. полноэкранный
   оверлей .streak-modal — один такой слой стоит дороже всех карточек вместе.
   !important обязателен: часть правил уже объявлена с !important и без него
   перекрытие проиграло бы по специфичности. */
.btn-task-action,
.btn-donate,
.btn-shop-buy,
.btn-modal-action,
.btn-inventory,
.tg-menu-item,
.balance-pill,
.stat-glass-card,
.reactor-monolith,
.page-profile-card,
#profile-container,
#modal-window,
#inventory-modal,
.inventory-modal,
.referral-back-btn,
.btn-core-spin,
/* Селекторы с #id/комбинациями: они специфичнее «простых» .menu-card, поэтому
   перекрыть их одним коротким правилом нельзя — перечисляем явно. */
#home-page-container .menu-card,
#home-page-container .referral-card,
.menu-card.referral-card,
.onyx-inner,
#home-page-container .onyx-inner,
.inventory-modal-content,
.modal-window-content,
#page-reactor.premium-mode .btn-core-spin,
.menu-card,
.rocket-panel,
.rocket-live,
.rocket-hist,
.referral-hero,
.referral-link-card,
.referral-milestone,
.referral-friends-block,
.streak-modal,
.streak-modal-content,
.streak-toast,
.donate-card,
.inventory-card,
.inventory-item-card,
.shop-item-card,
.premium-card,
.task-card,
.quest-card,
.bottom-nav-capsule,
.nav-island-circle,
.nav-island-profile,
.admin-modal-content {
    -webkit-backdrop-filter: blur(6px) !important;
    backdrop-filter: blur(6px) !important;
}

/* --- 2. GPU-слои для бесконечных анимаций ------------------------------- */
/* Только элементы, которые анимируются ПОСТОЯННО: постоянный will-change на
   десятках узлов наоборот съедает память GPU (важно на 3-6 ГБ устройствах). */
.onyx-breathe,
.onyx-outer,
.ambient-background,
.neon-orb,
.onyx-nav-button,
.onyx-active-banner,
.roulette-mask,
.live-wins-bar,
.onyx-card,
.onyx-card::before,
#home-page-container .menu-card[class*="card-"]::before,
#home-page-container .menu-card[class*="card-"]::after,
.card-icon-float,
.card-icon-pulse,
.card-icon-sway,
.card-icon-beat,
.card-badge,
#buy-stars-btn,
.rocket-main-btn.is-bet::after,
.rocket-main-btn.is-cashout::after,
.streak-badge,
.streak-day,
.rocket-coin,
.rocket-bet-av,
.rocket-hist.jack {
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.onyx-breathe,
.onyx-outer,
.ambient-background,
.neon-orb,
.onyx-nav-button,
.onyx-active-banner,
.roulette-mask,
.live-wins-bar,
#home-page-container .menu-card[class*="card-"]::before,
#home-page-container .menu-card[class*="card-"]::after,
.card-icon-float,
.card-icon-pulse,
.card-icon-sway,
.card-icon-beat,
.card-badge,
.rocket-coin {
    will-change: transform, opacity;
}

/* --- 3. Изоляция перерисовки при скролле -------------------------------- */
/* ВАЖНО: contain:paint обрезает потомков по границам элемента и делает его
   containing block для position:fixed. Поэтому его НЕЛЬЗЯ вешать на
   #home-page-container и .app-page — там живут переходы страниц и модалки.
   Изолируем только внутренние области, где вылезать за края нечему. */
.rocket-screen,
.rocket-coins,
.rocket-bets,
.rocket-live-list,
.rocket-history,
.rocket-stage,
.referral-friends-list,
.inventory-grid,
.shop-grid,
.admin-modal-content,
.streak-modal-content,
.bottom-nav-capsule {
    contain: content;
    isolation: isolate;
}

/* Инерционный скролл на iOS (инерция включается один раз и переиспользуется
   всеми списками — дешевле, чем нативная прокрутка по умолчанию). */
.rocket-bets-panel,
.referral-friends-list,
.inventory-grid,
.shop-grid,
.admin-modal-content,
.referral-screen {
    -webkit-overflow-scrolling: touch;
}

/* content-visibility включаем только для НЕАКТИВНЫХ страниц и только когда
   они не в переходе: на .page-leaving (display:flex) он «схлопнул» бы
   контент, и анимация ухода уехала бы пустой. */
.app-page:not(.active):not(.page-leaving) {
    content-visibility: auto;
    contain-intrinsic-size: auto 720px;
}

/* --- 5. Свечения остальных экранов: box-shadow -> opacity на ::after ------ */
/* Те же 10 «пульсов», что оставались в модалке серии, экране Коробок и Ракете.
   box-shadow становится СТАТИЧНЫМ на ::after, анимируется только opacity. */
.streak-live-badge,
.streak-live-badge.can-claim,
.streak-day.current,
.btn-claim-streak,
.mines-action-btn.mines-cashout,
.rocket-hist.jack,
.rocket-main-btn.is-bet,
.rocket-main-btn.is-cashout {
    position: relative;
    isolation: isolate;
    /* Сам элемент больше НЕ мигает (иначе кадр opacity гасил бы текст/фон);
       пульсирует только ::after с тенью. */
    animation: none;
}
.streak-live-badge::after,
.streak-live-badge.can-claim::after,
.streak-day.current::after,
.btn-claim-streak::after,
.mines-action-btn.mines-cashout::after,
.rocket-hist.jack::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    will-change: opacity;
    opacity: 0.5;
}
.streak-live-badge::after         { box-shadow: 0 0 16px rgba(255, 140, 0, 0.5); animation: streak-badge-pulse 2.6s ease-in-out infinite; }
.streak-live-badge.can-claim::after { box-shadow: 0 0 22px rgba(255, 160, 20, 0.75); animation: streak-badge-pulse-strong 1.8s ease-in-out infinite; }
.streak-day.current::after       { box-shadow: 0 0 22px rgba(255, 160, 20, 0.65); animation: streak-current-pulse 2s ease-in-out infinite; }
.btn-claim-streak::after         { box-shadow: 0 10px 32px rgba(255, 150, 20, 0.6); animation: streak-btn-glow 2.4s ease-in-out infinite; }
.mines-action-btn.mines-cashout::after { box-shadow: 0 10px 44px rgba(34, 197, 94, 0.8); animation: minesCashoutPulse 1.8s ease-in-out infinite; }
.rocket-hist.jack::after        { box-shadow: 0 0 20px rgba(255, 215, 0, 0.55); animation: rocketJackPulse 1.5s ease-in-out infinite; }

/* Собственно переписанные кадры: только transform + opacity. */
@keyframes streak-badge-pulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}
@keyframes streak-badge-pulse-strong {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
@keyframes streak-current-pulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}
@keyframes streak-btn-glow {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}
@keyframes minesCashoutPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}
@keyframes rocketJackPulse {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}
@keyframes rocketBetPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}
@keyframes rocketCashPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
/* Кнопки Ракеты: пульс переносим на ::after (сама кнопка остаётся статичной). */
.rocket-main-btn.is-bet::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: 0 10px 34px rgba(157, 0, 255, 0.62);
    opacity: 0.5;
    pointer-events: none;
    will-change: opacity;
    animation: rocketBetPulse 1.8s ease-in-out infinite;
}
.rocket-main-btn.is-cashout::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.78);
    opacity: 0.55;
    pointer-events: none;
    will-change: opacity;
    animation: rocketCashPulse 900ms ease-in-out infinite;
}

/* --- 6. Частицы фона: background-position -> transform -------------------- */
/* onyx-particle-drift раньше двигал background-position, то есть перерисовывал
   слой с частицами целиком. Двигаем тайл трансформом (тот же результат). */
.onyx-particles {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}
@keyframes onyx-particle-drift {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-200px, -200px, 0); }
}

/* --- 7. Честная поддержка «уменьшить движение» ---------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ambient-background,
    .neon-orb,
    .onyx-breathe,
    .onyx-particles,
    #home-page-container .menu-card[class*="card-"],
    #home-page-container .menu-card[class*="card-"]::before,
    #home-page-container .menu-card[class*="card-"]::after,
    .card-badge,
    .card-icon-float, .card-icon-pulse, .card-icon-sway, .card-icon-beat,
    #buy-stars-btn, #buy-stars-btn::after,
    .streak-live-badge::after, .streak-day.current::after, .btn-claim-streak::after,
    .mines-action-btn.mines-cashout::after, .rocket-hist.jack::after,
    .rocket-main-btn.is-bet::after, .rocket-main-btn.is-cashout::after {
        animation: none !important;
    }
}

@media (max-width: 380px) {
    .rocket-screen { gap: 10px; }
    .rocket-stage { height: 200px; }
    .rocket-mult { font-size: 36px; }
    .rocket-label { flex-basis: 70px; }
    .rocket-quick { padding-left: 79px; }
    .rocket-main-btn { font-size: 13px; padding: 15px 10px; }
}
