.player-profile-page{padding-top:20px;padding-bottom:24px;max-width:950px}
.player-profile-back{display:inline-block;margin-bottom:12px;font-size:13px}
.player-profile{padding:20px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:14px}
.player-profile header{display:grid;grid-template-columns:auto minmax(0,1fr);gap:3px 10px}
.player-profile header .eyebrow{grid-column:1/-1;font-size:10px;line-height:1.3;letter-spacing:.08em}
.player-profile h1{grid-column:1/-1;margin:1px 0;font-size:26px;line-height:1.2;overflow-wrap:anywhere}
.player-profile header p{margin:0;font-size:12px;line-height:1.4;color:var(--muted)}
.player-profile header .player-profile-age{grid-column:1/-1;margin-bottom:3px;font-size:12px;font-weight:600}
.player-profile-owner{text-align:right;font-weight:700;overflow-wrap:anywhere}
.player-profile-rookie{font-size:9px;font-weight:800;text-decoration:none;color:var(--gold)}
html[data-theme="dark"] .player-profile-rookie{color:var(--gold)}
.player-profile-overview{margin:12px 0 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.player-profile-overview>div{display:grid;grid-template-columns:74px minmax(0,1fr);align-items:center;gap:10px;padding:6px 0}
.player-profile-overview>div+div{border-top:1px solid var(--line)}
.player-profile-overview dt{font-size:11px;font-weight:700;color:var(--muted)}
.player-profile-overview dd{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:2px 10px;min-width:0;margin:0;font-size:13px}
.player-profile-overview dd strong{font-weight:700}
.player-profile-overview dd span{font-size:11px;color:var(--muted)}
.player-profile-overview .player-profile-projection{font-size:22px;font-weight:800;color:var(--accent,#157b86);font-variant-numeric:tabular-nums}
.player-profile-time,.player-profile-note{font-size:11px;color:var(--muted);line-height:1.4;margin:7px 0}
.player-profile-table{overflow-x:auto;max-width:100%;margin-top:8px;overscroll-behavior-x:contain}
.player-profile table{width:100%;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums}
.player-profile th,.player-profile td{text-align:right;padding:6px 7px;border-bottom:1px solid var(--line);white-space:nowrap}
.player-profile th:first-child{text-align:left}
.player-profile thead{color:var(--muted);background:var(--panel-2)}
.player-profile h2{font-size:14px;margin:12px 0 5px}
.player-profile-season-table table{min-width:450px}
.player-profile-season-table th,.player-profile-season-table td{padding:6px 4px;font-size:11px}
.player-profile-season-table th:first-child{position:sticky;left:0;background:var(--panel);z-index:1}
.player-profile-season-table thead th:first-child{background:var(--panel-2)}
.player-profile-actions{display:flex;justify-content:space-between;align-items:center;gap:6px 12px;flex-wrap:wrap;font-size:11px;margin-top:7px}
.player-profile-actions a{display:inline-flex;align-items:center;min-height:36px}
.player-stats-dialog{padding:0;border:0;border-radius:14px;width:min(680px,calc(100vw - 16px));max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;background:var(--panel);color:var(--text);box-shadow:0 20px 90px #0006}
.player-stats-dialog::backdrop{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.player-stats-close{position:sticky;top:5px;float:right;margin:5px 5px -49px 0;z-index:2;width:44px;height:44px;border:1px solid var(--line);background:var(--panel-2);color:var(--text);border-radius:50%;font-size:25px;cursor:pointer}
.player-stats-dialog .player-profile{border:0;padding:14px}
.player-stats-dialog .player-profile header{padding-right:36px}
.player-stats-dialog .player-profile h1{font-size:22px}
.player-stats-dialog .player-profile header .eyebrow{font-size:9px}
.player-stats-loading,.player-stats-error{padding:45px 25px;font-size:14px}
.player-stats-error a{display:block;margin-top:10px}
@media(max-width:550px){
 .player-profile,.player-stats-dialog .player-profile{padding:12px}
 .player-profile h1,.player-stats-dialog .player-profile h1{font-size:20px}
 .player-profile header{grid-template-columns:1fr}
 .player-profile-owner{text-align:left}
 .player-profile header p{font-size:11px}
 .player-profile-overview{margin-top:9px}
 .player-profile-overview>div{grid-template-columns:65px minmax(0,1fr);gap:6px;padding:5px 0}
 .player-profile-overview dd{font-size:12px;gap:2px 7px}
 .player-profile th,.player-profile td{padding:6px 4px;font-size:11px}
 .player-profile-time,.player-profile-note{font-size:10px}
 .player-profile-actions{gap:4px 10px;font-size:10px}
}

/* Inline popup styles override older footer assets on already-open pages. */
#player-stats-dialog{width:min(560px,calc(100vw - 16px));max-width:calc(100vw - 16px);max-height:calc(100dvh - 20px);border-radius:12px}
#player-stats-dialog .player-profile{padding:10px;border-radius:12px}
#player-stats-dialog .player-profile header{display:block;margin:-10px -10px 0;padding:9px 46px 8px 10px;background:var(--heading-bg);color:#fff}
#player-stats-dialog .player-profile header .eyebrow{font-size:8px;line-height:1.2;letter-spacing:.06em;color:#e3c777}
#player-stats-dialog .player-profile h1{margin:3px 0 2px;padding:0;font-size:18px;line-height:1.15;color:#fff}
#player-stats-dialog .player-profile header p,#player-stats-dialog .player-profile header .player-profile-age{margin:0;font-size:10px;line-height:1.4;color:#d5e2ef}
#player-stats-dialog .player-profile header .player-profile-owner{margin-top:1px;text-align:left;font-size:10px}
#player-stats-dialog .player-profile-owner a{color:#fff}
#player-stats-dialog .player-profile-rookie{color:var(--gold)}
#player-stats-dialog .player-stats-close{top:3px;width:40px;height:40px;margin:3px 3px -43px 0;border-color:#ffffff30;background:var(--heading-bg);color:#fff;font-size:24px}
#player-stats-dialog .player-profile-overview{display:grid;grid-template-columns:.8fr 1fr 1fr;gap:0;margin:0 -10px;padding:7px 10px;background:var(--panel-2);border-top:0;border-bottom:1px solid var(--line)}
#player-stats-dialog .player-profile-overview>div{display:block;min-width:0;padding:0 8px;border:0}
#player-stats-dialog .player-profile-overview>div:first-child{padding-left:0}
#player-stats-dialog .player-profile-overview>div+div{border-left:1px solid var(--line)}
#player-stats-dialog .player-profile-overview dt{font-size:9px;line-height:1.2;font-weight:700}
#player-stats-dialog .player-profile-overview dd{display:block;margin:3px 0 0;font-size:11px;line-height:1.2}
#player-stats-dialog .player-profile-overview dd strong{display:block;font-size:11px;line-height:1.2}
#player-stats-dialog .player-profile-overview dd span{display:block;margin-top:2px;font-size:9px;line-height:1.2;overflow-wrap:anywhere}
#player-stats-dialog .player-profile-overview .player-profile-projection{font-size:20px;line-height:1.1;font-weight:800}
#player-stats-dialog .player-profile-time{margin:5px 0;font-size:9px;line-height:1.3}
#player-stats-dialog .player-profile-table{margin-top:5px}
#player-stats-dialog .player-profile th,#player-stats-dialog .player-profile td{padding:5px 4px;font-size:11px;line-height:1.2}
#player-stats-dialog .player-profile h2{margin:9px 0 4px;font-size:12px;line-height:1.2}
#player-stats-dialog .player-profile-season-table table{min-width:0;table-layout:fixed}
#player-stats-dialog .player-profile-season-table th,#player-stats-dialog .player-profile-season-table td{padding:5px 1px;font-size:10px;line-height:1.2}
#player-stats-dialog .player-profile-season-table th:first-child{width:45px}
#player-stats-dialog .player-profile-season-table th:nth-child(3){width:47px}
.player-profile-method{margin-top:5px;font-size:10px;color:var(--muted)}
.player-profile-method summary{cursor:pointer;padding:5px 0;font-size:10px;line-height:1.3}
.player-profile-method .player-profile-note{margin:2px 0 6px}
#player-stats-dialog .player-profile-actions{gap:4px 10px;margin-top:0;font-size:10px}
#player-stats-dialog .player-profile-actions a{min-height:30px}
@media(max-width:350px){
 #player-stats-dialog .player-profile-season-table th,#player-stats-dialog .player-profile-season-table td{font-size:9px}
 #player-stats-dialog .player-profile-season-table th:first-child{width:40px}
 #player-stats-dialog .player-profile-season-table th:nth-child(3){width:42px}
 #player-stats-dialog .player-profile h1{font-size:17px}
}

.player-profile-today{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;padding:8px 0;border-bottom:1px solid var(--line);font-size:12px;line-height:1.3;font-variant-numeric:tabular-nums}
.player-profile-today-label{font-weight:800}
.player-profile-today-label small{margin-left:5px;font-size:9px;font-weight:600;color:var(--muted)}
.player-profile-today strong{color:var(--accent);white-space:nowrap}
.player-profile-today strong small{font-size:10px;font-weight:600}
.player-profile-today-line{flex:1;min-width:0;color:var(--muted)}
#player-stats-dialog .player-profile-today{padding:6px 0;gap:3px 8px;font-size:10px;line-height:1.3}
#player-stats-dialog .player-profile-today-line{font-size:10px}
#player-stats-dialog .player-profile th,#player-stats-dialog .player-profile td{padding-top:4px;padding-bottom:4px}
#player-stats-dialog .player-profile h2{margin-top:7px}
@media(max-height:600px){
 #player-stats-dialog .player-profile th,#player-stats-dialog .player-profile td{padding-top:3px;padding-bottom:3px}
 #player-stats-dialog .player-profile header{padding-top:6px;padding-bottom:6px}
 #player-stats-dialog .player-profile-time{margin:3px 0}
}

/* Modeless player panel: the page remains clear and usable. */
#player-stats-dialog{position:fixed;inset:auto;margin:0;left:50%;top:80px;transform:translateX(-50%);z-index:2500;resize:both;min-width:min(280px,calc(100vw - 16px));min-height:180px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
#player-stats-dialog .player-profile header{cursor:move;touch-action:none;user-select:none}
#player-stats-dialog .player-profile header a{cursor:pointer}

/* A distinct frame separates the floating panel from the page. */
html[data-theme] #player-stats-dialog{box-sizing:border-box;border:2px solid var(--focus);border-radius:16px;box-shadow:0 0 0 3px var(--accent-soft),0 12px 36px rgba(0,0,0,.4)}
