/* Compact empty-state variant */
.player-profile .ds-empty--sm { padding: var(--ds-space-8) var(--ds-space-4); }
.player-profile .ds-empty--sm .ds-empty-icon {
    width: 48px;
    height: 48px;
    font-size: var(--ds-type-body-large);
    border-radius: var(--ds-radius-lg);
    margin-bottom: var(--ds-space-3);
}
.player-profile .ds-empty--sm .ds-empty-title { font-size: var(--ds-type-body-small); }
.player-profile .ds-empty--sm .ds-empty-sub { font-size: var(--ds-type-body-small); margin-bottom: var(--ds-space-3); }

/* Card-header action buttons keep a comfortable touch target */
.player-profile .ds-card-action, #matchDetailModal .ds-card-action { min-height: 44px; display: inline-flex; align-items: center; }

.player-profile, #matchDetailModal {
    --profile-ink: var(--ds-text-primary);
    --profile-ink: light-dark(#202731, #f1f4f7);
    --profile-muted: var(--ds-text-muted);
    --profile-muted: light-dark(#52606c, #b4bec8);
    --profile-paper: var(--ds-surface-primary);
    --profile-paper: light-dark(#fff, #1d252a);
    --profile-wash: var(--ds-surface-secondary);
    --profile-wash: light-dark(#f1f4f6, #263137);
    --profile-rule: var(--ds-border-default);
    --profile-rule: light-dark(#d1d8dd, #465056);
    --profile-link: var(--ds-info);
    --profile-radius: 1rem;
    color: var(--profile-ink);
}
.player-profile.container {
    max-width: 75rem; padding: clamp(1rem, 2.2vw, (1.5rem + .25rem)) clamp(1rem, 2.7vw, 2rem) 3rem;
}
.player-profile :is(a, button, [tabindex="0"]):focus-visible,
#matchDetailModal :is(a, button, [tabindex="0"]):focus-visible {
    outline: 3px solid var(--profile-link); outline-offset: 3px;
}
.player-masthead {
    --athlete-surface: var(--ds-emphasis-surface, #16372b);
    --athlete-ink: #f7fbf7;
    --athlete-secondary: #d1e4da;
    --athlete-accent: #d2f1cd;
    --athlete-line: #627c70;
    --athlete-pad: clamp(1.2rem, 2.6vw, 2.3rem);
    margin-bottom: clamp(1rem, 2.2vw, (1.5rem + .25rem)); border-radius: 1.3rem;
    background: var(--athlete-surface); color: var(--athlete-ink);
    box-shadow: 0 0 0 1px var(--profile-rule);
}
.player-masthead-main {
    display: grid; align-items: center; gap: 1.25rem; min-width: 0;
    padding: var(--athlete-pad);
}
.player-identity {
    display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: center;
    gap: .75rem clamp(1rem, 1.9vw, (1.5rem + .25rem)); min-width: 0;
}
.player-portrait { align-self: center; }
.player-portrait .ds-hero-avatar {
    display: block; width: clamp(7.25rem, 10.5vw, 9.5rem); aspect-ratio: 1; height: auto;
    border: 1px solid var(--athlete-line); border-radius: .92rem; object-fit: cover; background: var(--profile-wash);
}
.player-portrait .ds-hero-avatar:hover, #matchDetailModal .photo-clickable:hover { transform: none; box-shadow: 0 0 0 3px var(--profile-rule); }
.player-identity-copy { min-width: 0; }
.player-sport, .player-affiliation, .player-style { margin: 0; }
.player-sport {
    display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem;
    color: var(--athlete-accent); font-size: .875rem; line-height: 1.3; font-weight: 620;
}
.player-identity h1 {
    margin: 0; max-width: 24ch; color: var(--athlete-ink);
    font-size: clamp(2rem, 3.55vw, 3.5rem); line-height: 1.02; letter-spacing: -.048em;
    font-weight: 650; overflow-wrap: anywhere;
}
.player-affiliation, .player-style {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; overflow-wrap: anywhere;
}
.player-affiliation { margin-top: .5rem; font-size: clamp(.94rem, 1.3vw, 1.06rem); color: var(--athlete-ink); }
.player-style { margin-top: .25rem; font-size: .875rem; color: var(--athlete-secondary); }
:is(.player-affiliation, .player-style) span + span::before { content: "·"; margin-right: .5rem; }
.player-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.player-actions:not(:has(:is(button,a))) { display: none; }
.player-actions .header-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--athlete-line); border-radius: .58rem;
    background: transparent; color: var(--athlete-ink); text-decoration: none; font-weight: 600;
}
.player-actions .header-btn.primary { background: var(--athlete-ink); color: #193b29; border-color: var(--athlete-ink); } /* design-audit-allow: hardcoded-color — dark ink on the hero's fixed light pill; the hero keeps its own palette in both themes */
.player-actions .header-btn:hover { text-decoration: underline; text-underline-offset: .16em; }
.player-masthead .player-masthead-main :is(a,button,[tabindex="0"]):focus-visible { outline-color: var(--athlete-accent); }
.player-profile .profile-stats {
    display: grid; grid-template-columns: minmax(0,1.18fr) minmax(0,1fr) minmax(0,.83fr) minmax(max-content,1.08fr); gap: 0;
    margin: 0; min-width: 0; padding-top: 1rem; border-top: 1px solid var(--athlete-line);
}
.profile-stats > div { position: relative; min-width: 0; padding-inline: clamp(.75rem, 1.5vw, 1.25rem); }
.profile-stats > div:first-child { padding-inline-start: 0; }
.profile-stats > div:last-child { padding-inline-end: 0; }
.profile-stats > div + div { border-inline-start: 1px solid var(--athlete-line); }
.profile-stats .ds-stat-label {
    display: block; margin: 0 0 .5rem; color: var(--athlete-secondary); font: inherit;
    font-size: .8125rem; line-height: 1.27; font-weight: 580; text-transform: none; letter-spacing: 0;
}
.profile-stats .ds-stat-value {
    margin: 0; color: var(--athlete-ink); font-size: clamp(1.7rem, 2.55vw, 2.55rem);
    font-weight: 625; line-height: 1.05; letter-spacing: -.045em; font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.profile-stats > div:last-child .ds-stat-value { white-space: nowrap; }
.profile-stat-note { margin: .25rem 0 0; font-size: .75rem; line-height: 1.35; color: var(--athlete-secondary); }
.profile-stat-note a, .profile-matches-jump { color: var(--athlete-ink); }
.profile-stat-note a { text-decoration: underline; text-underline-offset: .17em; }
.profile-stat-note a i { font-size: .72em; }
.profile-matches-jump { text-decoration: none; }
.profile-matches-jump:hover { color: var(--athlete-accent); text-decoration: underline; text-underline-offset: .16em; }
.profile-matches-jump::after { content: ""; position: absolute; inset: -.22rem 0; }
.profile-matches-jump i { margin-inline-start: .23rem; vertical-align: .14em; font-size: .47em; color: var(--athlete-accent); }
#profile-matches-title { scroll-margin-top: 1.5rem; }
.profile-analysis { --bs-gutter-x: clamp(1rem, 2.4vw, 2rem); --bs-gutter-y: clamp(1rem, 2.4vw, 2rem); }
.profile-form {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.25rem;
    padding: .75rem var(--athlete-pad); border-radius: 0 0 1.3rem 1.3rem;
    color: var(--profile-ink); background: var(--profile-paper);
}
.profile-form-last, .profile-country { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; min-width: 0; }
.profile-form h2 { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.4; color: var(--profile-ink); }
.profile-form-note, .profile-country small { margin: 0; color: var(--profile-muted); font-size: .75rem; line-height: 1.3; }
.profile-form-results { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.profile-form-results .ds-wl {
    display: grid; place-items: center; width: 1.65rem; height: auto; aspect-ratio: 1; border-radius: .4rem;
    font-size: .75rem; line-height: 1; font-weight: 680; border: 1px solid;
}
.profile-form-results .ds-wl--w, .match-outcome.is-win {
    color: var(--ds-success); background: var(--ds-success-surface); border-color: var(--ds-success-border);
}
.profile-form-results .ds-wl--l, .match-outcome.is-loss {
    color: var(--ds-error); background: var(--ds-error-surface); border-color: var(--ds-error-border);
}
.profile-country { color: var(--profile-muted); font-size: .875rem; }
.profile-country strong { font-size: 1.0625rem; font-weight: 650; color: var(--profile-ink); }
.profile-section-head h2 {
    margin: 0; color: var(--profile-ink); font-size: clamp(1.5rem, 2.35vw, 2.1rem);
    line-height: 1.13; letter-spacing: -.04em; font-weight: 650;
}
@media (min-width: 68em) {
    .player-masthead-main { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: clamp(1.25rem, 3.2vw, 3rem); }
    .player-profile .profile-stats { border-top: 0; padding-top: 0; }
    .profile-stats > div { padding-inline: clamp(.5rem, .85vw, 1rem); }
    .profile-stats .ds-stat-value { font-size: clamp(1.7rem, 2.25vw, 2.2rem); }
}
.profile-matches { margin-block: clamp(.75rem, 2vw, (1.5rem + .25rem)) 1.5rem; }
.profile-section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 1rem; margin-bottom: .75rem; }
.player-profile .match-history-link {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .875rem; font-weight: 600;
    color: var(--profile-link); text-decoration: underline; text-underline-offset: .18em;
}
.match-history-link i { font-size: .75em; }
.profile-matches {
    --match-columns: 2.65rem minmax(0,1.55fr) minmax(4.8rem,.33fr) minmax(0,1fr) minmax(6.4rem,.45fr) .75rem;
    --match-gap: clamp(.75rem, 1.2vw, 1rem);
}
.match-columns, .profile-matches .match-row {
    width: 100%; display: grid; grid-template-columns: var(--match-columns); gap: .25rem var(--match-gap);
    align-items: center; padding-inline: .75rem;
}
.match-columns { padding-block: .5rem; border-block: 1px solid var(--profile-rule); background: var(--profile-wash); color: var(--profile-muted); font-size: .75rem; font-weight: 650; }
.match-columns > :first-child { grid-column: span 2; }
.profile-matches .match-row {
    min-height: 4.7rem; padding-block: .75rem; border: 0; border-bottom: 1px solid var(--profile-rule);
    background: transparent; color: var(--profile-ink); border-radius: 0; text-align: start; font: inherit; line-height: 1.3;
}
.profile-matches .match-row:is(:hover,:focus-visible) { background: var(--profile-wash); }
.match-row .ds-match-avatar { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--profile-wash); }
.match-opposition, .match-score { display: grid; justify-items: start; align-content: center; gap: .25rem; min-width: 0; }
.match-opposition strong, .match-score strong { color: var(--profile-ink); font-size: 1.0625rem; line-height: 1.22; font-weight: 660; overflow-wrap: anywhere; }
.match-context, .match-date { color: var(--profile-muted); font-size: .8125rem; line-height: 1.35; overflow-wrap: anywhere; }
.match-points { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; color: var(--profile-muted); }
.match-point {
    display: inline-flex; justify-content: center; align-items: baseline; gap: 0; padding: .25rem .25rem;
    color: var(--profile-muted); background: var(--profile-wash); border: 1px solid var(--profile-rule); border-radius: .32rem;
    font-size: .75rem; line-height: 1.2; white-space: nowrap;
}
.match-point .set-high { color: var(--profile-ink); font-weight: 750; }
.match-unrecorded, .profile-match-count { color: var(--profile-muted); font-size: .8125rem; }
.match-outcome {
    display: inline-flex; width: fit-content; align-items: center; padding: .25rem .5rem; border: 1px solid transparent;
    border-radius: 100px; font-size: .75rem; font-weight: 650; line-height: 1.35; white-space: nowrap;
}
.profile-form-results .is-neutral, .match-outcome.is-neutral { color: var(--profile-muted); background: var(--profile-wash); border-color: var(--profile-rule); }
.match-chevron { color: var(--profile-link); font-size: .75rem; text-align: end; }
.profile-matches-footer { display: flex; gap: .5rem 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-block: .75rem; }
.profile-matches-footer .btn-outline-secondary { gap: .5rem; background: var(--profile-paper); color: var(--profile-ink); border-color: var(--profile-rule); }
/* Sections below the match list share its heading and ruled-row language. */
.profile-section { margin-block: clamp((1.5rem + .25rem), 3.6vw, 3rem) 0; }
.profile-section .profile-section-head { padding-bottom: .75rem; margin-bottom: 0; border-bottom: 1px solid var(--profile-rule); }
.profile-section-scope {
    margin-inline-start: .45rem; color: var(--profile-muted);
    font-size: .875rem; font-weight: 560; letter-spacing: 0; white-space: nowrap;
}
.profile-section > .ds-empty { border-bottom: 1px solid var(--profile-rule); }
.profile-friends {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem;
    margin-top: 1rem; padding-block: .25rem; border-block: 1px solid var(--profile-rule);
}
.profile-friends p { margin: 0; color: var(--profile-muted); font-size: 1rem; }
.profile-friends strong { margin-inline-end: .2rem; color: var(--profile-ink); font-size: 1.0625rem; font-weight: 650; }
.profile-gear-body { display: grid; gap: 0 clamp(1rem, 2.6vw, 2rem); align-items: start; }
.profile-gear-photo {
    display: grid; place-items: center; width: min(100%, 13rem); aspect-ratio: 1.15; margin: 1rem 0 0; overflow: hidden;
    border: 1px solid var(--profile-rule); border-radius: .8rem; background: var(--profile-wash);
}
.profile-gear-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.profile-gear-facts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 0 clamp(1rem, 2.6vw, 2rem);
    margin: 0; min-width: 0;
}
.profile-gear-facts > div { min-width: 0; padding-block: .75rem; border-bottom: 1px solid var(--profile-rule); }
.profile-gear-facts .profile-gear-primary { grid-column: 1 / -1; }
.profile-gear-facts dt { margin-bottom: .25rem; color: var(--profile-muted); font-size: .8125rem; line-height: 1.3; font-weight: 580; }
.profile-gear-facts dd { margin: 0; color: var(--profile-ink); font-size: 1.0625rem; line-height: 1.3; font-weight: 640; overflow-wrap: anywhere; }
.profile-gear-primary dd { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 650; }
@media (min-width: 40em) {
    .profile-gear-body:has(.profile-gear-photo) { grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); }
}
.profile-posts-list { padding-top: 1rem; }
.profile-posts-list > .ds-empty { padding-top: var(--ds-space-4); }
.player-profile .official-ratings { margin-top: 1rem; }
.player-profile .official-ratings:has(> .official-ratings__note):not(:has(.official-ratings__values)) {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
    border: 0 !important; border-block: 1px solid var(--profile-rule) !important; border-radius: 0 !important; box-shadow: none !important;
    background: transparent !important; padding-block: .75rem;
}
.player-profile .official-ratings:has(> .official-ratings__note) > :is(header, .official-ratings__note) {
    margin: 0; padding: 0; border: 0; background: none !important;
}
.player-profile .official-ratings:has(> .official-ratings__note) h2 { font-size: 1rem; }
.player-profile .official-ratings:has(> .official-ratings__note) h2 i { display: none; }

#matchDetailModal.modal { height: 100vh; height: 100dvh; }
#matchDetailModal .md-dialog { width: min(37rem, calc(100% - 1.5rem)); max-width: none; margin: clamp(.75rem, 4vh, 3rem) auto; }
#matchDetailModal .md-content {
    max-height: calc(100vh - 2 * clamp(.75rem, 4vh, 3rem)); max-height: calc(100dvh - 2 * clamp(.75rem, 4vh, 3rem));
    display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--profile-rule);
    border-radius: var(--profile-radius); background: var(--profile-paper); box-shadow: var(--ds-shadow-lg);
}
#matchDetailModal .md-header, #matchDetailModal .md-footer {
    flex: none; padding: 1rem clamp(1rem, 3.5vw, (1.5rem + .25rem)); background: var(--profile-paper) !important; border-color: var(--profile-rule);
}
#matchDetailModal .md-title { margin: 0; color: var(--profile-ink); font-size: clamp(1.3rem, 3vw, 1.75rem); line-height: 1.17; font-weight: 660; letter-spacing: -.035em; overflow-wrap: anywhere; }
#matchDetailModal .md-header .btn-close { flex: none; margin-inline-start: .3rem; }
#matchDetailModal .md-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1.25rem clamp(1rem, 3.5vw, (1.5rem + .25rem)); }
.md-facts { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .5rem; color: var(--profile-muted); font-size: .8125rem; }
.md-facts > :empty { display: none; }
.md-facts > :not(:empty):not([hidden]) ~ :not(:empty):not([hidden])::before { content: "·"; margin-inline-end: .65rem; }
.md-scoreboard { padding: .75rem 1rem .5rem; border: 1px solid var(--profile-rule); border-radius: .8rem; background: var(--profile-wash); }
.md-scoreboard-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding-bottom: .5rem; }
.md-sets-label { color: var(--profile-muted); font-size: .8125rem; }
.md-team { display: grid; grid-template-columns: 2.65rem minmax(0,1fr) max-content; gap: .75rem; align-items: center; min-height: 3.5rem; padding-block: .5rem; }
.md-team + .md-team { border-top: 1px solid var(--profile-rule); }
.md-team .md-vs-avatar { width: 2.65rem; height: 2.65rem; border-radius: 50%; object-fit: cover; background: var(--profile-paper); }
.md-team-name { color: var(--profile-ink); font-size: clamp(.98rem, 2.2vw, 1.1rem); font-weight: 650; overflow-wrap: anywhere; }
.md-team-total { color: var(--profile-ink); font-size: 1.75rem; font-weight: 650; letter-spacing: -.045em; line-height: 1; }
.md-section-label { margin: 1.25rem 0 .5rem; color: var(--profile-ink); font-size: 1.0625rem; font-weight: 650; }
#matchDetailModal .md-sets { width: 100%; border-collapse: collapse; color: var(--profile-ink); }
.md-sets :is(th, td) { padding: .5rem .25rem; text-align: center; border-bottom: 1px solid var(--profile-rule); font-size: .875rem; font-variant-numeric: tabular-nums; }
.md-sets thead th { white-space: nowrap; color: var(--profile-muted); background: var(--profile-wash); font-weight: 600; }
.md-sets th:first-child { text-align: start; }
.md-sets tbody th { max-width: 13rem; min-width: 4.7rem; font-weight: 580; overflow-wrap: anywhere; }
.md-sets td > span { display: inline-flex; justify-content: center; align-items: center; min-width: 1.75rem; min-height: 1.75rem; padding-inline: .25rem; color: var(--profile-muted); }
.md-sets td > .md-set-high { border-radius: .35rem; background: var(--ds-success-surface); color: var(--ds-success); font-weight: 760; }
.md-unrecorded, #md-notes { margin: 0; font-size: .875rem; color: var(--profile-muted); overflow-wrap: anywhere; }
#matchDetailModal [hidden] { display: none !important; }
#matchDetailModal .md-footer { gap: .5rem; }
#matchDetailModal .md-footer > a { margin: 0; }
#matchDetailModal .md-footer .btn-primary { background: var(--profile-link) !important; border-color: var(--profile-link) !important; color: var(--ds-on-info) !important; }
#matchDetailModal .md-footer a:hover { text-decoration: underline; text-underline-offset: .15em; }

@media (max-width: 48em) {
    .player-profile.container { padding-inline: 1rem; }
    .player-portrait .ds-hero-avatar { width: clamp(5.5rem, 18vw, 7.75rem); }
    .match-columns { display: none; }
    .profile-matches #matches-list { border-top: 1px solid var(--profile-rule); }
    .profile-matches .match-row {
        grid-template-columns: 2.12rem minmax(0,1fr) minmax(2.9rem,max-content) .6rem;
        grid-template-areas: "avatar name result arrow" "avatar date result arrow" "context context context context" "points points points points";
        gap: .25rem .5rem; min-height: 4.6rem; padding: .75rem .25rem;
    }
    .match-row .ds-match-avatar { grid-area: avatar; }
    .match-opposition { display: contents; }
    .match-opposition strong { grid-area: name; font-size: 1rem; }
    .match-opposition .match-context { grid-area: context; margin-top: .25rem; }
    .match-date { grid-area: date; }
    .match-score { grid-area: result; justify-items: end; gap: .25rem; }
    .match-score strong { font-size: 1rem; }
    .match-points { grid-area: points; margin-top: .25rem; }
    .match-chevron { grid-area: arrow; }
}
@media (max-width: 37em) {
    .player-profile.container { padding-inline: .5rem; }
    .player-masthead { --athlete-pad: .95rem; border-radius: 1rem; }
    .player-masthead-main { gap: 1rem; }
    .player-portrait .ds-hero-avatar { width: clamp(4.6rem, 19.5vw, 6.25rem); border-radius: .7rem; }
    .player-identity { column-gap: .75rem; }
    .player-identity h1 { font-size: clamp(1.73rem, 6.5vw, 2.25rem); }
    .player-sport { font-size: .75rem; margin-bottom: .25rem; }
    .player-affiliation { margin-top: .25rem; font-size: .8125rem; }
    .player-style { margin-top: 0; font-size: .75rem; }
    .player-profile .profile-stats { padding-top: .75rem; }
    .profile-stats > div { padding-inline: clamp(.25rem, 1.6vw, .5rem); }
    .profile-stats .ds-stat-label { font-size: .75rem; min-height: 2.5em; display: flex; align-items: end; margin-bottom: .25rem; }
    .profile-stats .ds-stat-value { font-size: clamp(1.25rem, 4.7vw, 1.75rem); }
    .profile-stat-note { font-size: .75rem; }
    .profile-form { padding-block: .75rem; border-radius: 0 0 1rem 1rem; }
    .profile-form-last, .profile-country { gap: .25rem .5rem; }
    .profile-form h2 { font-size: .8125rem; }
    .profile-form-note, .profile-country small { font-size: .75rem; }
    .profile-form-results .ds-wl { width: 1.4rem; }
    .profile-section-head { margin-bottom: .75rem; }
    #matchDetailModal .md-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 1rem; }
    #matchDetailModal .md-footer > a { justify-content: center; padding-inline: .5rem; }
}
@media (max-width: 22em) {
    .profile-matches .match-row { column-gap: .5rem; }
    #matchDetailModal .md-footer { padding: .75rem; }
    #matchDetailModal .md-footer > a { font-size: .8125rem; padding-inline: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .player-profile .photo-clickable, #matchDetailModal .photo-clickable { transition: none; }
}
@media (forced-colors: active) {
    .player-masthead, .profile-form-results .ds-wl, .match-outcome { border: 1px solid CanvasText; }
    .player-masthead .profile-matches-jump, .player-masthead .profile-stat-note a { color: LinkText; }
    .match-row .match-chevron, .profile-stat-note a, .player-actions .header-btn { color: LinkText; }
}

/* The lightbox opens from either the profile or a match dialog. */
body:has(#photo-lightbox[open]) { overflow: hidden; }
#photo-lightbox:not([open]) { display: none; }
#photo-lightbox[open] {
    position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .75rem; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
    padding: calc(3rem + .75rem) 1rem 1.5rem; border: 0; background: rgb(8 13 18 / 96%); color: #f2f5f8; /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
    text-align: center; cursor: zoom-out;
}
#photo-lightbox::backdrop { background: rgb(8 13 18 / 72%); } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
#photo-lightbox-img {
    max-width: 88vw; max-height: 70vh; max-height: 70dvh; min-height: 0; object-fit: contain;
    border-radius: .75rem; cursor: default;
}
#photo-lightbox-name { font-size: 1.0625rem; font-weight: 650; }
#photo-lightbox-hint { font-size: .875rem; color: #c9d2da; } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
#photo-lightbox .photo-lightbox-close {
    display: grid; place-items: center; position: absolute; top: 1rem; right: 1rem; min-width: 44px; min-height: 44px;
    border-radius: 50%; border: 1px solid #a0adb5; background: #29353a; color: var(--ds-on-dark); /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
}
#photo-lightbox .photo-lightbox-close:focus-visible { outline: 3px solid #a0ceff; outline-offset: 3px; } /* design-audit-allow: hardcoded-color — photo viewer chrome stays dark in both themes */
.player-profile .photo-clickable, #matchDetailModal .photo-clickable { cursor: zoom-in; }
