

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

.stopwatch-modern-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* центрируем содержимое */
    width: 40px; /* фиксированная ширина */
    height: 40px; /* фиксированная высота */
    padding: 0; /* убираем внутренние отступы */
    border: none;
    border-radius: 12px; /* закругленные углы */
    color: var(--text-color);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 20px;
    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 */
.stopwatch-mb-mb {
    padding-left: 6px;
}

/* Обновляем медиа-запросы */
@media (max-width: 992px) {
    .stopwatch-modern-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .stopwatch-modern-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .stopwatch-modern-button {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-radius: 8px;
    }
}

/* Блик на поверхности стекла */
.stopwatch-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;
}

.stopwatch-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);
}

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

.stopwatch-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);
}

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

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

.stopwatch-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;
}

.stopwatch-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    --progress: 0%; /* Добавляем переменную по умолчанию */
}

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

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

/* Определяем свойство --progress для анимации */
@property --progress {
    syntax: '<percentage>';
    inherits: true;
    initial-value: 0%;
}

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

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

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

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

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

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

@media (max-width: 768px) {

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

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

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

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

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

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

@media (max-width: 480px) {

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

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

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

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

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

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

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

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

    .stopwatch-circle {
        margin: 4px 0;
    }
}

/* МОДАЛЬНОЕ ОКНО СЕКУНДОМЕРА */
.stopwatch-modal-container {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 10px;
    padding-right: 50px;
    box-sizing: border-box;
    gap: 48px;
    min-height: 0;
}

/* Левый блок (40%) */
.stopwatch-modal-left {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.stopwatch-modal-title {
    font-size: 20px;
    font-weight: 300;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    padding: 8px 0;
}

.stopwatch-modal-habits-list {
    flex: 1;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.stopwatch-modal-habits-list:hover {
    overflow-y: auto;
}

.stopwatch-modal-habit-item {
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stopwatch-modal-habit-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.stopwatch-modal-radio-label {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
}

.stopwatch-modal-radio {
    display: none;
}

.stopwatch-modal-radio-custom {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stopwatch-modal-radio:checked + .stopwatch-modal-radio-custom {
    border-color: var(--success-color);
    background: var(--success-color);
    box-shadow: 0 0 0 4px rgba(var(--success-color-rgb), 0.2);
}

.stopwatch-modal-radio:checked + .stopwatch-modal-radio-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transform: scale(1);
    transition: transform 0.2s ease;
}

/* Правый блок (60%) */
.stopwatch-modal-right {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* Блок статистики */
.stopwatch-modal-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.stopwatch-modal-stats-list {
    flex: 1;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding: 2px;
}

.stopwatch-modal-stats-list:hover {
    overflow-y: auto;
}

.stopwatch-modal-stat-item {
    padding: 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stopwatch-modal-stat-item:hover {
    border-color: var(--success-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stopwatch-modal-stat-name {
    font-size: 12px;
    color: var(--text-color);
    font-weight: 300;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stopwatch-modal-stat-name::before {
    content: "•";
    color: var(--success-color);
    font-size: 20px;
}

.stopwatch-modal-stat-time {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}

.time-period {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    background: rgba(var(--success-color-rgb), 0.08);
    border-radius: 8px;
    border: 1px solid rgba(var(--success-color-rgb), 0.15);
}

.period-label {
    font-size: 12px;
    color: var(--secondary-text-color);
    font-weight: 300;
}

.period-value {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 400;
}

.stopwatch-modal-stat-forecast {
    display: flex;
    flex-direction: column;
}

.forecast-note {
    font-size: 10px;
    color: var(--secondary-text-color);
    font-style: italic;
    text-align: center;
    margin-bottom: 4px;
}

.forecast-periods {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
    flex-wrap: wrap;
}

.stopwatch-forecast-item {
    font-size: 10px;
    color: var(--text-color);
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Блок сессий */
.stopwatch-modal-sessions {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.stopwatch-modal-sessions-list {
    flex: 1;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    padding: 4px;
}

.stopwatch-modal-sessions-list:hover {
    overflow-y: auto;
}

.stopwatch-modal-session-item {
    padding: 6px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.stopwatch-modal-session-item:hover {
    border-color: var(--success-color);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.session-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stopwatch-modal-session-name {
    font-size: 12px;
    color: var(--text-color);
    font-weight: 300;
}

.stopwatch-modal-session-time {
    font-size: 11px;
    color: var(--success-color);
    font-weight: 300;
}

.session-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary-text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.session-delete-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    transform: scale(1.1);
}

.session-delete-btn:active {
    transform: scale(0.95);
}

.session-delete-btn svg {
    transition: all 0.3s ease;
}

.session-delete-btn:hover svg {
    filter: drop-shadow(0 2px 4px rgba(255, 59, 48, 0.3));
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .stopwatch-modal-session-item {
        padding: 10px 12px;
    }
    
    .stopwatch-modal-session-name {
        font-size: 13px;
    }
    
    .stopwatch-modal-session-time {
        font-size: 12px;
    }
    
    .session-delete-btn {
        width: 28px;
        height: 28px;
    }
    
    .session-delete-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Заголовки секций */
.stopwatch-modal-section-title {
    font-size: 18px;
    font-weight: 300;
    color: var(--text-color);
    margin-bottom: 10px;
    padding-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stopwatch-modal-section-title::before {
    content: "⏱";
    color: var(--success-color);
    font-size: 20px;
}

/* Стили скроллбара */
.stopwatch-modal-habits-list::-webkit-scrollbar,
.stopwatch-modal-stats-list::-webkit-scrollbar,
.stopwatch-modal-sessions-list::-webkit-scrollbar {
    width: 1px;
}

.stopwatch-modal-habits-list::-webkit-scrollbar-track,
.stopwatch-modal-stats-list::-webkit-scrollbar-track,
.stopwatch-modal-sessions-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1px;
}

.stopwatch-modal-habits-list::-webkit-scrollbar-thumb,
.stopwatch-modal-stats-list::-webkit-scrollbar-thumb,
.stopwatch-modal-sessions-list::-webkit-scrollbar-thumb {
    background: var(--success-color);
    border-radius: 1px;
    opacity: 0.6;
}

.stopwatch-modal-habits-list::-webkit-scrollbar-thumb:hover,
.stopwatch-modal-stats-list::-webkit-scrollbar-thumb:hover,
.stopwatch-modal-sessions-list::-webkit-scrollbar-thumb:hover {
    opacity: 0.8;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stopwatch-modal-stat-item,
.stopwatch-modal-session-item,
.stopwatch-modal-habit-item {
    animation: fadeIn 0.4s ease forwards;
}