.player-profile-dialog { border: var(--t-panel-border); padding: 0; width: min(440px, calc(100vw - 24px)); max-height: min(90vh, 700px); background: var(--t-panel-bg); color: var(--t-panel-text); box-shadow: var(--z-frame), 5px 5px 0 var(--z-shadow); }
.player-profile-dialog::backdrop { background: #080604b8; }
.player-profile-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; background: var(--t-panel-header-bg); color: var(--t-panel-header-color); border-bottom: 3px solid var(--t-panel-header-line); }
.player-profile-card header h2 { margin: 0; font-size: 16px; }
.player-profile-card header button { flex: 0 0 auto; min-width: 30px; padding: 2px 7px; }
.player-profile-body { padding: 16px; overflow: auto; max-height: calc(90vh - 56px); }
.player-profile-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.player-profile-photo { width: 96px; height: 96px; flex: 0 0 96px; display: grid; place-items: center; font-size: 42px; background: var(--t-card-bg); border: 3px solid var(--t-card-border); color: var(--t-card-text); position: relative; }
.player-profile-photo::after { content: ''; position: absolute; inset: -8px; background: none; image-rendering: pixelated; pointer-events: none; }
.player-profile-photo img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.player-profile-identity h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.player-profile-identity p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.player-profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.player-profile-stats div { display: grid; gap: 6px; padding: 9px; background: var(--t-field-bg); color: var(--t-field-color); border: var(--t-field-border); }
.player-profile-stats strong { font-size: 12px; }
.player-profile-stat-value { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.player-profile-stat-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; overflow: hidden; }
/* Rank > Profile controls emblem size and position without a clipping container. */
.player-profile-rank-icon { box-sizing: border-box; overflow: visible; color: var(--t-field-color); font-size: 19px;
  width: calc(30px * var(--rank-profile-emblem-scale, 1)); height: calc(30px * var(--rank-profile-emblem-scale, 1)); flex-basis: calc(30px * var(--rank-profile-emblem-scale, 1)); }
.player-profile-rank-icon img { width: 100%; height: 100%; image-rendering: pixelated; }
.player-profile-rank-icon img[hidden] { display: none; }
.player-profile-team-icon { font-size: 23px; }
.player-profile-team-icon img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.player-profile-card form { display: grid; gap: 10px; border-top: 2px solid var(--t-panel-header-line); padding-top: 12px; }
.player-profile-card form[hidden] { display: none; }
.player-profile-card label { display: grid; gap: 5px; }
.player-profile-portraits[hidden] { display: none; }
.player-profile-portraits { display: grid; gap: 7px; }
.player-profile-portraits > strong { font-size: 13px; }
.player-profile-portrait-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; }
.player-profile-portrait-choice { display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 5px; border: 2px solid var(--t-card-border); background: var(--t-card-bg); color: var(--t-card-text); cursor: pointer; font: inherit; }
.player-profile-portrait-choice:hover, .player-profile-portrait-choice:focus-visible { border-color: var(--t-card-selected-border); background: var(--t-card-bg); }
.player-profile-portrait-choice[aria-pressed="true"] { border-color: var(--t-card-selected-border); box-shadow: inset 0 0 0 2px var(--t-card-selected-border); }
.player-profile-portrait-choice img { width: 56px; height: 56px; object-fit: cover; image-rendering: pixelated; }
.player-profile-portrait-choice span { max-width: 100%; overflow-wrap: anywhere; text-align: center; font-size: 11px; line-height: 1.15; }
.player-profile-card textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.player-profile-card input[type="file"] { width: 100%; min-width: 0; box-sizing: border-box; overflow: hidden; }
.player-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#playerProfileStatus { min-height: 1em; margin: 10px 0 0; color: var(--z-red-light); }
.player-profile-trigger { cursor: pointer; font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; text-decoration: underline; text-decoration-style: dotted; }
.player-profile-trigger:hover { color: var(--t-card-hover-border); }
.chat-card #messages .chat-name.player-profile-trigger { background: transparent; border: 0; box-shadow: none; padding: 0; min-height: 0; text-decoration: none; translate: none; filter: none; }
.chat-card #messages .chat-name.player-profile-trigger:hover { background: transparent; box-shadow: none; text-decoration: underline; translate: none; filter: none; }
.chat-card #messages .chat-name.player-profile-trigger:active { background: transparent; box-shadow: none; translate: none; }
.party-hud .player-profile-trigger { pointer-events: auto; }
#playerHud .player-name[data-account-id]:not([data-account-id=""]) { pointer-events: auto; cursor: pointer; }
@media (max-width: 440px) { .player-profile-stats { grid-template-columns: 1fr; } .player-profile-photo { width: 72px; height: 72px; flex-basis: 72px; } }
