@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&display=swap');

/* Основной контейнер */
.timer-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    margin-top: 40px;
}

/* Дисплей таймера */
.timer-display {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* До инициализации JS показываем только сообщение о загрузке, без мигания значений */
.timer-loading-message {
    font-size: 1.25rem;
    color: #666;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.timer-display.timer-initialized .timer-loading-message {
    display: none;
}
.timer-display .time,
.timer-display .round-info {
    opacity: 0;
    pointer-events: none;
}
.timer-display.timer-initialized .time,
.timer-display.timer-initialized .round-info {
    opacity: 1;
    pointer-events: auto;
}

/* Время */
.time {
    font-size: 6rem;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    transition: color 0.3s ease;
}

/* Информация о раунде */
.round-info {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: #666;
    font-weight: 500;
}

/* Индикатор статуса */
.status-indicator {
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
    margin-top: 1rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.status-indicator.fight {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.status-indicator.break {
    background: #ffc107;
    color: #000;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.status-indicator.ended {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.status-indicator.paused {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

/* Панель управления */
.main-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.main-controls button {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 120px;
    justify-content: center;
    cursor: pointer;
}

.main-controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Стили кнопок */
.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Настройки таймера */
.settings-panel {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.settings-panel h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.settings-group {
    margin-bottom: 1.2rem;
}

.settings-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.time-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-input span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
}

.time-input input {
    width: 80px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.number-field {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Кнопки действий настроек */
.settings-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.settings-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.settings-actions .btn-success {
    background: #4caf50;
    color: white;
    border: none;
}

.settings-actions .btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.settings-actions .btn-secondary {
    background: #757575;
    color: white;
    border: none;
}

.settings-actions .btn-secondary:hover {
    background: #616161;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(117, 117, 117, 0.3);
}

/* Анимации для уведомлений */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Дополнительные функции */
.additional-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.volume-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.volume-control label {
    color: #555;
    font-weight: 500;
}

.volume-control input[type="range"] {
    width: 100%;
}

.preset-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Горячие клавиши */
.hotkeys-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.hotkeys-info h4 {
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hotkeys-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hotkeys-info li {
    margin-bottom: 0.5rem;
    color: #666;
}

.hotkeys-info kbd {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
    color: #333;
    display: inline-block;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    white-space: nowrap;
}

/* Полноэкранный режим */
.fullscreen .timer-container {
    max-width: 100%;
    height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fullscreen .time {
    font-size: 12rem;
}

.fullscreen .round-info {
    font-size: 2.5rem;
}

.fullscreen .status-indicator {
    font-size: 1.8rem;
}

/* Адаптивный дизайн */
@media (min-width: 768px) {
    .timer-display {
        padding: 3rem;
    }

    .time {
        font-size: 8rem;
    }

    .timer-controls {
        flex-wrap: nowrap;
    }
}

@media (max-width: 767px) {
    .timer-container {
        margin: 0.5rem;
        padding: 1rem;
    }

    .timer-display {
        padding: 1rem;
    }

    .time {
        font-size: 3.5rem;
    }

    .round-info {
        font-size: 1.1rem;
    }

    .main-controls {
        gap: 0.5rem;
    }

    .main-controls button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-width: 100px;
    }

    .settings-panel {
        padding: 1rem;
    }

    .settings-group {
        margin-bottom: 1rem;
    }

    .time-input input {
        width: 60px;
        font-size: 0.9rem;
    }

    .preset-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .preset-controls button {
        width: 100%;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .time {
        font-size: 2.5rem;
    }

    .main-controls button {
        padding: 0.5rem;
        font-size: 0.8rem;
        min-width: 80px;
    }

    .settings-group label {
        font-size: 0.9rem;
    }
}

/* Улучшения для тач-устройств */
@media (hover: none) {
    .main-controls button {
        padding: 0.8rem 1.2rem;
    }

    .main-controls button:active {
        transform: none;
    }

    input[type="range"] {
        height: 30px;
    }
}

/* Улучшения доступности */
.main-controls button:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

input:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Анимация пульсации для паузы */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.time.warning {
    color: #dc3545;
    animation: pulse 1s infinite;
}

.time.paused {
    color: #6c757d;
    animation: pulse 2s infinite;
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .timer-container {
        background: #2d2d2d;
    }

    .timer-display,
    .settings-panel {
        background: #333;
    }

    .time {
        color: #fff;
    }

    .round-info {
        color: #ccc;
    }

    .settings-panel h3,
    .hotkeys-info h4 {
        color: #fff;
    }

    .settings-group label,
    .hotkeys-info li {
        color: #ccc;
    }

    .time-input input,
    .number-field {
        background: #444;
        border-color: #555;
        color: #fff;
    }

    .hotkeys-info {
        background: #333;
    }

    .hotkeys-info kbd {
        background-color: #444;
        border-color: #555;
        color: #fff;
    }
} 

.scoreboard-mode {
    background: #23242a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    height: auto;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2001;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}
.scoreboard-row-new {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    width: 100vw;
    margin-bottom: 2rem;
    gap: 2rem;
}
.scoreboard-left, .scoreboard-right {
    min-width: 320px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.2rem;
}
.scoreboard-flag img {
    width: 48px;
    height: 36px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.scoreboard-names {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.scoreboard-name {
    font-size: 2.8rem;
    font-family: 'Teko', sans-serif;
    font-weight: 700;
    color: #e6e6e6;
    letter-spacing: 1px;
}
.scoreboard-country-style {
    display: flex;
    flex-direction: row;
    gap: 1.2rem;
}
.scoreboard-country, .scoreboard-style {
    font-size: 1.3rem;
    color: #bdbdbd;
    font-family: 'Teko', sans-serif;
}
.scoreboard-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 320px;
}
.scoreboard-timer-block {
    background: #ffe03a;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 1.2rem 3.5rem 1.2rem 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
    min-height: 220px;
}
.scoreboard-timer {
    font-size: 6rem;
    color: #6b2c1a;
    font-family: 'Teko', sans-serif;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.scoreboard-label {
    font-size: 2.2rem;
    color: #6b2c1a;
    margin-top: 0.5rem;
    font-family: 'Teko', sans-serif;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.scoreboard-points-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}
.scoreboard-points {
    font-size: 5rem;
    font-family: 'Teko', sans-serif;
    font-weight: 700;
    color: #0a7c3a;
    background: #fff;
    border-radius: 16px;
    min-width: 120px;
    text-align: center;
    margin-bottom: 0.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.scoreboard-advantage, .scoreboard-penalty {
    font-size: 1.5rem;
    color: #bdbdbd;
    background: #23242a;
    border-radius: 8px;
    padding: 0.3rem 1.2rem;
    text-align: center;
    font-family: 'Teko', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
}
.scoreboard-advantage span, .scoreboard-penalty span {
    font-size: 1.5rem;
    color: #e6e6e6;
    font-weight: 700;
}
.scoreboard-controls {
    display: flex;
    gap: 18px;
    margin: 18px 0 0 0;
    flex-wrap: wrap;
    justify-content: center;
}
.scoreboard-controls button {
    padding: 18px 24px;
    font-size: 2rem;
    background-color: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Teko', sans-serif;
    font-weight: 600;
    margin-bottom: 8px;
    transition: background 0.2s, color 0.2s;
}
.scoreboard-controls button:hover {
    background-color: #ffe03a;
    color: #23242a;
}
/* .exit-scoreboard-btn — маркер для JS (делегирование клика); визуал только у кнопки в .sc-timer-buttons: .sc-timer-btn-exit */
@media (max-width: 1200px) {
    .scoreboard-row-new {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
    }
    .scoreboard-left, .scoreboard-right, .scoreboard-center {
        min-width: unset;
        max-width: 100vw;
        width: 100vw;
        align-items: center;
    }
    .scoreboard-timer-block {
        min-width: 220px;
        padding: 1rem 1.5rem;
    }
}
@media (max-width: 700px) {
    .scoreboard-timer {
        font-size: 2.5rem;
    }
    .scoreboard-label {
        font-size: 1.1rem;
    }
    .scoreboard-points {
        font-size: 2.5rem;
        min-width: 60px;
    }
    .scoreboard-controls button {
        font-size: 1.1rem;
        padding: 8px 12px;
    }
}

.main-scoreboard-timer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    text-align: center;
    font-size: 10rem;
    font-family: 'Orbitron', 'Teko', 'Arial', sans-serif;
    font-weight: 700;
    color: #22ff55; /* зелёный по умолчанию */
    letter-spacing: 0.18em;
    margin: 0;
    padding: 0.5rem 0 0.2rem 0;
    text-shadow: 0 4px 24px rgba(0,0,0,0.18);
    background: #23242a;
    z-index: 3000;
    border-top: 4px solid #ffe03a;
    box-shadow: 0 -2px 24px rgba(0,0,0,0.18);
    transition: color 0.3s, background 0.3s;
}
.main-scoreboard-timer.yellow {
    background: #ffe066 !important;
    color: #222 !important;
    border-top: 4px solid #ffe066 !important;
}
.main-scoreboard-timer.red {
    color: #ff2a2a;
    background: #23242a;
    /* animation: blink 1s steps(2, start) infinite; */
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.main-scoreboard-timer.blue {
    color: #fff;
    background: #1a2a6c;
    border-top: 4px solid #1a2a6c;
}
.main-scoreboard-timer.finished {
    color: #fff;
    background: #b71c1c;
    border-top: 4px solid #b71c1c;
    animation: none;
}
.main-scoreboard-timer.last-five-seconds {
    background-color: #c82333 !important;
    color: #fff !important;
    border-top: 4px solid #c82333 !important;
    animation: none !important;
    transition: all 0.3s ease;
}

.scoreboard-status {
    width: 100vw;
    text-align: center;
    font-size: 2.5rem;
    font-family: 'Orbitron', 'Teko', 'Arial', sans-serif;
    font-weight: 700;
    margin: 0;
    padding: 0.2rem 0 0.5rem 0;
    color: #fff;
    letter-spacing: 0.12em;
    opacity: 0;
    transition: opacity 0.5s;
    position: fixed;
    left: 0;
    bottom: 8.5rem;
    z-index: 3001;
    pointer-events: none;
}
.scoreboard-status.visible {
    opacity: 1;
}

@media (max-width: 900px) {
    .main-scoreboard-timer { font-size: 4rem; }
}

@keyframes digits-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.digits-blink {
  animation: digits-blink 1s steps(1, end) infinite;
}

.scoreboard-academy {
    font-size: 1.2em;
    color: #666;
    margin: 5px 0;
    font-weight: 500;
}

.scoreboard-names {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 15px;
}

.scoreboard-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.scoreboard-controls button {
    padding: 5px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.scoreboard-controls button:hover {
    background-color: #e0e0e0;
}

.fighter h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

/* --- Smoothcomp scoreboard style --- */
.smoothcomp-scoreboard {
    width: 100vw;
    min-height: 100vh;
    height: auto;
    background: #111;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    font-family: 'Teko', 'Arial', sans-serif;
    overflow-x: hidden;
    overflow-y: visible;
}
.sc-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    width: 100vw;
    height: 30vh;
    flex-shrink: 0;
    padding: 0;
    position: relative;
}

/* Стили для левой части (счет слева) */
.sc-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    max-width: 250px;
    padding: 15px 30px;
    gap: 15px;
    flex: 0 0 auto;
    order: 1;
}

/* Центральная часть (фото и имя справа от счета) */
/* Колонка «ЧЕЛЛЕНДЖ» между именем и панелью +1…+5 (справа) */
.sc-challenge-column {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(94vw, 1120px);
    padding: 0 10px 0 12px;
    order: 3;
    box-sizing: border-box;
}

.sc-challenge-column.sc-challenge-column--visible {
    display: flex;
    gap: 12px;
}

.sc-center {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 30px;
    gap: 25px;
    flex: 1;
    order: 2;
    overflow: visible; /* Изменено с hidden на visible, чтобы текст не обрезался */
    min-width: 0; /* Позволяет flex-элементу сжиматься при необходимости */
}

.sc-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-width: 400px;
    padding: 15px 30px;
    gap: 15px;
    flex: 0 0 auto;
    order: 4;
    overflow: visible; /* Изменено с hidden на visible, чтобы не обрезать контент */
}

/* Блок с фото и именем (фон строки — градиент на всей .sc-row-top / .sc-row-bottom) */
.sc-photo-name-block {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 25px;
    flex: 1;
    padding-top: 10px;
    min-width: 0; /* Позволяет сжиматься */
    overflow: visible; /* Показывать весь контент */
    position: relative;
    z-index: 55; /* выше плашки пассива (50), если края всё же сходятся */
}

.sc-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffe03a;
    box-shadow: 0 6px 20px rgba(255, 224, 58, 0.4);
    flex-shrink: 0;
}

.sc-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe03a, #ff9800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #23242a;
    border: 4px solid #ffe03a;
    box-shadow: 0 6px 20px rgba(255, 224, 58, 0.4);
    flex-shrink: 0;
}

.sc-name-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    margin-top: -5px;
    min-width: 0; /* Позволяет сжиматься */
    overflow: visible; /* Показывать весь контент, включая бейдж */
}

/* Вся полоса бойца: счёт + фото/имена + кнопки — один красно-чёрный / сине-чёрный градиент (как base_generic) */
.sc-row-top {
    background: linear-gradient(135deg, #000000 0%, #1a0000 32%, #5a0c0c 68%, #901010 100%);
    border-bottom: 4px solid rgba(90, 30, 30, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.sc-row-bottom {
    background: linear-gradient(135deg, #000000 0%, #040a14 32%, #0a2440 65%, #143a68 100%);
    border-bottom: 4px solid rgba(25, 55, 95, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.sc-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    line-height: 1.2;
}
.sc-academy, .sc-club {
    font-size: 1.6rem;
    color: #ffe03a;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 5px;
    text-shadow: 0 0 8px rgba(255, 224, 58, 0.5);
}
.sc-score-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 220px;
    padding: 0 40px 0 0;
}
.sc-label {
    font-size: 1.1rem;
    color: #aaa;
    font-weight: 500;
    margin-top: 0.2rem;
    margin-bottom: 0.1rem;
    letter-spacing: 1px;
}
.sc-value {
    font-size: 2.1rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.sc-points {
    font-size: 6rem;
    font-weight: 900;
    color: #ffe03a;
    min-width: 150px;
    padding: 20px;
    line-height: 1;
    text-align: center;
    border: 5px solid #ffe03a;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 224, 58, 0.5);
}

.sc-penalties {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ff4444;
    text-align: center;
    padding: 8px 15px;
    background: rgba(255, 68, 68, 0.1);
    border: 2px solid #ff4444;
    border-radius: 8px;
    min-width: 120px;
}

.sc-penalties span {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ff6666;
}
.sc-bottom-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100vw;
    min-height: 40vh;
    height: auto;
    flex-shrink: 0;
    background: #111;
    border-top: 4px solid #333;
    padding: 16px 40px 20px;
    margin: 0;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}
.sc-timer {
    font-size: 10rem;
    color: #00ff00;
    font-family: 'Teko', 'Arial', sans-serif;
    font-weight: 900;
    letter-spacing: 10px;
    margin: 0;
    padding: 0;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8), 0 0 40px rgba(0, 255, 0, 0.5), 0 4px 8px rgba(0,0,0,0.5);
    line-height: 1;
    display: block;
    white-space: nowrap;
}
.sc-match-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
    margin: 0;
    margin-left: 30px;
    letter-spacing: 2px;
    flex: 1;
    min-width: 250px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
/* При случайном выделении мышью — не системный голубой, а цвет табло */
.scoreboard-mode .sc-match-info ::selection {
    background: rgba(255, 214, 58, 0.35);
    color: #fff;
}
.scoreboard-mode .sc-match-info ::-moz-selection {
    background: rgba(255, 214, 58, 0.35);
    color: #fff;
}
.sc-stage {
    color: #ffe03a;
    font-weight: 700;
    font-size: 2.1rem;
    margin-right: 20px;
}
.sc-category {
    color: #ffe03a;
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(255, 224, 58, 0.5);
    line-height: 1.2;
}
@media (max-width: 1200px) {
    .sc-row {
        height: 25vh;
    }
    .sc-bottom-row {
        min-height: 50vh;
        height: auto;
        flex-direction: column;
        align-items: center;
        padding: 15px;
    }
    .sc-score-block {
        min-width: unset;
        padding: 0 20px;
    }
    .sc-timer {
        font-size: 6rem;
        letter-spacing: 6px;
    }
    .sc-match-info {
        font-size: 1.5rem;
        margin-left: 10px;
        margin-top: 15px;
    }
    .sc-category {
        font-size: 1.3rem;
    }
    .sc-weight-class {
        font-size: 1.2rem;
        margin-top: 0.35rem;
    }
    .sc-mat {
        font-size: 1.1rem;
    }
    .sc-timer-controls {
        min-width: auto;
    }
}
@media (max-width: 700px) {
    .sc-activity-plaque,
    .sc-challenge-plaque,
    .sc-medical-plaque {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        margin-top: 0;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        transform: none;
    }
    .sc-challenge-column {
        max-width: none;
        width: 100%;
        padding: 8px 12px;
    }
    .sc-row {
        height: 20vh;
        flex-direction: column;
    }
    .sc-bottom-row {
        min-height: 60vh;
        height: auto;
    }
    .sc-left {
        min-width: auto;
        max-width: none;
    }
    .sc-center {
        justify-content: center;
    }
    .sc-photo, .sc-photo-placeholder {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    .sc-name {
        font-size: 1.5rem;
    }
    .sc-academy, .sc-club {
        font-size: 1.2rem;
    }
    .sc-points {
        font-size: 3rem;
        min-width: 100px;
        padding: 15px;
    }
    .sc-penalties {
        font-size: 1.1rem;
        padding: 6px 12px;
    }
    .sc-timer {
        font-size: 4rem;
        letter-spacing: 4px;
    }
    .sc-match-info {
        font-size: 1.2rem;
    }
    .sc-category {
        font-size: 1.2rem;
    }
    .sc-weight-class {
        font-size: 1.05rem;
    }
    .sc-mat {
        font-size: 1rem;
    }
    .sc-right {
        min-width: auto;
        padding: 10px 15px;
    }
}

/* --- Красивая панель кнопок начисления баллов и штрафов --- */
.sc-btn-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    border-radius: 16px;
    box-shadow: none;
    padding: 12px 18px;
    margin: 0;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.sc-btn-panel button {
    font-size: 1.5rem;
    font-family: 'Teko', sans-serif;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    outline: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    margin: 0 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.sc-btn-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

.sc-btn-row button {
    width: 100%;
    min-width: 0;
    margin: 0;
}

/* Кнопка челленджа — отдельный ряд под −1…−5, по центру */
.sc-btn-row .sc-btn-challenge {
    grid-column: 2 / span 2;
    justify-self: stretch;
}

/* Ряд: челлендж + медикал + пассив/активность (три колонки) */
.sc-btn-row-signals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sc-btn-row-signals .sc-btn-challenge,
.sc-btn-row-signals .sc-btn-medical,
.sc-btn-row-signals .sc-btn-activity {
    grid-column: auto;
    justify-self: stretch;
}
.sc-btn-panel button.sc-btn-pos {
    background: rgba(0, 0, 0, 0.45);
    color: #ffe03a;
    border: 2px solid #ffe03a;
}

.sc-btn-panel button.sc-btn-pos:hover {
    box-shadow: 0 4px 16px rgba(255, 224, 58, 0.35);
}

/* Минусы: у красного угла — красная обводка, у синего — синяя */
.sc-btn-panel button.sc-btn-neg {
    background: rgba(0, 0, 0, 0.45);
}

.sc-row-top .sc-btn-panel button.sc-btn-neg {
    color: #ff8a8a;
    border: 2px solid #ff3a3a;
}

.sc-row-top .sc-btn-panel button.sc-btn-neg:hover {
    box-shadow: 0 4px 16px rgba(255, 58, 58, 0.35);
}

.sc-row-bottom .sc-btn-panel button.sc-btn-neg {
    color: #93c5fd;
    border: 2px solid #3b82f6;
}

.sc-row-bottom .sc-btn-panel button.sc-btn-neg:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.sc-btn-panel button.sc-btn-challenge {
    font-size: 1.25rem;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.sc-row-top .sc-btn-panel button.sc-btn-challenge {
    background: rgba(255, 58, 58, 0.18);
    color: #ff3a3a;
    border: 2px solid #ff3a3a;
}

.sc-row-top .sc-btn-panel button.sc-btn-challenge:hover {
    box-shadow: 0 4px 16px rgba(255, 58, 58, 0.35);
}

.sc-row-bottom .sc-btn-panel button.sc-btn-challenge {
    background: rgba(59, 130, 246, 0.22);
    color: #93c5fd;
    border: 2px solid #3b82f6;
}

.sc-row-bottom .sc-btn-panel button.sc-btn-challenge:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.sc-btn-panel button.sc-btn-medical {
    font-size: 1.25rem;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.sc-row-top .sc-btn-panel button.sc-btn-medical {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 2px solid #22c55e;
}

.sc-row-top .sc-btn-panel button.sc-btn-medical:hover {
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.sc-row-bottom .sc-btn-panel button.sc-btn-medical {
    background: rgba(16, 185, 129, 0.22);
    color: #6ee7b7;
    border: 2px solid #10b981;
}

.sc-row-bottom .sc-btn-panel button.sc-btn-medical:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.sc-btn-panel button.sc-btn-activity {
    font-size: 1.25rem;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.sc-row-top .sc-btn-panel button.sc-btn-activity {
    background: rgba(251, 191, 36, 0.22);
    color: #fcd34d;
    border: 2px solid #f59e0b;
}

.sc-row-top .sc-btn-panel button.sc-btn-activity:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.sc-row-bottom .sc-btn-panel button.sc-btn-activity {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 2px solid #d97706;
}

.sc-row-bottom .sc-btn-panel button.sc-btn-activity:hover {
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.45);
}

.sc-btn-panel button:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(255,224,58,0.18);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.sc-btn-panel button:active {
    transform: scale(0.95);
}

/* Плашка челленджа — та же полоса и габариты, что у пассива; «стекло», слово мигает */
.sc-challenge-plaque {
    position: absolute;
    z-index: 50;
    left: clamp(468px, 44vw, 860px);
    right: clamp(386px, 26.5vw, 528px);
    top: 50%;
    margin-top: -4.25rem;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    transform: translate(0, -24px);
    color: #fff;
    border-radius: 20px;
    padding: 48px 22px;
    min-height: 8.5rem;
    min-width: 0;
    justify-content: center;
    font-family: 'Teko', 'Arial', sans-serif;
    font-weight: 800;
    font-size: clamp(1.35rem, 2.8vw, 2.15rem);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    text-transform: uppercase;
    overflow: visible;
    /* «Стекло»: полупрозрачный градиент + размытие фона */
    background: linear-gradient(
        145deg,
        rgba(220, 53, 69, 0.42) 0%,
        rgba(120, 20, 35, 0.55) 100%
    );
    border: 2px solid rgba(255, 255, 255, 0.38);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sc-challenge-plaque__icon {
    font-size: 1.35em;
    opacity: 0.95;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.sc-challenge-plaque__text {
    animation: challenge-label-pulse 1.15s ease-in-out infinite;
}

@keyframes challenge-label-pulse {
    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 14px rgba(255, 255, 255, 0.55), 0 0 28px rgba(255, 120, 120, 0.45);
    }
    50% {
        opacity: 0.55;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.35), 0 0 18px rgba(255, 80, 80, 0.35);
    }
}

#scChallengePlaqueBlue.sc-challenge-plaque {
    background: linear-gradient(
        145deg,
        rgba(59, 130, 246, 0.42) 0%,
        rgba(25, 60, 140, 0.55) 100%
    );
    border: 2px solid rgba(186, 220, 255, 0.45);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#scChallengePlaqueBlue.sc-challenge-plaque .sc-challenge-plaque__text {
    animation-name: challenge-label-pulse-blue;
}

@keyframes challenge-label-pulse-blue {
    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 14px rgba(255, 255, 255, 0.55), 0 0 28px rgba(120, 180, 255, 0.5);
    }
    50% {
        opacity: 0.55;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.35), 0 0 18px rgba(80, 140, 255, 0.35);
    }
}

.sc-challenge-plaque.sc-challenge-plaque--active {
    opacity: 1;
    pointer-events: none;
    animation: sc-activity-plop-in 0.55s ease-out forwards;
}

@keyframes sc-activity-plop-in {
    0% {
        opacity: 0;
        transform: translate(0, -24px) scale(0.88);
    }
    100% {
        opacity: 1;
        transform: translate(0, -24px) scale(1);
    }
}

/* Совместимость: старый класс .show больше не обязателен */
.sc-challenge-plaque.show {
    opacity: 1;
}

/* Плашка медикала — зелёная гамма, те же габариты что у пассива/челленджа */
.sc-medical-plaque {
    position: absolute;
    z-index: 50;
    left: clamp(468px, 44vw, 860px);
    right: clamp(386px, 26.5vw, 528px);
    top: 50%;
    margin-top: -4.25rem;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    transform: translate(0, -24px);
    color: #fff;
    border-radius: 20px;
    padding: 48px 22px;
    min-height: 8.5rem;
    min-width: 0;
    justify-content: center;
    font-family: 'Teko', 'Arial', sans-serif;
    font-weight: 800;
    font-size: clamp(1.35rem, 2.8vw, 2.15rem);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    text-transform: uppercase;
    overflow: visible;
    background: linear-gradient(
        145deg,
        rgba(22, 163, 74, 0.48) 0%,
        rgba(6, 78, 59, 0.58) 100%
    );
    border: 2px solid rgba(187, 247, 208, 0.45);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sc-medical-plaque__icon {
    font-size: 1.35em;
    opacity: 0.95;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.sc-medical-plaque__text {
    animation: medical-label-pulse 1.15s ease-in-out infinite;
}

@keyframes medical-label-pulse {
    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 14px rgba(255, 255, 255, 0.55), 0 0 28px rgba(134, 239, 172, 0.5);
    }
    50% {
        opacity: 0.55;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.35), 0 0 18px rgba(74, 222, 128, 0.35);
    }
}

#scMedicalPlaqueBlue.sc-medical-plaque {
    background: linear-gradient(
        145deg,
        rgba(13, 148, 136, 0.48) 0%,
        rgba(15, 118, 110, 0.58) 100%
    );
    border: 2px solid rgba(153, 246, 228, 0.5);
}

#scMedicalPlaqueBlue.sc-medical-plaque .sc-medical-plaque__text {
    animation-name: medical-label-pulse-blue;
}

@keyframes medical-label-pulse-blue {
    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 14px rgba(255, 255, 255, 0.55), 0 0 28px rgba(110, 231, 183, 0.55);
    }
    50% {
        opacity: 0.55;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.35), 0 0 18px rgba(45, 212, 191, 0.4);
    }
}

.sc-medical-plaque.sc-medical-plaque--active {
    opacity: 1;
    pointer-events: none;
    animation: sc-activity-plop-in 0.55s ease-out forwards;
}

/* Плашка пассива — та же полоса left/right, что у челленджа и медикала (имя не перекрываем).
   Зафиксировано: общие отступы/полоса, padding, min-height, скругление — не менять без явной задачи. */
.sc-activity-plaque {
    position: absolute;
    z-index: 50;
    /* левый край — после блока фото+имя; правый — запас под .sc-right */
    left: clamp(468px, 44vw, 860px);
    right: clamp(386px, 26.5vw, 528px);
    top: 50%;
    margin-top: -4.25rem;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    transform: translate(0, -24px);
    color: #fff;
    border-radius: 20px;
    padding: 48px 22px;
    min-height: 8.5rem;
    min-width: 0;
    font-family: 'Teko', 'Arial', sans-serif;
    font-weight: 800;
    font-size: clamp(1.35rem, 2.8vw, 2.15rem);
    letter-spacing: 0.1em;
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    align-items: center;
    row-gap: 0.35rem;
    opacity: 0;
    pointer-events: none;
    text-transform: uppercase;
    overflow: visible;
    background: linear-gradient(
        145deg,
        rgba(245, 158, 11, 0.48) 0%,
        rgba(146, 64, 14, 0.58) 100%
    );
    border: 2px solid rgba(253, 230, 138, 0.48);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 820px) and (min-width: 701px) {
    .sc-activity-plaque,
    .sc-challenge-plaque,
    .sc-medical-plaque {
        left: clamp(348px, 39vw, 450px);
    }
}

.sc-activity-plaque__time {
    grid-row: 1;
    align-self: center;
    font-size: clamp(2.7rem, 7vw, 4.35rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.06em;
    color: #fff;
    text-align: center;
    text-shadow:
        0 0 12px rgba(251, 191, 36, 0.85),
        0 2px 8px rgba(0, 0, 0, 0.45);
    font-variant-numeric: tabular-nums;
    text-transform: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.sc-activity-plaque__text {
    grid-row: 2;
    align-self: end;
    width: 100%;
    text-align: center;
    font-size: clamp(0.8rem, 1.32vw, 1.12rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    animation: challenge-label-pulse 1.15s ease-in-out infinite;
    line-height: 1.1;
    text-transform: uppercase;
}

#scActivityPlaqueBlue.sc-activity-plaque {
    background: linear-gradient(
        145deg,
        rgba(251, 191, 36, 0.42) 0%,
        rgba(120, 53, 15, 0.55) 100%
    );
    border: 2px solid rgba(254, 243, 199, 0.5);
}

#scActivityPlaqueBlue.sc-activity-plaque .sc-activity-plaque__text {
    animation-name: challenge-label-pulse-blue;
}

.sc-activity-plaque.sc-activity-plaque--active {
    opacity: 1;
    pointer-events: none;
    animation: sc-activity-plop-in 0.55s ease-out forwards;
}

.sc-btn-panel button {
    animation: none;
    transition: all 0.2s ease;
}

.sc-btn-panel button.sc-btn-score:active,
.sc-btn-panel button.sc-btn-penalty:active {
    animation: button-press 0.2s ease;
}

@keyframes button-press {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* На тач-устройствах (мобильная версия) — без сужения при тапе */
@media (hover: none) {
    .sc-btn-panel button:active {
        transform: none;
    }
    .sc-btn-panel button.sc-btn-score:active,
    .sc-btn-panel button.sc-btn-penalty:active {
        animation: none;
        transform: none;
    }
}

/* Стили для кнопок управления таймером в scoreboard */
.sc-timer-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
    min-width: 300px;
}

/* Вариант 1: кнопки под таймером скрыты по умолчанию, показываются по клику на таймер */
.scoreboard-mode .sc-timer-buttons {
    display: none;
}
.scoreboard-mode.sc-controls-visible .sc-timer-buttons {
    display: flex;
}
.scoreboard-mode .sc-timer {
    cursor: pointer;
    user-select: none;
}

/* Сетка 3×N: одинаковая ширина в колонке; «Выйти» — отдельная строка по центру */
.sc-timer-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch;
}

.sc-timer-btn {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 2.85rem;
    background: rgba(255, 224, 58, 0.2);
    border: 2px solid #ffe03a;
    color: #ffe03a;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Teko', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    line-height: 1.2;
}

.sc-timer-btn:hover {
    background: #ffe03a;
    color: #23242a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 224, 58, 0.4);
}

.sc-timer-btn:active {
    transform: translateY(0);
}

.sc-timer-buttons .sc-timer-btn > i {
    font-size: 1.4rem;
    line-height: 1;
    vertical-align: middle;
}

.sc-timer-readonly-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    padding: 8px 12px;
    pointer-events: none;
    font-family: 'Teko', sans-serif;
}

/* Седьмая кнопка — в средней колонке, та же ширина ячейки, что и у кнопки над ней */
.sc-timer-btn.sc-timer-btn-exit {
    grid-column: 2;
    width: 100%;
}

@media (max-width: 380px) {
    .sc-timer-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
    }
    .sc-timer-btn.sc-timer-btn-exit {
        grid-column: 1 / -1;
        width: min(12rem, calc(50% - 6px));
        justify-self: center;
    }
}

@media (max-width: 900px) {
    .sc-btn-panel {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 8px;
    }
    .sc-btn-panel button {
        font-size: 1.1rem;
        padding: 7px 10px;
    }
    .sc-btn-row {
        gap: 6px;
    }
}

.sc-timer.green { color: #22ff55; background: none; }
.sc-timer.blue { color: #3a9cff; background: none; }
.sc-timer.yellow { color: #ffd700; background: none; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.sc-timer.red { color: #ff3a3a; background: none; }
.sc-timer.gray { color: #bdbdbd; background: none; }
/* Этап сетки (финал, полуфинал, утешилка…) над раундами таймера */
.sc-bracket-stage {
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    color: #ffffff;
    font-family: 'Teko', 'Orbitron', 'Arial', sans-serif;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.12;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    animation: none;
}
.sc-bracket-stage:empty {
    display: none;
}
.sc-round-info {
    font-size: clamp(1.9rem, 3.2vw, 2.35rem);
    color: #ffffff;
    font-family: 'Teko', 'Orbitron', 'Arial', sans-serif;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.12;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    animation: none;
}

.sc-round-info .sc-round-num {
    display: inline-block;
    font-size: 1.26em;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1;
    margin-left: 0.1em;
    color: #ffd700;
    text-shadow: 0 0 26px rgba(255, 228, 92, 0.8), 0 0 60px rgba(255, 228, 92, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45);
    animation: scGoldFlicker 3.4s ease-in-out infinite;
}
@media (max-width: 900px) {
    .sc-round-info { font-size: 1.1rem; }
}

/* Вес / возраст / пол — в одной визуальной линии с этапом и раундом, без «подсветки выделения» */
.sc-weight-class {
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
    color: #ffffff;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.04em;
    font-family: 'Teko', 'Arial', sans-serif;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    animation: none;
    user-select: none;
    -webkit-user-select: none;
}
.sc-weight-class:empty {
    display: none;
}
/* Ковёр — тот же золотистый акцент, что у этапа; номер крупнее и белым */
.sc-mat {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35em;
    font-size: clamp(1.05rem, 2.1vw, 1.5rem);
    margin: 0;
    line-height: 1.12;
    font-family: 'Teko', 'Orbitron', 'Arial', sans-serif;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    animation: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Единая ровная колонка инфо справа от таймера */
.sc-match-info {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.3rem;
    letter-spacing: 0.06em;
}

.sc-category {
    color: #ffffff;
    margin: 0;
    line-height: 1.12;
    font-size: clamp(1.35rem, 2.5vw, 1.95rem);
    font-family: 'Teko', 'Orbitron', 'Arial', sans-serif;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    animation: none;
}

@keyframes scGoldFlicker {
    0%, 100% {
        filter: brightness(0.98);
        opacity: 0.98;
    }
    25% {
        filter: brightness(1.04);
        opacity: 1;
    }
    52% {
        filter: brightness(0.95);
        opacity: 0.96;
    }
    78% {
        filter: brightness(1.03);
        opacity: 1;
    }
}

/* Числа в инфо-блоке выглядят не меньше букв и не "плавают" */
.sc-bracket-stage,
.sc-round-info,
.sc-weight-class,
.sc-category,
.sc-mat,
.sc-mat .sc-mat-value {
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
}
.sc-mat .sc-mat-value {
    font-size: 1.34em;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #ffd700;
    text-shadow: 0 0 26px rgba(255, 228, 92, 0.8), 0 0 60px rgba(255, 228, 92, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45);
    animation: scGoldFlicker 3.4s ease-in-out infinite;
}

.sc-mat .sc-mat-total {
    font-size: 1.1em;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 0.04em;
    text-shadow: 0 0 24px rgba(255, 228, 92, 0.75), 0 0 54px rgba(255, 228, 92, 0.5), 0 2px 8px rgba(0, 0, 0, 0.45);
    animation: scGoldFlicker 3.4s ease-in-out infinite;
}

.sc-mat .sc-mat-sep {
    display: inline-block;
    margin: 0 0.12em;
    font-size: 1.16em;
    font-weight: 800;
    color: #fff0ad;
}

/* Модалка выбора победителя в Scoreboard режиме */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    margin: 10% auto;
    padding: 2rem;
    border: 2px solid #ffe03a;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(255, 224, 58, 0.3);
    color: #fff;
}

.modal-content h3 {
    color: #ffe03a;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.winner-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.winner-buttons button {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.winner-buttons button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.next-match-info {
    background: rgba(255, 224, 58, 0.1);
    border: 1px solid #ffe03a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.next-match-info h4 {
    color: #ffe03a;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

#nextMatchDetails {
    color: #fff;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.modal-actions button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-light {
    background: #6c757d;
    color: #fff;
}

.btn-light:hover {
    background: #5a6268;
}

.btn-info {
    background: #17a2b8;
    color: #fff;
}

.btn-info:hover {
    background: #138496;
}

.btn-warning {
    background: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Старый отступ ломал сетку кнопок таймера */
.sc-timer-buttons .sc-end-match-btn {
    margin-top: 0;
}
.sc-end-match-btn {
    margin-top: 10px;
}

/* Модальное окно "Матч завершен" */
.match-finished-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.match-finished-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.match-finished-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 2px solid rgba(255, 224, 58, 0.5);
    border-radius: 20px;
    padding: 40px 35px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(255, 224, 58, 0.3),
                0 0 40px rgba(255, 224, 58, 0.1);
    text-align: center;
    animation: slideUp 0.4s ease;
    z-index: 10001;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.match-finished-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
    animation: scaleIn 0.5s ease 0.2s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.match-finished-icon i {
    font-size: 2.5rem;
    color: #fff;
}

.match-finished-title {
    color: #ffe03a;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(255, 224, 58, 0.5);
}

.match-finished-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 224, 58, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.match-finished-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0 0 15px 0;
}

.next-match-players {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-name {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 10px 20px;
    background: rgba(255, 224, 58, 0.15);
    border: 1px solid rgba(255, 224, 58, 0.3);
    border-radius: 8px;
    min-width: 200px;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.vs-text {
    color: #ffe03a;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 5px 0;
    text-shadow: 0 2px 8px rgba(255, 224, 58, 0.5);
}

.match-finished-question {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin: 0 0 30px 0;
    font-weight: 500;
}

.match-finished-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.match-finished-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-finished-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.match-finished-btn:active {
    transform: translateY(0);
}

.match-finished-btn-cancel {
    background: rgba(108, 117, 125, 0.3);
    color: #fff;
    border: 1px solid rgba(108, 117, 125, 0.5);
}

.match-finished-btn-cancel:hover {
    background: rgba(108, 117, 125, 0.5);
    border-color: rgba(108, 117, 125, 0.7);
}

.match-finished-btn-ok {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.match-finished-btn-ok:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.5);
}

/* ============================================
   СТИЛИ ДЛЯ ОТОБРАЖЕНИЯ ПОБЕДИТЕЛЯ (ВАРИАНТ 4)
   ============================================ */

/* Бейдж "ПОБЕДИТЕЛЬ" над именем */
.sc-winner-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    color: #1a1a1a;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.4);
    margin-bottom: 10px;
    animation: winnerBadgeAppear 0.5s ease-out, winnerBadgePulse 2s ease-in-out 0.5s infinite;
    position: relative;
    z-index: 10;
    white-space: nowrap; /* Не переносить текст */
    overflow: visible; /* Показывать весь текст */
    min-width: fit-content; /* Минимальная ширина по содержимому */
    flex-shrink: 0; /* Не сжимать */
}

.sc-winner-badge i {
    font-size: 1.6rem;
    color: #1a1a1a;
    animation: trophyRotate 2s ease-in-out infinite;
}

@keyframes winnerBadgeAppear {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes winnerBadgePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 215, 0, 0.8), 0 0 35px rgba(255, 215, 0, 0.6);
    }
}

@keyframes trophyRotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

/* Золотая рамка вокруг секции победителя */
.sc-row.winner {
    position: relative;
    border: 4px solid #ffd700 !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.1);
    animation: winnerRowPulse 3s ease-in-out;
}

.sc-row.winner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 237, 78, 0.2), rgba(255, 215, 0, 0.3));
    border-radius: 4px;
    z-index: -1;
    animation: winnerGlow 3s ease-in-out infinite;
}

@keyframes winnerRowPulse {
    0% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.7), inset 0 0 40px rgba(255, 215, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.1);
    }
}

@keyframes winnerGlow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* Toast уведомление о победителе */
.winner-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
}

.winner-toast-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px 40px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
    border: 3px solid #ffd700;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.4);
    backdrop-filter: blur(10px);
    animation: toastAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), toastPulse 2s ease-in-out 0.6s infinite;
    min-width: 400px;
    max-width: 600px;
}

.winner-toast-icon {
    font-size: 3.5rem;
    color: #ffd700;
    animation: trophyBounce 1.5s ease-in-out infinite;
}

.winner-toast-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.winner-toast-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.winner-toast-name {
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

.winner-toast-score {
    font-size: 1.4rem;
    color: #ffe03a;
    font-weight: 500;
}

@keyframes toastAppear {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastPulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 80px rgba(255, 215, 0, 0.6);
    }
}

@keyframes trophyBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-10px) rotate(5deg);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .winner-toast-content {
        min-width: 90%;
        padding: 20px 25px;
        gap: 15px;
    }
    
    .winner-toast-icon {
        font-size: 2.5rem;
    }
    
    .winner-toast-title {
        font-size: 1.4rem;
    }
    
    .winner-toast-name {
        font-size: 1.6rem;
    }
    
    .winner-toast-score {
        font-size: 1.2rem;
    }
    
    .sc-winner-badge {
        font-size: 1.1rem;
        padding: 6px 15px;
    }
}

