/* PR100: shared illustrated identity. All selectors are Rank/Profile/Home scoped. */
.rank-gem{display:inline-flex;position:relative;flex:0 0 auto;align-items:center;justify-content:center;vertical-align:middle;filter:drop-shadow(0 3px 4px #0008)}
.rank-gem-small{width:29px;height:29px}.rank-gem-medium{width:39px;height:39px}.rank-gem-large{width:58px;height:58px}.rank-gem-hero{width:86px;height:86px}
.rank-gem>img{display:block;width:100%;height:100%;object-fit:contain}
.rank-gem-name{position:absolute;top:100%;white-space:nowrap}
.rank-identity{display:flex;gap:18px;align-items:center;min-width:0;text-align:left}
.rank-identity .rank-gem-large{width:80px;height:80px}
.rank-identity .rank-gem-hero{width:114px;height:114px}
.rank-identity-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.rank-identity-copy>strong{font:700 clamp(19px,2vw,28px)/1.15 Georgia,serif;color:#faf1df}
.rank-identity-copy>b{font-size:17px;color:#fff;font-variant-numeric:tabular-nums}
.rank-identity-copy>small{font-size:12px;line-height:1.35;color:#c6c2ba}
.rank-identity[data-rank-id=red_diamond] .rank-identity-copy>strong{color:#ffb7c2}
.rank-identity-gauge{height:5px;width:100%;max-width:280px;background:#ffffff15;border-radius:4px;overflow:hidden;margin-top:5px}
.rank-identity-gauge>i{display:block;height:100%;background:linear-gradient(90deg,#8b7651,#f1d39a);border-radius:inherit}
.rank-identity[data-rank-id=diamond] .rank-identity-gauge>i{background:#b1dcff}
.rank-identity[data-rank-id=red_diamond] .rank-identity-gauge>i{background:#eb6078}
.rank-profile-card.rank-profile-ready{display:block;padding:20px;background:#111723eb;border:1px solid #b1a28a35;border-radius:12px}
.rank-private-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:16px 0;padding-top:12px;border-top:1px solid #ffffff14}
.rank-private-stats>div{min-width:0}.rank-private-stats dt,.rank-history dt{font-size:11px;color:#b8b5b0;margin-bottom:5px}
.rank-private-stats dd,.rank-history dd{font-size:15px;color:#eee;margin:0;font-variant-numeric:tabular-nums}
.rank-history{border-top:1px solid #ffffff14;padding-top:10px}
.rank-history-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;color:#d8c7a5}
.rank-history select{min-width:0;max-width:200px;border:1px solid #ffffff24;border-radius:5px;padding:5px;background:#182131;color:#eae3d7;font-size:12px}
.rank-history dl{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:10px 0}
.rank-history>small,.rank-history>p{font-size:10px;color:#aaa;line-height:1.4;margin:0}
.home-player-hud{display:flex;flex:1 1 auto;align-items:center;justify-content:flex-end;gap:clamp(4px,1vw,20px);min-width:0;margin-left:auto;padding:0 clamp(2px,1vw,20px);box-sizing:border-box;line-height:1.1;container:home-hud / inline-size}
.home-player-identity{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:baseline;align-content:center;column-gap:10px;row-gap:3px;min-width:min-content}
.home-player-identity>strong{flex:0 0 auto;font-size:13px;color:#fff;white-space:nowrap}
.home-player-identity>small{flex:0 0 auto;font-size:11px;color:#d0bb8e;white-space:nowrap}
.home-player-stones{display:flex;flex:0 0 auto;gap:6px;align-items:center;white-space:nowrap;color:#eee4d0}
.home-player-stones b{font-size:13px;font-variant-numeric:tabular-nums}.home-player-stones small{font-size:10px;color:#aaa}
body .shared-mode-grid #rankedMode{padding:22px 26px;display:flex;flex-direction:column;justify-content:center;align-items:stretch;gap:8px}
body .shared-mode-grid #rankedMode:before{display:none}
body .shared-mode-grid #rankedMode>b,body .shared-mode-grid #rankedMode>small{text-align:left}
body .shared-mode-grid #rankedMode .rank-identity{margin-top:12px}
.online-entry-rank-status{font-size:13px;margin-top:15px;color:#c8c3b7}
body .profile-panel{max-width:1000px}
body .profile-panel .rank-profile-card{overflow:visible}
@media(orientation:landscape) and (max-height:600px){
  .home-player-stones b{font-size:11px}.home-player-stones small{display:none}
  body .shared-mode-grid #rankedMode{padding:12px 18px;gap:3px}
  body .shared-mode-grid #rankedMode>b{font-size:21px}
  body .shared-mode-grid #rankedMode>small{font-size:11px}
  body .shared-mode-grid #rankedMode .rank-identity{margin-top:4px}
  .rank-identity{gap:10px}.rank-identity .rank-gem-hero{width:78px;height:78px}.rank-identity .rank-gem-large{width:56px;height:56px}
  .rank-identity-copy{gap:3px}.rank-identity-copy>strong{font-size:20px}.rank-identity-copy>b{font-size:14px}.rank-identity-copy>small{font-size:11px}
  .rank-identity-gauge{margin-top:3px;height:4px}
  body.general-mobile-active .profile-panel{grid-template-columns:minmax(0,1fr) 170px;gap:6px 12px;padding:12px 18px}
  body .profile-panel h1{font-size:20px;margin-bottom:2px}
  body .profile-panel .rank-profile-card{padding:9px 12px;overflow:visible}
  .profile-panel .rank-identity .rank-gem-hero{width:65px;height:65px}
  .profile-panel .rank-identity-copy>strong{font-size:19px}
  .rank-private-stats{gap:5px;margin:7px 0;padding-top:7px}
  .rank-private-stats dt,.rank-history dt{font-size:10px;margin-bottom:2px;white-space:nowrap}
  .rank-private-stats dd,.rank-history dd{font-size:12px}
  .rank-history{padding-top:6px}.rank-history-heading{font-size:10px}
  .rank-history select{font-size:10px;padding:2px 4px;max-width:155px}
  .rank-history dl{margin:5px 0;gap:5px}.rank-history>small{display:block;font-size:9px;line-height:1.3}
  body .profile-panel .profile-actions{display:flex;flex-direction:column;justify-content:center;gap:5px}
  body .profile-panel .profile-actions button{min-height:33px;padding:4px 6px;font-size:11px}
}
@media(max-width:780px) and (orientation:landscape){
  body.general-mobile-active .profile-panel{grid-template-columns:minmax(0,1fr) 143px;padding:8px 12px;gap:4px 8px}
  .rank-private-stats{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}.rank-private-stats dt{font-size:9px}
  .profile-panel .rank-identity .rank-gem-hero{width:58px;height:58px}
}

/* The Home HUD uses the same server identity and asset renderer as Rank Profile. */
body:has(.title-app){--shared-bar:52px;--shared-header-height:calc(52px + env(safe-area-inset-top));--mobile-header:var(--shared-header-height)}
.home-player-rank{min-width:0;flex:0 0 auto}
.home-player-rank .rank-identity{gap:8px}
.home-player-rank .rank-gem-small{width:46px;height:46px}
.home-player-rank .rank-identity-copy{gap:2px}
.home-player-rank .rank-identity-copy>strong{font-size:13px}
.home-player-rank .rank-identity-copy>b{font-size:12px}
.home-player-rank .rank-identity-copy>small{font-size:10px}
.home-rank-status{font-size:10px;color:#c6c2ba}
.ranked-compat-identity{display:flex!important;align-items:center;gap:10px;grid-column:1/-1}
.ranked-compat-identity>div{display:grid;gap:4px}
.ranked-result-authoritative>header strong,.rank-promotion-stage>strong{color:#faf1df}
.ranked-result-authoritative>header:has([data-rank-gem=red_diamond]) strong,.rank-promotion-stage:has([data-rank-gem=red_diamond])>strong{color:#ffb7c2}
@media(max-width:780px) and (orientation:landscape){.rank-private-stats dt{white-space:normal;line-height:1.25;min-height:2.5em}}
@media(max-width:720px){.rank-gem-hero{width:72px;height:72px}}
@media(orientation:landscape) and (max-height:600px){
 .home-player-hud{gap:6px;padding-inline:4px}
 .home-player-rank .rank-gem-small{width:40px;height:40px}
 .home-player-rank .rank-identity{gap:6px}
 .home-player-rank .rank-identity-copy>strong{font-size:12px}
 .home-player-rank .rank-identity-copy>b{font-size:11px}
 .home-player-rank .rank-identity-copy>small{font-size:9px}
}

/* Preserve readable names before letting only the title use a second line.
   The query follows the actual HUD cell, including Safe Area / sibling space. */
@container home-hud (max-width:560px){
 .home-player-identity{column-gap:5px}
 .home-player-identity>strong{font-size:clamp(11px,2.5cqi,13px)}
 .home-player-identity>small{font-size:11px}
 .home-player-stones{gap:4px}
 .home-player-stones b{font-size:11px}
 .home-player-stones small{display:none}
 .home-player-rank .rank-identity{gap:5px}
 .home-player-rank .rank-identity-copy>strong{font-size:12px}
 .home-player-rank .rank-identity-copy>b{font-size:11px}
 .home-player-rank .rank-identity-copy>small{font-size:9px}
}
@container home-hud (max-width:420px){
 .home-player-identity{column-gap:4px}
 .home-player-rank .rank-gem-small{width:38px;height:38px}
}
@container home-hud (max-width:330px){
 .home-player-rank .rank-gem-small{width:36px;height:36px}
 .home-player-rank .rank-identity{gap:4px}
}
@media(max-width:780px){
 .title-app .home-player-hud{gap:4px;padding-inline:2px}
 body .title-app>.topbar.shared-header{gap:4px}
 body .title-app>.topbar.shared-header .brand{padding-inline:4px}
}

/* Ranked identity stays within the existing two-row nameplate. No extra HUD
   height, backdrop or artwork scaling; the gem gets its own full-height lane. */
.battle-rank{display:inline-flex;align-items:center;gap:4px}
.battle-rank-name{font-size:12px;font-weight:700;color:#efe5ca;white-space:nowrap}
body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .nameplate-content:has(.battle-rank){grid-template-columns:34px max-content minmax(0,1fr);column-gap:5px}
body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .battle-rank{display:contents}
body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .battle-rank>.rank-gem{grid-column:1;grid-row:1/3;width:34px;height:34px;align-self:center;margin:0}
body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .battle-rank-name{grid-column:2;grid-row:2;align-self:center;line-height:16px}
body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .nameplate-content:has(.battle-rank) .nameplate-role{display:none}
body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .nameplate-content:has(.battle-rank) .nameplate-player{grid-column:2/-1;margin-inline:0}
body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .nameplate-content:has(.battle-rank) .nameplate-title{grid-column:3;grid-row:2;top:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:1180px) and (max-height:600px) and (orientation:landscape){
 body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .nameplate-content:has(.battle-rank){grid-template-columns:28px max-content minmax(0,1fr);column-gap:4px}
 body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .battle-rank>.rank-gem{width:28px;height:28px}
 body.battle-screen-active .game-app[data-equipment-status-layout] .score-strip > .combatant[data-equipment-status-panel] .battle-rank-name{font-size:10px;line-height:10px}
}
.rank-guide{min-width:0;text-align:left}
.rank-guide-path{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.rank-guide-current,.rank-guide-next{display:flex;align-items:center;gap:10px;min-width:0}
.rank-guide-current>div,.rank-guide-next>div{display:grid;gap:3px}
.rank-guide-current strong{font-size:23px;color:#faf1df}.rank-guide-next strong{font-size:18px;color:#e2dccf}
.rank-guide-current b{font-size:14px;font-variant-numeric:tabular-nums}
.rank-guide small{font-size:12px;color:#c6c2ba}.rank-guide-arrow{color:#b8a780;font-size:22px}.rank-guide-highest{color:#ffb7c2;font-weight:700}
.rank-guide-progress{margin:10px 0;font-size:14px}.rank-guide-progress p{margin:0 0 5px}.rank-guide-progress .rank-identity-gauge{display:block;max-width:none;margin:4px 0}.rank-guide-progress small{display:block}
.rank-guide-list{margin-top:12px;border-top:1px solid #ffffff20;padding-top:8px}.rank-guide-list summary{cursor:pointer;min-height:32px;line-height:32px;font-size:13px;color:#e6d4ad}.rank-guide-list summary:focus-visible{outline:2px solid #e6d4ad;outline-offset:3px}
.rank-guide-list ol{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px;margin:8px 0 12px;padding:0;list-style:none}.rank-guide-list li{display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 2px;font-size:12px;text-align:center}.rank-guide-list li[aria-current]{outline:1px solid #d3bd7b80;border-radius:6px}.rank-guide-list p{font-size:12px;line-height:1.6;margin:6px 0;color:#c6c2ba}
@media(orientation:landscape) and (max-height:600px){
 .rank-guide-path{gap:10px}.rank-guide-current>.rank-gem{width:48px;height:48px}.rank-guide-next>.rank-gem{width:34px;height:34px}.rank-guide-current strong{font-size:19px}.rank-guide-next strong{font-size:16px}.rank-guide-progress{margin:6px 0}.rank-guide-list{margin-top:8px}
}


#tutorialRankGuide{margin:16px 0;border-top:1px solid rgba(255,255,255,.14);padding-top:12px}
#tutorialRankGuide>summary{cursor:pointer;font-weight:600;padding:8px 0}
#tutorialRankGuide>.rank-guide{margin:12px 0;max-width:640px}
