.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px 30px 15px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

.example-formula {
    font-size: 1.4em;
    font-weight: bold;
    margin: 40px 0 30px 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 10px;
    max-width: 100%;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
    text-align: center;
}

.example-formula::-webkit-scrollbar {
    display: none;
}

.answer {
    font-size: 2em;
    color: #28a745;
    margin: 20px 0 30px 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    font-weight: bold;
    width: 100%;
    text-align: center;
}

.answer.show {
    opacity: 1;
}

.font-size-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.font-label {
    font-size: 0.9em;
    color: #2c3e50;
    font-weight: 600;
    margin-right: 5px;
}

.font-btn {
    width: 35px;
    height: 35px;
    background: white;
    border: 2px solid #2c3e50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
    cursor: pointer;
}

/* Контейнер для основного контента */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 20px;
}

/* === ОТВЕЧАЕТ ЗА ПОЛОЖЕНИЕ КНОПКИ === */
.action-btn {
    position: fixed;
    bottom: 10px; /* Поднял выше */
    left: 10px; /* Отступ слева */
    right: 10px; /* Отступ справа */
    width: calc(100% - 20px); /* Во всю ширину с отступами */
    z-index: 100;
    margin: 0;
    max-width: none; /* Убираем ограничение по ширине */
}
/* === КОНЕЦ СТИЛЕЙ ДЛЯ КНОПКИ === */

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .container {
        padding: 15px 10px 20px 10px;
        min-height: calc(100vh - 60px);
    }
    
    .example-formula {
        font-size: 1.2em;
        margin: 30px 0 20px 0;
        padding: 10px 5px;
        min-height: 50px;
    }
    
    .answer {
        font-size: 1.8em;
        margin: 15px 0 25px 0;
        min-height: 40px;
    }
    
    .font-size-controls {
        top: 10px;
        right: 10px;
    }
    
    .font-btn {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }
    
    /* === ОТВЕЧАЕТ ЗА ПОЛОЖЕНИЕ КНОПКИ НА МОБИЛЬНЫХ === */
    .action-btn {
        position: fixed;
        bottom: 40px; /* Поднял выше */
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        margin: 0;
    }
    
    .content-area {
        padding-bottom: 70px;
    }
}

@media (max-width: 360px) {
    .example-formula {
        font-size: 1.1em;
        padding: 8px 3px;
        margin: 25px 0 15px 0;
    }
    
    .answer {
        font-size: 1.6em;
        margin: 10px 0 20px 0;
    }
    
    .font-label {
        display: none;
    }
    
    /* === ОТВЕЧАЕТ ЗА ПОЛОЖЕНИЕ КНОПКИ НА МАЛЕНЬКИХ ЭКРАНАХ === */
    .action-btn {
        bottom: 8px;
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        font-size: 0.9em;
        padding: 12px 20px;
    }
    
    .content-area {
        padding-bottom: 60px;
    }
}

/* Для очень маленьких высот экрана */
@media (max-height: 600px) {
    .example-formula {
        margin: 20px 0 15px 0;
        min-height: 40px;
    }
    
    .answer {
        margin: 10px 0 15px 0;
        min-height: 30px;
        font-size: 1.5em;
    }
    
    .content-area {
        padding-bottom: 50px;
    }
}

/* Для компьютеров */
@media (min-width: 700px) {
    .container {
        padding: 30px 20px 40px 20px;
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* === ОТВЕЧАЕТ ЗА ПОЛОЖЕНИЕ КНОПКИ НА КОМПЬЮТЕРАХ === */
    .action-btn {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        min-width: 300px;
        max-width: 90%;
    }
}
