/* A single bounded dialog, persistent navigation and readable profile sections. */
body.royal-theme #profileDialog[open]{display:flex!important;flex-direction:column;gap:0;width:min(720px,calc(100vw - 20px));height:min(900px,calc(100dvh - 20px));max-height:calc(100dvh - 20px);padding:0!important;overflow:hidden!important;box-sizing:border-box;border:1px solid #88d8df88!important;border-radius:24px!important;background:linear-gradient(145deg,#12283d,#112035 60%,#162838)!important;color:#e5f2fa;box-shadow:0 24px 80px #000b,inset 0 1px #dcf4ff33}
#profileHeader190{display:flex;align-items:center;justify-content:space-between;flex:none;padding:16px 18px 10px;border-bottom:1px solid #9fcae51c;gap:10px}
#profileHeader190 small{font:700 10px/1.2 system-ui;letter-spacing:.12em;color:#e8cb83}
body.royal-theme #profileHeader190 h2{font:800 25px/1.2 system-ui!important;color:#e5f6ff!important;text-shadow:none!important;margin:3px 0!important}
body.royal-theme #profileHeader190 #closeProfile{position:static!important;flex:none}
#profileTabs190{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;flex:none;padding:10px 10px 12px;background:#0a1b2b88}
body.royal-theme #profileDialog[open] #profileTabs190 button{font:700 11px/1.2 system-ui!important;min-height:43px!important;padding:8px 2px!important;border-radius:11px!important;border:1px solid #54738b!important;border-bottom-width:2px!important;box-shadow:0 3px 6px #0002!important;background:linear-gradient(#294d65,#1b344a)!important;color:#e1eef7!important;-webkit-text-fill-color:#e1eef7!important;text-shadow:none!important;overflow-wrap:normal!important}
body.royal-theme #profileDialog[open] #profileTabs190 button[aria-selected=true]{background:linear-gradient(#f5df9e,#d8b65e)!important;color:#2b2335!important;-webkit-text-fill-color:#2b2335!important;border-color:#ffe6a3!important}
#profileScroll190{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:16px;flex:1}
#profileDialog[open] .profile-panel190[hidden],#profileDialog[open] .avatar-option[hidden]{display:none!important}
#profileDialog[open] .profile-panel190{outline:none;min-width:0}
body.royal-theme #profileDialog[open] h3{font:750 21px/1.25 system-ui!important;color:#a0eeea!important;letter-spacing:0!important;margin:18px 0 12px}
#profileDialog[open] p,#profileDialog[open] label,#profileDialog[open] small{line-height:1.45}
#profileDialog[open] p{font-size:13px;margin:10px 0;color:#bfd1df}
#profileDialog[open] .profile-label{font:650 12px/1.4 system-ui;color:#d0e0ec;display:block;margin:14px 0 5px}
body.royal-theme #profileDialog[open] input:not([type=file]),body.royal-theme #profileDialog[open] select{width:100%;box-sizing:border-box;min-height:47px;padding:11px 12px!important;border:1px solid #7798b4!important;border-radius:12px!important;background:#091d30!important;color:#f2f8ff!important;-webkit-text-fill-color:#f2f8ff!important;text-shadow:none!important;font:500 16px/1.3 system-ui!important;box-shadow:inset 0 1px 6px #0003!important;margin-top:5px}
body.royal-theme #profileDialog[open] select{appearance:auto!important;padding-right:22px!important}
body.royal-theme #profileDialog[open] select option{color:#f2f8ff!important;background:#12283d!important}
#profileHero190{display:flex;align-items:center;gap:14px;padding:16px;border:1px solid #c2e6e03b;border-radius:18px;background:radial-gradient(ellipse at 10% 10%,#36646577,transparent 70%),#0a1d30;min-height:80px}
#profileHero190>div:last-child{min-width:0}
body.royal-theme #profileHero190 h3{font-size:23px!important;color:#fff0bc!important;margin:3px 0 6px;overflow-wrap:anywhere}
#profileHero190 b{font-size:12px;color:#8fe3e5}
#profileHero190 small{font-size:11px;color:#c9dce4}
#profileBadge190{width:70px;height:70px;flex:none;border-radius:20px;border:2px solid #dfb878;background-size:cover;background-position:center;display:grid;place-items:center;font:800 27px system-ui;color:#ffe5a3;box-shadow:0 0 20px #dbb96e22}
#profileBadge190.frame-ice{border-color:#92ebff;box-shadow:0 0 20px #8ee6ff44}
#profileBadge190.frame-royal{border:3px double #ffd571;box-shadow:0 0 22px #ffd57166}
#profileDialog[open] #regionMessage{min-height:19px;color:#f3d487;font-size:12px}
#profileDialog[open] #regionMessage[data-saved=true]{color:#95edc6}
body.royal-theme #profileDialog[open] #saveProfile{width:100%;margin:4px 0 14px;font-size:15px!important}
#profileDialog[open] .profile-level{margin:10px 0;padding:15px!important;border:1px solid #6c8eaa55;background:#203b5255!important;border-radius:16px}
#profileDialog[open] #profileRank{font:750 24px/1.4 system-ui;color:#bde9f6}
#profileDialog[open] .profile-statline{font-size:11px;margin:12px 0;gap:8px;display:flex;justify-content:space-between}
#profileDialog[open] .profile-stats{gap:8px;margin:12px 0}
#profileDialog[open] .profile-stats>div{padding:12px 5px;border-radius:12px;background:#27405855}
#profileDialog[open] .profile-stats b{font-size:24px}
#profileDialog[open] .section-title{display:flex;align-items:center;justify-content:space-between;gap:8px}
#profileEmblemCount190{font-size:12px;color:#e6c987;white-space:nowrap}
#emblemFilters190{display:flex;gap:10px}
#emblemFilters190 button{flex:1}
body.royal-theme #profileDialog[open] .avatar-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:18px}
body.royal-theme #profileDialog[open] .avatar-option{background:linear-gradient(#28445a,#112c3f)!important;border:1px solid #53758d!important;box-shadow:inset 0 1px #ffffff12!important;opacity:1!important;min-height:110px!important;padding:9px 4px!important;text-shadow:none!important}
#profileDialog[open] .avatar-option img{width:48px;height:48px;object-fit:contain}
body.royal-theme #profileDialog[open] .avatar-option span{font:700 11px/1.3 system-ui!important;color:#e5eef5!important;-webkit-text-fill-color:#e5eef5!important;display:block;padding:5px 0 3px!important}
body.royal-theme #profileDialog[open] .avatar-option small{display:block;font:600 9px/1.2 system-ui!important;color:#c1d0df!important;-webkit-text-fill-color:#c1d0df!important}
body.royal-theme #profileDialog[open] .avatar-option[aria-disabled=true]{filter:none!important}
#profileDialog[open] .avatar-option[aria-disabled=true] img{opacity:.45;filter:grayscale(.7)}
body.royal-theme #profileDialog[open] .avatar-option.selected{border-color:#f8d982!important;background:linear-gradient(#466259,#233f3d)!important;outline:1px solid #f8d982!important;box-shadow:0 0 12px #f8d98233!important}
.initials190{display:grid;place-items:center;height:48px;font:800 24px system-ui;color:#e9d296}
.emblem-empty190{grid-column:1/-1}
#profileDialog[open] .profile-career{padding:0;background:none;border:0}
#profileDialog[open] .career-hero{padding:14px;border-radius:16px;background:#173d34;gap:12px}
#profileDialog[open] .career-hero img{width:58px;height:110px;object-fit:contain}
#profileDialog[open] .career-hero p{font-size:11px}
#profileDialog[open] .career-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
body.royal-theme #profileDialog[open] .career-choices button{font:750 13px/1.3 system-ui!important;padding:13px 10px!important;min-height:86px;opacity:1!important}
body.royal-theme #profileDialog[open] .career-choices button:disabled{background:#213d51!important;border-color:#506e83!important;color:#d0ddea!important;-webkit-text-fill-color:#d0ddea!important;filter:none!important;text-shadow:none!important;box-shadow:none!important}
body.royal-theme #profileDialog[open] .career-choices small{display:block;font:550 11px/1.4 system-ui!important;margin-top:8px}
.title-progress190{display:block;height:5px;border-radius:4px;background:#061a2d;overflow:hidden;margin-top:12px}
.title-progress190 i{display:block;height:100%;background:linear-gradient(90deg,#5bd1d2,#ffdd85);border-radius:4px}
#profileDialog[open] .career-history{padding:0;list-style:none}
#profileDialog[open] .career-history li{gap:8px;padding:12px 0;font-size:12px;border-bottom:1px solid #6e92ac44}
#profileDialog[open] #playerStats75{padding:0;border:0;background:none}
#profileDialog[open] .player-grid75{gap:10px}
#profileDialog[open] .player-grid75>div{padding:13px;background:#26455d88;border:1px solid #7090aa55;border-radius:14px}
#profileDialog[open] .player-grid75 dt{font-size:12px}
#profileDialog[open] .player-grid75 dd{font-size:25px;color:#f1d492}
#profileDialog[open] .backup-panel{padding:16px;background:#233d5366;border:1px solid #63819a55;border-radius:16px;margin:0 0 16px}
#profileDialog[open] .backup-panel button{max-width:100%}
@media(min-width:600px){body.royal-theme #profileDialog[open] .avatar-grid{grid-template-columns:repeat(6,minmax(0,1fr))}#profileScroll190{padding:24px}body.royal-theme #profileDialog[open] #profileTabs190 button{font-size:14px!important}}
@media(max-width:370px){#profileScroll190{padding:12px}body.royal-theme #profileDialog[open] #profileTabs190 button{font-size:10px!important}#profileTabs190{gap:3px;padding-inline:7px}body.royal-theme #profileDialog[open] .avatar-grid{gap:7px}#profileBadge190{width:54px;height:54px}#profileHero190{padding:12px}}
/* Join the existing first control layer so these scoped rules win its !important theme. */
@layer controls183 {
 body.royal-theme #profileDialog[open] #profileTabs190 button{font:700 11px/1.2 system-ui!important;letter-spacing:0!important;background:linear-gradient(#294d65,#1b344a)!important;color:#e1eef7!important;-webkit-text-fill-color:#e1eef7!important;border-color:#54738b!important;padding:8px 2px!important}
 body.royal-theme #profileDialog[open] #profileTabs190 button[aria-selected=true]{background:linear-gradient(#f5df9e,#d8b65e)!important;color:#2b2335!important;-webkit-text-fill-color:#2b2335!important;border-color:#ffe6a3!important}
 body.royal-theme #profileDialog[open] select{font:500 16px/1.3 system-ui!important;background:#091d30!important;color:#f2f8ff!important;-webkit-text-fill-color:#f2f8ff!important;letter-spacing:0!important}
 body.royal-theme #profileDialog[open] select option{background:#12283d!important;color:#f2f8ff!important}
 body.royal-theme #profileDialog[open] .avatar-option{background:linear-gradient(#28445a,#112c3f)!important;border:1px solid #53758d!important;box-shadow:inset 0 1px #ffffff12!important;opacity:1!important}
 body.royal-theme #profileDialog[open] .avatar-option.selected{background:linear-gradient(#466259,#233f3d)!important;border-color:#f8d982!important;outline:1px solid #f8d982!important}
 body.royal-theme #profileDialog[open] .avatar-option span{font:700 11px/1.3 system-ui!important;color:#e5eef5!important;-webkit-text-fill-color:#e5eef5!important;letter-spacing:0!important}
 body.royal-theme #profileDialog[open] .avatar-option small{font:600 9px/1.2 system-ui!important;color:#c1d0df!important;-webkit-text-fill-color:#c1d0df!important;letter-spacing:0!important}
 body.royal-theme #profileDialog[open] .career-choices button{font:750 13px/1.3 system-ui!important;letter-spacing:0!important;opacity:1!important}
 body.royal-theme #profileDialog[open] .career-choices button:disabled{background:#213d51!important;border-color:#506e83!important;color:#d0ddea!important;-webkit-text-fill-color:#d0ddea!important;opacity:1!important;filter:none!important}
 body.royal-theme #profileDialog[open] .career-choices small{font:550 11px/1.4 system-ui!important;letter-spacing:0!important}
 @media(max-width:370px){body.royal-theme #profileDialog[open] #profileTabs190 button{font-size:10px!important}}
 @media(min-width:600px){body.royal-theme #profileDialog[open] #profileTabs190 button{font-size:14px!important}}
}
#profileDialog #profileHeader190{background:linear-gradient(110deg,#213f57,#163047)!important}
@media(max-width:480px){
 #profileDialog #profileTabs190{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;padding:9px 10px}
 #profileDialog #profileTabs190 button{grid-column:span 2}
 #profileDialog #profileTabs190 button:nth-child(n+4){grid-column:span 3}
 @layer controls183{body.royal-theme #profileDialog[open] #profileTabs190 button{font-size:12px!important}}
}
