/* ========================================= */
/* === URSA IPA CORE SYSTEM v4.7.0 === */
/* ========================================= */

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

:root {
    --bg-dark: #03080f;
    --neon-blue: #00ccff;
    --text-color: #ffffff;
    --badge-color: #30d158;
    --glass-bg: rgba(255, 255, 255, 0.04);
}

/* --- RESET & GLOBAL --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    width: 100%;
    height: 100vh;
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Montserrat", sans-serif;
    background-color: var(--bg-dark);
    overflow-x: hidden;
    position: relative;
}

/* --- VIDEO BACKGROUND --- */
.video-bg-container {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(3,8,15,0.8) 100%);
}

/* --- HEADER --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: calc(env(safe-area-inset-top) + 20px);
    padding-top: env(safe-area-inset-top);
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.main-header h1 {
    font-family: 'Unbounded', sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, #00ccff 25%, #007aff 50%, #00ccff 75%, #fff 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: liquid-flow 4s linear infinite, neon-pulse 3s ease-in-out infinite alternate;
}

@keyframes liquid-flow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
@keyframes neon-pulse { from { filter: drop-shadow(0 0 5px rgba(0,204,255,0.4)); } to { filter: drop-shadow(0 0 15px rgba(0,204,255,0.9)); } }

/* --- NAVIGATION --- */
.bottom-nav {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 94%;
    max-width: 400px;
    height: 64px;
    background: rgba(20, 25, 40, 0.7);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    z-index: 1000;
}

.nav-item {
    background: none; border: none; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; gap: 3px; cursor: pointer; transition: 0.2s;
}

.nav-icon ion-icon { font-size: 24px; color: rgba(255,255,255,0.45); }
.nav-label { font-size: 9px; font-weight: 600; font-family: 'Montserrat'; color: rgba(255,255,255,0.45); text-transform: uppercase; }

.nav-item.active ion-icon { color: var(--neon-blue); filter: drop-shadow(0 0 6px var(--neon-blue)); }
.nav-item.active .nav-label { color: #fff; }
.nav-item:active { transform: scale(0.92); }

/* ========================================= */
/* === INSTRUCTION OVERLAYS (TELEGRAM/SAFARI) === */
/* ========================================= */

#install-guide, #telegram-warning {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at center, #001a33 0%, #03080f 100%);
    overflow-y: auto;
}

#telegram-warning { z-index: 10000; }

.guide-content {
    background: var(--glass-bg);
    backdrop-filter: blur(45px) saturate(160%);
    -webkit-backdrop-filter: blur(45px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 40px 25px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.8);
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.guide-logo {
    width: 80px; height: 80px; border-radius: 20px; margin-bottom: 20px;
    border: 2px solid rgba(255,255,255,0.1); box-shadow: 0 10px 25px rgba(0, 204, 255, 0.2);
}

.guide-content h1 {
    font-family: 'Unbounded', sans-serif;
    font-size: 18px; font-weight: 900; text-transform: uppercase;
}

/* Пульсирующая плашка для шага 1 (Telegram Fix) */
.telegram-btn-highlight {
    border: 2px solid var(--neon-blue) !important;
    background: rgba(0, 204, 255, 0.1) !important;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(0, 204, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 204, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 204, 255, 0); }
}

.steps-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 20px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 15px;
}

.step { display: flex; gap: 15px; align-items: center; }

.step-num {
    background: var(--neon-blue);
    color: #03080f;
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 13px; flex-shrink: 0;
}

.step p { font-size: 14px; line-height: 1.4; color: rgba(255,255,255,0.9); }
.step strong { color: var(--neon-blue); }

.ios-icon {
    background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 6px;
    font-weight: bold; color: var(--neon-blue); font-size: 16px;
}

.divider {
    height: 1px; background: rgba(255, 255, 255, 0.08);
    margin: 15px 10px 15px 40px;
}

.guide-footer {
    margin-top: 25px; font-size: 10px; opacity: 0.4; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px;
}

/* --- MODE SWITCHER --- */
#app-wrapper { display: none; }

@media all and (display-mode: standalone) {
    #install-guide, #telegram-warning { display: none !important; }
    #app-wrapper { display: block !important; animation: fadeIn 0.5s ease; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Адаптив под старые/маленькие iPhone */
@media screen and (max-height: 700px) {
    .guide-content { padding: 25px 20px; border-radius: 30px; }
    .guide-logo { width: 60px; height: 60px; }
    .steps-card { padding: 15px; }
    .divider { margin: 10px 10px 10px 40px; }
}
