.page-opponents .container {
    width: min(1460px, calc(100% - 2rem));
}

.match-discovery-surface {
    padding: 0.94rem 1rem 1rem;
    border: 0;
    box-shadow: 0 18px 42px rgba(19, 33, 50, 0.08);
}

.match-header {
    display: grid;
    gap: 0.42rem;
}

.match-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.match-title-row .page-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.match-stat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.26rem;
}

.match-stat-badges .chip {
    font-size: 0.66rem;
    padding: 0.22rem 0.46rem;
}

.match-search-form {
    display: grid;
    gap: 0.58rem;
}

.match-filter-grid {
    display: grid;
    gap: 0.42rem;
    grid-template-columns: minmax(0, 1fr);
}

.match-search-form .field {
    gap: 0.24rem;
}

.match-search-form label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--ink-500);
}

.match-search-form input,
.match-search-form select {
    min-height: 46px;
    padding: 0.58rem 0.72rem;
    border-color: color-mix(in srgb, var(--ui-border) 85%, #ffffff);
    background: #fff;
}

.match-search-form input:disabled {
    cursor: not-allowed;
    color: var(--ink-500);
    background: #f3f6f9;
}

.match-discovery-surface .section-subtitle {
    margin-top: 0.2rem;
    font-size: 0.95rem;
    line-height: 1.24;
}

#team-search-form.mt-2 {
    margin-top: 0.44rem !important;
}

.match-advanced {
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--ui-border) 88%, #ffffff);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #fbfcfd 0%, #f6f8fb 100%);
    padding: 0.5rem 0.68rem 0.58rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.match-advanced > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    color: var(--ui-text);
    list-style: none;
}

.match-advanced > summary::-webkit-details-marker {
    display: none;
}

.match-advanced > summary::after {
    content: "+";
    color: var(--teal-600);
    font-size: 1rem;
    line-height: 1;
    font-weight: 700;
}

.match-advanced[open] > summary::after {
    content: "-";
}

.match-advanced.mt-1 {
    margin-top: 0.26rem !important;
}

.match-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.48rem;
}

.match-form-actions .btn {
    min-height: 40px;
    padding: 0.42rem 0.74rem;
}

.match-form-actions.mt-2 {
    margin-top: 0.44rem !important;
}

#search-team-btn {
    min-width: 214px;
}

#reset-team-search-btn {
    min-width: 112px;
}

.match-layout {
    display: grid;
    gap: 0.92rem;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
}

.match-panel {
    display: grid;
    gap: 0.7rem;
    align-content: start;
    padding: 1.2rem 1.2rem 1.35rem;
    border: 0;
    box-shadow: 0 22px 46px rgba(15, 28, 43, 0.08);
}

.match-panel > .card-title-row {
    align-items: center;
}

.match-result-grid {
    display: grid;
    gap: 0.95rem;
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
}

.match-search-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.match-card {
    border-radius: var(--radius-md);
    border: 1px solid color-mix(in srgb, var(--teal-500) 18%, var(--ui-border));
    background: linear-gradient(180deg, #ffffff 0%, #fafdff 100%);
    box-shadow: 0 14px 28px rgba(20, 36, 56, 0.06);
    padding: 0.88rem 0.94rem;
    display: flex;
    flex-direction: column;
    gap: 0.56rem;
    min-height: 100%;
}

.match-card-ready {
    border-color: color-mix(in srgb, var(--teal-500) 28%, var(--ui-border));
}

.match-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.match-card h3 {
    margin: 0;
    font-size: 1.38rem;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.match-teams {
    display: grid;
    gap: 0.26rem;
    min-width: 0;
    flex: 1 1 0;
}

.match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.44rem;
}

.match-kpi-row {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.match-kpi {
    border: 0;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #eef4fa 0%, #e8eff7 100%);
    padding: 0.48rem 0.55rem;
    display: grid;
    gap: 0.12rem;
}

.match-kpi-label {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-500);
    font-weight: 700;
}

.match-kpi-value {
    font-size: 1rem;
    color: var(--ink-900);
    font-weight: 800;
}

.match-card-note {
    margin-top: 0.04rem;
    line-height: 1.25;
    font-size: 0.79rem;
}

.match-card-actions {
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 0.28rem;
}

.match-card .row .btn {
    min-height: 46px;
    width: 100%;
    justify-content: center;
    padding: 0.58rem 0.95rem;
    font-size: 0.95rem;
}

.match-request-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1400;
    width: min(32rem, calc(100vw - 2rem));
    padding: 0.9rem 1.1rem;
    border-radius: 0.95rem;
    background: rgba(12, 31, 45, 0.96);
    color: #ffffff;
    box-shadow: 0 22px 54px rgba(10, 18, 28, 0.36);
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.96);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.match-request-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.match-meta .chip {
    font-size: 0.78rem;
    padding: 0.34rem 0.62rem;
    border: 0;
    background: #f1f5f9;
    color: #35516d;
}

.match-card-head .chip {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 0.78rem;
    padding: 0.34rem 0.62rem;
}

.player-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.player-pill {
    border-radius: var(--radius-pill);
    border: 1px solid color-mix(in srgb, var(--green-500) 38%, var(--border));
    background: color-mix(in srgb, var(--green-500) 12%, transparent);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.22rem 0.52rem;
}

.player-pill-btn {
    cursor: pointer;
}

@media (min-width: 768px) {
    .match-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .match-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .match-header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 0.72rem;
    }

    .match-stat-badges {
        justify-content: flex-end;
    }
}

@media (min-width: 1100px) {
    .match-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .match-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 1280px) {
    .match-filter-grid-primary {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .match-result-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1360px) {
    .match-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .page-opponents .container {
        width: min(100%, calc(100% - 1rem));
    }

    .match-discovery-surface {
        padding: 0.68rem 0.72rem 0.74rem;
    }

    .match-header {
        gap: 0.32rem;
    }

    .match-title-row {
        align-items: flex-start;
    }

    .match-title-row .page-title {
        font-size: 1.52rem;
    }

    .match-discovery-surface .section-subtitle {
        font-size: 0.88rem;
        line-height: 1.22;
    }

    .match-stat-badges {
        gap: 0.22rem;
    }

    .match-stat-badges .chip {
        font-size: 0.62rem;
        padding: 0.18rem 0.42rem;
    }

    .match-search-form {
        gap: 0.5rem;
    }

    .match-filter-grid {
        gap: 0.36rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .match-search-form input,
    .match-search-form select {
        min-height: 42px;
        padding: 0.48rem 0.6rem;
    }

    .match-search-form .field:nth-child(3),
    .match-search-form .field:nth-child(4) {
        grid-column: span 1;
    }

    .match-advanced {
        padding: 0.44rem 0.58rem 0.5rem;
    }

    .match-filter-grid-advanced {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .match-form-actions {
        justify-content: stretch;
        gap: 0.36rem;
    }

    .match-form-actions .btn {
        width: 100%;
        min-height: 42px;
        padding: 0.5rem 0.72rem;
    }

    .match-search-pagination {
        justify-content: stretch;
    }

    .match-search-pagination .btn {
        width: 100%;
    }

    .match-kpi-row {
        gap: 0.34rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .match-panel {
        padding: 0.84rem 0.82rem 0.92rem;
        gap: 0.58rem;
    }

    .match-result-grid {
        gap: 0.58rem;
    }

    .match-card {
        padding: 0.68rem 0.72rem;
        gap: 0.42rem;
        border-radius: 0.88rem;
    }

    .match-card-head {
        gap: 0.42rem;
    }

    .match-card h3 {
        font-size: 1.08rem;
        line-height: 1.16;
    }

    .match-card-head .chip,
    .match-meta .chip {
        font-size: 0.68rem;
        padding: 0.24rem 0.46rem;
    }

    .match-kpi {
        padding: 0.38rem 0.42rem;
        border-radius: 0.76rem;
    }

    .match-kpi-value {
        font-size: 0.86rem;
    }

    .match-card-actions {
        padding-top: 0.14rem;
    }

    .match-card .row .btn {
        min-height: 40px;
        padding: 0.5rem 0.72rem;
        font-size: 0.84rem;
    }
}
