/* KOBIT Sports - SofaScore Style Theme
 * Version: 1.2.0
 */

/* 1. GLOBAL UI & TYPOGRAPHY
-------------------------------------------------- */
.kobit-sports-match-list {
    /* Using Inter or Roboto as primary font, with fallbacks */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #FFFFFF;
    color: #212121;
}

/* Sport Tabs Navigation */
.kobit-sport-tabs-nav {
    display: flex;
    background-color: #0057b8; /* Blue */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin-bottom: 0;
}
.kobit-sport-tabs-nav::-webkit-scrollbar {
    display: none;
}
.kobit-sport-tab {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 12px 16px;
    color: #FFFFFF;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 4px solid transparent;
    transition: background-color 0.2s;
    white-space: nowrap;
}
.kobit-sport-tab i {
    font-size: 20px;
    color: #FFC107; /* Yellow */
}
.kobit-sport-tab.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: #FFC107;
}
.kobit-sport-tab:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
}
.kobit-tab-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}
.kobit-tab-live-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background-color: #E53935;
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    line-height: 1;
    z-index: 1;
}

/* 2. LEAGUE/COMPETITION HEADER
-------------------------------------------------- */
.kobit-competition-group {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
    overflow: hidden;
}

.kobit-competition-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 8px 12px;
    border-bottom: 1px solid #D1D5DB;
}

.kobit-competition-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.kobit-competition-name {
    font-size: 14px;
    font-weight: 600;
    color: #212121;
}

/* 3. & 4. MATCH ROW LAYOUT & STYLE
-------------------------------------------------- */
.kobit-match-row {
    display: grid;
    grid-template-columns: 50px 1fr 40px;
    gap: 12px;
    align-items: center;
    height: 60px;
    padding: 0 12px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #D1D5DB;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.kobit-match-row:last-child {
    border-bottom: none;
}

.kobit-match-row:hover {
    background-color: #E3F2FD;
}

/* Left Column: Time / Status Badge */
.kobit-match-time-status {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
}

.kobit-match-time-status .match-time {
    color: #0057b8; /* Blue for upcoming */
}

/* Middle Column: Teams & Score */
.kobit-match-teams-score {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.kobit-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.kobit-team.home {
    justify-content: flex-end;
}

.kobit-team.away {
    justify-content: flex-start;
}

.kobit-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kobit-team-name.short-name {
    display: none;
    text-transform: uppercase;
}

.kobit-team-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #F0F5FA; /* Placeholder color */
}

.kobit-match-score {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    min-width: 50px;
}

/* Right Column: Short Status */
.kobit-match-status-short {
    font-size: 12px;
    font-weight: 500;
    color: #757575;
    text-align: right;
}

/* 5. STATUS COLORS & BADGES
-------------------------------------------------- */
.match-status-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #FFFFFF;
    text-transform: uppercase;
}

.match-status-badge.live { background-color: #E53935; }
.match-status-badge.ht { background-color: #F57C00; } /* Half-Time */
.match-status-badge.ft { background-color: #212121; } /* Finished */
.match-status-badge.postponed { background-color: #9E9E9E; }

/* 6. RESPONSIVE RULES (Desktop)
-------------------------------------------------- */
@media (min-width: 768px) {
    .kobit-competition-header {
        padding: 16px 16px 12px 16px;
    }

    .kobit-competition-name {
        font-size: 16px;
    }

    .kobit-match-row {
        grid-template-columns: 60px 1fr 50px;
        height: 64px;
        padding: 0 16px;
        gap: 16px;
    }

    .kobit-team {
        font-size: 15px;
        gap: 12px;
    }

    .kobit-team-logo {
        width: 32px;
        height: 32px;
    }

    .kobit-match-score {
        font-size: 18px;
    }
}

@media (max-width: 767px) {
    .kobit-team-name.full-name,
    .kobit-team-name-large.full-name {
        display: none;}
    .kobit-team-name.short-name,
    .kobit-team-name-large.short-name {
        display: inline;
}
}

/* 7. MATCH DETAILS PAGE
-------------------------------------------------- */
.kobit-match-details-container {
    background-color: #F0F5FA;
    padding: 16px 0;
}

/* Details Header */
.kobit-match-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #FFFFFF;
    padding: 24px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 0 12px 16px 12px;
}

.kobit-team-header {
    flex: 1;
    text-align: center;
}

.kobit-team-header a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.kobit-team-logo-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.kobit-team-name-large {
    font-size: 16px;
    font-weight: 600;
}

.kobit-score-center {
    text-align: center;
    margin: 0 16px;
}

.kobit-match-score-large {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
}

.kobit-match-status-full {
    font-size: 12px;
    font-weight: 600;
    color: #757575;
    text-transform: uppercase;
}
/* Status colors for match details header */
.kobit-match-status-full.live { color: #E53935; }
.kobit-match-status-full.ns { color: #0057b8; } /* Not Started */
.kobit-match-status-full.ft { color: #212121; } /* Finished */
.kobit-match-status-full.ht { color: #F57C00; } /* Half-Time */
.kobit-match-status-full.postponed { color: #9E9E9E; }

/* Live Pulse Dot */
.kobit-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #E53935;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    animation: kobitPulse 1.5s infinite;
}

/* Match Info Bar */
.kobit-match-info-bar {
    background-color: #FFFFFF;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 0 12px 16px 12px;
    font-size: 13px;
    color: #757575;
}

.kobit-info-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.kobit-info-toggle-header {
    display: none;
}

@media (max-width: 767px) {
    .kobit-info-toggle-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        cursor: pointer;
        font-weight: 600;
        color: #212121;
        padding: 4px 0;
        border-bottom: 1px solid transparent;
        transition: padding-bottom 0.3s ease, border-bottom-color 0.3s ease, margin-bottom 0.3s ease;
    }
    .kobit-info-toggle-header .fa-chevron-down { transition: transform 0.3s ease; }
    .kobit-match-info-bar.active .kobit-info-toggle-header {
        padding-bottom: 12px;
        border-bottom-color: #eee;
        margin-bottom: 12px;
    }
    .kobit-info-content {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
    }
    .kobit-match-info-bar.active .kobit-info-content {
        max-height: 500px;
        opacity: 1;
    }
    .kobit-match-info-bar.active .fa-chevron-down { transform: rotate(180deg); }
    .kobit-info-item { width: 100%; }
}

.kobit-match-info-bar .kobit-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.kobit-match-info-bar .kobit-info-icon {
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Details Section (Info, Events, etc.) */
.kobit-details-section {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 0 12px 16px 12px;
    overflow: hidden; /* For rounded corners on children */
}

.kobit-section-header {
    padding: 12px 16px;
    border-bottom: 1px solid #D1D5DB;
    background-color: #FFFFFF; /* Ensure header background is white */
}

.kobit-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.kobit-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.kobit-info-label {
    color: #757575;
}

.kobit-info-value {
    font-weight: 500;
}

/* Match Video Embed */
.kobit-match-video-container {
    margin-bottom: 20px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.kobit-video-header {
    padding: 8px 12px;
    background-color: #212121;
    display: flex;
    align-items: center;
}
.kobit-video-badge {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kobit-video-badge.live {
    background-color: #E53935;
    animation: kobitPulse 1.5s infinite;
}
.kobit-video-badge.highlight {
    background-color: #0057b8;
}
.kobit-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}
.kobit-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Admin Video Form */
.kobit-admin-video-form-container {
    margin-bottom: 20px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 10px;
}
.kobit-admin-toggle-btn {
    background: none;
    border: none;
    color: #856404;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    width: 100%;
    text-align: left;
}
.kobit-admin-video-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ffeeba;
}
.kobit-form-group {
    margin-bottom: 12px;
}
.kobit-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #856404;
}
.kobit-form-group select,
.kobit-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
}
.kobit-btn-save {
    background-color: #0057b8;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.kobit-btn-save:hover {
    background-color: #004494;
}

/* 8. EVENT / TIMELINE SECTION
-------------------------------------------------- */
.kobit-events-list {
    position: relative;
    padding: 16px 0; /* Vertical padding for the timeline */
    background-color: #FFFFFF; /* Ensure background is white */
}
.kobit-events-list::before { /* The central timeline bar */
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: #D1D5DB;
}

.kobit-event-row {
    display: flex;
    justify-content: flex-start; /* Default for home */
    align-items: center;
    position: relative;
    padding: 4px 0;
    width: 50%;
    min-height: 50px;
    box-sizing: border-box;
}

.kobit-event-row.away {
    margin-left: 50%; /* Push away events to the right side */
}

.kobit-event-details {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
    width: calc(100% - 40px);
    box-sizing: border-box;
    background-color: #F0F5FA;
    border-radius: 6px;
    position: relative;
}

.kobit-event-row.home .kobit-event-details {
    justify-content: flex-end;
    text-align: right;
    margin-right: 40px;
}

/* Pointer arrow for the card */
.kobit-event-details::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.kobit-event-row.away .kobit-event-details {
    justify-content: flex-start;
    text-align: left;
    margin-left: 40px;
}

.kobit-event-row.home .kobit-event-details::after {
    left: 100%;
    border-left: 6px solid #F0F5FA;
}
.kobit-event-row.away .kobit-event-details::after {
    right: 100%;
    border-right: 6px solid #F0F5FA;
}

/* Order icon and player name based on team */
.kobit-event-row.home .kobit-event-details {
    flex-direction: row-reverse;
}
.kobit-event-row.home .kobit-event-player-names { text-align: right; }
.kobit-event-row.away .kobit-event-player-names { text-align: left; }

.kobit-event-minute {
    font-weight: 600;
    font-size: 13px;
    color: #757575;
    margin-left: auto; /* Pushes the minute to the far right */
    padding-left: 10px;
    border-left: 1px solid #D1D5DB;
    white-space: nowrap;
}

.kobit-event-row.home .kobit-event-minute {
    order: -1; /* Moves minute to the far left for home team events */
    padding-left: 0;
    padding-right: 10px;
    border-left: none;
    border-right: 1px solid #D1D5DB;
}

.kobit-event-team-logo {
    display: none; /* Hide on desktop by default */
}
.kobit-event-team-logo img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.kobit-event-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kobit-event-player-names {
    display: flex;
    flex-direction: column;
}
.kobit-event-player-main {
    font-weight: 600;
}
.kobit-event-player-sub {
    font-size: 0.85em;
    color: #757575;
}
.kobit-event-player-sub i {
    font-size: 0.9em;
}
.kobit-event-player-sub.in { color: #4CAF50; }
.kobit-event-player-sub.out { color: #E53935; }
.kobit-event-detail-text {
    font-size: 0.9em;
    color: #757575;
}

.kobit-event-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    position: relative; /* For penalty badge positioning */
}

.kobit-player-photo-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #F0F5FA;
    border: 1px solid #D1D5DB;
}

/* Event Icons */
.kobit-event-icon.fa-futbol.normal-goal {
    color: #4CAF50; /* Green */
}
.kobit-event-icon.fa-futbol.own-goal {
    color: #f57c00; /* Orange */
}
.kobit-event-icon.fa-futbol.penalty {
    color: #4CAF50; /* Green */
}
.kobit-event-icon.fa-futbol.missed-penalty,
.kobit-event-icon.fa-futbol.goal-disallowed-offside,
.kobit-event-icon.fa-futbol.goal-cancelled {
    color: #BDBDBD; /* Grey for cancelled/missed events */
}

/* 'X' overlay for missed/cancelled goals */
.kobit-event-icon.missed-penalty::before,
.kobit-event-icon.goal-disallowed-offside::before,
.kobit-event-icon.goal-cancelled::before {
    content: '\00d7'; /* Multiplication sign '×' */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #E53935; /* Red */
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 2px #fff;
}

/* Subscript text for PEN or VAR */
.kobit-event-icon.missed-penalty::after,
.kobit-event-icon.goal-disallowed-offside::after,
.kobit-event-icon.goal-cancelled::after {
    position: absolute;
    bottom: -4px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    color: #E53935;
    line-height: 1;
}
.kobit-event-icon.missed-penalty::after { content: 'PEN'; }
.kobit-event-icon.goal-disallowed-offside::after,
.kobit-event-icon.goal-cancelled::after { content: 'VAR'; }

/* Subscript for successful penalty goals */
.kobit-event-icon.fa-futbol.penalty::after {
    content: 'PEN';
    position: absolute;
    bottom: -4px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    color: #212121; /* Dark text for contrast */
    line-height: 1;
}

/* Subscript for VAR-confirmed goals */
.kobit-event-icon.fa-futbol.var-goal-confirmed::after {
    content: 'VAR';
    position: absolute;
    bottom: -4px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    color: #212121; /* Dark text for contrast */
    line-height: 1;
}

.kobit-event-icon.yellow-card {
    width: 14px;
    height: 18px;
    background-color: #FFCA28;
    border-radius: 2px;
}
.kobit-event-icon.red-card {
    width: 14px;
    height: 18px;
    background-color: #E53935;
    border-radius: 2px;
}
.kobit-event-icon[class*="substitution"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E53935' d='m12 5.83-3.17 3.17 1.41 1.41L12 8.66l1.76 1.76-1.41 1.41L12 10.41V3h-2v7.41L7.41 7.59 6 9l6 6z'/%3E%3Cpath fill='%234CAF50' d='m18 15-6-6-1.41 1.41L12 11.83l-1.76-1.76 1.41-1.41L12 10.08V15h2v-4.92l2.59 2.59L18 15z'/%3E%3C/svg%3E");
}
.kobit-event-icon.var {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230057b8'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4V6h11v12z'/%3E%3Cpath d='M18 12.5V9h-2v3.5h-1V9h-2v3.5h-1V9h-2v3.5c0 .83.67 1.5 1.5 1.5h5c.83 0 1.5-.67 1.5-1.5z'/%3E%3C/svg%3E"); /* Blue VAR screen */
}
.kobit-event-icon.goal-cancelled {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23BDBDBD' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolygon points='12 7 9 9 10 12 14 12 15 9 12 7'/%3E%3Cpolyline points='9 9 5.5 10.5 6.5 14.5 10 12'/%3E%3Cpolyline points='15 9 18.5 10.5 17.5 14.5 14 12'/%3E%3Cpolyline points='10 12 7.5 16 12 17.5 16.5 16 14 12'/%3E%3Cpath d='M4.22 4.22l15.56 15.56' stroke='red' stroke-width='2'/%3E%3C/svg%3E"); /* Crossed-out ball */
}
.kobit-event-icon.injury-time, .kobit-event-icon.injury {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 11h-4v4h-2v-4H8v-2h4V8h2v4h4v2z'/%3E%3C/svg%3E"); /* Medical cross */
}

/* Animation for new event flash */
@keyframes newEventFlash {
    0% {
        background-color: #FFF59D; /* Yellow flash */
    }
    100% {
        background-color: #F0F5FA; /* Back to original gray */
    }
}
.kobit-event-row.flash .kobit-event-details {
    animation: newEventFlash 2s ease-out;
}

@media (max-width: 767px) {
    .kobit-events-list::before {
        left: 24px; /* Move timeline bar to the left */
    }
    .kobit-event-row,
    .kobit-event-row.away {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
    .kobit-event-minute {
        /* This is now handled by flexbox inside the details card */
    }
    .kobit-event-details {
        width: calc(100% - 40px); /* Adjust width to account for timeline */
        padding-left: 12px;
        padding-right: 16px;
    }
    .kobit-event-details::after {
        right: 100%;
        border-right: 6px solid #F0F5FA;
        border-left: none;
    }
    .kobit-event-row.home .kobit-event-details,
    .kobit-event-row.away .kobit-event-details {
        text-align: left;
        margin-right: 0;
        flex-direction: row; /* Always icon first */
    }
    .kobit-event-row.home .kobit-event-minute {
        order: 1; /* Reset order for mobile to always be on the right */
        padding-left: 10px;
        padding-right: 0;
        border-left: 1px solid #D1D5DB;
        border-right: none;
    }
    .kobit-event-row.home .kobit-event-player-info {
        order: 0;
    }
    .kobit-event-team-logo {
        display: block; /* Show on mobile */
        order: 2; /* Place it after the timestamp */
    }

    /* --- Mobile Lineup Tabs Refactor --- */
    .kobit-lineups-desktop-layout {
        display: none; /* Hide desktop layouts on mobile */
    }

    .kobit-lineup-mobile-tabs {
        display: flex; /* Use flexbox for the main container */
        flex-direction: column;
    }

    .kobit-lineup-mobile-tabs .kobit-tabs-nav {
        display: flex;
        justify-content: center;
        border-bottom: 1px solid #D1D5DB;
        padding: 0;
        margin: 0;
    }

    .kobit-lineup-mobile-tabs .kobit-tab-item {
        flex: 1 1 50%; /* Each tab takes 50% width */
        padding: 12px 8px;
        border-bottom: 2px solid transparent;
        text-align: center;
    }

    .kobit-lineup-mobile-tabs .kobit-tab-item.active {
        border-bottom-color: #0057b8;
        background-color: #F0F5FA; /* Add a subtle background to the active tab */
    }

    .kobit-lineup-mobile-tabs .kobit-team-logo {
        width: 32px;
        height: 32px;
    }

    .kobit-lineup-mobile-tabs .kobit-tabs-content {
        background-color: #F0F5FA; /* Match active tab background */
    }

    .kobit-lineup-mobile-tabs .kobit-tab-panel {
        width: 100%;
        display: none;
    }

    .kobit-lineup-mobile-tabs .kobit-tab-panel.active {
        display: block;
    }

    /* Ensure lineup content inside mobile tabs is visible */
    .kobit-lineup-mobile-tabs .kobit-lineups-container {
        display: block;
    }
    .kobit-lineup-mobile-tabs .kobit-lineup-team {
        display: flex;
    }

    /* --- End Mobile Lineup Tabs Refactor --- */
}

@media (min-width: 768px) {
    .kobit-match-details-header, .kobit-details-section {
        margin: 0 auto 16px auto;
        max-width: 800px;
    }

    .kobit-lineups-desktop-layout {
        display: block; /* Show desktop layout */
    }

    .kobit-lineup-mobile-tabs {
        display: none; /* Hide mobile tabs on desktop */
    }
}

/* 8. TABS
-------------------------------------------------- */
.kobit-tabs-container {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin: 0 12px 16px 12px;
}

.kobit-tabs-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 8px;
    border-bottom: 1px solid #D1D5DB;
    overflow-x: auto;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.kobit-tabs-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.kobit-tab-item {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #757575;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; /* Overlap border */
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.kobit-tab-item:hover {
    color: #212121;
}

.kobit-tab-item.active {
    color: #0057b8;
    border-bottom-color: #0057b8;
}

.kobit-tab-panel {
    display: none;
    padding: 16px;
}

.kobit-tab-panel.active {
    display: block;
}
.kobit-tab-panel > p {
    text-align: center;
    color: #757575;
    padding: 24px 0;
}

/* 10. LINEUPS TAB
-------------------------------------------------- */
.kobit-lineups-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.kobit-lineup-header {
    font-size: 13px;
    font-weight: 600;
    color: #757575;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #D1D5DB;
}
.kobit-lineup-section h5 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
}
.kobit-player-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.player-list-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.player-name-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}
.player-name-wrapper.on-pitch {
    flex-direction: column;
}
.kobit-player-list li {
    display: flex;
    align-items: center;
    font-size: 14px;
}
.kobit-player-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #F0F5FA;
    margin-right: 8px;
}
.kobit-player-list li .player-name {
    font-weight: 500;
}
.player-number {
    font-weight: 600;
    color: #757575;
    width: 24px;
    text-align: right;
    margin-right: 8px;
}

.player-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    color: #fff;
    margin-right: 8px;
    text-align: center;
}

.kobit-player-rating {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background-color: #e0e0e0;
    color: #212121;
    margin-left: 6px;
}
.kobit-player-rating.high { background-color: #4CAF50; color: #fff; }
/* Position-specific colors */
.player-pos.pos-g { background-color: #f57c00; } /* Goalkeeper - Orange */
.player-pos.pos-d { background-color: #1976d2; } /* Defender - Blue */
.player-pos.pos-m { background-color: #388e3c; } /* Midfielder - Green */
.player-pos.pos-f { background-color: #d32f2f; } /* Forward - Red */

/* 10. STATISTICS TAB (Refactored)
-------------------------------------------------- */
.kobit-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Increased gap for better spacing */
}
.kobit-stats-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #757575;
}
.stat-bar-label .stat-value {
    font-weight: 700;
    color: #212121;
}
.stat-bar-label span:nth-child(2) { /* The text label */
    text-align: center;
    white-space: nowrap;
}
.stat-bar-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.stat-bar-container {
    background-color: #F0F5FA;
    border-radius: 4px;
    overflow: hidden;
    height: 8px;
}
.stat-bar-container.away {
    direction: rtl; /* Makes the bar fill from right to left */
}
.stat-bar-container .stat-bar {
    width: 0; /* Start at 0 for animation */
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1); /* Smooth ease-out */
}
.stat-bar-container.filled .stat-bar {
    width: var(--perc, 50%);
}
.stat-bar-container.home .stat-bar {
    background-color: var(--team-color, #0057b8); /* Blue for home team */
}
.stat-bar-container.away .stat-bar {
    background-color: var(--team-color, #FFCA28); /* Yellow for away team */
}


/* 11. H2H TAB (Refactored)
-------------------------------------------------- */
.kobit-h2h-tab {
    padding: 16px 0 0 0 !important; /* Override default panel padding */
}
.kobit-h2h-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
}
.kobit-h2h-summary-team {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}
.kobit-h2h-summary-team .team-name {
    font-weight: 600;
    font-size: 14px;
}
.kobit-h2h-summary-team.away {
    align-items: flex-end;
}
.kobit-h2h-summary-team.away .form-pills {
    justify-content: flex-end;
}

/* H2H Win Summary Bar */
.kobit-h2h-win-summary {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 16px 24px 16px;
    background-color: #F0F5FA;
}
.h2h-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 14px;
    transition: width 0.5s ease-out;
}
.h2h-bar.home { background-color: #0057b8; }
.h2h-bar.draw { background-color: #757575; }
.h2h-bar.away { background-color: #FFCA28; }
.h2h-bar-value {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* H2H Results List */
.kobit-h2h-results {
    display: flex;
    flex-direction: column;
}
.kobit-h2h-match-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #D1D5DB;
    font-size: 13px;
    color: #757575;
}
.kobit-h2h-match-card:last-child {
    border-bottom: none;
}
.kobit-h2h-match-card.home-win .h2h-team.home .h2h-team-name,
.kobit-h2h-match-card.away-win .h2h-team.away .h2h-team-name {
    font-weight: 700;
    color: #212121;
}
.h2h-match-date {
    width: 70px;
    flex-shrink: 0;
}
.h2h-match-teams {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}
.h2h-team {
    display: flex;
    align-items: center;
    gap: 8px;
}
.h2h-team.home { justify-content: flex-end; }
.h2h-team.away { justify-content: flex-start; }
.h2h-team-logo {
    width: 20px;
    height: 20px;
}
.h2h-team-name {
    font-weight: 500;
    color: #212121;
}
.h2h-score {
    font-weight: 700;
    font-size: 14px;
    color: #212121;
    background-color: #F0F5FA;
    padding: 2px 8px;
    border-radius: 4px;
}
.h2h-match-competition {
    flex: 1;
    text-align: left;
}

.form-pills {
    display: flex;
    align-items: center;
    gap: 6px;
}
.kobit-form-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%; /* Circular pills */
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
}
.kobit-form-pill.w { background-color: #4CAF50; } /* Win - Green */
.kobit-form-pill.d { background-color: #757575; } /* Draw - Gray */
.kobit-form-pill.l { background-color: #E53935; } /* Loss - Red */

/* Mobile Optimization for H2H */
@media (max-width: 767px) {
    .kobit-h2h-summary {
        padding: 12px;
    }
    .kobit-form-pill {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    .kobit-h2h-match-card {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 6px 0;
    }
    .h2h-match-date {
        order: 1;
        width: auto;
        font-size: 11px;
        color: #999;
        margin-right: auto;
    }
    .h2h-match-competition {
        order: 2;
        flex: 0 1 auto;
        width: auto;
        text-align: right;
        font-size: 11px;
        max-width: 60%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .h2h-match-teams {
        order: 3;
        width: 100%;
        margin-top: 4px;
    }
    .h2h-team-name {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 90px;
    }
}

/* 12. LEAGUE TABLE TAB */
.kobit-league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background-color: #FFFFFF;
}
.kobit-league-table th, .kobit-league-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #D1D5DB;
}
.kobit-league-table th {
    font-size: 12px;
    font-weight: 600;
    color: #757575;
    text-transform: uppercase;
}
.kobit-league-table td.rank {
    text-align: center;
    font-weight: 500;
}
.kobit-league-table td:nth-child(2) { /* Team Name */
    font-weight: 500;
}
.kobit-league-table tr.highlighted td {
    background-color: #E3F2FD; /* Light blue highlight */
    font-weight: 600;
}

/* 13. ODDS TABLE TAB
-------------------------------------------------- */
.kobit-odds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.kobit-odds-table th, .kobit-odds-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #D1D5DB;
    vertical-align: middle;
}
.kobit-odds-table th {
    font-size: 12px;
    font-weight: 600;
    color: #757575;
    text-transform: uppercase;
}
.kobit-odds-table th:not(:first-child) {
    text-align: center;
}
.kobit-odds-table td:first-child {
    font-weight: 500;
}
.kobit-odds-table td.odds-value {
    text-align: center;
    font-weight: 700;
    color: #0057b8;
    background-color: #F0F5FA;
    border-radius: 4px;
    padding: 6px 10px;
}
.kobit-odds-table tbody tr:hover td {
    background-color: #E3F2FD;
}

/* 13. FORMATION BOARD (Existing styles, moved for organization)
-------------------------------------------------- */
.kobit-formation-board {
    background-color: var(--pitch-bg-color, #3A7E3D); /* A nice pitch green */
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Pitch Markings */
.pitch {
	position: relative;
	width: 100%;
	aspect-ratio: 7 / 10;
	background-color: var(--pitch-bg-color, #3A7E3D); /* Moved from parent for encapsulation */
	--line-color: rgba(255, 255, 255, 0.3);
	background-image: 
		/* Penalty Spots */
		radial-gradient(circle at 50% 11.5%, var(--line-color) 0.8%, transparent 0.8%), 
		radial-gradient(circle at 50% 88.5%, var(--line-color) 0.8%, transparent 0.8%), 
		/* Center Spot */
		radial-gradient(circle at 50% 50%, var(--line-color) 0.8%, transparent 0.8%), 
		/* Center Circle */
		radial-gradient(circle at 50% 50%, transparent 12%, var(--line-color) 12%, var(--line-color) 12.5%, transparent 12.5%), 
		/* Goal Areas */
		linear-gradient(to right, transparent 30%, var(--line-color) 30%, var(--line-color) 70%, transparent 70%), 
		linear-gradient(to bottom, transparent 0%, var(--line-color) 0, var(--line-color) 6%, transparent 6%), 
		linear-gradient(to bottom, transparent 94%, var(--line-color) 94%, var(--line-color) 100%, transparent 100%), 
		/* Penalty Boxes */
		linear-gradient(to right, transparent 15%, var(--line-color) 15%, var(--line-color) 85%, transparent 85%), 
		linear-gradient(to bottom, transparent 0, var(--line-color) 0, var(--line-color) 17%, transparent 17%), 
		linear-gradient(to bottom, transparent 83%, var(--line-color) 83%, var(--line-color) 100%, transparent 100%), 
		/* Center Line */
		linear-gradient(to bottom, transparent 0%, transparent 49.7%, var(--line-color) 49.7%, var(--line-color) 50.3%, transparent 50.3%, transparent 100%);
}
.player-dot {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 60px; /* Give it a fixed width */
}
.player-image-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}
.player-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    background-color: #e0e0e0;
}
.player-number {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background-color: #212121;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border: 1px solid #fff;
}
.player-dot .player-name {
    font-size: 12px;
    color: #fff;
    font-weight: 500;
    background-color: rgba(0,0,0,0.6);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}
.player-dot .lineup-player-icons {
    position: absolute;
    top: 0;
    left: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-left: 4px;
}
.player-dot .lineup-event-icon {
    width: 14px;
    height: 14px;
}
.player-dot .lineup-event-icon.is-sub-out,
.player-dot .lineup-event-icon.is-sub-in {
    font-size: 10px;
}

.kobit-lineup-team {
	display: flex;
	flex-direction: column;
}

.lineup-player-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.lineup-event-icon {
    font-size: 12px;
}

.lineup-event-icon.is-goal { color: #4CAF50; }
.lineup-event-icon.is-own-goal { color: #f57c00; } /* Orange for Own Goal */
.lineup-event-icon.is-assist { color: #2196F3; }
.lineup-event-icon.is-captain { color: #FFC107; font-size: 11px; } /* Gold C */
.lineup-event-icon.is-yellow-card { color: #FFCA28; }
.lineup-event-icon.is-red-card { color: #E53935; }

.lineup-event-icon.is-sub-in,
.lineup-event-icon.is-sub-out {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
}
.lineup-event-icon.is-sub-in { color: #4CAF50; }
.lineup-event-icon.is-sub-out { color: #E53935; }

/* 10. LINEUPS TAB (Refactored)
-------------------------------------------------- */
.kobit-lineups-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.kobit-lineup-team {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Space between formation and lists */
}

.kobit-player-list li {
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.kobit-player-list li:nth-child(odd) {
    background-color: #F0F5FA;
}

.kobit-player-list li:hover {
    background-color: #E3F2FD;
}

/* Center Line */
.kobit-formation-board::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.3);
}
/* Center Circle */
.kobit-formation-board::after {
    width: 25%;
    padding-bottom: 25%; /* Maintain aspect ratio */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-width: 2px;
    border-radius: 50%;
}

.player-event-icon.sub-out {
    color: #E53935;
}

/* 15. MAN OF THE MATCH CARD
-------------------------------------------------- */
.kobit-motm-card {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin: 0 12px 16px 12px;
    overflow: hidden;
}

.kobit-motm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #D1D5DB;
}

.kobit-motm-icon {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFC107'%3E%3Cpath d='M19 4h-4L12 1 9 4H5C3.9 4 3 4.9 3 6v13c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 13c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.kobit-motm-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #212121;
}

.kobit-motm-body {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
}

.kobit-motm-player-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFC107; /* Gold border */
}

.kobit-motm-player-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kobit-motm-player-name {
    font-size: 18px;
    font-weight: 700;
}

.kobit-motm-team-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #757575;
}

.kobit-motm-team-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

@media (min-width: 768px) {
    .kobit-motm-card {
        margin: 0 auto 16px auto;
        max-width: 1200px;
    }
}

/* 14. RESPONSIVENESS RULES
-------------------------------------------------- */
@media (min-width: 768px) {
    .kobit-match-details-header,
    .kobit-match-info-bar,
    .kobit-tabs-container,
    .kobit-details-section {
        margin: 0 auto 16px auto;
        max-width: 1200px; /* Constrain width on larger screens */
    }

    .kobit-team-name-large.short-name {
        display: none;
    }

    .kobit-tabs-nav {
        justify-content: center; /* Center main tabs on desktop */
    }

    /* Stats: Hide mobile tabs, show desktop grid */
    .kobit-stats-mobile-tabs {
        display: none;
    }
    .kobit-stats-desktop-grid {
        display: grid;
        grid-template-columns: 1fr; /* Single column for stats rows */
        gap: 12px;
    }
    .kobit-stats-row {
        grid-template-columns: 50px 1fr 50px; /* Adjust column widths for desktop */
        gap: 8px 16px;
    }
    .kobit-stats-row .stat-bar-label {
        font-size: 14px;
    }

    /* Events: Wider spacing */
    .kobit-events-list {
        padding: 20px 0;
    }
    .kobit-event-row {
        padding: 10px 0;
    }
    .kobit-event-row.home .kobit-event-details {
        margin-right: 40px; /* More space from center line */
    }
    .kobit-event-row.away .kobit-event-details {
        margin-left: 40px; /* More space from center line */
    }

    /* Lineups: Adjust player list spacing */
    .kobit-player-list {
        gap: 8px;
    }
}

/* Icons for Match Info Bar (placeholders) */
.icon-competition { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M12 2L4 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-8-3zm0 10.99h-1V10h1v2.99zm0-5.98h-1V7h1v-.01z'/%3E%3C/svg%3E"); }
.icon-time { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E"); }
.icon-stadium { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M12 12c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6zm0 2c4.42 0 8 3.58 8 8v2H4v-2c0-4.42 3.58-8 8-8z'/%3E%3C/svg%3E"); }
.icon-round { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E"); }
.icon-referee { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23757575'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E"); }

@media (min-width: 768px) {
    .kobit-tabs-container {
        margin: 0 auto 16px auto;
        max-width: 1200px;
    }
    .kobit-tabs-nav {
        justify-content: center;
    }
}

/* 16. PLAYER DETAILS PAGE
-------------------------------------------------- */
.kobit-player-details-container {
    max-width: 800px;
    margin: 16px auto;
    padding: 16px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.kobit-player-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #D1D5DB;
    margin-bottom: 16px;
}

.kobit-player-photo-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kobit-player-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.kobit-player-bio {
    display: flex;
    gap: 24px;
    margin-left: auto; /* Pushes bio info to the right */
    text-align: center;
}

.kobit-bio-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kobit-bio-label {
    font-size: 12px;
    color: #757575;
}

.kobit-bio-value {
    font-size: 16px;
    font-weight: 600;
}

.kobit-player-nationality {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #757575;
    margin-bottom: 8px;
}

.kobit-player-bio-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 16px;
    padding: 16px;
    background-color: #F0F5FA;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.kobit-bio-detail-item strong {
    color: #757575;
    margin-right: 6px;
}

.kobit-career-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    background-color: transparent;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}
.kobit-summary-item {
    background-color: #F0F5FA;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.2s;
}
.kobit-summary-item:hover { transform: translateY(-2px); }
.kobit-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #0057b8;
}
.kobit-summary-label {
    font-size: 13px;
    color: #757575;
    font-weight: 500;
}

.kobit-player-team-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #757575;
}
.kobit-player-team-logo {
    width: 24px;
    height: 24px;
}

.kobit-season-selector-wrapper {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.kobit-season-selector {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #D1D5DB;
    font-size: 14px;
}

.kobit-chart-container {
    position: relative;
    height: 300px;
    margin-top: 24px;
}

.kobit-player-stats-table {
    width: 100%;
    border-collapse: collapse;
}
.kobit-player-stats-table th, .kobit-player-stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #D1D5DB;
}
.kobit-player-stats-table th {
    font-size: 12px;
    color: #757575;
    text-transform: uppercase;
}
.kobit-player-stats-table td:not(:first-child) {
    text-align: center;
    font-weight: 600;
}
.competition-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.competition-logo {
    width: 24px;
    height: 24px;
}
.transfer-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.transfer-team.from { justify-content: flex-end; text-align: right; }
.transfer-team.to { justify-content: flex-start; text-align: left; }
.transfer-team img {
    width: 28px;
    height: 28px;
}

/* 18. FLOATING SHARE BUTTON
-------------------------------------------------- */
.kobit-share-fab-container {
    position: fixed;
    top: 50%;
    left: 0;
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 0;
}
.kobit-share-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: 0 8px 8px 0;
    background-color: #0057b8;
    color: #fff;
    border: none;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background-color 0.3s, width 0.2s;
    animation: kobitSharePulse 2s infinite;
}
.kobit-share-toggle-btn:hover {
    background-color: #004494;
    width: 54px;
}
.kobit-share-toggle-btn .fa-times { display: none; }
.kobit-share-fab-container.active .kobit-share-toggle-btn .fa-share-nodes { display: none; }
.kobit-share-fab-container.active .kobit-share-toggle-btn .fa-times { display: block; }
.kobit-share-fab-container.active .kobit-share-toggle-btn { animation: none; }

@keyframes kobitSharePulse {
    0% { box-shadow: 2px 2px 8px rgba(0,0,0,0.2), 0 0 0 0 rgba(0, 87, 184, 0.7); }
    70% { box-shadow: 2px 2px 8px rgba(0,0,0,0.2), 0 0 0 10px rgba(0, 87, 184, 0); }
    100% { box-shadow: 2px 2px 8px rgba(0,0,0,0.2), 0 0 0 0 rgba(0, 87, 184, 0); }
}

.kobit-share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-left: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.kobit-share-fab-container.active .kobit-share-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.kobit-share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #fff;
    color: #555;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s;
    font-size: 18px;
    cursor: pointer;
}
.kobit-share-btn:hover { transform: scale(1.1); }
.kobit-share-btn.facebook { color: #1877F2; }
.kobit-share-btn.twitter { color: #000; }
.kobit-share-btn.whatsapp { color: #25D366; }
.kobit-share-btn.copy-link { color: #757575; }

@media (prefers-color-scheme: dark) {
    .kobit-share-btn {
        background-color: #2c2c2c;
        border-color: #444;
    }
    .kobit-share-btn.copy-link { color: #ccc; }
    .kobit-share-btn.twitter { color: #fff; }
}

/* 19. SHARE FLASHCARD (Hidden)
-------------------------------------------------- */
.kobit-share-card {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 800px;
    height: 418px; /* Approx 1.91:1 aspect ratio */
    background: linear-gradient(135deg, #0057b8 0%, #003b7e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}
.kobit-card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}
.kobit-card-header .site-logo { height: 50px; object-fit: contain; z-index: 1; }
.kobit-card-header .site-name { font-size: 24px; font-weight: 700; margin: 0; color: #fff; text-transform: uppercase; letter-spacing: 1px; z-index: 1; }

.kobit-card-watermark {
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 250px;
    height: 250px;
    opacity: 0.1;
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: 0;
    object-fit: contain;
}

.kobit-card-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-grow: 1;
    z-index: 1;
}
.card-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 250px;
    text-align: center;
}
.card-team img { width: 100px; height: 100px; object-fit: contain; background: #fff; border-radius: 50%; padding: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.card-team span { font-size: 20px; font-weight: 700; line-height: 1.2; }

.card-score-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.card-score { font-size: 64px; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.card-status { background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 20px; font-weight: 600; font-size: 14px; text-transform: uppercase; }

.kobit-card-footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    opacity: 1;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    z-index: 1;
}
.kobit-card-footer-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    align-items: center;
}
.kobit-card-footer-row.details {
    font-size: 14px;
    opacity: 0.9;
}
.kobit-card-footer-row.details span { display: flex; align-items: center; gap: 6px; }
.kobit-share-btn.download-image { color: #E91E63; }

/* 17. TEAM DETAILS PAGE
-------------------------------------------------- */
.kobit-team-details-container {
    max-width: 800px;
    margin: 16px auto;
}

.kobit-team-details-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 16px;
}
.kobit-team-details-header .team-logo {
    width: 80px;
    height: 80px;
}
.kobit-team-details-header h1 {
    margin: 0 0 4px 0;
    font-size: 28px;
}
.kobit-team-details-header .team-meta {
    font-size: 14px;
    color: #757575;
}

/* Squad List */
.kobit-squad-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.kobit-player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #F0F5FA;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}
.kobit-player-card:hover {
    background-color: #e3f2fd;
}
.kobit-player-card .player-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.kobit-player-card .player-info {
    display: flex;
    flex-direction: column;
}
.kobit-player-card .player-name {
    font-weight: 600;
}
.kobit-player-card .player-position {
    font-size: 13px;
    color: #757575;
}

/* Venue Details */
.kobit-venue-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.kobit-venue-details .venue-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}
.kobit-venue-details .venue-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}
.kobit-venue-details .venue-meta-item strong {
    color: #757575;
    margin-right: 8px;
}

.kobit-team-name-large, .kobit-motm-team-name, .kobit-h2h-summary-team .team-name, .kobit-odds-table .odds-team-name, .kobit-league-table .team-name {
    text-transform: uppercase;
}

/* Mobile Horizontal Scroll for Stats Tables */
@media (max-width: 767px) {
    .kobit-stats-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .kobit-stats-table-header,
    .kobit-stats-table-row {
        min-width: 500px; /* Ensure content is wide enough to scroll */
    }
    /* Sticky Rank Column */
    .col-rank {
        position: sticky;
        left: 0;
        background-color: #FFFFFF;
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    }
    @media (prefers-color-scheme: dark) {
        .col-rank {
            background-color: #212121;
        }
    }
}

/* 20. COMPETITION DETAILS LAYOUT
-------------------------------------------------- */
/* Mobile: Maximize width for competition details */
@media (max-width: 767px) {
    .kobit-competition-details-container .kobit-tabs-container {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .kobit-competition-details-header {
        padding: 0 12px;
    }
}

/* Desktop: Increase width constraint */
@media (min-width: 768px) {
    .kobit-competition-details-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .kobit-competition-details-container .kobit-tabs-container {
        max-width: 100%;
    }
}

/* 21. NO MATCHES STATE
-------------------------------------------------- */
.kobit-no-matches-state {
    text-align: center;
    padding: 40px 20px;
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 16px;
}
.kobit-no-matches-icon {
    font-size: 48px;
    color: #BDBDBD;
    margin-bottom: 16px;
}
.kobit-no-matches-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #212121;
}
.kobit-no-matches-state p {
    color: #757575;
    margin: 0 0 24px 0;
    font-size: 14px;
}
.kobit-find-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #0057b8;
    color: #FFFFFF;
    padding: 10px 24px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s;
}
.kobit-find-next-btn:hover {
    background-color: #004494;
    color: #FFFFFF;
}

/* 22. EXPANDABLE MATCH ROWS
-------------------------------------------------- */
.kobit-match-row.expandable {
    cursor: pointer;
}
.kobit-match-row.expandable::after {
    /* Optional: Add an indicator icon */
}
.kobit-match-expanded-details {
    background-color: #F9FAFB;
    border-bottom: 1px solid #D1D5DB;
    padding: 12px 16px;
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
.kobit-expanded-goals-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 12px;
    position: relative;
}
.kobit-expanded-goals-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background-color: #D1D5DB;
    transform: translateX(-50%);
}
.kobit-expanded-goals-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #424242;
}
.kobit-expanded-goals-column.home {
    align-items: flex-end;
    text-align: right;
}
.kobit-expanded-goals-column.away {
    align-items: flex-start;
    text-align: left;
}
.goal-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.goal-player-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.kobit-expanded-goals-column.home .goal-player-wrapper { align-items: flex-end; }
.kobit-expanded-goals-column.away .goal-player-wrapper { align-items: flex-start; }
.goal-assist {
    font-size: 11px;
    color: #757575;
}
.goal-assist i, .kobit-event-assist i {
    color: #2196F3;
    font-size: 10px;
    margin-right: 3px;
}
.goal-time { font-weight: 600; color: #757575; font-size: 12px; min-width: 20px; }
.goal-item .fa-futbol { font-size: 12px; color: #4CAF50; }
.goal-item .fa-futbol.own-goal { color: #F57C00; }

.kobit-full-details-link {
    text-align: center;
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 12px;
}
.kobit-btn-full-details {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #0057b8;
    text-decoration: none;
}
.kobit-btn-full-details:hover { text-decoration: underline; }
.kobit-loading-spinner { text-align: center; color: #757575; padding: 10px; }