/* Player workspace: persistent identity and one focused content area. */
#playerProfile.profile-workspace {
    display: grid;
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
    width: min(1320px, calc(100% - 40px));
    gap: 28px;
    align-items: start;
    padding-bottom: 40px;
}
.profile-sidebar { min-width: 0; position: sticky; top: 20px; }
.profile-content, .profile-panels { min-width: 0; }
#playerProfile .profile-sidebar .player-hero { margin: 0; position: relative; }
#playerProfile .profile-sections {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px;
    margin: 0 0 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    box-sizing: border-box;
}
#playerProfile .profile-sections button {
    flex: 1 1 auto;
    padding: 11px 12px;
    border: 1px solid transparent;
    background: transparent;
    color: #b9c7cc;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
}
#playerProfile .profile-sections button:hover { background: #22382b; color: #eef8f1; }
#playerProfile .profile-sections button[aria-pressed="true"] {
    background: #39d98a;
    color: #071b10;
    border-color: #39d98a;
}
#playerProfile .profile-panels { display: grid; gap: 22px; }
#playerProfile .profile-panels > .card { margin: 0; position: static; padding: 26px; }
#playerProfile .card-title { flex-wrap: wrap; align-items: flex-start; }
#playerProfile .card-title .section-subtitle { flex-basis: 100%; margin: 0; line-height: 1.6; }
#playerProfile .section-subtitle { line-height: 1.6; }
#playerProfile [data-profile-role="chart"] { order: 1; }
#playerProfile [data-profile-role="recent"] { order: 2; }
#playerProfile .chart-container { height: 300px; }
#playerProfile .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#playerProfile .season-title { padding: 18px 14px; border-left: 3px solid #39d98a; }
#playerProfile .season-info { min-width: 0; }
#playerProfile .season-name { overflow-wrap: anywhere; }
#playerProfile .palmares-table { display: table; width: 100%; }
#playerProfile [data-profile-role="tournaments"] { overflow-x: auto; }
@media (max-width: 1050px) {
    #playerProfile.profile-workspace { grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
    #playerProfile .profile-sections button { flex: 1 1 28%; }
    #playerProfile .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    #playerProfile.profile-workspace { grid-template-columns: minmax(0, 1fr); width: calc(100% - 24px); gap: 18px; }
    .profile-sidebar { position: static; }
    #playerProfile .profile-panels > .card { padding: 18px; }
    #playerProfile .profile-sections { gap: 4px; margin-bottom: 16px; }
    #playerProfile .profile-sections button { padding: 12px 6px; font-size: 12px; }
    #playerProfile .chart-container { height: 240px; }
    #playerProfile .season-title { flex-wrap: wrap; gap: 10px; }
    #playerProfile .recent-player-results li { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    #playerProfile * { scroll-behavior: auto; transition: none; }
}
.profile-probability-method { margin: 18px 0 24px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; color: #b9c7cc; font-size: 13px; line-height: 1.65; }
.profile-probability-method summary { cursor: pointer; color: #b3f4cf; font-weight: 600; }
.profile-probability-method p:last-child { margin-bottom: 0; }

#playerProfile .profile-sections { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
#playerProfile .profile-sections button { flex: 1 0 auto; text-decoration: none; }
#playerProfile .profile-sections button:hover { text-decoration: none; }
.profile-club-identity { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
#playerProfile .profile-club-logo { width: 24px; height: 24px; object-fit: contain; border-radius: 3px; flex: 0 0 auto; }
.stat-interactive { position: relative; padding-bottom: 42px; }
.stat-detail-trigger { position: absolute; inset: 0; width: 100%; border: 1px solid transparent; border-radius: inherit; cursor: pointer; background: transparent; color: #8af2bd; text-align: left; font: inherit; }
.stat-detail-trigger span { position: absolute; left: 16px; bottom: 12px; font-size: 12px; }
.stat-detail-trigger:hover { border-color: #39d98a; background: rgba(57,217,138,.04); }
.profile-record-button { border: 1px solid #3c6350; border-radius: 7px; padding: 8px 10px; background: #18261f; color: #b3f4cf; font: inherit; cursor: pointer; white-space: nowrap; }
.profile-record-button:hover { border-color: #39d98a; }
.profile-detail-dialog { width: min(850px, calc(100% - 32px)); max-height: 85dvh; padding: 24px; border: 1px solid #3c6350; border-radius: 16px; background: #141a17; color: #e5ede8; box-sizing: border-box; }
.profile-detail-dialog::backdrop { background: rgba(0,0,0,.75); }
.profile-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.profile-detail-heading h2 { margin: 0; font-size: 21px; }
.profile-dialog-close { border: 1px solid #52666e; border-radius: 8px; background: #18261f; color: white; padding: 10px 14px; cursor: pointer; }
.profile-detail-dialog p { color: #b9c7cc; line-height: 1.6; }
.profile-detail-games { display: grid; gap: 12px; }
.profile-detail-game { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px 18px; padding: 16px; background: #19211d; border: 1px solid #34473b; border-radius: 10px; overflow-wrap: anywhere; }
.profile-detail-game a { color: #b3f4cf; }
.profile-detail-game > small, .profile-detail-game > div { grid-column: 1 / -1; }
.profile-detail-partials { display: block; margin-top: 6px; color: #b9cbd3; line-height: 1.6; }
@media(max-width:760px) {
    #playerProfile .profile-sections button { flex: 0 0 auto; padding: 12px; }
    .profile-detail-dialog { padding: 16px; }
    .profile-detail-game { grid-template-columns: minmax(0,1fr); }
}
#playerProfile .recent-opponent-rating { color: #b9c7cc; font-size: 12px; white-space: nowrap; }
.profile-career-season { border: 1px solid var(--border); border-radius: 12px; margin-top: 16px; padding: 12px; }
.profile-career-season > summary { cursor: pointer; padding: 8px; overflow-wrap: anywhere; }
.profile-career-season > summary > span { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.profile-career-club > summary { cursor: pointer; }
#playerProfile .profile-career-club .season-record { display: block; }
.profile-career-club > summary::after { content: '▾'; color: var(--muted); margin-left: 8px; }
.profile-career-club[open] > summary::after { content: '▴'; }
.profile-career-club > summary:focus-visible, .profile-career-season > summary:focus-visible { outline: 2px solid #39d98a; outline-offset: 3px; }
.profile-career-club[open] > summary { background: #22382b; }
.profile-licenses { margin-top: 16px; text-align: left; }
.profile-licenses h2 { font-size: 15px; }
.profile-license { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.profile-license .profile-club-identity { justify-content: flex-start; }
.profile-license-note, .profile-match-equipment { font-size: 11px; color: var(--muted); line-height: 1.6; }
.profile-match-equipment { display: block; white-space: normal; max-width: 340px; margin-top: 6px; }
#playerProfile .player-club { display: grid; gap: 10px; overflow-wrap: anywhere; }
#playerProfile .player-club > small { color: var(--muted); font-size: 11px; }

/* Compact identity metadata and on-demand match equipment. */
#playerProfile .player-club { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; padding: 14px 0; margin: 12px 0 0; border-top: 1px solid var(--border); text-align: left; }
#playerProfile .profile-clubs-heading { display: flex; justify-content: space-between; flex-basis: 100%; gap: 12px; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
#playerProfile .profile-clubs-heading span { text-transform: none; letter-spacing: 0; }
#playerProfile .player-club > .profile-club-identity { padding: 6px 9px; border: 1px solid #304137; border-radius: 6px; font-size: 12px; background: #19231d; justify-content: flex-start; max-width: 100%; box-sizing: border-box; }
#playerProfile .player-club .profile-club-logo { width: 20px; height: 20px; }
.profile-licenses { margin-top: 12px; }
.profile-licenses h2 { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin: 16px 0 8px; }
.profile-license { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px 12px; padding: 12px 0; }
.profile-license-country { display: grid; gap: 4px; }
.profile-license-country strong { font-size: 13px; font-weight: 500; }
.profile-license-country small { font-size: 10px; color: var(--muted); }
.profile-license-country .profile-country-flag { width: 27px; height: 18px; display: block; border-radius: 2px; box-shadow: 0 0 0 1px #ffffff20; }
.profile-license-country { justify-items: start; }
.profile-license-clubs a, .profile-career-club .season-name a { color: inherit; text-decoration: none; }
.profile-license-clubs a:hover, .profile-career-club .season-name a:hover, .profile-club-identity:hover { text-decoration: underline; }
a.profile-club-identity { color: inherit; text-decoration: none; }
.profile-license-number { font-size: 15px; font-variant-numeric: tabular-nums; color: #e5ede8; }
.profile-license-number > small { font-size: 10px; color: var(--muted); }
.profile-license-clubs { grid-column: 1 / -1; font-size: 11px; color: var(--muted); margin-top: 4px; }
.profile-license-clubs summary { cursor: pointer; }
.profile-license-clubs p { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: #b9c7cc; }
.profile-equipment { margin-top: 7px; font-size: 11px; font-weight: normal; color: #b9c7cc; text-align: left; white-space: normal; }
.profile-equipment > summary { cursor: pointer; color: #9eb3a6; width: fit-content; padding: 4px 0; text-decoration: underline dotted; text-underline-offset: 3px; }
.profile-equipment dl { margin: 7px 0; padding: 10px 12px; border-left: 2px solid #3c6350; background: #111b15; min-width: 160px; max-width: 280px; }
.profile-equipment dl > div + div { margin-top: 10px; }
.profile-equipment dt { color: #91a699; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.profile-equipment dd { margin: 3px 0 0; color: #e5ede8; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.profile-equipment dd small { display: block; margin-top: 3px; color: #91a699; font-size: 10px; }
.h2h-match-equipment:empty { display: none; }
.h2h-match-equipment { margin: 0 18px 12px; }
.h2h-match-equipment .profile-equipment dl { max-width: none; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.h2h-match-equipment .profile-equipment dl > div + div { margin-top: 0; }
@media(max-width:480px) { .h2h-match-equipment .profile-equipment dl { grid-template-columns: minmax(0,1fr); } }
.profile-detail-game > .profile-equipment { grid-column: 1 / -1; }
.profile-career-season { border: 0; border-radius: 0; padding: 0; margin-top: 20px; }
.profile-career-season > summary { padding: 12px 0; border-bottom: 1px solid var(--border); }
.profile-career-season > summary > span { margin-top: 5px; }
#playerProfile .profile-career-club > .season-title { border: 0; border-bottom: 1px solid #2b3a31; border-radius: 0; padding: 14px 10px; margin: 0; gap: 12px; background: transparent; }
.profile-career-club[open] > .season-title { background: #19271e !important; }
#playerProfile .profile-career-club .season-info { flex: 1; }
#playerProfile .profile-career-club .season-name { font-size: 13px; }
#playerProfile .profile-career-club .season-record { font-size: 12px; white-space: nowrap; }
@media(max-width:760px) {
    #playerProfile .profile-career-club > .season-title { flex-wrap: nowrap; gap: 8px; padding: 12px 4px; }
    #playerProfile .profile-career-club .season-info img { width: 25px; height: 25px; }
}
.season-summary-filter{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.season-summary-filter select,.season-summary-filter button{font:inherit;padding:9px;max-width:100%;border-radius:8px}.season-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px}.season-summary-grid>div{padding:12px;border:1px solid #64748b;border-radius:10px}.season-summary-grid dt{font-size:.85rem}.season-summary-grid dd{margin:8px 0 0;font-size:1.25rem;font-weight:700}

html.profile-loading[data-profile-view="summary"] #playerProfile [data-profile-section]:not([data-profile-section="summary"]){display:none}
html.profile-loading[data-profile-view="singles"] #playerProfile [data-profile-section]:not([data-profile-section="singles"]){display:none}
html.profile-loading[data-profile-view="h2h"] #playerProfile [data-profile-section]:not([data-profile-section="h2h"]){display:none}
html.profile-loading[data-profile-view="doubles"] #playerProfile [data-profile-section]:not([data-profile-section="doubles"]){display:none}
html.profile-loading[data-profile-view="career"] #playerProfile [data-profile-section]:not([data-profile-section="career"]){display:none}
html.profile-loading[data-profile-view="honors"] #playerProfile [data-profile-section]:not([data-profile-section="honors"]){display:none}
#playerProfile [hidden]{display:none!important}
