:root {
    --bg-color: #05050b;
    --card-color: #0e0e18;
    --accent-color: #00f0ff;
    --text-color: #ffffff;
    --text-secondary: #4a4a65;
    --neon-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color); color: var(--text-color);
    margin: 0; padding: 0; display: flex; flex-direction: column;
    height: 100vh; height: -webkit-fill-available; overflow: hidden; 
    user-select: none; -webkit-user-select: none;
}
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; padding: 10px 15px; gap: 8px;
    background: linear-gradient(to bottom, #0c0c16, transparent); z-index: 10;
}
.stat-box { background: var(--card-color); border: 1px solid #141424; border-radius: 8px; padding: 6px; text-align: center; }
.stat-label { font-size: 9px; color: var(--text-secondary); text-transform: uppercase; }
.stat-value { font-size: 12px; font-weight: bold; color: #fff; }
.balance-section { text-align: center; padding: 5px 0; z-index: 10; }
.league-badge {
    display: inline-block; background: rgba(0,240,255,0.08); border: 1px solid var(--accent-color);
    color: var(--accent-color); font-size: 10px; padding: 3px 10px; border-radius: 15px;
    text-transform: uppercase; font-weight: bold;
}
.main-balance { font-size: 38px; font-weight: 900; margin: 5px 0; }
.page-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.tab-panel { display: none; flex: 1; flex-direction: column; padding: 15px; overflow-y: auto; z-index: 5; }
.tab-panel.active { display: flex; }

/* ИСПРАВЛЕННАЯ ИГРОВАЯ АРЕНА */
.space-arena {
    position: relative; 
    height: 45vh; /* Четко выделяем 45% от высоты экрана под полет */
    min-height: 250px;
    background: radial-gradient(circle at center, #0e0e24 0%, #030306 100%);
    border: 2px solid #1a1a3a; border-radius: 14px; 
    margin: 10px; 
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

/* ОБЪЕМНЫЕ НЕОНОВЫЕ СФЕРЫ */
.asteroid {
    position: absolute; width: 55px; height: 55px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    cursor: pointer; user-select: none; z-index: 50;
}
.asteroid.bronze {
    background: radial-gradient(circle at 35% 35%, #ffbe76 0%, #e056fd 70%, #4a00e0 100%);
    box-shadow: 0 0 25px rgba(224, 86, 253, 0.6), inset -4px -4px 10px rgba(0,0,0,0.7);
}
.asteroid.silver {
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #70a1ff 60%, #1e3799 100%);
    box-shadow: 0 0 25px rgba(112, 161, 255, 0.6), inset -4px -4px 10px rgba(0,0,0,0.7);
}
.asteroid.gold {
    background: radial-gradient(circle at 35% 35%, #fff200 0%, #ff9f43 60%, #ee5a24 100%);
    box-shadow: 0 0 30px rgba(255, 159, 67, 0.7), inset -4px -4px 10px rgba(0,0,0,0.7);
}
.asteroid.anomaly {
    background: radial-gradient(circle at 35% 35%, #7bed9f 0%, #2ed573 60%, #019436 100%);
    box-shadow: 0 0 35px rgba(46, 213, 115, 0.8), inset -4px -4px 10px rgba(0,0,0,0.7);
}

.click-pop {
    position: absolute; color: var(--accent-color); font-size: 22px; font-weight: 900;
    pointer-events: none; animation: popUp 0.5s ease-out forwards; text-shadow: 0 0 6px var(--accent-color); z-index: 100;
}
@keyframes popUp { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-60px) scale(0.8); } }
.energy-box { padding: 0 20px; margin: 5px 0; z-index: 10; }
.energy-header { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 3px; color: var(--text-secondary); }
.energy-bar { height: 6px; background: #0f0f1c; border-radius: 3px; overflow: hidden; }
.energy-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent-color), #00ff88); transition: width 0.1s ease; }
.upgrade-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 15px; }
.upgrade-card {
    background: var(--card-color); border: 1px solid #141426; border-radius: 10px;
    padding: 12px; display: flex; align-items: center; justify-content: space-between;
}
.up-info { display: flex; flex-direction: column; gap: 2px; }
.up-title { font-size: 13px; font-weight: bold; }
.up-desc { font-size: 10px; color: var(--text-secondary); }
.up-cost { font-size: 11px; color: #ffb703; font-weight: bold; }
.up-btn { background: var(--accent-color); color: #000; font-weight: bold; border: none; padding: 8px 12px; border-radius: 6px; font-size: 11px; cursor: pointer; }
.bottom-nav {
    background: #06060c; display: flex; justify-content: space-around; padding: 8px 0; border-top: 1px solid #121224;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 10;
}
.nav-tab { display: flex; flex-direction: column; align-items: center; color: var(--text-secondary); font-size: 9px; gap: 3px; cursor: pointer; width: 25%; }
.nav-tab.active { color: var(--accent-color); }
.nav-tab-icon { font-size: 18px; }
#splash {
    position: fixed; top:0; left:0; width:100vw; height:100vh; background: #05050b;
    z-index: 999; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.loader { width: 40px; height: 40px; border: 4px solid #111; border-top-color: var(--accent-color); border-radius: 50%; animation: spin 1s infinite linear; margin-bottom: 15px; }
