:root {
    --light-bg: #f0f0f0;
    --dark-bg: #222222;
    --light-text: #333333;
    --dark-text: #eeeeee;
    --cup-outline: #8B4513;
    --coffee-start: #C4714D;
    --coffee-end: #8B4513;
    --btn-color: #999999;
    --btn-hover: #777777;
    --clock-size: 120px;
    --cup-size: 120px;
    --timer-size: 36px;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--light-bg);
    color: var(--light-text);
    font-family: Arial, sans-serif;
    transition: background-color 0.1s, color 0.1s, transform 0.5s;
    overflow: auto;
    position: relative;
}

body.mobile-horizontal {
    margin: 0;
    padding: 0;
}
body.night-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

/* --- СТИЛИ ШУТЕРА (SHOOTER MODE) --- */

/* Стили текста в режиме шутера */
body.shooter-mode #pomodoroTimer,
body.shooter-mode #time,
body.shooter-mode #date {
    transition: color 0.3s ease;
    /* Сильная тень, чтобы цифры читались на фоне взрывов */
    text-shadow: 0 0 20px #000, 0 0 10px #000, 2px 2px 0px rgba(0,0,0,0.8);
}

/* Дневной режим (Night Mode OFF) - Белый */
body.shooter-mode:not(.night-mode) #pomodoroTimer,
body.shooter-mode:not(.night-mode) #time,
body.shooter-mode:not(.night-mode) #date,
body.shooter-mode:not(.night-mode) .pomodoro-btn {
    color: #ffffff !important;
}

/* Ночной режим (Night Mode ON) - Темно-серый */
body.shooter-mode.night-mode #pomodoroTimer,
body.shooter-mode.night-mode #time,
body.shooter-mode.night-mode #date,
body.shooter-mode.night-mode .pomodoro-btn {
    color: #333333 !important;
}

/* Убираем рамки и фон у кнопок в режиме шутера, но сохраняем размеры */
body.shooter-mode .pomodoro-btn {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    /* Размеры уже заданы в основном CSS, здесь мы их не трогаем */
}

/* Rotation for mobile horizontal mode - disabled */
body.mobile-horizontal {
    /* transform: rotate(90deg); */ /* Полностью убрали поворот для нормального отображения */
    transform-origin: center center;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 0;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    transition: all 0.5s ease;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
}

@media (max-width: 900px) {
    .container:not(.horizontal) {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: auto;
        min-height: auto;
    }
}

/* Horizontal Layout - центрирование по высоте относительно часов */
.container.horizontal {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0;
    max-width: 100%;
    padding: 0;
    height: auto;
    min-height: 100vh;
    position: relative;
    margin: 0 auto;
    box-sizing: border-box;
}

body.mobile-horizontal .container.horizontal {
    width: 100%;
    height: auto;
    min-height: 100vw;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 0;
    margin: 0 auto;
    box-sizing: border-box;
}

.container.horizontal .clock-section,
.container.horizontal .pomodoro-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

body.mobile-horizontal .container.horizontal .clock-section {
    flex: 0 0 67%;
    max-width: 67%;
    width: 67%;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

body.mobile-horizontal .container.horizontal .pomodoro-section {
    flex: 0 0 33%;
    max-width: 33%;
    width: 33%;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
}

body.mobile-horizontal .container.horizontal .time {
    font-size: calc(var(--clock-size) / 1.2);
    max-width: 100%;
    word-break: break-word;
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

body.mobile-horizontal .container.horizontal .coffee-cup-container {
    width: var(--cup-size) !important;
    height: var(--cup-size) !important;
    margin: 0;
    order: 3;
}

body.mobile-horizontal .container.horizontal .pomodoro-timer {
    order: 1;
}

body.mobile-horizontal .container.horizontal .pomodoro-controls {
    order: 2;
}

body.mobile-horizontal .container.horizontal .pomodoro-section {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 10px;
}

/* Clock Section */
.clock-section {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.time {
    font-size: 20vw;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    transition: font-size 0.3s;
}

/* В горизонтальном режиме - фиксированный размер */
.container.horizontal .time {
    font-size: var(--clock-size);
}

.date {
    font-size: 8vw;
    display: none;
    margin-top: 10px;
}

.container.horizontal .date {
    font-size: calc(var(--clock-size) * 0.3);
}

/* Pomodoro Timer Section */
.pomodoro-section {
    display: none;
    width: 100%;
    background: transparent;
    padding: 0;
    text-align: center;
}

.pomodoro-section.visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pomodoro-status {
    display: none;
}

/* Coffee Cup SVG */
.coffee-cup-container {
    position: relative;
    width: var(--cup-size);
    height: var(--cup-size);
    margin: 0 auto;
    cursor: ns-resize;
    transition: all 0.3s;
}

/* В горизонтальном режиме - размер = размеру часов */
.container.horizontal .coffee-cup-container {
    height: calc(var(--cup-size) * 1.00); /* в горизонтальном режиме кружка выше */
    margin: 0;
}

.coffee-cup {
    width: 100%;
    height: 100%;
}

.cup-body {
    fill: none;
    stroke: var(--cup-outline);
    stroke-width: 3;
}

.coffee-fill {
    fill: url(#coffeeGradient);
    transition: height 0.5s ease, y 0.5s ease;
}

.cup-handle {
    fill: none;
    stroke: var(--cup-outline);
    stroke-width: 3;
}

/* Steam animation */
.steam {
    opacity: 0.6;
    stroke: var(--cup-outline);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    animation: steam-rise 2s ease-in-out infinite;
}

.steam:nth-child(2) {
    animation-delay: 0.3s;
}

.steam:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes steam-rise {
    0% {
        opacity: 0.6;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
}

/* Timer Display - под чашкой */
.session-counter-div {
    display: none;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--light-text);
}

.pomodoro-timer {
    font-size: var(--timer-size);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin: 10px 0 5px 0;
    color: var(--light-text);
    cursor: ns-resize;
    transition: font-size 0.3s;
}

/* В горизонтальном режиме - меньше и ближе */
.container.horizontal .pomodoro-timer {
    margin: 5px 0 5px 0;
}

body.mobile-horizontal .container.horizontal .pomodoro-timer {
    margin: 20px 0 2px 0;
}

body.night-mode .pomodoro-timer {
    color: var(--dark-text);
}

/* Control Buttons - под таймером */
.pomodoro-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 5px 0 0 0;
}

.container.horizontal .pomodoro-controls {
    gap: 5px;
    margin: 5px 0 0 0;
}

.pomodoro-btn {
    padding: 0;
    width: 40px;
    height: 40px;
    font-size: 10px;
    border: none;
    cursor: pointer;
    color: var(--btn-color);
    background: transparent;
    transition: color 0.2s;
}

/* В горизонтальном режиме - меньше */
.container.horizontal .pomodoro-btn {
    width: calc(var(--timer-size) * 0.833);
    height: calc(var(--timer-size) * 0.833);
    font-size: calc(var(--timer-size) * 0.222);
}

.pomodoro-btn {
    width: calc(var(--timer-size) * 1.667);
    height: calc(var(--timer-size) * 1.667);
    font-size: calc(var(--timer-size) * 0.444);
}

.pomodoro-btn:hover {
    color: var(--btn-hover);
}

.pomodoro-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Seconds pulse animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.seconds-pulse {
    animation: pulse 1s infinite;
}

/* Settings Panel */
.options {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    background-color: rgba(240, 240, 240, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    z-index: 1000;
}

body.night-mode .options {
    background-color: rgba(34, 34, 34, 0.95);
}

/* Checkbox styles */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: inherit;
    line-height: 1.2;
}

/* фикс «наползания»: абсолютный инпут иногда попадает в поток/наезжает в модале */
.checkbox-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: #ddd;
    border-radius: 4px;
    margin-right: 8px;
    transition: background-color 0.3s, transform 0.2s;
}

.checkbox-label:hover .checkmark {
    transform: scale(1.1);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #4CAF50;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

body.night-mode .checkmark {
    background-color: #555;
}

body.night-mode .checkbox-label input:checked ~ .checkmark {
    background-color: #2196F3;
}

/* Settings Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body.night-mode .modal {
    background: #333;
    color: var(--dark-text);
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.modal-field input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

body.night-mode .modal-field input {
    background: #444;
    color: var(--dark-text);
    border-color: #666;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.modal-btn.save {
    background-color: #4CAF50;
    color: white;
}

.modal-btn.cancel {
    background-color: #ccc;
    color: #333;
}

.modal-btn.reset {
    background-color: #f44336;
    color: white;
}

/*!* Responsive *!*/
/*@media (max-width: 600px) {*/
/*    .time {*/
/*        font-size: 15vw;*/
/*    }*/
/*    .date {*/
/*        font-size: 6vw;*/
/*    }*/
/*    .coffee-cup-container {*/
/*        width: 250px;*/
/*        height: 250px;*/
/*    }*/
/*    .pomodoro-timer {*/
/*        font-size: 36px;*/
/*    }*/
/*}*/

/*@media (max-width: 500px) {*/
/*    .time {*/
/*        font-size: 12vw;*/
/*    }*/
/*    .coffee-cup-container {*/
/*        width: 200px;*/
/*        height: 200px;*/
/*    }*/
/*    .pomodoro-timer {*/
/*        font-size: 28px;*/
/*    }*/
/*}*/

/* === СТИЛИ КОНЦЕНТРАЦИИ === */

.modal-sep {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 16px 0;
}

.modal h3 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #d1d5db;
}

.focus-settings {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

/* Скрываем настройки если не выбран режим - можно убрать если нужно всегда показывать */
.focus-settings.hidden {
    display: none;
}

/* Индикатор концентрации под кружкой */
.focus-indicator {
    text-align: center;
    min-height: 24px;
    margin-top: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #60a5fa;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.focus-indicator.active {
    opacity: 1;
}

.focus-indicator.waiting {
    color: #fbbf24;
}

.focus-indicator.settled {
    /* текст будет белый на зелёной полосе */
    color: #ffffff;
}

/* Полоса концентрации сверху */
.focus-bar {
    width: 100%;
    max-width: 100%;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 8px;
    background: rgba(34, 197, 94, 0.95); /* green */
    color: #fff;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.focus-bar.active {
    display: flex;
}

.focus-bar__label {
    font-size: 12px;
    opacity: 0.9;
}

.focus-bar__time {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

/* полоса теперь в потоке под кнопками */
body.focus-bar-on {
    padding-top: 0;
}

/* Кнопка фокуса - активное состояние */
#focusBtn.active {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.6);
}