/* UI consistency pass (2026-10-17). Layout/size only; no game rules.
 * 1) Dialog buttons keep a readable width instead of stretching across the window.
 * 2) Small text floors on phones. 3) Legion menu uses the normal window size. */

/* 1. Single primary actions inside panels: centered, natural width. */
.release-content.chest-inventory044>:not(.chest-grid578) button.primary,.release-content.chest-inventory044>button.primary{display:block;width:auto!important;min-width:180px;max-width:300px;margin-left:auto!important;margin-right:auto!important;padding-left:28px;padding-right:28px}

/* Account panel: one centered column, list buttons share one comfortable width. */
.release-content.account-panel070{margin-left:auto!important;margin-right:auto!important}
.release-content.account-panel070>button{display:block;width:min(340px,100%)!important;margin-left:auto!important;margin-right:auto!important}

/* Legion menu keeps its full-screen sheet, but its two choices sit together in the middle
 * at a fixed size instead of each stretching across half the screen. */
.release-content.legion-menu047{display:grid!important;grid-template-columns:repeat(2,minmax(0,260px))!important;justify-content:center;align-content:center;gap:16px}
.release-content.legion-menu047>:not(button){grid-column:1/-1;width:100%!important;max-width:536px;justify-self:center;box-sizing:border-box}
.release-content.legion-menu047>button.icon-button045{width:100%!important;height:min(170px,40vh)!important;min-height:0!important}
@media (min-width:1500px) and (min-height:850px) and (pointer:fine){.release-content.legion-menu047{zoom:1.4}}

/* 2. Minimum text size for lobby chips that dropped to 10px on phones. */
.release-league.rank047,.release-season{font-size:max(11px,1em)!important}

/* 3. One label style for every lobby landmark (shop, chest, upgrade, deck). */
.landmark047{font-size:13px}

/* 4. One icon size scale (sprite backgrounds use % sizing, so resizing keeps the crop).
 *    xs 18 · s 22 · m 26 · l = lobby landmarks. */
:root{--ic-xs:18px;--ic-s:22px;--ic-m:26px;--ic-l:min(80px,15vh)}
/* Lobby landmarks (shop, chest, deck, upgrade hammer): all the same size. */
#releaseLobby .landmark047 .atlas-icon045,#releaseLobby .landmark047 .blacksmith092{width:var(--ic-l)!important;height:var(--ic-l)!important;flex:0 0 var(--ic-l)!important;flex-basis:var(--ic-l)!important}
/* Currency icons: same size in the top bar and in every panel header. */
#releaseLobby .top047 .wallet052 .reward-icon254,#releaseLobby .top047 .gold047 .reward-icon254,#releasePanel .release-panel-head .reward-icon254{width:24px!important;height:24px!important;flex:0 0 24px!important;margin:0 3px!important}
@media (max-height:450px){#releaseLobby .top047 .wallet052 .reward-icon254,#releaseLobby .top047 .gold047 .reward-icon254,#releasePanel .release-panel-head .reward-icon254{width:var(--ic-s)!important;height:var(--ic-s)!important;flex-basis:var(--ic-s)!important}}
/* Icons inside buttons and price tags. */
#releasePanel button .reward-icon254{width:var(--ic-s)!important;height:var(--ic-s)!important;flex:0 0 var(--ic-s)!important}
#releasePanel small .reward-icon254,#releasePanel .shop044 .product044>small .reward-icon254{width:var(--ic-xs)!important;height:var(--ic-xs)!important;flex:0 0 var(--ic-xs)!important}
/* Tab icons (shop tabs, workshop categories, evolution toggles). */
#releasePanel .shop-nav .atlas-icon045,#releasePanel .work-category-art089,#releasePanel button>.evolution-icon20261008,.evolution-toggle566 .atlas-icon045{width:var(--ic-m)!important;height:var(--ic-m)!important;flex:0 0 var(--ic-m)!important}
/* Keep icons optically centered next to their labels. */
.reward-icon254,.atlas-icon045{vertical-align:middle}
#releasePanel button:has(>.reward-icon254),#releasePanel button:has(>.atlas-icon045){display:inline-flex;align-items:center;justify-content:center;gap:6px}

/* 5. Big-screen scale (tablets, PC). --ui-k is set by ui-consistency-20261017.js; phones keep 1.
 *    Only self-contained chrome is scaled; the battlefield canvas and card dock keep their own fitting. */
.ui-large1017 #releaseLobby .top047,.ui-large1017 #releaseLobby .footer047,.ui-large1017 #releaseLobby .battle-actions047{zoom:var(--ui-k,1)}
.ui-large1017 #releaseLobby .story-entry068,.ui-large1017 #releaseLobby .legion047,.ui-large1017 #releaseLobby .landmark047 .icon-caption045{zoom:var(--ui-k,1)}
.ui-large1017 #hud,.ui-large1017 #synergyRail048,.ui-large1017 #menuButton,.ui-large1017 #rosterButton,.ui-large1017 .merge-feed{zoom:var(--ui-k,1)}
.ui-large1017 #controls .spell-change,.ui-large1017 #controls .recipe-book048{zoom:min(var(--ui-k,1),1.2)}
/* The HUD width is written in px by the fitter; under zoom it must follow left/right instead. */
.ui-large1017 #hud{width:calc(var(--view-w,100vw) / var(--ui-k,1) - 16px)!important;max-width:none!important}

/* 6. Settings: category list + one page. */
.release-content.settings045.settings-tier1017{display:grid!important;grid-template-columns:minmax(150px,220px) minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;gap:14px!important;align-items:stretch;overflow:hidden!important;columns:auto!important}
.settings-nav1017{display:flex;flex-direction:column;gap:6px;overflow-y:auto;padding:2px;border-right:1px solid #2c4658;padding-right:12px}
.settings-tab1017{display:grid!important;gap:2px;width:100%!important;min-height:52px;padding:8px 12px!important;text-align:left!important;justify-items:start;background:#0f2633!important;border:2px solid #2c4658!important;border-radius:8px;color:#dfeef3!important;cursor:pointer}
.settings-tab1017 strong{font-size:14px}.settings-tab1017 small{font-size:11px;color:#8fa8b4;line-height:1.3}
.settings-tab1017.active{border-color:#e6c276!important;background:#1d3d4f!important;color:#ffe7a8!important}
.settings-pages1017{overflow-y:auto;min-width:0;padding-right:4px}
.settings-page1017>article.settings-group045{display:flex!important;flex-direction:column;align-items:stretch;gap:10px;max-width:520px;margin:0 0 18px!important;break-inside:auto}
.settings-page1017>article.settings-group045>button,.settings-page1017>article.settings-group045>a{width:100%!important;max-width:360px}
.settings-page1017>article.settings-group045>h3{margin:0 0 2px;font-size:17px}
.settings-page1017 .language-asia4{max-width:360px}
@media (max-height:450px){.release-content.settings045.settings-tier1017{grid-template-columns:minmax(132px,170px) minmax(0,1fr)!important;gap:10px!important}.settings-tab1017{min-height:44px;padding:6px 10px!important}.settings-tab1017 small{display:none}}

/* Owned-chest cards: buttons stay inside the card frame. */
.release-content.chest-inventory044 .product044{box-sizing:border-box}
.release-content.chest-inventory044 .product044>button{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box;margin-left:0!important;margin-right:0!important}

/* 7. Chest rewards: every reward picture sits in the same square, whatever its source size. */
.loot-cards .loot-card>img{width:auto!important;height:84px!important;max-width:100%;object-fit:contain;margin:6px auto 0;display:block}
.loot-cards .loot-card>.loot-icon046{width:72px!important;height:72px!important;flex:0 0 72px!important;margin:12px auto 6px!important}
@media (max-height:450px){.loot-cards .loot-card>img{height:56px!important}.loot-cards .loot-card>.loot-icon046{width:48px!important;height:48px!important;flex-basis:48px!important;margin:6px auto 2px!important}}

/* 8. Battle result on big screens: a landscape card that fits the screen instead of a tall strip. */
.ui-large1017 #result.release-result .result-card{zoom:var(--ui-k,1);height:min(640px,calc(92vh / var(--ui-k,1)))!important;max-height:calc(92vh / var(--ui-k,1))!important;width:min(960px,calc(94vw / var(--ui-k,1)))!important}

/* 9. Panel frame: the 48px button frame has a bottom shade and a short left highlight; stretched over a
      big panel they show up as a dark band and a broken line. Panels use a flat-centre copy instead. */
html.pixel-ui038{--pixel-panel1017:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%20viewBox%3D%220%200%2048%2048%22%20shape-rendering%3D%22crispEdges%22%3E%0A%3Cpath%20fill%3D%22%2307131e%22%20d%3D%22M6%200H42V2H46V6H48V42H46V46H42V48H6V46H2V42H0V6H2V2H6Z%22%2F%3E%0A%3Cpath%20fill%3D%22%23deb96a%22%20d%3D%22M6%202H42V4H44V6H46V42H44V44H42V46H6V44H4V42H2V6H4V4H6Z%22%2F%3E%0A%3Cpath%20fill%3D%22%23fff1b3%22%20d%3D%22M6%202H42V4H8V6H6V40H4V6H6Z%22%2F%3E%0A%3Cpath%20fill%3D%22%23886037%22%20d%3D%22M42%206H44V42H42V44H6V42H40V40H42Z%22%2F%3E%0A%3Cpath%20fill%3D%22%2334302e%22%20d%3D%22M10%206H38V8H40V10H42V38H40V40H38V42H10V40H8V38H6V10H8V8H10Z%22%2F%3E%0A%3Cpath%20fill%3D%22%23133b49%22%20d%3D%22M12%208H36V10H38V12H40V36H38V38H36V40H12V38H10V36H8V12H10V10H12Z%22%2F%3E%0A%3Cpath%20fill%3D%22%23886037%22%20d%3D%22M12%208H36V10H12ZM10%2010H12V12H10ZM8%2012H10V36H8Z%22%2F%3E%0A%3Cpath%20fill%3D%22%2334302e%22%20d%3D%22M5%204h4v1h1v4h-1v1h-4v-1h-1v-4h1Z%22%2F%3E%3Cpath%20fill%3D%22%2363d4df%22%20d%3D%22M6%205h2v1h1v2h-1v1h-2v-1h-1v-2h1Z%22%2F%3E%3Crect%20fill%3D%22%23fff1b3%22%20x%3D%226%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3Cpath%20fill%3D%22%2334302e%22%20d%3D%22M39%204h4v1h1v4h-1v1h-4v-1h-1v-4h1Z%22%2F%3E%3Cpath%20fill%3D%22%2363d4df%22%20d%3D%22M40%205h2v1h1v2h-1v1h-2v-1h-1v-2h1Z%22%2F%3E%3Crect%20fill%3D%22%23fff1b3%22%20x%3D%2240%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3Cpath%20fill%3D%22%2334302e%22%20d%3D%22M5%2038h4v1h1v4h-1v1h-4v-1h-1v-4h1Z%22%2F%3E%3Cpath%20fill%3D%22%2363d4df%22%20d%3D%22M6%2039h2v1h1v2h-1v1h-2v-1h-1v-2h1Z%22%2F%3E%3Crect%20fill%3D%22%23fff1b3%22%20x%3D%226%22%20y%3D%2239%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3Cpath%20fill%3D%22%2334302e%22%20d%3D%22M39%2038h4v1h1v4h-1v1h-4v-1h-1v-4h1Z%22%2F%3E%3Cpath%20fill%3D%22%2363d4df%22%20d%3D%22M40%2039h2v1h1v2h-1v1h-2v-1h-1v-2h1Z%22%2F%3E%3Crect%20fill%3D%22%23fff1b3%22%20x%3D%2240%22%20y%3D%2239%22%20width%3D%221%22%20height%3D%221%22%2F%3E%3C%2Fsvg%3E')}
html.pixel-ui038 :is(.pixel-panel079,#result .result-card,#pausePanel .pause-card,.px-dialog,#atlasV3 .codex-shell,#synergyGuide .codex-shell){border-image-source:var(--pixel-panel1017)!important}

/* 10. Lobby top bar: everything on the row has one height, one font and is centred on one line. */
#releaseLobby .top047{--top-h:34px;--top-f:13px;display:flex;align-items:center!important;gap:10px;height:auto!important;min-height:calc(var(--top-h) + 6px)!important;padding-top:3px!important;padding-bottom:3px!important;box-sizing:border-box}
#releaseLobby .top047>:is(.account-level085,#myPage091,.rank047,.wallet052,#account070,.icon-button045){box-sizing:border-box;height:var(--top-h)!important;min-height:0!important;max-height:none!important;margin-top:0!important;margin-bottom:0!important;align-self:center!important;top:auto!important;transform:none!important;display:inline-flex;align-items:center;justify-content:center;font-family:Galmuri11,system-ui,sans-serif!important;font-size:var(--top-f)!important;line-height:1!important}
#releaseLobby .top047>:is(.rank047,.wallet052,#account070){padding-top:0!important;padding-bottom:0!important;padding-left:12px!important;padding-right:12px!important;gap:6px}
#releaseLobby .top047 .wallet052,#releaseLobby .top047 .wallet052 *{font-weight:700!important;font-size:var(--top-f)!important;line-height:1!important}
#releaseLobby .top047 .wallet052 .currency-value571{min-width:3ch;text-align:right;font-variant-numeric:tabular-nums}
#releaseLobby .top047 .wallet052 .reward-icon254{width:calc(var(--top-h) - 12px)!important;height:calc(var(--top-h) - 12px)!important;flex:none}
#releaseLobby .top047 .rank047{font-weight:700!important}
#releaseLobby .top047 .account-level085{flex-direction:column;gap:3px;padding:0 6px!important}
#releaseLobby .top047 .account-level085 strong{font-size:var(--top-f)!important;line-height:1!important}
#releaseLobby .top047 .account-level085 progress{height:4px!important;width:100%}
#releaseLobby .top047 .icon-button045{width:var(--top-h)!important;padding:0!important}
#releaseLobby .top047 .icon-button045 .atlas-icon045{width:calc(var(--top-h) - 4px)!important;height:calc(var(--top-h) - 4px)!important;margin:0!important}
@media (max-height:450px){#releaseLobby .top047{--top-h:28px;--top-f:11px;gap:6px}#releaseLobby .top047>:is(.rank047,.wallet052,#account070){padding-left:8px!important;padding-right:8px!important}}
#releaseLobby .top047>:is(.account-level085,#account070){border:2px solid transparent!important;border-radius:0!important;border-image:var(--plate052) 28 fill / 7px / 0 stretch!important;background:#082337!important;background-clip:padding-box!important;box-shadow:none!important;color:#fff2d0!important;text-shadow:1px 1px #071522}
@media (max-height:450px){#releaseLobby .top047>:is(.account-level085,#account070){border-image-width:6px!important}}
