/* Shared player-card appearance for the lineup, transfers and team pages. */
:root {
    --player-card-ink: #172033;
    --player-card-muted: #7b8594;
    --player-card-outline: rgba(255, 255, 255, .74);
    --player-card-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}

.pitch-player.GK, .bench-player.GK { --player-accent: #1da66c; --player-accent-soft: rgba(29, 166, 108, .12); }
.pitch-player.DEF, .bench-player.DEF { --player-accent: #3d80df; --player-accent-soft: rgba(61, 128, 223, .12); }
.pitch-player.MID, .bench-player.MID { --player-accent: #3472cf; --player-accent-soft: rgba(52, 114, 207, .12); }
.pitch-player.ATT, .bench-player.ATT { --player-accent: #e35a4e; --player-accent-soft: rgba(227, 90, 78, .12); }

/* Pitch cards: shirt portrait first, with clear name and fixture labels. */
.pitch-player {
    --player-accent: #218457;
    --player-accent-soft: rgba(33, 132, 87, .12);
    position: absolute;
    width: clamp(calc(var(--u, 10px) * 9.6), calc(var(--u, 10px) * 11), 148px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: calc(var(--u, 10px) * .35);
    overflow: visible;
    border: 1px solid rgba(208, 238, 218, .72);
    border-radius: calc(var(--u, 10px) * 1.1);
    background: linear-gradient(155deg, rgba(21, 91, 54, .96), rgba(13, 67, 43, .98));
    color: #fff;
    font-size: var(--u, 10px);
    text-align: center;
    box-shadow: 0 7px 18px rgba(0, 25, 11, .28), inset 0 1px 0 rgba(255,255,255,.16);
    cursor: pointer;
    user-select: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.pitch-line .pitch-player { position: relative; transform: none; }
.pitch-line .pitch-player:hover { transform: translateY(-4px) scale(1.025); border-color: color-mix(in srgb, var(--player-accent) 50%, white); box-shadow: 0 10px 22px rgba(0,0,0,.3); }

.pitch-player-avatar {
    width: 100%;
    height: clamp(38px, calc(var(--u, 10px) * 4), 54px);
    margin: 0 0 calc(var(--u, 10px) * .28);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 0;
    border-radius: calc(var(--u, 10px) * .75) calc(var(--u, 10px) * .75) 3px 3px;
    background: radial-gradient(ellipse at 50% 78%, rgba(225,255,234,.25), transparent 67%);
    color: #fff;
    font-size: calc(var(--u, 10px) * 1.25);
    font-weight: 800;
}

.pitch-player-avatar img { width: 100%; height: 100%; border-radius: 0; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 3px 4px rgba(0,0,0,.22)); }
.bench-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center 16%; }
.pitch-player-avatar.GK, .pitch-player-avatar.DEF, .pitch-player-avatar.MID, .pitch-player-avatar.ATT { background: var(--player-accent-soft); }

/* Non-goalkeepers wear the club kit; keep only the white surname/opponent label. */
.pitch-player.shirt-kit-player {
    gap: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.pitch-line .pitch-player.shirt-kit-player:hover,
.pitch-player.shirt-kit-player:has(.captain-badge),
.pitch-player.shirt-kit-player:has(.vice-captain-badge) {
    border: 0;
    background: transparent;
    box-shadow: none;
}
.pitch-player-avatar.is-kit {
    width: 100%;
    height: clamp(62px, calc(var(--u, 10px) * 7.4), 100px);
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent !important;
}
.pitch-player-avatar.is-kit img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: translateY(7px) scale(1.12);
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .16));
}
.pitch-player-avatar.GK.is-kit img { transform: translateY(5px) scale(.9); }
.pitch-player.shirt-kit-player .pitch-player-name {
    position: relative;
    z-index: 2;
    min-height: 1.8em;
    margin-top: -8px;
    padding: calc(var(--u, 10px) * .25) calc(var(--u, 10px) * .35);
    border-radius: 4px 4px 0 0;
}
.pitch-player.shirt-kit-player .pitch-player-fixture {
    border-radius: 0 0 4px 4px;
}

.pitch-player-name {
    width: 100%;
    min-height: 2.2em;
    display: -webkit-box;
    overflow: hidden;
    padding: calc(var(--u, 10px) * .32) calc(var(--u, 10px) * .28);
    border-radius: 4px 4px 0 0;
    background: #f8faf9;
    color: #172033;
    font-size: calc(var(--u, 10px) * 1.02);
    font-weight: 800;
    line-height: 1.12;
    text-align: center;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pitch-player-club {
    width: 100%;
    max-width: 100%;
    margin-top: 0;
    padding: calc(var(--u, 10px) * .28) calc(var(--u, 10px) * .25);
    overflow: hidden;
    border-radius: 0 0 5px 5px;
    background: #e9eaf0;
    color: #4d5665;
    font-size: calc(var(--u, 10px) * .9);
    font-weight: 600;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

 .pitch-player-fixture {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
}

.pitch-player-price {
    min-width: calc(var(--u, 10px) * 5.8);
    margin-top: calc(var(--u, 10px) * .5);
    padding: calc(var(--u, 10px) * .4) calc(var(--u, 10px) * .75);
    border-radius: 20px;
    background: #17263d;
    color: #fff;
    font-size: calc(var(--u, 10px) * .95);
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.pitch-player:has(.captain-badge) { box-shadow: 0 0 0 2px rgba(242, 189, 50, .78), 0 7px 18px rgba(0,0,0,.3); }
.pitch-player:has(.vice-captain-badge) { box-shadow: 0 0 0 2px rgba(120, 87, 232, .72), 0 7px 18px rgba(0,0,0,.3); }

/* Bench cards use the same light face/name/club card treatment on every page. */
.bench-player {
    --player-accent: #218457;
    --player-accent-soft: rgba(33, 132, 87, .12);
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
    overflow: hidden;
    border: 1px solid #d8e3dd;
    border-left: 3px solid var(--player-accent);
    border-radius: 9px;
    background: linear-gradient(110deg, var(--player-accent-soft), #f8fbf9 38%);
    color: var(--player-card-ink);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.bench-player:hover { border-color: color-mix(in srgb, var(--player-accent) 45%, #d8e3dd); background: linear-gradient(110deg, var(--player-accent-soft), #fff 52%); box-shadow: 0 4px 12px rgba(0,0,0,.16); }
.bench-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid #fff;
    outline: 1px solid color-mix(in srgb, var(--player-accent) 45%, #d9e0e7);
    border-radius: 50%;
    background: var(--player-accent-soft);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}
.bench-avatar.GK { background: #19a86b; }
.bench-avatar.DEF { background: #3175db; }
.bench-avatar.MID { background: #235fc3; }
.bench-avatar.ATT { background: #e0443b; }
.bench-info { min-width: 0; flex: 1; }
.bench-name { overflow: hidden; color: var(--player-card-ink); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.bench-position { margin-top: 2px; overflow: hidden; color: var(--player-card-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

/* Market rows share the same colors, outlines and typography as the lineup cards. */
.player-card {
    min-width: 0;
    border: 1px solid #30363d;
    border-radius: 9px;
    background: #1b1f23;
    color: #edf1f4;
}
.player-card:hover { border-color: #46534d; background: #202722; }
.player-card.selected { border-color: #2d7652; background: #172d23; }
.player-avatar { flex: 0 0 36px; border-color: #394149; background: #232a31; }
.player-avatar img { object-fit: cover; object-position: center 16%; }
.player-name { color: #edf1f4; }
.player-meta-line, .player-club, .player-position-tag { color: #929ba4; }
.player-price, .player-total-points { color: #f2f5f6; }

/* Both player-detail dialogs follow one shared card surface. */
.player-modal-content,
.team-player-modal-content {
    border: 1px solid #30363d;
    border-radius: 16px;
    background: #171a1e;
    color: #f3f5f7;
}

body[data-mode="team"] .pitch-player,
body[data-mode="team"] .bench-player { cursor: pointer; }
body[data-mode="team"] .pitch-player:focus-visible,
body[data-mode="team"] .bench-player:focus-visible { outline: 2px solid #82d6a3; outline-offset: 3px; }

@media (max-width: 600px) {
    .bench-player { justify-content: center; padding-inline: 4px; }
    .bench-info { display: none; }
}
.player-points-breakdown{width:100%;min-width:0;margin-top:8px;border-collapse:collapse;font-size:12px}.player-points-breakdown th,.player-points-breakdown td{padding:7px 8px;border-bottom:1px solid #343b42;text-align:left}.player-points-breakdown th{color:#9aa3ab;font-size:10px;text-transform:uppercase;letter-spacing:.05em}.player-points-breakdown td:last-child,.player-points-breakdown th:last-child{text-align:right;white-space:nowrap}.player-points-breakdown td:nth-child(2),.player-points-breakdown th:nth-child(2){text-align:center}.modal-detail-card h4,.team-player-card h4{margin:10px 0 3px;font-size:12px;color:#c7d0d8}
