/* ========================================= */
/* === URSA IPA ULTIMATE MONOLITH v4.6.1 === */
/* ========================================= */

@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;
    --vip-gold: #ffcc00;
    --matte-gray: rgba(13, 17, 23, 0.98); /* Глубокий матовый фон */
}

/* --- RESET --- */
* {
    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: rgba(0,0,0,0.4);
}

/* --- 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;
    margin: 0;
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #00ccff 25%,
        #007aff 50%,
        #00ccff 75%,
        #ffffff 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)); }
}

/* --- MAIN CONTENT CONTAINER --- */
#content {
    position: relative;
    z-index: 1;
    padding: 10px 16px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 100px);
    min-height: 100vh;
}

/* --- CATEGORY BAR (ULTRA SLIM) --- */
#category-bar {
    display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; margin-bottom: 5px;
    scrollbar-width: none; -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
#category-bar::-webkit-scrollbar { display: none; }

.category-btn {
    display: flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 14px;
    border-radius: 12px; background: transparent; backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1); font-family: 'Montserrat', sans-serif;
    font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.4); cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn.active {
    background: rgba(255, 255, 255, 0.05) !important; 
    border: 1.5px solid var(--neon-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.2);
}
.category-btn.active ion-icon { color: var(--neon-blue); opacity: 1; }

/* --- CARDS (DENSE DESIGN) --- */
#app-list { display: flex; flex-direction: column; gap: 8px; margin-top: 5px; }

.app-card {
    background: rgba(20, 25, 40, 0.5); backdrop-filter: blur(20px) saturate(160%);
    border-radius: 16px; padding: 10px 12px; display: flex; align-items: center; gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06); cursor: pointer; transition: all 0.2s ease;
}
.app-card:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.05); }

.icon-wrapper { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.app-icon { width: 100% !important; height: 100% !important; border-radius: 14px; object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.1); }

/* --- STATUS BADGES --- */
.status-badge {
    position: absolute; top: -5px; left: -5px; padding: 2px 5px; border-radius: 6px;
    font-size: 8px; font-weight: 900; font-family: 'Unbounded', sans-serif;
    z-index: 10; border: 1px solid rgba(0, 0, 0, 0.5); text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.vip-badge { 
    background: linear-gradient(135deg, #ffcc00 0%, #ff9500 100%); 
    color: #000; 
}

.free-badge { 
    background: linear-gradient(135deg, #30d158 0%, #208c3a 100%); 
    color: #ffffff; 
    box-shadow: 0 2px 5px rgba(48, 209, 88, 0.4);
}

/* --- APP INFO --- */
.app-info { flex: 1; min-width: 0; }
.app-name { font-size: 15px; font-weight: 800; color: white; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-meta { font-size: 10px; color: rgba(255, 255, 255, 0.4); }
.app-date { font-size: 9px; color: var(--neon-blue); font-weight: 800; margin-top: 4px; text-transform: uppercase; }

.download-btn {
    background: var(--neon-blue); color: #03080f; border: none; font-weight: 900; 
    font-size: 11px; padding: 6px 14px; min-width: 65px; border-radius: 10px; 
    text-transform: uppercase;
}

/* --- FEATURED CAROUSEL (GAMES TAB) --- */
.featured-carousel {
    display: flex; overflow-x: auto; gap: 16px; padding: 10px 5px 25px 5px;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.featured-carousel::-webkit-scrollbar { display: none; }

.featured-card {
    flex: 0 0 88%; height: 190px; border-radius: 28px; position: relative; overflow: hidden;
    scroll-snap-align: center; border: 1px solid rgba(255, 255, 255, 0.1); background: #080c14;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(255,255,255,0.02);
}

.featured-bg { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.8); }

.featured-content {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 18px;
    background: linear-gradient(to top, rgba(8, 12, 20, 0.95) 20%, rgba(8, 12, 20, 0.4) 60%, transparent 100%);
    backdrop-filter: blur(10px); display: flex; align-items: center; gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.featured-icon { width: 52px; height: 52px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,0.2); }
.featured-info h3 { font-size: 18px; font-weight: 900; color: white; margin: 0; font-family: 'Unbounded', sans-serif; }
.featured-info p { font-size: 10px; color: var(--neon-blue); font-weight: 800; text-transform: uppercase; }

/* --- SKELETON LOADING --- */
.skeleton-card {
    background: rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 10px 12px;
    display: flex; align-items: center; gap: 14px; border: 1px solid rgba(255, 255, 255, 0.02);
    height: 82px;
}
.sk-icon { width: 60px; height: 60px; border-radius: 14px; background: rgba(255,255,255,0.1); }
.sk-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sk-line { height: 10px; border-radius: 4px; background: rgba(255,255,255,0.1); }
.sk-line.short { width: 40%; }
.sk-line.long { width: 70%; }
.sk-btn { width: 65px; height: 26px; border-radius: 10px; background: rgba(255,255,255,0.1); }

.skeleton-card .sk-icon, .skeleton-card .sk-line, .skeleton-card .sk-btn {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* --- PAGINATION --- */
.pagination-nav {
    display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 20px; padding: 12px;
    background: rgba(255, 255, 255, 0.03); border-radius: 18px; border: 1.5px solid var(--neon-blue);
}
.pag-btn {
    background: rgba(0, 204, 255, 0.08); border: 1px solid rgba(0, 204, 255, 0.3);
    color: var(--neon-blue); width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
}

/* ========================================= */
/* === MORE TAB: FIX & PREMIUM DESIGN === */
/* ========================================= */

.more-wrapper {
    position: fixed; 
    top: calc(env(safe-area-inset-top) + 60px);
    left: 0; right: 0; bottom: 100px;
    padding: 0 16px;
    display: flex; flex-direction: column;
    z-index: 100;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-panel {
    flex: 1;
    background: rgba(20, 25, 40, 0.6);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
}
.glass-panel::-webkit-scrollbar { display: none; }

/* AUTH SECTION - GRID LAYOUT */
.auth-card {
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    flex-shrink: 0;
}

.auth-card:not(.logged-in) { display: flex; align-items: center; gap: 15px; }

.auth-card.logged-in {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 18px;
    row-gap: 12px;
    align-items: center;
}

.auth-icon-circle {
    width: 48px; height: 48px; min-width: 48px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 24px; color: #000;
    flex-shrink: 0;
}

/* 🔥 ПРЕМИУМ КНОПКА ВХОДА ДЛЯ ГОСТЯ (iOS FIX APPLIED) */
.google-signin-btn {
    width: 100%;
    min-height: 54px; 
    padding: 0 20px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1.5px solid var(--neon-blue);
    border-radius: 20px;
    color: white;
    font-family: 'Unbounded', sans-serif;
    font-size: 13px;
    font-weight: 800;
    
    /* Flex alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(0, 204, 255, 0.2);
    text-transform: uppercase;

    /* 🔥 iOS SAFARI FORCE FIXES 🔥 */
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

.google-signin-btn:active { 
    transform: scale(0.97); 
    background: rgba(0, 204, 255, 0.1); 
}

.google-signin-btn ion-icon { 
    font-size: 20px; 
    flex-shrink: 0; 
}

.user-avatar-wrap { grid-row: 1 / span 2; align-self: center; position: relative; }
.user-avatar-img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--neon-blue); object-fit: cover; }
.online-indicator { 
    position: absolute; bottom: 2px; right: 2px; width: 14px; height: 14px; 
    background: #30d158; border: 3px solid #161b2e; border-radius: 50%; 
}

.user-text { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-text h3 { margin: 0; font-size: 17px; font-weight: 800; color: white; font-family: 'Unbounded', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text p { margin: 0; font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.auth-btn-action {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    width: 42px; height: 42px; border-radius: 12px; color: white; font-size: 20px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; margin-left: auto;
}

.sign-out-btn {
    grid-column: 2; grid-row: 2; width: 100%; height: 36px;
    background: rgba(255, 59, 48, 0.15); border: 1px solid rgba(255, 59, 48, 0.3); color: #ff453a; 
    border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.sign-out-btn::after { content: "SIGN OUT"; font-size: 11px; font-weight: 800; font-family: 'Montserrat', sans-serif; letter-spacing: 1px; }

/* STATS GRID */
.stats-grid {
    display: flex; align-items: center; justify-content: space-around; padding: 20px 0;
    background: linear-gradient(90deg, rgba(0,204,255,0.05) 0%, rgba(0,204,255,0.0) 100%);
    border-radius: 20px; border: 1px solid rgba(0, 204, 255, 0.1); flex-shrink: 0;
}
.stat-box { text-align: center; }
.stat-box ion-icon { font-size: 24px; color: var(--neon-blue); margin-bottom: 5px; opacity: 0.8; }
.stat-num { display: block; font-family: 'Unbounded'; font-size: 20px; font-weight: 900; color: white; }
.stat-divider { width: 1px; height: 30px; background: rgba(255,255,255,0.1); }

/* MENU LIST */
.menu-list { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.menu-item {
    display: flex; align-items: center; gap: 15px; padding: 14px; border-radius: 18px;
    background: rgba(255, 255, 255, 0.02); border: 1px solid transparent; transition: 0.2s; cursor: pointer;
}
.menu-item:active { background: rgba(255,255,255,0.06); transform: scale(0.98); }

.menu-icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: white; }
.icon-blue { background: linear-gradient(135deg, #007aff, #00c6ff); }
.icon-purple { background: linear-gradient(135deg, #bf5af2, #ff2d55); }
.icon-green { background: linear-gradient(135deg, #30d158, #34c759); }
.icon-orange { background: linear-gradient(135deg, #ff9f0a, #ff375f); }
.icon-red { background: linear-gradient(135deg, #ff453a, #ff3b30); }
.menu-text { flex: 1; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.9); }
.menu-arrow { color: rgba(255,255,255,0.2); font-size: 18px; }

/* TOGGLE SWITCH STYLE */
.toggle-switch { width: 42px; height: 24px; background: rgba(255,255,255,0.1); border-radius: 20px; position: relative; transition: 0.3s; }
.toggle-knob { width: 20px; height: 20px; background: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: 0.3s; }
.active-switch .toggle-switch { background: var(--neon-blue); }
.active-switch .toggle-knob { transform: translateX(18px); }

.more-footer { text-align: center; margin-top: auto; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; gap: 4px; }
.ursa-ver { font-size: 10px; color: rgba(255,255,255,0.3); font-weight: 700; }
.ursa-dev { font-size: 10px; color: var(--neon-blue); font-family: 'Unbounded'; font-weight: 900; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.8; }

/* ========================================= */
/* === MODAL (GLASS 4.0 MONOLITH) === */
/* ========================================= */

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); display: none; z-index: 2000; }
.modal-overlay.active { display: flex; }

.modal-content {
    background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(50px) saturate(220%);
    width: 100vw; height: 100vh; padding: 100px 25px 50px 25px;
    overflow-y: auto; overflow-x: hidden; border: none; position: relative;
}

.back-btn {
    position: fixed; top: 40px; left: 20px;
    background: rgba(255, 255, 255, 0.05); border: 1.5px solid var(--neon-blue); 
    border-radius: 12px; padding: 8px 16px; color: #ffffff;
    display: flex; align-items: center; gap: 6px;
    font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 700;
    cursor: pointer; z-index: 2100; box-shadow: 0 0 10px rgba(0, 204, 255, 0.2);
}

.share-btn {
    position: fixed; top: 40px; right: 20px;
    background: rgba(255, 255, 255, 0.05); border: 1.5px solid var(--neon-blue); 
    border-radius: 12px; padding: 8px 12px; color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 2100; font-size: 20px; transition: transform 0.2s ease;
}

.modal-header-info { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 15px; margin-bottom: 35px; }
.modal-icon-big { width: 75px; height: 75px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.15); object-fit: cover; }
.modal-title-wrap h2 { font-size: 22px; font-weight: 900; color: white; font-family: 'Unbounded', sans-serif; }

.metadata-group-card { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 24px; padding: 10px 18px; margin-bottom: 30px; overflow: hidden; }
.meta-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.meta-row ion-icon { font-size: 20px; color: var(--neon-blue); opacity: 0.8; }
.meta-label { flex-shrink: 0; font-size: 11px; color: rgba(255, 255, 255, 0.4); text-transform: uppercase; }
.meta-value { flex: 1; font-size: 13px; color: white; font-weight: 700; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mod-features-box { background: rgba(0, 204, 255, 0.05); border: 1.5px solid rgba(0, 204, 255, 0.1); border-radius: 24px; padding: 22px; margin-bottom: 40px; }
.mod-features-box h4 { color: var(--neon-blue); font-size: 14px; margin: 0 0 15px 0; text-transform: uppercase; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.features-list { list-style: none; padding: 0; }
.features-list li { font-size: 14px; color: rgba(255, 255, 255, 0.9); padding: 10px 0; display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }

.get-btn-big { width: 100%; padding: 22px; border-radius: 24px; background: transparent; border: 1.5px solid var(--neon-blue); color: #ffffff; font-family: 'Unbounded', sans-serif; font-weight: 900; font-size: 17px; text-transform: uppercase; cursor: pointer; }

/* ========================================= */
/* === SEARCH OVERLAY (INVISIBLE GLASS) === */
/* ========================================= */

.search-overlay {
    position: fixed; inset: 0; background: transparent; z-index: 2500; display: none; flex-direction: column;
    padding-top: calc(env(safe-area-inset-top) + 40px); overflow-x: hidden; animation: fadeIn 0.2s ease-out;
}
.search-overlay.active { display: flex; }

.search-header { padding: 20px 20px 40px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 40px; }

.search-input-wrapper {
    width: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(20px) saturate(180%);
    border: 1.5px solid rgba(255, 255, 255, 0.1); border-radius: 20px; 
    display: flex; align-items: center; padding: 0 18px; height: 60px;
}
.search-input-wrapper input { flex: 1; background: none; border: none; color: white; font-size: 18px; outline: none; }

.clear-btn { 
    background: rgba(255, 255, 255, 0.1); border: none; color: white; width: 28px; height: 28px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.search-results { flex: 1; padding: 10px 16px; overflow-y: auto; padding-bottom: 150px; display: flex; flex-direction: column; gap: 15px; }

/* ========================================= */
/* === COMMUNITY CHAT (MATTE GRAY DESIGN) === */
/* ========================================= */

#chat-overlay {
    position: fixed; inset: 0;
    background: var(--matte-gray) !important; 
    backdrop-filter: blur(35px) saturate(160%) !important;
    z-index: 5000;
    display: none; flex-direction: column;
    padding-top: calc(env(safe-area-inset-top) + 40px);
}
#chat-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

#chat-messages {
    flex: 1; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 16px;
    padding-bottom: 140px;
    scrollbar-width: none;
}
#chat-messages::-webkit-scrollbar { display: none; }

.chat-msg-item { display: flex; gap: 12px; animation: slideIn 0.3s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.chat-msg-avatar { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.15); object-fit: cover; }

.chat-msg-content {
    background: rgba(255, 255, 255, 0.06); padding: 12px 18px;
    border-radius: 22px; border-top-left-radius: 4px; max-width: 80%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.chat-msg-user { font-size: 10px; font-weight: 900; color: var(--neon-blue); text-transform: uppercase; margin-bottom: 4px; opacity: 0.7; }
.chat-msg-text { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.9); }

/* VIP Logic for Chat */
.chat-msg-item.is-vip .chat-msg-avatar { border-color: var(--vip-gold); box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); }
.chat-msg-item.is-vip .chat-msg-content { background: rgba(255, 204, 0, 0.07); border-color: rgba(255, 204, 0, 0.2); }
.chat-msg-item.is-vip .vip-name { color: var(--vip-gold) !important; display: flex; align-items: center; gap: 4px; }
.chat-msg-item.is-vip .vip-name::after { content: '👑'; font-size: 10px; }

/* Chat Input Wrapper */
#chat-overlay .search-input-wrapper {
    position: fixed; bottom: 30px; left: 5%; width: 90%;
    background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5); backdrop-filter: blur(20px);
}

/* ========================================= */
/* === PWA & TELEGRAM GUIDES (UNIFIED) === */
/* ========================================= */

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

.guide-content {
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 32px;
    padding: 40px 25px; text-align: center; color: white; width: 100%; max-width: 350px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.guide-logo { width: 80px; height: 80px; border-radius: 20px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.1); }
.guide-content h1 { font-family: 'Unbounded'; font-size: 24px; margin-bottom: 10px; background: linear-gradient(to right, #fff, var(--neon-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.guide-desc { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 30px; line-height: 1.4; }

.steps-card { background: rgba(255,255,255,0.03); border-radius: 24px; padding: 10px 15px; border: 1px solid rgba(255,255,255,0.05); margin-top: 20px; }
.step { display: flex; align-items: center; gap: 15px; padding: 15px 5px; text-align: left; }
.step-num { width: 28px; height: 28px; background: var(--neon-blue); color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; flex-shrink: 0; }
.step p { font-size: 13px; color: rgba(255,255,255,0.9); }
.ios-icon { font-size: 18px; vertical-align: middle; color: var(--neon-blue); }
.divider { height: 1px; background: rgba(255,255,255,0.05); margin: 0 10px; }
.guide-footer { margin-top: 25px; font-size: 10px; text-transform: uppercase; letter-spacing: 2px; opacity: 0.3; font-weight: 800; }

/* ========================================= */
/* === GLOBAL COMPONENTS (TOAST / NAV) === */
/* ========================================= */

.toast {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: rgba(0, 204, 255, 0.25); backdrop-filter: blur(15px); border: 1.5px solid var(--neon-blue);
    color: white; padding: 12px 24px; border-radius: 20px; font-size: 13px; font-weight: 800;
    z-index: 9999; opacity: 0; pointer-events: none; transition: 0.4s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* BOTTOM NAV (PREMIUM GLASS) */
.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.65);
    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; gap: 3px; cursor: pointer; color: rgba(255,255,255,0.45); }
.nav-item.active { color: var(--neon-blue); }

#app-wrapper { display: none; }

/* --- ADAPTIVE FIXES --- */
@media screen and (max-width: 380px) {
    /* Фикс отступов для маленьких экранов */
    .google-signin-btn { padding: 0 15px; min-height: 48px; gap: 8px; }
    .auth-card { padding: 15px; }
    .glass-panel { padding: 15px; gap: 15px; }
    .main-header h1 { font-size: 22px; }
}

@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; } }

/* Фикс для полной изоляции ворнинга Telegram */
#telegram-warning {
    z-index: 999999 !important;
    position: fixed !important;
    background: #03080f !important; /* Глухой фон */
    display: none; /* Включается через JS */
}
