* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-gradient-light: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --bg-gradient-dark: linear-gradient(135deg, #434343 0%, #000000 100%);
    --text-light: #333;
    --text-dark: #f0f0f0;
    --panel-bg-light: rgba(255, 255, 255, 0.95);
    --panel-bg-dark: rgba(30, 30, 30, 0.95);
    --card-bg-light: rgba(255, 255, 255);
    --card-bg-dark: rgba(40, 40, 40);
    --border-light: #ddd;
    --border-dark: #555;
    --primary-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --success-color: #27ae60;
    --timer-normal: #2c3e50;
    --timer-normal-dark: #ecf0f1;
    --timer-warning: #f39c12;
    --timer-over: #e74c3c;
    --shadow-light: rgba(0, 0, 0, 0.2);
    --shadow-dark: rgba(0, 0, 0, 0.5);
    --input-bg-light: #fff;
    --input-bg-dark: #333;
    --input-text-light: #333;
    --input-text-dark: #fff;
    --input-border-light: #ddd;
    --input-border-dark: #555;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient-light);
    color: var(--text-light);
    line-height: 1.6;
    padding: 10px;
    min-height: 100vh;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

body.dark {
    background: var(--bg-gradient-dark);
    color: var(--text-dark);
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 350px;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.95) 0%, rgba(41, 128, 185, 0.95) 100%);
    color: white;
    border-left: 4px solid #2980b9;
}

.notification.warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.95) 0%, rgba(230, 126, 34, 0.95) 100%);
    color: white;
    border-left: 4px solid #d68910;
}

.notification.over {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95) 0%, rgba(192, 57, 43, 0.95) 100%);
    color: white;
    border-left: 4px solid #c0392b;
}

.notification i {
    font-size: 20px;
    flex-shrink: 0;
}

body.dark .notification {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        animation: slideInDown 0.3s ease-out;
    }

    @keyframes slideInDown {
        from {
            opacity: 0;
            transform: translateY(-100%);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Переключатель темы */
.theme-toggle {
    /* position: fixed; */
    bottom: 70px;
    right: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 20px;
    touch-action: manipulation;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 22px;
    color: #333;
}

body.dark .theme-toggle {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--warning-color);
}

body.dark .theme-toggle i {
    color: #fff;
}

@media (max-width: 768px) {
    .theme-toggle {
        bottom: 80px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.global-timers {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--panel-bg-light);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-light);
    gap: 15px;
    backdrop-filter: blur(10px);
}

body.dark .global-timers {
    background: var(--panel-bg-dark);
    box-shadow: 0 5px 20px var(--shadow-dark);
}

.global-timer {
    text-align: center;
    width: 100%;
}

.global-timer h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

body.dark .global-timer h3 {
    color: #aaa;
}

.global-timer div {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--timer-normal);
    margin-bottom: 10px;
}

body.dark .global-timer div {
    color: var(--timer-normal-dark);
}

/* Название дебатов */
.debate-title-input {
    width: 100%;
    max-width: 300px;
    margin: 10px auto 0;
}

.debate-title {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: var(--panel-bg-light);
    color: var(--timer-normal);
    transition: all 0.3s;
    outline: none;
}

body.dark .debate-title {
    background: var(--panel-bg-dark);
    color: var(--timer-normal-dark);
    border-color: var(--primary-color);
}

.debate-title:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

body.dark .debate-title:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4);
}

.start-debate-btn {
    background: linear-gradient(135deg, var(--success-color) 0%, #219653 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    touch-action: manipulation;
}

.start-debate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.start-debate-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.start-debate-btn.stop {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.start-debate-btn.stop:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.sides-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: auto;
}

@media (min-width: 768px) {
    .sides-container {
        flex-direction: row;
    }
}

.side {
    background: var(--card-bg-light);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    flex: 1;
}

body.dark .side {
    background: var(--card-bg-dark);
    box-shadow: 0 5px 15px var(--shadow-dark);
}

.side:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-light);
}

body.dark .side:hover {
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.side.active {
    box-shadow: 0 0 0 3px var(--primary-color), 0 8px 25px var(--shadow-light);
    animation: pulse-border 2s infinite;
}

body.dark .side.active {
    box-shadow: 0 0 0 3px var(--primary-color), 0 8px 25px var(--shadow-dark);
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 3px var(--primary-color), 0 8px 25px var(--shadow-light);
    }

    50% {
        box-shadow: 0 0 0 5px var(--primary-color), 0 8px 25px var(--shadow-light);
    }

    100% {
        box-shadow: 0 0 0 3px var(--primary-color), 0 8px 25px var(--shadow-light);
    }
}

body.dark .side.active {
    animation: pulse-border-dark 2s infinite;
}

@keyframes pulse-border-dark {
    0% {
        box-shadow: 0 0 0 3px var(--primary-color), 0 8px 25px var(--shadow-dark);
    }

    50% {
        box-shadow: 0 0 0 5px var(--primary-color), 0 8px 25px var(--shadow-dark);
    }

    100% {
        box-shadow: 0 0 0 3px var(--primary-color), 0 8px 25px var(--shadow-dark);
    }
}

.left-side {
    border-top: 5px solid var(--primary-color);
}

.right-side {
    border-top: 5px solid var(--danger-color);
}

.side-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    position: relative;
}

@media (min-width: 480px) {
    .side-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

body.dark .side-header {
    border-bottom: 1px solid #555;
}

/* Часики становятся зелеными при активном таймере */
.total-time i {
    font-size: 18px;
    color: #7f8c8d;
    /* Серый по умолчанию */
    transition: color 0.3s;
}

body.dark .total-time i {
    color: #aaa;
}

.side.active .total-time i,
.neutral-side.active .total-time i {
    position: relative;
    animation: clock-intense-pulse 1s infinite alternate !important;
}

body.dark .side.active .total-time i,
body.dark .neutral-side.active .total-time i {
    animation: clock-intense-pulse-dark 1s infinite alternate !important;
}

@keyframes clock-intense-pulse {
    0% {
        color: #27ae60;
        text-shadow: 0 0 8px rgba(39, 174, 96, 0.6),
            0 0 12px rgba(39, 174, 96, 0.3);
    }

    100% {
        color: #2ecc71;
        text-shadow: 0 0 15px rgba(46, 204, 113, 0.9),
            0 0 25px rgba(46, 204, 113, 0.5),
            0 0 35px rgba(46, 204, 113, 0.2);
    }
}

@keyframes clock-intense-pulse-dark {
    0% {
        color: #2ecc71;
        text-shadow: 0 0 12px rgba(46, 204, 113, 0.8),
            0 0 20px rgba(46, 204, 113, 0.4);
    }

    100% {
        color: #27ae60;
        text-shadow: 0 0 20px rgba(39, 174, 96, 0.9),
            0 0 35px rgba(39, 174, 96, 0.6),
            0 0 45px rgba(39, 174, 96, 0.3);
    }
}

.speaking-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    animation: blink 1s infinite;
    display: none;
    z-index: 10;
}

.side.active .speaking-indicator {
    display: block;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.side-name-input {
    font-size: 18px;
    font-weight: 600;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    color: var(--timer-normal);
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.3s;
    text-align: center;
}

@media (min-width: 480px) {
    .side-name-input {
        text-align: left;
        width: 70%;
        margin-left: 0;
    }
}

body.dark .side-name-input {
    color: var(--timer-normal-dark);
}

.side-name-input:focus {
    background: #f8f9fa;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.dark .side-name-input:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.total-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    color: #7f8c8d;
}

@media (min-width: 480px) {
    .total-time {
        justify-content: flex-end;
    }
}

body.dark .total-time {
    color: #aaa;
}

.total-time span {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 18px;
    color: var(--timer-normal);
}

body.dark .total-time span {
    color: var(--timer-normal-dark);
}

.timer-display {
    text-align: center;
    margin: 15px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.active-timer-display {
    font-size: 60px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-bottom: 15px;
    color: var(--timer-normal);
    line-height: 1;
    transition: all 0.3s;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    word-break: break-all;
}

@media (min-width: 768px) {
    .active-timer-display {
        font-size: 80px;
    }
}

@media (min-width: 1200px) {
    .active-timer-display {
        font-size: 96px;
    }
}

body.dark .active-timer-display {
    color: var(--timer-normal-dark);
}

.timer-label {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    height: 24px;
    word-break: break-word;
}

body.dark .timer-label {
    color: #aaa;
}

.normal {
    color: var(--timer-normal);
}

body.dark .normal {
    color: var(--timer-normal-dark);
}

.warning {
    color: var(--timer-warning);
    animation: pulse 1s infinite;
}

.over {
    color: var(--timer-over);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulse-warning {
    0% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    }

    100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);
    }
}

.active-timer-display.warning-pulse {
    color: #ffc107 !important;
    animation: pulse-warning 1.5s infinite !important;
}

.timers-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 15px 0;
}

@media (max-width: 380px) {
    .timers-selection {
        grid-template-columns: 1fr;
    }
}

.timer-option {
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    background: #f8f9fa;
    touch-action: manipulation;
}

body.dark .timer-option {
    border: 2px solid var(--border-dark);
    background: #2c3e50;
}

.timer-option:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

body.dark .timer-option:hover {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.timer-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.timer-option-name {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 14px;
}

.timer-option-time {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 15px;
}

@media (min-width: 480px) {
    .controls {
        grid-template-columns: repeat(4, 1fr);
    }
}

.control-btn {
    width: 150px;
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s;
    box-shadow: 0 4px 6px var(--shadow-light);
    touch-action: manipulation;
    min-height: 60px;
}

@media (min-width: 480px) {
    .control-btn {
        flex-direction: row;
        font-size: 15px;
        padding: 12px;
    }
}

body.dark .control-btn {
    box-shadow: 0 4px 6px var(--shadow-dark);
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px var(--shadow-light);
}

body.dark .control-btn:hover:not(:disabled) {
    box-shadow: 0 6px 12px var(--shadow-dark);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.control-btn i {
    font-size: 16px;
}

.start-btn {
    background: linear-gradient(135deg, #1e8449 0%, #186a3b 100%);
    color: white;
}

.start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #219653 0%, #1e8449 100%);
}

.pause-btn {
    background: linear-gradient(135deg, #d68910 0%, #b9770e 100%);
    color: white;
}

.pause-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d68910 0%, #b9770e 100%);
}

.reset-btn {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    color: white;
}

.reset-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.add-time-btn {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
    color: white;
}

.add-time-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
}

/* Кнопка продолжения */
.continue {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%) !important;
}

.continue:hover:not(:disabled) {
    background: linear-gradient(135deg, #219653 0%, #1e8449 100%) !important;
}

.add-time-panel {
    margin-top: 15px;
    padding: 15px;
    background: var(--panel-bg-light);
    border-radius: 12px;
    display: none;
    flex-direction: column;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 5px 20px var(--shadow-light);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary-color);
}

body.dark .add-time-panel {
    background: var(--panel-bg-dark);
    box-shadow: 0 5px 20px var(--shadow-dark);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.add-time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.add-time-header h3 {
    color: var(--timer-normal);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark .add-time-header h3 {
    color: var(--timer-normal-dark);
}

.add-time-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

@media (max-width: 380px) {
    .add-time-options {
        grid-template-columns: 1fr;
    }
}

.time-option {
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    touch-action: manipulation;
}

body.dark .time-option {
    border: 2px solid var(--border-dark);
    background: #2c3e50;
}

.time-option:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

body.dark .time-option:hover {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.time-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.time-option-value {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.time-option-label {
    font-size: 13px;
    opacity: 0.8;
}

.custom-time-section {
    margin-top: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #eee;
}

body.dark .custom-time-section {
    background: #2c3e50;
    border: 2px solid #555;
}

.custom-time-section h4 {
    margin-bottom: 8px;
    color: var(--timer-normal);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    text-align: center;
}

body.dark .custom-time-section h4 {
    color: var(--timer-normal-dark);
}

.custom-time-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.custom-time-inputs input {
    padding: 8px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    width: 70px;
    text-align: center;
    transition: border-color 0.3s;
    font-family: 'Courier New', monospace;
    background: var(--input-bg-light);
    color: var(--input-text-light);
}

body.dark .custom-time-inputs input {
    border: 2px solid var(--border-dark);
    background: var(--input-bg-dark);
    color: var(--input-text-dark);
}

.custom-time-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.dark .custom-time-inputs input:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.custom-time-inputs span {
    font-weight: 600;
    color: var(--timer-normal);
    font-size: 14px;
}

body.dark .custom-time-inputs span {
    color: var(--timer-normal-dark);
}

.add-time-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.confirm-add-btn,
.cancel-add-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px var(--shadow-light);
    touch-action: manipulation;
}

body.dark .confirm-add-btn,
body.dark .cancel-add-btn {
    box-shadow: 0 4px 6px var(--shadow-dark);
}

.confirm-add-btn:hover,
.cancel-add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px var(--shadow-light);
}

body.dark .confirm-add-btn:hover,
body.dark .cancel-add-btn:hover {
    box-shadow: 0 6px 12px var(--shadow-dark);
}

.confirm-add-btn {
    background: linear-gradient(135deg, var(--success-color) 0%, #219653 100%);
    color: white;
}

.confirm-add-btn:hover {
    background: linear-gradient(135deg, #219653 0%, #1e8449 100%);
}

.cancel-add-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.cancel-add-btn:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7b7d 100%);
}

.setup-panel {
    background: var(--panel-bg-light);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 20px var(--shadow-light);
    backdrop-filter: blur(10px);
}

body.dark .setup-panel {
    background: var(--panel-bg-dark);
    box-shadow: 0 5px 20px var(--shadow-dark);
}

.setup-panel h3 {
    margin-bottom: 15px;
    color: var(--timer-normal);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    text-align: center;
    justify-content: center;
}

body.dark .setup-panel h3 {
    color: var(--timer-normal-dark);
}

.timers-setup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .timers-setup {
        grid-template-columns: repeat(2, 1fr);
    }
}

.timer-setup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 480px) {
    .timer-setup {
        flex-direction: row;
        align-items: center;
    }
}

.timer-setup label {
    font-weight: 600;
    min-width: 70px;
    color: var(--timer-normal);
    font-size: 14px;
}

body.dark .timer-setup label {
    color: var(--timer-normal-dark);
}

.timer-name-input,
.timer-duration-input {
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: var(--input-bg-light);
    color: var(--input-text-light);
    width: 100%;
}

body.dark .timer-name-input,
body.dark .timer-duration-input {
    border: 2px solid var(--border-dark);
    background: var(--input-bg-dark);
    color: var(--input-text-dark);
}

.timer-name-input:focus,
.timer-duration-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.dark .timer-name-input:focus,
body.dark .timer-duration-input:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.timer-name-input {
    flex: 2;
}

.timer-duration-input {
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: var(--input-bg-light);
    color: var(--input-text-light);
}

@media (min-width: 480px) {
    .timer-duration-input {
        width: 70px;
    }
}

body.dark .timer-duration-input {
    border: 2px solid var(--border-dark);
    background: var(--input-bg-dark);
    color: var(--input-text-dark);
}

.timer-duration-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.dark .timer-duration-input:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.apply-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    width: 100%;
    max-width: 300px;
    touch-action: manipulation;
}

.apply-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.sound-settings {
    background: var(--panel-bg-light);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 20px var(--shadow-light);
    margin-top: 15px;
    backdrop-filter: blur(10px);
}

body.dark .sound-settings {
    background: var(--panel-bg-dark);
    box-shadow: 0 5px 20px var(--shadow-dark);
}

.sound-settings h3 {
    margin-bottom: 15px;
    color: var(--timer-normal);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    text-align: center;
    justify-content: center;
}

body.dark .sound-settings h3 {
    color: var(--timer-normal-dark);
}

.sound-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sound-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

body.dark .sound-control {
    background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
    .sound-control {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.sound-control label {
    font-weight: 600;
    color: var(--timer-normal);
    font-size: 14px;
    flex-shrink: 0;
}

body.dark .sound-control label {
    color: var(--timer-normal-dark);
}

.sound-control-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.sound-control input {
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    width: 80px;
    text-align: center;
    transition: border-color 0.3s;
    background: var(--input-bg-light);
    color: var(--input-text-light);
}

body.dark .sound-control input {
    border: 2px solid var(--border-dark);
    background: var(--input-bg-dark);
    color: var(--input-text-dark);
}

.sound-control input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.dark .sound-control input:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.sound-test-btn {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
    touch-action: manipulation;
    white-space: nowrap;
}

.sound-test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
}

.sound-select {
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
    background: var(--input-bg-light);
    color: var(--input-text-light);
    min-width: 160px;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
}

@media (min-width: 480px) {
    .sound-select {
        width: auto;
    }
}

body.dark .sound-select {
    border: 2px solid var(--border-dark);
    background: var(--input-bg-dark);
    color: var(--input-text-dark);
}

.sound-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

body.dark .sound-select:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.log-panel {
    background: var(--panel-bg-light);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 20px var(--shadow-light);
    backdrop-filter: blur(10px);
    margin-bottom: 70px;
}

body.dark .log-panel {
    background: var(--panel-bg-dark);
    box-shadow: 0 5px 20px var(--shadow-dark);
}

.log-panel h3 {
    margin-bottom: 15px;
    color: var(--timer-normal);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    text-align: center;
    justify-content: center;
}

body.dark .log-panel h3 {
    color: var(--timer-normal-dark);
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    color: var(--timer-normal);
}

body.dark .log-content {
    background: #2c3e50;
    color: var(--timer-normal-dark);
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    color: var(--timer-normal);
    animation: fadeIn 0.3s ease-out;
    word-break: break-word;
}

body.dark .log-entry {
    border-bottom: 1px solid #555;
    color: var(--timer-normal-dark);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-entry:last-child {
    border-bottom: none;
}

/* Блок статистики в логе */
.log-stats-block {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(155, 89, 182, 0.1) 100%);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: fadeIn 0.5s ease-out;
}

body.dark .log-stats-block {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(155, 89, 182, 0.15) 100%);
}

.stats-header {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--timer-normal);
    letter-spacing: 0.5px;
}

body.dark .stats-header {
    color: var(--timer-normal-dark);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: var(--timer-normal);
    border-bottom: 1px dashed rgba(52, 152, 219, 0.3);
}

body.dark .stats-row {
    color: var(--timer-normal-dark);
    border-bottom: 1px dashed rgba(52, 152, 219, 0.5);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

body.dark .stats-value {
    background: rgba(52, 152, 219, 0.2);
}

.clear-log-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(149, 165, 166, 0.3);
    width: 100%;
    max-width: 200px;
    touch-action: manipulation;
}

.clear-log-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(149, 165, 166, 0.4);
}

.neutral-side {
    border-top: 5px solid #9b59b6;
    margin-top: 15px;
}

.notification-checkbox {
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-checkbox label {
    font-weight: 500;
    color: var(--timer-normal);
    cursor: pointer;
    font-size: 14px;
}

body.dark .notification-checkbox label {
    color: var(--timer-normal-dark);
}

.notification-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

@media (max-width: 380px) {
    .timer-setup {
        flex-wrap: wrap;
        gap: 8px;
    }

    .timer-setup label {
        min-width: 60px;
        font-size: 13px;
    }

    .timer-duration-input {
        width: 60px;
    }

    .sound-control label {
        font-size: 13px;
    }

    .sound-select {
        min-width: 140px;
        font-size: 14px;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .control-btn {
        flex-direction: row;
    }
}

@media (max-width: 320px) {
    .active-timer-display {
        font-size: 50px;
    }

    .side-name-input {
        font-size: 16px;
    }

    .control-btn {
        font-size: 13px;
        padding: 10px 6px;
    }

    .timer-option {
        padding: 10px;
    }
}

.sound-control-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    margin-bottom: 10px;
}

body.dark .sound-control-row {
    background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
    .sound-control-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.sound-control-label {
    font-weight: 600;
    color: var(--timer-normal);
    font-size: 14px;
    min-width: 200px;
}

body.dark .sound-control-label {
    color: var(--timer-normal-dark);
}

.sound-control-value {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.sound-control-action {
    display: flex;
    align-items: center;
    gap: 10px;
}

input,
select,
button {
    font-size: 16px;
}

* {
    -webkit-overflow-scrolling: touch;
}

.log-content {
    -webkit-overflow-scrolling: touch;
}

.control-btn,
.timer-option,
.time-option,
.start-debate-btn,
.apply-btn,
.clear-log-btn,
.sound-test-btn {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/*  */

#openExternalDisplayBtn {
    /* background: transparent !important; */
    border: none !important;
    padding: 5px !important;
    border-radius: 5px;
}

#openExternalDisplayBtn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

#openExternalDisplayBtn:active {
    background: rgba(255, 255, 255, 0.2) !important;
}

/*  */

/* Кнопки внизу страницы */
.bottom-buttons {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.theme-toggle,
.feedback-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.theme-toggle:hover,
.feedback-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .bottom-buttons {
        bottom: 10px;
        left: 10px;
    }

    .theme-toggle,
    .feedback-toggle {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Делаем обе кнопки одинаковыми */
.theme-toggle,
.feedback-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg) !important;
    /* !important переопределит старые стили */
    border: 2px solid var(--border-color) !important;
    color: var(--text-color) !important;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* При наведении обе становятся оранжевыми */
.theme-toggle:hover,
.feedback-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

/* -------------------------- */
/* КНОПКИ ВНИЗУ СТРАНИЦЫ - В САМОМ НИЗУ СТРАНИЦЫ */
.bottom-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px;
    justify-content: flex-start;
    width: 100%;
    position: relative;
}

/* Общие стили для обеих кнопок */
.theme-toggle,
.feedback-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Эффект при наведении */
.theme-toggle:hover,
.feedback-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Форма обратной связи - ОТКРЫВАЕТСЯ РЯДОМ С КНОПКОЙ */
.feedback-form {
    display: none;
    align-items: center;
    gap: 10px;
    /* background: var(--card-bg); */
    background: #ffffff;
    padding: 35px 16px;
    margin-bottom: 10px;
    border-radius: 30px;
    border: 2px solid #7b7b7b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: absolute;
    left: 0;
    bottom: 70px;
    white-space: nowrap;
    width: 350px;
    z-index: 100;
}

body.dark .feedback-form {
    background: #1a1a1a;
    border: 2px solid #7b7b7b;
}

.feedback-form.show {
    display: flex;
}

/* Поле ввода */
#feedbackInput {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    background: var(--input-bg-light);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    border-radius: 20px;
    transition: all 0.3s;
    flex: 1;
}

body.dark #feedbackInput {
    background: var(--input-bg-dark);
    border-color: var(--border-dark);
}

#feedbackInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

#feedbackInput::placeholder {
    color: #888;
    font-size: 14px;
    opacity: 0.8;
}

/* Счетчик символов */
.char-counter {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
    white-space: nowrap;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Кнопка отправки */
.send-feedback-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-feedback-btn:hover {
    background: var(--primary-color-dark);
    transform: translateY(-2px);
}

/* Статус отправки */
.feedback-status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    z-index: 1001;
    white-space: nowrap;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90vw;
}

.feedback-status.show {
    opacity: 1;
    /* animation: fadeInOut 2s ease-in-out; */
}

.feedback-status.success {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
}

.feedback-status.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .bottom-buttons {
        padding: 15px;
        margin-top: 20px;
    }

    .theme-toggle,
    .feedback-toggle {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .feedback-form {
        position: fixed;
        bottom: 80px;
        left: 10px;
        right: 10px;
        width: auto;
        padding: 35px 15px !important;
        margin-bottom: 10px;
    }

    #feedbackInput {
        width: calc(100% - 90px);
        font-size: 15px;
        padding: 10px 12px;
    }

    .send-feedback-btn {
        order: 2;
        margin-left: 8px;
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .char-counter {
        order: 3;
        margin-left: 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .bottom-buttons {
        padding: 10px;
    }

    .feedback-form {
        bottom: 75px;
        padding: 35px 15px !important;
        margin-bottom: 10px;
    }

    #feedbackInput {
        font-size: 14px;
        padding: 8px 10px;
        width: calc(100% - 80px);
    }

    .send-feedback-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        margin-left: 6px;
    }

    .char-counter {
        font-size: 10px;
        margin-left: 6px;
    }
}

.container h1 {
    text-align: center;
    font-size: 17px;
    opacity: 0.1;
}