/* =========================================
   AstroMia - Quantum Nexus v2.0 CSS
   ========================================= */

/* --- 1. CORE VARIABLES --- */
:root {
    --bg-void: #030305;
    --bg-panel: rgba(10, 10, 18, 0.6);
    
    --neon-cyan: #00F0FF;
    --neon-cyan-dim: rgba(0, 240, 255, 0.2);
    --neon-purple: #B026FF;
    --neon-purple-dim: rgba(176, 38, 255, 0.2);
    --neon-gold: #FFB800;
    --neon-gold-dim: rgba(255, 184, 0, 0.2);
    
    --tg-gradient: linear-gradient(135deg, #2AABEE 0%, #00F0FF 100%);
    
    --text-main: #E2E8F0;
    --text-muted: #64748B;
    
    --font-ui: 'Montserrat', sans-serif;
    --font-hud: 'Orbitron', sans-serif;
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --radius-sm: 4px;
    --radius-md: 12px;
}

/* --- 2. GLOBAL RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.nexus-core {
    background-color: var(--bg-void);
    color: var(--text-main);
    font-family: var(--font-ui);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Utilities */
.font-mono { font-family: monospace; letter-spacing: 1px; }
.font-orbitron { font-family: var(--font-hud); }
.text-neon-cyan { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan); }
.text-neon-gold, .neon-gold { color: var(--neon-gold); text-shadow: 0 0 10px var(--neon-gold); }
.text-neon-purple, .neon-purple { color: var(--neon-purple); text-shadow: 0 0 10px var(--neon-purple); }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.hidden { display: none !important; }
.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0.3; } }

/* --- 3. BACKGROUND --- */
#space-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -3; }
.cyber-vignette { position: fixed; top: 0; left: 0; width: 100%; height: 100%; box-shadow: inset 0 0 150px rgba(0,0,0,0.9); pointer-events: none; z-index: -2; }

/* --- 4. HUD HEADER & TAMAGOTCHI --- */
.hud-top-bar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    background: rgba(3, 3, 5, 0.85); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
}
.hud-content {
    max-width: 1200px; margin: 0 auto; padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.logo-glitch { font-family: var(--font-hud); font-weight: 900; font-size: 1.2rem; letter-spacing: 2px; color: #fff; }

/* Тамагочи Шкала */
.tamagotchi-status { flex: 1; max-width: 400px; display: flex; flex-direction: column; gap: 4px; }
.status-label { font-size: 0.7rem; color: var(--text-muted); display: flex; justify-content: space-between; }
#satiety-val { color: var(--neon-gold); font-weight: bold; }
.status-bar-container { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; position: relative; overflow: hidden; }
.status-bar-fill { height: 100%; background: var(--neon-gold); box-shadow: 0 0 10px var(--neon-gold); transition: width 0.5s ease, background 0.5s ease; }
.mood-hint { font-size: 0.65rem; color: var(--neon-cyan); text-align: right; }

.burger-btn { background: none; border: none; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.burger-btn span { display: block; width: 24px; height: 2px; background: var(--neon-cyan); }

/* --- 5. LAYOUT --- */
.nexus-scroll-container { max-width: 900px; margin: 0 auto; padding: 100px 16px 60px 16px; display: flex; flex-direction: column; gap: 80px; }
.nexus-section { width: 100%; }
.section-heading { font-family: var(--font-hud); font-size: 1.5rem; text-align: center; margin-bottom: 32px; letter-spacing: 1px; }

/* --- 6. BUTTONS --- */
.btn-nexus-start {
    display: block; width: 100%; padding: 18px; text-align: center;
    background: transparent; border: 1px solid var(--neon-cyan); color: var(--neon-cyan);
    font-family: var(--font-hud); font-weight: 700; font-size: 1.1rem; text-decoration: none;
    text-transform: uppercase; letter-spacing: 2px; cursor: pointer; position: relative;
    overflow: hidden; transition: 0.3s;
}
.btn-nexus-start:hover { background: var(--neon-cyan-dim); box-shadow: 0 0 20px var(--neon-cyan-dim); }
.btn-nexus-start:disabled { border-color: #444; color: #666; cursor: not-allowed; }

.btn-node {
    width: 100%; padding: 16px; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass); border-left: 3px solid var(--neon-purple);
    color: var(--text-main); font-family: var(--font-ui); font-size: 0.95rem; font-weight: 600;
    text-align: left; cursor: pointer; transition: 0.2s;
}
.btn-node:hover, .btn-node.selected { background: var(--neon-purple-dim); border-color: var(--neon-purple); }

/* Мега-кнопка ТГ */
.btn-tg-mega {
    display: flex; justify-content: center; align-items: center; gap: 12px;
    width: 100%; padding: 20px; background: var(--tg-gradient);
    border-radius: 8px; color: #fff; font-family: var(--font-hud); font-weight: 900;
    font-size: 1.2rem; text-decoration: none; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(42, 171, 238, 0.4); transition: transform 0.2s, box-shadow 0.2s;
}
.btn-tg-mega:active { transform: scale(0.98); }
.tg-icon { width: 28px; height: 28px; }

/* --- 7. HERO --- */
.hero-layer { text-align: center; padding-top: 4vh; }
.main-title { font-family: var(--font-hud); font-size: 2.2rem; letter-spacing: 2px; margin-bottom: 40px; }
.mascot-nexus { position: relative; width: 220px; height: 220px; margin: 0 auto 40px auto; }
.mia-hologram { width: 100%; height: auto; filter: drop-shadow(0 0 20px var(--neon-purple)); position: relative; z-index: 2; }
.float-3d { animation: float-holo 4s ease-in-out infinite; }
@keyframes float-holo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* --- 8. TELEMETRY (Weather) --- */
.telemetry-grid { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.tele-card { width: 100%; background: var(--bg-panel); border: 1px solid var(--border-glass); padding: 20px; border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; }
.tele-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; letter-spacing: 1px; }
.tele-value { font-family: var(--font-hud); font-size: 1.1rem; font-weight: 700; }

.planet-viewport { width: 140px; height: 140px; perspective: 800px; margin: 10px 0; position: relative; }
.planet-3d-sphere { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #444, #000); box-shadow: inset -20px -20px 40px rgba(0,0,0,0.9), 0 0 20px var(--border-glass); }
.planet-3d-sphere.danger { background: radial-gradient(circle at 30% 30%, #800, #200); box-shadow: inset -20px -20px 40px rgba(0,0,0,0.9), 0 0 30px rgba(255,0,0,0.6); }

/* --- 9. TERMINAL QUIZ & CUSTOM DATE SELECT --- */
.terminal-frame { background: var(--bg-panel); border: 1px solid var(--neon-cyan-dim); border-radius: var(--radius-sm); padding: 24px; }
.terminal-header { margin-bottom: 24px; }
.progress-line { height: 2px; background: var(--neon-cyan); width: 20%; box-shadow: 0 0 10px var(--neon-cyan); transition: width 0.3s; margin-bottom: 8px; }
.step-counter { font-size: 0.8rem; color: var(--neon-cyan); }

.quiz-step { display: none; opacity: 0; transition: opacity 0.3s; }
.quiz-step.active { display: block; opacity: 1; }
.term-query { font-size: 1.2rem; margin-bottom: 24px; }
.term-options { display: flex; flex-direction: column; gap: 12px; }

/* Кастомные Селекты Координат (Вместо input date) */
.coords-picker { display: flex; gap: 12px; margin-bottom: 24px; }
.coord-box { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.coord-box label { font-family: monospace; font-size: 0.7rem; color: var(--text-muted); }
.term-select {
    width: 100%; background: rgba(0,0,0,0.5); border: 1px solid var(--border-glass);
    color: var(--neon-gold); padding: 12px 8px; font-family: var(--font-hud);
    font-size: 1rem; outline: none; appearance: none; border-radius: 0;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFB800' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
.term-select:focus { border-color: var(--neon-gold); box-shadow: 0 0 10px var(--neon-gold-dim); }
.term-select option { background: #111; color: #fff; font-family: var(--font-ui); }

.quiz-loading { text-align: center; padding: 40px 0; }
.result-box { padding: 16px; border-left: 2px solid var(--neon-gold); background: rgba(255,184,0,0.05); font-size: 0.95rem; line-height: 1.6; }

/* --- 10. NEURO-ORB & DONATES --- */
.sphere-nexus { display: flex; flex-direction: column; gap: 40px; }

/* Нейро-шар */
.ball-block { background: var(--bg-panel); border: 1px solid var(--neon-purple-dim); padding: 24px; border-radius: var(--radius-sm); text-align: center; }
.magic-orb-container { position: relative; width: 160px; height: 160px; margin: 0 auto 24px auto; }
.orb-visual {
    width: 100%; height: 100%; border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(176,38,255,0.1), #000);
    border: 2px solid rgba(176,38,255,0.3); box-shadow: 0 0 30px var(--neon-purple-dim);
    display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative;
}
.orb-inner-answer { position: relative; z-index: 2; font-family: var(--font-ui); font-weight: 700; color: #fff; font-size: 0.9rem; padding: 10px; text-shadow: 0 0 5px #000; }
.orb-input-group { display: flex; gap: 8px; }
.term-input { flex: 1; background: rgba(0,0,0,0.5); border: 1px solid var(--border-glass); padding: 12px; color: #fff; outline: none; }

/* Донаты (Чистые кнопки) */
.donate-hud { padding: 24px; border: 1px solid var(--neon-gold-dim); }
.donate-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-pay {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; padding: 16px; background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass); color: var(--text-main);
    font-family: var(--font-hud); font-size: 1rem; cursor: pointer; transition: 0.2s;
}
.btn-pay:hover { border-color: var(--neon-cyan); background: var(--neon-cyan-dim); }
.p-icon { font-size: 1.2rem; }
.custom-pay-wrap { display: flex; gap: 8px; margin-top: 8px; }
.custom-pay-wrap input { width: 80px; background: rgba(0,0,0,0.5); border: 1px solid var(--border-glass); color: var(--neon-gold); text-align: center; font-family: var(--font-hud); font-size: 1.1rem; outline: none; }
.btn-pay-custom { flex: 1; background: var(--neon-gold); color: #000; border: none; font-family: var(--font-hud); font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-pay-custom:hover { box-shadow: 0 0 15px var(--neon-gold); }

/* --- 11. EXPERT --- */
.expert-profile-card { padding: 24px; border: 1px solid var(--border-glass); border-left: 4px solid var(--neon-gold); display: flex; flex-direction: column; gap: 24px; align-items: center; text-align: center; background: linear-gradient(135deg, rgba(20,20,25,0.8), #000); }
.expert-avatar-wrap img { width: 120px; height: 120px; border-radius: 50%; border: 2px solid var(--neon-gold); filter: grayscale(30%); }

/* --- 12. FOOTER --- */
.nexus-footer { padding: 20px 16px; border-top: 1px solid var(--border-glass); font-size: 0.75rem; color: var(--text-muted); }
.footer-wrap { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.social-icons { display: flex; gap: 16px; }
.soc-link { color: var(--text-muted); text-decoration: none; font-weight: bold; transition: color 0.2s; }
.soc-link:hover { color: var(--neon-cyan); }

/* --- 13. DESKTOP TWEAKS --- */
@media (min-width: 768px) {
    .telemetry-grid { flex-direction: row; justify-content: center; }
    .tele-card { width: 200px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .coords-picker { flex-direction: row; }
    .sphere-nexus { flex-direction: row; align-items: stretch; }
    .ball-block, .donate-block { flex: 1; display: flex; flex-direction: column; justify-content: center; }
    .expert-profile-card { flex-direction: row; text-align: left; }
}