/**
 * Canvas Match Player Styles
 * FA13 Production
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden; /* Предотвращаем горизонтальную прокрутку */
}

#match-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Header */
#match-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
}

#match-teams {
    font-size: 24px;
    font-weight: bold;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
}

#match-score {
    font-size: 32px;
    font-weight: bold;
    color: #4CAF50;
}

/* Canvas wrapper */
#canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px;
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
    /* Соотношение сторон 3:2 (1200:800) */
    aspect-ratio: 3 / 2;
}

#match-field,
#match-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    /* Обеспечиваем плавное масштабирование */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

#match-canvas:hover {
    opacity: 0.95;
}

/* Controls */
#match-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 20px;
}

#debug-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    background-color: #20252b;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.debug-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.debug-toolbar-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #9fb3c8;
    font-size: 13px;
}

.debug-control-btn {
    padding: 8px 12px;
    font-size: 13px;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.debug-control-btn:hover:not(:disabled),
.debug-control-btn.active {
    border-color: rgba(87, 210, 155, 0.65);
    background: rgba(87, 210, 155, 0.12);
}

.debug-control-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.control-btn {
    padding: 10px 20px;
    font-size: 18px;
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;
}

.control-btn:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
}

.control-btn:disabled {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
}

#speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

#speed-slider {
    width: 150px;
}

#time-display {
    font-size: 24px;
    font-weight: bold;
    min-width: 100px;
    text-align: center;
    padding: 5px 15px;
    background-color: #333;
    border-radius: 5px;
}

/* Timeline */
#match-timeline {
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 20px;
}

#timeline-track {
    position: relative;
    height: 10px;
    background-color: #444;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 25px; /* Увеличено для меток времени */
}

#timeline-progress {
    position: absolute;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 5px;
    width: 0%;
    -webkit-transition: width 0.1s linear;
    -moz-transition: width 0.1s linear;
    -o-transition: width 0.1s linear;
    transition: width 0.1s linear;
}

#timeline-handle {
    position: absolute;
    top: -5px;
    left: 0%;
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border: 2px solid white;
    border-radius: 50%;
    cursor: grab;
    -webkit-transform: translateX(-50%);
    -moz-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    -o-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 20; /* Поверх меток */
}

#timeline-handle:active {
    cursor: grabbing;
}

#timeline-events-toggle {
    margin-top: 10px;
    text-align: left;
}

#btn-toggle-events {
    padding: 8px 16px;
    font-size: 14px;
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;
}

#btn-toggle-events:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
}

#timeline-events {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

.debug-tab {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: #20252b;
    border-radius: 8px;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.debug-title {
    font-size: 20px;
    font-weight: bold;
}

.debug-subtitle {
    color: #9fb3c8;
}

.debug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.debug-controls-panel {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.debug-card {
    background: #11161c;
    border: 1px solid #2f3c4a;
    border-radius: 8px;
    padding: 14px;
}

.debug-card-wide {
    grid-column: span 2;
}

.debug-card h3 {
    margin-bottom: 10px;
    font-size: 15px;
    color: #d7e4f2;
}

.debug-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #9fb3c8;
}

.debug-row strong {
    color: #ffffff;
    text-align: right;
}

.debug-trace-item {
    border-top: 1px solid rgba(159, 179, 200, 0.15);
    padding-top: 8px;
}

.debug-trace-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.debug-trace-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.debug-trace-head span,
.debug-trace-body {
    color: #9fb3c8;
    font-size: 13px;
}

.debug-empty {
    color: #9fb3c8;
}

.timeline-event {
    padding: 5px 10px;
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.timeline-event:hover {
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.1);
}

.timeline-event.active {
    border: 2px solid #fff;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Убраны все цветные фоны - теперь все кнопки имеют прозрачный фон */
.timeline-event.goal,
.timeline-event.yellow-card,
.timeline-event.red-card,
.timeline-event.foul,
.timeline-event.whistle,
.timeline-event.event,
.timeline-event.danger,
.timeline-event.shot,
.timeline-event.offside,
.timeline-event.injury,
.timeline-event.substitution,
.timeline-event.corner,
.timeline-event.penalty,
.timeline-event.free-kick,
.timeline-event.halftime,
.timeline-event.end {
    background-color: transparent;
}

.event-icon {
    font-size: 14px;
}

.event-label {
    font-weight: bold;
}

.event-minute {
    opacity: 0.8;
    font-size: 11px;
}

/* Timeline markers on progress bar */
.timeline-marker {
    position: absolute;
    top: -3px;
    width: 6px;
    height: 16px;
    border-radius: 2px;
    -webkit-transform: translateX(-50%);
    -moz-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    -o-transform: translateX(-50%);
    transform: translateX(-50%);
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    z-index: 10;
}

.timeline-marker:hover {
    -webkit-transform: translateX(-50%) scale(1.3);
    -moz-transform: translateX(-50%) scale(1.3);
    -ms-transform: translateX(-50%) scale(1.3);
    -o-transform: translateX(-50%) scale(1.3);
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Time markers (ticks) on timeline */
.timeline-tick {
    position: absolute;
    bottom: -6px;
    width: 1px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    z-index: 5;
}

.timeline-tick.major {
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    bottom: -10px;
}

.timeline-tick-label {
    position: absolute;
    top: 14px;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    pointer-events: none;
}

/* Info Panel */
#match-info {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

#info-toggle {
    text-align: left;
}

#btn-show-info {
    padding: 8px 16px;
    font-size: 14px;
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;
}

#btn-show-info:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
}

#info-panel {
    padding: 15px;
    background-color: #333;
    border-radius: 5px;
    margin-top: 10px;
}

#info-keyboard-controls {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #444;
    border-radius: 5px;
}

#info-keyboard-controls h3 {
    margin-bottom: 15px;
    color: #4CAF50;
    font-size: 16px;
}

.keyboard-shortcuts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 15px;
    font-size: 14px;
}

.keyboard-key {
    display: inline-block;
    padding: 4px 8px;
    background-color: #555;
    border: 1px solid #666;
    border-radius: 3px;
    font-family: monospace;
    font-weight: bold;
    text-align: center;
    min-width: 30px;
    box-shadow: 0 2px 3px rgba(0,0,0,0.3);
}

.keyboard-description {
    display: flex;
    align-items: center;
    color: #ddd;
}

#info-teams {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.team-info {
    padding: 15px;
    background-color: #444;
    border-radius: 5px;
}

.team-info h3 {
    margin-bottom: 10px;
    color: #4CAF50;
}

.player-item {
    padding: 5px 0;
    border-bottom: 1px solid #555;
}

.player-item:last-child {
    border-bottom: none;
}

#info-stats {
    padding: 15px;
    background-color: #444;
    border-radius: 5px;
}

/* Events Settings */
#events-settings {
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
}

#settings-toggle {
    text-align: left;
}

#btn-toggle-settings {
    padding: 8px 16px;
    font-size: 14px;
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;
}

#btn-toggle-settings:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
}

#settings-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    margin-top: 10px;
    background-color: #333;
    border-radius: 5px;
}

#settings-panel label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background-color: #333;
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: background-color 0.2s;
    -moz-transition: background-color 0.2s;
    -o-transition: background-color 0.2s;
    transition: background-color 0.2s;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#settings-panel label:hover {
    background-color: #3a3a3a;
}

#settings-panel input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#settings-panel input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Стили для отключенных чекбоксов - применяются через JavaScript, так как :has() не поддерживается старыми браузерами */
#settings-panel label.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#settings-panel label.disabled:hover {
    background-color: #333;
}

/* Messages */
#error-message,
#loading-message {
    padding: 20px;
    text-align: center;
    font-size: 18px;
    background-color: #333;
    border-radius: 8px;
    margin: 20px 0;
}

#error-message {
    background-color: #F44336;
}

#loading-message {
    background-color: #2196F3;
}

/* Responsive Design - Mobile First */

/* Экраны шириной до 600px */
@media (max-width: 600px) {
    #match-teams {
        font-size: 14px;
        text-align: center;
        max-width: 100%;
    }

    #match-score {
        font-size: 24px;
    }

    .keyboard-shortcuts {
        font-size: 12px;
        gap: 8px 10px;
    }

    .keyboard-key {
        font-size: 12px;
        padding: 3px 6px;
        min-width: 25px;
    }
}

/* Очень маленькие экраны (телефоны в портретной ориентации) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    #match-container {
        padding: 10px;
    }

    #match-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    #match-teams {
        font-size: 13px;
        text-align: center;
        max-width: 100%;
        padding: 0 5px;
    }

    #match-score {
        font-size: 20px;
    }

    #match-controls {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
        justify-content: center;
    }

    #debug-toolbar {
        padding: 10px;
        gap: 8px;
    }

    .debug-toolbar-group,
    .debug-controls-panel {
        width: 100%;
    }

    .debug-control-btn {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .control-btn {
        padding: 8px 10px;
        font-size: 16px;
        flex: 0 1 auto;
        min-width: 50px;
        border-width: 1px;
    }

    /* Первый ряд: кнопки управления */
    #btn-play,
    #btn-pause,
    #btn-restart,
    #btn-rewind-1min {
        flex: 1 1 calc(25% - 6px);
        max-width: calc(25% - 6px);
    }

    #speed-control {
        width: 100%;
        flex-basis: 100%;
        justify-content: center;
        gap: 8px;
        order: 1;
        margin-top: 4px;
    }

    #speed-control label {
        font-size: 12px;
    }

    #speed-slider {
        width: 100%;
        max-width: 150px;
        flex: 1;
    }

    #speed-value {
        font-size: 14px;
        min-width: 25px;
    }

    #time-display {
        font-size: 16px;
        min-width: 70px;
        padding: 6px 10px;
        order: 2;
        margin-top: 4px;
        flex-basis: 100%;
    }

    #info-teams {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .team-info {
        padding: 10px;
    }

    #timeline-events {
        gap: 3px;
    }

    .timeline-event {
        padding: 4px 8px;
        font-size: 11px;
    }

    #canvas-wrapper {
        border-radius: 4px;
        margin-bottom: 10px;
    }

    #match-timeline,
    #match-info,
    #events-settings {
        padding: 10px;
        margin-bottom: 10px;
    }

    #info-keyboard-controls h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .keyboard-shortcuts {
        font-size: 11px;
        gap: 6px 8px;
    }

    .keyboard-key {
        font-size: 10px;
        padding: 2px 5px;
        min-width: 22px;
    }
}

/* Средние экраны (телефоны в альбомной, планшеты в портретной) */
@media (min-width: 481px) and (max-width: 768px) {
    #match-container {
        padding: 15px;
    }

    #match-teams {
        font-size: 16px;
    }

    #match-score {
        font-size: 26px;
    }

    #match-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    .control-btn {
        padding: 9px 14px;
        font-size: 15px;
    }

    #speed-control {
        flex-basis: 100%;
        justify-content: center;
        order: 1;
    }

    #time-display {
        font-size: 18px;
        order: 2;
        flex-basis: 100%;
        margin-top: 8px;
    }

    #info-teams {
        grid-template-columns: 1fr;
    }
}

/* Узкие десктопные окна (как на скриншоте) */
@media (min-width: 769px) and (max-width: 900px) {
    #match-teams {
        font-size: 18px;
    }

    #match-score {
        font-size: 28px;
    }

    .control-btn {
        padding: 9px 15px;
        font-size: 16px;
    }

    #speed-slider {
        width: 120px;
    }

    #time-display {
        font-size: 20px;
        min-width: 90px;
    }
}

/* Планшеты в альбомной ориентации */
@media (min-width: 769px) and (max-width: 1024px) {
    #match-container {
        padding: 18px;
    }

    #match-teams {
        font-size: 20px;
    }

    #match-score {
        font-size: 28px;
    }

    #info-teams {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* Поддержка touch устройств */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем размеры кнопок для удобного нажатия пальцем */
    .control-btn {
        min-height: 44px;
        min-width: 44px;
    }

    #timeline-handle {
        width: 30px;
        height: 30px;
        top: -10px;
    }

    .timeline-event {
        min-height: 40px;
        padding: 8px 12px;
    }

    /* Убираем hover эффекты на touch устройствах */
    .control-btn:hover:not(:disabled),
    #btn-toggle-events:hover,
    #btn-show-info:hover,
    .timeline-event:hover {
        transform: none;
        background-color: transparent;
    }
}

/* Ориентация экрана */
@media (orientation: landscape) and (max-width: 768px) {
    /* Для альбомной ориентации на маленьких экранах */
    #match-container {
        padding: 10px;
    }

    #match-header {
        padding: 10px;
    }

    #match-controls {
        padding: 8px;
        gap: 8px;
    }
}

/* Высокие DPI экраны (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #match-field,
    #match-canvas {
        /* Canvas автоматически обрабатывается в JS с учетом devicePixelRatio */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Очень большие экраны */
@media (min-width: 1400px) {
    #match-container {
        max-width: 1600px;
    }

    #canvas-wrapper {
        max-width: 1400px;
    }
}

/* =====================================
   Sound Control Styles
   ===================================== */

/* Sound Control Button */
#sound-toggle {
    position: relative;
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    width: 50px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

#sound-toggle:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
}

#sound-toggle.sound-on {
    border-color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.2);
}

#sound-toggle.sound-on:hover {
    background-color: rgba(76, 175, 80, 0.3);
}

/* Volume Slider */
#volume-control {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

#volume-control.visible {
    display: flex;
}

#volume-slider {
    width: 100px;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#volume-value {
    min-width: 35px;
    text-align: right;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* =====================================
   Tabs System Styles
   ===================================== */

/* Tabs Container */
.match-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
    gap: 15px;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Tab Button */
.tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: #ffffff;
    background-color: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
}

/* Match Indicator (shows when on other tabs) */
.match-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.match-indicator:hover {
    background-color: rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.6);
}

.match-indicator .indicator-icon {
    color: #4CAF50;
    font-size: 12px;
}

.match-indicator .indicator-text {
    color: rgba(255, 255, 255, 0.8);
}

.match-indicator .indicator-time {
    color: #4CAF50;
    font-weight: bold;
}

/* Tabs Content Container */
.tabs-content {
    position: relative;
}

/* Individual Tab Content */
.tab-content {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
    max-width: 1200px;
    margin: 0 auto 20px;
}

/* =====================================
   Lineup Tab Styles
   ===================================== */

.lineup-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.lineup-team {
    background-color: #333;
    border-radius: 8px;
    padding: 15px;
}

.lineup-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #444;
}

.lineup-team-name {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

.lineup-team-formation {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    background-color: #444;
    padding: 4px 10px;
    border-radius: 12px;
}

.lineup-section {
    margin-bottom: 15px;
}

.lineup-section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.lineup-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background-color: #3a3a3a;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.lineup-player:hover {
    background-color: #444;
}

.lineup-player-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    font-size: 12px;
    border-radius: 50%;
}

.lineup-team.guests .lineup-player-number {
    background-color: #2196F3;
}

.lineup-player-name {
    flex: 1;
    font-size: 14px;
}

.lineup-player-position {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    background-color: #444;
    padding: 2px 8px;
    border-radius: 10px;
}

.lineup-player-power {
    font-size: 12px;
    font-weight: bold;
    color: #4CAF50;
    min-width: 35px;
    text-align: right;
}

.lineup-player-settings {
    font-size: 11px;
    color: #888;
    min-width: 25px;
    text-align: center;
    margin-left: 8px;
}

.lineup-player.substitute {
    opacity: 0.7;
}

.lineup-player.substitute .lineup-player-number {
    background-color: #666;
}

/* Игрок заменён (ушёл с поля) */
.lineup-player.substituted-out {
    opacity: 0.5;
}

.lineup-player.substituted-out .lineup-player-name {
    text-decoration: line-through;
    color: #888;
}

/* Игрок вышел на замену (на поле) */
.lineup-player.substituted-in {
    opacity: 1;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 4px;
}

/* =====================================
   Stats Tab Styles
   ===================================== */

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    background-color: #333;
    border-radius: 8px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
}

.stat-value.hosts {
    text-align: right;
    color: #4CAF50;
}

.stat-value.guests {
    text-align: left;
    color: #2196F3;
}

.stat-center {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.stat-label {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-bar-container {
    display: flex;
    height: 6px;
    background-color: #444;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.stat-bar {
    height: 100%;
    transition: width 0.5s ease;
}

.stat-bar.hosts {
    background-color: #4CAF50;
}

.stat-bar.guests {
    background-color: #2196F3;
}

/* =====================================
   Heatmap Tab Styles
   ===================================== */

.heatmap-container {
    position: relative;
}

.heatmap-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.heatmap-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.heatmap-stats {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.heatmap-canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: #1a472a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.heatmap-canvas {
    width: 100%;
    height: 100%;
}

/* =====================================
   Shots Tab Styles
   ===================================== */

.shots-container {
    position: relative;
}

.shots-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 5px;
}

.shots-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.shots-stats {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.shots-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.shots-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.shots-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.shots-legend-dot.goal {
    background-color: #4CAF50;
}

.shots-legend-dot.on-target {
    background-color: #FFC107;
}

.shots-legend-dot.off-target {
    background-color: #F44336;
}

.shots-canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.shots-canvas {
    width: 100%;
    height: 100%;
}

/* =====================================
   Events Tab Styles
   ===================================== */

.events-list-container {
    max-height: 500px;
    overflow-y: auto;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background-color: #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.event-item:hover {
    background-color: #3a3a3a;
    transform: translateX(5px);
}

.event-time {
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    min-width: 45px;
}

.event-icon {
    font-size: 18px;
    width: 30px;
    text-align: center;
}

.event-description {
    flex: 1;
    font-size: 14px;
}

.event-team {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
}

.event-team.hosts {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.event-team.guests {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

/* =====================================
   Tabs Responsive Styles
   ===================================== */

@media (max-width: 768px) {
    .match-tabs {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .tabs-nav {
        width: 100%;
        justify-content: center;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .match-indicator {
        width: 100%;
        justify-content: center;
    }

    .tab-content {
        padding: 15px;
        min-height: 300px;
    }

    .lineup-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tabs-nav {
        gap: 3px;
    }

    .tab-btn {
        padding: 5px 8px;
        font-size: 10px;
        letter-spacing: 0;
    }

    .match-indicator {
        padding: 6px 12px;
        font-size: 12px;
    }

    .stat-row {
        grid-template-columns: 80px auto 80px;
        padding: 10px;
        gap: 10px;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-label {
        font-size: 11px;
    }
}
