/* Premium accents and adaptive controls for the overnight release. Geometry remains source-owned. */
#app.reference-main-menu .menu-stack>[data-reference-label="Protocol"]{border-image-source:url('/assets/reference-ui/frame-gold-v1.svg')!important;background:linear-gradient(112deg,#06172af5,#113958e8 60%,#173e4dee)!important;box-shadow:inset 0 1px #cdeeff55,0 0 9px #4cbbf040!important}
#app.reference-main-menu .menu-stack>[data-reference-label="Protocol"] .menu-button-icon{color:#f4d784!important;filter:drop-shadow(0 0 4px #3499df66)}
#app.reference-main-menu .menu-stack>[data-reference-label="Endless"]{box-shadow:inset 0 0 9px #efd66a35,0 0 9px #ffc85b45!important;animation:endless-release-glow 4s ease-in-out infinite alternate}
@keyframes endless-release-glow{to{box-shadow:inset 0 0 12px #efd66a55,0 0 14px #ffc85b66}}
#app.reference-main-menu .release-online-locked .menu-button-icon:after{content:'🔒';position:absolute;right:10%;bottom:4%;font-size:.45em;filter:none}
#app.reference-main-menu .release-online-locked{filter:saturate(.65)}
.release-unavailable{display:block;font:800 max(8px,.55em)/1.25 Arial,sans-serif;letter-spacing:.08em;color:#f5db92;text-shadow:0 1px 2px #000;white-space:nowrap}
.release-legal-links{margin-top:20px;padding:14px;border:1px solid #4e7189;border-radius:8px;background:#061b2be8;display:grid;gap:8px}
.release-legal-links h3{margin:0 0 5px;color:#e7ca83;font-size:15px}.release-legal-links button{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:44px}.release-legal-links small{color:#ecd190;font-size:10px}.release-delete-account{display:block;width:100%;min-height:44px;margin-top:20px!important;border-color:#ba6672!important;color:#ffd5da!important;background:linear-gradient(125deg,#53222a,#27141d)!important}.release-legal-links .release-delete-account{margin-top:8px!important}
.release-soon,.release-legal,.progression-reward{position:fixed;inset:0;z-index:16000;display:grid;place-items:center;padding:max(12px,var(--safe-top,0px)) max(12px,var(--safe-right,0px)) max(12px,var(--safe-bottom,0px)) max(12px,var(--safe-left,0px));background:#020a13d9;color:#f2f6fc;font-family:Arial,sans-serif;box-sizing:border-box}
.release-soon section,.progression-reward section{width:min(480px,88vw);max-height:100%;overflow:auto;box-sizing:border-box;padding:clamp(14px,4vh,34px);text-align:center;border:8px solid transparent;border-image:url('/assets/reference-ui/frame-gold-v1.svg') 22 / 8px / 0 stretch;background:radial-gradient(ellipse at 50% 20%,#3e4b41,#0c2439 70%);box-shadow:0 12px 60px #0009}.release-soon h2,.progression-reward h1{color:#ffe4a1;font-size:clamp(22px,5vh,34px);margin:8px 0}.release-emblem{font-size:38px;color:#e6c565}.release-soon button,.progression-collect{min-height:44px;padding:10px 18px;border:5px solid transparent;border-image:url('/assets/reference-ui/frame-blue-v1.svg') 22 / 5px / 0 stretch;background:linear-gradient(#23577a,#0b2135);color:white;font-weight:800;width:100%}.release-soon p{margin:12px 0 20px}
.release-legal>section{width:min(980px,100%);height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;border:1px solid #bd9d51;background:#081b2b;box-sizing:border-box}.release-legal header,.release-legal footer{padding:10px 18px;background:#12334a}.release-legal h1{margin:0;font-size:clamp(18px,4vh,30px)}.release-legal article{overflow:auto;padding:12px 24px;font-size:clamp(13px,2.8vh,18px);line-height:1.65;overscroll-behavior:contain}.release-legal footer button{min-height:44px}
.progression-reward{backdrop-filter:blur(5px)}.progression-reward small{color:#f2ce6f;font-size:12px;letter-spacing:.16em}.progression-chest{position:relative;height:clamp(80px,27vh,240px);margin:5px auto;display:grid;place-items:center}.progression-chest:before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse,#ffe19f55,transparent 65%);animation:rank-chest-shine 2s ease-in-out infinite alternate}.progression-chest>img{height:100%;max-width:100%;object-fit:contain;position:relative;filter:drop-shadow(0 0 12px #f9c65766)}.progression-chest .promotion-insignia{position:absolute;right:12%;top:0;height:50%;filter:drop-shadow(0 2px 6px #000)}.progression-amounts{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.progression-amounts b{padding:6px 10px;background:#05281f;border:1px solid #7aab79;border-radius:5px;font-size:clamp(12px,3vh,18px)}.progression-amounts b:nth-child(2){color:#ffbdce;background:#351329;border-color:#af567b}.progression-reward p{font-size:13px;line-height:1.4}.progression-reward-status:empty{display:none}@keyframes rank-chest-shine{to{transform:scale(1.12);opacity:.6}}
.full-currency-integer{white-space:nowrap!important;text-overflow:clip!important;overflow:visible!important;font-variant-numeric:tabular-nums;letter-spacing:0!important;min-width:0!important}
.endless-camera-controls{position:absolute;right:max(8px,var(--safe-right,0px));bottom:calc(var(--endless-toolbar-height,74px) + 8px);z-index:12;display:flex;gap:3px;pointer-events:auto}.endless-camera-controls button{min-width:44px;min-height:44px;padding:4px 8px;border:1px solid #7299b2;background:#0a2439ed;color:#e5f6ff;border-radius:5px;font-size:17px;font-weight:800}.endless-camera-controls [data-camera="reset"]{font-size:12px;min-width:58px}.endless-battle canvas{touch-action:none}
.campaign-section[data-season]{padding:10px 10px 16px;margin-bottom:16px;border:1px solid var(--season-color);border-radius:9px;background:linear-gradient(120deg,var(--season-glaze),#061724d9 62%);position:relative}.campaign-section[data-season="1"]{--season-color:#7bba96;--season-glaze:#254d3fbb}.campaign-section[data-season="2"]{--season-color:#8fb7d5;--season-glaze:#344b64bb}.campaign-section[data-season="3"]{--season-color:#d0ac68;--season-glaze:#5b472abb}.campaign-section[data-season]>h3{color:var(--season-color);padding:10px 8px;border-bottom:1px solid var(--season-color);font-size:clamp(14px,3.5vh,22px);letter-spacing:.06em}.mission-archive-nav button{min-height:44px;white-space:normal!important;line-height:1.15!important;font-size:clamp(10px,2.8vh,16px)!important}.mission-archive-nav button:nth-child(1){border-color:#7bba96}.mission-archive-nav button:nth-child(2){border-color:#8fb7d5}.mission-archive-nav button:nth-child(3){border-color:#d0ac68}
.tower-reference-card,.enemy-reference-card{position:relative;isolation:isolate;border:1px solid #718e9d!important;background:linear-gradient(115deg,#142f40ee,#06121fe8),url('/assets/daily-depot-1280-v2.webp') center/cover!important;box-shadow:inset 0 1px #d4e5eb20,0 3px 9px #0007;overflow:hidden}.tower-reference-card:before,.enemy-reference-card:before{content:'';position:absolute;right:-14%;top:3%;bottom:3%;width:65%;z-index:-1;background:var(--card-art) right center/contain no-repeat;opacity:.22;filter:drop-shadow(0 0 5px #aed2dc77);pointer-events:none}.tower-reference-card h2,.enemy-reference-card h2{color:#f6e3b0}.preordered-future-tower>b{color:#f7da87;border:1px solid #ba9c4b;padding:5px 10px}.preordered-future-tower p{line-height:1.4}
.atomcore-counter,.atomcore-menu-button{filter:drop-shadow(0 0 5px #33e18b40)}img[src*="atomcore"]{filter:drop-shadow(0 0 4px #62f1a36b)}.atomcore-identity{background:radial-gradient(ellipse,#0b492d66,transparent 68%)}.atomcore-panel .atomcore-meter{box-shadow:inset 0 0 9px #062c1b,0 0 8px #57df8e22}.atomcore-panel .atomcore-current-reward{border-color:#61b68d!important}
@media(max-height:420px){.progression-reward section{width:min(470px,88vw);padding:12px}.progression-chest{height:90px}.progression-reward h1{font-size:23px;margin:4px}.progression-reward p{margin:6px 0}.progression-reward small{font-size:9px}.progression-amounts b{font-size:12px;padding:4px 7px}.release-legal-links{padding:10px}.endless-camera-controls{bottom:78px}}
@media(prefers-reduced-motion:reduce){#app.reference-main-menu .menu-stack>[data-reference-label="Endless"],.progression-chest:before{animation:none}}

.mission-premium-actions button{min-height:44px!important;height:auto!important;padding:5px 7px!important;gap:2px;line-height:1.1!important;overflow:hidden}.mission-premium-actions button span{font-size:10px!important;line-height:1.1}.mission-premium-actions button b{font-size:12px!important;line-height:1.1;margin-top:1px}.mission-premium-actions .release-unavailable{font-size:8px!important;line-height:1.1}

.store-page [data-release-unavailable],.store-screen [data-release-unavailable]{height:auto!important;min-height:44px!important;line-height:1.1!important;display:flex!important;flex-direction:column!important;justify-content:center!important}.store-page .release-unavailable,.store-screen .release-unavailable{font-size:9px!important;line-height:1.15!important}.remove-ads-menu-anchor button .release-unavailable{position:absolute;bottom:1px;left:0;right:0;text-align:center;font-size:8px!important;line-height:1.1}.endless-camera-controls{left:8px!important;right:auto!important}


#app.reference-main-menu .remove-ads-art-menu .release-unavailable{bottom:10%!important;left:24%!important;right:24%!important;z-index:3;font-size:12px!important;line-height:1.1!important;background:#192509ee;color:#ffefaa;border:1px solid #c9ac55;border-radius:3px;padding:1px 3px!important}


.progression-reward .progression-chest{display:block;isolation:isolate;width:min(260px,64vw);height:clamp(70px,24vh,170px);min-height:0;pointer-events:none}.progression-reward .progression-chest>img:first-child{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-height:100%!important;min-height:0!important;object-fit:contain!important;pointer-events:none}.progression-reward .progression-chest .promotion-insignia{position:absolute!important;inset:0 0 auto auto!important;width:52px!important;height:52px!important;max-height:52px!important;object-fit:contain;pointer-events:none}.progression-reward .progression-collect{position:relative;z-index:2}


.preordered-future-tower .preorder-status{display:inline-block;white-space:nowrap;color:#f7da87;border:1px solid #ba9c4b;padding:5px 10px;border-radius:4px;background:#35280cbb}.preordered-future-tower>div{min-width:0}.preordered-future-tower h3{color:#f6e3b0}


#app.reference-store .store-header.large-balances{flex-wrap:wrap!important}#app.reference-store .store-header.large-balances .reference-store-wallet{flex:1 1 100%!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}.store-wallet strong,.online-resource-value{white-space:nowrap!important;text-overflow:clip!important;min-width:0!important}


.mission-premium-actions .watch-ad-coins[data-release-unavailable]>b{font-size:11px!important;line-height:1.05!important;margin:0!important}.mission-premium-actions .watch-ad-coins .ad-rubies{font-size:9px!important;line-height:1.05!important;display:inline-flex!important;align-items:center;gap:2px}.mission-premium-actions .watch-ad-coins .ad-rubies img{width:10px!important;height:10px!important;object-fit:contain}.mission-premium-actions .watch-ad-coins>.release-unavailable{font-size:9px!important;line-height:1.1!important;min-height:10px}


.mission-premium-actions .watch-ad-coins[data-release-unavailable]{height:54px!important;min-height:54px!important;padding:2px 5px!important;row-gap:0!important;grid-template-rows:11px minmax(0,1fr) 10px!important;align-items:center}.mission-premium-actions .watch-ad-coins>.release-unavailable{align-self:center;white-space:nowrap}


#app.online-screen .online-top-hud.md-resource-large{grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr)!important;gap:4px!important}#app.online-screen .online-top-hud.md-resource-large .online-player-resources{min-width:0!important;max-width:100%;gap:2px!important}#app.online-screen .online-top-hud.md-resource-large .online-player-resources>span{min-width:0!important;flex:1 1 auto;padding:2px 3px!important;gap:2px!important}#app.online-screen .online-top-hud.md-resource-large .online-coins-a{flex-grow:3!important}#app.online-screen .online-top-hud.md-resource-large .online-resource-value{display:block;flex:1 1 auto;min-width:0!important}

.release-legal{height:100dvh;max-height:100dvh;overflow:hidden}.release-legal>section{min-height:0;max-height:100%;overflow:hidden}.release-legal article{min-height:0}.release-legal footer{flex-shrink:0}

/* Retired small-screen rules must not change the master canvas's containing
   blocks. Its outer scale is responsible for fitting the screen. */
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-stack{position:absolute!important;left:55.1px!important;top:29.2%!important;bottom:auto!important;width:411.84px!important;height:auto!important;margin:0!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .database-buttons{position:absolute!important;left:auto!important;right:34.56px!important;top:auto!important;bottom:110px!important;width:201.6px!important;height:105px!important;margin:0!important;transform:none!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-feature-column{position:absolute!important;left:auto!important;right:34.56px!important;top:199.71px!important;bottom:auto!important;width:240px!important;height:calc(100% - 446.97px)!important;min-height:0!important;align-self:auto!important;margin:0!important;transform:none!important}
html.md-main-menu-master:not(.md-main-menu-phone-reference) #brightness>#app.reference-main-menu.reference-ui .modern-defense-structure{position:absolute!important;left:54.72px!important;top:28.8px!important;height:auto!important;margin:0!important}
html.md-main-menu-master:not(.md-main-menu-phone-reference) #brightness>#app.reference-main-menu.reference-ui .menu-reference-motto{position:absolute!important;left:122.88px!important;top:0!important;width:522.24px!important;margin:0!important}
/* Keep header content in flow: balances and account identity must never share
   absolute coordinates. The same grid handles guest, signed-in and full wallets. */
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-top{
  position:fixed!important;left:auto!important;right:21px!important;top:12px!important;
  width:760px!important;max-width:none!important;height:auto!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) 178px 134px!important;
  grid-template-areas:"wallet navigation store" "identity identity identity"!important;
  align-items:center!important;gap:8px!important;
}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-navigation{
  grid-area:navigation;display:flex!important;align-items:center!important;gap:8px!important;height:40px!important;
}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-navigation>.menu-reference-icon-only{width:38px!important;min-width:38px!important;flex:0 0 38px!important;height:38px!important;min-height:38px!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-navigation>.language-selector{width:86px!important;min-width:86px!important;flex:0 0 86px!important;height:38px!important;min-height:38px!important;font-size:14px!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-top>.store-menu-button{grid-area:store;width:134px!important;min-width:134px!important;height:40px!important;min-height:40px!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-top>.menu-currencies{
  grid-area:wallet;position:static!important;inset:auto!important;width:100%!important;max-width:none!important;min-width:0!important;
  display:grid!important;grid-template-columns:118px 110px 96px 90px!important;align-items:center!important;
  gap:6px!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;
}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-top>.menu-currencies>span{
  position:static!important;width:100%!important;min-width:0!important;max-width:none!important;
  height:40px!important;min-height:40px!important;box-sizing:border-box!important;
  padding:0 4px!important;gap:4px!important;border-width:5px!important;border-image-width:5px!important;font-size:18px!important;
}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-top>.menu-currencies b{display:block!important;flex:1 1 0!important;width:0!important;min-width:0!important;max-width:none!important;font-size:18px;text-align:center!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-currencies img{width:22px!important;height:24px!important;flex:0 0 22px!important;object-fit:contain!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-currencies button:not(.atomcore-counter){width:18px!important;min-width:18px!important;height:22px!important;min-height:22px!important;flex:0 0 18px!important;font-size:15px!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-currencies .key-hud img{width:18px!important;flex-basis:18px!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-currencies .atomcore-counter{display:flex!important;align-items:center!important;width:100%!important;min-width:0!important;height:100%!important;min-height:0!important;gap:4px!important;padding:0!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-auxiliary{
  grid-area:identity;position:static!important;inset:auto!important;width:100%!important;max-width:none!important;min-width:0!important;
  display:flex!important;justify-content:flex-end!important;gap:8px!important;margin:0!important;
}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-auxiliary .username{max-width:100%!important;margin:0!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:right!important;font-size:11px!important;line-height:16px!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui.md-wallet-large .menu-reference-top{
  grid-template-areas:". navigation store" "wallet wallet wallet" "identity identity identity"!important;
}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui.md-wallet-large .menu-reference-top>.menu-currencies{grid-template-columns:repeat(4,minmax(0,1fr))!important}
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui.md-wallet-extreme .menu-reference-top>.menu-currencies{grid-template-columns:repeat(2,minmax(0,1fr))!important}
/* Fit the complete slogan above the featured cards, including all three lines. */
html.md-main-menu-master #brightness>#app.reference-main-menu.reference-ui .menu-reference-slogan{top:auto!important;bottom:calc(100% - 199.71px + 14px)!important;right:34.56px!important;width:240px!important;max-width:none!important;margin:0!important;font-size:15px!important;line-height:22px!important}
html.md-main-menu-master:not(.md-main-menu-phone-reference) #brightness>#app.reference-main-menu.reference-ui .modern-defense-structure{width:610px!important}
/* The landscape phone header has its own rows above the right-hand cards. */
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui .menu-reference-top{right:19px!important;top:5px!important;width:calc(var(--mm-master-width) - 590px)!important;grid-template-areas:". navigation store" "wallet wallet wallet" "identity identity identity"!important;gap:6px!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui .menu-stack{left:42px!important;top:154px!important;width:365px!important;height:467px!important}
html.md-main-menu-phone-reference #brightness:not(.account-rank-menu)>#app.reference-main-menu.reference-ui{height:calc(100% - 50px)!important;top:50px!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui .menu-reference-top>.menu-currencies{grid-template-columns:repeat(4,minmax(0,1fr))!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui .menu-reference-slogan{top:78px!important;bottom:auto!important;right:19px!important;width:227px!important;font-size:10px!important;line-height:13px!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui .menu-feature-column{right:19px!important;top:130px!important;bottom:auto!important;width:227px!important;height:330px!important;display:grid!important;gap:8px!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui .menu-feature-column>.menu-feature-card{position:relative!important;inset:auto!important;height:100%!important;min-height:0!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui .database-buttons{right:19px!important;top:474px!important;bottom:auto!important;width:227px!important;height:90px!important;grid-template-rows:1fr 1fr!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui.md-wallet-extreme .menu-reference-top>.menu-currencies{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html.md-main-menu-phone-reference #brightness>#app.reference-main-menu.reference-ui.md-wallet-extreme .menu-reference-slogan{display:none!important}

/* A quiet gold-edged shade keeps rank identity readable over the branches. */
html.md-main-menu-master #brightness .account-rank-component{isolation:isolate}
html.md-main-menu-master #brightness .account-rank-component::before{content:"";position:absolute;grid-column:1 / 3;grid-row:1;inset:-2px -6px;border:1px solid #f0cd6c40;border-radius:8px;background:linear-gradient(105deg,#071726eb,#0b2236c9);box-shadow:0 0 12px #f0cd6c20,inset 0 1px #ffe49b18;z-index:-1;pointer-events:none}
html.md-main-menu-master #brightness .account-rank-insignia img{filter:contrast(1.05) drop-shadow(0 2px 2px #000c) drop-shadow(0 0 6px #f2c85b70)!important}
html.md-main-menu-master #brightness .account-rank-name{color:#fff5d3!important;text-shadow:0 2px 3px #000,0 0 7px #f3d27a50!important}
