﻿/* Gedian Sports — MatchDetails mobile-first lineup refinement (2026-11-09).
   Scoped overlay: does not alter other pages or any database functionality. */
.public-match-details-page {
    font-family: Tajawal, "Segoe UI", sans-serif !important;
    font-size: 10px;
}

    .public-match-details-page :is(button,input,select,textarea) {
        font-family: Tajawal,"Segoe UI",sans-serif;
    }
    /* Base typography requested at 10px; key scoreboard values remain visibly distinguished. */
    .public-match-details-page :is(.pmd-panel,.pmd-overview-facts,.pmd-scoreboard-facts,.pmd-pitch-caption,.pmd-staff-profile-list,.pmd-player-list) {
        font-size: 10px;
    }

    .public-match-details-page .pmd-scoreboard-facts-flat {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 8px 0 0 !important;
        margin: 8px 0 0 !important;
    }

        .public-match-details-page .pmd-scoreboard-facts-flat > div {
            background: transparent !important;
            box-shadow: none !important;
            border: 0 !important;
            border-radius: 0 !important;
            padding: 5px 8px !important;
        }
    /* Remove default width constraints from the pitch's outer layout. */
    .public-match-details-page .pmd-panel[data-pmd-panel="lineup"] {
        min-width: 0;
    }

    .public-match-details-page .pmd-pitch-scroll-hint {
        font-size: 10px;
        color: #637763;
        margin: 6px 2px;
    }

    .public-match-details-page .pmd-pitch-shell {
        width: 100%;
        min-width: 0;
        margin: 10px auto 0;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .public-match-details-page .pmd-football-pitch {
        position: relative;
        box-sizing: border-box;
        margin-inline: auto;
        width: min(100%, 720px);
        min-height: 810px;
        height: 810px;
        overflow: hidden;
    }

    .public-match-details-page .pmd-pitch-player {
        position: absolute;
        z-index: 2;
        width: 76px;
        max-width: 76px;
        box-sizing: border-box;
        transform: translate(-50%,-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 1px;
    }

    .public-match-details-page .pmd-pitch-photo {
        width: 40px;
        height: 40px;
        max-width: 40px;
        flex: 0 0 40px;
        border-radius: 50%;
        overflow: visible;
        position: relative;
    }

        .public-match-details-page .pmd-pitch-photo :is(img,i) {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }

    .public-match-details-page .pmd-pitch-player > strong {
        display: block;
        max-width: 100%;
        font-size: 10px;
        line-height: 1.12;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: white;
        text-shadow: 0 1px 3px #142c1c;
    }

    .public-match-details-page .pmd-pitch-player > small {
        font-size: 9px;
        line-height: 1.1;
    }
    /* Coach and staff photo dimensions are absolutely bounded, even if legacy CSS is broad. */
    .public-match-details-page .pmd-compact-person {
        display: grid;
        grid-template-columns: 24px 38px minmax(0,1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 7px 5px;
        min-width: 0;
        border-bottom: 1px solid #e5ece2;
        font-size: 10px;
    }

    .public-match-details-page .pmd-compact-staff {
        grid-template-columns: 38px minmax(0,1fr) auto;
    }

    .public-match-details-page .pmd-compact-order {
        text-align: center;
        color: #61705e;
        font-weight: 700;
    }

    .public-match-details-page .pmd-compact-avatar {
        display: inline-grid;
        place-items: center;
        width: 38px;
        height: 38px;
        max-width: 38px;
        max-height: 38px;
        min-width: 38px;
        min-height: 38px;
        overflow: hidden;
        flex: 0 0 38px;
        border-radius: 50%;
        background: #edf5e8;
        border: 1px solid #dbe8d5;
        text-decoration: none;
        color: #466f2d;
        font-weight: 800;
    }

        .public-match-details-page .pmd-compact-avatar img {
            display: block !important;
            width: 36px !important;
            height: 36px !important;
            min-width: 0 !important;
            max-width: 36px !important;
            min-height: 0 !important;
            max-height: 36px !important;
            aspect-ratio: 1/1;
            object-fit: cover !important;
            border-radius: 50% !important;
            margin: 0 !important;
            padding: 0 !important;
        }

            .public-match-details-page .pmd-compact-avatar img[hidden],
            .public-match-details-page .pmd-compact-avatar span[hidden] {
                display: none !important;
            }

        .public-match-details-page .pmd-compact-avatar span {
            font-size: 14px;
        }

    .public-match-details-page .pmd-compact-name {
        color: #263d27;
        font-weight: 700;
        text-decoration: none;
        min-width: 0;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }

    .public-match-details-page a.pmd-compact-name:hover {
        color: #5b8c3b;
        text-decoration: underline;
    }

    .public-match-details-page .pmd-compact-number {
        font-size: 12px;
        font-weight: 800;
        min-width: 22px;
        text-align: center;
    }

    .public-match-details-page .pmd-compact-role {
        color: #647264;
        font-size: 10px;
        text-align: left;
        max-width: 140px;
    }

    .public-match-details-page .pmd-lineup-staff-block {
        margin: 16px 0 0;
        padding: 12px;
        border-top: 1px solid #e3eade;
    }

        .public-match-details-page .pmd-lineup-staff-block .pmd-staff-columns {
            display: grid;
            grid-template-columns: repeat(2,minmax(0,1fr));
            gap: 12px;
        }

    .public-match-details-page .pmd-staff-profile-list, .public-match-details-page .pmd-player-list {
        min-width: 0;
    }

@media(max-width:700px) {
    .public-match-details-page .container {
        width: 100%;
        max-width: 100%;
        padding-inline: 5px !important;
    }

    .public-match-details-page .pmd-panel[data-pmd-panel="lineup"] {
        padding-inline: 4px !important;
        overflow: hidden;
    }

    .public-match-details-page .pmd-pitch-shell {
        margin-inline: 0;
        width: 100%;
    }
    /* Preserve field proportions rather than compressing 22 portraits into ~320px. */
    .public-match-details-page .pmd-football-pitch {
        width: 560px !important;
        min-width: 560px !important;
        max-width: none !important;
        height: 940px !important;
        min-height: 940px !important;
        margin-inline: 0;
    }

    .public-match-details-page .pmd-pitch-player {
        width: 82px;
        max-width: 82px;
    }

    .public-match-details-page .pmd-pitch-photo {
        width: 42px;
        height: 42px;
        max-width: 42px;
        flex-basis: 42px;
    }

    .public-match-details-page .pmd-lineup-columns {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .public-match-details-page .pmd-lineup-staff-block .pmd-staff-columns,
    .public-match-details-page .pmd-coach-columns {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .public-match-details-page .pmd-lineup-staff-block {
        padding-inline: 4px;
    }

    .public-match-details-page .pmd-compact-person {
        gap: 6px;
    }

    .public-match-details-page .pmd-compact-role {
        max-width: 110px;
    }
}

/* GEDIAN: horizontal pitch + parallel coaches + capsule team-roster switch */
.public-match-details-page .pmd-football-pitch.pmd-pitch-landscape {
    width: min(100%, 1080px) !important;
    min-width: 800px !important;
    max-width: none !important;
    height: 590px !important;
    min-height: 590px !important;
    direction: ltr;
    background: repeating-linear-gradient(90deg,#2e8245 0,#2e8245 90px,#28763d 90px,#28763d 180px) !important;
    border: 4px solid #f0faf1;
    border-radius: 12px;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.7);
}
/* Replace vertically aligned field markings with correct horizontal geometry. */
.public-match-details-page .pmd-pitch-landscape .pitch-half-line {
    position: absolute !important;
    inset: 0 auto 0 50% !important;
    left: 50% !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 2px !important;
    height: 100% !important;
    border: 0 !important;
    background: rgba(255,255,255,.76) !important;
    transform: translateX(-50%) !important;
}

.public-match-details-page .pmd-pitch-landscape .pitch-center-circle {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 120px !important;
    height: 120px !important;
    border: 2px solid rgba(255,255,255,.78) !important;
    border-radius: 50% !important;
    background: transparent !important;
    transform: translate(-50%,-50%) !important;
}

.public-match-details-page .pmd-pitch-landscape .pitch-box,
.public-match-details-page .pmd-pitch-landscape .pitch-goal-box {
    position: absolute !important;
    top: 50% !important;
    border: 2px solid rgba(255,255,255,.75) !important;
    background: transparent !important;
    transform: translateY(-50%) !important;
    border-radius: 0 !important;
}

.public-match-details-page .pmd-pitch-landscape .pitch-box {
    width: 14% !important;
    height: 55% !important;
}

.public-match-details-page .pmd-pitch-landscape .pitch-goal-box {
    width: 6% !important;
    height: 27% !important;
}

.public-match-details-page .pmd-pitch-landscape .pitch-box-top,
.public-match-details-page .pmd-pitch-landscape .pitch-goal-box-top {
    left: 0 !important;
    right: auto !important;
    border-left: 0 !important;
}

.public-match-details-page .pmd-pitch-landscape .pitch-box-bottom,
.public-match-details-page .pmd-pitch-landscape .pitch-goal-box-bottom {
    right: 0 !important;
    left: auto !important;
    border-right: 0 !important;
}

.public-match-details-page .pmd-pitch-landscape .pmd-pitch-half-label {
    position: absolute !important;
    top: 10px !important;
    bottom: auto !important;
    transform: none !important;
    max-width: 170px;
    z-index: 1;
    color: #fff;
    text-shadow: 0 1px 3px #1a3624;
}

    .public-match-details-page .pmd-pitch-landscape .pmd-pitch-half-label.is-away {
        left: 12px !important;
        right: auto !important;
    }

    .public-match-details-page .pmd-pitch-landscape .pmd-pitch-half-label.is-home {
        right: 12px !important;
        left: auto !important;
    }

.public-match-details-page .pmd-pitch-landscape .pmd-pitch-player {
    z-index: 3;
    width: 76px !important;
    max-width: 76px !important;
    direction: rtl;
    transform: translate(-50%,-50%) !important;
}

    .public-match-details-page .pmd-pitch-landscape .pmd-pitch-player > strong {
        font-size: 10px !important;
        white-space: nowrap;
        text-align: center;
    }

.public-match-details-page .pmd-coach-dual {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
    gap: 8px !important;
    direction: rtl;
}

    .public-match-details-page .pmd-coach-dual > article {
        min-width: 0;
        padding: 6px !important;
    }

    .public-match-details-page .pmd-coach-dual .pmd-compact-staff {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 5px !important;
        min-width: 0;
    }

    .public-match-details-page .pmd-coach-dual > article:nth-child(2) .pmd-compact-staff {
        flex-direction: row-reverse;
    }

    .public-match-details-page .pmd-coach-dual .pmd-compact-staff .pmd-compact-role {
        display: none;
    }

    .public-match-details-page .pmd-coach-dual .pmd-compact-name {
        flex: 1;
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: 10px;
    }

    .public-match-details-page .pmd-coach-dual .pmd-compact-avatar {
        flex: 0 0 38px;
    }

.public-match-details-page .pmd-team-roster-switch {
    margin-top: 14px;
    min-width: 0;
}

.public-match-details-page .pmd-team-switch-capsules {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 4px;
    padding: 4px;
    background: #eaf2e6;
    border-radius: 999px;
    border: 1px solid #dce8d7;
}

.public-match-details-page .pmd-team-switch {
    border: 0;
    border-radius: 999px;
    min-height: 40px;
    padding: 8px 10px;
    background: transparent;
    color: #42633a;
    font-family: Tajawal,"Segoe UI",sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    cursor: pointer;
    overflow-wrap: anywhere;
}

    .public-match-details-page .pmd-team-switch.is-active {
        background: #5B8C3B;
        color: white;
        box-shadow: 0 2px 6px #2c52272e;
    }

    .public-match-details-page .pmd-team-switch:focus-visible {
        outline: 2px solid #264b1e;
        outline-offset: 2px;
    }

.public-match-details-page .pmd-team-roster-panel {
    padding: 10px 4px;
    min-width: 0;
}

    .public-match-details-page .pmd-team-roster-panel[hidden] {
        display: none !important;
    }

    .public-match-details-page .pmd-team-roster-panel .pmd-squad-subheading {
        margin-top: 12px;
    }

@media(max-width:700px) {
    .public-match-details-page .pmd-football-pitch.pmd-pitch-landscape {
        width: 900px !important;
        min-width: 900px !important;
        height: 540px !important;
        min-height: 540px !important;
    }

    .public-match-details-page .pmd-coach-dual {
        grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
        gap: 4px !important;
    }

        .public-match-details-page .pmd-coach-dual > article {
            padding: 4px !important;
        }

        .public-match-details-page .pmd-coach-dual .pmd-staff-team-title {
            font-size: 10px;
        }

        .public-match-details-page .pmd-coach-dual .pmd-compact-avatar,
        .public-match-details-page .pmd-coach-dual .pmd-compact-avatar img {
            width: 30px !important;
            height: 30px !important;
            min-width: 30px !important;
            max-width: 30px !important;
            min-height: 30px !important;
            max-height: 30px !important;
            flex-basis: 30px !important;
        }

        .public-match-details-page .pmd-coach-dual .pmd-compact-staff {
            gap: 3px !important;
            padding: 5px 0;
        }

    .public-match-details-page .pmd-team-switch {
        font-size: 11px;
    }
}
