/* Port of forge-clone-2 current _tokens.uss and _reference-hud.uss.
   Deliberate adaptations: one row of 3 units + production die; 3 existing pages. */
#app #game.master-mode{--ui-paper:#393346;--ui-paper-deep:#292532;--ui-rim:#17131f;--ui-blue:#6c82ee;--ui-red:#c34c68;--ui-ink:#fff;--ui-muted:#bdb7d2}
#app #game.master-mode #topbar{background:#231e2ee6!important;border:0!important;padding:8px 12px!important}
#app #game.master-mode #master-profile b{color:white!important}#app #game.master-mode #master-profile span{color:#ffcf48!important}
#app #game.master-mode .master-wallet span{background:#393346;border:2px solid #17131f;border-radius:7px;color:white;padding:6px 8px}
#app #game.master-mode #deployment-panel{background:#292532!important;border-top:2px solid #17131f!important;border-radius:0!important;height:194px!important;padding:10px 18px!important;box-shadow:none!important}
#app #game.master-mode #deployment{gap:8px!important}
#app #game.master-mode .master-slot,#app #game.master-mode .production-slot{background:#211d2a!important;border:2px solid #17131f!important;border-bottom-width:4px!important;box-shadow:inset 0 0 0 2px var(--portal-rarity,#74658b)!important;border-radius:8px!important;height:76px!important}
#app #game.master-mode .master-slot .role-label,.production-slot small{color:#bdb7d2!important}
#app #game.master-mode .portal-tier{background:#17131fcc!important;color:white!important;border:0!important;text-shadow:0 1px #000}
#app #game.master-mode .portal-charge-readout{color:white!important}
#app #game.master-mode .master-slot progress{accent-color:#63c6ff!important}
#app #game.master-mode #dice-hud.master-controls{position:relative!important;display:block!important;height:90px!important;width:100%!important;padding:0!important}
#app #game.master-mode .summon-portal{position:absolute!important;left:50%!important;top:0!important;transform:translateX(-50%);margin:0!important;width:114px!important;height:90px!important}
#app #game.master-mode .portal-vortex{inset:-2px 21px 10px;border:6px solid #74658b;box-shadow:0 4px #17131f,0 0 14px #74d2ff55,inset 0 0 12px #96edff}
#app #game.master-mode .summon-portal b{font-size:10px;margin-top:44px;color:white;text-shadow:0 2px #17131f}
#app #game.master-mode .summon-portal small{background:#c34c68;border:2px solid #17131f;border-bottom-width:4px;min-width:67px;font-size:12px}
#app #game.master-mode .core-upgrade{position:absolute!important;right:0;top:17px;width:84px!important;height:50px!important;border:2px solid #17131f!important;border-bottom-width:4px!important;background:#6c82ee!important;box-shadow:inset 0 1px #a6b4ff!important;color:white!important;border-radius:7px!important}
#app #game.master-mode .core-upgrade>span{display:none}.core-upgrade b{font-size:15px}.core-upgrade small{font-size:10px}
#app #game.master-mode .pending-deck{position:absolute;left:2%;top:7%;width:56px;height:76px;padding:0!important;background:#393346!important;border:2px solid var(--tier)!important;border-radius:6px!important;box-shadow:4px -3px #292532,5px -4px var(--tier)!important;overflow:visible;color:white}
.pending-deck .hero-art{position:absolute;left:0;top:0;width:52px!important;height:54px!important}.pending-deck b{position:absolute;bottom:0;left:0;right:0;background:#231e2ee6;font-size:12px;line-height:18px;border-radius:0 0 4px 4px}.pending-deck small{position:absolute;right:-9px;top:-9px;background:#454056;border:1px solid #ffcf48;border-radius:10px;padding:2px 5px;font-size:10px}
#app #game.master-mode #tabs{background:#292532!important;border-top:2px solid #17131f!important}#app #game.master-mode #tabs button{border-radius:0!important;color:#bdb7d2!important;border-right:1px solid #17131f!important}#app #game.master-mode #tabs button.active{background:linear-gradient(#74658b,#554b68)!important;color:white!important;box-shadow:inset 0 3px #ffcf48}
/* Source compares only on deck selection; backdrop closes without a close icon. */
#app #game.master-mode #portal-orders.has-comparison{position:fixed!important;inset:0!important;width:100%!important;max-width:none!important;height:100%!important;min-height:0!important;max-height:none!important;transform:none!important;padding:0!important;border:0!important;background:linear-gradient(transparent 61.5%,#0e0b15bf 61.5%)!important;box-shadow:none!important;z-index:30!important}
#app #game.master-mode .replacement-panel{position:absolute;left:50%;top:45%;bottom:12%;width:84%;max-width:420px;transform:translateX(-50%);height:auto;padding:9px;border:2px solid #17131f;border-radius:8px;background:#393346;color:#fff;box-shadow:0 3px #17131f;display:flex;flex-direction:column}
.replacement-panel:before{display:none}.compare-heading{height:8%;margin:0 0 5px;font-size:12px;color:#fff;border-left:3px solid #6c82ee;padding-left:7px}
#app #game.master-mode .compare-pair{flex:1;gap:0}
#app #game.master-mode .compare-row{background:#393346;border-radius:6px;padding:8px;gap:11px;flex:1}
#app #game.master-mode .compare-row:nth-child(2){background:#292532;border-radius:6px 6px 0 0}
#app #game.master-mode .compare-row .hero-art{width:53px!important;height:59px!important;background:#211d2a;border:2px solid #74658b;border-radius:7px}
#app #game.master-mode #portal-orders .compare-row small{color:#bdb7d2!important;font-size:9px}
#app #game.master-mode #portal-orders .compare-row b{color:#ffcf48!important;font-size:12px;margin:6px 0}
#app #game.master-mode #portal-orders .compare-row span{color:white!important;font-size:11px}
#app #game.master-mode #portal-orders .compare-actions{margin:0;background:#292532;padding:8px 10px;gap:16px;border-radius:0 0 6px 6px}
#app #game.master-mode #portal-orders .compare-actions button{height:43px!important;background:#6c82ee!important;border:2px solid #17131f!important;border-bottom-width:4px!important;color:white!important;border-radius:7px!important;font-size:14px!important}
#app #game.master-mode #portal-orders .compare-actions button:first-child{background:#c34c68!important}
/* Match feature dialogs to the same current theme. */
#app #game.master-mode #sheet{background:#393346!important;color:white!important;border:2px solid #17131f!important}#app #game.master-mode #sheet-title{color:white!important}#app #game.master-mode #panel{color:white!important}
#app #game.master-mode .master-forge,#app #game.master-mode .master-unit-detail{background:#292532!important;border:1px solid #17131f!important;color:white}
#app #game.master-mode .master-forge small,#app #game.master-mode .master-unit-hero small,#app #game.master-mode .master-note{color:#bdb7d2!important}
#app #game.master-mode #panel .master-primary{background:#6c82ee!important;color:white!important;border:2px solid #17131f!important;box-shadow:0 3px #17131f!important}
#app #game.master-mode .era-odds{border-color:#17131f}#app #game.master-mode .era-odds>div{background:#292532;color:white;border-color:#554b68}#app #game.master-mode .era-odds strong{color:#9fe77f}
#app #game.master-mode #panel .codex-unit{background:#292532!important;color:white!important}.codex-unit small,.codex-unit em,.role-section{color:#bdb7d2!important}
#app #game.master-mode .master-stat-grid>div{background:#292532;color:white}#app #game.master-mode .master-stat-grid{border-color:#17131f;background:#17131f}.master-stat-grid small{color:#bdb7d2!important}
/* Verified against the running forge-clone-2 at 2026-11-07: yellow equipped tag,
   new item inset, delta in upper right, red sell / blue equip. */
#app #game.master-mode .compare-heading{background:#ffcf48;color:#191622;border:0;border-radius:3px;width:77px;height:15px;line-height:15px;font-size:10px;padding-left:6px;margin:0 0 8px}
#app #game.master-mode .compare-pair{position:relative}
#app #game.master-mode .compare-delta{position:absolute;right:8px;top:55%;font-size:11px;font-weight:bold;color:#9fe77f}
#app #game.master-mode #portal-orders .compare-row b{color:#bdb7d2!important}
#app #game.master-mode .compare-row .hero-art{background:#b4ae9c;border-color:#d6d0bb}
#app #game.master-mode .master-slot .portal-tier{top:auto!important;bottom:14px!important;left:6px!important;right:6px!important;width:auto!important;border-radius:3px!important;font-size:10px!important;line-height:13px!important}
#app #game.master-mode .master-slot .role-label{font-size:8px}.master-mode .master-slot .deploy-orb{margin-top:2px!important}
/* Whole HUD surface pass using the current clone's component system. */
#app #game.master-mode #topbar{height:58px!important;align-items:center!important;background:transparent!important;box-shadow:none!important;padding:8px 13px!important}
#app #game.master-mode #topbar #master-profile{position:relative!important;min-width:118px!important;max-width:145px!important;height:35px!important;padding:3px 6px 3px 34px!important;background:#231e2ee6!important;border:2px solid #17131f!important;border-radius:6px!important}
#app #game.master-mode #master-profile .profile-name{font-size:10px!important;letter-spacing:0!important;color:white!important;line-height:12px!important}
#app #game.master-mode #master-profile b{margin:1px 0 0!important;font-size:10px!important;color:#ffcf48!important;line-height:11px!important}
.forge-avatar{position:absolute;left:3px;top:1px;width:27px;height:29px;object-fit:contain}
#app #game.master-mode .master-wallet{margin-left:auto;gap:6px;font-size:11px}
#app #game.master-mode .master-wallet span{position:relative;min-width:65px;text-align:right;padding:3px 6px 3px 23px;border-radius:12px;line-height:14px}
.master-wallet span:before{content:'';position:absolute;left:3px;top:1px;width:19px;height:19px;background:url('assets/forge-ui/currency-gold.png') center/contain no-repeat}.master-wallet span:first-child:before{background-image:url('assets/forge-ui/currency-runestone-v1.png')}
#app #game.master-mode #field{top:0!important}
#app #game.master-mode #combat-top{top:60px!important}
#app #game.master-mode #ct-stage{background:#292532!important;color:white!important;border:2px solid #17131f!important;border-radius:12px!important;font-size:12px!important;min-width:56%!important;line-height:18px!important;padding:1px 16px!important}
#app #game.master-mode #ct-wave{display:block!important;background:none!important;border:0!important;height:16px!important;padding:0!important;margin:3px auto!important}
.forge-wave-line{position:relative;display:flex;width:105px;justify-content:space-between;margin:auto;height:12px;align-items:center}.forge-wave-line:before{content:'';position:absolute;left:0;right:0;height:2px;background:#a3a0ad}.forge-wave-line i{z-index:1;width:8px;height:8px;background:#393346;border:1px solid #17131f;border-radius:50%}.forge-wave-line i.done{background:#63c6ff}
#app #game.master-mode .master-slot{background:var(--portal-rarity)!important;box-shadow:inset 0 0 0 3px #ffffff33!important;border:1px solid #17131f!important;border-bottom-width:3px!important;border-radius:7px!important}
#app #game.master-mode .master-slot .role-label{color:#292532!important;top:3px!important;font-weight:bold;font-size:8px!important}
#app #game.master-mode .master-slot .portal-tier{background:#17131fcc!important;color:white!important;left:3px!important;right:3px!important;bottom:13px!important;border-radius:3px!important}
#app #game.master-mode .production-slot{background:#454056!important;box-shadow:inset 0 0 0 3px #ffffff33!important}
#app #game.master-mode #tabs button{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;padding:3px!important;font-size:10px!important;box-shadow:inset 0 1px #ffffff18!important}
#app #game.master-mode #tabs button img{width:31px;height:31px;object-fit:contain;filter:drop-shadow(0 2px #17131f)}
#app #game.master-mode #tabs button span{font-size:9px!important;line-height:12px!important;color:inherit!important}
#app #game.master-mode .summon-portal small{display:flex;gap:3px;justify-content:center;align-items:center;line-height:16px;height:24px}.summon-portal small img{width:19px;height:19px;object-fit:contain}
#app #game.master-mode .core-upgrade{box-shadow:inset 0 0 0 3px #ffffff33!important}
#app #game.master-mode #sheet{left:5%!important;right:5%!important;bottom:12%!important;max-height:76%!important;border-radius:8px!important;border:2px solid #17131f!important;border-bottom-width:4px!important;box-shadow:0 8px 20px #0008!important;overflow:visible!important}
#app #game.master-mode #sheet header,#app #game.master-mode .sheet-head{background:#393346!important;border:0!important;box-shadow:none!important;padding:12px 14px!important;min-height:42px!important}
#app #game.master-mode #sheet-title{font-size:16px!important;text-shadow:0 2px #17131f!important}
#app #game.master-mode #sheet-close{position:absolute!important;right:-8px!important;top:-10px!important;width:32px!important;height:32px!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent url('assets/forge-ui/close-button.png') center/contain no-repeat!important;font-size:0!important;box-shadow:none!important}
#app #game.master-mode #sheet-backdrop{background:#0e0b15bf!important;backdrop-filter:none!important}
#app #game.master-mode #panel{padding:12px!important;overflow-y:auto!important;max-height:calc(76dvh - 60px)!important}
#app #game.master-mode .master-forge{padding:14px;border-radius:7px;border:1px solid #17131f}.forge-emblem{background:#454056!important;border:2px solid #17131f!important;box-shadow:inset 0 0 0 3px #ffffff33!important;border-radius:8px!important}.forge-emblem img{width:100%;height:100%;object-fit:contain}
#app #game.master-mode .master-forge h2{font-size:22px;color:white;text-shadow:0 2px #17131f}.master-forge p{color:#bdb7d2}
#app #game.master-mode #panel button{border:1px solid #17131f!important;border-bottom-width:3px!important;box-shadow:inset 0 0 0 2px #ffffff25!important;border-radius:6px!important;color:white!important;background:#454056!important}
#app #game.master-mode #panel button.master-primary{background:#6c82ee!important;border-radius:7px!important;min-height:42px!important}
#app #game.master-mode #panel button:disabled{opacity:.5!important}
#app #game.master-mode .era-selector{gap:5px;padding-bottom:8px}.era-selector button{min-width:48px;min-height:30px}.era-selector button.active{background:#6c82ee!important}
#app #game.master-mode #panel .codex-unit{border:2px solid var(--drop-color)!important;background:#292532!important;padding:9px!important;box-shadow:inset 0 0 0 2px #ffffff25!important}
#app #game.master-mode .codex-unit b{color:white!important}.master-section-title{color:white!important;font-size:13px}.master-unit-detail h2{color:white}.master-unit-detail p{color:#bdb7d2}.master-options{color:#9fe77f!important}
#app #game.master-mode .master-unit-hero>.hero-art{border:2px solid var(--drop-color);border-radius:7px;background:#454056}
#app #game.master-mode #portal-orders .compare-actions button{box-shadow:inset 0 0 0 3px #ffffff33!important;text-shadow:0 2px #17131f!important}
#app #game.master-mode button:active{translate:0 1px}
#app #game.master-mode #sheet>#panel{background:#393346!important;color:#fff!important;box-shadow:none!important}
#app #game.master-mode #sheet>.sheet-head{background:#393346!important;border:0!important;box-shadow:none!important}
#app #game.master-mode #sheet>.sheet-head #sheet-title{color:#fff!important}
#app #game.master-mode #sheet-close svg{display:none!important}
#app #game.master-mode #panel .era-selector button.active{background:#6c82ee!important}
#app #game.master-mode #panel .master-stat-grid>div{color:#fff!important}
#app #game.master-mode #sheet #panel .master-note{color:#bdb7d2!important}
#app #boot{background:#292532!important;color:white!important}#app #boot:before,#app #boot:after{display:none!important}#app #boot .boot-brand{background:none!important}#app #boot h1{color:#ffcf48!important;text-shadow:0 3px #17131f!important}#app #boot #boot-start{background:#6c82ee!important;border:2px solid #17131f!important;border-bottom-width:4px!important;box-shadow:inset 0 0 0 3px #ffffff33!important;color:#fff!important;border-radius:8px!important}
/* Clone navigation: league / dungeon / growth / guild / shop. */
#app #game.master-mode #tabs{display:grid!important;grid-template-columns:repeat(5,1fr)!important}
#app #game.master-mode #tabs button{position:relative!important;min-width:0!important}
#app #game.master-mode #tabs button:disabled{opacity:.5!important;filter:saturate(.4)}
.menu-lock{position:absolute;left:50%;top:20px;transform:translateX(-50%);font-style:normal;font-size:12px}
#app #game.master-mode .core-upgrade{top:5px!important;height:40px!important}
#app #game.master-mode .portal-auto{position:absolute;right:0;top:51px;width:84px;height:32px!important;min-height:0!important;padding:3px 6px!important;background:#565276!important;border:2px solid #17131f!important;border-bottom-width:4px!important;box-shadow:inset 0 0 0 2px #ffffff33!important;border-radius:7px!important;color:white!important;display:flex;align-items:center;justify-content:center;gap:8px;font-size:11px!important}
.portal-auto span{font-size:19px}.portal-auto.running span{animation:portal-auto-spin 1s linear infinite}.portal-auto.running{background:#6c82ee!important}@keyframes portal-auto-spin{to{transform:rotate(360deg)}}
#app #game.master-mode.feature-open #sheet.feature-page{position:absolute!important;inset:58px 0 62px!important;max-height:none!important;border-radius:0!important;border:0!important;box-shadow:none!important;width:100%!important;display:flex!important;flex-direction:column!important}
#app #game.master-mode.feature-open #sheet-backdrop{display:none!important}
#app #game.master-mode #sheet.feature-page .sheet-head{height:48px!important;flex:none!important;text-align:center;padding-left:70px!important;padding-right:70px!important;border-bottom:1px solid #554b68!important}
#app #game.master-mode #sheet.feature-page #sheet-close{display:none!important}
#app #game.master-mode #sheet.feature-page #panel{max-height:none!important;flex:1;min-height:0;padding:16px 14px 66px!important}
#app #game.master-mode #panel .feature-back{position:absolute;top:9px;left:12px;height:29px;min-height:0;padding:3px 9px;background:#c34c68!important;font-size:11px}
.growth-research>h3{color:#ffcf48;font-size:18px;margin:4px 0}.growth-research>p{color:#bdb7d2;font-size:11px;margin:6px 0 18px}
.growth-research article{display:flex;align-items:center;justify-content:space-between;padding:15px 12px;margin-bottom:12px;border:2px solid #17131f;border-radius:8px;background:#292532;gap:8px}.growth-research article h3{font-size:13px;color:white;margin:0 0 8px}.growth-research article small{color:#ffcf48;font-size:10px}.growth-research article p{color:#bdb7d2;font-size:10px;margin:0}.growth-research article button{font-size:11px!important;padding:8px!important;min-width:68px}
.growth-subtabs{position:absolute;bottom:0;left:0;right:0;display:flex;background:#292532;padding:9px 12px;gap:7px;border-top:2px solid #17131f}.growth-subtabs button{flex:1;height:35px;font-size:12px}.growth-subtabs button.active{background:#6c82ee!important}
.auto-era-list{display:grid;gap:6px;margin-bottom:15px}.auto-era-list button{display:flex!important;align-items:center!important;gap:10px!important;width:100%!important;min-height:36px!important;padding:6px 10px!important;font-size:12px!important}.auto-era-list button.selected{background:#565276!important}.auto-era-list i{width:20px;height:20px;border:1px solid #17131f;border-radius:4px}.auto-era-list small{margin-left:auto;color:#bdb7d2}
@media(prefers-reduced-motion:reduce){.portal-auto.running span{animation:none}}
/* Readable production charge, compact level and role symbols. Same tray footprint. */
#app #game.master-mode .master-slot{overflow:hidden!important;background:linear-gradient(150deg,color-mix(in srgb,var(--portal-rarity) 55%,#302d3e),#302d3e)!important}
#app #game.master-mode .master-slot .deploy-orb{position:absolute!important;inset:10px 13px 22px!important;width:auto!important;height:auto!important;margin:0!important;border:0!important;background:none!important;box-shadow:none!important}
#app #game.master-mode .master-slot .deploy-orb .hero-art{width:100%!important;height:100%!important}
.slot-role-icon{position:absolute;left:5px;top:5px;width:17px;height:17px;display:grid;place-items:center;color:#f3e5bd;filter:drop-shadow(0 1px 1px #151220)}
.slot-role-icon svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}
.slot-level{position:absolute;right:4px;top:3px;min-width:18px;padding:1px 3px;border-radius:5px;background:#211d2dcc;color:#f7dfa4;font-size:11px;font-weight:800;line-height:14px;font-variant-numeric:tabular-nums}
.slot-charge{position:absolute;left:3px;right:3px;bottom:3px;height:20px;overflow:hidden;border:1px solid #121825;border-radius:5px;background:#151c2d;box-shadow:inset 0 1px 3px #0008}
.slot-charge-fill{position:absolute;inset:0 auto 0 0;background:linear-gradient(#8ae0f5,#43a9d1);border-right:1px solid #d1faff;box-shadow:0 0 8px #78dbef77}
.slot-charge-label{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;gap:4px;color:#fff;text-shadow:0 1px 2px #071828,0 0 3px #071828}
.slot-charge-label svg{width:13px;height:13px;fill:#f7e7bb;stroke:#364553;stroke-width:1}.slot-charge-label svg circle{fill:#364553;stroke:none}
.slot-charge-label b{font-size:13px;line-height:18px;font-variant-numeric:tabular-nums}.slot-charge-label em{font-size:11px;font-style:normal;color:#e0eef6;margin-left:1px}
.slot-charge.charged{border-color:#ffe9a3}.slot-charge.charged .slot-charge-fill{background:linear-gradient(#ffe7a0,#cea34e)}
#app #game.master-mode .master-wallet #portal-gold:before{background-image:url('assets/forge-ui/currency-gold.png')}
#app #game.master-mode .master-wallet #portal-gems:before{background-image:url('assets/forge-ui/currency-gem.png')}
/* Summoning is a portal, production remains the sculpted die in its own slot. */
#app #game.master-mode .portal-vortex{inset:0 25px 14px!important;border:4px solid #b4a1cf!important;border-radius:46% 46% 43% 43%!important;transform:none!important;background:radial-gradient(ellipse at 50% 57%,#c9fffa 0%,#6fd7ed 12%,#4877b9 30%,#443068 56%,#21172f 75%)!important;box-shadow:0 3px 0 #17131f,0 0 0 2px #65527e,inset 0 0 0 2px #e1d8ff88,inset 0 0 14px #67c4ed,0 0 13px #7bbfea55!important}
.portal-orbit{position:absolute;inset:9px 7px;border:2px solid #a5f8f1aa;border-left-color:transparent;border-bottom-color:transparent;border-radius:50%;transform:rotate(-25deg);box-shadow:inset 0 0 7px #90efff88;animation:portal-orbit-turn 8s linear infinite}
.portal-core-light{position:absolute;width:9px;height:16px;left:calc(50% - 4.5px);top:calc(50% - 8px);border-radius:50%;background:#dafffa;box-shadow:0 0 10px 4px #82e4ff77}
#app #game.master-mode .summon-portal b{margin-top:41px!important;z-index:2;font-size:11px!important;text-shadow:0 1px 3px #17131f,0 0 5px #17131f}
#app #game.master-mode .summon-portal small{min-width:52px!important;height:20px!important;padding:0 8px!important;background:#272438!important;border:1px solid #8b7ba4!important;border-radius:10px!important;font-size:11px!important;line-height:18px!important;color:#e9defa!important}
@keyframes portal-orbit-turn{to{transform:rotate(335deg)}}
@media(prefers-reduced-motion:reduce){.portal-orbit{animation:none}}
/* Authored toy portal prop: frame, keystone and plinth share the unit art style. */
#app #game.master-mode .summon-portal .summon-portal-art{position:absolute;left:8px;top:-5px;width:98px;height:88px;object-fit:contain;pointer-events:none;filter:drop-shadow(0 3px 2px #14111e88)}
#app #game.master-mode .summon-portal b{position:absolute;bottom:19px;left:0;right:0;margin:0!important;line-height:15px!important;text-shadow:0 1px 3px #17131f,0 0 4px #17131f,0 0 6px #17131f!important}
#app #game.master-mode .summon-portal small{position:absolute;bottom:0;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:10px!important;min-width:80px!important}
.summon-portal.opening .summon-portal-art{animation:portal-prop-open .7s ease-out}
@keyframes portal-prop-open{0%,100%{transform:scale(1);filter:drop-shadow(0 3px 2px #14111e88)}45%{transform:scale(1.06);filter:drop-shadow(0 0 8px #8fe9ff) brightness(1.18)}}
@media(prefers-reduced-motion:reduce){.summon-portal.opening .summon-portal-art{animation:none}}
/* Shared feature-page hierarchy: fixed heading / scroll body / fixed subnavigation. */
#app #game.master-mode.feature-open #sheet.feature-page{overflow:hidden!important;background:#292532!important}
#app #game.master-mode #sheet.feature-page .sheet-head{position:relative!important;height:48px!important;min-height:48px!important;flex-shrink:0!important}
#feature-back-fixed{position:absolute;left:10px;top:7px;width:36px;height:34px;border:1px solid #181421;border-radius:7px;background:#c34c68;color:white;font-size:28px;line-height:28px}
#app #game.master-mode #sheet.feature-page #panel{padding:14px!important;overflow:auto!important;min-height:0!important}
#feature-footer{display:flex;flex:none;gap:8px;padding:9px 14px;background:#292532;border-top:1px solid #665b75;min-height:54px}
#feature-footer[hidden],#feature-back-fixed[hidden]{display:none!important}
#feature-footer button{flex:1;background:#454056;border:1px solid #17131f;border-radius:6px;color:#ddd5e9;min-height:36px}#feature-footer button.active{background:#6c82ee;color:white}#feature-footer button:disabled{opacity:.5}
.feature-help{font-size:11px;color:#bdb7d2;margin:0 0 12px}.dungeon-banners{display:grid;gap:13px}
.dungeon-banner{position:relative;min-height:125px;border:2px solid #17131f;border-radius:10px;overflow:hidden;background-size:cover;background-position:center;padding:14px;isolation:isolate}.dungeon-banner:before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#17131fe8,#17131f22);z-index:-1}.dungeon-banner h3{font-size:18px;margin:0 0 6px;color:#fff1cb;text-shadow:0 2px #17131f}.dungeon-banner p{font-size:11px;color:#e5dbea;margin:0 0 12px}
#app #game.master-mode #panel .dungeon-banner button{display:flex;align-items:center;justify-content:space-between;width:100%;padding:7px 12px;background:#5e71c7!important;font-size:12px;min-height:33px}.dungeon-banner button span{font-variant-numeric:tabular-nums}
#feature-detail{position:absolute;inset:0;z-index:20;background:#100d1dcc;display:grid;place-items:center;padding:16px}#feature-detail.hidden{display:none}
.dungeon-detail-card{position:relative;width:100%;max-width:370px;max-height:100%;overflow:auto;background:#393346;border:2px solid #17131f;border-radius:12px;color:white;box-shadow:0 12px 25px #0008}.dungeon-detail-card>[data-detail-close]{position:absolute;right:8px;top:8px;z-index:1;width:32px;height:32px;border:1px solid #17131f;background:#c34c68;border-radius:7px;font-size:23px;color:white}
.dungeon-detail-art{height:125px;background-size:cover;background-position:center;display:flex;align-items:end;padding:14px}.dungeon-detail-art h2{margin:0;font-size:21px;color:#fff1cb;text-shadow:0 2px 4px #17131f}.dungeon-detail-body{padding:14px}.dungeon-detail-body h3,.dungeon-detail-body h4{margin:0 0 10px}.dungeon-detail-body p{font-size:12px;color:#c7c1d6}.dungeon-reward-list>div{display:flex;justify-content:space-between;padding:10px;background:#292532;border-radius:6px;margin:6px 0}.dungeon-detail-body .master-primary{width:100%;min-height:44px;background:#6c82ee;color:white;border:1px solid #17131f;border-radius:7px;font-weight:bold}.dungeon-detail-body button:disabled{opacity:.5}
.research-wallet{display:flex;justify-content:space-between;color:#dfd5eb;margin-bottom:12px}.research-status{margin-bottom:14px}.research-status button{width:100%;min-height:40px}.research-branches{display:grid;gap:12px}.research-branches button{display:flex;flex-direction:column;gap:14px;padding:22px!important;text-align:left}.research-branches strong{font-size:18px;color:#ffe19a}.research-branches span{font-size:12px;color:#c4bbd7}
#app #game.master-mode #sheet.feature-page .sheet-head{order:0!important}
#app #game.master-mode #sheet.feature-page #panel{order:1!important}
#app #game.master-mode #sheet.feature-page #feature-footer{order:2!important;position:relative!important}
.dungeon-key-icon{display:inline-block;width:17px;height:17px;vertical-align:middle;background:url('assets/forge-ui/dungeon-key-gold.png') center/contain no-repeat}
/* Fit common pages without shrinking their text; overflow remains a short-screen fallback. */
#app #game.master-mode #sheet[data-page="auto"],#app #game.master-mode #sheet[data-page="forge"]{max-height:calc(100% - 128px)!important;bottom:68px!important}
#app #game.master-mode #sheet[data-page="auto"] #panel,#app #game.master-mode #sheet[data-page="forge"] #panel{max-height:calc(100dvh - 200px)!important}
#app #game.master-mode #sheet.feature-page #panel{padding:10px!important}
#sheet[data-page="dungeon"] #panel{display:flex;flex-direction:column;gap:8px}
#sheet[data-page="dungeon"] .feature-help{margin:0;flex:none}
#sheet[data-page="dungeon"] .dungeon-banners{flex:1;min-height:400px;grid-template-rows:repeat(4,minmax(94px,1fr));gap:8px}
#sheet[data-page="dungeon"] .dungeon-banner{min-height:0;padding:9px 12px;display:grid;grid-template-columns:1fr auto;align-content:center;gap:4px 8px}
#sheet[data-page="dungeon"] .dungeon-banner h3{font-size:17px;margin:0}
#sheet[data-page="dungeon"] .dungeon-banner p{margin:0;grid-column:1;font-size:11px}
#app #game.master-mode #panel .dungeon-banner button{grid-column:2;grid-row:1/3;min-height:42px;width:105px;padding:7px;gap:5px}
#app #game.master-mode .auto-era-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:12px}
#app #game.master-mode .auto-era-list button{min-height:44px!important;gap:5px!important;padding:6px!important;font-size:12px!important}
.auto-era-list i{width:10px;height:15px;flex-shrink:0}.auto-era-list small{font-size:10px}
#app #game.master-mode #sheet[data-page="auto"] .master-section-title{margin:0 0 8px}
#app #game.master-mode #sheet[data-page="auto"] .master-note{margin:6px 0 12px}
.forge-tabs,.research-tiers,.research-pager{display:flex;gap:6px;margin:0 0 12px;align-items:center}
.forge-tabs button,.research-tiers button,.research-pager button{flex:1;min-height:38px;background:#454056;color:#ddd5e9;border:1px solid #17131f;border-radius:6px;font-size:12px}
.forge-tabs button[aria-pressed="true"],.research-tiers button[aria-pressed="true"]{background:#6c82ee;color:white}
#sheet[data-page="forge"] #panel[data-forge-tab="upgrade"]>.era-odds,#sheet[data-page="forge"] #panel[data-forge-tab="upgrade"]>.master-section-title,#sheet[data-page="forge"] #panel[data-forge-tab="odds"]>.master-forge{display:none}
#sheet[data-page="forge"] .era-odds>div{padding:7px 8px}
#sheet[data-page="forge"] .master-section-title{margin:8px 0}
#sheet[data-page="forge"] .master-note{margin:9px 0 0;font-size:11px}
#sheet[data-page="growth"] .research-wallet{margin-bottom:8px;font-size:13px}
#sheet[data-page="growth"] .research-status{margin-bottom:10px}
#sheet[data-page="growth"] .growth-research article{padding:10px!important;margin-bottom:8px!important;min-height:62px}
#sheet[data-page="growth"] .growth-research h3{font-size:13px;margin:0 0 5px}
#sheet[data-page="growth"] .growth-research p{font-size:11px;margin:0}
.research-pager{margin:8px 0 0}.research-pager span{font-size:12px;min-width:46px;text-align:center}
@media(max-height:650px){.dungeon-detail-art{height:90px}.dungeon-detail-body{padding:10px}.dungeon-detail-body p{margin:8px 0}.dungeon-reward-list>div{padding:7px}.dungeon-detail-body h3,.dungeon-detail-body h4{margin-bottom:7px}}
#app #game.master-mode #sheet[data-page="growth"] .growth-research article{padding:6px 8px!important;margin-bottom:4px!important;min-height:54px}
#app #game.master-mode #sheet[data-page="growth"] .growth-research article button{min-height:40px;padding:6px 9px}
#sheet[data-page="forge"] .era-odds>div{padding-top:6px;padding-bottom:6px}
/* Feature surfaces only. Battlefield, production die and summon dock retain v137. */
#app #game.master-mode #sheet{border:2px solid #746580!important;border-radius:14px!important;box-shadow:0 8px 22px #100b2080,inset 0 0 0 1px #bda4ce33!important;background:linear-gradient(145deg,#41394e,#2b2636)!important}
#app #game.master-mode #sheet>.sheet-head{background:linear-gradient(90deg,#46394f,#342e42,#46394f)!important;border-bottom:1px solid #9d849a88!important;box-shadow:inset 0 2px #dfc4d51a!important}
#app #game.master-mode #sheet>.sheet-head #sheet-title{color:#ffe7b4!important;letter-spacing:1px!important}
#app #game.master-mode.feature-open #sheet.feature-page{background:radial-gradient(ellipse at 50% 0,#4a3d56,#292532 65%)!important;border-radius:0!important}
#feature-back-fixed{background:linear-gradient(#79637d,#4d405c);border-color:#b79caa;color:#ffe7b4;box-shadow:0 2px #17131f}
#app #game.master-mode .dungeon-banner{border-color:#8b758c;box-shadow:inset 0 0 0 1px #e3c3a333,0 3px 0 #191521;border-radius:12px}
#app #game.master-mode .dungeon-banner:before{background:linear-gradient(90deg,#181424f2,#21192d88 55%,#21192d22)}
#app #game.master-mode #panel .dungeon-banner button{background:linear-gradient(#7d6f9e,#55476d)!important;border:1px solid #baa1b5!important;border-bottom:3px solid #35273f!important;color:#fff0cd;border-radius:8px}
#app #game.master-mode #panel .dungeon-banner button:disabled{filter:saturate(.35);opacity:.65}
.dungeon-detail-card{background:linear-gradient(#42374e,#2d2637);border-color:#b59a9c;border-radius:14px;box-shadow:0 12px 30px #080610aa,inset 0 0 0 2px #cbb09522}
.dungeon-detail-art{border-bottom:2px solid #b89b71;box-shadow:inset 0 -35px 30px -20px #141022}
.dungeon-detail-card>[data-detail-close]{background:#6b4d66;border-color:#ba91a0;color:#ffe9ca}
.dungeon-reward-list>div{background:#211c2d;border:1px solid #75617d;color:#dfd0e6}.dungeon-reward-list b{color:#ffe0a0}
.dungeon-detail-body h3{color:#ffe0a0}.dungeon-detail-body h4{font-size:12px;color:#cab5d1;letter-spacing:1px}
#app #game.master-mode #sheet .master-primary{background:linear-gradient(#8879b3,#625282)!important;border:1px solid #b6a0ca!important;border-bottom:3px solid #352844!important;box-shadow:inset 0 1px #e4d4ff55!important;color:#fff4dc!important;border-radius:8px}
#sheet .research-branches button{position:relative;overflow:hidden;min-height:118px;padding:22px 20px 22px 100px!important;justify-content:center;gap:9px;background:radial-gradient(ellipse at 15% 50%,#6b5477,#352c43 65%);border:1px solid #9e819f;border-bottom:3px solid #17131f;border-radius:12px;box-shadow:inset 0 0 0 3px #d8bdd113}
.research-branch-art{position:absolute;left:12px;top:12px;bottom:12px;width:74px;background:center/contain no-repeat;filter:drop-shadow(0 4px 4px #100b22)}
.research-branch-art.portal{background-image:url('assets/summon-portal-v1.png')}.research-branch-art.army{background-image:url('assets/forge-ui/menu-growth-hood.png')}
#sheet .research-branches strong{color:#ffe2b0}.research-wallet b{color:#ffe2b0}
#sheet .growth-research article{background:linear-gradient(100deg,#44394f,#332b40)!important;border:1px solid #786380!important;border-left:3px solid #baa1c7!important;border-radius:8px!important}
#sheet .growth-research article h3{color:#efdfed}#sheet .growth-research article small{color:#ffe0a0}
#sheet .research-tiers button[aria-pressed="true"],#sheet .forge-tabs button[aria-pressed="true"]{background:linear-gradient(#8a749f,#5d4c76);border-color:#c2a5bb;color:#fff0ce;box-shadow:inset 0 -2px #dfbd7a}
#feature-footer{background:#292231;border-top-color:#8b7188}#feature-footer button.active{background:linear-gradient(#816b96,#574469);border-color:#b69bb5;color:#ffebba}
#app #game.master-mode #panel .research-branches button{padding:18px 18px 18px 100px!important;background:radial-gradient(ellipse at 15% 50%,#6b5477,#352c43 65%)!important;border:1px solid #9e819f!important;border-bottom:3px solid #17131f!important;box-shadow:inset 0 0 0 3px #d8bdd113!important}
#app #game.master-mode #sheet #feature-back-fixed{color:#ffe7b4!important;background:linear-gradient(#79637d,#4d405c)!important;padding:0!important}
/* Content-led cards: retain all feature routes, action hooks and pagination. */
.feature-icon{display:inline-block;width:22px;height:22px;object-fit:contain;vertical-align:middle;flex-shrink:0;filter:drop-shadow(0 2px 1px #130d22)}
svg.feature-icon{fill:#a685ca33;stroke:#e6c79b;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round}
#app #game.master-mode #sheet[data-page="dungeon"] .dungeon-banner{padding:10px 12px;grid-template-columns:minmax(0,1fr) 95px;gap:9px 8px;border:1px solid #9d8299;border-bottom:3px solid #181321;background-position:65% center}
#sheet[data-page="dungeon"] .dungeon-banner h3{font-size:16px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dungeon-stage{font-size:10px;color:#fce4ab;background:#211929d9;padding:3px 6px;border:1px solid #a48b6e88;border-radius:4px;white-space:nowrap}
#sheet[data-page="dungeon"] .dungeon-loot{display:flex;gap:5px;flex-wrap:wrap}
.dungeon-loot span{display:inline-flex;align-items:center;gap:3px;font-size:10px;background:#171422bd;padding:2px 5px;border-radius:4px;color:#e3d6e5}
.dungeon-loot .feature-icon{width:17px;height:17px}
#app #game.master-mode #panel .dungeon-banner button{width:95px;min-height:58px;display:flex;flex-direction:column;justify-content:center;gap:5px;font-weight:800;font-size:12px;box-shadow:inset 0 1px #f1dbff55,0 2px 3px #120c22aa!important}
.dungeon-banner button>span{font-weight:normal;font-size:11px;background:#211a3655;border-radius:10px;padding:1px 8px}
.dungeon-reward-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}
.dungeon-reward-list>div{display:grid;grid-template-columns:30px 1fr;gap:4px 8px;align-items:center;margin:0;padding:10px;background:linear-gradient(#3b3048,#261e31);border:1px solid #88708d;box-shadow:inset 0 0 0 2px #bca3cc0d}
.dungeon-reward-list .feature-icon{grid-row:1/3;width:30px;height:30px}.dungeon-reward-list span{font-size:11px}.dungeon-reward-list b{font-size:17px}
.research-wallet>span{display:flex;align-items:center;gap:5px}.research-wallet{align-items:center}
#app #game.master-mode #sheet[data-page="growth"] .growth-research{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#app #game.master-mode #sheet[data-page="growth"] .growth-research .research-card{display:flex;flex-direction:column;align-items:stretch;gap:7px;min-width:0;min-height:123px;margin:0!important;padding:9px!important;border:1px solid #8b7395!important;border-bottom:3px solid #21182f!important;background:radial-gradient(ellipse at 10% 0,#55445f,#342a42 75%)!important;box-shadow:inset 0 1px #e6c5e422}
.research-card-heading{display:flex;align-items:center;gap:7px;min-height:34px}.research-card-heading>.feature-icon{width:29px;height:29px;background:#211b30;border:1px solid #90759c;padding:4px;border-radius:7px}
#app #game.master-mode #sheet[data-page="growth"] .research-card h3{font-size:12px!important;line-height:1.3;margin:0!important}.research-card h3 small{display:block;font-size:10px;margin-top:3px}
#app #game.master-mode #sheet[data-page="growth"] .research-card p{font-size:10px!important;line-height:1.4;min-height:28px;color:#c6b7d2}
#app #game.master-mode #sheet[data-page="growth"] .research-card button{display:flex;align-items:center;justify-content:center;gap:4px;min-height:32px!important;margin-top:auto;padding:4px 6px!important;border:1px solid #b5a0c4!important;border-bottom:3px solid #30233f!important;border-radius:6px;background:linear-gradient(#8875ab,#61507e)!important;color:#fff0d0!important;box-shadow:inset 0 1px #d9c3f144!important;font-size:11px}
.research-card button .feature-icon{width:17px;height:17px}.research-card button>span{margin-left:auto;font-size:10px}.research-card button:disabled{opacity:.48;filter:saturate(.5)}
#app #game.master-mode #panel .research-branches button{border-radius:12px!important}
#app #game.master-mode #panel .research-tiers button[aria-pressed="true"]{background:linear-gradient(#947bad,#615077)!important;border:1px solid #d3b7d1!important;box-shadow:inset 0 -3px #e4bf7e!important;color:#fff0c7!important}
#app #game.master-mode #sheet[data-page="growth"] .research-card p{min-height:20px}
.collection-wallet{display:flex;justify-content:space-between;margin-bottom:10px}.collection-loadout{display:grid;grid-template-columns:65px 1fr;gap:6px;background:#292532;padding:10px;border-radius:8px;font-size:12px;margin-bottom:10px}.collection-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.collection-grid article{background:#393346;border:1px solid #847096;border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:5px}.collection-grid small,.collection-grid p{font-size:11px;margin:0;color:#c9bdd7}.collection-grid button{min-height:32px}.collection-art{font-size:30px;height:40px}.collection-result{color:#ffe4a0;font-size:13px}.collection-die{display:inline-block;transform:scale(.65);transform-origin:top left}.production-slot[role="button"]{cursor:pointer}.production-slot:focus-visible{outline:2px solid #ffe4a0;outline-offset:2px}
#sheet[data-page="dungeon"] .dungeon-banners{grid-template-rows:repeat(5,minmax(76px,1fr));min-height:430px;gap:6px}
#app #game.master-mode #sheet[data-page="dungeon"] .dungeon-banner{padding:6px 10px}
#app #game.master-mode #panel .dungeon-banner button{min-height:48px}
.collection-dice-preview{height:85px;display:grid;place-items:center;margin:4px 0 12px;background:radial-gradient(ellipse,#8575a455,transparent 65%)}
#app #game.master-mode #sheet[data-page="dice"]{bottom:12%!important;max-height:76%!important}
#sheet[data-page="dungeon"] .dungeon-banners{grid-template-rows:repeat(3,minmax(115px,1fr));min-height:365px;gap:12px}
.pet-loadout{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}.pet-loadout>div{display:flex;flex-direction:column;gap:7px;padding:12px;border:2px solid #9c87ae;background:#292532;border-radius:9px}.pet-loadout small{color:#c4b4d4}.pet-loadout b{font-size:13px;color:#ffe4ad}.pet-equip-actions{display:flex;gap:5px}.pet-equip-actions button{flex:1;font-size:11px}
/* Two compact pet ability rings at the battlefield edge, outside the unit slots. */
#pet-battle-hud{position:absolute;right:14px;top:-53px;display:flex;gap:8px;height:46px;z-index:4}
#app #game.master-mode .pet-battle-orb{position:relative;width:44px;height:44px;min-height:0;padding:3px;border:2px solid #211c2c;border-radius:50%;background:conic-gradient(from -90deg,#f5d878 var(--pet-charge),#474253 0);box-shadow:0 2px 3px #0008;cursor:pointer}
.pet-battle-face{display:grid;place-items:center;width:100%;height:100%;border-radius:50%;background:radial-gradient(circle at 40% 30%,#80748d,#332c42);border:1px solid #17131f;font-size:24px;line-height:1}
.pet-battle-orb small{position:absolute;bottom:-3px;left:50%;transform:translateX(-50%);font-size:9px;line-height:12px;color:#fff0b3;background:#302b3a;border-radius:5px;padding:0 3px;white-space:nowrap}
.pet-battle-orb small:empty{display:none}.pet-battle-orb.empty{opacity:.6}.pet-battle-orb.empty .pet-battle-face{color:#c2b7cb;font-size:23px}
.pet-battle-orb.firing{animation:pet-ability-flash .7s ease-out}.pet-battle-orb:focus-visible{outline:2px solid #fff2b0;outline-offset:2px}
#game.panel-open #pet-battle-hud{visibility:hidden}
@keyframes pet-ability-flash{0%{transform:scale(1.15);box-shadow:0 0 13px #ffe89c}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.pet-battle-orb.firing{animation:none;box-shadow:0 0 8px #ffe89c}}
#offline-reward-dialog{position:absolute;inset:0;z-index:200;background:#100e1dcc;display:grid;place-items:center;padding:18px}
#offline-reward-dialog section{width:100%;max-width:360px;max-height:95%;overflow:auto;border:3px solid #191621;border-radius:13px;background:#ece9de;box-shadow:0 6px #15131b77;text-align:center}
#offline-reward-dialog header{background:#454457;color:#fff;padding:22px 14px 16px;border-bottom:3px solid #252334}
#offline-title{font-size:23px;margin:0 0 10px;text-shadow:0 2px #191621}#offline-reward-dialog p{font-size:13px}#offline-reward-dialog p b{color:#a8ee8a}
.offline-rates{display:flex;justify-content:center;gap:62px;padding:16px 0}.offline-rates span{display:grid;justify-items:center;gap:8px}.offline-rates img{width:38px;height:38px;object-fit:contain}.offline-rates b{color:#a8ee8a;font-size:14px}#offline-reward-dialog header small{font-size:10px;color:#c9c5d2}
.offline-claim{padding:24px 16px 16px}.offline-claim>div{display:flex;justify-content:center;gap:20px;margin-bottom:23px}.offline-claim span{display:flex;align-items:center;gap:5px;font-size:22px;font-weight:900;color:#302d3b}.offline-claim img{width:27px;height:27px;object-fit:contain}
#offline-reward-dialog button{display:block;margin:auto;border-radius:9px;cursor:pointer}#offline-reward-dialog [data-offline-claim]{width:180px;min-height:55px;background:#6c82ee;border:2px solid #262131;border-bottom:5px solid #3c487d;color:white;font-size:20px;font-weight:900}#offline-reward-dialog [data-offline-close]{margin-top:14px;background:transparent;border:0;color:#6e6579;font-size:12px;padding:8px}
#offline-reward-badge{position:absolute;left:14px;top:-42px;height:30px;background:#615276;color:#ffe9a9;border:2px solid #b1a0bb;border-radius:8px;font-size:11px;z-index:4}#game.panel-open #offline-reward-badge{visibility:hidden}
.scroll-nursery{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:12px 0}.scroll-nursery>div{display:flex;flex-direction:column;align-items:center;gap:5px;padding:9px 3px;background:#292532;border:1px solid #89739a;border-radius:8px}.scroll-nursery b{font-size:25px}.scroll-nursery small{font-size:10px;color:#ddd0e6}.scroll-nursery button{font-size:10px;min-height:32px;padding:3px}
.pet-screen{display:flex;flex-direction:column;gap:10px;min-height:100%}.pet-screen-wallet{display:flex;justify-content:space-between;font-size:12px;color:#cfc5db}.pet-screen-wallet b{color:#ffe6aa}
.pet-inventory{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px 8px;align-content:start;flex:1;min-height:155px;padding:4px 0 10px}
#app #game.master-mode #panel .pet-portrait,.pet-portrait{position:relative;display:block!important;aspect-ratio:1;width:100%;min-height:0!important;padding:0!important;border:2px solid var(--pet-tier)!important;border-bottom:4px solid #292032!important;border-radius:10px!important;background:radial-gradient(circle at 35% 25%,var(--pet-tier),#504058)!important;box-shadow:inset 0 0 0 2px #fff3,0 2px 3px #17112477!important;color:#fff!important}
.pet-portrait-art{position:absolute;inset:3px 0 15px;display:grid;place-items:center;font-size:34px;filter:drop-shadow(0 2px 1px #291e37)}.pet-portrait b{position:absolute;bottom:4px;left:0;right:0;font-size:12px;text-shadow:0 2px #20192c,1px 0 #20192c,-1px 0 #20192c}.pet-portrait small{position:absolute;bottom:-9px;left:-4px;right:-4px;font-size:9px;letter-spacing:-1px;color:#ffe17b;text-shadow:0 1px 2px #1c1526}.pet-portrait em{position:absolute;left:-2px;right:-2px;top:4px;font-size:9px;font-style:normal;background:#292133d9;border-radius:6px;color:#fff1c1}
.pet-empty{grid-column:1/-1;align-self:center;text-align:center;font-size:13px;line-height:1.8;color:#b9acc7;margin:35px 0}.pet-equipped-bar{display:flex;justify-content:space-between;align-items:center;background:#292532;border:2px solid #73617e;border-bottom:4px solid #191420;border-radius:9px;padding:10px 14px}.pet-equipped-bar>div{display:flex;gap:12px}.pet-equipped-bar strong{font-size:13px;color:#ffe9b3}.pet-equipped-bar strong small{display:block;margin-top:5px;font-size:10px;color:#bfb0cd}.pet-equipped-bar .mini,.pet-detail-intro .mini{width:53px;height:53px;flex-shrink:0}.mini .pet-portrait-art{font-size:29px}.pet-empty-slot{display:grid;place-items:center;width:53px;height:53px;border:1px dashed #9c89aa;border-radius:8px;color:#b7a4c7}.pet-empty-slot small{font-size:9px}
.pet-summon-row{display:flex;justify-content:center;align-items:center;gap:15px}.pet-summon-row>.master-primary{width:210px;min-height:58px;display:flex;flex-direction:column;justify-content:center;gap:5px}.pet-summon-row b{font-size:15px}.pet-summon-row span{font-size:12px}
#app #game.master-mode #panel .pet-rates{background:transparent!important;box-shadow:none!important;border:0!important;display:flex;flex-direction:column;align-items:center;gap:3px;color:#ddd0eb!important;padding:4px!important;min-width:54px}.pet-rates b{font-size:12px}.pet-rates small{font-size:10px}
.pet-scroll-heading{display:flex;justify-content:space-between;font-size:11px;color:#d4c5df}.pet-screen .scroll-nursery{margin:0;min-height:84px}.pet-screen .scroll-nursery>div{background:radial-gradient(ellipse at top,#746082,#292532 80%);border-top:2px solid #b69cbb}.pet-result{font-size:11px;color:#ffe2a2;margin:0;text-align:center}.pet-pages{display:flex;align-items:center;justify-content:center;gap:15px;font-size:11px}.pet-pages button{min-width:32px;min-height:28px}
#pet-detail-overlay{position:absolute;inset:0;z-index:40;background:#120d20b8;display:grid;align-items:center;padding:18px}#pet-detail-overlay section{position:relative;background:#393346;border:2px solid #ad95b7;border-bottom:5px solid #1c1428;border-radius:13px;padding:22px 18px 28px;color:white;box-shadow:0 8px 20px #08061188;max-height:95%;overflow:auto}
.pet-detail-intro{display:flex;align-items:center;gap:17px}.pet-detail-intro h2{font-size:18px;margin:5px 0;color:#ffe4a1}.pet-detail-intro p,.pet-detail-intro small{font-size:11px;color:#cbbad8;margin:0}.pet-detail-effect{padding:14px;background:#292532;border-radius:8px;font-size:13px;line-height:1.7;margin:18px 0 9px}.pet-detail-growth{font-size:11px;color:#bfaecf}.pet-detail-slots{display:flex;gap:10px;margin-top:20px}.pet-detail-slots button{flex:1;display:flex;flex-direction:column;gap:7px;align-items:center;padding:12px 5px;background:linear-gradient(#8797ed,#6073bd);border:1px solid #bdc5ff;border-bottom:4px solid #36477e;border-radius:8px;color:white}.pet-detail-slots small{font-size:10px}.pet-detail-slots b{font-size:16px}.pet-detail-slots button:disabled{opacity:.5}.pet-detail-close{display:block;margin:18px auto -16px;width:38px;height:38px;background:#c34c68;border:2px solid #241927;border-radius:50%;color:white;font-size:25px}.pet-probabilities p{display:flex;justify-content:space-between;font-size:13px}
.pet-screen{gap:8px}.pet-inventory{min-height:120px;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px 8px}.pet-inventory .pet-portrait{max-width:64px;justify-self:center}
#app #game.master-mode #panel .pet-equipped-bar .pet-portrait{width:53px!important;max-width:53px;min-width:53px;height:53px!important;flex:0 0 53px}
#app #game.master-mode #panel .pet-summon-row>.master-primary{width:210px!important;min-height:54px!important;padding:7px!important;flex:0 1 210px}
#app #game.master-mode #panel .pet-rates{width:58px!important;flex:0 0 58px}
.pet-screen .scroll-nursery{min-height:72px}.pet-screen .scroll-nursery>div{padding:6px 3px}.pet-screen .scroll-nursery b{font-size:22px}

/* Generated pet portraits shared by inventory, details and battlefield HUD. */
.pet-asset{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.pet-portrait-art{inset:2px 2px 9px;filter:drop-shadow(0 2px 2px #20182b80)}
.pet-battle-face{overflow:hidden}.pet-battle-face .pet-asset{width:94%;height:94%}
.scroll-nursery .scroll-art{display:block;width:40px;height:30px;line-height:0}.scroll-art img{width:100%;height:100%;object-fit:contain}
.scroll-nursery>div:not(:has(button)) .scroll-art{opacity:.35;filter:grayscale(.7)}
.pet-screen{gap:6px}.pet-inventory{gap:10px 8px;padding:2px 0 8px}.pet-inventory .pet-portrait{max-width:60px}.pet-equipped-bar{padding:6px 14px}.pet-screen .scroll-nursery>div{gap:3px;padding:4px 3px}.pet-screen .scroll-nursery button{min-height:24px!important;padding:2px!important}.pet-screen .scroll-nursery .scroll-art{height:28px}
/* Evolution and deliberate material feeding; preserve the existing pet navigation. */
.pet-copy-count{position:absolute;right:1px;top:23px;font-size:9px;font-style:normal;background:#241b32bd;border-radius:3px;padding:0 2px}
.pet-xp{height:7px;border:1px solid #9982a8;border-radius:5px;background:#211b2d;overflow:hidden}.pet-xp>span{height:100%;display:block;background:#b4bbed}
.pet-growth-actions{display:flex;gap:8px;margin-top:12px}.pet-growth-actions button{flex:1;min-height:36px;border:1px solid #a99bbd;border-bottom:3px solid #292032;border-radius:7px;background:#686298;color:#fff;font-weight:bold}.pet-growth-actions button:disabled{opacity:.45}
.pet-materials{max-height:190px;overflow-y:auto;overscroll-behavior:contain;display:grid;gap:5px}.pet-material{display:flex;align-items:center;gap:6px;padding:5px;border:1px solid #786882;border-radius:7px;background:#2b2438}.pet-material.selected{border-color:#ebcc83}.pet-material-art{width:37px;height:37px;flex:0 0 37px}.pet-material>div{flex:1}.pet-material b{font-size:11px}.pet-material small{display:block;font-size:10px;color:#c6b5d0}.pet-material button{min-height:29px;min-width:29px;padding:0;border-radius:6px;background:#6a6081;color:#fff;border:1px solid #a38ab5}.pet-feed-preview{font-size:12px;color:#ffe4a1;line-height:1.6;margin-top:12px}
/* Scroll storage and decoding are separate; every evolution keeps a fixed visual position. */
.summon-growth{display:flex;gap:7px;align-items:center;font-size:10px;color:#ded3ea}.summon-growth progress{flex:1;min-width:25px;height:7px;accent-color:#c2b2f0}.summon-growth small{white-space:nowrap;font-size:9px}
.scroll-storage{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}.scroll-storage button{display:flex!important;flex-direction:column;align-items:center;min-height:0!important;padding:3px!important;background:#30283e!important;border:1px solid var(--scroll-tier)!important;border-bottom:3px solid var(--scroll-tier)!important;border-radius:7px!important;color:#fff}.scroll-storage button:disabled{opacity:.32}.scroll-storage small{font-size:9px}.scroll-storage strong{font-size:10px;color:var(--scroll-tier)}
.scroll-grade-art{position:relative;display:block;width:35px;height:32px;background:radial-gradient(ellipse,var(--scroll-tier),transparent 70%);flex-shrink:0}.scroll-grade-art img{width:100%;height:100%;object-fit:contain}.scroll-grade-art b{position:absolute;right:-2px;top:0;border-radius:50%;background:var(--scroll-tier);color:#211925;font-size:10px!important;line-height:14px;width:14px;text-align:center}.scroll-grade-art i{position:absolute;left:0;right:0;bottom:-3px;text-align:center;font-size:6px;font-style:normal;color:var(--scroll-tier);text-shadow:0 1px #000}
.scroll-detail{text-align:center}.scroll-detail .scroll-grade-art{width:95px;height:90px;margin:auto}.scroll-detail .scroll-grade-art b{width:24px;line-height:24px;font-size:17px!important}.scroll-detail .scroll-grade-art i{font-size:12px}.scroll-detail p{font-size:12px;color:#d0bedb}
.pet-screen .scroll-nursery .decoding-scroll{border-color:var(--scroll-tier);background:linear-gradient(#44384f,#272231)}.empty-decode>span{font-size:22px;color:#94849f}.empty-decode{justify-content:center;border-style:dashed!important}.pet-screen .scroll-nursery{min-height:66px}.pet-screen .scroll-nursery small{font-size:9px}
.pet-screen{gap:4px}.pet-inventory{flex:1;min-height:66px;max-height:100px;overflow-y:auto;overscroll-behavior:contain;flex-shrink:1}.pet-equipped-bar{padding:4px 12px}#app #game.master-mode #panel .pet-equipped-bar .pet-portrait{width:40px!important;max-width:40px;min-width:40px;height:40px!important;flex-basis:40px}.pet-equipped-bar .pet-portrait-art{inset:1px 1px 6px}.pet-equipped-bar .pet-portrait b{font-size:10px}.pet-equipped-bar .pet-portrait em{font-size:7px}.pet-equipped-bar strong small{display:none}#app #game.master-mode #panel .pet-summon-row>.master-primary{min-height:42px!important;padding:3px!important}.pet-summon-row b{font-size:13px}.pet-summon-row span{font-size:10px}
/* A single visual timeline, from earliest to latest, with locked unavailable eras. */
#app #game.master-mode .auto-era-list{grid-template-columns:minmax(0,1fr);gap:3px;margin:0 0 8px}
#app #game.master-mode .auto-era-list button{height:33px;min-height:33px!important;padding:1px 9px!important;gap:9px!important;border:1px solid #5c526b!important;border-left:4px solid var(--era-color)!important;border-radius:6px!important;background:#292432!important;box-shadow:none!important}
#app #game.master-mode .auto-era-list button.selected{border-color:var(--era-color)!important;background:color-mix(in srgb,var(--era-color) 25%,#292432)!important;box-shadow:inset 0 0 0 1px var(--era-color)!important}
.auto-era-list .era-step{width:18px;color:var(--era-color);font-size:10px;font-weight:bold}.auto-era-list .era-unit{width:34px;height:30px;display:block;overflow:hidden}.era-unit img{width:100%;height:100%;object-fit:contain}.auto-era-list b{font-size:12px;color:var(--era-color)}.auto-era-list .era-check{width:21px;height:21px;border:1px solid #8a7d96;border-radius:50%;display:grid;place-items:center;font-size:15px}.auto-era-list .selected .era-check{background:var(--era-color);color:#201a2b;border-color:var(--era-color)}.auto-era-list .locked{opacity:.35}.auto-era-list .locked .era-check{visibility:hidden}
.auto-era-list .era-unit{background-size:200% 100%;background-position:left center;background-repeat:no-repeat}
.pet-screen{min-height:0!important;height:100%;box-sizing:border-box}.pet-inventory{min-height:66px;max-height:100px;flex:1 1 66px}.pet-summon-row{height:48px;min-height:48px;flex:0 0 48px}.pet-summon-row .pet-rates{height:44px!important;min-height:0!important;gap:1px!important}.scroll-storage{height:65px;flex:0 0 65px}.scroll-storage button{height:65px!important;gap:0!important}.scroll-storage .scroll-grade-art{height:30px}.pet-screen .scroll-nursery{height:76px;min-height:76px;flex:0 0 76px}.pet-screen .scroll-nursery>div{padding:2px!important;gap:2px!important}.pet-screen .scroll-nursery .scroll-grade-art{height:26px}.pet-screen .scroll-nursery button{height:23px!important;line-height:16px!important;min-height:23px!important;margin:0!important;font-size:9px!important}.pet-scroll-heading{line-height:13px}.summon-growth{line-height:14px;min-height:14px}
/* Reference pet layout: one scrolling collection and a fixed action dock. */
.pet-reference{gap:10px!important}.pet-reference .pet-screen-wallet>span{display:flex;align-items:center;gap:6px;background:#241e2d;border:1px solid #71627f;border-radius:7px;padding:2px 8px}.pet-reference .pet-screen-wallet .feature-icon{width:22px;height:22px}.pet-reference .pet-screen-wallet{flex:0 0 26px}.pet-reference .pet-inventory{max-height:none;min-height:65px;flex:1 1 auto;grid-template-columns:repeat(5,minmax(0,1fr));gap:17px 10px;padding:5px 3px 14px}.pet-reference .pet-inventory .pet-portrait{width:100%;max-width:60px}
#app #game.master-mode #panel .pet-scroll-card{position:relative;width:100%;max-width:60px;aspect-ratio:1;justify-self:center;padding:0!important;min-height:0!important;display:flex!important;flex-direction:column;align-items:center;justify-content:center;background:transparent!important;border:0!important;box-shadow:none!important}.pet-scroll-card .scroll-grade-art{width:47px;height:44px}.pet-scroll-card small{font-size:10px;color:#f2e8da}.pet-scroll-card>b{position:absolute;right:0;bottom:13px;font-size:10px;color:#fff;text-shadow:0 1px 3px #000}
.pet-reference .pet-equipped-bar{flex:0 0 50px;padding:6px 12px}.pet-reference .pet-equipped-bar strong{color:#fff;font-size:12px;background:#746482;padding:4px 13px;margin-left:-13px;clip-path:polygon(0 0,100% 0,90% 50%,100% 100%,0 100%)}.pet-reference .pet-equipped-bar .pet-empty-slot{height:40px;width:40px}.pet-reference .pet-summon-row{height:58px;min-height:58px;flex-basis:58px;gap:15px}#app #game.master-mode #panel .pet-reference .pet-summon-row>.master-primary{height:54px!important;min-height:54px!important;width:180px!important;flex-basis:180px}.pet-reference .pet-summon-row>.master-primary span{display:flex;align-items:center;justify-content:center;font-size:16px;gap:4px}.pet-summon-row .feature-icon{width:22px;height:22px}.pet-reference .pet-rates{min-height:54px!important;height:54px!important;justify-content:center}.summon-xp{position:relative;display:block;width:65px;height:13px;border:1px solid #baacc9;border-radius:7px;background:#292332;overflow:hidden}.summon-xp i{position:absolute;inset:0 auto 0 0;background:#8a96de}.summon-xp small{position:relative;display:block;text-align:center;color:#fff;font-size:9px!important;line-height:11px;font-weight:bold}.pet-reference .scroll-nursery{flex:0 0 82px;height:82px;min-height:82px;margin:0 -5px!important;padding-top:6px;border-top:2px solid #a78cb6}.pet-reference .scroll-nursery>div{border:0!important;background:radial-gradient(ellipse at top,#a28b6955,transparent 70%)!important}.pet-reference .scroll-nursery .scroll-grade-art{height:37px;width:42px}.pet-reference .empty-decode{background:none!important}.pet-reference .scroll-nursery small{display:none}.pet-reference .scroll-nursery button{background:#393043!important;border:1px solid #7b6b89!important}
.pet-stat-chips{display:flex;align-items:center;gap:5px;margin-top:7px;font-size:12px}.pet-stat-chips .feature-icon{width:20px;height:20px}.pet-lock-icon{position:absolute;right:14px;top:12px;width:27px;height:27px;border-radius:5px;border:1px solid #ac99ba;background:#63546f;color:white}.equip-slot-art{display:block;width:42px;height:42px}.pet-upgrade-xp{position:relative;height:25px;margin:14px 0 8px;overflow:hidden;background:#272130;border:1px solid #9583a2;border-radius:6px;text-align:center}.pet-upgrade-xp>i{position:absolute;inset:0 auto 0 0;background:#7e84b8}.pet-upgrade-xp>b{position:relative;line-height:23px;font-size:12px;color:#fff}.pet-upgrade-overlay{padding:12px!important}.pet-upgrade-overlay>section{height:calc(100% - 30px);max-height:calc(100% - 30px)!important;display:flex;flex-direction:column;padding:12px 12px 25px!important;overflow:visible!important}.upgrade-summary{flex-shrink:0;padding:10px;background:#4a4055;border:1px solid #a691b2;border-radius:9px}.upgrade-summary .pet-detail-intro h2{font-size:15px}.upgrade-summary-bottom{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#ffdf9a}.upgrade-summary-bottom button{min-height:32px;padding:5px 12px;background:#7488d1;border:1px solid #bac4ff;border-bottom:3px solid #374378;border-radius:7px;color:#fff;font-weight:bold}.upgrade-summary-bottom button:disabled{background:#625b6a;border-color:#807489;color:#aaa0b1}.pet-material-filters{display:flex;justify-content:center;gap:9px;margin:10px 0}.pet-material-filters button{width:35px;height:32px;border:1px solid #ad9bbe;border-bottom:3px solid #221b2b;border-radius:7px;background:#50435f;color:#fff;font-size:22px}.pet-material-filters button[aria-pressed=true]{background:#8d80a5;border-color:#e7cb84}.pet-material-slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;flex:0 0 51px;margin:0 0 12px}.pet-material-slots>button{position:relative;border:0;border-bottom:2px solid #dfc78c;background:#342a41;border-radius:6px;padding:0;min-width:0}.pet-material-slots>button>span:last-child{position:absolute;right:0;top:-4px;font-size:13px;color:#fff;background:#a35160;border-radius:50%;width:15px}.material-slot-empty{border-bottom:2px solid #a994ba;margin-top:42px}.pet-material-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-content:start;gap:16px 10px;overflow-y:auto;min-height:0;flex:1;padding:4px 0 14px;overscroll-behavior:contain}.pet-material-grid>button{position:relative;aspect-ratio:1;min-width:0;min-height:0;padding:0;background:transparent;border:0;color:white}.pet-material-grid>button:disabled{opacity:.38}.pet-material-grid>button.selected{opacity:1}.pet-material-grid>button.selected .material-pet-art{outline:2px solid #ffe094}.pet-material-grid button>b{position:absolute;bottom:1px;right:1px;font-size:10px;background:#201a2ccf;padding:0 2px}.pet-material-grid button>em{position:absolute;top:1px;left:0;right:0;font-size:10px;font-style:normal;background:#22192bd9;color:#ffe5a1}.material-pet-art{position:relative;display:block;width:100%;height:100%;border:2px solid var(--pet-tier);border-radius:7px;background:radial-gradient(at 40% 20%,var(--pet-tier),#4b3e59)}.material-pet-art img{width:100%;height:100%;object-fit:contain}.material-pet-art small{position:absolute;bottom:1px;left:0;right:0;font-size:10px;font-weight:bold;text-shadow:0 1px 2px black}.material-pet-art i{position:absolute;bottom:-8px;left:0;right:0;font-size:7px;font-style:normal;color:#ffe094}.pet-material-grid .scroll-grade-art,.pet-material-slots .scroll-grade-art{width:90%;height:90%;margin:auto}.pet-upgrade-overlay .pet-detail-close{position:absolute;bottom:-18px;left:calc(50% - 19px);margin:0!important;flex-shrink:0}
.pet-material-filters img{width:26px;height:26px;object-fit:contain;display:block;margin:auto}
.pet-reference .pet-inventory{grid-auto-rows:74px;align-items:start;row-gap:12px}.pet-reference .pet-inventory .pet-portrait,.pet-reference .pet-inventory .pet-scroll-card{height:60px!important;align-self:start}.summon-xp{flex-shrink:0;min-height:14px;line-height:12px}#app #game.master-mode #panel .pet-reference .pet-rates{height:58px!important;min-height:58px!important;padding:0!important;gap:2px!important;font-size:14px!important;line-height:16px!important}.pet-reference .pet-rates b{font-size:11px;line-height:14px}.pet-reference .pet-rates .summon-xp small{line-height:12px!important}
#pet-detail-overlay.pet-upgrade-overlay{display:block;padding:0!important}#pet-detail-overlay.pet-upgrade-overlay>section{position:absolute;inset:12px 12px 32px;height:auto!important;max-height:none!important;min-height:0;box-sizing:border-box}.pet-material-grid{grid-auto-rows:61px;align-items:start}.pet-material-grid>button{height:56px;align-self:start}.pet-upgrade-overlay .upgrade-summary .pet-detail-intro p{display:none}.pet-upgrade-overlay .upgrade-summary{padding:9px}.pet-upgrade-overlay .pet-upgrade-xp{margin:10px 0 7px}.pet-upgrade-overlay .pet-detail-intro .mini{height:50px;width:50px}.pet-material-slots .material-pet-art{box-sizing:border-box}
/* Tier is communicated only by the card backplate and rim, for pets and scrolls. */
#app #game.master-mode #panel .pet-portrait,.pet-portrait,.material-pet-art{background:linear-gradient(145deg,color-mix(in srgb,var(--pet-tier) 68%,white),color-mix(in srgb,var(--pet-tier) 58%,#242333))!important;border:2px solid var(--pet-tier)!important;box-shadow:inset 0 1px 2px #fff7,0 2px 2px #0005!important}
.scroll-grade-art{box-sizing:border-box;border:2px solid var(--scroll-tier);border-radius:8px;background:linear-gradient(145deg,color-mix(in srgb,var(--scroll-tier) 68%,white),color-mix(in srgb,var(--scroll-tier) 58%,#242333));box-shadow:inset 0 1px 2px #fff7,0 2px 2px #0005;padding:3px}
.pet-scroll-card .scroll-grade-art{width:100%;height:100%}.pet-material-grid .scroll-grade-art,.pet-material-slots .scroll-grade-art{width:100%;height:100%}.pet-portrait-art{inset:2px 0 11px}.pet-reference .pet-inventory{grid-auto-rows:64px;row-gap:10px}
/* Auto summon: current portal odds, obtainable eras, explicit outcome per row. */
#app #game.master-mode #sheet[data-page="auto"]{top:50%!important;bottom:auto!important;transform:translateY(-50%);height:auto!important;max-height:calc(100% - 140px)!important}
#app #game.master-mode #sheet[data-page="auto"] #panel{height:auto!important;max-height:calc(100dvh - 230px)!important}
.auto-setup{display:flex;flex-direction:column;gap:12px}.auto-level{display:flex;align-items:center;gap:12px;padding:4px 7px 10px;border-bottom:1px solid #9984ad66}.auto-level>img{width:56px;height:56px;object-fit:contain}.auto-level strong{display:block;font-size:18px;color:#ffe7ac}.auto-level small{display:block;margin-top:5px;font-size:11px;color:#c8bad6}.auto-columns{display:flex;justify-content:space-between;padding:0 4px;color:#bdb0cc;font-size:10px}.auto-setup .auto-era-list{gap:8px;margin:0}
#app #game.master-mode #panel .auto-setup .auto-era-list button{display:grid!important;grid-template-columns:36px 1fr 52px 26px;gap:6px;min-height:49px!important;padding:5px 8px!important}.auto-setup .auto-era-list b{font-size:13px;text-align:left}.auto-setup .auto-era-list small{font-size:12px;color:#e6dfee;text-align:right}.era-disposition{font-size:10px;color:#bcafc9;background:#262130;padding:5px 3px;border-radius:6px;text-align:center}.selected .era-disposition{background:var(--era-color);color:#251c31;font-weight:bold}.auto-next{display:flex;justify-content:space-between;align-items:center;padding:7px 5px;border-top:1px solid #8e7e9955;font-size:11px}.auto-next small{color:#b8abc6}.auto-single{margin:0;text-align:center;font-size:11px;color:#c3b4cf}.auto-setup .master-primary{display:flex;justify-content:center;align-items:center;gap:14px;min-height:48px}.auto-setup .master-primary span{display:flex;align-items:center;gap:3px;font-size:11px;font-weight:normal}.auto-setup .master-primary img{width:18px;height:18px;object-fit:contain}

.auto-setup .era-check{justify-self:end;width:22px;height:22px;border-radius:5px;border:1px solid #a99ab8;background:#292332;display:grid;place-items:center;font-size:16px;font-weight:bold}.auto-setup .selected .era-check{background:var(--era-color);border-color:var(--era-color);color:#241c2e}
#app #game.master-mode #panel .auto-stack-option{display:grid;grid-template-columns:32px 1fr auto 24px;align-items:center;gap:7px;padding:8px;min-height:42px;background:#292333;border:1px solid #8e7d9c;border-radius:7px;color:#e8dced;text-align:left}.auto-stack-option b{font-size:12px}.auto-stack-option small{font-size:11px;color:#c8b7d6}.stack-symbol{font-size:22px;letter-spacing:-9px;color:#ddc792}.auto-stack-option[aria-pressed=true] .era-check{background:#e7cc8c;color:#302438;border-color:#e7cc8c}.auto-stack-option:disabled{opacity:.5}
.auto-batch{display:flex;gap:8px}.auto-batch button{flex:1;display:flex;justify-content:center;align-items:center;gap:6px;min-height:38px;border:1px solid #897995;border-radius:7px;background:#292333;color:#d9ccdf}.auto-batch button[aria-pressed=true]{border-color:#e4cb8c;background:#685675;color:#ffe7ad;box-shadow:inset 0 -2px #e4cb8c}.auto-batch button:disabled{opacity:.42}.auto-batch small{font-size:10px}.auto-batch b{font-size:15px}
/* Screenshot reference: retain rows above, fixed controls below. */
#app #game.master-mode #sheet[data-page="auto"]{top:20px!important;bottom:30px!important;left:12px!important;right:12px!important;width:auto!important;height:auto!important;max-height:none!important;transform:none!important;background:#fff!important;border:3px solid #191821!important;border-radius:14px!important;overflow:visible!important;display:flex;flex-direction:column}
#sheet[data-page="auto"] .sheet-head{justify-content:center;background:transparent!important;border:0!important;padding:16px 12px 10px!important;flex:none;color:#171720!important}#sheet[data-page="auto"] #sheet-title{font-size:23px!important;color:#171720!important;text-align:center}
#app #game.master-mode #sheet[data-page="auto"] #panel{flex:1;min-height:0!important;max-height:none!important;height:auto!important;padding:0!important;overflow:hidden!important;color:#16161e!important}
#sheet[data-page="auto"] #sheet-close{position:absolute!important;top:auto!important;bottom:-23px!important;left:calc(50% - 23px)!important;right:auto!important;width:46px!important;height:46px!important;border-radius:50%!important;border:3px solid #171720!important;background:#f64d65!important;font-size:29px!important;color:white!important;z-index:5}
.auto-reference{height:100%;display:flex;flex-direction:column}.auto-reference-body{flex:1;min-height:0;overflow-y:auto;padding:8px 12px}.auto-retain-heading{display:flex;justify-content:space-between;align-items:center;margin:0 3px 8px}.auto-retain-heading b{font-size:14px}.auto-retain-heading small{font-size:11px;color:#665d70}
#app #game.master-mode #panel .auto-reference .auto-era-list button{display:grid!important;grid-template-columns:25px 30px 1fr 57px;gap:7px;padding:5px 7px!important;min-height:38px!important;background:linear-gradient(120deg,color-mix(in srgb,var(--era-color) 80%,white),var(--era-color))!important;border:0!important;border-radius:8px!important;box-shadow:none!important;color:#171720!important}
.auto-reference .auto-era-list{gap:7px;margin:0}.auto-reference .auto-era-list b{color:#171720;font-size:14px;text-align:left}.auto-reference .auto-era-list small{color:#171720;font-size:14px;text-align:right;font-weight:900}.auto-reference .era-unit{width:30px;height:28px}.auto-reference .era-check{width:24px;height:25px;box-sizing:border-box;border:2px solid #14141b;border-radius:6px;background:#43495e;display:grid;place-items:center;color:#30ef48;font-size:24px;font-weight:900;line-height:21px}.auto-reference .selected .era-check{background:#43495e!important;color:#30ef48!important;border-color:#14141b!important}
#app #game.master-mode #panel .auto-filter-toggle{display:flex;justify-content:flex-end;align-items:center;gap:7px;margin:14px 0 0 auto!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;color:#15151c!important}.auto-switch{display:block;position:relative;width:39px;height:21px;background:#454b5f;border:2px solid #15151c;border-radius:8px}.auto-switch:before{content:'';position:absolute;left:-3px;top:-5px;width:26px;height:26px;background:#00aceb;border:2px solid #15151c;border-radius:50%;box-shadow:0 2px #0003}.auto-switch.on:before{left:15px}.auto-filter-options{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:15px}.auto-filter-options button{border:1px solid #444;border-radius:6px;background:#eee;color:#222;padding:8px}.auto-filter-options button[aria-pressed=true]{background:#bcecff}.auto-filter-options span{float:right}
.auto-reference-footer{flex:none;border-top:3px solid #25232d;padding:14px 16px 30px;background:#fff}.auto-batch-row{display:flex;justify-content:space-between;align-items:center;gap:8px}.auto-batch-row b{font-size:12px}.auto-batch-row select{width:96px;height:36px;background:#454b5f;color:white;border:2px solid #15151c;border-radius:7px;padding:2px 8px;font-weight:900;font-size:19px}
#app #game.master-mode #panel .auto-continue-row{display:flex;align-items:center;gap:7px;width:100%;margin:20px 0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;color:#16161e!important;text-align:left}.auto-continue-row b{font-size:12px;flex:1}.auto-continue-row small{font-size:10px}.auto-continue-row:disabled{opacity:.5}
#app #game.master-mode #panel .auto-reference-footer>.master-primary{display:block;width:160px!important;min-height:59px!important;margin:0 auto!important;background:#04acf0!important;border:2px solid #171720!important;border-bottom:5px solid #164b6f!important;border-radius:9px!important;color:white!important;font-size:23px!important;font-weight:900;box-shadow:none!important}
#app #game.master-mode #sheet[data-page="auto"]{z-index:210!important}
#app #game.master-mode #sheet[data-page="auto"] #panel{background:#fff!important}
#app #game.master-mode #sheet[data-page="auto"] .sheet-head{color:#171720!important;background:#fff!important;border-radius:10px 10px 0 0}
#app #game.master-mode #sheet[data-page="auto"] #sheet-title{color:#171720!important;font-size:23px!important;text-align:center!important;width:100%}
#app #game.master-mode #sheet[data-page="auto"] #sheet-close{position:absolute!important;top:auto!important;bottom:-23px!important;left:calc(50% - 23px)!important;right:auto!important;width:46px!important;height:46px!important;min-height:46px!important;padding:0!important;border-radius:50%!important;border:3px solid #171720!important;background:#f64d65!important;font-size:29px!important;color:white!important;z-index:215!important;transform:none!important;box-shadow:0 3px #962739!important}
#app #game.master-mode #sheet[data-page="auto"]>.sheet-head{justify-content:center!important;text-align:center!important}
#app #game.master-mode #sheet[data-page="auto"]>.sheet-head>#sheet-title{display:block!important;flex:1!important;text-align:center!important;color:#171720!important;font-size:23px!important}
#app #game.master-mode #sheet[data-page="auto"] #sheet-close svg{display:block!important;width:24px!important;height:24px!important;margin:auto!important;fill:none!important;stroke:white!important;stroke-width:4!important;stroke-linecap:round!important}
/* Expanded filter keeps the reference's single checkbox-list grammar. */
.auto-reference-body{display:flex;flex-direction:column;overflow:hidden}.auto-reference-body>.auto-retain-heading,.auto-reference-body>.auto-era-list,.auto-reference-body>.auto-filter-toggle{flex-shrink:0}
.auto-reference .auto-filter-options{display:flex;flex-direction:column;gap:6px;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin-top:12px;padding:0 0 4px;flex:1}
#app #game.master-mode #panel .auto-reference .auto-filter-options button{display:flex;align-items:center;gap:12px;flex-shrink:0;min-height:38px;padding:5px 7px!important;border:0!important;border-radius:7px!important;background:#ececec!important;box-shadow:none!important;color:#171720!important;text-align:left}
.auto-reference .auto-filter-options button b{font-size:13px}.auto-reference .auto-filter-options .era-check{float:none;flex-shrink:0}.auto-reference .auto-filter-options button[aria-pressed=true] .era-check{color:#30ef48;background:#43495e}
.auto-reference .auto-switch.on{background:#19e938}.auto-reference .auto-filter-toggle{min-height:29px!important}
#app #game.master-mode #sheet[data-page="auto"]>.sheet-head{min-height:32px!important;padding:10px 12px!important}
.auto-reference-footer{padding:12px 16px 27px}
#app #game.master-mode #panel .auto-continue-row{min-height:26px!important;margin:14px 0!important}
#app #game.master-mode #panel .auto-reference-footer>.master-primary{min-height:50px!important}
#app #game.master-mode #panel .auto-reference .auto-filter-options button{min-height:32px!important;padding:3px 7px!important}
.auto-reference .auto-filter-options{gap:5px;margin-top:8px}
.auto-reference-footer{padding-bottom:15px}
/* Shared game palette; reference layout and interactions stay unchanged. */
#app #game.master-mode #sheet[data-page="auto"]{--auto-surface:#393346;--auto-inset:#292532;--auto-rim:#ad95b7;--auto-text:#f5ead7;--auto-muted:#c5b5d0;--auto-accent:#e7cc8c;background:var(--auto-surface)!important;border:2px solid var(--auto-rim)!important;border-bottom:5px solid #1c1428!important;box-shadow:0 8px 20px #08061188,inset 0 1px #ead9ff22!important;color:var(--auto-text)!important}
#app #game.master-mode #sheet[data-page="auto"] #panel{background:var(--auto-surface)!important;color:var(--auto-text)!important}
#app #game.master-mode #sheet[data-page="auto"]>.sheet-head{background:linear-gradient(90deg,#46394f,#342e42,#46394f)!important;border-bottom:1px solid #9d849a88!important;color:var(--auto-text)!important}
#app #game.master-mode #sheet[data-page="auto"]>.sheet-head>#sheet-title{color:#ffe7b4!important;font-size:21px!important;letter-spacing:.5px!important;text-shadow:0 2px #21182f}
.auto-reference .auto-retain-heading small{color:var(--auto-muted)}
#app #game.master-mode #panel .auto-reference .auto-era-list button{background:linear-gradient(110deg,color-mix(in srgb,var(--era-color) 36%,#393346),color-mix(in srgb,var(--era-color) 18%,#292532))!important;border:1px solid color-mix(in srgb,var(--era-color) 65%,#71627f)!important;box-shadow:inset 0 1px #ffffff16,0 2px #211a2c!important;color:var(--auto-text)!important}
.auto-reference .auto-era-list b{color:var(--era-color)}.auto-reference .auto-era-list small{color:var(--auto-text)}
.auto-reference .era-check{border:1px solid #9b86ad;background:var(--auto-inset);color:var(--auto-accent);box-shadow:inset 0 2px 3px #140e2055;font-size:21px}
.auto-reference .selected .era-check,.auto-reference .auto-filter-options button[aria-pressed=true] .era-check,.auto-reference .auto-continue-row[aria-pressed=true] .era-check{border-color:var(--auto-accent)!important;background:var(--auto-accent)!important;color:#352842!important;box-shadow:inset 0 1px #fff5}
#app #game.master-mode #panel .auto-reference .auto-filter-toggle{color:var(--auto-text)!important}
.auto-reference .auto-switch{background:var(--auto-inset);border:1px solid #a18ab2;box-shadow:inset 0 2px 3px #140e2055}.auto-reference .auto-switch.on{background:#8879b3}.auto-reference .auto-switch:before{background:linear-gradient(#f1ddb0,#c0a36d);border:1px solid #715c45;box-shadow:0 2px 3px #130e2066}
#app #game.master-mode #panel .auto-reference .auto-filter-options button{background:var(--auto-inset)!important;border:1px solid #796889!important;box-shadow:inset 0 1px #c7aeea10!important;color:var(--auto-text)!important}
.auto-reference-footer{background:#302939;border-top:2px solid #9d849a88;box-shadow:0 -2px 6px #17102033}
.auto-reference .auto-batch-row select{background:var(--auto-inset);border:1px solid #a18ab2;border-bottom:3px solid #1c1428;color:var(--auto-text);font-size:17px;box-shadow:inset 0 1px #dac6e622;color-scheme:dark}
#app #game.master-mode #panel .auto-reference .auto-continue-row{color:var(--auto-text)!important}
#app #game.master-mode #panel .auto-reference-footer>.master-primary{background:linear-gradient(#8879b3,#625282)!important;border:1px solid #b6a0ca!important;border-bottom:3px solid #352844!important;box-shadow:inset 0 1px #e4d4ff55!important;color:#fff4dc!important;font-size:21px!important;text-shadow:0 1px #352844}
#app #game.master-mode #sheet[data-page="auto"] #sheet-close{background:linear-gradient(#cf6780,#a53f5e)!important;border:2px solid #291c30!important;box-shadow:0 3px #21152a,inset 0 1px #ffd5e155!important}
.auto-reference button:focus-visible,.auto-reference select:focus-visible{outline:2px solid #ffe7b4;outline-offset:2px}

/* Keep the portrait game and fixed overlays in one desktop coordinate space. */
html body #app{margin:0 auto;width:100%;max-width:500px;height:100dvh;max-height:none;transform:translateZ(0);}

/* Shared game-card language: the unit replacement card is the reference. */
#app #game.master-mode #sheet:not(.feature-page),
#app #game.master-mode .dungeon-detail-card,
#app #game.master-mode #pet-detail-overlay>section,
#app #game.master-mode #offline-reward-dialog>section{
 background:#393346!important;color:#fff!important;border:2px solid #17131f!important;
 border-radius:9px!important;box-shadow:0 4px 0 #17131f!important;
}
#app #game.master-mode #sheet>.sheet-head{background:#393346!important;border:0!important;box-shadow:none!important}
#app #game.master-mode #sheet>.sheet-head>#sheet-title{color:#fff!important;letter-spacing:0!important}
#app #game.master-mode #panel .master-primary,
#app #game.master-mode .dungeon-detail-body .master-primary,
#app #game.master-mode .pet-growth-actions button,
#app #game.master-mode .pet-detail-slots button,
#app #game.master-mode #offline-reward-dialog [data-offline-claim]{
 background:#6c82ee!important;color:#fff!important;border:2px solid #292532!important;
 border-bottom:5px solid #202032!important;border-radius:8px!important;
 box-shadow:inset 0 0 0 2px #b7c0ff66!important;min-height:46px;font-size:16px!important;font-weight:800;
}
#app #game.master-mode .dungeon-detail-body{padding:16px;background:#292532;margin:8px;border-radius:7px}
#app #game.master-mode .dungeon-detail-art{height:145px;border:0;box-shadow:inset 0 -35px 30px -20px #17131f}
#app #game.master-mode .dungeon-reward-list{display:flex;gap:12px;margin:12px 0 20px}
#app #game.master-mode .dungeon-reward-list>div{flex:1;display:grid;grid-template-columns:40px 1fr;align-items:center;gap:4px 8px;padding:10px;background:#393346;border:0}
#app #game.master-mode .dungeon-reward-list .feature-icon{width:36px;height:36px;grid-row:1/3}
#app #game.master-mode .dungeon-reward-list span{font-size:11px;color:#bdb7d2}
#app #game.master-mode .dungeon-reward-list b{font-size:20px;color:#fff}
#app #game.master-mode .pet-detail-intro{padding:10px 0 16px}
#app #game.master-mode .pet-detail-intro h2{color:#fff}
#app #game.master-mode .pet-detail-effect,#app #game.master-mode .upgrade-summary{background:#292532;border:0;border-radius:7px}
#app #game.master-mode #offline-reward-dialog header{background:#393346;border:0}
#app #game.master-mode .offline-claim{background:#292532;margin:8px;border-radius:7px;color:#fff}
#app #game.master-mode #offline-reward-dialog [data-offline-close]{color:#bdb7d2}
#app #game.master-mode .pet-detail-close,#app #game.master-mode .dungeon-detail-card>[data-detail-close]{background:#c34c68;border:2px solid #17131f;color:white;border-radius:7px;box-shadow:inset 0 0 0 2px #ed98ac55}
#app #game.master-mode .master-stat-grid{background:none;border:0;gap:6px}
#app #game.master-mode .master-stat-grid>div{border-radius:5px;background:#393346}
#app #game.master-mode #sheet[data-page="auto"]{--auto-rim:#17131f;--auto-accent:#ffd74c}
#app #game.master-mode #sheet[data-page="auto"]>.sheet-head{background:#393346!important;border:0!important}
#app #game.master-mode #sheet[data-page="auto"]>.sheet-head>#sheet-title{color:white!important}
#app #game.master-mode .offline-claim>div,#app #game.master-mode .offline-claim>div span{color:#fff!important;text-shadow:0 2px #17131f}
#app #game.master-mode #sheet #feature-detail .master-primary,#app #game.master-mode #sheet #pet-detail-overlay .master-primary{background:#6c82ee!important;border:2px solid #292532!important;border-bottom:5px solid #202032!important;border-radius:8px!important;box-shadow:inset 0 0 0 2px #b7c0ff66!important;color:#fff!important;min-height:46px;font-size:16px!important}
