.user-profile-dialog{box-sizing:border-box;width:min(660px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:22px;border:1px solid #55c5ef;border-radius:16px;background:linear-gradient(150deg,#102c40,#061522);color:#e4f2fa;box-shadow:0 18px 80px #0009;font:14px/1.5 system-ui,sans-serif}
.user-profile-dialog::backdrop{background:#020b15cf;backdrop-filter:blur(5px)}
.user-profile-dialog header{display:flex;justify-content:space-between;align-items:center;gap:16px}.user-profile-dialog header h2{font-size:26px;margin:0}.user-profile-dialog header small{color:#6ccde9;letter-spacing:2px;font-size:10px}
.user-profile-dialog button{min-height:44px;padding:9px 16px;border:1px solid #5687a4;border-radius:8px;background:#16374b;color:#e7f6ff;font:700 14px/1.3 system-ui;cursor:pointer}.user-profile-dialog button:disabled{opacity:.45;cursor:not-allowed}.user-profile-dialog #upClose{font-size:24px;min-width:44px;padding:4px}
.user-profile-dialog fieldset{padding:0;border:0;margin:0;min-width:0}.user-profile-dialog label{display:block;font-weight:600;margin:12px 0}.user-profile-dialog input,.user-profile-dialog textarea{box-sizing:border-box;width:100%;display:block;margin-top:5px;padding:10px;border:1px solid #4a6f85;border-radius:7px;background:#061722;color:#ecf8ff;font:16px/1.5 system-ui;min-width:0}.user-profile-dialog textarea{resize:vertical}.user-profile-dialog input:read-only{color:#9cb5c5}.user-profile-dialog fieldset:disabled input,.user-profile-dialog fieldset:disabled textarea{opacity:.65}.user-profile-dialog p{font-size:12px;color:#a8c5d8;overflow-wrap:anywhere}
.user-profile-dialog .up-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px}.user-profile-dialog .up-identity{display:flex;align-items:center;gap:18px;margin:18px 0}.user-profile-dialog .up-identity img{width:84px;height:84px;object-fit:cover;border-radius:18px;border:1px solid #5ad5f2}.user-profile-dialog h3{font-size:16px;margin:12px 0 4px}.user-profile-dialog .up-presets{display:flex;gap:12px}.user-profile-dialog .up-presets button{padding:4px;width:76px;height:76px}.user-profile-dialog .up-presets img{display:block;width:100%;height:100%;object-fit:contain}.user-profile-dialog [aria-pressed=true]{outline:2px solid #4de3b6}.user-profile-dialog #upSave{width:100%;margin:16px 0;background:linear-gradient(#146185,#10384f);border-color:#57c8e7}.user-profile-dialog .up-actions{display:flex;gap:10px;flex-wrap:wrap}.user-profile-dialog #upNotice{padding:12px;background:#1b3948;border-radius:8px;min-height:20px;color:#b7ecfa}.user-profile-dialog #upHistoryList{margin-top:14px}.user-profile-dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;background:#05121b;padding:12px;border-radius:6px}.user-profile-dialog details{margin:8px 0}.user-profile-dialog :focus-visible{outline:2px solid #62e4ff;outline-offset:2px}
#playerProfile .profile-display-name{display:block;max-width:160px;font:600 12px/1.3 system-ui;color:#80e2f4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:0}
@media(max-width:540px){.user-profile-dialog{padding:16px}.user-profile-dialog .up-columns{grid-template-columns:minmax(0,1fr);gap:0}#playerProfile .profile-display-name{font-size:10px;max-width:110px}}
@media(max-height:600px) and (orientation:landscape){#playerProfile .profile-display-name{font-size:9px;max-width:120px}}

.user-profile-dialog header{position:sticky;top:-22px;z-index:2;background:#102b3d;margin:-22px -22px 16px;padding:18px 22px;border-bottom:1px solid #31566b}.user-profile-dialog textarea{min-height:80px}@media(max-width:540px){.user-profile-dialog header{top:-16px;margin:-16px -16px 14px;padding:14px 16px}}

.up-port-details{margin-top:20px;padding-top:14px;border-top:1px solid #40657a}.up-port-details dl{margin:0}.up-port-details dl>div{display:flex;justify-content:space-between;gap:12px;padding:8px 0}.up-port-details dt{color:#a1bdcf}.up-port-details dd{margin:0;text-align:right;overflow-wrap:anywhere;min-width:0}

/* Reference nameplate: the PNG contains only frame art; identity and level stay live. */
html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile{container-type:inline-size;position:absolute;left:auto;right:calc(1.2% + 12px);top:8px;transform:none!important;display:block!important;width:min(300px,calc(21.8% - 20px));max-width:none!important;aspect-ratio:1833/680;height:auto!important;min-height:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;overflow:visible;isolation:isolate;z-index:8}
html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile::after{content:'';position:absolute;left:-15.0027%;top:-2.35294%;width:118.494%;height:106.4706%;background:url('assets/profile-neon-frame.png') center/100% 100% no-repeat;pointer-events:none;z-index:2}
html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile>.player-avatar{display:block!important;position:absolute;left:8.18%;top:14.56%;width:24.55%;height:66.18%;border:0!important;border-radius:50%;object-fit:cover;box-shadow:none!important;z-index:1}
html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile .player-identity{display:contents!important;position:static!important}
html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile .player-identity>b,html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile .player-identity>small:not(#profileLevelBadge),html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile>.player-rank,html body.portfolio-redesign .stage #playerProfile>.hud-fold{display:none!important}
html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile .profile-display-name{position:absolute;left:39.5%;top:33%;width:53%;height:37%;max-width:none;display:flex;align-items:center;justify-content:flex-start;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:clip;font:900 clamp(12px,9cqw,29px)/1.25 system-ui,sans-serif;color:#eff9ff;text-shadow:0 1px #c4eaff,0 2px 2px #021126,0 0 6px #008bcb;letter-spacing:0;z-index:3}
html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile #profileLevelBadge{display:flex!important;align-items:center;justify-content:center;position:absolute;left:9.8%;top:74%;width:21.5%;height:16%;font:800 clamp(9px,4.7cqw,15px)/1.2 F1Barlow,Arial,sans-serif;color:#efffff;letter-spacing:0;white-space:nowrap;text-shadow:0 0 4px #00ccff;z-index:3}
@media(max-width:700px) and (orientation:portrait),(max-width:540px){
 html body.portfolio-redesign:not(.normal-ui) .stage{grid-template-rows:var(--battle-row) 68px var(--army-row) minmax(56px,1fr) var(--tactical-row) var(--support-row) var(--round-row) 38px}
 html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile{position:relative;inset:auto;grid-row:2;grid-column:2;justify-self:start;align-self:start;width:calc(100% - 6px)}
}
@media(max-height:600px) and (orientation:landscape) and (min-width:541px){html body.portfolio-redesign:not(.normal-ui) .stage #playerProfile{top:4px;width:22%;right:calc(1.2% + 8px)}}

#playerProfile .profile-display-name{text-align:left}
