/* ==========================================================================
   فريق الجولة — صفحة مستقلة، ثيم لايت/دارك
   ========================================================================== */

.round-xi-page {
    --rx-page: #0e1019;
    --rx-card: #151825;
    --rx-card-2: #191d2d;
    --rx-border: #1e2235;
    --rx-text: #f4f5f8;
    --rx-muted: #8b90a5;
    --rx-accent: #39dbbf;
    --rx-accent-2: #5bd286;
    --rx-gold: #ffc420;
    --rx-gold-bg: rgba(255, 196, 32, 0.14);
    --rx-chip: #191d2d;
    --rx-chip-on: #39dbbf;
    --rx-chip-on-text: #0e1019;
    --rx-pitch-a: #0c3d2c;
    --rx-pitch-b: #146b48;
    --rx-pitch-line: rgba(255, 255, 255, 0.28);
    --rx-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    background: var(--rx-page);
    color: var(--rx-text);
    padding: 0 0 48px;
}

html.light .round-xi-page {
    --rx-page: #f4f6fb;
    --rx-card: #ffffff;
    --rx-card-2: #f7f8fc;
    --rx-border: #e6eaf3;
    --rx-text: #131521;
    --rx-muted: #6b7085;
    --rx-accent: #0ea58d;
    --rx-accent-2: #17a35a;
    --rx-gold: #c88800;
    --rx-gold-bg: rgba(200, 136, 0, 0.12);
    --rx-chip: #ffffff;
    --rx-chip-on: #0ea58d;
    --rx-chip-on-text: #ffffff;
    --rx-pitch-a: #1b7a4d;
    --rx-pitch-b: #24915c;
    --rx-pitch-line: rgba(255, 255, 255, 0.42);
    --rx-shadow: 0 12px 32px rgba(19, 21, 33, 0.08);
}

@media (prefers-color-scheme: light) {
    html:not(.dark) .round-xi-page {
        --rx-page: #f4f6fb;
        --rx-card: #ffffff;
        --rx-card-2: #f7f8fc;
        --rx-border: #e6eaf3;
        --rx-text: #131521;
        --rx-muted: #6b7085;
        --rx-accent: #0ea58d;
        --rx-chip-on: #0ea58d;
        --rx-chip-on-text: #ffffff;
        --rx-pitch-a: #1b7a4d;
        --rx-pitch-b: #24915c;
    }
}

.round-xi-page .container {
    max-width: 980px;
}

.round-xi-hero {
    position: relative;
    overflow: hidden;
    padding: 22px 0 8px;
}

.round-xi-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(57, 219, 191, 0.16), transparent 70%);
    pointer-events: none;
}

html.light .round-xi-hero::before {
    background: radial-gradient(circle, rgba(14, 165, 141, 0.12), transparent 70%);
}

.round-xi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    position: relative;
}

.round-xi-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--rx-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.round-xi-back:hover {
    color: var(--rx-accent);
}

.round-xi-back svg {
    width: 8px;
    height: 14px;
    flex: none;
}

.round-xi-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.round-xi-identity img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: var(--rx-card);
    border: 1px solid var(--rx-border);
    border-radius: 16px;
    padding: 6px;
}

.round-xi-kicker {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rx-accent);
}

.round-xi-identity h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.25;
    color: var(--rx-text);
}

.round-xi-meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--rx-muted);
}

.round-xi-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.round-xi-stat {
    background: var(--rx-card);
    border: 1px solid var(--rx-border);
    border-radius: 12px;
    padding: 8px 12px;
    min-width: 72px;
    text-align: center;
}

.round-xi-stat b {
    display: block;
    font-size: 16px;
    font-weight: 900;
    color: var(--rx-accent);
    line-height: 1.2;
}

.round-xi-stat span {
    font-size: 11px;
    color: var(--rx-muted);
    font-weight: 700;
}

.round-xi-rounds {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 0 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.round-xi-rounds::-webkit-scrollbar {
    display: none;
}

.round-xi-chip {
    flex: none;
    border: 1px solid var(--rx-border);
    background: var(--rx-chip);
    color: var(--rx-text);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

.round-xi-chip.is-on,
.round-xi-chip[aria-pressed="true"] {
    background: var(--rx-chip-on);
    border-color: var(--rx-chip-on);
    color: var(--rx-chip-on-text);
}

.round-xi-highlights {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.round-xi-card {
    background: var(--rx-card);
    border: 1px solid var(--rx-border);
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: var(--rx-shadow);
}

.round-xi-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--rx-muted);
    margin-bottom: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.round-xi-star {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rx-gold-bg);
    color: var(--rx-gold);
    font-size: 15px;
}

.round-xi-motm,
.round-xi-coach {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.round-xi-motm img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--rx-card-2);
    flex: none;
}

.round-xi-coach > a:first-child img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--rx-card-2);
    display: block;
}

.round-xi-coach-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--rx-card);
    border: 2px solid var(--rx-card);
    margin-inline-start: -18px;
    margin-top: 36px;
    position: relative;
    z-index: 1;
}

.round-xi-motm .text,
.round-xi-coach .text {
    min-width: 0;
    flex: 1;
}

.round-xi-motm h2,
.round-xi-coach h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    color: var(--rx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.round-xi-motm p,
.round-xi-coach p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--rx-muted);
}

.round-xi-rating {
    flex: none;
    min-width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    background: var(--rx-gold-bg);
    color: var(--rx-gold);
    border: 2px solid rgba(255, 196, 32, 0.35);
}

.round-xi-coach-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--rx-card);
    border: 2px solid var(--rx-card);
    margin-inline-start: -22px;
    margin-top: 36px;
}

.round-xi-pitch-wrap {
    background: var(--rx-card);
    border: 1px solid var(--rx-border);
    border-radius: 22px;
    padding: 12px;
    box-shadow: var(--rx-shadow);
    margin-bottom: 18px;
}

.round-xi-page .teams-lineup .lineup-wrap,
.round-xi-page .lineup-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 18%),
        repeating-linear-gradient(
            180deg,
            var(--rx-pitch-a) 0 48px,
            var(--rx-pitch-b) 48px 96px
        );
    background-image: none;
    aspect-ratio: 9 / 11;
    min-height: 520px;
}

.round-xi-page .lineup-wrap::before,
.round-xi-page .lineup-wrap::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border: 2px solid var(--rx-pitch-line);
    box-sizing: border-box;
}

.round-xi-page .lineup-wrap::before {
    inset: 10px;
    border-radius: 8px;
}

.round-xi-page .lineup-wrap::after {
    left: 50%;
    top: 50%;
    width: 22%;
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.round-xi-midline {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 50%;
    height: 2px;
    background: var(--rx-pitch-line);
    pointer-events: none;
    z-index: 1;
}

.round-xi-page .lineup-wrapper {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 6px 12px;
}

.round-xi-page .lineup-bg {
    display: none !important;
}

.round-xi-page .lineup-player-item .player-name h3 {
    color: #fff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    font-size: 11px !important;
    font-weight: 800;
}

.round-xi-page .lineup-player-item .img {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.round-xi-page .team_cap img {
    width: 22px !important;
    height: 22px;
    display: block !important;
    background: #fff;
    border-radius: 50%;
}

.round-xi-page .lineup-custom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 0 2px;
}

.round-xi-page .lineup-custom-row .logo img {
    height: 16px;
    opacity: 0.85;
}

.round-xi-page .lineup-text {
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.round-xi-list {
    background: var(--rx-card);
    border: 1px solid var(--rx-border);
    border-radius: 18px;
    overflow: hidden;
}

.round-xi-list h3 {
    margin: 0;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 900;
    border-bottom: 1px solid var(--rx-border);
}

.round-xi-list a {
    display: grid;
    grid-template-columns: 36px 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--rx-text);
    border-bottom: 1px solid var(--rx-border);
}

.round-xi-list a:last-child {
    border-bottom: 0;
}

.round-xi-list a:hover {
    background: var(--rx-card-2);
}

.round-xi-list .n {
    font-weight: 900;
    color: var(--rx-muted);
    text-align: center;
}

.round-xi-list img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--rx-card-2);
}

.round-xi-list .nm {
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.round-xi-list .rt {
    font-weight: 900;
    color: var(--rx-accent);
}

.round-xi-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--rx-muted);
}

#champ_lineup_round.round-xi-select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

@media (max-width: 767px) {
    .round-xi-highlights {
        grid-template-columns: 1fr;
    }

    .round-xi-identity h1 {
        font-size: 18px;
    }

    .round-xi-page .teams-lineup .lineup-wrap,
    .round-xi-page .lineup-wrap {
        min-height: 560px;
        aspect-ratio: 3 / 4;
    }

    .round-xi-hero > .container {
        display: flex;
        flex-direction: column;
    }

    .round-xi-identity {
        order: 1;
    }

    .round-xi-top {
        order: 2;
        margin-top: 12px;
    }

    .round-xi-rounds {
        order: 3;
    }
}
