/* =========================================
   1. ЭКРАНЫ & ОБЩИЙ UI
   ========================================= */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    background: #f8faff;
    /* Immersive */
}

/* DESKTOP / TABLET ADAPTATION WRAPPER */
@media (min-width: 768px) {
    .screen {
        align-items: center;
        background: #e9ecef;
        /* Gray background for desktop */
    }

    .screen>* {
        max-width: 480px;
        /* Mobile App simulation width */
        width: 100%;
        background: #fff;
        min-height: 100%;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    }

    /* Exception for specific full-width views if needed, e.g. Admin */
    /* But for Planner, we want the app feel */
}

.screen.active {
    display: flex;
}

/* ЗАГРУЗОЧНЫЙ ЭКРАН */
#loading-screen {
    background-image: url('../assets/images/loading_bg.jpg');
    background-size: cover;
    background-position: center;
    justify-content: flex-end;
    align-items: center;
    position: fixed;
    /* Fix to viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    z-index: 9999;
    background-color: #263238;
}

#loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.loading-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 40px;
    text-align: center;
    color: white;
}

#loading-bar {
    width: 0%;
    height: 100%;
    background: #4fc3f7;
    transition: width 0.2s;
}

.loader-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

/* ГЛАВНОЕ МЕНЮ */
#main-menu {
    position: absolute;
    justify-content: center;
    align-items: center;
    background: #37474f;
    z-index: 50;
}

.menu-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/loading_bg.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(4px) brightness(0.7);
    z-index: 0;
}

.menu-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-title {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.1;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 85%;
    max-width: 320px;
}

.menu-btn {
    padding: 16px;
    font-size: 1.1rem;
    border: none;
    border-radius: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-btn:active {
    transform: scale(0.98);
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    font-size: 1.2rem;
    padding: 18px;
}

.secondary-btn {
    background: #fff;
    color: #333;
}

.shop-btn {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    color: white;
}

.icon-only-btn {
    width: 50px;
    padding: 0;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: #fff;
}

.install-btn {
    background: #43a047;
    color: white;
    flex: 1;
}

.row-btns {
    display: flex;
    gap: 10px;
}

.version-text {
    position: absolute;
    bottom: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

/* МОДАЛЬНЫЕ ОКНА (БАЗА) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: var(--radius-premium);
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f3f5;
    padding-bottom: 10px;
}

.modal-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
}

.close-cross-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

/* КНОПКИ ДЕЙСТВИЙ */
.action-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 15px;
    width: 100%;
    border-radius: 14px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 15px;
    cursor: pointer;
    box-shadow: 0 4px 0 #01579b;
}

.action-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.warning-btn {
    background: #ffa726;
    box-shadow: 0 4px 0 #ef6c00;
}

.danger-btn {
    background: #ef5350;
    box-shadow: 0 4px 0 #c62828;
}

.text-btn {
    background: none;
    border: none;
    color: #78909c;
    text-decoration: underline;
    margin-top: 15px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ПРЕМИУМ КОМПОНЕНТЫ */
.premium-input {
    background: #f8f9fa;
    border: 1.5px solid transparent;
    border-radius: 14px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    width: 100%;
}

.premium-input:focus {
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(51, 154, 240, 0.1);
}

.premium-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.25);
}

.premium-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.premium-btn:active {
    transform: translateY(1px);
}

.text-muted {
    color: #adb5bd;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.close-btn-premium {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #495057;
    cursor: pointer;
}

/* SETTINGS ACCORDION */
.accordion-setting {
    border: 1px solid #f1f3f5;
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-btn {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: none;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-content {
    display: none;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #f1f3f5;
}

.accordion-content.active {
    display: block;
}

.manage-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.9rem;
}

.manage-item:last-child {
    border-bottom: none;
}

.manage-del-btn {
    background: #ffc9c9;
    color: #fa5252;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

.add-box {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}