body.ic-menu{background:#170a13}
[hidden]{display:none!important}
body.ic-menu .launch-stage{position:relative;display:block;padding:0;isolation:isolate;min-height:100dvh;height:100dvh;overflow:hidden;background:#281422 url('/intro/royal-courtyard-poster.webp') center/cover no-repeat}
#lobby-motion{position:absolute;width:100%;height:100%;inset:0;object-fit:cover;pointer-events:none;z-index:-2}
body.ic-menu .launch-stage::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#16071353 0%,transparent 24%,#1607131c 56%,#150710aa 100%);z-index:-1;pointer-events:none}
body.ic-menu .royal-lobby{--g:#e3b778;--ink:#fff1d5;--rim:#936442;--gold:#f5d192;--surface:linear-gradient(155deg,#502333f7,#241222f7);--font:clamp(.71rem,1.45vw,1rem);display:grid;position:relative;grid-template-columns:minmax(112px,.94fr) minmax(0,2.3fr) minmax(127px,1fr);grid-template-rows:auto minmax(0,1fr) auto;column-gap:clamp(7px,1.7vw,28px);row-gap:clamp(5px,1.4vh,18px);margin:0 auto;padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-left),env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom));width:min(100%,1720px);height:100%;background:none;border:none;box-shadow:none;color:var(--ink);text-align:left;font-size:var(--font)}
.royal-topbar{grid-column:1/-1;grid-row:1;display:flex;justify-content:space-between;gap:8px;align-items:center}
.royal-utilities{display:flex;justify-content:end;align-items:center;gap:6px;min-width:0}
.royal-button,.royal-panel,.royal-ranks strong,.royal-rules button{border:1px solid var(--rim,#a87950);background:var(--surface,linear-gradient(155deg,#512737,#2a1423));color:var(--ink,#fff1d5);border-radius:10px;box-shadow:0 4px 12px #10050966}
.royal-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:4px 9px;font:700 inherit;font:inherit;font-weight:750;text-decoration:none;cursor:pointer}
.royal-button img{width:19px;height:19px;object-fit:contain;flex:none}
.royal-lobby .profile-open{width:min(100%,166px);min-height:36px;font-size:inherit;justify-content:flex-start}
.royal-lobby .profile-mark{width:29px;height:29px;outline:1px solid #e8bb79;outline-offset:-1px}
.royal-lobby .profile-mark img{width:100%;height:100%;border-radius:50%}
.royal-lobby .language-control{margin:0}
.royal-lobby .language-control :is(select,.mg-landscape-select-trigger){background:#38192b;border-color:var(--rim);border-radius:10px;min-height:34px;font-size:var(--font);max-width:155px}
.royal-ranks{grid-row:2;grid-column:1;align-self:start}
.royal-ranks strong{display:inline-flex;align-items:center;gap:4px;padding:5px 9px;margin-bottom:5px;max-width:100%;overflow:hidden;color:var(--gold)}
.royal-rules{display:grid;gap:4px;padding:4px;max-width:228px;border:1px solid var(--rim);border-radius:10px;background:#210f1ce5}
.royal-rules button{display:grid;grid-template-columns:16px 1fr auto;align-items:center;text-align:left;gap:3px;padding:3px 6px;min-height:28px;font:inherit;font-weight:750;cursor:pointer}
.royal-rules i{font:700 1em Georgia,serif;color:var(--gold)}
.royal-rules button span{color:var(--g)}
.royal-brand{grid-row:2;grid-column:2;align-self:end;display:grid;justify-items:center;min-width:0;text-align:center}
.royal-tile-seals{display:flex;gap:5px;align-items:end;margin-bottom:5px}
.royal-tile-seals i{display:grid;place-items:center;width:clamp(19px,2.75vw,46px);aspect-ratio:.78;border-radius:6px;border:1px solid #ffefb9;color:#1d573b;background:linear-gradient(#ffefd1,#dfc287);box-shadow:0 3px #a26732,0 5px #1b080a80;font:700 clamp(15px,2vw,30px) Georgia,serif}
.royal-tile-seals i:nth-child(2){color:#981f36;transform:translateY(-3px)}
.royal-tile-seals i:nth-child(3){color:#385482}
.royal-brand p{font-size:clamp(.53rem,1.13vw,.8rem);font-weight:800;letter-spacing:.22em;text-transform:uppercase;color:var(--gold);text-shadow:0 1px 7px #17090e;margin:6px 0}
body.ic-menu .royal-resume{display:grid;grid-template-columns:22px 1fr auto;align-items:center;text-align:left;width:min(100%,425px);margin-top:7px;padding:7px 10px;color:var(--ink);text-decoration:none;gap:7px;line-height:1.1}
.royal-resume small,.royal-start small{display:block;font-size:.78em;font-weight:600;margin-top:4px;color:#f4c994}
.royal-friends{grid-row:2;grid-column:3;align-self:start;min-width:0}
.royal-friends>#friends-open{display:flex;margin-left:auto;white-space:nowrap;max-width:100%;font-size:.9em}
#friends-open>span:first-child{color:#77e5b3}
.royal-panel{margin-top:5px;padding:4px 5px 5px;text-align:start;font-size:.88em;min-width:0}
.royal-panel header,.royal-pager,.royal-inline{display:flex;align-items:center;justify-content:space-between;gap:4px}
.royal-panel header{color:var(--gold);padding:0 1px 3px;font-size:.88em}
.royal-panel :is(p,small){margin:2px 0}
.royal-mini{min-height:25px;padding:3px 5px;border-radius:6px}
.royal-panel .royal-friend-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px;align-items:center;min-height:31px;border-top:1px solid #bf8c583c;padding:2px 0}
.royal-friend-row b,.royal-friend-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.royal-friend-row small{color:#8be1bc}
.royal-friend-row .match{color:#f1c58d}
.royal-actions{grid-row:3;grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,21%);grid-template-areas:"modes start";gap:4px clamp(7px,1.4vw,22px);align-items:stretch}
body.ic-menu .royal-mode-choices{grid-area:modes;display:grid;grid-template-columns:minmax(0,20.2%) minmax(0,15.7%);gap:6px}
body.ic-menu .royal-actions .royal-button{display:flex;align-items:center;justify-content:center;text-align:center;gap:5px;border-radius:7px;padding:4px 6px;line-height:1.12;font-size:.9em;min-height:36px;color:var(--ink);background:var(--surface);border:1px solid var(--rim);min-width:0;hyphens:none}
body.ic-menu .royal-actions .royal-button b{min-width:0;overflow-wrap:normal;white-space:normal}
body.ic-menu .royal-mode-choices button[aria-pressed=true]{background:linear-gradient(#84384a,#4c1a2c);border-color:#e8ad6b}
.royal-start{grid-area:start}
@media (orientation:portrait) and (pointer:fine) and (max-width:460px){
 .royal-actions{grid-template-columns:minmax(0,1fr);grid-template-areas:"modes" "start"}
}
body.ic-menu .royal-start,.royal-cta{display:grid;place-content:center;text-align:center;min-width:0;color:#3a2015;background:linear-gradient(#fae0a2,#c89354);border:1px solid #fce2ac;border-radius:11px;box-shadow:inset 0 0 0 2px #ab713858,0 4px 8px #190810aa;padding:4px 6px;text-decoration:none;font:700 clamp(.96rem,2vw,1.9rem)/1 Georgia,serif;text-transform:uppercase}
body.ic-menu .royal-start{background:linear-gradient(158deg,#fff3c5 0%,#f2cd83 46%,#dda560 100%);border-color:#ffe4a7;box-shadow:inset 0 0 0 2px #a8692e45,0 4px 11px #190810aa;gap:3px}
.royal-start>b{font:700 clamp(1rem,4.8vmin,1.75rem)/1.08 Georgia,serif;letter-spacing:.035em;overflow-wrap:anywhere}
.royal-start small{font:600 clamp(.66rem,2.65vmin,.88rem)/1.16 system-ui,sans-serif;color:#583019;text-transform:none;margin:0;overflow-wrap:anywhere}
.royal-lobby :is(a,button,select):focus-visible,.royal-overlay :is(a,button,input):focus-visible{outline:2px solid #ffdda0;outline-offset:1px}
.royal-overlay{--g:#efc587;--rim:#926345;--ink:#fff1d8;--surface:linear-gradient(#552c41,#361927);width:min(850px,calc(100dvw - 18px));max-width:none;max-height:calc(100dvh - 18px);overflow:hidden;padding:clamp(7px,2.4vmin,19px);color:var(--ink);background:linear-gradient(142deg,#422033,#241220);border:1px solid #d4a06b;border-radius:15px;box-shadow:0 8px 32px #110813c7;font:clamp(.7rem,2.9vmin,.94rem)/1.22 system-ui,sans-serif}
.royal-overlay::backdrop{background:#1206119e}
.royal-overlay header{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:5px}
.royal-overlay h2{font:700 clamp(1.1rem,4.6vmin,1.8rem)/1 Georgia,serif;color:var(--g);margin:0}
.royal-close{min-width:30px;font-size:1.2em}
.royal-overlay .royal-button{min-height:30px;border-radius:7px}
.royal-overlay .royal-highlight{color:#3b241b;background:linear-gradient(#fae0a2,#c89354);border-color:#e8c692}
.royal-overlay .royal-copyrow{display:flex;align-items:center;justify-content:center;gap:4px;white-space:nowrap}
.royal-overlay .royal-person{border:1px solid var(--rim);border-radius:10px;padding:7px;display:grid;gap:4px;justify-items:center;align-content:center;text-align:center;min-width:0;overflow:hidden}
.royal-person img{width:clamp(42px,15vmin,104px);aspect-ratio:1;object-fit:cover;border-radius:50%;border:2px solid var(--g)}
.royal-person strong{font:700 1.3em Georgia,serif;max-width:100%;overflow-wrap:anywhere}
.royal-profile-grid{display:grid;grid-template-columns:minmax(148px,.76fr) minmax(0,2fr);gap:7px}
.royal-tabs{display:flex;gap:4px;margin-block:4px;align-items:stretch;flex-wrap:wrap}
.royal-tabs>*{flex:1;min-width:0;overflow-wrap:anywhere}
.royal-metrics{display:grid;gap:4px;grid-template-columns:repeat(4,minmax(0,1fr));margin:4px 0}
.royal-metrics span,.royal-board-row{padding:4px 6px;border:1px solid #b7815650;border-radius:6px;background:#29152099;min-width:0;overflow-wrap:anywhere}
.royal-metrics b{display:block;color:var(--g);font-size:1.17em}
.royal-mini-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:7px;align-items:center;margin-bottom:3px}
.royal-mini-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.royal-search{display:grid;gap:5px;grid-template-columns:1fr auto}
.royal-search input{width:100%;min-width:0;padding:5px 8px;border:1px solid #a86e5f;border-radius:7px;background:#211321;color:#fff0d5;font:inherit;font-size:max(16px,1em)}
.royal-overlay .royal-message{margin:4px 0;color:#efc48c}
.royal-overlay button:disabled{opacity:.65;cursor:default}
.royal-search-results{margin-top:5px}
.royal-lobby .royal-button[aria-pressed=true]{outline:1px solid #edb36b}
.royal-overlay .royal-copyrow{font-variant-numeric:tabular-nums}
#player-profile.player-profile{background:#351a2b}
@media (orientation:portrait) and (hover:none) and (pointer:coarse){
 /* Pin the oversized rotated canvas to the physical left in both LTR and
    RTL. Setting left and right together with a fixed width lets RTL choose
    the right edge and shift the entire lobby out of the clipped viewport. */
 body.ic-menu .launch-stage{
  position:fixed;top:0;left:0;right:auto;bottom:auto;
  width:100vh;height:100vw;width:100dvh;height:100dvw;min-height:0;
  transform-origin:0 0;transform:translateX(100vw) rotate(90deg);transform:translateX(100dvw) rotate(90deg)
 }
 body.ic-menu .royal-lobby{--font:clamp(.71rem,1.48dvh,1rem)}
 .royal-tile-seals i{width:clamp(19px,3dvh,40px);font-size:clamp(15px,2.2dvh,30px)}
 .royal-brand p{font-size:clamp(.53rem,1.1dvh,.8rem)}
 .royal-overlay[open]{position:fixed;inset:auto;top:50%;left:50%;margin:0;width:min(850px,calc(100dvh - 20px));max-height:calc(100dvw - 18px);transform:translate(-50%,-50%) rotate(90deg)}
}
@media (max-height:440px),(orientation:portrait) and (max-width:440px){
 .royal-button,.royal-lobby .profile-open,.royal-lobby .language-control :is(select,.mg-landscape-select-trigger){min-height:28px}
 .royal-lobby .profile-mark{width:25px;height:25px}
 .royal-actions nav .royal-button img{width:15px;height:15px}
 .royal-overlay .royal-button{min-height:25px}
 .royal-overlay .royal-search input{min-height:28px}
}
@media (orientation:portrait) and (pointer:fine) and (max-width:670px){
 body.ic-menu .royal-lobby{grid-template-columns:minmax(95px,1fr) minmax(108px,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;max-width:none}
 .royal-brand{grid-column:1/-1;grid-row:2}
 .royal-ranks,.royal-friends{grid-row:3}
 .royal-friends{grid-column:2}
 .royal-actions{grid-row:4}
}
@media (prefers-reduced-motion:reduce){#lobby-motion{display:none}}
.royal-history-row{margin:3px 0}
.royal-history-row small{display:block;color:#f2c893}
.royal-account{display:grid;gap:6px}
.royal-account input{padding:4px 8px;border-radius:7px;border:1px solid #ad795c;color:#fff1d8;background:#211320;font-size:max(16px,1em);width:100%}
.royal-account summary{cursor:pointer;margin-bottom:4px}
.royal-overlay .royal-board-row.royal-inline{min-height:32px}
.royal-friends-count{background:#a43650;color:#fff1d3;border-radius:7px;padding:1px 4px}
@media (max-height:410px),(orientation:portrait) and (max-width:410px){
 .royal-overlay .royal-button{min-height:23px;font-size:.92em;padding:2px 6px}
 .royal-overlay{padding:6px 9px;line-height:1.1}
 .royal-overlay .royal-mini-row,.royal-overlay .royal-history-row{margin-bottom:3px}
}
@media (max-height:300px),(orientation:portrait) and (max-width:310px){
 .royal-overlay header{margin-bottom:2px}
 .royal-profile-grid{grid-template-columns:minmax(111px,.66fr) minmax(0,2fr)}
 .royal-rules button{min-height:22px}
 .royal-panel .royal-friend-row{min-height:25px}
}
.royal-social-tools{display:flex;justify-content:flex-end;align-items:center;gap:4px}
.royal-friends .royal-social-tools>#friends-open{margin-left:0;white-space:nowrap}
#global-open{color:#ffdfa5;border-color:#b38254}
#global-open svg{flex:none}
.royal-global-list{display:grid;gap:4px;margin-block:5px}
.royal-global-row{display:grid;grid-template-columns:minmax(70px,20%) minmax(0,1fr) auto;align-items:center;gap:6px}
.royal-global-row .global-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.royal-global-row .global-action{display:flex;align-items:center;gap:3px}
.royal-global-row .global-copy{min-width:0;overflow-wrap:anywhere}
.royal-global-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:stretch}
.royal-global-composer{padding:5px 0 2px}
.royal-global-compose-tabs{display:flex;gap:5px;margin-block-end:4px}
.royal-global-quick-fields{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.8fr);gap:5px}
.royal-global-quick-fields[hidden],.royal-global-input[hidden],.royal-global-status:empty{display:none}
.royal-global-input{box-sizing:border-box;width:100%;min-width:0;min-height:34px;color:#fff3d9;background:#291827;border:1px solid #b08057;border-radius:7px;padding:4px 8px;font:inherit;font-size:max(16px,1em)}
.royal-global-input::placeholder{color:#dac2d0}
.royal-overlay[data-royal-view=global]{overflow-y:auto;overscroll-behavior:contain}
html.mg-native-keyboard-open .royal-overlay[data-royal-view=global].mg-native-keyboard-panel #royal-dialog-body>:is(.royal-tabs,.royal-global-controls,.royal-global-list){display:none}
html.mg-native-keyboard-open .royal-overlay[data-royal-view=global].mg-native-keyboard-panel .royal-global-composer{padding-block-start:0}
@media (max-height:200px){
 html.mg-native-keyboard-open .royal-overlay[data-royal-view=global].mg-native-keyboard-panel .royal-global-compose-tabs{display:none}
}
.royal-global-compose select,.royal-global-compose .mg-landscape-select-trigger{width:100%;min-width:0;color:#fff3d9;background:#291827;border:1px solid #b08057;border-radius:7px;padding:4px;font:inherit}
.royal-global-controls,.royal-recruit-bar{display:flex;align-items:center;gap:4px;justify-content:space-between;margin-top:5px}
@media (max-height:425px),(orientation:portrait) and (max-width:425px){
 .royal-friends .royal-social-tools .royal-button{font-size:.82em;padding-inline:5px;gap:3px}
 .royal-friends .royal-social-tools svg{width:12px;height:12px}
}
@media (orientation:portrait) and (pointer:fine) and (max-width:425px){
 .royal-friends .royal-social-tools #global-open span{display:none}
}
.royal-name-link{display:block;max-width:100%;min-height:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:1px 0!important;background:none!important;border:0!important;box-shadow:none;text-align:start;color:#ffe1ad!important}
.royal-name-link:hover{text-decoration:underline}
.royal-public-ranks>*{margin:4px 0}
.royal-social-tools #friends-open>span:nth-child(2){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}


.royal-friends{display:flex;flex-direction:column;align-self:stretch;min-height:0;container-type:size}
.royal-friends>.royal-social-tools{flex:none}
#friends-panel{display:flex;flex-direction:column;flex:0 1 auto;min-height:0;overflow:hidden}
#friends-panel>header{flex:none}
.royal-friends-list{min-height:0;overflow:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.royal-friends-list::-webkit-scrollbar{display:none}
.royal-friend-row .offline{color:#d2bcc9}

.royal-app-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:-1px;white-space:nowrap}
.royal-account-summary{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;padding:6px 0}
.royal-account-summary code{font-size:1.12em;letter-spacing:.07em;font-variant-numeric:tabular-nums;direction:ltr;color:var(--g)}
.royal-account-actions{display:flex;align-items:center;flex-wrap:wrap;gap:5px}

.royal-password-field{display:grid;gap:3px;text-align:start;min-inline-size:0}
.royal-password-field input{min-inline-size:0;box-sizing:border-box}

/* Lobby and table presence use the same green signal; labels still say where. */
.royal-friend-status .royal-friend-dot{display:inline-block;width:.62em;height:.62em;border-radius:50%;margin-inline-end:.45em;vertical-align:.05em;background:#a498a5}
.royal-friend-status:is(.lobby,.match) .royal-friend-dot{background:#69e6a9;box-shadow:0 0 .38em #69e6a955}

.royal-friends-chevron{
 flex:none;display:inline-block;width:.43em;height:.43em;margin-inline:.14em;
 border-right:1.4px solid currentColor;border-bottom:1.4px solid currentColor;
 transform:translateY(-.10em) rotate(45deg);
}
#friends-open[aria-expanded="true"] .royal-friends-chevron{
 transform:translateY(.10em) rotate(225deg);
}

.royal-settings-wrap{position:relative;min-width:0}
#royal-settings-panel{
 position:absolute;z-index:12;inset-block-start:calc(100% + 5px);inset-inline-end:0;
 box-sizing:border-box;width:clamp(118px,18vw,175px);margin:0;
 display:grid;gap:4px;padding:5px;
}
#royal-settings-panel .royal-button{width:100%;min-height:28px;justify-content:flex-start;text-align:start}
.royal-lobby[data-settings-open] .royal-friends{visibility:hidden}
.royal-account #account-name-count{margin:0;font-size:.75rem;color:#f2cf9b}
.royal-account input[aria-invalid="true"]{border-color:#f5a793}

/* Offline rows stay readable without widening the compact lobby drawer. */
.royal-panel .royal-friend-row.royal-friend-offline{grid-template-columns:auto minmax(0,1fr);gap:6px;padding:4px 5px;border:1px solid #79516270;border-radius:7px;background:#362330;margin-bottom:3px}
.royal-offline-avatar{position:relative;display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;background:#594052;color:#ffeddb;font-size:10px;font-weight:700}
.royal-offline-avatar .royal-friend-dot{position:absolute;inset:auto -1px -1px auto;width:7px;height:7px;background:#b7aab5;border:1px solid #362330;border-radius:50%}
.royal-friend-age{font-variant-numeric:tabular-nums}

/* Restored inline Top 5, independent of the full ranking drawer. */
.royal-ranks{align-self:stretch;min-width:0;min-height:0;position:relative;container-type:size;z-index:3;display:flex;flex-direction:column;align-items:flex-start}
.royal-ranks-toggle{color:var(--gold);flex:none;max-width:100%;white-space:nowrap}
.royal-ranks-toggle>span:not([aria-hidden]){min-width:0;overflow:hidden;text-overflow:ellipsis}
.royal-rank-chevron{display:inline-block;border:solid currentColor;border-width:0 1px 1px 0;width:.42em;height:.42em;rotate:45deg;margin:0 .15em .20em .20em;flex:none}
.royal-ranks-toggle[aria-expanded=true] .royal-rank-chevron{rotate:225deg;margin-bottom:-.1em}
:is(#royal-rank-panel,#royal-rank-preview){
 --rank-row:24px; /* Older Android WebViews without container units. */
 --rank-control:30px;
 --rank-number:19px;
 --rank-score:56px;
 --rank-inset:5px;
 position:relative;display:flex;flex-direction:column;min-height:0;max-width:100%;
 width:min(100%,246px);flex:0 1 auto;margin:4px 0 0;padding:5px;
 background:linear-gradient(155deg,#382136,#281b2d 85%);
 border-color:#a77c59;box-sizing:border-box;-webkit-text-size-adjust:100%;text-size-adjust:100%
}
@supports (height:1cqh){:is(#royal-rank-panel,#royal-rank-preview){--rank-row:clamp(16px,calc((100cqh - 130px)/5),30px)}}
.royal-rank-pick,.royal-rank-labels,.royal-rank-foot,.royal-rank-message{flex:none}
.royal-rank-body,.royal-rank-table{display:flex;flex:0 1 auto;flex-direction:column;min-height:0;min-width:0}
.royal-rank-rows{min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
:is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-rows{overflow:hidden;scrollbar-width:none}
.royal-rank-full :is(.royal-rank-rows,.royal-rank-labels){scrollbar-gutter:stable;overflow-y:auto}
.royal-rank-pick{min-width:0}
.royal-rank-pick .royal-rank-choice{display:flex;justify-content:space-between;width:100%;min-height:23px;padding:2px 5px;text-align:start;line-height:1.1;font-size:clamp(.61rem,1.2cqw,.84rem);font-size:clamp(.61rem,calc(var(--font) * .85),.84rem);border-radius:5px}
.royal-rank-options{position:absolute;inset:calc(var(--rank-control) + 6px) 4px auto;z-index:4;max-height:110px;max-height:clamp(48px,calc(100cqh - 77px),160px);overflow:auto;overscroll-behavior:contain;border:1px solid #b9916d;border-radius:6px;background:#392138;padding:3px;box-shadow:0 6px 18px #100914cc}
.royal-rank-options .royal-button{overflow-wrap:anywhere;display:flex;justify-content:flex-start;text-align:start;width:100%;min-height:26px;margin-bottom:2px;padding:3px 5px;border-radius:4px;font-size:.79rem;font-size:min(.79rem,var(--font));line-height:1.13;box-shadow:none}
.royal-rank-options [aria-current=true]{background:#624235;color:var(--gold)}
.royal-rank-row{
 display:grid;grid-template-columns:var(--rank-number) minmax(0,1fr) var(--rank-score);
 align-items:center;gap:4px;min-height:var(--rank-row);padding:0 var(--rank-inset);
 line-height:1.12;font-size:clamp(11px,calc(var(--rank-row) * .54),14px);font-variant-numeric:tabular-nums
}
.royal-rank-row>span:last-child{text-align:end;color:var(--gold);white-space:nowrap;unicode-bidi:isolate}
.royal-rank-row .royal-name-link{font:inherit;font-weight:750;display:block;width:100%;text-align:start;min-height:0;padding:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;box-shadow:none}
.royal-rank-labels{min-height:19px;color:#dfc4cf;font-size:11px;font-weight:700}
.royal-rank-rows .royal-rank-row:nth-child(odd){background:#ffffff08;border-radius:4px}
.royal-rank-rows .royal-rank-row:not(:last-child){box-shadow:inset 0 -1px #d3a87b19}
.royal-rank-rows .royal-rank-me{background:#79543080!important}
.royal-rank-foot,.royal-rank-ops{display:flex;align-items:center;justify-content:space-between;gap:3px;flex-wrap:wrap;margin-top:3px}
.royal-rank-foot small,.royal-rank-ops small,.royal-rank-message{font-size:clamp(.53rem,calc(var(--font) * .73),.73rem);color:#e4c8d1}
.royal-rank-foot .royal-rank-small,.royal-rank-message .royal-rank-small{min-height:19px;padding:2px 4px;font-size:clamp(.55rem,calc(var(--font) * .77),.76rem);box-shadow:none;border-radius:4px}
.royal-rank-ops{width:100%;justify-content:flex-start}
:is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-foot{flex-wrap:nowrap;border-top:1px solid #ad825238;padding:3px 2px 0}
:is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-foot small{min-width:max-content}
:is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-foot .royal-rank-small{
 min-height:24px;font-size:11px;line-height:1.1;text-align:end;margin-inline-start:auto
}
.royal-rank-foot :is(a,button,small){max-width:100%;overflow-wrap:anywhere}
.royal-rank-message:empty{display:none}
:is(#royal-rank-panel,#royal-rank-preview).royal-rank-full{width:min(100%,340px);background:#321e31}
@media (orientation:landscape),(orientation:portrait) and (hover:none) and (pointer:coarse){
 body.ic-menu .royal-lobby{
  grid-template-columns:minmax(125px,1.12fr) minmax(0,2.12fr) minmax(127px,1fr)
 }
 body.ic-menu .royal-lobby:has(.royal-rank-full:not([hidden])){
  grid-template-columns:minmax(112px,1.45fr) minmax(0,1.79fr) minmax(127px,1fr)
 }
}

/* Reserve a dedicated square for the outer frame, not just the inner photo. */
.royal-rank-row .royal-name-link{display:flex;align-items:center;gap:5px;overflow:visible}
.royal-rank-display-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.royal-rank-avatar{
 --rank-avatar:clamp(15px,calc(var(--rank-row) - 5px),23px);
 position:relative;display:grid;place-items:center;flex:0 0 var(--rank-avatar);
 width:var(--rank-avatar);height:var(--rank-avatar);border-radius:50%;
 color:#ffe3b9;isolation:isolate
}
.royal-rank-initial{display:grid;place-items:center;width:70%;height:70%;border:1px solid #a78a70;border-radius:50%;background:#534057;font-size:.77em;line-height:1;box-sizing:border-box}
.royal-rank-avatar{isolation:isolate;overflow:hidden}
.royal-rank-avatar>*{grid-area:1/1;place-self:center}
.royal-rank-photo,.royal-rank-frame{position:static;pointer-events:none;margin:0;display:block}
.royal-rank-photo{width:73%;height:73%;object-fit:cover;border-radius:50%;z-index:1}
.royal-rank-frame{width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;z-index:2}
.royal-rank-avatar-framed::after{content:"";position:absolute;inset:0;border:1px solid #d3ad82;border-radius:50%;pointer-events:none;z-index:3}
.royal-rank-full .royal-rank-avatar{--rank-avatar:clamp(16px,calc(var(--rank-row) - 2px),27px)}
.royal-rank-full .royal-rank-row:not(.royal-rank-labels){min-height:max(22px,var(--rank-row))}

/* A row is a table, not a centered button: fixed left edges for rank and avatar. */
:is(#royal-rank-panel,#royal-rank-preview) .royal-rank-row>span:first-child{justify-self:start;text-align:start}
:is(#royal-rank-panel,#royal-rank-preview) .royal-rank-row .royal-name-link{
 justify-content:flex-start;justify-self:stretch;min-width:0;text-align:start;overflow:hidden
}
:is(#royal-rank-panel,#royal-rank-preview) .royal-rank-name{min-width:0;overflow:hidden}
:is(#royal-rank-panel,#royal-rank-preview) .royal-rank-display-name{text-align:start}
:is(#royal-rank-panel,#royal-rank-preview) .royal-rank-avatar{box-sizing:border-box}
:is(#royal-rank-panel,#royal-rank-preview) :is(.royal-rank-photo,.royal-rank-frame)[hidden]{display:none}

.royal-panel .royal-friend-row.royal-friend-has-photo{grid-template-columns:auto minmax(0,1fr) auto;gap:5px}
.royal-friend-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%;opacity:0;pointer-events:none}
.royal-friend-photo.is-loaded{opacity:1}
.royal-directory-photo{width:25px;height:25px;object-fit:cover;border-radius:50%;align-self:center}

/* Spectating is separate from joining. Keep the eye beside that player's name. */
.royal-friend-row .royal-watch{display:inline-grid;place-items:center;inline-size:2.2rem;min-block-size:2.15rem;padding:0;color:#f2d997;background:#2c2420;border:1px solid #776144;border-radius:.6rem;text-decoration:none;justify-self:end}
.royal-friend-row .royal-watch:hover,.royal-friend-row .royal-watch:focus-visible{background:#624926;color:#fff3d2}


/* The compact controls stay mounted; only the incoming board fades in. */
.royal-rank-pick-rail{display:flex;align-items:stretch;gap:3px}
.royal-rank-pick-rail .royal-rank-choice{flex:1;min-width:0;min-height:var(--rank-control);align-items:center}
.royal-rank-choice-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.royal-rank-pause.royal-button{position:relative;display:grid;place-items:center;flex:0 0 30px;width:30px;min-height:var(--rank-control);padding:0;border-radius:5px;box-shadow:none}
.royal-rank-pause[hidden]{display:none}
.royal-rank-pause::before{content:"";width:10px;height:11px;border-inline:3px solid currentColor}
.royal-rank-pause[data-rotating=false]::before{width:0;height:0;border:5px solid transparent;border-inline-start:8px solid currentColor;transform:translateX(2px)}
@keyframes royal-board-in{from{opacity:.55;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}
@media (prefers-reduced-motion:no-preference){.royal-rank-crossfade{animation:royal-board-in .18s ease-out both}}


/* Profile stands alone on the left; Shop and Training lead the right toolbar. */
.royal-topbar{container-type:inline-size;justify-content:space-between;min-width:0;gap:clamp(4px,1cqw,12px)}
.royal-primary-tools,.royal-utilities{display:flex;align-items:center;min-width:0;gap:clamp(3px,.60cqw,9px)}
.royal-primary-tools{flex:0 1 auto}
.royal-utilities{flex:0 1 auto;justify-content:flex-end}
.royal-utilities>.royal-button,.royal-utilities>.royal-settings-wrap{min-width:0}
.royal-utilities>.royal-button:focus-visible,.royal-utilities #royal-settings:focus-visible{z-index:1}
.royal-topbar .royal-button{color:#fff1d5;border-color:#ae8157;background:linear-gradient(158deg,#4b263b,#271727 86%);box-shadow:inset 0 0 0 2px #e8bc781b,0 4px 10px #10050980;min-height:clamp(34px,4.15cqw,49px);padding-inline:clamp(4px,.8cqw,11px);white-space:nowrap;font-size:clamp(.68rem,1.38cqw,.96rem);gap:clamp(3px,.48cqw,7px);line-height:1.1}
.royal-topbar .royal-button :is(svg,img:not(#profile-chip-avatar,.mg-profile-frame)),#inventory-open svg{width:clamp(14px,1.75cqw,19px);height:clamp(14px,1.75cqw,19px);flex:none;color:#f5cf8d}
.royal-topbar .royal-button :is(b,span[data-social]){min-width:0;overflow:hidden;text-overflow:ellipsis}
.royal-topbar .profile-open{width:clamp(76px,12cqw,166px)}
.royal-lobby .royal-topbar .profile-mark #profile-chip-avatar{width:100%;height:100%}
.royal-topbar .profile-open #profile-chip-label{min-width:0;overflow:hidden}
.royal-topbar #lobby-score{max-width:29cqw}
.royal-settings-actions{display:grid;gap:4px}
#royal-settings-panel{width:clamp(150px,24cqw,210px)}
#royal-settings-panel .royal-settings-language-label{font-weight:750;color:#f6d49a;padding:1px 4px}
#royal-settings-panel .language-control{width:100%;margin:0 0 3px}
#royal-settings-panel .language-control :is(select,.mg-landscape-select-trigger){width:100%;max-width:none}
#royal-settings-panel .mg-landscape-select-control{width:100%}
body.ic-menu .royal-actions .royal-button{min-height:clamp(38px,5.3cqw,62px);border-radius:10px}
body.ic-menu .royal-actions .royal-button[id="inventory-open"]{background:linear-gradient(155deg,#503349,#2d192b);border-color:#ae8157;box-shadow:inset 0 0 0 2px #e8bc7819,0 4px 10px #10050980}
body.ic-menu .royal-start{min-block-size:clamp(44px,6vmin,56px);background:linear-gradient(168deg,#fff0b9,#f5d58b 27%,#daa35e 52%,#f7d491 82%,#dda868);box-shadow:inset 0 0 0 2px #a8692e52,0 4px 11px #190810aa}
@container (max-width:700px){
 .royal-topbar .royal-button{font-size:clamp(.60rem,1.65cqw,.77rem);padding-inline:4px}
 .royal-topbar .profile-open{width:clamp(57px,12cqw,96px)}
 .royal-topbar #lobby-score b{white-space:normal;line-height:1.05;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
}
@container (max-width:510px){
 .royal-topbar .royal-button{padding:4px;min-width:33px;min-height:35px}
 .royal-topbar .royal-button:not(.profile-open) :is(b,span[data-social]){position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
 .royal-topbar .profile-open{width:36px}
 .royal-topbar #profile-chip-label{position:absolute;width:1px;height:1px;clip-path:inset(50%)}
 .royal-topbar #lobby-score{max-width:none}
}

/* The same compact component fits native landscape and the rotated mobile stage. */
@container (max-width:170px){
 :is(#royal-rank-panel,#royal-rank-preview){--rank-number:15px;--rank-score:48px;--rank-inset:3px;padding:4px}
 :is(#royal-rank-panel,#royal-rank-preview) .royal-rank-row{gap:3px}
 :is(#royal-rank-panel,#royal-rank-preview) .royal-name-link{gap:4px}
 :is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-avatar{--rank-avatar:clamp(15px,calc(var(--rank-row) - 5px),18px)}
}
@container (max-height:156px){
 :is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full){--rank-control:18px;--rank-row:14px;margin-top:2px;padding-block:2px}
 .royal-ranks-toggle{min-height:18px;padding-block:1px}
 /* The title row is still announced by assistive technology. */
 :is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-labels{
  position:absolute;inline-size:1px;block-size:1px;min-height:0;padding:0;overflow:hidden;clip-path:inset(50%)
 }
 :is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-foot{margin-top:1px;padding-top:1px}
 :is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-foot .royal-rank-small{min-height:17px;padding-block:1px}
 :is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-rank-avatar{--rank-avatar:13px}
 :is(#royal-rank-panel,#royal-rank-preview):not(.royal-rank-full) .royal-name-link{padding-block:0!important}
}

/* Home profile: the label and photo stay inside the button while the
   equipped frame keeps its own centered layer instead of using toolbar icon sizing. */
body.ic-menu .royal-topbar #profile-open{
 --home-portrait:clamp(27px,4.2cqw,40px);
 width:clamp(85px,14.3cqw,176px);
 min-height:clamp(40px,5.3cqw,55px);
 gap:clamp(5px,.9cqw,11px);
 padding-inline:clamp(7px,1.1cqw,13px);
 font-size:clamp(.73rem,1.55cqw,1.05rem);
}
body.ic-menu #profile-open .profile-mark{
 position:relative;display:grid;place-items:center;
 width:var(--home-portrait);height:var(--home-portrait);
}
body.ic-menu #profile-open .profile-mark > #profile-chip-avatar{
 width:100%;height:100%;object-fit:cover;object-position:center;border-radius:50%;
}
body.ic-menu #profile-open .profile-mark.mg-profile-framed:has(> .mg-profile-frame:not([hidden])){
 outline:none;background:transparent;
}
body.ic-menu #profile-open .profile-mark.mg-profile-framed:has(> .mg-profile-frame:not([hidden])) > #profile-chip-avatar{
 width:86%;height:86%;
}
body.ic-menu #profile-open .profile-mark > img.mg-profile-frame{
 position:absolute;top:50%;left:50%;right:auto;bottom:auto;width:154%;height:154%;
 max-width:none;max-height:none;transform:translate(-50%,-50%);object-fit:contain;
}
@container (max-width:510px){
 body.ic-menu .royal-topbar #profile-open{width:42px;padding-inline:5px}
}

/* Separate gift mail at the left edge of the top utility row, before Shop. */
.royal-topbar #royal-mail-open{position:relative;flex:none;min-inline-size:35px;padding-inline:6px}
#royal-mail-count{
 position:absolute;inset-block-start:-4px;inset-inline-end:-4px;min-width:14px;height:14px;
 padding-inline:2px;display:grid;place-items:center;border-radius:20px;background:#f6cf83;color:#2c1820;
 font:750 9px/1 system-ui;box-shadow:0 0 0 1px #533237;pointer-events:none;
}
.royal-mail-message{display:grid;justify-items:start;gap:4px;padding:10px 12px;border:1px solid #966d50;border-radius:9px;background:#39222e}
.royal-mail-message h3{margin:0;color:#ffe1a0}
.royal-mail-message p{margin:1px 0}
:is(#royal-rank-panel,#royal-rank-preview) .mg-rank-points-cell{--mg-rank-size:14px;line-height:1}
/* The online lane keeps the display name independent from presence and controls. */
.royal-friends .royal-social-tools{display:grid;grid-template-columns:auto minmax(0,1fr)}
.royal-social-tools #friends-open{position:relative;justify-content:space-between;font-size:clamp(.65rem,1em,.95rem);padding-inline:5px}
.royal-social-tools #friends-open>span:first-child{flex:none;font-size:.77em}
.royal-social-tools #friends-open>span:nth-child(2){flex:1;min-inline-size:0;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;line-height:1.13;text-align:start}
.royal-social-tools #friends-open .royal-friends-count{position:absolute;inset-block-start:-3px;inset-inline-end:-3px;pointer-events:none}

#friends-panel{box-sizing:border-box;background:linear-gradient(155deg,#382535,#281e2b 86%);border-color:#a47b55}
#friends-panel .royal-friends-list{scrollbar-gutter:auto}
#friends-panel .royal-friend-row{
 --friends-avatar:clamp(20px,7.5vmin,31px);--friends-watch:clamp(27px,9vmin,37px);
 grid-template-columns:var(--friends-avatar) minmax(0,1fr) auto;
 gap:clamp(4px,1.4vmin,7px);min-block-size:calc(var(--friends-watch) + 5px);
 padding:3px 2px;border-color:#ad805239;
}
#friends-panel .royal-friend-row .royal-offline-avatar,#friends-panel .royal-friend-row .mg-imperial-player-look{
 --mg-look-size:var(--friends-avatar);inline-size:var(--friends-avatar);block-size:var(--friends-avatar)
}
#friends-panel .royal-friend-copy{display:grid;gap:2px;min-inline-size:0}
#friends-panel .royal-friend-identity{display:flex;align-items:center;gap:4px;min-inline-size:0}
#friends-panel .royal-friend-identity .royal-name-link{
 flex:0 1 auto;min-inline-size:0;padding:0!important;font-weight:750;font-size:clamp(.68rem,1.12em,1rem);line-height:1.08;
 white-space:normal;overflow-wrap:anywhere
}
#friends-panel .royal-friend-identity .mg-imperial-rank-mark{--mg-rank-size:clamp(11px,3.6vmin,15px);flex:none}
#friends-panel .royal-friend-copy .royal-friend-status{
 display:flex;align-items:center;min-inline-size:0;margin:0;color:#c6b6be;font-size:clamp(.58rem,.82em,.75rem);
 line-height:1.12;white-space:normal;overflow-wrap:anywhere;
}
#friends-panel .royal-friend-status .royal-friend-dot{flex:none}
#friends-panel .royal-friend-row .royal-watch{inline-size:var(--friends-watch);block-size:var(--friends-watch);box-sizing:border-box;min-block-size:0}
#friends-panel .royal-friend-row .royal-friend-invite{font-size:.82em;min-inline-size:var(--friends-watch);min-block-size:var(--friends-watch);padding-inline:4px;max-inline-size:48px;overflow-wrap:anywhere}
#friends-panel .royal-friend-row{display:flex;align-items:center}
#friends-panel .royal-friend-copy{flex:1}
#friends-panel .royal-friend-row.royal-friend-offline{margin:0;gap:clamp(4px,1.4vmin,7px);min-block-size:calc(var(--friends-watch) + 5px);padding:3px 2px}
#friends-panel .royal-friend-tier{flex:0 0 auto;display:flex;align-items:center;gap:3px;color:#f0ce9d;font-size:clamp(.57rem,.76em,.69rem);white-space:nowrap}
#friends-panel .royal-friend-tier .mg-imperial-rank-mark{--mg-rank-size:clamp(13px,3.8vmin,17px)}
#friends-panel .royal-friend-row .royal-friend-invite{font:750 clamp(.6rem,.82em,.75rem)/1.05 system-ui;max-inline-size:57px}
@media(max-height:330px){#friends-panel .royal-friend-tier{flex-direction:column;gap:1px}}

/* The account sheet is a small action panel, not a full-width profile. */
.royal-overlay[data-royal-view=account-settings]{width:min(480px,calc(100dvw - 24px));padding:clamp(9px,2vmin,14px)}
.royal-overlay[data-royal-view=account-settings] header{justify-content:space-between;gap:8px;margin-bottom:3px}
.royal-overlay[data-royal-view=account-settings] .royal-account-summary{padding:3px 0;gap:4px 8px}
.royal-overlay[data-royal-view=account-settings] .royal-account-actions{gap:4px}
.royal-overlay[data-royal-view=account-settings] .royal-button{min-height:28px}

@media (orientation:portrait) and (hover:none) and (pointer:coarse){
 .royal-overlay[data-royal-view=account-settings][open]{width:min(480px,calc(100dvh - 24px))}
}

/* Road to Emperor: the compact bottom rail does not move or change
   color by game mode. The centered drawer occupies the existing middle row. */
body.ic-menu .royal-actions{grid-template-columns:minmax(0,1fr) clamp(86px,16.5%,238px);grid-template-areas:"modes start";gap:clamp(4px,.85cqw,11px);container-name:royal-actions;container-type:inline-size;width:100%}
body.ic-menu .royal-mode-choices{gap:clamp(3px,.72cqw,9px)}
body.ic-menu .royal-actions .royal-button,body.ic-menu .royal-actions .royal-button[id="inventory-open"]{min-height:clamp(33px,5.25cqw,56px);background:linear-gradient(155deg,#4b2b40,#291c2d);border-color:#9d7258;box-shadow:inset 0 0 0 1px #e8bc781b,0 4px 10px #10050980;padding:4px clamp(3px,.6cqw,9px);gap:clamp(3px,.55cqw,8px)}
body.ic-menu .royal-actions .royal-button :is(svg,img){width:clamp(12px,1.75cqw,23px);height:clamp(12px,1.75cqw,23px);color:#f5d194;flex:none}
body.ic-menu .royal-actions .royal-button:is([aria-pressed=true],[aria-expanded=true]){background:linear-gradient(155deg,#623c4f,#392032);border-color:#edbd7e;outline:1px solid #dca76a;outline-offset:-1px}
body.ic-menu .royal-actions .royal-button b{display:block;overflow-wrap:normal;min-width:0}
.royal-lobby:has(.royal-rank-drawer:not([hidden])) :is(.royal-brand,.royal-friends,.royal-ranks-preview){visibility:hidden}
body.ic-menu .royal-lobby:has(.royal-rank-drawer.royal-rank-full:not([hidden])){grid-template-columns:minmax(112px,.94fr) minmax(0,2.3fr) minmax(127px,1fr)}
@media (orientation:portrait) and (pointer:fine) and (max-width:670px){body.ic-menu .royal-lobby:has(.royal-rank-drawer.royal-rank-full:not([hidden])){grid-template-columns:minmax(95px,1fr) minmax(108px,1fr)}}
#royal-rank-panel.royal-rank-drawer{
 grid-column:1/-1;grid-row:2;align-self:stretch;justify-self:center;z-index:7;
 width:min(94%,1050px);max-height:100%;--rank-row:clamp(21px,3.7cqw,44px);--rank-number:clamp(31px,8cqw,90px);
 --rank-score:clamp(43px,12cqw,127px);--rank-tier:clamp(79px,24cqw,210px);
 --rank-inset:clamp(4px,1.2cqw,13px);--rank-control:26px;gap:clamp(2px,.65cqw,9px);
 margin:0;padding:clamp(4px,1.22cqw,16px);border-color:#ad825e;border-radius:clamp(9px,1.6cqw,19px);
 background:#241c2c;box-shadow:0 14px 38px #170a18a3;container-type:inline-size
}
.royal-rank-drawer .royal-rank-drawer-head{align-items:center;min-height:23px;padding:0;flex:none}
.royal-rank-drawer-head h2{margin:0;color:#ffe9c4;font:700 clamp(1.08rem,2.95cqw,1.98rem)/1.1 Georgia,serif}
.royal-rank-drawer-head .royal-button{min-width:25px;min-height:23px;padding:0 5px;font-size:1.2em;box-shadow:none;background:#302332}
#royal-ranking-pane{min-height:0;min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
.royal-rank-drawer .royal-rank-pick{position:relative;align-self:flex-end;width:clamp(105px,33%,319px)}
.royal-rank-drawer .royal-rank-options{inset:calc(var(--rank-control) + 2px) 0 auto;max-height:clamp(64px,23cqw,195px)}
.royal-rank-drawer .royal-rank-body,.royal-rank-drawer .royal-rank-table{flex:1 1 auto}
#royal-rank-panel.royal-rank-drawer .royal-rank-rows{overflow:auto;display:grid;gap:2px;align-content:start}
.royal-rank-drawer .royal-rank-row{grid-template-columns:var(--rank-number) minmax(0,1fr) var(--rank-tier) var(--rank-score);font-size:clamp(.63rem,1.48cqw,.94rem);gap:4px}
.royal-rank-drawer .royal-rank-row[data-medal]{border:1px solid;box-shadow:none}
.royal-rank-drawer .royal-rank-row[data-medal="1"]{background:#493832;border-color:#be9559}
.royal-rank-drawer .royal-rank-row[data-medal="2"]{background:#373547;border-color:#9c94ad}
.royal-rank-drawer .royal-rank-row[data-medal="3"]{background:#44323e;border-color:#a87861}
.royal-rank-drawer .royal-rank-trophy{display:inline-grid;place-items:center;min-inline-size:1.5em;min-block-size:1.35em;color:#ffdc9b;background:#241926;border:1px solid currentColor;border-radius:4px 4px 8px 8px;font-weight:800}
.royal-rank-drawer [data-medal="2"] .royal-rank-trophy{color:#e1d5ef}
.royal-rank-drawer [data-medal="3"] .royal-rank-trophy{color:#eab294}
.royal-rank-drawer .royal-rank-tier-cell{display:flex;align-items:center;gap:.36em;min-width:0}
.royal-rank-drawer .royal-rank-tier-cell bdi{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.royal-rank-drawer .royal-rank-own-row{flex:none;margin-top:4px;border:1px solid #c69b69;border-radius:6px;background:#4b313f;color:#fff0d0;font-weight:700}
.royal-rank-drawer .royal-rank-own-row button{font-weight:700}
@container royal-actions (max-width:530px){
 body.ic-menu .royal-actions .royal-button{gap:3px;font-size:clamp(.55rem,1.63cqw,.70rem);padding-inline:2px}
 body.ic-menu .royal-actions .royal-button :is(svg,img){width:12px;height:12px}
}
@container (max-width:530px){.royal-rank-drawer .royal-rank-row{--rank-tier:66px}}
@media (max-height:365px) and (orientation:landscape),(orientation:portrait) and (pointer:coarse) and (max-width:365px){
 #royal-rank-panel.royal-rank-drawer{--rank-row:22px;--rank-control:21px}
 .royal-rank-drawer .royal-rank-drawer-head h2{font-size:1.04rem}
}
@media (orientation:portrait) and (pointer:fine) and (max-width:670px){#royal-rank-panel.royal-rank-drawer{grid-row:2 / 4}}

@media (max-height:410px) and (orientation:landscape),(orientation:portrait) and (pointer:coarse) and (max-width:410px){
 #royal-rank-panel.royal-rank-drawer{--rank-row:22px;--rank-control:21px;padding:5px 7px;gap:3px}
 #royal-rank-panel.royal-rank-drawer .royal-rank-labels{min-height:16px}
 #royal-rank-panel.royal-rank-drawer .royal-rank-own-row{margin-top:2px}
 #royal-rank-panel.royal-rank-drawer .royal-rank-small{min-height:19px}
 #royal-rank-panel.royal-rank-drawer .royal-rank-options{max-block-size:95px}
}

/* Keep the existing public profile card and right-hand ranks in place. */
.royal-profile-grid .royal-private-profile-column{display:grid;align-content:start;gap:6px;min-width:0}
.royal-profile-grid .royal-profile-direct-chat{
 width:100%;min-height:clamp(26px,5.5vmin,40px);min-width:0;
 display:flex;align-items:center;justify-content:center;gap:6px;padding:3px 6px;
 color:#fff0d8;border-color:#bd8a60;background:linear-gradient(155deg,#553548,#3b273b);text-align:center
}
.royal-profile-grid .royal-profile-direct-chat svg{width:16px;height:16px;flex:none;color:#ffdda4}
.royal-private-mail-tabs{flex:none;margin:0 0 5px}
#royal-private-toast{position:absolute;inset-inline-start:max(14px,25%);inset-block-start:clamp(44px,6.5cqw,68px);z-index:12;max-inline-size:min(440px,48%);pointer-events:none}
#royal-private-toast>*{pointer-events:auto}
@media (orientation:portrait) and (pointer:coarse){#royal-private-toast{inset-block-start:50px}}

/* Static legacy heading: no chevron, click target or expand interaction. */
#royal-ranks-preview-title{margin:0;cursor:default;font-weight:inherit}
#royal-rank-preview{flex:0 1 auto;min-height:0}
#royal-rank-preview:not(.royal-rank-full) .royal-rank-rows{overflow-y:auto;overflow-x:hidden;scrollbar-width:none}
#royal-rank-preview:not(.royal-rank-full) .royal-rank-rows::-webkit-scrollbar{display:none}
/* Keep several online rows readable in the safe middle lane before overflow. */
@supports (height:1cqh){
 #friends-panel .royal-friend-row{
  --friends-watch:clamp(24px,calc((100cqh - 74px)/3 - 6px),37px);
  --friends-avatar:clamp(18px,calc(var(--friends-watch) - 5px),31px);
 }
}

/* Full rankings occupy the safe landscape stage in one scrolling list.
   Use the lobby's outer edges rather than its padded grid columns, so the
   full panel does not pay for the lobby padding and the device safe area. */
body.ic-menu .royal-lobby:has(.royal-rank-screen:not([hidden])) :is(.royal-topbar,.royal-actions){visibility:hidden}
#royal-rank-panel.royal-rank-screen{
 /* The compact drawer uses grid row 2. Clear all grid placement so the
    full screen can occupy the whole lobby instead of its middle row. */
 --rank-safe-inline:max(6px,env(safe-area-inset-left,0px),env(safe-area-inset-right,0px));
 --rank-safe-block:max(6px,env(safe-area-inset-top,0px),env(safe-area-inset-bottom,0px));
 position:absolute;grid-area:auto;
 inset:var(--rank-safe-block) var(--rank-safe-inline);
 width:auto;max-width:none;height:auto;max-height:none;justify-self:stretch;align-self:stretch;
 z-index:12;margin:0;padding:clamp(5px,1.05cqw,13px) clamp(4px,.65cqw,10px);gap:4px;
 --rank-row:clamp(24px,3.5cqw,35px);--rank-number:clamp(25px,5.6cqw,66px);--rank-score:clamp(36px,6.5cqw,77px);
 --rank-tier:clamp(66px,12cqw,145px);--rank-inset:5px
}
@media (orientation:portrait) and (hover:none) and (pointer:coarse){
 /* The landscape stage is rotated clockwise on portrait-locked phones. */
 #royal-rank-panel.royal-rank-screen{
  --rank-safe-inline:max(6px,env(safe-area-inset-top,0px),env(safe-area-inset-bottom,0px));
  --rank-safe-block:max(6px,env(safe-area-inset-left,0px),env(safe-area-inset-right,0px));
 }
}
.royal-rank-screen .royal-rank-drawer-head h2{font-size:clamp(1.06rem,2.55cqw,1.65rem)}
.royal-rank-screen .mg-road-tab{min-block-size:25px;padding-block:2px}
.royal-rank-screen .royal-rank-pick{width:clamp(112px,30%,285px)}
#royal-rank-panel.royal-rank-screen .royal-rank-rows{display:block;overscroll-behavior:contain;min-height:0}
.royal-rank-screen .royal-rank-labels{min-height:17px}
#royal-rank-panel.royal-rank-screen .royal-rank-row:not(.royal-rank-labels){min-height:var(--rank-row);font-size:clamp(.65rem,1.7cqw,.98rem);gap:4px}
.royal-rank-screen .royal-rank-avatar{--rank-avatar:clamp(15px,calc(var(--rank-row) - 5px),24px)}
.royal-rank-screen .royal-rank-own-row{align-self:end;width:100%;margin-top:3px}
.royal-rank-screen .royal-rank-page-foot{flex-wrap:nowrap;margin:2px 0 0;min-height:23px}
.royal-rank-screen .royal-rank-page-foot .royal-button{white-space:nowrap;min-height:23px;padding:2px 7px}
@container (max-width:550px){
 .royal-rank-screen .royal-rank-tier-cell bdi{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
 .royal-rank-screen .royal-rank-row{--rank-tier:22px;--rank-number:20px;--rank-score:36px;--rank-inset:2px}
}
@media (max-height:330px) and (orientation:landscape),(max-width:330px) and (orientation:portrait){
 #royal-rank-panel.royal-rank-screen{--rank-row:20px;gap:2px;padding:5px}
}
@media (max-height:270px) and (orientation:landscape),(max-width:270px) and (orientation:portrait){
 #royal-rank-panel.royal-rank-screen{--rank-row:18px;gap:2px;padding:4px}
 .royal-rank-screen .royal-rank-drawer-head,.royal-rank-screen .royal-rank-drawer-head .royal-button,.royal-rank-screen .mg-road-tab{min-height:20px}
 .royal-rank-screen .royal-rank-choice,.royal-rank-screen .royal-rank-page-foot .royal-button,.royal-rank-screen .royal-rank-page-foot{min-height:19px}
 .royal-rank-screen .royal-rank-labels{min-height:15px}
}
@media (orientation:portrait) and (pointer:fine) and (max-width:460px){body.ic-menu .royal-mode-choices{grid-template-columns:repeat(2,minmax(0,110px));}}

/* Top 5: the rule menu occupies the open stage to the right, not the rows. */
#royal-rank-preview .royal-rank-options:not([hidden]){
 position:absolute;inset:4px auto auto calc(100% + 8px);
 display:flex;flex-direction:column;gap:2px;z-index:5;
 width:clamp(132px,28vw,240px);width:clamp(132px,28vmax,240px);
 max-height:clamp(88px,100cqh,272px);padding:5px;overflow:hidden;
 background:#312137;border-color:#c89f72;border-radius:8px
}
#royal-rank-preview .royal-rank-options-list{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#royal-rank-preview .royal-rank-options-head{
 flex:none;display:flex;align-items:center;justify-content:space-between;gap:5px;
 padding:0 2px 3px;color:var(--gold);font-weight:800;border-bottom:1px solid #9c735655
}
#royal-rank-preview .royal-rank-options-head .royal-rank-options-close{
 width:28px;min-height:28px;flex:none;justify-content:center;margin:0;padding:0;font-size:1.15rem
}
#royal-rank-preview .royal-rank-options [aria-current=true]::after{content:'✓';margin-inline-start:auto;padding-inline-start:.45em}
#royal-rank-preview .royal-rank-choice .royal-rank-chevron{rotate:-45deg}
#royal-rank-preview .royal-rank-display-name{
 display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;overflow-wrap:anywhere;line-height:1.08
}
:dir(rtl) #royal-rank-preview .royal-rank-options:not([hidden]){inset:4px calc(100% + 8px) auto auto}
:dir(rtl) #royal-rank-preview .royal-rank-choice .royal-rank-chevron{rotate:135deg}

/* One compact identity line and one metadata line, without added dots. */
#friends-panel .royal-friends-list{flex:0 1 auto;min-block-size:0;overflow-y:auto;scrollbar-width:thin}
#friends-panel .royal-friends-list::-webkit-scrollbar{display:block;width:3px}
#friends-panel .royal-friends-list::-webkit-scrollbar-thumb{background:#bd936185;border-radius:3px}
#friends-panel .royal-friend-row{gap:clamp(3px,1vmin,6px);min-inline-size:0}
#friends-panel .royal-friend-identity .royal-name-link{
 flex:1 1 0;display:block;white-space:nowrap;overflow:hidden;overflow-wrap:normal;text-overflow:clip;
}
#friends-panel .royal-friend-meta{
 display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;min-inline-size:0;
}
#friends-panel .royal-friend-copy .royal-friend-status{
 flex:0 1 auto;white-space:nowrap;overflow:hidden;overflow-wrap:normal;
}
#friends-panel .royal-friend-status-label,#friends-panel .royal-friend-age{white-space:nowrap;overflow:hidden}
#friends-panel .royal-friend-status .royal-friend-dot{margin-inline-end:3px}
#friends-panel .royal-friend-tier{flex:none;flex-direction:row;gap:2px}
#friends-panel .royal-friend-row .royal-friend-invite{flex:none;white-space:nowrap;overflow-wrap:normal}
:is(#royal-rank-preview,#royal-rank-panel) .royal-rank-display-name{
 display:block;white-space:nowrap;overflow:hidden;overflow-wrap:normal;text-overflow:clip;
}
@media (orientation:portrait) and (hover:none) and (pointer:coarse){
 #friends-panel .royal-friends-list,#friends-panel .royal-friends-list .royal-friend-row{touch-action:none}
}

/* Release announcements keep the inbox scrollable even in phone landscape. */
#royal-mail-count[hidden],.royal-release-mail [hidden]{display:none}
.royal-overlay[data-royal-view=mail]{box-sizing:border-box;width:min(1040px,calc(100dvw - max(14px,env(safe-area-inset-left) + env(safe-area-inset-right) + 10px)));min-height:min(400px,68dvh);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.royal-overlay[data-royal-view=mail] #royal-dialog-body{display:grid;gap:8px;min-width:0}
/* Rotate alongside the existing phone layout; the viewport's height is the
   dialog's inline size and its width is the dialog's block size. */
@media (orientation:portrait) and (hover:none) and (pointer:coarse){
 .royal-overlay[data-royal-view=mail][open]{width:min(1040px,calc(100dvh - max(14px,env(safe-area-inset-top) + env(safe-area-inset-bottom) + 10px)));min-height:min(400px,68dvw)}
}
.royal-game-mail-stack{display:grid;gap:7px;min-width:0}
.royal-game-mail-stack:empty{display:none}
.royal-release-mail{display:block;padding:0;min-width:0;background:linear-gradient(140deg,#492d37,#301c29)}
.royal-release-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:9px 12px;cursor:pointer;list-style:none}
.royal-release-summary::-webkit-details-marker{display:none}
.royal-release-summary::after{content:'+';color:#ffe1a0;font:700 1.1rem/1 system-ui}
.royal-release-mail[open] .royal-release-summary::after{content:'−'}
.royal-release-summary:focus-visible{outline:2px solid #ffdda0;outline-offset:-3px;border-radius:8px}
.royal-release-labels{flex:1;min-width:0}
.royal-release-kicker{color:#f2d1a4;text-transform:uppercase;font:650 .75rem/1.3 system-ui;letter-spacing:.06em}
.royal-release-summary h3{font:500 clamp(1rem,3.8vmin,1.18rem)/1.2 system-ui;overflow-wrap:anywhere}
.royal-release-mail[data-mail-state=unread]{border-color:#d5a56d;background:linear-gradient(140deg,#554039,#3b242d)}
.royal-release-mail[data-mail-state=unread] h3{font-weight:800}
.royal-release-state{border-radius:20px;padding:4px 8px;color:#ebd4bf;background:#573746;font:650 .75rem/1.2 system-ui;text-align:center}
.royal-release-mail[data-mail-state=unread] .royal-release-state{color:#301924;background:#f6cf83;font-weight:750}
.royal-reward-mail h3{font-weight:500}
.royal-game-mail-pending .royal-reward-mail h3{font-weight:750}
.royal-release-content{display:grid;justify-items:start;gap:8px;padding:0 12px 12px;font:400 .94rem/1.4 system-ui;color:#fff3df;overflow-wrap:anywhere}
.royal-release-content p{margin:0}
.royal-release-highlights{margin:0;padding-inline-start:1.25em}
.royal-release-highlights li+li{margin-block-start:3px}
.royal-overlay .royal-release-watch{min-height:40px;max-width:100%;white-space:normal}
.royal-release-status{font-size:.85rem;color:#ffdda0}
.royal-release-mail:not([open])>.royal-release-content{display:none}
.royal-release-highlights{display:grid;gap:8px;width:100%}
.royal-release-highlights li{padding-inline-start:3px}
.royal-release-highlights li>strong{color:#ffe1a0}
.royal-release-case-link{display:inline-flex;align-items:center;min-height:30px;color:#ffdfaa;text-decoration:underline;text-underline-offset:3px}
.royal-release-controls{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding-block-start:5px}
