.circle-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    /* Критически важно! */
    flex-wrap: wrap;
    /* Перенос на маленьких экранах */
    gap: 10px;
    /* Пространство между кругами */
    padding: 10px;
    box-sizing: border-box;
}

.circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--circle-progress-color) 0%,
            var(--circle-progress-bg) var(--progress),
            transparent var(--progress),
            transparent 100%);
    -webkit-mask: radial-gradient(farthest-side,
            transparent calc(100% - 4px),
            var(--circle-progress-bg) calc(100% - 3px));
    mask: radial-gradient(farthest-side,
            transparent calc(100% - 4px),
            var(--circle-progress-bg) calc(100% - 3px));
}

.circle>span {
    position: relative;
    z-index: 1;
    color: var(--circle-text-color);
    font-size: 0.8em;
}

.circle::before {
    transition: --progress 0.5s linear;
}

@property --progress {
    syntax: '<percentage>';
    inherits: true;
    initial-value: 0%;
}

.ball-timer-1 {
    width: 60px;
    height: 60px;
    background: rgba(var(--accent-color-back), 0.5);
    filter: blur(50px);
    top: 10%;
    left: 20%;
}

.modern-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border: none;
    border-radius: 12px;
    color: var(--text-color);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 20px;
    /* font-weight: 200; */
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1;

    /* Основные стили жидкого стекла */
    background: rgba(var(--primary-color), 0.15);
    backdrop-filter: blur(10px);
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.4),
        inset -1px -1px 2px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(var(--accent-color-back), 0.15);

    /* Градиентная рамка */
    border: 1px solid transparent;
    background-clip: padding-box;
    padding-bottom: 3px;
}

.mb-mb {
    padding-bottom: 5px;
}

/* Блик на поверхности стекла */
.modern-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom,
            rgba(48, 47, 47, 0.5),
            transparent);
    border-radius: 12px 12px 0 0;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.modern-button:hover {
    box-shadow:
        inset 1px 1px 3px rgba(255, 255, 255, 0.162),
        inset -1px -1px 3px rgba(0, 0, 0, 0.1),
        0 6px 16px rgba(var(--accent-color-back), 0.2);
    transform: translateY(-1px);
    background: rgba(var(--primary-color), 0.25);
}

.modern-button:hover::after {
    opacity: 0.8;
}

.modern-button:active {
    transform: translateY(1px);
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.3),
        inset -1px -1px 2px rgba(0, 0, 0, 0.1),
        0 2px 6px rgba(var(--accent-color-back), 0.15);
}

.icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    stroke-width: 2;
    transition: transform 0.2s ease;
    stroke: var(--text-color);
}

.modern-button:active .icon {
    transform: translateX(2px);
}

/* Базовые стили для таймера */
.circle-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
}

.circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

/* ... остальные базовые стили ... */

/* Медиа-запросы для адаптации */
@media (max-width: 992px) {
    #timer-box {
        display: none;
    }

    /* Планшеты */
    .circle {
        width: 36px;
        height: 36px;
    }

    .circle>span {
        font-size: 0.75em;
    }

    .modern-button {
        padding: 1px 14px;
        font-size: 13px;
    }

    .icon {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }

    .ball-timer-1 {
        width: 50px;
        height: 50px;
        filter: blur(40px);
    }
}

@media (max-width: 768px) {

    /* Большие мобильные устройства */
    .circle-row {
        gap: 8px;
        padding: 8px;
    }

    .circle {
        width: 32px;
        height: 32px;
    }

    .circle>span {
        font-size: 0.7em;
    }

    .modern-button {
        padding: 1px 12px;
        font-size: 12px;
        border-radius: 10px;
    }

    .icon {
        width: 14px;
        height: 14px;
        margin-right: 5px;
    }

    .ball-timer-1 {
        width: 40px;
        height: 40px;
        filter: blur(30px);
    }
}

@media (max-width: 480px) {

    /* Малые мобильные устройства */
    .circle-row {
        gap: 6px;
        padding: 6px;
        justify-content: center;
    }

    .circle {
        width: 28px;
        height: 28px;
    }

    .circle>span {
        font-size: 0.6em;
    }

    .modern-button {
        padding: 1px 10px;
        font-size: 11px;
        border-radius: 8px;
    }

    .icon {
        width: 12px;
        height: 12px;
        margin-right: 4px;
    }

    .ball-timer-1 {
        display: none;
        /* Скрываем на очень маленьких экранах */
    }

    /* Уменьшаем размеры псевдоэлементов */
    .modern-button::before,
    .modern-button::after {
        margin: -1px;
    }
}

/* Вертикальная ориентация на мобильных */
@media (max-height: 600px) and (max-width: 768px) {
    .circle-row {
        flex-wrap: nowrap;
        flex-direction: column;
        justify-content: flex-start;
        overflow-y: auto;
        padding: 5px;
    }

    .circle {
        margin: 4px 0;
    }
}

.modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Предотвращаем скролл всего контейнера */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(var(--text-color), 0.1);
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: rgba(var(--accent-color-back), 0.8);
}

.modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow: hidden; /* Убираем скролл */
    display: flex;
    flex-direction: column;
}

.timer-settings-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 20px;
    overflow: hidden; /* Убираем скролл */
    padding-right: 5px; /* Компенсируем возможную потерю ширины из-за скролла */
}

.timer-setting {
    display: flex;
    flex-direction: column;
    width: 95%;
    flex-shrink: 0; /* Предотвращаем сжатие */
}

.timer-setting label {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.timer-setting input[type="number"] {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(var(--text-color), 0.2);
    background: rgba(var(--primary-color), 0.1);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Важно для правильного расчета ширины */
}

.checkbox-setting {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: auto; /* Прижимаем чекбокс к низу, если нужно */
}

.checkbox-setting label {
    margin-bottom: 0;
    flex-grow: 1;
}

.timer-setting input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: rgba(var(--accent-color-back), 0.8);
    cursor: pointer;
    margin-left: 10px;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid rgba(var(--text-color), 0.1);
    flex-shrink: 0;
}

#reset-timer, #save-timer {
    padding: 10px 0;
    font-size: 0.9rem;
    flex: 1;
}

#save-timer {
    margin-left: 10px;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .timer-setting {
        margin-bottom: 15px;
    }
    
    .timer-setting input[type="number"] {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .modal-footer {
        padding: 12px 15px;
    }
    
    #reset-timer, #save-timer {
        padding: 6px 15px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 10px 12px;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 10px;
    }
    
    .timer-setting label {
        font-size: 0.8rem;
    }
    
    .timer-setting input[type="number"] {
        padding: 6px 10px;
    }
    
    .modal-footer {
        justify-content: center;
    }
}

.btn-icon {
    /* width: 1em; */
    /* height: 1em; */
    display: block;
    /* margin: 0 auto; */
}

/* Иконка плей по умолчанию скрыта */
#play-icon {
    display: none;
}

.circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        transparent 0%,
        transparent var(--progress),
        var(--circle-progress-color) var(--progress),
        var(--circle-progress-color) 100%
    );
    -webkit-mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 4px),
        var(--circle-progress-bg) calc(100% - 3px)
    );
    mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 4px),
        var(--circle-progress-bg) calc(100% - 3px)
    );
    transform: rotate(-90deg);
    z-index: 0;
}

#btn-stop {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
}

#edit-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
}

#btn-stop .btn-icon {
    margin: 0;
    width: 18px;
    height: 18px;
}

.circle:nth-child(5)::before {
    display: none !important;
}

.circle:nth-child(5) {
    background: rgba(var(--primary-color), 0.1);
    border: 1px solid rgba(var(--text-color), 0.2);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid rgba(var(--text-color), 0.1);
    flex-shrink: 0;
    gap: 15px; /* Добавим промежуток между кнопками */
}

#reset-timer, #save-timer {
    flex: 1;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#reset-timer {
    background-color: rgba(var(--text-color), 0.08);
    color: var(--text-color);
}

#reset-timer:hover {
    background-color: rgba(var(--text-color), 0.15);
}

#reset-timer:active {
    transform: scale(0.98);
}

#save-timer {
    background-color: rgba(var(--accent-color-back), 0.3);
    color: white;
    box-shadow: 0 2px 4px rgba(var(--accent-color-back), 0.2);
}

#save-timer:hover {
    background-color: rgba(var(--accent-color-back), 0.9);
    box-shadow: 0 3px 6px rgba(var(--accent-color-back), 0.25);
}

#save-timer:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(var(--accent-color-back), 0.15);
}

/* Для фокуса (доступность) */
#reset-timer:focus-visible, 
#save-timer:focus-visible {
    outline: 2px solid rgba(var(--accent-color-back), 0.5);
    outline-offset: 2px;
}