/* ===================================== */
/*              CORE STYLES              */
/* ===================================== */

/* Базовые настройки для страниц - ИСПРАВЛЕНО */
.page {
    display: none;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    pointer-events: auto !important;
    z-index: 1;
}

/* Фикс для мобильных устройств */
@media (max-width: 768px) {
    .page.active {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        pointer-events: auto !important;
        z-index: 1;
    }
}

/* Экран авторизации */
#authScreen {
    position: fixed; 
    inset: 0; 
    background: #0b0b0b; 
    z-index: 10000; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: white; 
    font-family: sans-serif;
}

.auth-card { 
    background: #181818; 
    padding: 40px; 
    border-radius: 12px; 
    width: 300px; 
    text-align: center; 
}

.auth-card input { 
    width: 100%; 
    padding: 12px; 
    margin: 10px 0; 
    border-radius: 6px; 
    border: none; 
    background: #282828; 
    color: white; 
    box-sizing: border-box;
}

.auth-card input:focus {
    outline: 2px solid #FFD700;
}

.auth-card button { 
    width: 100%; 
    padding: 12px; 
    border-radius: 25px; 
    border: none; 
    background: #1db954; 
    color: white; 
    font-weight: bold; 
    cursor: pointer; 
    margin-top: 10px;
    transition: all 0.2s ease;
}

.auth-card button:hover {
    background: #1ed760;
    transform: scale(1.02);
}

/* Состояния после авторизации */
body.logged-in .sidebar,
body.logged-in .main-content,
body.logged-in .player-bar {
    display: block;
}

body.logged-in .sidebar {
    display: flex;
}

body.logged-in .player-bar {
    display: flex;
}

/* Вспомогательные классы */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Анимация загрузки */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 215, 0, 0.1);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
