/* =========================
   Desktop rules + mobile gets compact, less data displayed in table
   ========================= */

body {
    font-family: 'Roboto Condensed', sans-serif;
}

.team-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: auto;
    height: auto;
}

.place-number {
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

.place-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.15rem 0.5rem;
    border-radius: 0.45rem;
    color: inherit;
    background: transparent;
    line-height: 1;
}

.place-badge--advancing {
    background: #0b4da3;
    color: #fff;
}

.team-name,
.match-team-name {
    overflow-wrap: anywhere;
}






/* =========================
   LAYOUT
   ========================= */
#groups-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.group-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    background-color: #212529;
    color: white;
    padding: 2rem;
    border-radius: 0;
    border-bottom: 1px solid #525252;
    box-sizing: border-box;
}

.group-header {
    display: block;
    margin-bottom: 0.75rem;
}

.group-title {
    color: #fff;
    font-size: 1.5rem;
    line-height: 1.2;
}

/* Desktop view visible by default */
.group-desktop-view {
    display: block;
}

/* Mobile view hidden by default */
.group-mobile-view {
    display: none;
}

/* Tables */
.group-card table {
    width: 100%;
    table-layout: auto;
}

.group-card td,
.group-card th {
    white-space: nowrap;
    vertical-align: middle;
    padding: 0.5rem;
}

/* Match desktop table */
.matches-table {
    margin-top: 0.5rem;
    width: 100%;
}

.match-team-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.matches-table th,
.matches-table td {
    vertical-align: middle;
}






/* Mobile toggle button hidden on desktop */
.group-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.group-toggle:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.group-toggle-icon {
    transition: transform 0.2s ease;
}

.group-toggle.is-open .group-toggle-icon {
    transform: rotate(180deg);
}









/* =========================
   MOBILE
   ========================= */
@media (max-width: 768px) {

    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    #groups-container {
        gap: 1.25rem;
    }

    .group-card {
        width: 100%;
        border-radius: 18px;
        padding: 1rem 0.75rem;
    }

    .group-title {
        font-size: 1.15rem;
        margin-bottom: 0;
    }

    .group-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.9rem;
    }

    .group-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        width: auto;
        padding: 0.7rem 0.9rem;
        font-size: 0.92rem;
    }

    .group-desktop-view {
        display: none;
    }

    .group-mobile-view {
        display: block;
        width: 100%;
    }

    .mobile-table-wrap {
        width: 100%;
        overflow-x: hidden;
    }

    .standings-table-mobile {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
    }

    .standings-table-mobile th,
    .standings-table-mobile td {
        font-size: 0.82rem;
        padding: 0.45rem 0.25rem;
        white-space: normal;
        vertical-align: middle;
    }

    .standings-table-mobile th:nth-child(1),
    .standings-table-mobile td:nth-child(1) {
        width: 12%;
        text-align: center;
    }

    .standings-table-mobile th:nth-child(2),
    .standings-table-mobile td:nth-child(2) {
        width: 42%;
    }

    .standings-table-mobile th:nth-child(3),
    .standings-table-mobile td:nth-child(3) {
        width: 12%;
        text-align: center;
    }

    .standings-table-mobile th:nth-child(4),
    .standings-table-mobile td:nth-child(4) {
        width: 20%;
        text-align: center;
    }

    .standings-table-mobile th:nth-child(5),
    .standings-table-mobile td:nth-child(5) {
        width: 14%;
        text-align: center;
    }

    .mobile-team-cell {
        display: inline-flex;
        align-items: flex-start;
        gap: 0.4rem;
        min-width: 0;
        max-width: 100%;
    }

    .mobile-team-name {
        min-width: 0;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .mobile-flag {
        flex: 0 0 auto;
        border-radius: 2px;
        margin-top: 0.12rem;
    }

    .mobile-match-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 0.9rem;
    }

    .match-tile {
        background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        padding: 0.95rem 0.85rem;
        text-align: center;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    }

    .match-date {
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #b8c4d4;
        margin-bottom: 0.3rem;
    }

    .match-time {
        font-size: 0.92rem;
        font-weight: 700;
        color: #ffffff;
        margin-bottom: 0.75rem;
    }

    .match-team-row {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        width: 100%;
        text-align: center;
        line-height: 1.2;
        font-weight: 600;
        min-height: 1.6rem;
        margin: 0 auto;
    }

    .match-team-row .match-team-name {
        text-align: center;
        overflow-wrap: anywhere;
        min-width: 0;
        max-width: 100%;
        line-height: 1.2;
    }

    .match-flag {
        flex: 0 0 auto;
        border-radius: 2px;
        margin-top: 0.12rem;
    }

    .match-vs {
        margin: 0.4rem 0;
        font-weight: 700;
        letter-spacing: 0.04em;
        color: rgba(255, 255, 255, 0.75);
    }

    .match-status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-top: 0.75rem;
        padding: 0.22rem 0.7rem;
        border-radius: 999px;
        font-size: 0.75rem;
        font-weight: 700;
    }

    .match-status.is-upcoming {
        background: rgba(255, 255, 255, 0.08);
        color: #e3edf7;
    }

    .match-status.is-finished {
        background: rgba(11, 77, 163, 0.2);
        color: #9fc7ff;
    }

    .mobile-empty {
        margin-top: 0.9rem;
        color: rgba(255, 255, 255, 0.72);
        font-size: 0.92rem;
    }
}