/* Menu clarity pass. Illustration and gameplay styles remain owned by their modules. */
:root{--ui-cream:#fff0cc;--ui-muted:#ddcee9;--ui-edge:#aa8cbd;--ui-button:linear-gradient(#735789,#49365e);--ui-accent:linear-gradient(#fde7ae,#e3ca84)}
body.in-menu:not(.watching-background) iframe[data-menu-background-scene]{opacity:.18;filter:none}
body.in-menu.watching-background iframe[data-menu-background-scene]{opacity:1;filter:none}
body.hex-desktop-screens #lobby.home-menu .home-rank-rail>#rank-road-open{min-height:260px;padding:16px;gap:7px}
body #lobby.home-menu .home-rewards{background:#241d33b3;box-shadow:none;border-color:#8d779d60}
body #lobby.home-menu :is(#account-open,#phone-rewards-open small){font-family:'Trebuchet MS',sans-serif!important;letter-spacing:0}
body #lobby.home-menu :is(.pc-chat-line,.rank-label,.rank-mini small){color:var(--ui-muted)}

/* A shared secondary button and selected state across Academy and wardrobe. */
body .academy-app :is(.academy-top button,.academy-navigation button,.academy-ownership button,.academy-demo-controls button),
body.hex-screen-ui #hub-dialog :is(#hub-close,.fitting-sheet-close,.wardrobe-page-back),
body #hub-dialog[data-tab=cosmetics] :is(.wardrobe-tabs button,.collection-filters button){
 font-family:'Trebuchet MS',sans-serif!important;font-weight:700!important;
 color:var(--ui-cream)!important;background:var(--ui-button)!important;
 border:1px solid var(--ui-edge)!important;border-bottom:3px solid #32233f!important;
 border-radius:12px!important;box-shadow:0 3px 0 #160f2440!important;
}
body .academy-app .academy-ownership button[aria-pressed=true],
body #hub-dialog[data-tab=cosmetics] :is(.wardrobe-tabs button,.collection-filters button)[aria-pressed=true]{
 background:var(--ui-accent)!important;color:#372e24!important;border-color:#fdeec2!important;border-bottom-color:#718b4b!important;
}
body .academy-app button:focus-visible,body #hub-dialog button:focus-visible,body #lobby.home-menu button:focus-visible{outline:3px solid #fde8af;outline-offset:3px}
.academy-app .academy-spell>small{font-size:12px;color:#f1e4f9;text-transform:none;letter-spacing:0}
.academy-app .academy-spell-summary{font:15px/1.45 'Trebuchet MS',sans-serif;color:#fff0da;max-width:48ch;margin:4px 0 12px}
.academy-app .academy-study-meter{padding:10px 12px;border:1px solid #b79ccc66;border-radius:12px;background:#21172d99;margin:8px 0}
.academy-study-meter>strong{display:block;font-size:13px;color:#f0e2fd;margin-bottom:7px}
.academy-study-meter>small,.academy-mastery-help{display:block;font-size:12px;line-height:1.4;color:#dfd1eb;margin-top:5px}
.academy-app .academy-mastery-badge{display:flex;flex-wrap:wrap;gap:5px 10px;padding:9px 12px;background:#20172a99;border-color:#a992b866}
.academy-mastery-help{flex-basis:100%}
.academy-app .academy-spell-notes summary{font-family:'Trebuchet MS',sans-serif}
body #hub-dialog[data-tab=cosmetics] .hat-position[hidden],body #hub-dialog[data-tab=cosmetics] .fitting-actions button[hidden]{display:none!important}
body #hub-dialog[data-tab=cosmetics] .cosmetic-expand-card{position:relative}
body #hub-dialog[data-tab=cosmetics] .fitting-ownership{display:block!important;position:absolute;z-index:2;top:10px;left:10px;max-width:calc(100% - 20px);box-sizing:border-box;padding:5px 9px;border-radius:8px;background:#251b37ef;color:#e4d5ed;font:700 12px/1.3 'Trebuchet MS',sans-serif;pointer-events:none;border:1px solid #9983aa}
body #hub-dialog[data-tab=cosmetics] .fitting-ownership[data-state=equipped]{background:#f5dea0;color:#372e24;border-color:#fdeec3}
body #hub-dialog[data-tab=cosmetics] .fitting-ownership[data-state=preview]{background:#c5daf3;color:#203247}

/* Short landscape: retain the familiar composition, remove tiny secondary copy. */
body #lobby.home-phone-fit .pc-chat-window,body #lobby.home-phone-fit .pc-chat-enter,
body #lobby.home-phone-fit #solo-record,body #lobby.home-phone-fit .home-rank-hint,
body #lobby.home-phone-fit #rank-gap{display:none!important}
body:not(.hex-fixed-home) #lobby.home-phone-fit .pc-chat-preview{
 min-height:var(--home-control-height)!important;height:var(--home-control-height)!important;
 padding:10px 14px!important;justify-content:center;
}
body #lobby.home-phone-fit .pc-chat-top{padding:0;border:0}
body #lobby.home-phone-fit .pc-chat-top strong{font-size:var(--home-readable-font)!important}
body #lobby.home-phone-fit :is(#rank-next,.rank-mini small,#account-open,.pc-battle-utilities button,.pc-battle-utilities a,#phone-rewards-open small){font-size:var(--home-readable-font)!important;line-height:1.25!important}
body #lobby.home-phone-fit #rank-name{font-size:calc(var(--home-readable-font) + 3px)!important}
body.hex-desktop-screens #lobby.home-phone-fit .home-rank-rail>#rank-road-open{min-height:240px;padding:15px 10px;gap:8px}
body #lobby.home-phone-fit .pc-battle-utilities :is(button,a){min-height:var(--home-control-height)!important}
body #lobby.home-phone-fit .academy-friends-label{font-size:var(--home-readable-font)!important}
body.hex-desktop-screens #lobby.home-menu.home-phone-fit .home-header #account-open{
 font:700 var(--home-readable-font)/1.2 'Trebuchet MS',sans-serif!important;
 min-height:var(--home-control-height)!important;
}
body.hex-desktop-screens #lobby.home-menu.home-phone-fit .pc-battle-utilities #watch-background,
body.hex-desktop-screens #lobby.home-menu.home-phone-fit .pc-battle-utilities a{font-size:var(--home-readable-font)!important;min-height:var(--home-control-height)!important}
body.hex-desktop-screens #lobby.home-menu.home-phone-fit #phone-rewards-open{height:86px}
@media(max-height:500px){
 .academy-app .academy-spell-summary{font-size:13px;line-height:1.3;margin:3px 0 7px}
 .academy-app .academy-study-meter{padding:6px 9px;margin:5px 0}
 .academy-study-meter>strong{margin-bottom:3px}
 .academy-study-meter>small,.academy-mastery-help{font-size:12px}
 .academy-app .academy-mastery-badge{padding:6px 9px}
 .academy-app .academy-detail{align-items:start}
 .academy-app .academy-study-meter>small,.academy-app .academy-mastery-help{display:none}
 .academy-app .academy-detail .academy-spell-page{gap:0}
 .academy-app .academy-detail .academy-study-meter{margin:3px 0;padding:5px 8px}
 .academy-app .academy-detail .academy-mastery-badge{margin:3px 0;padding:5px 8px}
 .academy-app .academy-detail .academy-spell-summary{margin:2px 0 4px}
 .academy-app .academy-detail .academy-progress{margin:0}
 body #hub-dialog[data-tab=cosmetics] .fitting-ownership{font-size:11px;top:6px;left:6px;padding:3px 7px}
}
@media(prefers-reduced-motion:reduce){body.in-menu:not(.watching-background) iframe[data-menu-background-scene]{filter:none}}

/* Reflow the fitting room instead of shrinking its text with the desktop canvas. */
@media(max-height:500px) and (orientation:landscape){
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content{padding:8px 12px}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room{position:relative;inset:auto;transform:none;width:100%;height:100%;grid-template-columns:minmax(135px,23%) minmax(0,1fr);gap:12px}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-preview{height:100%;padding:10px;grid-template-rows:22px minmax(0,1fr) 22px auto;gap:6px;border-radius:18px}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-preview h2{font-size:16px!important;line-height:22px}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-tabs button{height:44px!important;min-height:44px!important;padding:5px!important;font-size:13px!important;gap:4px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-tabs button strong{font-size:13px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-tabs button img{width:22px!important;height:24px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe{grid-template-rows:44px 48px minmax(0,1fr) 18px!important;gap:6px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-cards{grid-auto-rows:170px!important;gap:10px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-cards article.cosmetic-expand-card{min-height:0!important;padding:8px!important;grid-template-rows:minmax(0,1fr) 32px 20px!important;gap:4px!important;border-radius:16px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-cards article.cosmetic-expand-card h3{font-size:13px!important;line-height:16px}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-art{min-height:0!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .cosmetic-expand-hint{font-size:12px!important}
}
@media(max-height:500px) and (max-width:650px) and (orientation:landscape){
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-tabs button img{display:none}
}
@media(max-height:320px) and (orientation:landscape){
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe{grid-template-rows:32px 32px minmax(0,1fr) 14px!important;gap:4px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room :is(.wardrobe-tabs,.collection-filters) button{height:32px!important;min-height:32px!important;padding:3px!important;font-size:12px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-cards{grid-auto-rows:112px!important;gap:6px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .wardrobe-cards article.cosmetic-expand-card{padding:5px!important;grid-template-rows:minmax(0,1fr) 28px 16px!important;gap:2px!important}
 body.hex-screen-ui.hex-desktop-screens #hub-dialog[data-tab=cosmetics] #hub-content .fitting-room .cosmetic-expand-hint{font-size:11px!important}
}

/* Compact identity controls fit their actual header and Play geometry. */
body.hex-desktop-screens #lobby.home-menu.home-phone-fit .home-header #account-open{box-sizing:border-box;height:56px!important;min-height:56px!important;max-height:56px!important;max-width:240px!important;width:auto!important;padding:8px 12px 8px 48px!important;font-size:18px!important;line-height:1.2!important;align-self:center;margin:0!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body #lobby.home-phone-fit .play-panel>.rename-scroll{top:var(--compact-name-top,auto)!important;bottom:auto!important}
