.bracket-page {
    min-height: 100vh;
    padding: 128px 0 72px;
    overflow-x: clip;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 8%, rgba(6, 72, 201, .18), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(227, 6, 44, .15), transparent 32%),
        linear-gradient(180deg, #f7f9ff 0%, #edf2ff 100%);
}

.bracket-page,
.bracket-page * {
    box-sizing: border-box;
}

.bracket-page .container {
    min-width: 0;
}

html.dark-mode .bracket-page {
    background:
        radial-gradient(circle at 18% 8%, rgba(6, 72, 201, .34), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(227, 6, 44, .24), transparent 32%),
        linear-gradient(180deg, #020817 0%, #061332 100%);
}

.bracket-hero {
    position: relative;
    display: grid;
    gap: 22px;
    margin-bottom: 28px;
    padding: clamp(24px, 4vw, 44px);
    overflow: hidden;
    border: 1px solid rgba(6, 59, 143, .12);
    border-radius: 28px;
    background: rgba(255, 255, 255, .76);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
}

html.dark-mode .bracket-hero,
html.dark-mode .bracket-card,
html.dark-mode .knockout {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.bracket-eyebrow {
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.bracket-hero h1 {
    margin: 0;
    color: var(--blue-dark);
    font-size: clamp(38px, 5vw, 72px);
    line-height: .95;
    text-transform: uppercase;
}

html.dark-mode .bracket-hero h1 {
    color: var(--white);
}

.bracket-meta {
    color: var(--text-light);
    font-size: 18px;
    font-weight: 700;
}

html.dark-mode .bracket-meta {
    color: rgba(255,255,255,.72);
}

.tournament-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tournament-tabs button {
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(6, 59, 143, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.tournament-tabs button.active,
.tournament-tabs button:hover {
    border-color: var(--red);
    color: var(--white);
    background: linear-gradient(135deg, var(--red), #b80022);
    transform: translateY(-1px);
}

html.dark-mode .tournament-tabs button {
    border-color: rgba(255,255,255,.14);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.86);
}

.status,
.empty {
    padding: 18px;
    border: 1px solid rgba(6, 59, 143, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .66);
    color: var(--text-light);
    font-weight: 800;
}

html.dark-mode .status,
html.dark-mode .empty {
    border-color: rgba(255,255,255,.10);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.72);
}

.groups {
    display: grid;
    gap: 24px;
}

.bracket-card,
.knockout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid rgba(6, 59, 143, .12);
    border-radius: 24px;
    background: rgba(255, 255, 255, .74);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
}

.bracket-card h2,
.knockout h2 {
    margin: 0 0 18px;
    color: var(--blue-dark);
    font-size: clamp(26px, 3vw, 38px);
    text-transform: uppercase;
}

html.dark-mode .bracket-card h2,
html.dark-mode .knockout h2 {
    color: var(--white);
}

.section-title {
    margin: 24px 0 12px;
    color: var(--red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid rgba(6, 59, 143, .10);
    border-radius: 18px;
}

html.dark-mode .table-wrap {
    border-color: rgba(255,255,255,.10);
}

.standings-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    table-layout: auto;
}

.standings-table th,
.standings-table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(6, 59, 143, .08);
    text-align: left;
    white-space: nowrap;
}

html.dark-mode .standings-table th,
html.dark-mode .standings-table td {
    border-bottom-color: rgba(255,255,255,.08);
}

.standings-table th {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.standings-table td {
    color: var(--blue-dark);
    font-weight: 800;
}

html.dark-mode .standings-table td {
    color: rgba(255,255,255,.9);
}

.team-cell {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.standings-team-text,
.standings-team-name {
    min-width: 0;
}

.standings-team-name {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.standing-rank {
    flex: 0 0 auto;
}

.mobile-standings-stats {
    display: none;
}

.team-logo,
.team-placeholder {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
}

.team-logo {
    object-fit: contain;
    padding: 4px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(6, 59, 143, .12);
}

.team-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue), var(--red));
    font-size: 11px;
    font-weight: 900;
}

.matches {
    display: grid;
    min-width: 0;
    gap: 12px;
}

.match {
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(120px, auto);
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(6, 59, 143, .10);
    border-radius: 18px;
    background: rgba(255,255,255,.58);
}

html.dark-mode .match {
    border-color: rgba(255,255,255,.10);
    background: rgba(255,255,255,.07);
}

.match-team {
    display: flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 10px;
}

.match-team-a {
    justify-content: flex-end;
    text-align: right;
}

.match-team-name {
    min-width: 0;
    overflow: hidden;
    color: var(--blue-dark);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.dark-mode .match-team-name {
    color: var(--white);
}

.score {
    min-width: 78px;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(135deg, var(--red), #b90024);
    font-family: var(--font-heading-family);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.match-meta {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

html.dark-mode .match-meta {
    color: rgba(255,255,255,.58);
}

.match-set-detail {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}

.match-set-detail span {
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--text-light);
    background: rgba(6, 59, 143, .08);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

html.dark-mode .match-set-detail span {
    color: rgba(255,255,255,.72);
    background: rgba(255,255,255,.08);
}

@media (max-width: 980px) {
    .bracket-page {
        padding-top: 104px;
    }

    .match {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .match-meta {
        grid-column: 1 / -1;
        text-align: center;
    }
}

@media (max-width: 720px) {
    .bracket-page {
        padding-bottom: 42px;
        overflow-x: hidden;
    }

    .bracket-hero,
    .bracket-card,
    .knockout {
        border-radius: 20px;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .standings-table {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .standings-table thead {
        display: none;
    }

    .standings-table tbody {
        display: grid;
        gap: 10px;
        width: 100%;
    }

    .standings-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        width: 100%;
        min-width: 0;
        padding: 12px;
        border: 1px solid rgba(6, 59, 143, .10);
        border-radius: 16px;
        background: rgba(255,255,255,.54);
    }

    html.dark-mode .standings-table tr {
        border-color: rgba(255,255,255,.10);
        background: rgba(255,255,255,.06);
    }

    .standings-table th,
    .standings-table td {
        padding: 0;
        border-bottom: 0;
        white-space: normal;
    }

    .standings-table td {
        display: none;
    }

    .standings-table td:first-child {
        display: block;
        min-width: 0;
    }

    .standings-table td:first-child {
        overflow: hidden;
    }

    .standings-table td:nth-child(9) {
        display: none;
    }

    .team-cell {
        display: flex;
        width: 100%;
        overflow: hidden;
    }

    .standings-team-text {
        display: grid;
        min-width: 0;
        gap: 3px;
    }

    .standings-team-name {
        display: block;
        overflow: hidden;
        font-size: 15px;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-standings-stats {
        display: grid;
        width: 100%;
        overflow: hidden;
        border: 1px solid rgba(6, 59, 143, .10);
        border-radius: 11px;
        font-size: 12px;
        font-weight: 900;
        line-height: 1.15;
    }

    .mobile-standings-head,
    .mobile-standings-values {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        min-width: 0;
        text-align: center;
    }

    .mobile-standings-head span,
    .mobile-standings-values span {
        min-width: 0;
        padding: 6px 3px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-standings-head {
        color: var(--red);
        background: rgba(227, 6, 44, .12);
        text-transform: uppercase;
    }

    .mobile-standings-values {
        color: var(--white);
        background: var(--blue-dark);
    }

    html.dark-mode .mobile-standings-stats {
        border-color: rgba(255,255,255,.10);
    }

    html.dark-mode .mobile-standings-head {
        background: rgba(227, 6, 44, .18);
    }

    html.dark-mode .mobile-standings-values {
        background: rgba(4, 17, 42, .92);
    }

    .match {
        grid-template-columns: minmax(0, 1fr) minmax(54px, auto) minmax(0, 1fr);
        gap: 8px;
        padding: 11px;
    }

    .match-team {
        gap: 7px;
    }

    .team-logo,
    .team-placeholder {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .match-team-name {
        font-size: 14px;
    }

    .score {
        min-width: 54px;
        padding: 7px 9px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .bracket-page {
        padding-top: 96px;
    }

    .bracket-hero {
        padding: 20px;
    }

    .bracket-card,
    .knockout {
        padding: 14px;
    }

    .tournament-tabs button {
        flex: 1 1 100%;
    }

    .match {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        padding: 10px;
        border-radius: 15px;
    }

    .match-team-name {
        font-size: 12px;
    }

    .team-logo,
    .team-placeholder {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        font-size: 9px;
    }

    .score {
        min-width: 48px;
        padding: 6px 7px;
        font-size: 13px;
    }

    .standings-table tr {
        padding: 10px;
    }

    .standings-team-name {
        font-size: 13px;
    }

    .mobile-standings-stats {
        font-size: 11px;
    }

    .match-meta {
        font-size: 12px;
    }
}
