@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

:root {
    --bg: #000000;
    --card-bg: #0A0A0A;
    --text: #FFFFFF;
    --sub-text: #888888;
    --accent: #00FFFF;
    --neon-purple: #AE00FF;
    --border: #1A1A1A;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* Лоадер */
#loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.l-content {
    position: relative;
    width: 200px; height: 200px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 50px;
}

.ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent);
    animation: rotateRing 2s linear infinite;
}

.l-logo { width: 100px; filter: drop-shadow(0 0 20px rgba(0,255,255,0.5)); }
.l-pct { font-size: 56px; font-weight: 900; color: var(--accent); margin-bottom: 30px; }
.l-bar { width: 100%; height: 6px; background: #111; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
#bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.3s; }

/* Приложение */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 15px;
}

header {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px 15px;
    display: flex; align-items: center; gap: 15px;
}

.u-avatar { width: 45px; height: 45px; border: 2px solid var(--accent); border-radius: 12px; overflow: hidden; }
.u-avatar img { width: 100%; height: 100%; object-fit: cover; }
.u-lvl { margin-left: auto; background: var(--accent); color: #000; font-size: 11px; font-weight: 900; padding: 6px 14px; border-radius: 10px; }

.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; }
.s-box { background: var(--card-bg); border: 1px solid var(--border); padding: 15px; border-radius: 18px; text-align: center; }
.s-box small { display: block; font-size: 10px; color: var(--sub-text); margin-bottom: 5px; }
.s-box b { font-size: 18px; color: var(--accent); }

.balance-area { text-align: center; margin: 30px 0; }
.balance-area h1 { font-size: 64px; font-weight: 900; }

.game-core {
    flex-grow: 1;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

.brain-target { width: 250px; z-index: 5; transition: transform 0.05s; cursor: pointer; }
.brain-target:active { transform: scale(0.92); }
.brain-target img { width: 100%; }

/* БОКОВОЕ МЕНЮ */
.side-menu {
    position: absolute;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.side-menu button {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border);
    color: var(--text);
    width: 95px;
    padding: 12px 0;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

/* Энергия */
.energy-section { margin-top: auto; margin-bottom: 10px; }
.e-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--sub-text); margin-bottom: 8px; }
.e-track { height: 8px; background: #111; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; }
#e-fill { height: 100%; background: var(--accent); transition: width 0.3s; }

/* НИЖНЕЕ МЕНЮ */
.bottom-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 15px;
}

.bottom-tabs button {
    background: #0A0A0A;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 16px 0;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

/* Модалки */
.modal-bg {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    display: none; align-items: flex-end; z-index: 1000;
}
.modal-bg.active { display: flex; }
.modal-box {
    background: #050505; width: 100%;
    border-radius: 25px 25px 0 0;
    padding: 25px; border-top: 1px solid #222;
}
.handle { width: 40px; height: 4px; background: #333; border-radius: 10px; margin: 0 auto 20px; }
.m-close { 
    width: 100%; padding: 15px; margin-top: 20px;
    background: #111; border: 1px solid #222; color: white;
    border-radius: 12px; font-weight: bold; cursor: pointer;
}

.top-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; background: #0A0A0A; border: 1px solid #1A1A1A;
    border-radius: 15px; margin-bottom: 10px;
}

/* Анимации */
.pop { position: fixed; font-size: 30px; font-weight: 900; color: var(--accent); animation: fly 0.7s forwards; pointer-events: none; z-index: 100; }
@keyframes fly { 0% { opacity:1; transform:translateY(0); } 100% { opacity:0; transform:translateY(-100px); } }
@keyframes rotateRing { to { transform: rotate(360deg); } }
