html, body {
    margin: 0; 
    padding: 0;
    width: 100%; 
    height: 100%;
    overflow: hidden; 
    background: #000;
    font-family: 'Segoe UI', Roboto, sans-serif;
    
    /* Запрещаем выделение текста */
    user-select: none;
    -webkit-user-select: none;

    /* Убираем синий квадрат при нажатии на мобилках */
    -webkit-tap-highlight-color: transparent;

    /* ГЛАВНОЕ: Убираем лишние жесты браузера (скролл, зум) */
    touch-action: none; 
    
    /* Фиксируем положение, чтобы экран не "гулял" за пальцем */
    position: fixed;
}

canvas {
    display: block;
    position: fixed;
    top: 0; left: 0;
    z-index: 2; /* Возвращаем планеты на слой 1 */
    filter: none !important;
    pointer-events: auto !important;
}

#ui-layer {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    z-index: 10; /* Интерфейс на слое 10 */
    pointer-events: none; /* ВАЖНО: возвращаем обычные клики! */
    box-sizing: border-box;
}

/* ИСПРАВЛЕНО: добавлена ширина и правильный бокс-сайзинг */
.game-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; 
    box-sizing: border-box;
    /* Твои отступы */
    padding-top: calc(env(safe-area-inset-top, 0px) + 40px); 
    padding-left: 15px;
    padding-right: 15px;
    
    display: flex;
    justify-content: space-between; 
    align-items: center; /* Центрируем по вертикали, чтобы кнопка и текст были в одну линию */
    z-index: 20;
    pointer-events: none; /* Пропускаем клики сквозь хедер на игру... */
}

/* ...но возвращаем клики на интерактивные элементы! */
.user-info, .wallet, .wallet-connect-wrapper {
    pointer-events: auto;
}

.user-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    pointer-events: auto;
    
    display: flex;
    align-items: center;
    height: fit-content; 
    max-width: 40%; /* Ограничение ширины ника */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet {
    display: flex;
    flex-direction: column; /* Если хочешь, чтобы QUANT и QUBI были друг под другом */
    gap: 8px;
    background: none !important; /* Убираем черный фон */
    border: none !important;     /* Убираем рамку */
    box-shadow: none !important;  /* Убираем тени, если есть */
    padding: 0 !important;       /* Убираем внутренние отступы */
}

/* Каждая отдельная строка с валютой */
.currency {
    background: none !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Прижимаем к правому краю */
    gap: 10px;
}

.coin-tag {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-tag img {
    object-fit: contain; 
    flex-shrink: 0; 
}

.quant .coin-tag img {
    height: 32px !important; 
    width: 32px !important;
}

.qubi .coin-tag img {
    height: 48px !important; /* Оптимально для 160px ширины кошелька */
    width: 48px !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

.coin-tag span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
}

/* Чтобы цифры лучше читались на фоне звезд, добавим им легкое свечение */
#quant-val, #qubi-val {
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5), 0 0 20px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    font-size: 18px;
}

#quant-val { color: #00e5ff; }
#qubi-val { color: #ffd700; }

/* МОДАЛЬНОЕ ОКНО */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.moon-card {
    background: linear-gradient(145deg, #121212, #000);
    border: 1px solid rgba(0, 229, 255, 0.2);
    padding: 20px; /* Немного уменьшили отступы, чтобы сэкономить место */
    border-radius: 24px;
    width: 85%;
    max-width: 340px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.15);
    
    /* ДОБАВЬ ЭТИ СТРОКИ: */
    max-height: 90vh; /* Максимальная высота - 90% экрана */
    overflow-y: auto; /* Включает прокрутку, если контента много */
}

.close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: none; border: none;
    color: rgba(255, 255, 255, 0.5); 
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: #fff; }

.moon-header img { width: 50px; margin-bottom: 8px; filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.3)); }
.moon-header h2 { font-size: 16px; letter-spacing: 2px; margin: 0; color: #fff; text-transform: uppercase; }

.station-desc { color: #888; font-size: 11px; margin: 10px 0 20px; }

/* СЕКЦИИ ОБМЕНА */
.exchange-section {
    transition: transform 0.2s, background 0.2s;
}
.exchange-section:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.05) !important;
}

/* МАЛЕНЬКИЕ КНОПКИ ОБМЕНА */
.process-btn-small {
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.process-btn-small:active {
    transform: translateY(2px);
    filter: brightness(0.8);
}

/* ПОЛОСКИ ПРОГРЕССА */
.factory-bar-bg {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.limit-section {
    display: block !important;
    width: 100%;
    margin-top: 8px; /* Отступ от кнопки обмена */
    opacity: 1 !important;
}

.factory-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    display: block !important;
}

/* ИНФО О ЗАПАСАХ */
.res-info {
    display: flex; 
    justify-content: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px; 
    border-radius: 12px; 
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.res-info span { font-weight: bold; }

/* Общий контейнер для сеток обмена */
.exchange-grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

/* Кнопка пакета обмена (адаптировано под твой стиль) */
.exchange-pkg-btn {
    background: rgba(0, 229, 255, 0.05); /* Легкий неоновый фон */
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 12px;
    padding: 12px 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

/* Эффект нажатия (тот самый "физический" отклик) */
.exchange-pkg-btn:active {
    transform: scale(0.95);
    background: rgba(0, 229, 255, 0.2);
    border-color: #00e5ff;
}

/* Названия пакетов (Метеоритный запас и т.д.) */
.exchange-pkg-btn .pkg-name {
    font-size: 11px;
    font-weight: bold;
    color: #ffa500; /* Оранжевый акцент для QUBI */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

/* Правая часть (цифры обмена) */
.exchange-pkg-btn .pkg-val {
    font-size: 11px;
    color: #fff;
    opacity: 0.9;
    text-align: right;
    font-family: monospace; /* Чтобы цифры стояли ровно */
}

/* ЛОАДЕР */
#loading-screen {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: #000;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; z-index: 2000;
    color: #fff;
}

.loader {
    width: 30px; height: 30px;
    border: 3px solid rgba(0, 229, 255, 0.2);
    border-top-color: #00e5ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* ============================================================================
   👑 КИБЕРСПОРТИВНЫЙ 3D ЛИДЕРБОРД
   ============================================================================ */
.leaderboard-card {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #050b14 0%, #02040a 100%) !important;
    border: 2px solid rgba(0, 229, 255, 0.15) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), inset 0 0 20px rgba(0, 229, 255, 0.05) !important;
}

/* Навигация табов внутри топа */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 12px;
    margin: 15px 0 5px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.leader-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    padding: 10px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
.leader-tab.active-tab {
    color: #000;
    background: #00e5ff;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}
#tab-colony.active-tab {
    background: #ffaa00;
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.4);
}

.leaderboard-list {
    margin-top: 10px;
    overflow-y: auto;
    max-height: 380px;
    padding-right: 6px;
    text-align: left;
}

/* Стилизация скроллбара */
.leaderboard-list::-webkit-scrollbar {
    width: 4px;
}
.leaderboard-list::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.2);
    border-radius: 10px;
}

/* Космическая 3D-строка игрока */
.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    font-size: 13px;
    color: #e3e9f3;
    
    /* Эффект объема */
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, background 0.2s ease, border-color 0.2s ease;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rank-num {
    font-weight: 900;
    color: rgba(255, 255, 255, 0.3);
    min-width: 20px;
}
.player-name {
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Стилизация значений очков */
.player-row .score {
    font-weight: 900;
    font-family: monospace;
    transform: translateZ(15px);
}
.qubi-score {
    color: #00e5ff;
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.2);
}
.colony-score {
    color: #ffaa00;
    text-shadow: 0 0 5px rgba(255, 170, 0, 0.2);
}

/* Выделение себя в таблице лидеров */
.leaderboard-me {
    background: rgba(0, 229, 255, 0.08) !important;
    border-color: rgba(0, 229, 255, 0.4) !important;
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.05);
}
.leaderboard-me .player-name {
    color: #00e5ff;
    font-weight: 900;
}

/* Оверлей для окна раннера */
.runner-ui {
    position: absolute;
    /* Убираем зависимость от padding и flex-выравнивания по вертикали */
    top: 100px; /* Вот этот параметр опустит весь блок вниз. Можешь поставить 100px, если мало */
    left: 0;
    width: 100%;
    padding: 0 20px; /* Отступы только по бокам */
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center; 
    z-index: 1010;
    pointer-events: none;
}

#runnerCanvas {
    width: 100%;
    height: 100%;
    display: block;
    /* На всякий случай дублируем тут */
    touch-action: none; 
}

/* Интерфейс поверх игрового канваса */
.runner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1000;
    display: none;
    overflow: hidden;
    /* Убираем любые системные жесты и выделения */
    touch-action: none; 
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto !important;
}

.exit-btn {
    background: rgba(255, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto !important; /* Принудительно включаем клики */
    backdrop-filter: blur(5px);
    
    /* ДОБАВЬ ЭТО: */
    position: relative;
    z-index: 2000; /* Ставим выше всех игровых слоев */
}

.score-display {
    /* Твои базовые стили */
   background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 229, 255, 0.4); 
    padding: 12px 20px; /* Увеличил внутренние отступы */
    border-radius: 12px;
    backdrop-filter: blur(5px);
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Увеличил расстояние между строками */
    min-width: 130px; /* Увеличил ширину панели */
    z-index: 10;
}

/* Иконки валют */
.run-icon {
    width: 36px;  /* УВЕЛИЧИЛ ИКОНКИ В 2 РАЗА (было 18-20px) */
    height: 36px;
    margin-right: 15px;
    object-fit: contain;
}

/* Общий стиль для строк (Квант и Куби) */
.score-row {
    display: flex;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    font-size: 28px; /* УВЕЛИЧИЛ ТЕКСТ В 2 РАЗА (было 18px) */
}

/* Цвет для QUANT — теперь Голубой */
.quant-color {
    color: #00e5ff; 
}

/* Цвет для QUBI — теперь Желто-Оранжевый */
.qubi-color {
    color: #ffcc00; /* Яркий золотистый цвет */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

/* Увеличиваем конкретно иконку QUBI */
.qubi-color .run-icon {
    width: 54px;  /* Было 36px, делаем еще больше */
    height: 54px;
    margin-right: 12px;
}

@keyframes station-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Новая секция кнопки внутри хедера */
/* Убираем все лишние фоны и рамки */
.wallet-connect-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: none !important; /* Убирает тот самый прямоугольник */
    border: none !important;
    box-shadow: none !important;
    flex: 1; 
    pointer-events: auto; /* Включает клики именно на этот блок */
    z-index: 999;
}

/* Убираем стили самого виджета, если они лезут из библиотеки */
#ton-connect-btn {
    background: none !important;
    border: none !important;
    pointer-events: auto !important;
}

/* Важный фикс: внутри виджета есть встроенные кнопки, им тоже нужны клики */
#ton-connect-btn * {
    pointer-events: auto !important;
}

/* Немного опустим кнопку, если она слишком близко к "Закрыть" */
#ton-connect-btn {
    transform: scale(0.8) translateY(5px); 
}

/* Оптимальный размер для мобилок внутри хедера */
@media (max-width: 480px) {
    #ton-connect-btn {
        /* scale 0.7-0.8 — золотая середина, чтобы не перекрывать баланс */
        transform: scale(0.8); 
    }
}

/* ============================================================================
   🛒 ВЫСОКОТЕХНОЛОГИЧНЫЙ 3D DESIGN ДЛЯ SPACE MARKET & NFT STORE
   ============================================================================ */

#shop-modal {
    background: rgba(2, 6, 14, 0.92) !important;
    backdrop-filter: blur(12px);
    z-index: 2000;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    display: none; /* Управляется через JS */
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
}

/* Окно магазина с глобальной 3D перспективой */
.shop-window {
    width: 92%;
    max-width: 420px;
    background: radial-gradient(circle at top, #0c1836 0%, #040814 100%);
    border: 2px solid rgba(0, 229, 255, 0.25);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.1);
    /* Задает глубину для всех карточек внутри */
    perspective: 1200px; 
}

/* Сетка товаров с адаптивным скроллом */
.shop-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 20px 15px;
    max-height: 58vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00e5ff transparent;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================================
   📦 ЭФФЕКТНЫЕ 3D КАРТОЧКИ ТОВАРОВ (МОДУЛИ + АДАПТИВНЫЕ NFT ЯЧЕЙКИ)
   ============================================================================ */
.shop-item {
    position: relative;
    background: linear-gradient(135deg, #09152a 0%, #030712 100%);
    border: 2px solid rgba(0, 229, 255, 0.2);
    border-radius: 16px;
    padding: 12px 8px; /* Чуть уменьшили внутренние отступы, чтобы выиграть место для текста */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(0, 229, 255, 0.05);
    
    /* ФИКС ВЫСОТЫ: Даем карточке минимальный размер, но позволяем ей расти, если текста много */
    min-height: 220px; 
    
    /* Параллакс магия */
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Наклон карточки при таче / удержании */
.shop-item:active {
    transform: rotateX(10deg) rotateY(-8deg) scale(0.96);
    box-shadow: 0 4px 10px rgba(0,0,0,0.7), 0 0 15px rgba(0, 229, 255, 0.3);
}

/* Выталкиваем картинку товара вперед */
.shop-item-avatar-wrap {
    position: relative;
    width: 65px; /* Аккуратно уменьшили с 75px, чтобы убрать тесноту на мобильных экранах */
    height: 65px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(30px); /* Парит над картой */
    transition: transform 0.3s ease;
}

/* ФИКС ДЛЯ ОТОБРАЖЕНИЯ SVG И КАРТИНОК: Намертво сажаем в рамки wrap-контейнера */
.shop-item-img, 
.shop-item-avatar-wrap svg {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    border-radius: 12px;
}
.shop-item-img {
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

/* Блок описания (Средний уровень 3D) */
.shop-item-info {
    width: 100%;
    margin: 4px 0;
    transform: translateZ(15px);
}
.shop-item-name {
    font-weight: 900;
    font-size: 13px;
    color: #fff;
    letter-spacing: 0.5px;
}

/* ФИКС ОПИСАНИЯ: Убираем жесткий min-height, чтобы длинный текст NFT не наплывал на цену */
.shop-item-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Стеклянный блик (Фикс: не вылезает за рамки) */
.shop-glass-glare {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
    background-size: 200% 200%;
    background-position: 0% 0%;
    pointer-events: none;
    z-index: 5;
    clip-path: inset(0 round 16px);
    transition: background-position 0.3s ease;
}
.shop-item:active .shop-glass-glare {
    background-position: 100% 100% !important;
}

/* Премиум-подсветка для карточек во вкладке NFT */
.shop-item.nft-item {
    border-color: #ffaa00;
    background: linear-gradient(135deg, #1f1402 0%, #050300 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(255, 170, 0, 0.1);
}
.shop-item.nft-item .shop-item-desc {
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================================================
   👑 ПРЕМИУМ СТИЛИ ДЛЯ ЛЕГЕНДАРОК И NFT СЕКЦИИ (ПОД ТОН)
   ============================================================================ */
.shop-item.legendary, .shop-item.nft-item {
    border-color: #ffaa00;
    background: linear-gradient(135deg, #1f1402 0%, #050300 100%);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(255, 170, 0, 0.1);
}

/* 🔥 ФИКС СВЕЧЕНИЯ ДЛЯ NFT: Применяем drop-shadow к контейнеру-обёртке. 
   Теперь неоновый ореол вокруг робота будет работать идеально и на iOS, и на Android! */
.shop-item.legendary .shop-item-avatar-wrap, 
.shop-item.nft-item .shop-item-avatar-wrap {
    filter: drop-shadow(0 0 10px rgba(255, 170, 0, 0.65));
}

.shop-item.legendary:active, .shop-item.nft-item:active {
    box-shadow: 0 4px 10px rgba(0,0,0,0.7), 0 0 20px rgba(255, 170, 0, 0.5);
}

/* Полноценная редкая анимация для мистических предметов */
.shop-item.epic { border-color: #cc00ff; }
.shop-item.rare { border-color: #0077ff; }

/* Кнопки и цены (Нижний уровень 3D) */
.shop-price-container {
    width: 100%;
    margin-top: auto; /* Намертво прижимает кнопку к низу карточки, как бы она ни растягивалась */
    transform: translateZ(10px);
}
.shop-price-val {
    font-size: 13px;
    font-weight: 800;
    color: #00e5ff;
    margin-bottom: 6px;
    font-family: monospace;
}
.shop-item.nft-item .shop-price-val, .shop-item.legendary .shop-price-val {
    color: #ffaa00;
    text-shadow: 0 0 5px rgba(255,170,0,0.4);
}

.shop-buy-btn {
    background: #00e5ff;
    color: #000;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.5px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
    transition: all 0.2s ease;
}
.shop-item.nft-item .shop-buy-btn, .shop-item.legendary .shop-buy-btn {
    background: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
}
.shop-buy-btn:active {
    transform: scale(0.95);
}

.shop-owned-text {
    color: #39ff14;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 6px 0;
    text-shadow: 0 0 5px rgba(57,255,20,0.4);
}

/* Навигационные табы */
.shop-tabs button {
    background: none;
    border: none;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 12px 6px;
    opacity: 0.4;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.shop-tabs button:active {
    transform: scale(0.88);
}
.shop-tabs button.active-tab {
    opacity: 1 !important;
    font-weight: 900;
}

/* --- СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН И ИНТЕРФЕЙСА ХЕДЕРА --- */
.modal-title-cyan { color: #00e5ff; margin-bottom: 15px; }
.btn-cyan { background: #00e5ff; }
.colony-modal-title { margin-top: 0; color: #00e5ff; letter-spacing: 1px; }
.modal-subtitle { font-size: 12px; color: #aaa; margin-bottom: 20px; }
.modal-btn-group { display: flex; gap: 10px; }

.colony-input {
    width: 100%; padding: 15px; background: rgba(0,0,0,0.6); 
    border: 2px solid #00e5ff; color: white; border-radius: 12px; 
    margin-bottom: 20px; text-align: center; outline: none; 
    font-weight: bold; box-sizing: border-box; font-size: 16px;
}

/* Кнопка отмены внутри стандартных модалок */
.btn-cancel {
    flex: 1; padding: 12px; background: rgba(255,255,255,0.1); color: #fff; 
    border: 1px solid rgba(255,255,255,0.3); border-radius: 10px; font-weight: bold; cursor: pointer;
}
.btn-confirm {
    flex: 2; padding: 12px; background: #00e5ff; color: #000; border: none; 
    border-radius: 10px; font-weight: bold; cursor: pointer; box-shadow: 0 0 15px rgba(0,229,255,0.4);
}

.earth-screen {
    display: none; flex-direction: column; 
    background: radial-gradient(circle at center, #0a122c 0%, #030611 100%); 
    overflow-x: hidden; position: fixed; top:0; left:0; width:100%; height:100%; z-index: 999;
    pointer-events: auto; 
}

/* === КИБЕРПАНК ХЕДЕР И ЦЕНТРАЛЬНЫЙ 3Д ДИСПЛЕЙ === */
.colony-header-cyber {
    position: absolute; /* Меняем на absolute, чтобы двигать независимо от верха */
    top: 18%;           /* Сдвигаем на 18% от верха экрана (аккурат ближе к полю) */
    left: 50%;
    transform: translateX(-50%); /* Идеально центрируем по горизонтали */
    display: flex;
    flex-direction: column; /* Выстраиваем элементы вертикально: сначала дисплей, под ним кнопка */
    align-items: center;
    gap: 12px;          /* Расстояние между 3D дисплеем и кнопкой выхода */
    z-index: 1010;
    width: 90%;
    max-width: 400px;   /* Ограничиваем ширину, чтобы на ПК не растягивалось */
    box-sizing: border-box;
    padding: 0;
}

/* Сам 3D дисплей (немного оптимизируем отступы) */
.holo-display-3d {
    position: relative;
    background: rgba(0, 15, 30, 0.8);
    border: 2px solid #00e5ff;
    border-radius: 16px;
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.25), inset 0 0 15px rgba(0, 229, 255, 0.2);
    transform: perspective(600px) rotateX(-8deg);
    backdrop-filter: blur(10px);
    width: 100%; /* Занимает всю ширину контейнера .colony-header-cyber */
    box-sizing: border-box;
}

/* Анимированный световой блик внутри дисплея */
.holo-glow {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 229, 255, 0.04) 40%, rgba(0, 229, 255, 0.12) 50%, transparent 60%);
    border-radius: 14px;
    pointer-events: none;
}

.holo-colony-name {
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 3px;
    text-shadow: 0 0 10px #00e5ff;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(0, 229, 255, 0.35);
    padding-bottom: 5px;
}

.holo-grid-resources {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.holo-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
}

.holo-badge .label {
    font-size: 9px;
    font-weight: bold;
    color: #8899a6;
    letter-spacing: 1px;
}

.holo-badge .value {
    font-size: 18px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    margin: 3px 0;
}

.holo-badge .speed {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: bold;
}

/* Свечение индикаторов разных ресурсов */
.holo-badge.qnt .value { color: #00e5ff; text-shadow: 0 0 6px rgba(0, 229, 255, 0.6); }
.holo-badge.qubi .value { color: #ffca28; text-shadow: 0 0 6px rgba(255, 202, 40, 0.6); }
.holo-badge.artifact .value { color: #e040fb; text-shadow: 0 0 6px rgba(224, 64, 251, 0.6); }

/* КНОПКА: ВЫХОД В КОСМОС (теперь она под дисплеем) */
.btn-space-exit {
    background: rgba(255, 77, 77, 0.07);
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: #ff4d4d;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.5px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.1);
    width: auto; /* Кнопка не растягивается во всю ширину, а аккуратно сидит по центру */
}

.btn-space-exit:hover {
    background: rgba(255, 77, 77, 0.18);
    border-color: #ff4d4d;
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.3);
    color: #fff;
}

.btn-space-exit:active {
    transform: scale(0.96);
}

.gate-icon {
    font-size: 13px;
    color: #ff4d4d;
}

/* --- ФИКС КНОПКИ ОТМЕНА внутри меню построек --- */
.earth-screen .close-build-btn,
#build-menu .close-build-btn {
    display: block !important;
    vertical-align: middle !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 15px 0 0 0 !important;
    padding: 14px !important;
    background: rgba(255, 49, 49, 0.15) !important;
    color: #ff4d4d !important;
    border: 1px solid rgba(255, 49, 49, 0.4) !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    height: auto !important;
    line-height: normal !important;
}

.earth-screen .close-build-btn:active,
#build-menu .close-build-btn:active {
    background: rgba(255, 49, 49, 0.3) !important;
}

/* --- ФИКС НИЖНЕГО МЕНЮ (ТЕХНОЛОГИЧЕСКИЙ ОТСЕК) --- */
#build-menu.build-modal,
.earth-screen > #build-menu {
    display: none !important; 
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    background: linear-gradient(to top, #030611 85%, rgba(10, 18, 44, 0.98) 100%) !important;
    border-top: 2px solid rgba(0, 229, 255, 0.3) !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 25px 20px 40px 20px !important; 
    box-shadow: 0 -10px 40px rgba(0, 229, 255, 0.2) !important;
    box-sizing: border-box !important;
    z-index: 1000 !important; 
}

#build-menu.build-modal.active,
#build-menu.build-modal.show {
    display: block !important;
}

#build-menu .build-content {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    transform: none !important;
}

.tech-menu-title { margin-top: 0; margin-bottom: 15px; color: #00e5ff; font-size: 18px; letter-spacing: 1px; text-align: center; text-transform: uppercase; }
.matrix-footer { padding: 15px; background: rgba(0,0,0,0.7); font-size: 11px; color: #00e5ff; text-align: center; z-index: 10; letter-spacing: 1px; border-top: 1px solid rgba(0,229,255,0.1); font-family: monospace; }

/* --- МОЩНЫЕ СТИЛИ ДЛЯ ИЗОМЕТРИИ И 3D КУБОВ --- */
.strategy-space {
    flex: 1; display: flex; justify-content: center; align-items: center; perspective: 1000px; padding: 20px; overflow: visible;
}
.building-grid-3d {
    position: relative; display: grid; grid-template-columns: repeat(3, 90px); grid-template-rows: repeat(3, 90px); gap: 15px; 
    transform: rotateX(60deg) rotateZ(-45deg); transform-style: preserve-3d; background: radial-gradient(rgba(0, 229, 255, 0.15), transparent); 
    padding: 20px; border-radius: 20px; box-shadow: 0 0 40px rgba(0,229,255,0.1), inset 0 0 30px rgba(0,229,255,0.2); border: 2px solid rgba(0, 229, 255, 0.3);
}
.slot-3d {
    background: rgba(0, 40, 80, 0.4); border: 2px dashed rgba(0, 229, 255, 0.4); border-radius: 8px;
    position: relative; cursor: pointer; transform-style: preserve-3d; transition: all 0.3s ease;
    display: flex; justify-content: center; align-items: center;
}
.slot-3d:hover {
    background: rgba(0, 229, 255, 0.2); box-shadow: 0 0 15px rgba(0,229,255,0.6); border-style: solid;
}

.building-3d-wrapper {
    position: absolute; width: 40px; height: 40px; transform-style: preserve-3d; transform: translateZ(20px);
}

.building-cube {
    width: 100%; height: 100%; position: relative; transform-style: preserve-3d;
    animation: growUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes growUp {
    from { transform: scaleZ(0); }
    to { transform: scaleZ(1); }
}

.building-cube .cube-face { 
    position: absolute; 
    width: 40px; 
    height: 40px; 
    border: 1px solid rgba(0, 229, 255, 0.8);
    background: rgba(0, 40, 80, 0.5); 
}

.building-cube .face-front  { transform: rotateX(-90deg) translateZ(20px); }
.building-cube .face-back   { transform: rotateX(90deg) translateZ(20px); }
.building-cube .face-left   { transform: rotateY(-90deg) translateZ(20px); }
.building-cube .face-right  { transform: rotateY(90deg) translateZ(20px); }
.building-cube .face-top    { transform: rotateX(0deg) translateZ(20px); background: rgba(0, 229, 255, 0.4) !important; }
.building-cube .face-bottom { transform: rotateX(0deg) translateZ(-20px); }

.slot-level-3d {
    position: absolute; 
    transform: translateZ(55px) rotateZ(45deg) rotateX(-60deg) scale(1.2);
    transform-origin: center;
    top: 50%;
    left: 50%;
    margin-top: -7px;  
    margin-left: -15px; 
    color: #fff; 
    background: #000; 
    border: 1px solid #00e5ff;
    font-size: 9px; 
    padding: 1px 4px; 
    border-radius: 4px; 
    font-weight: bold; 
    white-space: nowrap;
    z-index: 100;
}

.slot-timer-3d {
    position: absolute; 
    /* Поднимаем таймер на ту же высоту, где обычно висит уровень (translateZ(55px)) */
    transform: translateZ(55px) rotateZ(45deg) rotateX(-60deg) scale(1.2);
    transform-origin: center;
    top: 50%;
    left: 50%;
    margin-top: -10px;  /* Центрируем плашку по вертикали */
    margin-left: -20px; /* Центрируем плашку по горизонтали */
    
    color: #ff9100; 
    background: #000; 
    border: 1px solid #ff9100;
    font-size: 10px; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-family: 'Courier New', monospace;
    font-weight: bold;
    white-space: nowrap;
    z-index: 101;
    
    /* Добавляем мягкое футуристичное свечение вокруг таймера */
    box-shadow: 0 0 10px rgba(255, 145, 0, 0.4), inset 0 0 4px rgba(255, 145, 0, 0.2);
    animation: timerPulse 2s infinite ease-in-out;
}

/* Анимация мягкого мерцания для строящегося объекта */
@keyframes timerPulse {
    0% { box-shadow: 0 0 8px rgba(255, 145, 0, 0.3); border-color: rgba(255, 145, 0, 0.7); }
    50% { box-shadow: 0 0 15px rgba(255, 145, 0, 0.6); border-color: rgba(255, 145, 0, 1); }
    100% { box-shadow: 0 0 8px rgba(255, 145, 0, 0.3); border-color: rgba(255, 145, 0, 0.7); }
}

/* --- ОБНОВЛЕННАЯ МОБИЛЬНАЯ АДАПТИВНОСТЬ --- */
@media (max-width: 480px) {
    .colony-header-cyber { 
        top: 14%; /* На мобилках поднимаем чуть выше, чтобы не наезжало на верхние 3D кубы */
        flex-direction: column; /* Строгая вертикальная иерархия */
        gap: 10px;
    }
    
    .holo-display-3d { 
        padding: 8px 16px; 
    }

    .holo-badge .value {
        font-size: 16px; /* Чуть уменьшаем шрифт цифр, чтобы влезало на узких экранах */
    }
}

.planet-creation-overlay {
    display: none; 
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(3, 6, 17, 0.94) !important; 
    backdrop-filter: blur(8px); 
    align-items: center;
    justify-content: center;
    
    /* КРИТИЧЕСКИЙ ФИКС: Окно ОБЯЗАНО принимать клики и не пропускать их вниз */
    pointer-events: auto !important; 
    touch-action: none !important; /* Запрещает скроллить то, что под модалкой */
    
    z-index: 999999 !important;
    transform: translateZ(999px) !important;
}

/* Когда модалка должна быть видна (добавьте этот класс в JS при показе) */
.planet-creation-overlay.active {
    display: flex !important;
}

/* Общий фон окна */
.game-over-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    /* Увеличиваем до максимума, чтобы быть выше всех канвасов */
    z-index: 999999 !important; 
    /* Разрешаем окну принимать клики */
    pointer-events: auto !important; 
}

/* Рамка окна */
.game-over-content {
    background: #0a0000;
    border: 2px solid #ff4b2b;
    padding: 25px;
    border-radius: 24px;
    text-align: center;
    width: 300px;
    box-shadow: 0 0 30px rgba(255, 75, 43, 0.3);
    /* Добавляем на всякий случай здесь тоже */
    pointer-events: auto !important;
}

/* Заголовок */
.game-over-title {
    color: #ff4b2b !important;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* Контейнер для строк */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

/* Сама строка (подложка под иконку и число) */
.result-row {
    display: flex;
    justify-content: space-between; /* Название слева, число справа */
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 12px;
}

/* Левая часть: иконка + QUANT/QUBI */
.result-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff; /* Текст названия ресурса */
    font-size: 13px;
    font-weight: bold;
}

.res-icon {
    width: 42px;          /* Твой размер */
    height: 42px;         /* Твой размер */
    object-fit: contain;  /* Сохраняет пропорции внутри квадрата */
    flex-shrink: 0;       /* ЗАПРЕЩАЕТ деформацию (ВАЖНО) */
    display: block;       /* Убирает лишние отступы снизу */
}

/* Правая часть: Число (стиль берется из JS, тут только шрифт) */
.res-value {
    font-size: 18px;
    font-weight: 800;
    font-family: monospace; /* Чтобы цифры были ровными */
}

/* Кнопка */
.restart-btn {
    width: 100%;
    padding: 15px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 50px;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    /* Явно указываем, что кнопка должна реагировать */
    pointer-events: all !important;
    position: relative;
    z-index: 10;
}

/* Группа кнопок */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Основная кнопка (Белая) */
.restart-btn.primary {
    background: #fff;
    color: #000;
}

/* Вторая кнопка (Контурная) */
.restart-btn.secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

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

/* СТИЛИ ДЛЯ ПЛАНЕТЫ ГИЛЬДИЯ */

/* Строка клана в рейтинге */
#clans-list-container div, #clan-members-list div {
    transition: background 0.2s ease, border-color 0.2s ease;
}

#clans-list-container div:hover {
    background: rgba(0, 229, 255, 0.05) !important;
    border-color: #00e5ff !important;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

/* Красивые интерактивные кнопки */
#clan-window button {
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#clan-window button:hover {
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
    filter: brightness(1.2);
}

#clan-window button:active {
    transform: scale(0.98);
}

/* Кастомизация инпута для ввода названия */
#new-clan-name-input:focus {
    outline: none;
    border-color: #ff8100 !important;
    box-shadow: 0 0 10px rgba(255, 129, 0, 0.3);
}

/* Красивый скроллбар для длинных списков кланов */
#clan-window::-webkit-scrollbar {
    width: 6px;
}
#clan-window::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
#clan-window::-webkit-scrollbar-thumb {
    background: #00e5ff;
    border-radius: 3px;
}

/* Полный экран лоадера */
#cyber-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #030712;
    z-index: 9999; /* Выше всего интерфейса */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Orbitron', 'Courier New', monospace;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 35px;
    width: 80%;
    max-width: 400px;
}

/* 3D Вращающийся Куб */
.cube-wrapper {
    position: relative;
    width: 80px; height: 80px;
    perspective: 400px;
}

.cube {
    width: 100%; height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    animation: rotateCube 4s infinite linear;
}

.cube-face {
    position: absolute;
    width: 80px; height: 80px;
    background: rgba(0, 229, 255, 0.03);
    border: 2px solid #00e5ff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3), inset 0 0 10px rgba(0, 229, 255, 0.2);
}

/* Позиционирование граней 3D куба */
.face-front  { transform: rotateY(  0deg) translateZ(40px); }
.face-back   { transform: rotateY(180deg) translateZ(40px); }
.face-left   { transform: rotateY(-90deg) translateZ(40px); border-color: #00ffcc; box-shadow: 0 0 15px rgba(0, 255, 204, 0.3); }
.face-right  { transform: rotateY( 90deg) translateZ(40px); border-color: #00ffcc; box-shadow: 0 0 15px rgba(0, 255, 204, 0.3); }
.face-top    { transform: rotateX( 90deg) translateZ(40px); }
.face-bottom { transform: rotateX(-90deg) translateZ(40px); }

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* Лазерная линия сканирования */
.scan-line {
    position: absolute;
    top: 0; left: -10px;
    width: 100px; height: 4px;
    background: #00ffcc;
    box-shadow: 0 0 12px #00ffcc, 0 0 25px #00ffcc;
    animation: scanMove 2s infinite ease-in-out;
    pointer-events: none;
}

@keyframes scanMove {
    0%, 100% { top: -10px; opacity: 0; }
    50% { top: 90px; opacity: 1; }
}

/* Тексты загрузки */
.loader-text-status {
    text-align: center;
}

.glitch-loader {
    font-size: 16px;
    font-weight: 900;
    color: #00e5ff;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.loader-sub-text {
    font-size: 9px;
    color: #4b5e80;
    margin-top: 6px;
    letter-spacing: 1px;
}

/* Полоса прогресса (Киберпанк стиль) */
.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(75, 94, 128, 0.15);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

#loader-progress-fill {
    height: 100%;
    width: 0%; /* Контролируется через JS */
    background: linear-gradient(90deg, #00ffcc, #00e5ff);
    box-shadow: 0 0 10px #00e5ff;
    transition: width 0.3s ease-out;
}

#loader-percentage {
    font-size: 12px;
    color: #00ffcc;
    font-weight: bold;
}

/* ============================================================================
   🌌 ИЗОЛИРОВАННЫЙ МОДУЛЬ QUBI PASS (БЕЗ КОНФЛИКТОВ И ГЛЮКОВ)
   ============================================================================ */

/* Оверлей меню */
#qubi-pass-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at 50% 10%, #0d1a30 0%, #020612 100%);
    z-index: 100000;
    display: none; 
    flex-direction: column;
    font-family: 'Urbanist', system-ui, -apple-system, sans-serif;
    color: #fff;
    overflow: hidden;
    pointer-events: none; 
}

#qubi-pass-overlay.active {
    display: flex;
    pointer-events: auto; 
}

/* 3D Моделирование сцены куба */
#qubi-pass-overlay .cube-scene { 
    width: 70px; height: 70px; 
    perspective: 350px; 
    margin: 0 auto; 
    position: relative;
    cursor: pointer;
}

/* 🛡️ ЖЕСТКАЯ ПРИВЯЗКА К ПАССУ: Больше не пересекается с лоадером */
#qubi-pass-overlay .cube { 
    width: 100%; height: 100%; 
    position: relative; 
    transform-style: preserve-3d; 
    transform: rotateX(-25deg) rotateY(45deg); 
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease; 
}

#qubi-pass-overlay .cube-face { 
    position: absolute; 
    width: 70px; height: 70px; 
    background: rgba(10, 25, 50, 0.85); 
    border: 1.5px solid rgba(0, 229, 255, 0.4); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-sizing: border-box;
    box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.3);
    transition: all 0.4s;

    /* 🚀 ФИКС ФРИЗОВ: Включаем аппаратное ускорение для 3D на iOS */
    transform: translateZ(0);
    will-change: transform; 
}

/* 🛡️ ФИКС СТЕНЫ: Теперь эти 35px принадлежат ТОЛЬКО Пассу и не ломаются ангаром */
#qubi-pass-overlay .front  { transform: rotateY(0deg) translateZ(35px); }
#qubi-pass-overlay .back   { transform: rotateY(180deg) translateZ(35px); }
#qubi-pass-overlay .right  { transform: rotateY(90deg) translateZ(35px); }
#qubi-pass-overlay .left   { transform: rotateY(-90deg) translateZ(35px); }
#qubi-pass-overlay .top    { transform: rotateX(90deg) translateZ(35px); }
#qubi-pass-overlay .bottom { transform: rotateX(-90deg) translateZ(35px); }

/* Состояние: Заблокирован */
#qubi-pass-overlay .cube-locked .cube-face {
    background: rgba(20, 25, 35, 0.9);
    border-color: rgba(255,255,255,0.1);
    box-shadow: none;
}

/* Состояние: Текущий уровень (Синее вращение) */
#qubi-pass-overlay .cube-current { animation: qp_cubeSpin 6s infinite linear; }
#qubi-pass-overlay .cube-current .cube-face {
    border-color: #00e5ff;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.5), 0 0 10px rgba(0, 229, 255, 0.2);
}

/* Состояние: Готов к открытию (Зеленое парение) */
#qubi-pass-overlay .cube-ready { animation: qp_cubeFloat 2.5s infinite ease-in-out; }
#qubi-pass-overlay .cube-ready .cube-face {
    background: rgba(10, 45, 30, 0.85);
    border-color: #00ff66;
    box-shadow: inset 0 0 20px rgba(0, 255, 102, 0.6), 0 0 15px rgba(0, 255, 102, 0.3);
}

/* Эффект взрыва куба при сборе */
#qubi-pass-overlay .cube.cube-open { 
    transform: scale(0) rotateX(180deg) rotateY(360deg) !important; 
    opacity: 0 !important; 
    pointer-events: none !important;
}

/* 3D Динамическая Тень */
#qubi-pass-overlay .cube-shadow {
    position: absolute; 
    bottom: -15px; left: 10px; 
    width: 50px; height: 8px;
    background: rgba(0, 0, 0, 0.6); 
    border-radius: 50%; 
    filter: blur(4px);
    transform: rotateX(90deg); 
    z-index: -1; 
    transition: transform 0.45s, opacity 0.45s;
}

#qubi-pass-overlay .cube-ready + .cube-shadow { animation: qp_shadowPulse 2.5s infinite ease-in-out; }

#qubi-pass-overlay .cube-shadow.shadow-hide { 
    opacity: 0 !important; 
    transform: scale(0) rotateX(90deg) !important; 
}

/* Уникальные анимации для Пасса, чтобы не конфликтовать с Лоадером */
@keyframes qp_cubeSpin {
    from { transform: rotateX(-25deg) rotateY(0deg); }
    to { transform: rotateX(-25deg) rotateY(360deg); }
}
@keyframes qp_cubeFloat {
    0%, 100% { transform: translateY(0) rotateX(-25deg) rotateY(45deg); }
    50% { transform: translateY(-12px) rotateX(20deg) rotateY(225deg); }
}
@keyframes qp_shadowPulse {
    0%, 100% { transform: scale(1) rotateX(90deg); opacity: 0.6; filter: blur(4px); }
    50% { transform: scale(0.6) rotateX(90deg); opacity: 0.2; filter: blur(7px); }
}

/* Состояние: Награда собрана */
#qubi-pass-overlay .cube-collected {
    transform: rotateX(-25deg) rotateY(135deg) scale(0.85);
    opacity: 0.2;
}
#qubi-pass-overlay .cube-collected .cube-face {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}
#qubi-pass-overlay .cube-collected .cube-face span {
    filter: grayscale(1) opacity(0.3);
}

/* ============================================================================
   🌌 ГЛОБАЛЬНЫЙ ФИКС ДЛЯ ВСЕХ МОДАЛЬНЫХ ОКОН ИГРЫ (БЛОКИРОВКА СКВОЗНЫХ КЛИКОВ)
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 5, 15, 0.85); 
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; 
    pointer-events: auto;
}

.modal-overlay[style*="display: none"] {
    pointer-events: none !important;
}

/* ============================================================================
   🌌 ПОЛНОЭКРАННАЯ СТРАНИЦА АНГАРА — ТЕПЕРЬ ПОЛНОСТЬЮ СКРОЛЛИТСЯ ЦЕЛИКОМ
   ============================================================================ */
.scifi-fullscreen-page {
    position: fixed !important; 
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh !important; 
    background: radial-gradient(circle at center, #0a1b3a 0%, #030812 100%);
    color: #fff;
    
    /* 🔥 ФИКС: Увеличили верхний отступ, чтобы кнопка возврата и заголовок не слипались */
    padding: 110px 20px 40px 20px;  
    
    display: flex;
    flex-direction: column;
    z-index: 999999 !important; 
    
    overflow-y: auto !important; 
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important; 
    touch-action: auto !important; 
    
    box-sizing: border-box;
    pointer-events: auto !important; 
}

.scifi-fullscreen-page * {
    pointer-events: auto !important;
    box-sizing: border-box;
}

/* НЕОНОВЫЙ СКРОЛЛБАР ДЛЯ ВСЕГО ЭКРАНА АНГАРА */
.scifi-fullscreen-page::-webkit-scrollbar {
    width: 6px !important;
}
.scifi-fullscreen-page::-webkit-scrollbar-track {
    background: #030812 !important;
}
.scifi-fullscreen-page::-webkit-scrollbar-thumb {
    background: #00e5ff !important;
    border-radius: 4px;
    box-shadow: 0 0 8px #00e5ff;
}

/* Кнопка НАЗАД (Вернуться в космос) */
.scifi-back-btn {
    align-self: flex-start;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #00e5ff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    text-shadow: 0 0 5px #00e5ff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.1);
    transition: all 0.2s;
    margin-bottom: 15px;
}
.scifi-back-btn:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: #00e5ff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

/* Заголовок (Оборудование станции) */
.fullscreen-title {
    margin: 30px 0 25px 0; 
    font-size: 18px; 
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6); 
}

/* ============================================================================
   📦 ТРЁХМЕРНЫЙ НЕОНОВЫЙ КУБ — ПОЛНОСТЬЮ ГОЛУБОЙ И ЧИСТЫЙ
   ============================================================================ */
.cube-hub-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0 25px 0; 
    flex-shrink: 0;
}

.scene3d {
    width: 80px;
    height: 80px;
    perspective: 400px;
}

.cube3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 8s infinite linear;
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* 🔥 Все грани теперь строго одинакового неоново-голубого цвета */
.face {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(0, 229, 255, 0.03);
    
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    
    border: 1.5px solid #00e5ff;
    box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.3), 0 0 8px rgba(0, 229, 255, 0.2);
    transition: all 0.3s;
}

.front  { transform: rotateY(0deg) translateZ(40px); }
.back   { transform: rotateY(180deg) translateZ(40px); }
.right  { transform: rotateY(90deg) translateZ(40px); }
.left   { transform: rotateY(-90deg) translateZ(40px); }
.top    { transform: rotateX(90deg) translateZ(40px); }
.bottom { transform: rotateX(-90deg) translateZ(40px); }

/* Тень под кубом */
.cube-shadow {
    width: 60px;
    height: 6px;
    background: rgba(0, 229, 255, 0.25);
    border-radius: 50%;
    margin-top: 15px;
    filter: blur(4px);
    animation: shadowPulse 2s infinite ease-in-out;
}
@keyframes shadowPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

/* ============================================================================
   🖥️ ХАРАКТЕРИСТИКИ: ТРЁХМЕРНЫЙ КИБЕРНЕТИЧЕСКИЙ ДИСПЛЕЙ
   ============================================================================ */
.fullscreen-bars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px; 
    perspective: 500px; 
    flex-shrink: 0;
}
@media (max-width: 650px) {
    .fullscreen-bars-grid { grid-template-columns: 1fr; gap: 10px; }
}

.scifi-progress-wrapper { 
    margin-bottom: 0; 
    background: linear-gradient(135deg, rgba(10, 30, 60, 0.4) 0%, rgba(2, 8, 20, 0.8) 100%);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 229, 255, 0.05);
    transform: rotateX(10deg); 
    backdrop-filter: blur(2px);
    transform-style: preserve-3d;
}

.bar-label {
    font-size: 9px;
    color: #88a0c0;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    font-weight: bold;
    transform: translateZ(10px);
}

.scifi-bar-outer {
    position: relative;
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.border-hp { border: 1px solid rgba(255, 51, 0, 0.3); }
.border-energy { border: 1px solid rgba(0, 229, 255, 0.3); }
.border-regen { border: 1px solid rgba(157, 0, 255, 0.3); }

.scifi-bar-fill {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-size: 30px 30px;
    background-image: linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.08) 75%, transparent 75%, transparent);
}

.fill-hp { background-color: #ff3300; box-shadow: 0 0 10px rgba(255, 51, 0, 0.4); }
.fill-energy { background-color: #00e5ff; box-shadow: 0 0 10px rgba(0, 229, 255, 0.4); }
.fill-regen { background-color: #9d00ff; box-shadow: 0 0 10px rgba(157, 0, 255, 0.4); }

.bar-digits {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
}

/* Ресурсы и слоты */
.fullscreen-resource-ticker {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    margin-bottom: 25px; 
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.scifi-section-label {
    font-size: 11px;
    font-weight: bold;
    color: #00e5ff;
    margin: 15px 0 10px 0; 
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.scifi-slots-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 28px; 
    flex-shrink: 0;
}
.scifi-slot-mini {
    width: 18%;
    aspect-ratio: 1/1;
    max-width: 75px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(0, 229, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scifi-slot-mini.filled {
    border: 1px solid #00e5ff;
    background: rgba(0, 229, 255, 0.08);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}
.scifi-slot-mini img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

/* ============================================================================
   📂 КУЗОВ ХРАНИЛИЩА И НЕОНОВЫЕ ТАБЫ
   ============================================================================ */
.storage-section {
    display: flex;
    flex-direction: column;
    flex-shrink: 0; 
}

.storage-tabs {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 16px; 
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #4e6b8c;
    padding: 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}
.tab-btn.active {
    background: rgba(0, 229, 255, 0.1);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.3);
    text-shadow: 0 0 5px #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.05);
}

/* ============================================================================
   📂 ОБЕРТКА ХРАНИЛИЩА (ИНВЕНТАРЯ) — РАСКРЫВАЕТСЯ НА ПОЛНУЮ ВЫСОТУ
   ============================================================================ */
.fullscreen-inventory-wrapper {
    overflow-y: visible !important; 
    overflow-x: hidden !important;
    height: auto !important;
    min-height: auto !important;
    flex-grow: 0 !important;
    
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px !important; 
}

.scifi-inventory-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 10px !important;
    width: 100%;
    height: auto !important; 
    perspective: 1000px; 
}

/* Стили стандартных предметов */
.scifi-item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 12px !important;
    height: 54px !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.scifi-item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}
.scifi-item-card img {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.2));
}
.scifi-item-card div {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
    overflow: hidden;
}
.scifi-item-card span {
    font-size: 11px !important;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Настройки редкостей */
.scifi-item-card.common { border-color: rgba(0, 229, 255, 0.2); }
.scifi-item-card.uncommon { border-color: rgba(30, 255, 0, 0.2); }
.scifi-item-card.rare { border-color: rgba(0, 112, 221, 0.3); }
.scifi-item-card.epic { border-color: rgba(163, 53, 238, 0.3); }
.scifi-item-card.legendary { border-color: rgba(255, 128, 0, 0.4); box-shadow: 0 0 6px rgba(255, 128, 0, 0.1); }

.scifi-item-card.equipped {
    background: rgba(0, 229, 255, 0.06) !important;
    border-color: #00e5ff !important;
    box-shadow: inset 0 0 6px rgba(0, 229, 255, 0.15);
}

/* ============================================================================
   👑 ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ МЕГА-КРУТЫХ 3D NFT КАРТОЧЕК В ПАССЕ И АНГАРЕ
   ============================================================================ */

/* 1. ГЛАВНЫЙ КОНТЕЙНЕР (Включает 3D-перспективу для всего, что внутри) */
.scifi-nft-card-3d {
    perspective: 1000px;
    width: 100%;
    max-width: 220px;
    height: 240px; /* Оптимальная высота для полноценной Sci-Fi карты */
    margin: 10px auto;
    background: none;
    border: none;
    padding: 0;
    touch-action: pan-y !important; /* Чтобы страница листалась, если свайпать по картам */
}

/* 2. ВНУТРЕННЕЕ 3Д ТЕЛО КАРТОЧКИ (Слоеный пирог) */
.nft-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #071329 0%, #030812 100%);
    border: 2px solid var(--nft-glow, #00e5ff);
    border-radius: 14px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(0, 229, 255, 0.1);
    
    /* Самый важный флаг для параллакса слоев */
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}

/* Эффект наклона при наведении (ПК) и при удержании пальцем (Смартфоны) */
.scifi-nft-card-3d:hover .nft-card-inner,
.scifi-nft-card-3d:active .nft-card-inner,
.scifi-nft-card-3d:focus-within .nft-card-inner {
    transform: rotateX(12deg) rotateY(-10deg) translateY(-4px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.9), 0 0 25px var(--nft-glow, #00e5ff);
}

/* 3. ЭФФЕКТ БЛИКА СТЕКЛА */
.nft-glass-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Используем градиент меньшего размера, чтобы он не вылезал */
    background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
    transition: background-position 0.6s ease;
    background-size: 200% 200%;
    background-position: 0% 0%;
    pointer-events: none;
    z-index: 5;
    
    /* Жесткая маска по контуру карточки, убирающая любые полосы и вылеты под ней */
    clip-path: inset(0 round 14px); 
    
    /* Переводим в плоскость чуть выше фона, но ниже робота */
    transform: translateZ(1px); 
}

/* Блик динамически "бежит" по стеклу при наклоне (ПК) */
.scifi-nft-card-3d:hover .nft-glass-glare,
.scifi-nft-card-3d:focus-within .nft-glass-glare {
    background-position: 100% 100%;
}

/* 4. ФОНОВАЯ НЕОНОВАЯ СЕТКА КИБЕРАРЕНЫ */
.nft-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
    background-size: 12px 12px;
    border-radius: 12px;
    pointer-events: none;
}

/* 5. КОНТЕЙНЕР ДЛЯ ГОЛОГРАММЫ (Выталкиваем робота вперед!) */
.nft-avatar-hologram {
    position: relative;
    width: 95px;
    height: 95px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    border: 1px dashed var(--nft-glow, #00e5ff);
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Эффект парения над картой */
    transform: translateZ(35px); 
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* При наклоне робот вылетает еще сильнее навстречу игроку */
.scifi-nft-card-3d:hover .nft-avatar-hologram,
.scifi-nft-card-3d:active .nft-avatar-hologram {
    transform: translateZ(50px) scale(1.05);
}

/* Изображение/SVG внутри голограммы */
.nft-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--nft-glow, #00e5ff));
}

/* 6. БЛОК ИНФОРМАЦИИ (Парит чуть ниже робота) */
.nft-info-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transform: translateZ(20px); /* Парит между фоном и роботом */
}

.nft-card-name {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.nft-card-badge {
    display: block;
    font-size: 11px;
    color: #ffea00;
    margin-bottom: 6px;
    text-shadow: 0 0 5px rgba(255, 234, 0, 0.4);
    font-weight: bold;
}

/* 7. ТЕХНОЛОГИЧНАЯ КНОПКА ЗАБИРАНИЯ */
.nft-claim-btn {
    background: var(--nft-glow, #00e5ff);
    border: none;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 0 10px var(--nft-glow, #00e5ff);
    transition: all 0.2s;
    width: 100%;
    
    /* Кнопка должна быть кликабельной в 3D пространстве */
    transform: translateZ(15px); 
    pointer-events: auto !important;
}

.nft-claim-btn:hover:not(:disabled) {
    filter: brightness(1.2) contrast(1.1);
    box-shadow: 0 0 15px var(--nft-glow, #00e5ff);
}

.nft-claim-btn:disabled {
    background: #16222f !important;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: none !important;
    color: #4a6580;
    cursor: not-allowed;
    text-shadow: none;
}

/* Оставляем старые классы нетронутыми на всякий случай */
.pass-nft-reward-card, .nft-card-3d-internal, .nft-card-shine, .nft-robot-svg-wrap, .nft-card-info, .nft-title, .nft-mult, .scifi-nft-card-placed, .nft-mini-svg, .nft-mini-details {
    display: inherit; 
}

/* СТРОГИЕ ЦВЕТА ДЛЯ РЕСУРСОВ */
.glow-qubi { color: #ffea00; }
.glow-quant { color: #00f0ff; }
.glow-nft { color: #ff007f; }
.glow-hp { color: #ff3300; }
.glow-energy { color: #00e5ff; }
.glow-regen { color: #9d00ff; }

/* ============================================================================
   📱 БРОНЕБОЙНЫЙ 3D-ТАЧ ДЛЯ СМАРТФОНОВ (ФИКС АНГАРНЫХ И ПАСС КАРТОЧЕК)
   ============================================================================ */

/* 1. Настройка размеров для карточек в Ангаре (чтобы не ломали скролл) */
.scifi-nft-card-3d.hangar-version {
    display: inline-block !important;
    vertical-align: top;
    margin: 10px 8px;
    width: 150px;       /* Идеальный размер для горизонтальной ленты */
    height: 210px;      /* Пропорциональное сжатие высоты */
    flex-shrink: 0;     /* Запрещаем карточкам сжиматься в flex-контейнере */
}

/* 2. Триггерим наклон ОТ РОДИТЕЛЬСКОГО контейнера при таче (:active) */
.scifi-nft-card-3d:active .nft-card-inner {
    transform: rotateX(16deg) rotateY(-14deg) scale(0.94) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8), 0 0 20px var(--nft-glow) !important;
    transition: transform 0.05s ease-out !important; /* Ультра-быстрый отклик на палец */
}

/* 3. Принудительный сдвиг блика при таче для создания эффекта игры света */
.scifi-nft-card-3d:active .nft-glass-glare {
    background-position: 120% 120% !important;
    transition: background-position 0.05s ease-out !important;
}

/* 4. При таче выталкиваем голограмму робота ЕЩЕ сильнее вперед (Параллакс) */
.scifi-nft-card-3d:active .nft-avatar-hologram {
    transform: translateZ(55px) scale(1.08) !important;
    transition: transform 0.05s ease-out !important;
}

/* 5. Убираем задержку подсвечивания тапа в WebKit (iOS/Android синие дефолтные рамки) */
.scifi-nft-card-3d, .nft-card-inner {
    -webkit-tap-highlight-color: transparent !important;
}

/* Общий контейнер PvP окон */
#pvp-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    height: 80vh;
    max-height: 600px;
    z-index: 10000;
    font-family: 'Courier New', Courier, monospace;
    
    /* 🛡️ ФИКС: Сам контейнер не мешает кликать по игре, если он пустой */
    pointer-events: none; 
}

/* Базовый экран (интерфейс окон) */
.pvp-screen {
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 16, 0.95);
    border: 2px solid #ff4b2b;
    box-shadow: 0 0 25px rgba(255, 75, 43, 0.3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;

    /* 🛡️ ФИКС: Окно PvP ЖЕСТКО забирает все клики и тачи себе, не пуская их к планете */
    pointer-events: auto; 
}

/* Шапка меню логов */
.pvp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 75, 43, 0.1);
    border-bottom: 1px solid rgba(255, 75, 43, 0.3);
}

.pvp-header h3 {
    margin: 0;
    color: #ff4b2b;
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 75, 43, 0.5);
}

.pvp-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.pvp-close-btn:hover { color: #ff4b2b; }

/* Контейнер элементов истории */
#battle-logs-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Строка лога атак */
.log-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    box-sizing: border-box;
    transition: background 0.3s;
}
.log-row-item:hover {
    background: rgba(255, 75, 43, 0.05);
    border-color: rgba(255, 75, 43, 0.2);
}

/* Кнопки действий */
.pvp-action-btn {
    margin: 15px;
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.search-btn {
    background: linear-gradient(180deg, #ff5e3a 0%, #ff4b2b 100%);
    color: #fff;
    transition: transform 0.1s;
}
.search-btn:active { transform: scale(0.98); }

/* РАДАР И АНИМАЦИЯ */
#pvp-radar-overlay {
    justify-content: center;
    align-items: center;
    background: #020206;
}

.radar-container {
    text-align: center;
}

.radar-circle {
    position: relative;
    width: 160px;
    height: 160px;
    border: 2px solid #ff4b2b;
    border-radius: 50%;
    margin: 0 auto 25px;
    background: radial-gradient(circle, rgba(255,75,43,0.05) 0%, rgba(0,0,0,0) 70%);
    box-shadow: 0 0 20px rgba(255, 75, 43, 0.15);
}

.radar-line {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255,75,43,0.4) 0%, rgba(0,0,0,0) 50%);
    animation: radar-spin 2s linear infinite;
}

@keyframes radar-spin {
    100% { transform: rotate(360deg); }
}

#radar-status {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* КАРТОЧКА НАЙДЕННОЙ ЦЕЛИ */
.pvp-card {
    position: relative;
    padding: 30px 20px;
    justify-content: space-between;
    border-color: #00e5ff;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.2);
}

.card-title {
    color: #00e5ff;
    font-size: 18px;
    text-align: center;
    margin: 0 0 20px 0;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.card-info-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.card-label {
    font-size: 9px;
    color: #666;
    margin-bottom: 4px;
}

.card-value {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.loot-color { color: #ffea00; text-shadow: 0 0 5px rgba(255, 234, 0, 0.3); }
.shield-color { color: #9d00ff; }

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.pvp-btn {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-primary { background: linear-gradient(180deg, #00e5ff 0%, #0097a7 100%); color: #000; }
.btn-secondary { background: rgba(255, 255, 255, 0.05); color: #888; border: 1px solid rgba(255,255,255,0.1); }

/* ⏱️ СТИЛИ ТАЙМЕРА ОТСЧЕТА ПЕРЕД БОЕМ */
#pvp-countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: bold;
    color: #ff4b2b;
    text-shadow: 0 0 30px rgba(255, 75, 43, 0.8);
    z-index: 10005;
    font-family: sans-serif;
    pointer-events: none;
    letter-spacing: 2px;
}

/* ========================================================================= */
/* 🛡️ ФИКС МАСШТАБА И СЛОЕВ ДЛЯ КАНВАСОВ (ПЕРЕКРЫВАЕТ СТАРЫЕ СТИЛИ ВЫШЕ)     */
/* ========================================================================= */

#gameCanvas {
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1 !important; 
    touch-action: none !important;
}

#pvpCanvas {
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important; 
    touch-action: none !important;
}

/* ============================================================================
   🪐 ТОЧНЫЙ СТИЛЬ АНГАРА И ОПТИМИЗАЦИЯ 3D-КУБА (iOS) + ОБНОВЛЕННЫЙ СИНТЕЗ
   ============================================================================ */

.scifi-fullscreen-page-reactor {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: #020612; 
    color: #fff;
    padding: calc(85px + env(safe-area-inset-top)) 16px 20px 16px;
    display: flex; 
    flex-direction: column; 
    box-sizing: border-box; 
    
    /* 🔥 ЭЛЕГАНТНАЯ БЛОКИРОВКА СЛОЕВ: */
    z-index: 999999;
    pointer-events: auto !important; /* Окно полностью берет все клики на себя */
    touch-action: pan-x pan-y; /* Разрешаем внутренние скроллы инвентаря, блокируя системный фон iOS */
}

.reactor-header-panel { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.scifi-back-btn-reactor { background: rgba(0,229,255,0.04); border: 1px solid rgba(0,229,255,0.25); color: #00e5ff; padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: bold; }
.reactor-main-title { font-size: 14px; font-weight: 900; letter-spacing: 1.5px; color: #fff; text-shadow: 0 0 7px #00e5ff; }

/* 🧬 ТУГГЛЕР ПЕРЕКЛЮЧЕНИЯ РЕЖИМОВ (ВКЛАДКИ) */
.reactor-tabs-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
    width: 100%;
}
.reactor-tab-trigger {
    flex: 1;
    background: rgba(0, 229, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.15);
    color: #4b6584;
    padding: 10px;
    font-family: monospace;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.25s ease;
}
.reactor-tab-trigger.active {
    background: rgba(0, 229, 255, 0.12);
    color: #00e5ff;
    border-color: #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* Контроль видимости зон */
.reactor-mode-view { display: none; width: 100%; }
.reactor-mode-view.active { display: flex; flex-direction: column; }

/* Зона Компактного Куба (Режим Расщепления) */
.cube-reactor-dropzone {
    width: 100%; height: 38vh; /* Сделали зону чуть компактнее, чтобы куб не казался размытым гигантом */
    background: radial-gradient(circle at center, rgba(6,18,40,0.5) 0%, #030611 100%);
    border: 1px solid rgba(0, 229, 255, 0.15); border-radius: 16px;
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
}

/* Зона Компактного Куба (Режим Расщепления) */
.cube-reactor-dropzone {
    width: 100%; 
    height: 35vh; /* Фиксированная высота в процентах от экрана */
    min-height: 240px; /* Минимальный физический порог для инициализации Canvas */
    background: radial-gradient(circle at center, rgba(6,18,40,0.5) 0%, #030611 100%);
    border: 1px solid rgba(0, 229, 255, 0.15); 
    border-radius: 16px;
    position: relative; 
    overflow: hidden; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-sizing: border-box;
}

/* Отрегулированное позиционирование холста */
#reactor3DCanvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100% !important; 
    height: 100% !important; 
    pointer-events: none; 
    z-index: 5; 
}

.drop-here-text { font-size: 9px; font-weight: bold; color: #3b4d61; letter-spacing: 1px; position: absolute; bottom: 12px; z-index: 10; text-align: center; width: 100%; }

/* 🧪 НОВАЯ ЗОНА СИНТЕЗА (ДВУХМЕСТНЫЙ СЛИЯТЕЛЬ) */
.fusion-slots-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
    height: 38vh;
    background: radial-gradient(circle at center, rgba(14, 6, 40, 0.3) 0%, #030611 100%);
    border: 1px solid rgba(182, 36, 255, 0.15);
    border-radius: 16px;
    box-sizing: border-box;
    padding: 10px;
}
.fusion-core-sign {
    font-size: 24px;
    font-weight: 900;
    color: #b624ff;
    text-shadow: 0 0 8px #b624ff;
    font-family: monospace;
}
.fusion-ui-slot {
    width: 140px;
    height: 180px;
    border: 2px dashed rgba(0, 229, 255, 0.25);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(2, 6, 18, 0.6);
    box-sizing: border-box;
    position: relative;
}
.fusion-slot-empty-text {
    font-size: 8px;
    font-weight: 900;
    color: #2c3a4e;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.3;
    padding: 0 10px;
}

/* Кнопка запуска протокола слияния */
.fusion-action-trigger {
    width: 100%;
    background: linear-gradient(135deg, #b624ff, #00e5ff);
    border: none;
    padding: 14px;
    color: #fff;
    font-family: monospace;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    border-radius: 10px;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(182, 36, 255, 0.3);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
}
.fusion-action-trigger:disabled {
    background: #080f24;
    color: #2c3a4e;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: none;
    cursor: not-allowed;
}

/* Эффект взрыва */
.flash-overlay-effect { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #ffffff; z-index: 99; opacity: 0; pointer-events: none; }
.flash-strike { animation: strikeFlashAnim 0.45s ease-out forwards; }
@keyframes strikeFlashAnim {
    0% { opacity: 1; background: #fff; }
    40% { opacity: 1; background: #00e5ff; filter: blur(2px); }
    100% { opacity: 0; filter: blur(10px); }
}

/* Статистика */
.reactor-stats-mid { margin: 12px 0; }
.mid-stat { background: #040a19; border: 1px solid rgba(0,229,255,0.2); border-radius: 10px; padding: 12px; text-align: center; }
.stat-label { font-size: 9px; color: #4b6584; font-weight: 900; margin-bottom: 3px; letter-spacing: 0.5px; }
.stat-value-cyan { font-size: 18px; font-weight: 900; color: #00ffcc; text-shadow: 0 0 8px rgba(0,255,204,0.5); }

/* Лента NFT из Ангара */
.reactor-lower-inventory { width: 100%; background: #030714; border: 1px solid rgba(0,229,255,0.06); border-radius: 14px; padding: 14px 10px; box-sizing: border-box; overflow-x: auto; }
.inventory-scroll-wrapper { display: flex; gap: 14px; width: max-content; }

/* 🔥 ИНТЕГРАЦИЯ АНФАР-3D КАРТОЧЕК В ЛЕНТУ РЕАКТОРА */
.reactor-card-fix {
    width: 135px !important; 
    height: 195px !important; /* Компактная высота для горизонтального пула */
    flex-shrink: 0;
    margin: 0 !important;
}

/* Фикс внутренних отступов и размеров элементов для реактора */
.reactor-card-fix .nft-card-inner {
    padding: 10px 6px !important;
}

.reactor-card-fix .nft-avatar-hologram {
    width: 65px !important;
    height: 65px !important;
    transform: translateZ(20px);
}

.reactor-card-fix .scifi-nft-card-3d:hover .nft-avatar-hologram,
.reactor-card-fix .scifi-nft-card-3d:active .nft-avatar-hologram {
    transform: translateZ(30px) scale(1.03);
}

.reactor-card-fix .nft-card-name {
    font-size: 10px !important;
}

.reactor-card-fix .nft-multiplier-tag {
    font-size: 9px !important;
    margin-top: 2px !important;
    padding-top: 0 !important;
}

/* --- АДАПТАЦИЯ СЛОТОВ СЛИЯНИЯ ПОД НОВЫЙ 3D-СТИЛЬ --- */
.fusion-ui-slot {
    width: 135px;
    height: 195px;
    border: 2px dashed rgba(0, 229, 255, 0.25);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(2, 6, 18, 0.6);
    box-sizing: border-box;
    position: relative;
    perspective: 1000px; /* Добавляем 3D глубину слотам */
}

/* Стилизация карточки, когда её закинули в слот А или Б */
.fusion-ui-slot .nft-card-inner {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Свичи динамических подсветок рамок по data-rarity для слотов слияния */
.fusion-ui-slot[data-rarity="common"] { border-color: #00e5ff; box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.2); }
.fusion-ui-slot[data-rarity="rare"] { border-color: #b624ff; box-shadow: 0 0 12px rgba(182, 36, 255, 0.4), inset 0 0 10px rgba(182, 36, 255, 0.2); }
.fusion-ui-slot[data-rarity="premium"] { border-color: #ffcc00; box-shadow: 0 0 16px rgba(255, 204, 0, 0.5), inset 0 0 10px rgba(255, 204, 0, 0.2); }

/* 🔥 КОРРЕКЦИЯ ЦВЕТА СУПЕР-РОМБА ПОД ЦВЕТ РЕДКОСТИ КАРТЫ */
.reactor-card-fix .nft-ship-vector {
    border-color: var(--nft-glow, #00e5ff) !important;
}

.reactor-card-fix .nft-ship-vector::before {
    border-bottom-color: var(--nft-glow, #00e5ff) !important;
}

/* Фикс центрирования элементов внутри маленькой голограммы */
.reactor-card-fix .nft-avatar-hologram {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 🛸 АВТОНОМНЫЙ Sci-Fi РОМБ-ИСТРЕБИТЕЛЬ ДЛЯ РЕАКТОРА */
.reactor-card-fix .nft-avatar-hologram {
    position: relative !important;
    width: 65px !important;
    height: 65px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: translateZ(20px) !important;
}

.reactor-card-fix .nft-ship-vector {
    width: 24px !important;
    height: 24px !important;
    border: 2px solid var(--nft-glow, #00e5ff) !important;
    border-radius: 4px !important;
    transform: rotate(45deg) !important; /* Делаем ромб */
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Отрисовка крыльев космолета */
.reactor-card-fix .nft-ship-vector::before {
    content: '' !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 6px solid transparent !important;
    border-right: 6px solid transparent !important;
    border-bottom: 12px solid var(--nft-glow, #00e5ff) !important;
    top: -5px !important;
    transform: rotate(0deg) !important;
}

/* Свечение ядра */
.reactor-card-fix .radar-glow-core {
    position: absolute !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    background: var(--nft-glow, #00e5ff) !important;
    filter: blur(5px) !important;
    opacity: 0.25 !important;
    z-index: 1 !important;
}

/* ============================================================================
   🌌 МИНИМАЛИСТИЧНЫЙ КУРАТОРСКИЙ СТИЛЬ ГАЛАКТИКИ (PREMIUM PRESET)
   ============================================================================ */
.scifi-fullscreen-page-galaxy {
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, #020710 0%, #000103 100%);
    color: #fff;
    /* Спускаем весь контент ниже, чтобы гарантированно уйти из-под кнопок Telegram */
    padding: calc(65px + env(safe-area-inset-top)) 18px 35px 18px;
    display: flex; 
    flex-direction: column; 
    box-sizing: border-box; 
    z-index: 99999;
}

/* Верхняя панель: подняли z-index, чтобы она была строго поверх любых 3D-кликов */
.galaxy-header-panel { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 20px;
    width: 100%;
    z-index: 100005; /* Запас высоты для слоев */
    position: relative;
    height: 45px; /* Фиксируем высоту панели, чтобы элементы не разлетались */
}

/* Кнопка ОРБИТА: Сделана в культовом стиле неонового QUBI PASS */
.scifi-back-btn-galaxy { 
    background: rgba(3, 6, 12, 0.7); 
    border: 1px solid rgba(0, 229, 255, 0.4); 
    color: #00e5ff; 
    padding: 10px 20px; 
    border-radius: 12px; 
    font-size: 12px; 
    font-weight: bold;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
    /* Полностью отключаем задержку тапа и серый квадрат выделения на iOS */
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
}

.scifi-back-btn-galaxy:active {
    background: rgba(0, 229, 255, 0.2);
    transform: scale(0.95);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
}

.galaxy-main-title { 
    font-size: 13px; 
    font-weight: 700; 
    letter-spacing: 3px; 
    color: #ffffff; 
    font-family: monospace; 
    text-align: center;
    flex: 1; /* Центрирует название между кнопкой и бейджем */
}

/* Бейдж уровня в стиле неоновых карточек */
.galaxy-level-badge { 
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #00e5ff;
    padding: 10px 16px; 
    border-radius: 12px; 
    font-size: 12px; 
    font-weight: 900; 
    font-family: monospace; 
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.1);
}

/* Прогресс бар */
.galaxy-xp-container { 
    width: 100%; 
    margin-bottom: 20px; 
    z-index: 100005; 
    position: relative; 
}
.galaxy-xp-bar-wrapper { width: 100%; height: 5px; background: rgba(255, 255, 255, 0.03); border-radius: 3px; overflow: hidden; }
.galaxy-xp-fill-line { height: 100%; background: #00e5ff; box-shadow: 0 0 10px #00e5ff; transition: width 0.4s ease; }
.galaxy-xp-numbers { font-size: 10px; font-family: monospace; color: #5a6578; margin-top: 6px; text-align: center; }

/* 3D Вьюпорт опущен по z-index под интерфейс */
.galaxy-3d-viewport {
    flex: 1; 
    width: 100%; 
    position: relative; 
    background: transparent; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 100000;
}

#galaxy3DCanvas { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100% !important; 
    height: 100% !important; 
    outline: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Карточка описания куба */
.galaxy-planet-card {
    background: rgba(3, 6, 12, 0.96); 
    border: 1px solid rgba(0, 229, 255, 0.4); 
    border-radius: 18px; 
    padding: 22px; 
    text-align: center; 
    box-shadow: 0 0 35px rgba(0, 229, 255, 0.2), 0 20px 60px rgba(0, 0, 0, 0.9); 
    z-index: 100005; /* Подняли в один приоритет с верхней панелью */
    backdrop-filter: blur(30px); 
    -webkit-backdrop-filter: blur(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto; 
}

/* Статусы карточек */
.galaxy-planet-card.card-locked {
    border: 1px solid rgba(255, 30, 30, 0.6);
    box-shadow: 0 0 35px rgba(255, 30, 30, 0.2), 0 20px 60px rgba(0, 0, 0, 0.9);
}
.galaxy-planet-card.card-claimed {
    border: 1px solid rgba(186, 85, 211, 0.5);
    box-shadow: 0 0 35px rgba(186, 85, 211, 0.15), 0 20px 60px rgba(0, 0, 0, 0.9);
}

.planet-status-tag { 
    font-size: 9px; 
    font-weight: 700; 
    font-family: monospace; 
    color: #00e5ff; 
    letter-spacing: 1.5px; 
    margin-bottom: 8px; 
    text-transform: uppercase; 
}
.planet-status-tag.locked { color: #ff3333 !important; }
.planet-status-tag.claimed { color: #ba55d3 !important; }

.planet-main-name { font-size: 18px; font-weight: 800; margin: 0 0 10px 0; letter-spacing: 1px; font-family: monospace; color: #fff; }
.planet-description { font-size: 11px; color: #8190a6; line-height: 1.6; margin: 0; font-family: sans-serif; }

/* Награды внутри карточки */
.galaxy-reward-inline-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}
.galaxy-reward-inline-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-family: monospace;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================================
   🛸 ФУТУРИСТИЧЕСКИЙ КОМПАКТНЫЙ ВИДЖЕТ QUBI-PASS (БЕЗ XP-БАРА)
   ============================================================================ */
#galaxy-pass-widget {
    position: relative; /* Изменено с absolute, чтобы аккуратно ложиться в блок .wallet */
    margin-top: 4px;    /* Подняли чуть выше к блоку монет */
    width: 170px;
    background: rgba(2, 7, 16, 0.75);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 12px;
    padding: 10px 12px;
    box-sizing: border-box;
    font-family: monospace;
    color: #ffffff;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.1), inset 0 0 10px rgba(0, 229, 255, 0.05);
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    pointer-events: auto; /* Разрешаем клики, несмотря на pointer-events: none у родителя */
    
    animation: widgetPulse 3s infinite ease-in-out;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

#galaxy-pass-widget:active {
    transform: scale(0.97);
    border-color: #00e5ff;
}

/* 🔥 КРАСИВЫЙ НЕОНОВЫЙ ЗНАЧОК СЧЕТЧИКА КУБОВ (BADGE) */
.widget-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #ff1e1e;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px #ff1e1e, 0 0 3px #ffffff;
    border: 1px solid #ffffff;
    z-index: 1010;
    animation: badgePop 0.3s ease-out;
}

/* Эффект внутренней бегущей волны */
.widget-glow-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 12px;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}
.widget-glow-layer::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 229, 255, 0.03), transparent);
    transform: rotate(45deg);
    animation: neonGlowWave 4s infinite linear;
}

/* Шапка виджета */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.widget-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
.widget-lvl {
    font-size: 10px;
    font-weight: 900;
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 229, 255, 0.25);
}

/* Подвал виджета */
.widget-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.widget-status-text {
    font-size: 8px;
    color: #5a6578;
    letter-spacing: 0.5px;
}
.widget-status-blink {
    font-size: 8px;
    font-weight: bold;
    color: #00e5ff;
    letter-spacing: 0.5px;
    animation: statusBlink 1.5s infinite ease-in-out;
}

/* Анимации */
@keyframes widgetPulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(0, 229, 255, 0.15), inset 0 0 8px rgba(0, 229, 255, 0.05);
        border-color: rgba(0, 229, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 22px rgba(0, 229, 255, 0.35), inset 0 0 14px rgba(0, 229, 255, 0.15);
        border-color: rgba(0, 229, 255, 0.65);
    }
}
@keyframes neonGlowWave {
    0% { transform: translate(-30%, -30%) rotate(45deg); }
    100% { transform: translate(30%, 30%) rotate(45deg); }
}
@keyframes statusBlink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; text-shadow: 0 0 5px #00e5ff; }
}
@keyframes badgePop {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============================================================================
   🚫 АБСОЛЮТНАЯ ИЗОЛЯЦИЯ GOOGLE TRANSLATE (ПОЛНАЯ ЗАЧИСТКА ПЛАНЕТ И ПЛАШЕК)
   ============================================================================ */

/* 1. Скрываем технический элемент гугла, но ИСКЛЮЧАЕМ вашу кнопку из скрытия */
#google_translate_element, 
.skiptranslate:not(#language-toggle-btn) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

/* 2. Жестко глушим ВСЕ возможные iframe баннеры, верхние панели, значки планет и мобильные всплывашки Гугла */
iframe.goog-te-banner-frame,
iframe[id*="translate"],
.goog-te-banner-frame,
.goog-te-banner,
.goog-te-header,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-gadget,
.goog-te-gadget-icon,
.goog-te-gadget-simple,
.goog-logo-link,
img[src*="translate"],
img[src*="google"],
#google_translate_element select {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
}

/* 3. Запрещаем Гуглу сдвигать body вниз */
body {
    top: 0 !important;
    position: static !important;
}

/* 4. Убираем подсказки, которые вешаются на элементы при наведении/тапе */
.goog-tooltip, 
.goog-tooltip:hover,
.goog-te-balloon-direct,
[id*="goog-notification"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 5. Уничтожаем гугловскую подсветку переведенного текста */
.goog-text-highlight {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================================================
   🎯 СТИЛИ ЭЛЕМЕНТОВ ИНТЕРФЕЙСА (НОВОЕ РАСПОЛОЖЕНИЕ)
   ============================================================================ */

/* Кнопка перевода — аккуратная плашка под ником */
#language-toggle-btn {
    position: relative !important;
    z-index: 5 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    pointer-events: auto !important;
    cursor: pointer;
    
    /* Компактный дизайн */
    background: rgba(2, 7, 16, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
    transition: transform 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

#language-toggle-btn:active {
    transform: scale(0.95);
    background: rgba(0, 229, 255, 0.2);
}

/* Контейнер полоски энергии (Остается внизу экрана под защитой окон) */
.energy-section {
    position: fixed !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 80% !important;
    z-index: 5 !important; /* Автоматически скроется под окнами */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    pointer-events: none !important;
}

/* Стили самой полосы энергии */
.energy-bar {
    width: 100%;
    max-width: 260px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#energy-fill {
    width: 100%; 
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    transition: width 0.3s ease;
}

.energy-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: bold;
}

#galaxy-pass-widget {
    position: relative; /* Чтобы бадж позиционировался относительно виджета */
}

.widget-badge {
    position: absolute;
    top: -8px;
    left: -8px; 
    
    background: #ff1e1e;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    font-family: sans-serif;
    
    /* Делаем жесткий ровный круг */
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-sizing: border-box;
    
    /* 🛠️ ОТКАЗЫВАЕМСЯ ОТ FLEX СЛОВСЕМ: */
    display: block;
    padding: 0;
    margin: 0;
    
    /* Ставим строку точно по высоте круга (выравнивание по вертикали) */
    line-height: 18px; /* 20px минус толщина бордеров (1.5px * 2) */
    
    /* Выравнивание строго по горизонтали */
    text-align: center; 

    box-shadow: 0 0 10px #ff1e1e;
    border: 1.5px solid #fff;
    z-index: 5;
}
