/* =========================================
           1. НАСТРОЙКИ ЦВЕТОВ (ПЕРЕМЕННЫЕ)
           ========================================= */
        :root {
            /* СВЕТЛАЯ ТЕМА */
            --bg-color: #f4f6f8;
            --text-color: #2c3e50;
            --text-secondary: #7f8c8d;
            --card-bg: white;
            --card-border: 1px solid #eee;
            --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
            --logo-filter: none;
            --btn-bg: rgba(0, 0, 0, 0.05);

            /* ЦВЕТ ГРАДИЕНТА (Твой фирменный) */
            --primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
        }

        /* ТЕМНАЯ ТЕМА */
        body.dark-theme {
            --bg-color: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
            --text-color: #ffffff;
            --text-secondary: rgba(255, 255, 255, 0.6);
            --card-bg: rgba(255, 255, 255, 0.1);
            --card-border: 1px solid rgba(255, 255, 255, 0.15);
            --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            --logo-filter: invert(1);
            --btn-bg: rgba(255, 255, 255, 0.1);
        }

        /* =========================================
           2. ОСНОВНЫЕ СТИЛИ
           ========================================= */
        body {
            font-family: 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-color);
            min-height: 100vh;
            margin: 0;
            padding: 20px;
            color: var(--text-color);
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: background 0.5s ease, color 0.3s ease;
        }

        body.dark-theme {
            background-attachment: fixed;
        }

        /* КНОПКА СМЕНЫ ТЕМЫ */
        .theme-toggle-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            background: var(--btn-bg);
            border: none;
            border-radius: 50%;
            width: 45px;
            height: 45px;
            font-size: 22px;
            cursor: pointer;
            transition: 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100;
        }

        .theme-toggle-btn:hover {
            transform: scale(1.1);
        }

        /* --- НОВЫЙ ДИЗАЙН КНОПКИ УСТАНОВКИ --- */
        #installAppContainer {
            display: none;
            /* Скрыт по умолчанию */
            position: relative;
            width: 100%;
            max-width: 380px;
            margin-bottom: 25px;
            z-index: 90;
            animation: float 3s ease-in-out infinite;
        }

        .install-btn-body {
            width: 100%;
            padding: 14px 50px 14px 20px;
            /* Справа отступ под крестик */
            background: var(--primary-gradient);
            /* Сине-голубой градиент */
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 10px 25px rgba(0, 242, 254, 0.3);
            /* Красивая тень */
            transition: 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            text-align: center;
        }

        .install-btn-body:hover {
            transform: scale(1.02);
            filter: brightness(1.1);
        }

        /* Кнопка закрытия (Крестик) */
        .install-close {
            position: absolute;
            right: 6px;
            top: 50%;
            transform: translateY(-50%);
            width: 36px;
            height: 36px;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.2s;
            backdrop-filter: blur(5px);
        }

        .install-close:hover {
            background: rgba(255, 255, 255, 0.4);
            transform: translateY(-50%) rotate(90deg);
        }

        @keyframes float {
            0% {
                transform: translateY(0px);
            }

            50% {
                transform: translateY(-5px);
            }

            100% {
                transform: translateY(0px);
            }
        }

        /* =========================================
           КНОПКА "Я ЗДЕСЬ ВПЕРВЫЕ"
           ========================================= */
        :root {
            --pulse-color: rgba(255, 107, 107, 0.6);
        }

        body.dark-theme {
            --pulse-color: rgba(255, 255, 255, 0.4);
        }

        .first-time-btn {
            /* СТИЛИ ДЛЯ КОМПЬЮТЕРА (По умолчанию) */
            position: absolute;
            top: 20px;
            left: 20px;

            padding: 12px 25px;
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
            border-radius: 50px;

            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;

            text-decoration: none;
            color: #c0392b;
            font-weight: bold;
            font-size: 16px;

            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            z-index: 95;
            /* Чуть меньше, чем у кнопки темы, чтобы не перекрывала */
            transition: transform 0.3s ease;
            animation: pulse-btn 2s infinite;
        }

        .first-time-btn:hover {
            transform: scale(1.05);
        }

        /* --- АДАПТАЦИЯ ПОД ТЕЛЕФОНЫ И ПЛАНШЕТЫ (< 1024px) --- */
        @media (max-width: 1024px) {
            .first-time-btn {
                position: relative;
                /* Отключаем привязку к углу */
                top: auto;
                left: auto;

                margin-top: 10px;
                /* Отступ сверху от кнопки установки */
                margin-bottom: 20px;
                /* Отступ снизу до меню */

                width: 90%;
                /* Можно сделать пошире на телефоне */
                max-width: 380px;
                /* Но не шире кнопки установки */
            }
        }

        @keyframes pulse-btn {
            0% {
                box-shadow: 0 0 0 0 var(--pulse-color);
            }

            70% {
                box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
            }
        }


        /* --- ШАПКА --- */
        header {
            text-align: center;
            margin-bottom: 20px;
            animation: fadeIn 1s ease;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .logo-container {
            display: flex;
            justify-content: center;
            margin-bottom: 10px;
            width: 100%;
        }

        .main-logo {
            max-width: 600px;
            width: 95%;
            height: auto;
            filter: var(--logo-filter);
            transition: filter 0.3s ease;
        }

        .subtitle {
            color: var(--text-secondary);
            font-size: 15px;
            font-style: italic;
            margin-top: 5px;
        }

        /* --- МЕНЮ --- */
        /* --- МЕНЮ (Обновлено под 5 колонок) --- */
        .menu-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            /* 5 колонок в ряд */
            gap: 15px;
            width: 100%;
            max-width: 1100px;
            /* Чуть шире, чтобы влезло 5 штук */
            animation: slideUp 0.8s ease;
        }

        /* Планшеты (по 3 в ряд, если экран поменьше) */
        @media (max-width: 900px) {
            .menu-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        /* Телефоны (остаемся на 2 в ряд, иначе будет слишком мелко) */
        @media (max-width: 600px) {
            .menu-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
        }

        .menu-item {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            box-shadow: var(--card-shadow);
            border: var(--card-border);
            border-radius: 18px;
            padding: 15px 10px;
            min-height: 110px;
            text-align: center;
            text-decoration: none;
            color: var(--text-color);
            transition: 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            /* 🔥 ДОБАВЛЕНО ДЛЯ СЧЕТЧИКОВ (чтобы они держались за угол) */
        }

        .menu-item:hover {
            transform: translateY(-3px);
            border-color: #3498db;
        }

        .primary {
            border: 1px solid #3498db;
            background: rgba(52, 152, 219, 0.1);
        }

        /* --- 🔥 СТИЛИ ДЛЯ СЧЕТЧИКОВ УВЕДОМЛЕНИЙ --- */
        .notification-badge {
            position: absolute;
            top: -6px;
            right: -6px;
            background: #e74c3c;
            color: white;
            font-size: 13px;
            font-weight: bold;
            min-width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
            border: 3px solid var(--bg-color);
            /* Обводка цветом фона для красоты */
            z-index: 10;
            padding: 0 5px;
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .notification-badge.hidden {
            display: none !important;
            transform: scale(0);
        }

        .icon {
            font-size: 32px;
            margin-bottom: 8px;
        }

        .label {
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
        }

        footer {
            margin-top: auto;
            padding: 30px 0;
            text-align: center;
        }

        .admin-link {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 13px;
            border-bottom: 1px dotted var(--text-secondary);
            transition: 0.3s;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

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

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* === СТИЛИ ДЛЯ ВСПЛЫВАЮЩИХ ОКОН IOS === */
        .ios-prompt {
            position: fixed;
            z-index: 99999;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(15px);
            /* Эффект стекла */
            -webkit-backdrop-filter: blur(15px);
            width: 90%;
            max-width: 360px;
            left: 50%;
            transform: translateX(-50%);
            bottom: 25px;
            padding: 20px;
            border-radius: 20px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
            text-align: center;
            color: #000;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            animation: popUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        /* Для темной темы */
        body.dark-theme .ios-prompt {
            background: rgba(30, 30, 30, 0.95);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .close-prompt {
            position: absolute;
            top: 10px;
            right: 15px;
            background: none;
            border: none;
            font-size: 24px;
            opacity: 0.5;
            cursor: pointer;
            color: inherit;
        }

        @keyframes popUp {
            from {
                transform: translateX(-50%) scale(0.8);
                opacity: 0;
            }

            to {
                transform: translateX(-50%) scale(1);
                opacity: 1;
            }
        }