/* === 1. Глобальные сбросы и шрифты === */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body, html {
    height: 100%; 
    font-family: 'Segoe UI', -apple-system, sans-serif; /* Твой шрифт + системный запасной */
    color: white; 
    overflow: hidden;
}

/* === 2. Общий фон и контейнеры === */
#background {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-size: cover; 
    background-position: center; 
    z-index: -1;
}

.container {
    display: flex; 
    flex-direction: column; 
    align-items: center;
    width: 100%; 
    height: 100%; 
    z-index: 1; 
    text-align: center;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
}

h1 { 
    margin: 0 0 24px 0;
    font-size: 2.4rem;
    font-weight: 700;
    color: #e0d6ff; 
    text-shadow:
        0 0 12px rgba(125, 95, 225, 0.6),
        0 0 24px rgba(125, 95, 255, 0.3);
    letter-spacing: 1px; 
    position: relative;
}

/* === 3. Кнопки (Универсальные стили) === */

/* Твой стиль .nav-btn и .footer-nav из styles.css */
.nav-btn, .footer-nav a, .footer-nav button, .primary-btn, .secondary-btn {
    display: inline-block;
    padding: 10px 20px; 
    border-radius: 20px;
    background: #6a5acd !important; /* Насыщенный фиолетовый из твоего фикса */
    color: white !important;
    text-decoration: none; 
    font-weight: bold; 
    transition: 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 1 !important;
}

.footer-nav {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
}

.footer-nav .nav-btn {
    padding: 12px 28px;
    font-size: 0.95em;
    border-radius: 50%;
    background: rgba(74, 58, 138, 0.8);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-nav .nav-btn:hover {
    background: #7d5fff;
    transform: scale(1.05);
}

.nav-btn:hover, .primary-btn:hover { 
    background: #7b68ee !important; 
    transform: scale(1.05); 
}

button:disabled { 
    background: #555 !important; 
    cursor: not-allowed; 
    transform: none; 
}

/* === 4. Настройки (⚙️) — Общие элементы === */
.settings-wrapper { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 1000; 
}

.settings-trigger {
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    font-size: 24px;
    background: rgba(0,0,0,0.5); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2); 
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.settings-menu {
    display: none; 
    position: absolute; 
    bottom: 60px; 
    right: 0;
    width: 260px; 
    background: rgba(20, 20, 30, 0.95); 
    padding: 20px;
    border-radius: 15px; 
    border: 1px solid rgba(255,255,255,0.1); 
    backdrop-filter: blur(10px);
}

.settings-menu.active { 
    display: block; 
}

/* === 5. Общие анимации === */
@keyframes pulse { 
    to { transform: scale(1.05); } 
}

h1::after {
    content: "";
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(125, 95, 255, 0.7), transparent);
    transform: translateX(-50%);
    opacity: 0.8;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% {opacity: 0.6;}
        50%{ opacity: 1;}
    }

    /* === 6. Адаптивность для мобильных устройств === */
@media (max-width: 480px) {
    /* Чтобы контент не упирался в края экрана */
    .container {
        padding: 10px;
        justify-content: flex-start; /* Прижимаем к верху, чтобы влезла клавиатура */
    }

    h1 {
        font-size: 1.8rem; /* Уменьшаем заголовок, чтобы освободить место */
        margin-bottom: 15px;
    }

    /* Сокращаем поле ввода */
    input[type="text"], 
    .question-input,
    #question { 
        width: 85% !important; 
        max-width: 280px; 
        height: 45px; /* Фиксированная высота, чтобы не «раздувалось» */
        margin: 10px auto !important;
        font-size: 16px; /* Предотвращает авто-зум на iPhone */
    }

    /* Кнопка "Спросить" */
    .primary-btn, 
    button[type="submit"] {
        width: 70%;
        padding: 12px;
        margin-top: 10px;
        font-size: 1rem;
    }

    /* Если часы имеют свой класс, например .clock-container */
    .clock-container, #clock {
        margin-bottom: 10px;
        transform: scale(0.9); /* Слегка уменьшаем часы, если они огромные */
    }
}

/* Специальный фикс для мобильных устройств */
@media (max-width: 600px) {
    /* 1. Освобождаем место сверху под печати из dev_seal.html */
    .container {
        padding-top: 100px !important; /* Чтобы заголовок не налезал на логотип и донат */
        justify-content: flex-start !important;
        overflow-y: auto; /* Разрешаем скролл, если клавиатура всё перекрыла */
    }

    /* Скрываем кнопку голосового ввода */
    #voiceBtn, .voice-btn {
        display: none !important;
    }

    /* 2. Уменьшаем заголовок */
    h1 {
        font-size: 1.6rem !important;
        margin-bottom: 15px !important;
    }

    /* 3. СОКРАЩАЕМ ПОЛЕ ВВОДА (Твой главный запрос) */
    .input-group, .input-section, .question-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100% !important;
        gap: 10px;
    }

    /* Поля ввода (текст, дата, textarea) */
    input[type="text"], 
    input[type="date"], 
    textarea#question {
        width: 80% !important; /* Сокращаем ширину до 80% */
        max-width: 280px;      /* Ограничиваем жестко */
        min-height: 44px;      /* Удобно для нажатия пальцем */
        margin: 0 auto !important;
        font-size: 16px !important; /* Запрет авто-зума в iOS */
    }

    /* 4. Кнопка "Спросить" / "Узнать судьбу" */
    .primary-btn, #horoBtn, #castBtn {
        width: 70% !important;
        padding: 12px !important;
        font-size: 1rem !important;
        margin-top: 5px !important;
    }

    /* 5. Магический шар (делаем чуть меньше, чтобы всё влезло) */
    .magic-ball {
        width: 180px !important;
        height: 180px !important;
        margin: 10px auto !important;
    }

    /* 2. Контейнер для поля и кнопки */
    .input-group, .input-section {
        margin-top: auto; /* Выталкивает форму максимально вниз контейнера */
        margin-bottom: 40px; /* Отступ от самого низа экрана */
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* 3. Сокращаем поле ввода */
    #questionInput, #birthDate, #question {
        width: 85% !important;
        max-width: 280px;
        margin-bottom: 10px !important;
    }

    /* 4. Кнопка "Спросить" под полем */
    .primary-btn, #horoBtn, #castBtn {
        width: 85% !important;
        order: 2; /* Гарантируем, что кнопка идет после инпута */
    }
}