* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    margin: 0;
    background: #f3f4f6;
    color: #111827;
}

/* HEADER */
.topbar {
    background: #111827;
    color: #fff;
    padding: 14px;
    font-weight: 700;
    font-size: 18px;
}

/* LEAGUE NAV */
.league-nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
    background: #fff;
}

.league-nav button {
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    background: #e5e7eb;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.league-nav button.active {
    background: #e10600;
    color: #fff;
}

/* TABS */
.tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.tabs .tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.tabs .tab.active {
    color: #e10600;
    border-bottom: 3px solid #e10600;
}

/* CONTENT */
.content {
    padding: 10px;
}

/* MATCH CARD */
.match-card {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.match-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.match-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
}

.match-row strong {
    font-weight: 600;
}

@media(max-width:768px){
    .match-row {
        font-size: 13px;
    }
}

.score {
    font-weight: 700;
}

/* STANDINGS */
.standings {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.standings-row {
    display: grid;
    grid-template-columns: 30px 1fr 40px 40px;
    padding: 8px;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.standings-row.head {
    background: #111827;
    color: #fff;
    font-weight: 700;
}

/* DESKTOP */
@media (min-width: 768px) {
    .content {
        max-width: 900px;
        margin: auto;
    }

    .league-nav {
        justify-content: center;
    }
}

.liga-tabs .nav-link {
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
}

.card {
    border-radius: 10px;
}

@media (max-width: 768px) {
    .card-body {
        font-size: 13px;
    }
}


/* WRAPPER */
.table-wrapper {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

/* HEADER */
.table-head {
    display: grid;
    grid-template-columns: 1fr 140px 1fr;
    padding: 10px;
    font-weight: 600;
    background: #f8f9fa;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* BODY */
.table-body {
    max-height: 420px; /* SCROLL */
    overflow-y: auto;
}

/* ROW */
.table-row {
    display: grid;
    grid-template-columns: 1fr 140px 1fr;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.table-row:hover {
    background: #f9fafb;
}

/* TEAM */
.team {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.team.left {
    justify-content: start;
}
.team.right {
    justify-content: flex-end;
}

/* TIME */
.time {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

/* MOBILE */
@media(max-width:768px){
    .table-head,
    .table-row {
        grid-template-columns: 1fr 90px 1fr;
        font-size: 12px;
    }

    .team span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 90px;
    }

    .table-body {
        max-height: 360px;
    }
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 13px;
}

.filter-bar input[type="text"] {
    flex: 1;
}

/* MOBILE */
@media(max-width:768px){
    .filter-bar {
        gap: 6px;
    }
}

/* ===== TABLE BASE ===== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
}

.table-head {
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.table-row {
    font-size: 14px;
}

/* TEAM */
.team {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
}

.team img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.team span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* CENTER */
.time,
.score {
    text-align: center;
    font-weight: 600;
}

/* ================= MOBILE ================= */
@media (max-width: 576px) {

    .table-head {
        display: none;
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: 6px;
        text-align: center;
        padding: 12px 8px;
    }

    .team {
        justify-content: center;
        white-space: normal;
    }

    .team.left {
        flex-direction: row;
    }

    .team.right {
        flex-direction: row-reverse;
    }

    .time,
    .score {
        font-size: 14px;
        color: #e10600;
    }
}

/* ===== KLASMEN ===== */
.klasemen .table-head,
.klasemen .table-row {
    grid-template-columns: 40px 1.5fr 50px 50px 50px 120px;
}

.form {
    display: flex;
    gap: 4px;
}

.form .f {
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    color: #fff;
}

.form .win  { background: #2ecc71; }
.form .lose { background: #e74c3c; }
.form .draw { background: #95a5a6; }

/* ================= MOBILE ================= */
@media (max-width: 576px) {

    .klasemen .table-row {
        grid-template-columns: 1fr;
        gap: 6px;
        text-align: center;
        padding: 12px 8px;
    }

    .klasemen .table-head {
        display: none;
    }

    .klasemen .team {
        justify-content: center;
        font-weight: 600;
    }

    .klasemen .form {
        justify-content: center;
    }

    .klasemen .table-row > div {
        font-size: 13px;
    }
}


