:root { 
    --bg-color: #0f0f0f; 
    --card-bg: #1a1a1a; 
    --text-color: #ffffff; 
    --accent-color: #3b82f6; 
    --nav-bg: rgba(20, 20, 20, 0.95); 
    --nav-height: 60px; 
    --header-height: 60px;
}

body { 
    font-family: -apple-system, sans-serif; 
    background: var(--bg-color); 
    color: var(--text-color); 
    margin: 0; padding: 0; 
    display: flex; flex-direction: column; 
    min-height: 100vh; 
    -webkit-user-select: none; 
    user-select: none; 
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* УМНАЯ ШАПКА */
header { 
    position: sticky; 
    top: 0; 
    width: 100%;
    height: var(--header-height);
    padding: 0 20px; 
    background: rgba(15, 15, 15, 0.95); 
    backdrop-filter: blur(10px); 
    z-index: 100; 
    border-bottom: 1px solid #333; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-sizing: border-box;
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out; 
    will-change: transform;
}

.header-hidden { transform: translateY(-100%); }

h1 { margin: 0; font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.header-controls { display: flex; gap: 10px; align-items: center; height: 100%; }

.refresh-btn { 
    background: transparent; color: #fff; border: none; 
    width: 36px; height: 36px; border-radius: 50%; 
    cursor: pointer; display: flex; align-items: center; justify-content: center; 
    transition: background 0.2s, transform 0.2s; flex-shrink: 0; 
}
.refresh-btn:hover { background: #333; }
.refresh-btn:active { transform: scale(0.95); }
.refresh-btn svg { width: 20px; height: 20px; fill: currentColor; }

.sort-select { 
    background: #333; color: #fff; border: none; 
    height: 36px; padding: 0 12px; border-radius: 18px; 
    font-size: 13px; outline: none; cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 12px; padding-right: 25px; flex-shrink: 0;
}
.sort-select option { background: #222; color: #fff; }

/* ЖЕСТКО ЗАФИКСИРОВАННОЕ НИЖНЕЕ МЕНЮ */
.bottom-nav { 
    position: fixed !important; /* Принудительная фиксация */
    bottom: 0 !important; 
    left: 0 !important; 
    width: 100% !important; 
    height: var(--nav-height); 
    background: var(--nav-bg); 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    border-top: 1px solid #333; 
    z-index: 9999 !important; /* Максимальный приоритет */
    padding-bottom: env(safe-area-inset-bottom); 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}
.nav-item { 
    color: #888; text-decoration: none; font-size: 10px; 
    display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: center; 
}
.nav-item svg { width: 24px; height: 24px; fill: currentColor; margin-bottom: 4px; }
.nav-item.active { color: var(--accent-color); }
.nav-item.active::after { content:''; position:absolute; bottom:0; width:40px; height:3px; background:var(--accent-color); border-radius:3px 3px 0 0; }

@media (min-width: 768px) { 
    .bottom-nav { justify-content: center; gap: 40px; height: 70px; } 
    .nav-item { font-size: 12px; flex: unset; } 
    .nav-item svg { width: 28px; height: 28px; } 
}
