:root {
    --ls-gold: #c9a032;
    --ls-gold-light: #e8c547;
    --ls-gold-dark: #9a7a25;
    --ls-red: #DC2626;
    --ls-red-light: #EF4444;
    --ls-emerald: #10b981;
    --ls-emerald-light: #34d399;
    --ls-glass-bg: rgba(15, 15, 20, 0.75);
    --ls-glass-border: rgba(255, 255, 255, 0.06);
    --ls-glass-highlight: rgba(255, 255, 255, 0.08);
    --ls-text-primary: #ffffff;
    --ls-text-secondary: rgba(255, 255, 255, 0.6);
    --ls-text-muted: rgba(255, 255, 255, 0.35);
    --ls-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --ls-shadow-glow: 0 0 20px rgba(201, 160, 50, 0.15);
}

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes barGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(201, 160, 50, 0.3); }
    50% { box-shadow: 0 0 15px rgba(201, 160, 50, 0.5); }
}

#live-stats-panel {
    display: none !important;
    background: transparent;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid var(--ls-glass-border);
    box-shadow: var(--ls-shadow);
}

#live-stats-panel.active {
    display: block !important;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-panel-header { display: none; }

.stats-panel-tabs {
    display: flex;
    background: transparent;
    border-bottom: 1px solid var(--ls-glass-border);
}

.stats-panel-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--ls-text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.stats-panel-tab:hover {
    color: var(--ls-text-primary);
}

.stats-panel-tab.active {
    color: var(--ls-gold);
}

.stats-panel-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ls-gold);
}

.stats-panel-content {
    max-height: 350px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.25);
    scroll-behavior: smooth;
}

.stats-panel-content::-webkit-scrollbar {
    width: 3px;
}

.stats-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.stats-panel-content::-webkit-scrollbar-thumb {
    background: rgba(60, 60, 60, 0.6);
    border-radius: 2px;
}

.stats-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(80, 80, 80, 0.8);
}

.stats-tab-panel {
    display: none;
    padding: 16px;
}

.stats-tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ls-glass-border);
    animation: fadeInUp 0.4s ease backwards;
}

.stat-row:nth-child(1) { animation-delay: 0.05s; }
.stat-row:nth-child(2) { animation-delay: 0.1s; }
.stat-row:nth-child(3) { animation-delay: 0.15s; }
.stat-row:nth-child(4) { animation-delay: 0.2s; }
.stat-row:nth-child(5) { animation-delay: 0.25s; }
.stat-row:nth-child(6) { animation-delay: 0.3s; }
.stat-row:nth-child(7) { animation-delay: 0.35s; }
.stat-row:nth-child(8) { animation-delay: 0.4s; }

.stat-row:last-child {
    border: none;
}

.stat-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-row-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    font-weight: 700;
    min-width: 40px;
}

.stat-row-value.home {
    color: #ffffff;
    text-align: left;
}

.stat-row-value.away {
    color: var(--ls-red);
    text-align: right;
}

.stat-row-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    color: var(--ls-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    flex: 1;
}

.stat-row-bars {
    display: flex;
    gap: 2px;
    height: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
}

.stat-row-bar {
    height: 100%;
    border-radius: 1px;
    transform-origin: left center;
    animation: barGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.stat-row-bar.home {
    background: #ffffff;
    transform-origin: left center;
}

.stat-row-bar.away {
    background: var(--ls-red);
    transform-origin: right center;
}

.football-field-container {
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.football-field {
    position: relative;
    width: 100%;
    height: 220px;
    background:
        repeating-linear-gradient(
            90deg,
            #1a5c2e 0px,
            #1a5c2e 40px,
            #1e6633 40px,
            #1e6633 80px
        );
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
}

.field-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.field-lines::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.field-lines::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.penalty-area-top, .penalty-area-bottom {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}
.penalty-area-top { left: 0; border-left: none; border-radius: 0 4px 4px 0; }
.penalty-area-bottom { right: 0; border-right: none; border-radius: 4px 0 0 4px; }

.goal-area-top, .goal-area-bottom {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}
.goal-area-top { left: 0; border-left: none; border-radius: 0 2px 2px 0; }
.goal-area-bottom { right: 0; border-right: none; border-radius: 2px 0 0 2px; }

.team-half {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 10px 8px;
}
.team-half.home { left: 0; width: 50%; }
.team-half.away { right: 0; width: 50%; flex-direction: row-reverse; }

.formation-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.player-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform 0.2s ease;
}

.player-marker:hover {
    transform: scale(1.1);
    z-index: 10;
}

.player-marker-dot {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.player-marker-dot.has-photo {
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.player-marker-dot.has-photo::after {
    content: attr(data-num);
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 4px;
    border-radius: 8px;
    text-shadow: none;
}

.team-half.home .player-marker-dot:not(.has-photo) {
    background: linear-gradient(135deg, var(--ls-gold-light), var(--ls-gold-dark));
}

.team-half.away .player-marker-dot:not(.has-photo) {
    background: linear-gradient(135deg, var(--ls-emerald-light), #0d9668);
}

.player-marker:hover .player-marker-dot {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.player-marker-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 8px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    max-width: 45px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.5);
    padding: 1px 3px;
    border-radius: 2px;
}

.formation-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--ls-glass-border);
}

.formation-team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.formation-team-logo {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--ls-glass-highlight);
}

.formation-team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.formation-team-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.formation-team-name.home { color: var(--ls-gold); }
.formation-team-name.away { color: var(--ls-emerald); }

.formation-team-formation {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    padding: 2px 6px;
    background: var(--ls-glass-highlight);
    border-radius: 3px;
    color: var(--ls-text-secondary);
    border: 1px solid var(--ls-glass-border);
}

.lineups-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--ls-glass-border);
}

.lineup-col {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px;
}

.lineup-col-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ls-glass-border);
}

.lineup-col-logo {
    width: 28px;
    height: 28px;
    background: var(--ls-glass-highlight);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--ls-glass-border);
}

.lineup-col-logo img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.lineup-col-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.lineup-col-name.home { color: var(--ls-gold); }
.lineup-col-name.away { color: var(--ls-emerald); }

.lineup-col-formation {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    padding: 3px 8px;
    background: var(--ls-glass-highlight);
    border-radius: 6px;
    color: var(--ls-text-secondary);
}

.lineup-section-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--ls-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--ls-glass-border);
}

.lineup-section-label:first-child {
    margin-top: 0;
}

.lineup-player-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    gap: 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.lineup-player-row:hover {
    background: var(--ls-glass-highlight);
}

.lineup-player-row.starter {
    background: rgba(201, 160, 50, 0.08);
}

.lineup-player-num {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--ls-text-muted);
    min-width: 20px;
    text-align: center;
    background: var(--ls-glass-highlight);
    padding: 2px 4px;
    border-radius: 4px;
}

.lineup-player-name {
    font-size: 12px;
    color: var(--ls-text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lineup-player-pos {
    font-family: 'Rajdhani', sans-serif;
    font-size: 9px;
    padding: 3px 6px;
    background: var(--ls-glass-highlight);
    border-radius: 4px;
    color: var(--ls-text-secondary);
    text-transform: uppercase;
}

.lineup-player-captain {
    font-family: 'Rajdhani', sans-serif;
    font-size: 9px;
    padding: 2px 5px;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border-radius: 4px;
    font-weight: 700;
}

.lineup-player-photo {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--ls-glass-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ls-glass-border);
}

.lineup-player-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lineup-player-photo span {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--ls-text-secondary);
}

/* ========================================
   SofaScore Style Timeline - Events
   ======================================== */

.events-timeline {
    position: relative;
    padding: 10px 0;
}

.timeline-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    min-height: 60px;
    position: relative;
    animation: fadeInUp 0.3s ease backwards;
}

.timeline-row:nth-child(1) { animation-delay: 0.02s; }
.timeline-row:nth-child(2) { animation-delay: 0.04s; }
.timeline-row:nth-child(3) { animation-delay: 0.06s; }
.timeline-row:nth-child(4) { animation-delay: 0.08s; }
.timeline-row:nth-child(5) { animation-delay: 0.1s; }
.timeline-row:nth-child(6) { animation-delay: 0.12s; }
.timeline-row:nth-child(7) { animation-delay: 0.14s; }
.timeline-row:nth-child(8) { animation-delay: 0.16s; }

/* Sol ve sağ taraf */
.timeline-left,
.timeline-right {
    flex: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 8px 12px;
    gap: 10px;
}

.timeline-left {
    justify-content: flex-end !important;
    text-align: right;
}

.timeline-right {
    justify-content: flex-start !important;
    text-align: left;
}

/* Orta çizgi */
.timeline-center {
    width: 60px !important;
    min-width: 60px !important;
    flex: 0 0 60px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
}

.timeline-minute {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--ls-emerald);
    background: rgba(16, 185, 129, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 2;
    white-space: nowrap;
}

.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--ls-glass-border);
    transform: translateX(-50%);
    z-index: 1;
}

/* Tek event olduğunda da çizgi görünsün */
.timeline-row:first-child .timeline-line {
    top: 50%;
    bottom: -30px;
}

.timeline-row:last-child .timeline-line {
    top: -30px;
    bottom: 50%;
}

/* Tek event varsa (hem first hem last) - yine de kısa çizgi göster */
.timeline-row:only-child .timeline-line {
    top: 50%;
    bottom: auto;
    height: 30px;
}

/* Event içerik */
.timeline-event-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-left .timeline-event-content {
    align-items: flex-end;
}

.timeline-right .timeline-event-content {
    align-items: flex-start;
}

.timeline-event-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--ls-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-player {
    font-size: 13px;
    font-weight: 500;
    color: var(--ls-text-secondary);
}

/* Oyuncu değişikliği - dikey gösterim */
.timeline-player-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.timeline-player-sub .player-in {
    color: var(--ls-emerald);
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-player-sub .player-in::before {
    content: '↑';
    font-weight: bold;
}

.timeline-player-sub .player-out {
    color: var(--ls-red);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    opacity: 0.8;
}

.timeline-player-sub .player-out::before {
    content: '↓';
    font-weight: bold;
}

.timeline-left .timeline-player-sub .player-in,
.timeline-left .timeline-player-sub .player-out {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.timeline-left .timeline-player-sub .player-in::before,
.timeline-left .timeline-player-sub .player-out::before {
    content: none;
}

.timeline-left .timeline-player-sub .player-in::after {
    content: '↑';
    font-weight: bold;
}

.timeline-left .timeline-player-sub .player-out::after {
    content: '↓';
    font-weight: bold;
}

/* Event icon */
.timeline-event-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-icon {
    width: 20px;
    height: 20px;
    color: var(--ls-text-primary);
}

.event-icon.goal {
    color: var(--ls-emerald);
}

.event-icon.penalty-goal {
    color: var(--ls-emerald);
}

/* Home/Away renklendirme - Ev sahibi KIRMIZI, Deplasman YEŞİL */
.timeline-row.home .timeline-event-title {
    color: var(--ls-red-light);
}

.timeline-row.away .timeline-event-title {
    color: var(--ls-emerald);
}

.timeline-row.home .timeline-minute {
    color: var(--ls-red-light);
    background: rgba(239, 68, 68, 0.15);
}

.timeline-row.away .timeline-minute {
    color: var(--ls-emerald);
    background: rgba(16, 185, 129, 0.15);
}


/* Hover efekti */
.timeline-row:hover {
    background: var(--ls-glass-highlight);
}

.timeline-row.home:hover {
    background: rgba(239, 68, 68, 0.08);
}

.timeline-row.away:hover {
    background: rgba(16, 185, 129, 0.08);
}

/* Responsive */
@media (max-width: 600px) {
    .timeline-center {
        width: 50px;
        min-width: 50px;
    }

    .timeline-minute {
        font-size: 11px;
        padding: 3px 8px;
    }

    .timeline-left,
    .timeline-right {
        padding: 6px 8px;
    }

    .timeline-event-title {
        font-size: 11px;
    }

    .timeline-player {
        font-size: 11px;
    }

    .timeline-player-sub {
        font-size: 10px;
    }

    .timeline-event-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .event-icon {
        width: 16px;
        height: 16px;
    }
}

.stats-no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--ls-text-secondary);
}

.stats-no-data-icon {
    display: none;
}

.stats-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--ls-text-secondary);
}

.stats-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--ls-glass-highlight);
    border-top-color: var(--ls-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@media (max-width: 768px) {
    .score-bar-content {
        gap: 12px;
    }

    .lineups-grid {
        grid-template-columns: 1fr;
    }

    .football-field {
        height: 180px;
    }

    .player-marker-dot {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }

    .player-marker-name {
        font-size: 7px;
        max-width: 35px;
    }

    .formation-row {
        gap: 2px;
    }

    .stats-panel-tab {
        padding: 10px 12px;
        font-size: 11px;
    }

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

@media (max-width: 480px) {
    .formation-info {
        flex-direction: column;
        gap: 8px;
    }

    .formation-team {
        width: 100%;
        justify-content: center;
    }
}
