#battle47{--b47-gold:#e8c987;--b47-border:#746345;--b47-blue:#8cc9ef;--b47-red:#ef9a90;color:#ece7d9;background:#101a17;border:1px solid var(--b47-border);border-radius:14px;padding:0;width:min(1180px,97vw);height:min(800px,95dvh);max-height:95dvh;max-width:97vw;box-shadow:0 20px 80px #000b;font:16px/1.5 var(--game-chinese-font);overflow:hidden}#battle47::backdrop{background:#07100ee8;backdrop-filter:blur(7px)}#battle47 *{box-sizing:border-box}:where(#battle47) button,#battle47 select,#battle47 input{font:inherit;color:inherit}:where(#battle47) button{border:1px solid #76664b;background:linear-gradient(#35433a,#1d2c25);border-radius:7px;cursor:pointer;padding:8px 15px;touch-action:manipulation}:where(#battle47) button:hover{border-color:#e8c987;background:#3f503e}:where(#battle47) button:disabled{opacity:.45;cursor:default}:where(#battle47) button.primary{background:linear-gradient(#e5c482,#bd914d);color:#201b11;border-color:#f4da9e;font-weight:700}#battle47 input,#battle47 select{background:#111d18;border:1px solid #665b43;border-radius:6px;padding:9px;max-width:100%}.b47-head{height:70px;padding:12px 22px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #746345;background:linear-gradient(110deg,#213528,#111b18)}.b47-head h2{font-family:var(--game-chinese-font);font-size:25px;color:var(--b47-gold);margin:0;letter-spacing:2px}.b47-head small{color:#c1c6b6;font-size:12px;letter-spacing:1px}.b47-head button{padding:5px 14px}.b47-content{height:calc(100% - 70px);overflow:auto;padding:22px;background:radial-gradient(ellipse at 50% 0,#3d4e3022,transparent 70%)}.b47-top{display:flex;gap:20px;align-items:center;justify-content:space-between;margin-bottom:16px;flex-wrap:wrap}.b47-wallet{color:#dbc793;display:flex;gap:18px;font-size:14px}.b47-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.b47-mode{padding:20px 16px;border:1px solid #64704f;background:linear-gradient(155deg,#263c30,#17261f);border-radius:10px;position:relative;min-height:175px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}.b47-mode:nth-child(3),.b47-mode:nth-child(4){background:linear-gradient(155deg,#26343b,#15232c);border-color:#4a6574}.b47-mode h3{font-family:var(--game-chinese-font);font-size:23px;color:var(--b47-gold);margin:0}.b47-mode p{font-size:13px;color:#bcc8bd;margin:0;flex:1}.b47-mode .tag{font-size:11px;letter-spacing:2px;color:#9abd9b}.b47-mode button{align-self:stretch}.b47-roster{margin:20px 0;display:flex;gap:10px;flex-wrap:wrap}.b47-role{flex:1;min-width:140px;border:1px solid #52634b;padding:12px;border-radius:8px;display:flex;align-items:center;gap:14px;background:#1d2c21}.b47-role.selected{border-color:#e8c987;box-shadow:inset 0 0 0 1px #a4864e}.b47-role img{width:45px;height:64px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 4px 4px #0008)}.b47-role b{display:block;color:#e4d9bb;font-size:15px}.b47-role small{font-size:11px;color:#afbdad}.b47-section-title{font-family:var(--game-chinese-font);font-size:20px;margin:20px 0 8px;color:var(--b47-gold)}.b47-note{font-size:13px;color:#abbcaf;line-height:1.8;margin-top:16px}.b47-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.b47-inline input{width:145px;text-transform:uppercase;letter-spacing:2px}.b47-message{min-height:24px;font-size:14px;margin:10px 0;color:#f0c78f}.b47-team-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.b47-team{border:1px solid #50758c;border-radius:9px;background:#172932;padding:16px}.b47-team.red{border-color:#975d53;background:#30211f}.b47-team h3{margin:0 0 12px;color:#9cc5e3}.b47-team.red h3{color:#e8aea0}.b47-member{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid #a0b9bd22}.b47-member span:last-child{color:#a8d4a3;font-size:13px}.b47-code{font-size:25px;letter-spacing:5px;color:#f2d18b}.b47-footer{display:flex;justify-content:space-between;gap:10px;margin-top:18px;flex-wrap:wrap}.b47-history{width:100%;font-size:13px;border-collapse:collapse}.b47-history td,.b47-history th{padding:7px;text-align:left;border-bottom:1px solid #65704444}.b47-arena{position:relative;height:calc(100% - 70px);background:#1b3025;overflow:hidden;touch-action:none}.b47-arena canvas{width:100%;height:100%;display:block;touch-action:none}.b47-hud{position:absolute;top:9px;left:50%;transform:translateX(-50%);display:flex;gap:18px;align-items:center;border:1px solid #9c8a5b;background:#0b151cdb;border-radius:24px;padding:5px 20px;white-space:nowrap;pointer-events:none;font-weight:bold}.b47-hud .blue{color:#8dcdf2}.b47-hud .red{color:#efa399}.b47-hud time{font-size:19px;color:#f0d39a}.b47-events{position:absolute;top:60px;left:50%;transform:translateX(-50%);font-size:15px;text-shadow:0 2px 4px #000;text-align:center;pointer-events:none;width:85%;color:#ffe5a2}.b47-player{position:absolute;left:14px;top:12px;min-width:140px;background:#0c181cd9;border:1px solid #547c76;border-radius:7px;padding:7px 10px;font-size:12px;pointer-events:none}.b47-player b{font-size:14px;color:#efe2ba}.b47-health,.b47-mana{height:6px;margin-top:4px;border-radius:4px;background:#0b0e10;overflow:hidden}.b47-health>i{display:block;height:100%;background:#68ad70;width:100%}.b47-mana>i{display:block;height:100%;background:#62a3d5;width:100%}.b47-mini{position:absolute;right:12px;top:12px;width:155px;height:91px;border:1px solid #7a8260;background:#15231be8;pointer-events:none;box-shadow:0 2px 8px #0008}.b47-mini canvas{width:100%;height:100%}.b47-joystick{position:absolute;left:32px;bottom:30px;width:125px;height:125px;border-radius:50%;border:2px solid #c9d2b36b;background:radial-gradient(#2e514861,#12251d7d);touch-action:none;box-shadow:0 2px 15px #0004}.b47-joystick>i{position:absolute;width:50px;height:50px;left:35px;top:35px;border-radius:50%;border:1px solid #d5dab4aa;background:linear-gradient(#647b58cc,#2c4b3edb);pointer-events:none}.b47-controls{position:absolute;right:22px;bottom:22px;display:flex;align-items:flex-end;gap:10px;pointer-events:auto}.b47-controls button{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;border-radius:50%;width:67px;height:67px;padding:5px;background:radial-gradient(at 40% 30%,#4f7254,#203b35);border:2px solid #acb186;box-shadow:0 4px 12px #0008;touch-action:none;user-select:none;overflow:hidden;font-size:11px}.b47-controls button.attack{width:88px;height:88px;border-color:#d3be78;background:radial-gradient(at 40% 30%,#a78e48,#56411d);font-size:19px}.b47-controls button.ultimate{width:77px;height:77px;border-color:#b9b1dc;background:radial-gradient(at 40% 30%,#666090,#34304f)}.b47-controls button.active{box-shadow:0 0 18px #ffe29a}.b47-controls button .cool{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#081019b8;font-size:21px;font-weight:bold;pointer-events:none}.b47-controls button .cool:empty{display:none}.b47-controls button kbd{font-size:10px;opacity:.6;line-height:12px}.b47-utilities{position:absolute;bottom:126px;right:25px;display:flex;gap:6px}.b47-utilities button{font-size:12px;padding:6px 9px;background:#152b29d9;border-radius:20px}.b47-shop{position:absolute;right:25px;bottom:170px;background:#101d18f0;border:1px solid #b1a26b;padding:12px;border-radius:9px;display:grid;gap:6px;min-width:210px}.b47-shop[hidden]{display:none}.b47-shop button{text-align:left;font-size:13px}.b47-shop small{max-width:230px;color:#c8cbb7;font-size:11px}.b47-help{position:absolute;bottom:10px;left:180px;color:#bbc5afaa;font-size:11px;pointer-events:none}.b47-results{position:absolute;inset:0;background:#081011d9;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:22px;overflow:auto}.b47-results[hidden]{display:none}.b47-results h2{font:36px var(--game-chinese-font);color:#efce8e;margin:8px}.b47-results table{width:min(630px,95%);margin:18px}.b47-result-actions{display:flex;gap:12px}.b47-opening{position:absolute;z-index:15;right:22px;top:66px;padding:10px 18px!important;color:#ffe0a3!important;background:linear-gradient(#33462c,#17271d)!important;border:1px solid #c6ac64!important;border-radius:8px!important;font:15px var(--game-chinese-font)!important;box-shadow:0 4px 15px #0008}.b47-badge{font-size:11px;color:#a8d1b0;border:1px solid #53664d;border-radius:20px;padding:2px 7px}.b47-rank{font-size:12px;color:#b6cbd8}.b47-loading{text-align:center;padding:55px;color:#d4c798}
@media(max-width:850px){.b47-grid{grid-template-columns:repeat(2,1fr)}.b47-content{padding:14px}.b47-mode{min-height:150px}.b47-roster{gap:6px}.b47-role{min-width:120px;padding:8px;gap:8px}.b47-head{height:58px;padding:10px 14px}.b47-head h2{font-size:21px}.b47-content,.b47-arena{height:calc(100% - 58px)}.b47-player{min-width:120px;font-size:11px}.b47-mini{width:120px;height:70px}.b47-hud{font-size:13px;gap:12px;padding:4px 14px}.b47-controls{right:15px;bottom:15px;gap:7px}.b47-controls button{width:57px;height:57px;font-size:10px}.b47-controls button.ultimate{width:65px;height:65px}.b47-controls button.attack{width:75px;height:75px}.b47-utilities{bottom:100px;right:18px}.b47-shop{bottom:140px}.b47-joystick{width:110px;height:110px;left:25px;bottom:22px}.b47-joystick>i{width:46px;height:46px;left:30px;top:30px}.b47-help{display:none}}
@media(max-width:600px) and (orientation:portrait){#battle47{width:98vw;height:96dvh;max-height:96dvh}.b47-head small{display:none}.b47-mode h3{font-size:20px}.b47-role{min-width:calc(50% - 8px);flex:0 1 calc(50% - 3px)}.b47-team-grid{grid-template-columns:1fr}.b47-player{top:50px;left:8px;min-width:100px}.b47-mini{top:50px;right:8px;width:100px;height:60px}.b47-hud{top:7px}.b47-events{top:118px;font-size:13px}.b47-joystick{left:14px;bottom:25px;width:100px;height:100px}.b47-joystick>i{width:42px;height:42px;left:27px;top:27px}.b47-controls{right:10px;bottom:20px;width:195px;display:grid;grid-template-columns:repeat(3,1fr);gap:9px;align-items:end;justify-items:center}.b47-controls button{width:54px;height:54px}.b47-controls button.attack{grid-row:2;grid-column:2/4;width:73px;height:73px}.b47-controls button.ultimate{width:59px;height:59px}.b47-utilities{right:14px;bottom:170px}.b47-shop{bottom:210px;right:10px}.b47-results h2{font-size:28px}.b47-opening{right:10px;top:50px;font-size:13px!important;padding:7px 12px!important}}
@media(max-height:520px) and (orientation:landscape){#battle47{height:97dvh;max-height:97dvh}.b47-head{height:42px;padding:5px 12px}.b47-head h2{font-size:18px}.b47-head small{font-size:10px}.b47-content,.b47-arena{height:calc(100% - 42px)}.b47-mode{min-height:126px;padding:12px}.b47-player{top:8px;left:10px;min-width:110px}.b47-hud{top:7px}.b47-mini{width:105px;height:61px;top:7px;right:8px}.b47-joystick{width:92px;height:92px;left:22px;bottom:16px}.b47-joystick>i{width:38px;height:38px;left:25px;top:25px}.b47-controls button{width:52px;height:52px}.b47-controls button.ultimate{width:58px;height:58px}.b47-controls button.attack{width:69px;height:69px}.b47-controls{bottom:12px}.b47-utilities{bottom:90px}.b47-shop{bottom:127px}.b47-events{top:46px;font-size:12px}}

#battle47 .b47-controls button{padding:4px;line-height:1.25;border-radius:50%;white-space:normal}#battle47 .b47-controls button>span{display:block;max-width:100%;font-size:11px;overflow-wrap:normal;word-break:keep-all;text-align:center}#battle47 .b47-controls button.attack{font-size:18px}#battle47 .b47-role.selected{border-color:#e8c987;box-shadow:inset 0 0 0 1px #a4864e}

#battle47 .b47-controls button{padding:4px;line-height:1.25;border-radius:50%;white-space:normal}#battle47 .b47-controls button>span{display:block;max-width:100%;font-size:11px;overflow-wrap:normal;word-break:keep-all;text-align:center}#battle47 .b47-controls button.attack{font-size:18px}#battle47 .b47-role.selected{border-color:#e8c987;box-shadow:inset 0 0 0 1px #a4864e}

/* Bottom game shortcuts; keep desktop, portrait and landscape entry visible. */
#world .stage>.mobile-tools #open-battle47{--shortcut-ink:#ffe8a1;--shortcut-tint:#5c4e27;--shortcut-edge:#cbb46d}
#portrait-battle47{color:#ffe8a1!important;border-color:#cbb46d!important}
#landscape-battle47{color:#ffe8a1!important;font-size:11px!important;font-weight:700;line-height:1.2;display:grid;place-content:center;background:linear-gradient(#5c4e27,#29251b)!important;border:1px solid #cbb46d!important;text-indent:0!important}
#landscape-battle47::before,#landscape-battle47::after{display:none!important}

/*54: a match-only shop, skill points and support talent controls. */
#battle47 .b54-support-pick{margin:16px 0;padding:12px;border:1px solid #6b7356;border-radius:8px;background:#16261e}
#battle47 .b54-support-pick>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#battle47 .b54-support-pick button{min-height:72px;text-align:left;padding:10px}
#battle47 .b54-support-pick small{display:block;font-size:12px;line-height:1.5;margin-top:4px;color:#bdc9ae}
#battle47 .b54-support-pick .selected{border-color:#ecd28b;background:#41452c}
#battle47 .b47-shop{width:min(680px,90%);max-height:72%;overflow:auto;bottom:78px;left:12px;z-index:14;padding:14px;background:#102219f5}
#battle47 .b47-shop header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;position:sticky;top:-14px;background:#102219;padding:8px 0;z-index:2}
#battle47 .b47-shop header button{min-height:38px;padding:5px 10px;flex:none}#battle47 .b47-shop header span{flex-basis:100%}
#battle47 .b47-shop header span{font-size:12px;color:#c5caa9}
#battle47 .b54-shop-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
#battle47 .b54-shop-items button{display:flex;flex-direction:column;text-align:left;gap:5px;min-height:100px;padding:9px}
#battle47 .b54-shop-items button span{color:#f0d38c}#battle47 .b54-shop-items small{font-size:11px;line-height:1.4}
#battle47 .b54-inventory{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:12px}
#battle47 .b54-inventory>div{padding:8px;background:#2b3c2c;border:1px solid #7c7c54;border-radius:5px;font-size:12px;min-height:58px}
#battle47 .b54-inventory button{display:block;margin-top:5px;padding:4px 7px;font-size:11px}#battle47 .b54-inventory .empty{opacity:.45}
#battle47 .b54-upgrade{position:absolute;bottom:82px;min-width:40px;min-height:40px;padding:2px;font-size:25px;background:#d1bb70;color:#18261b;border-radius:50%;z-index:5}
#battle47 .b54-upgrade0{left:3px}#battle47 .b54-upgrade1{left:82px}#battle47 .b54-upgrade2{left:161px}
#battle47 .b54-points{position:absolute;bottom:195px;right:25px;font-size:13px;color:#f6dc8d;pointer-events:none}
#battle47 .b54-consumables{position:absolute;bottom:122px;left:155px;display:flex;flex-wrap:wrap;gap:5px;max-width:45%;z-index:6}
#battle47 .b54-consumables button{padding:7px;font-size:11px;min-height:36px}
@media(max-width:640px){#battle47 .b54-support-pick>div{grid-template-columns:repeat(2,minmax(0,1fr))}#battle47 .b54-shop-items{grid-template-columns:repeat(2,minmax(0,1fr))}#battle47 .b54-consumables{left:12px;bottom:150px;max-width:50%}#battle47 .b54-upgrade{bottom:60px;min-width:32px;min-height:32px;font-size:20px}#battle47 .b54-upgrade1{left:57px}#battle47 .b54-upgrade2{left:111px}#battle47 .b54-points{bottom:170px;right:10px}}

.b56-objective{position:absolute;top:54px;left:50%;transform:translateX(-50%);max-width:65%;padding:5px 12px;background:#101510e6;border:1px solid #a88b55;border-radius:6px;color:#ffe6a3;font-size:13px;text-align:center;pointer-events:none}
.b56-target{position:absolute;top:96px;left:50%;transform:translateX(-50%);background:#291611e0;border:1px solid #b67b5d;border-radius:5px;color:#ffe0ca;padding:4px 12px;pointer-events:none;font-size:13px;white-space:nowrap}
#battle47 .b47-events{top:140px;font-size:13px}#battle47 #b56-tower{border-color:#d3ba70;background:linear-gradient(#6a5530,#332813);color:#fff0bc;font-weight:bold}#battle47 .b47-utilities{max-width:calc(100% - 20px);flex-wrap:wrap;justify-content:flex-end}
@media(max-width:600px){.b56-objective{top:108px;max-width:95%;width:max-content;font-size:11px;padding:4px 8px}.b56-target{top:142px;font-size:11px}#battle47 .b47-events{top:171px;font-size:11px}#battle47 .b47-utilities{gap:4px;bottom:132px;right:8px;max-width:96%}#battle47 .b47-utilities button{font-size:11px;padding:6px}#battle47 .b47-mini{width:116px;height:68px}}
@media(max-height:520px) and (orientation:landscape){.b56-objective{top:44px;font-size:11px;padding:3px 8px;max-width:58%}.b56-target{top:73px;font-size:11px}#battle47 .b47-events{top:100px;font-size:11px}#battle47 .b47-utilities{right:9px;bottom:101px;gap:4px}#battle47 .b47-utilities button{font-size:10px;padding:5px 8px}}
#battle47 .b54-upgrade{width:32px;height:32px;min-width:32px;min-height:32px;bottom:77px;font-size:21px;padding:0}
#battle47 .b47-utilities{bottom:152px}
@media(max-width:640px){#battle47 .b54-upgrade{width:30px;height:30px;min-width:30px;min-height:30px;bottom:62px;font-size:20px}#battle47 .b47-utilities{bottom:139px}#battle47 .b54-points{bottom:184px}}
@media(max-height:520px) and (orientation:landscape){#battle47 .b54-upgrade{width:28px;height:28px;min-width:28px;min-height:28px;bottom:57px}#battle47 .b47-utilities{bottom:124px}#battle47 .b54-points{bottom:162px}}

#battle47 .b60-fill-choice{display:flex;align-items:center;gap:8px;margin:0 0 14px;color:#d6d6b7;font-size:13px}#battle47 .b60-fill-choice input{width:18px;height:18px;margin:0;flex:none}#battle47 .b60-preview{opacity:.72;border-top-style:dashed}
#battle47 .b60-comms{position:absolute;left:12px;top:104px;width:240px;max-width:74%;padding:7px 9px;border:1px solid #6e7558;border-radius:6px;background:#111c17e6;color:#eee5c8;font-size:12px;pointer-events:auto;z-index:7}#battle47 .b60-comms summary{cursor:pointer;color:#ead38e;font-weight:700}#battle47 #b60-practice{font-size:10px;color:#c0d6af;font-weight:400}#battle47 .b60-feed{max-height:138px;overflow:auto;margin-top:7px;line-height:1.55;overflow-wrap:anywhere}#battle47 .b60-feed>div{padding:3px 0}#battle47 .b60-feed b{color:#e8ca78;font-weight:500}#battle47 .b60-feed span{color:#fff8e7}#battle47 .b60-squad{font-size:10px;color:#afc1ad;margin-top:6px;line-height:1.5}#battle47 .b60-signals{display:flex;gap:4px;flex-wrap:wrap;margin:7px 0}#battle47 .b60-signals button{min-height:28px;font-size:11px;padding:3px 7px}#battle47 #b60-chat-form{display:flex;gap:5px}#battle47 #b60-chat-input{width:0;min-width:0;flex:1;font-size:12px;padding:5px}#battle47 #b60-chat-form button{font-size:11px;padding:4px 7px;min-height:30px}
@media(max-width:700px){#battle47 .b60-comms{top:182px;left:8px;width:220px;font-size:11px;padding:6px}#battle47 .b60-feed{max-height:104px}#battle47 .b60-squad{max-height:34px;overflow:hidden}}
@media(max-height:520px) and (orientation:landscape){#battle47 .b60-comms{top:95px;width:220px}#battle47 .b60-comms:not([open]){width:max-content}#battle47 .b60-feed{max-height:68px}#battle47 .b60-squad{display:none}}

#battle47 .b78-buffs{position:absolute;left:50%;top:112px;transform:translateX(-50%);z-index:2;color:#fae0a4;background:#161a19db;border:1px solid #8b684a;padding:3px 7px;font-size:12px;white-space:nowrap;pointer-events:none}
@media(max-height:520px) and (orientation:landscape){#battle47 .b78-buffs{top:75px}}

#battle47.b79-match{width:min(1510px,100vw);max-width:100vw;height:min(960px,100dvh);max-height:100dvh;border-radius:7px;overflow:hidden}
#battle47.b79-match .b47-head{height:34px;padding:3px 10px;background:#17251f}
#battle47.b79-match .b47-head h2{font-size:14px;letter-spacing:.04em}
#battle47.b79-match .b47-head small,#battle47.b79-match .b47-help{display:none}
#battle47.b79-match .b47-head button{padding:3px 9px;min-height:25px;font-size:11px;border-radius:4px}
#battle47.b79-match .b47-arena{height:calc(100% - 34px);position:relative;overflow:hidden}
#battle47.b79-match .b47-player{top:9px;left:8px;min-width:0;width:clamp(66px,14vw,120px);padding:4px 6px;font-size:10px;border-color:#4c6f67;background:#102322b9}
#battle47.b79-match .b47-player b{font-size:11px;overflow-wrap:anywhere}
#battle47.b79-match .b47-health,#battle47.b79-match .b47-mana{height:4px;margin:3px 0}
#battle47.b79-match .b47-hud{top:8px;gap:8px;font-size:10px;padding:3px 8px}
#battle47.b79-match .b47-hud time{font-size:14px}
#battle47.b79-match .b47-mini{top:8px;right:8px;width:clamp(62px,14vw,141px);height:auto;aspect-ratio:2200/1220}
#battle47.b79-match .b47-events{top:35px;width:min(42%,245px);font-size:10px}
#battle47.b79-match :is(.b56-objective,.b56-target,.b54-points){display:none}
#battle47.b79-match .b78-buffs{left:8px;top:67px;transform:none;max-width:31%;font-size:10px;white-space:normal;padding:2px 4px}
#battle47.b79-match .b60-comms{top:auto;bottom:9px;left:8px;width:max-content;max-width:min(72%,270px);padding:3px 6px;background:#111c17c7}
#battle47.b79-match .b60-comms[open]{width:min(68%,270px);background:#111c17f2}
#battle47.b79-match .b60-comms summary{font-size:10px}
#battle47.b79-match .b60-comms:not([open]) #b60-practice{display:none}
#battle47.b79-match #b47-stick-zone{
 position:absolute;bottom:36px;left:0;width:min(46%,310px);height:35%;z-index:2;touch-action:none;
}
#battle47.b79-match .b47-joystick{
 left:44px;top:auto;bottom:36px;width:clamp(58px,12vw,82px);height:clamp(58px,12vw,82px);
 transform:translate(-50%,0);opacity:.30;pointer-events:none;border-width:1px;
}
#battle47.b79-match .b47-joystick.held{bottom:auto;transform:translate(-50%,-50%);opacity:.82}
#battle47.b79-match .b47-joystick>i{inset:50% auto auto 50%;width:44%;height:44%;transform:translate(-50%,-50%)}
#battle47.b79-match .b47-controls{right:8px;bottom:8px;gap:5px}
#battle47.b79-match .b47-controls button[data-skill]{
 width:clamp(32px,6.3vw,54px);height:clamp(32px,6.3vw,54px);min-width:0;min-height:0;
 padding:0;border-width:1px;font-size:15px;overflow:visible
}
#battle47.b79-match .b47-controls button[data-skill] kbd{display:none}
#battle47.b79-match .b47-controls button[data-skill] .cool{border-radius:50%;font-size:10px}
#battle47.b79-match .b47-controls .attack{
 width:clamp(44px,8vw,66px);height:clamp(44px,8vw,66px);min-width:0;min-height:0;
 padding:0;font-size:12px;border-width:1px
}
#battle47.b79-match .b47-controls .b54-upgrade{
 width:18px;height:18px;right:auto;min-width:0;min-height:0;padding:0;font-size:12px;border-width:1px;
 bottom:calc(clamp(32px,6.3vw,54px) + 2px);z-index:1;
}
#battle47.b79-match .b47-controls .b54-upgrade0{left:3px}
#battle47.b79-match .b47-controls .b54-upgrade1{left:calc(clamp(32px,6.3vw,54px) + 8px)}
#battle47.b79-match .b47-controls .b54-upgrade2{left:calc(2 * clamp(32px,6.3vw,54px) + 13px)}
#battle47.b79-match .b47-utilities{top:auto;right:8px;bottom:calc(clamp(44px,8vw,66px) + 28px);gap:4px;max-width:55%}
#battle47.b79-match .b47-utilities button{padding:3px 6px;min-height:23px;font-size:10px;border-radius:4px}
#battle47.b79-match .b54-consumables{left:8px;bottom:36px;max-width:40%;z-index:3}
#battle47.b79-match .b54-consumables button{font-size:10px;padding:3px 5px}
#battle47.b79-match .b47-shop .b79-morphs{margin:0 0 8px;padding:7px 8px;border:1px solid #8e7246;border-radius:6px}
#battle47.b79-match .b79-map-hint{position:absolute;top:9px;right:8px;width:clamp(62px,14vw,141px);aspect-ratio:2200/1220;padding:0;border:0;background:transparent;z-index:3}
#battle47.b79-match .b79-map-hint:focus-visible{outline:2px solid #dfd3a0}
#battle47.b79-match.show-map .b47-mini{left:50%;top:50%;transform:translate(-50%,-50%);width:min(72%,620px);z-index:9}
#battle47.b79-match.show-map .b79-map-hint{inset:0;width:100%;height:100%;aspect-ratio:auto;z-index:10;background:#161b2044}
@media(max-height:520px) and (orientation:landscape){
 #battle47.b79-match .b47-head{height:29px}
 #battle47.b79-match .b47-arena{height:calc(100% - 29px)}
 #battle47.b79-match .b47-controls button[data-skill]{width:36px;height:36px}
 #battle47.b79-match .b47-controls .attack{width:49px;height:49px}
 #battle47.b79-match .b47-controls .b54-upgrade{bottom:38px}
 #battle47.b79-match .b47-controls .b54-upgrade1{left:44px}
 #battle47.b79-match .b47-controls .b54-upgrade2{left:85px}
 #battle47.b79-match .b47-utilities{bottom:73px}
}
/* Use one compact row on phones too, so the controls never rise into the field. */
#battle47.b79-match .b47-controls{display:flex;width:auto;align-items:flex-end;justify-content:flex-end}
#battle47.b79-match .b47-head{box-sizing:border-box;line-height:1.2;overflow:hidden}
#battle47.b79-match .b47-head h2{display:block;line-height:1.2}
#battle47.b79-match .b47-head [data-act=close]{white-space:nowrap;line-height:1.15}
#battle47.b79-match .b47-joystick:not(.held){top:auto!important;bottom:9px;opacity:.30}

@media (hover:hover) and (pointer:fine){
 #battle47 #b47-stick-zone,#battle47 #b47-stick{display:none}
 #battle47 #b47-canvas{cursor:url('/classic-cursor-point.png') 0 0,auto}
 #battle47 #b47-canvas.b87-attack-cursor{cursor:url('/classic-cursor-attack.png') 0 0,pointer}
}

#battle47 .b47-utilities #b84-shop-key{
 display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:31px;padding:5px 9px;
 border:1px solid #e8cca0;border-radius:4px;background:linear-gradient(#98652b,#573715);color:#fff2ca;font-weight:700;
 box-shadow:0 1px 4px #0009,inset 0 1px #eac57a4a;white-space:nowrap
}
#battle47 #b84-shop-key i{position:relative;width:11px;height:9px;border:1px solid currentColor;border-radius:1px}
#battle47 #b84-shop-key i::before{content:'';position:absolute;inset:-5px 2px auto;height:4px;border:1px solid currentColor;border-radius:3px 3px 0 0}
#battle47 #b84-shop-key[aria-expanded=true],#battle47 #b84-shop-key:hover{background:#97672f}
#battle47 #b84-shop-key kbd{font-size:.85em;opacity:.85}
#battle47 .b84-shop-filters{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 8px}
#battle47 .b84-shop-filters button{min-height:28px;padding:3px 8px;font-size:12px}
#battle47 .b84-shop-filters [aria-pressed=true]{background:#634a29;border-color:#d1a668;color:#fff1c1}
@media (pointer:coarse){#battle47 #b84-shop-key kbd{display:none}}

#battle47:is(.b87-pvp,.survival85)[open]:modal{
 --modal-top:0;--modal-right:0;--modal-bottom:0;--modal-left:0;
 --modal-width:100vw;--modal-height:100dvh;--modal-margin:0;
 position:fixed;inset:0;margin:0;width:100vw;max-width:none;height:100dvh;max-height:none;
 border:0;border-radius:0;outline:0;overflow:hidden
}
#battle47:is(.b87-pvp,.survival85) .b47-head{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
#battle47:is(.b87-pvp,.survival85) #b47-canvas{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;object-fit:fill}

#battle47.survival85 .b47-head{background:#24312b}
#battle47.survival85 .b47-events{top:84px;color:#f1d7a7}
#battle47 .s85-status{
 position:absolute;z-index:2;top:35px;left:50%;transform:translateX(-50%);display:grid;gap:2px;
 width:min(42%,280px);padding:4px 9px;border:1px solid #7d704e;border-radius:4px;
 color:#efe2bb;background:#161f1bdc;text-align:center;font-size:11px;pointer-events:none
}
#battle47 .s85-status b{color:#fae6aa;font-size:13px}
#battle47 .s85-status>div{display:flex;align-items:center;justify-content:center;gap:7px}
#battle47 .s85-status progress{width:35%;height:7px;accent-color:#83c7b2}
#battle47 #s85-relics{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#battle47 #s85-relics:empty{display:none}
#battle47 .s85-veil{
 position:absolute;z-index:15;inset:0;display:grid;place-items:center;padding:12px;
 background:#071713c9;overscroll-behavior:contain
}
#battle47 .s85-veil>section{
 width:min(96%,690px);max-height:100%;overflow:auto;padding:16px;border:1px solid #b2975b;
 border-radius:7px;background:#222e29;box-shadow:0 12px 38px #08130dc8;color:#f2e6c7
}
#battle47 .s85-veil header{display:flex;justify-content:space-between;gap:10px;margin:0 0 5px}
#battle47 .s85-veil h3{margin:0;color:#f4d993;font-size:20px}
#battle47 .s85-veil p{font-size:13px;margin:0 0 10px}
#battle47 #s85-time{font-size:13px;color:#d3ba83}
#battle47 #s85-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#battle47 #s85-options button{
 min-height:105px;padding:8px 10px;display:grid;align-content:start;justify-items:start;gap:5px;
 text-align:left;border-color:#ab9261;background:linear-gradient(#3c493a,#253029)
}
#battle47 #s85-options button:hover,#battle47 #s85-options button:focus-visible{background:#554d35;border-color:#f1d399}
#battle47 #s85-options button>span{color:#bba97f;font-size:11px}
#battle47 #s85-options button>b{color:#ffe3a4;font-size:16px}
#battle47 #s85-options button>small{font-size:12px;line-height:1.45}
@media (max-width:540px) and (orientation:portrait){
 #battle47 #s85-options{grid-template-columns:1fr}
 #battle47 #s85-options button{min-height:60px;grid-template-columns:auto 1fr;gap:2px 6px}
 #battle47 #s85-options button small{grid-column:2}
 #battle47.survival85 .s85-status{width:46%}
}


#world #bag-toggle[hidden],#landscape-actions #landscape-bag[hidden]{display:none!important}
#world .stage>.mobile-tools #open-titan88{--shortcut-ink:#e9e2ff;--shortcut-tint:#54466c;--shortcut-edge:#ab95cc}
#portrait-titan88,#landscape-actions #landscape-titan88{
 color:#eee6ff;border-color:#ab95cc;background:linear-gradient(#54466c,#282235)
}
#landscape-actions #landscape-titan88{
 display:grid;place-content:center;text-indent:0;font-size:11px;line-height:1.2;font-weight:700
}
#landscape-titan88::before,#landscape-titan88::after{display:none!important}
#battle47 .b88-solo-mode{width:min(100%,520px)}
#battle47.survival85 #b47-attack{white-space:normal;overflow-wrap:anywhere}
#battle47.survival85 #b47-attack[aria-pressed=true]{border-color:#ffdd90;background:radial-gradient(at 40% 30%,#e2ac52,#79501f);color:#fff8df}

@media (pointer:coarse){
 #battle47 .b47-arena{
  --b88-action-right:max(clamp(20px,5vw,45px),calc(env(safe-area-inset-right) + 14px));
  --b88-action-bottom:max(30px,calc(env(safe-area-inset-bottom) + 18px));
 }
 #battle47 .b47-controls,#battle47.b79-match .b47-controls{
  right:var(--b88-action-right);bottom:var(--b88-action-bottom);z-index:3;
 }
 #battle47 .b47-utilities,#battle47.b79-match .b47-utilities{
  top:auto;right:var(--b88-action-right);bottom:calc(var(--b88-action-bottom) + 66px);z-index:3;
 }
 #battle47.b79-match .b47-controls button[data-skill]{width:40px;height:40px}
 #battle47.b79-match .b47-controls .attack{width:54px;height:54px}
 #battle47.b79-match .b47-controls .b54-upgrade{bottom:42px}
 #battle47.b79-match .b47-controls .b54-upgrade1{left:48px}
 #battle47.b79-match .b47-controls .b54-upgrade2{left:93px}
 #battle47.b79-match .b47-utilities button{min-height:32px}
 #battle47:not(.b79-match) .b47-utilities{bottom:calc(var(--b88-action-bottom) + 94px)}
}
@media (pointer:coarse) and (orientation:portrait){
 #battle47.b79-match #b47-stick-zone{width:min(36%,180px)}
 #battle47:not(.b79-match) .b47-utilities{bottom:calc(var(--b88-action-bottom) + 150px)}
}


#battle47 .b89-difficulty{border:0;padding:0;margin:0;min-width:0;text-align:left}
#battle47 .b89-difficulty legend{padding:0;margin-bottom:6px;color:#f5db9f;font-weight:700}
#battle47 .b89-difficulty>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#battle47 .b89-difficulty label{
 display:flex;align-items:start;gap:6px;padding:8px;border:1px solid #675d45;border-radius:6px;
 background:#19241f;color:#efe6d2;cursor:pointer
}
#battle47 .b89-difficulty :is(input,label){touch-action:manipulation}
#battle47 .b89-difficulty input{margin:4px 0 0;accent-color:#e1c279}
#battle47 .b89-difficulty span{display:grid}
#battle47 .b89-difficulty small{font-size:12px;line-height:1.4}
#battle47 .b89-difficulty label:has(:checked){background:#3f3725;border-color:#e1c279;color:#ffe9b8}
#battle47 .b89-difficulty label:focus-within{outline:2px solid #e1c279;outline-offset:2px}
#battle47.survival85[open]:modal{display:grid;grid-template-rows:auto minmax(0,1fr)}
#battle47.survival85 .b47-arena{height:auto;min-height:0}
#battle47 #s89-fortune{color:#e5bcff}
@media(max-width:530px){
 #battle47 .b89-difficulty>div{grid-template-columns:1fr}
 #battle47 .b89-difficulty label{min-height:44px}
}


#battle47 #s90-seal{color:#ead697;font-variant-numeric:tabular-nums}
#battle47 #s90-seal[data-phase=warning]{color:#ffe2a0;font-weight:700}
#battle47 #s90-seal[data-phase=active]{color:#ebafff;font-weight:700}
#battle47 .b78-buffs.b90-covered{color:#152719;background:#a5e7a2;border-color:#83cd8e}
#battle47.survival85 .s85-status .b47-events{position:static;transform:none;width:auto;max-width:none;padding:0;white-space:normal}
#battle47.survival85 .s85-status .b47-events:empty{display:none}


#battle47.b79-match .b78-buffs.b90-covered{
 color:#defce9;background:#143529eb;border:1px solid #78bd91;font-weight:700;
 box-shadow:0 2px 7px #082017bc
}


#battle47 .b92-tier{margin-left:6px;font-size:.72em;color:#f4c77c;font-style:normal}
#battle47 .b92-passive{color:#f5dda1}


#battle47.b87-pvp[open]:modal{display:grid;grid-template-rows:auto minmax(0,1fr)}
#battle47.b87-pvp .b47-head{
 box-sizing:border-box;display:flex;align-items:center;height:auto;min-height:34px;
 padding-top:max(3px,env(safe-area-inset-top));padding-bottom:3px;
}
#battle47.b87-pvp .b47-head h2{margin:0;line-height:1.2}
#battle47.b87-pvp .b47-arena{height:auto;min-height:0}

/* Size the PvP action area as a unit so utility and upgrade buttons reserve space. */
#battle47.b87-pvp .b47-arena {
 --pvp-skill:clamp(46px,7.2vw,70px);
 --pvp-attack:clamp(62px,9.2vw,88px);
 --pvp-upgrade:clamp(24px,3.5vw,30px);
 --pvp-key-gap:clamp(4px,1vw,9px);
 --pvp-edge:max(14px,env(safe-area-inset-right,0px) + 10px);
 --pvp-bottom:max(14px,env(safe-area-inset-bottom,0px) + 10px);
 --pvp-utility-height:36px;
 --pvp-utility-type:13px;
}
#battle47.b87-pvp .b47-controls {
 right:var(--pvp-edge);bottom:var(--pvp-bottom);
 display:grid;width:auto;gap:4px var(--pvp-key-gap);align-items:end;justify-items:center;
 grid-template-columns:repeat(3,var(--pvp-skill)) var(--pvp-attack);
 grid-template-rows:var(--pvp-upgrade) var(--pvp-skill);
}
#battle47.b87-pvp .b47-controls button[data-skill] {
 grid-row:2;width:var(--pvp-skill);height:var(--pvp-skill);padding:3px;
}
#battle47.b87-pvp .b47-controls button[data-skill] > span {font-size:clamp(12px,1.3vw,16px)}
#battle47.b87-pvp .b47-controls button[data-skill] .cool {font-size:clamp(11px,1.12vw,14px)}
#battle47.b87-pvp .b47-controls .attack {
 grid-area:1/4/3/5;width:var(--pvp-attack);height:var(--pvp-attack);
 font-size:clamp(16px,1.85vw,22px);font-weight:700;
}
#battle47.b87-pvp .b47-controls .b54-upgrade {
 grid-row:1;position:static;justify-self:center;align-self:end;
 width:var(--pvp-upgrade);height:var(--pvp-upgrade);font-size:17px;
}
#battle47.b87-pvp .b47-controls :is([data-skill="0"],.b54-upgrade0) {grid-column:1}
#battle47.b87-pvp .b47-controls :is([data-skill="1"],.b54-upgrade1) {grid-column:2}
#battle47.b87-pvp .b47-controls :is([data-skill="2"],.b54-upgrade2) {grid-column:3}
#battle47.b87-pvp .b47-utilities {
 right:var(--pvp-edge);
 bottom:calc(var(--pvp-bottom) + max(var(--pvp-attack),var(--pvp-skill) + var(--pvp-upgrade) + 4px) + 9px);
 justify-content:flex-end;flex-wrap:wrap;gap:4px var(--pvp-key-gap);
 width:max-content;max-width:calc(100% - var(--pvp-edge) - 10px);
}
#battle47.b87-pvp .b47-utilities button,
#battle47.b87-pvp .b47-utilities #b84-shop-key {
 min-height:var(--pvp-utility-height);max-width:100%;padding:4px 9px;
 font-size:var(--pvp-utility-type);line-height:1.25;white-space:normal;
}
#battle47.b87-pvp .b47-utilities #b84-shop-key i {flex:none}

@media (pointer:coarse) {
 #battle47.b87-pvp .b47-arena {
  --pvp-skill:clamp(45px,12.3vw,52px);
  --pvp-attack:clamp(64px,17vw,74px);
  --pvp-edge:var(--b88-action-right);
  --pvp-bottom:var(--b88-action-bottom);
 }
}
@media (max-width:360px), (max-height:430px) {
 #battle47.b87-pvp .b47-arena {
  --pvp-skill:clamp(42px,14vw,60px);
  --pvp-attack:clamp(60px,20vw,78px);
  --pvp-upgrade:24px;
  --pvp-utility-height:34px;
  --pvp-utility-type:12px;
 }
}
@media (max-width:360px) {
 #battle47.b87-pvp .b47-utilities button,
 #battle47.b87-pvp .b47-utilities #b84-shop-key {padding-inline:6px}
}

/* Match-only touch HUD. Each thumb has its own group of controls. */
@media (pointer:coarse) {
 #battle47:is(.b87-pvp,.survival85) .b47-arena {
  --touch-left:max(9px,env(safe-area-inset-left,0px) + 6px);
  --touch-right:max(20px,env(safe-area-inset-right,0px) + 12px);
  --touch-bottom:max(12px,env(safe-area-inset-bottom,0px) + 8px);
  --touch-skill:clamp(46px,13vw,57px);
  --touch-attack:clamp(64px,18vw,78px);
  --touch-plus:25px;
  --touch-map:clamp(78px,17vw,138px);
  --touch-tip:calc(var(--touch-skill) + 10px);
  --touch-flank:calc(var(--touch-attack) + 10px);
 }
 #battle47:is(.b87-pvp,.survival85) .b47-mini,
 #battle47:is(.b87-pvp,.survival85) .b79-map-hint {
  top:8px;left:var(--touch-left);right:auto;width:var(--touch-map);
 }
 #battle47:is(.b87-pvp,.survival85).show-map .b47-mini {top:50%;left:50%;width:min(74%,620px)}
 #battle47:is(.b87-pvp,.survival85).show-map .b79-map-hint {inset:0;width:100%;height:100%}
 #battle47:is(.b87-pvp,.survival85) .b47-hud {top:8px}
 #battle47:is(.b87-pvp,.survival85) .b47-player {top:8px;right:var(--touch-right);left:auto;width:clamp(66px,12vw,108px)}
 #battle47:is(.b87-pvp,.survival85) .b47-events {top:40px;max-width:calc(100% - 2 * var(--touch-map) - 12px);white-space:normal}
 #battle47:is(.b87-pvp,.survival85) .b78-buffs {top:72px;right:var(--touch-right);left:auto;max-width:27%}
 #battle47:is(.b87-pvp,.survival85) #b47-stick-zone {
  width:clamp(116px,34vw,290px);height:clamp(107px,39%,260px);
  left:var(--touch-left);bottom:calc(var(--touch-bottom) + 40px);
 }
 #battle47:is(.b87-pvp,.survival85) #b47-stick:not(.held) {left:43px;bottom:14px}
 #battle47:is(.b87-pvp,.survival85) .b47-utilities {display:contents}
 #battle47:is(.b87-pvp,.survival85) .b47-utilities button,
 #battle47:is(.b87-pvp,.survival85) .b47-utilities #b84-shop-key {
  position:absolute;z-index:4;min-height:36px;padding:4px 8px;
  font-size:12px;white-space:nowrap;border-radius:6px;
 }
 #battle47:is(.b87-pvp,.survival85) #b84-shop-key {
  left:var(--touch-left);top:calc(13px + var(--touch-map)*.5545);
 }
 #battle47:is(.b87-pvp,.survival85) .b47-utilities #b54-support {
  left:var(--touch-left);bottom:var(--touch-bottom);width:62px;padding-inline:4px;white-space:normal;
 }
 #battle47:is(.b87-pvp,.survival85) #b47-recall {left:calc(var(--touch-left) + 69px);bottom:var(--touch-bottom)}
 #battle47:is(.b87-pvp,.survival85) #b47-target,#battle47:is(.b87-pvp,.survival85) #b56-tower {
  right:calc(var(--touch-right) + var(--touch-flank) + var(--touch-skill) + 6px);
  min-width:48px;padding-inline:5px;
 }
 #battle47:is(.b87-pvp,.survival85) #b47-target {bottom:calc(var(--touch-bottom) + 57px)}
 #battle47:is(.b87-pvp,.survival85) #b56-tower {bottom:calc(var(--touch-bottom) + 97px)}
 #battle47:is(.b87-pvp,.survival85) .b47-controls {
  right:var(--touch-right);bottom:var(--touch-bottom);width:0;height:0;display:block;
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls :is(.attack,[data-skill],.b54-upgrade) {
  position:absolute;margin:0;right:0;left:auto;bottom:0;
  grid-area:auto;
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls .attack {
  width:var(--touch-attack);height:var(--touch-attack);font-size:17px;
  background:radial-gradient(ellipse at 34% 23%,#a88e52,#63491e 55%,#2c2518 97%);
  box-shadow:inset 0 0 0 3px #edcf8033,0 3px 9px #080e0dcc;
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls button[data-skill] {
  width:var(--touch-skill);height:var(--touch-skill);border:1px solid #b1ad87;
  background:radial-gradient(ellipse at 34% 24%,#496b60,#203932 58%,#152224 95%);
  box-shadow:inset 0 0 0 3px #babc7e26,0 3px 8px #101315d9;
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls button[data-skill="2"] {
  border-color:#e3be8e;background:radial-gradient(ellipse at 32% 24%,#745573,#3f2e47 60%,#211e31 95%);
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls button[data-skill] > span {font-size:20px}
 #battle47:is(.b87-pvp,.survival85) .b47-controls button[data-skill] .cool {
  border-radius:inherit;background:#0a1519c9;color:#fff3cc;font-size:11px;font-weight:700;
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls button[data-skill][data-ready100="1"] .cool {display:none}
 #battle47:is(.b87-pvp,.survival85) .b47-controls [data-skill="0"] {right:var(--touch-flank);bottom:2px}
 #battle47:is(.b87-pvp,.survival85) .b47-controls [data-skill="1"] {right:var(--touch-tip);bottom:calc(var(--touch-attack) + 6px)}
 #battle47:is(.b87-pvp,.survival85) .b47-controls [data-skill="2"] {bottom:calc(var(--touch-attack) + 39px)}
 #battle47:is(.b87-pvp,.survival85) .b47-controls .b54-upgrade {
  width:var(--touch-plus);height:var(--touch-plus);font-size:16px;z-index:3;
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls .b54-upgrade0 {
  right:calc(var(--touch-flank) + var(--touch-skill) - var(--touch-plus)/2);
  bottom:calc(2px + var(--touch-skill) - var(--touch-plus)/2);
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls .b54-upgrade1 {
  right:calc(var(--touch-tip) + var(--touch-skill) - var(--touch-plus)/2);
  bottom:calc(var(--touch-attack) + var(--touch-skill) + 6px - var(--touch-plus)/2);
 }
 #battle47:is(.b87-pvp,.survival85) .b47-controls .b54-upgrade2 {
  right:calc(var(--touch-skill) - var(--touch-plus)/2);
  bottom:calc(var(--touch-attack) + var(--touch-skill) + 39px - var(--touch-plus)/2);
 }
 #battle47:is(.b87-pvp,.survival85) .b60-comms {left:var(--touch-left);top:calc(54px + var(--touch-map)*.5545);bottom:auto;max-width:63%}
 #battle47:is(.b87-pvp,.survival85) .b60-comms[open] {z-index:8;max-height:48%;overflow:auto}
 #battle47:is(.b87-pvp,.survival85) .b54-consumables {left:var(--touch-left);bottom:calc(var(--touch-bottom) + 42px);max-width:37%;z-index:4}
 #battle47:is(.b87-pvp,.survival85) .b47-shop {
  left:var(--touch-left);bottom:var(--touch-bottom);max-height:calc(100% - 24px);width:min(85%,650px);
 }
 #battle47:is(.b87-pvp,.survival85) #b100-cancel-aim {
  position:absolute;z-index:5;right:var(--touch-right);top:103px;
  display:grid;place-items:center;min-width:44px;min-height:44px;padding:4px 8px;border-radius:50%;
  border:1px solid #e2ae9d;background:#49282a;color:#ffe2cd;font-size:12px;pointer-events:none;
 }
 #battle47:is(.b87-pvp,.survival85) #b100-cancel-aim[data-on="1"] {background:#843d3c;border-color:#ffccaf}
 #battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-canvas {image-rendering:auto}
}
@media (pointer:coarse) and (max-height:430px) {
 #battle47:is(.b87-pvp,.survival85) .b47-arena {--touch-map:clamp(78px,14vw,108px);--touch-skill:50px;--touch-attack:68px}
 #battle47:is(.b87-pvp,.survival85) .b47-controls [data-skill="2"] {bottom:calc(var(--touch-attack) + 27px)}
 #battle47:is(.b87-pvp,.survival85) .b47-controls .b54-upgrade2 {bottom:calc(var(--touch-attack) + var(--touch-skill) + 27px - var(--touch-plus)/2)}
 #battle47:is(.b87-pvp,.survival85) #b100-cancel-aim {top:72px;right:calc(var(--touch-right) + var(--touch-skill) + 10px)}
 #battle47:is(.b87-pvp,.survival85) .b60-comms {
  left:calc(var(--touch-left) + var(--touch-map) + 8px);top:calc(13px + var(--touch-map)*.5545);
 }
}
@media (pointer:coarse) and (max-width:360px) {
 #battle47:is(.b87-pvp,.survival85) .b47-arena {--touch-skill:46px}
 #battle47:is(.b87-pvp,.survival85) .b47-utilities #b54-support {width:52px}
 #battle47:is(.b87-pvp,.survival85) #b47-recall {left:calc(var(--touch-left) + 57px)}
}

/* A full viewport in touch PvP, with safe insets applied to the controls only. */
#battle47:is(.b87-pvp,.survival85)[data-touch100][open]:modal {
 --touch-top:max(8px,calc(env(safe-area-inset-top,0px) + 4px));
 --touch-right:max(20px,calc(env(safe-area-inset-right,0px) + 12px));
 inset:0;
 margin:0;
 width:100%;
 height:100dvh;
 max-width:none;
 max-height:none;
 grid-template-rows:minmax(0,1fr);
 border:0;
 border-radius:0;
 overscroll-behavior:none;
}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-head {
 position:absolute;
 z-index:11;
 inset:var(--touch-top) var(--touch-right) auto auto;
 min-height:0;
 margin:0;
 padding:0;
 border:0;
 background:none;
}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-head > div {display:none}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-head button {
 min-height:44px;
 min-width:48px;
 padding:4px 9px;
 background:#182421e0;
}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-arena {height:100%;user-select:none;-webkit-user-select:none}
#battle47:is(.b87-pvp,.survival85)[data-touch100] :is(.b47-mini,.b79-map-hint,.b47-hud) {top:var(--touch-top)}
#battle47:is(.b87-pvp,.survival85)[data-touch100].show-map .b47-mini {top:50%}
#battle47:is(.b87-pvp,.survival85)[data-touch100].show-map .b79-map-hint {top:0}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-player {top:calc(var(--touch-top) + 49px)}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-events {top:calc(var(--touch-top) + 29px)}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b78-buffs {top:calc(var(--touch-top) + 110px)}
#battle47:is(.b87-pvp,.survival85)[data-touch100] #b84-shop-key {top:calc(var(--touch-top) + 5px + var(--touch-map)*.5545)}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b60-comms {top:calc(var(--touch-top) + 46px + var(--touch-map)*.5545)}
#battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-stick-zone {
 --stick-size:clamp(70px,21dvh,102px);
 bottom:calc(var(--touch-bottom) + 44px);
 width:max(125px,calc(var(--stick-size) + 28px));
 height:calc(var(--stick-size) + 24px);
}
#battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-stick {
 left:calc(var(--stick-size)/2 + 10px);
 top:auto!important;
 bottom:10px;
 width:var(--stick-size);
 height:var(--stick-size);
 transform:translateX(-50%);
 opacity:.55;
}
#battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-stick.held {opacity:.9}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-controls kbd,
#battle47:is(.b87-pvp,.survival85)[data-touch100] #b84-shop-key kbd {display:none}
@media (orientation:landscape) and (min-height:340px) {
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-arena {
  --touch-attack:clamp(74px,19dvh,94px);
  --touch-skill:clamp(50px,14dvh,66px);
 }
 #battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-stick-zone {
  left:max(21px,calc(env(safe-area-inset-left,0px) + 12px));
 }
}
@media (orientation:landscape) and (max-height:430px) {
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b60-comms {top:calc(var(--touch-top) + 5px + var(--touch-map)*.5545)}
 #battle47:is(.b87-pvp,.survival85)[data-touch100] #b100-cancel-aim {top:calc(var(--touch-top) + 58px)}
}
@media (orientation:portrait) {
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-arena {--touch-right:max(12px,calc(env(safe-area-inset-right,0px) + 6px))}
 #battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-stick-zone {--stick-size:clamp(70px,23vw,86px)}
}

/* Shift the touch controls without changing their hit areas or portrait layout. */
@media (orientation:landscape) {
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-arena {
  --landscape-utility-left:max(5px,calc(env(safe-area-inset-left,0px) + 3px));
  --landscape-utility-bottom:calc(var(--touch-bottom) + clamp(16px,5.5dvh,26px));
 }
 #battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-stick-zone {
  left:calc(var(--touch-left) + clamp(29px,4.8vw,52px));
  bottom:calc(var(--landscape-utility-bottom) + 44px);
 }
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-utilities #b54-support {
  left:var(--landscape-utility-left);
  bottom:var(--landscape-utility-bottom);
 }
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-utilities #b47-recall {
  left:calc(var(--landscape-utility-left) + 69px);
  bottom:var(--landscape-utility-bottom);
 }
 #battle47:is(.b87-pvp,.survival85)[data-touch100] #b84-shop-key {
  left:var(--landscape-utility-left);
  top:calc(var(--touch-top) + 2px + var(--touch-map)*.5545);
 }
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b60-comms {
  left:var(--landscape-utility-left);
  top:calc(var(--touch-top) + 43px + var(--touch-map)*.5545);
 }
}
@media (orientation:landscape) and (min-height:340px) {
 #battle47:is(.b87-pvp,.survival85)[data-touch100] #b47-stick-zone {
  left:calc(max(21px,calc(env(safe-area-inset-left,0px) + 12px)) + clamp(29px,4.8vw,52px));
 }
}
@media (orientation:landscape) and (max-height:430px) {
 #battle47:is(.b87-pvp,.survival85)[data-touch100] .b60-comms {
  left:calc(var(--touch-left) + var(--touch-map) + 4px);
  top:calc(var(--touch-top) + 2px + var(--touch-map)*.5545);
 }
}

#battle47:is(.b87-pvp,.survival85)[data-touch100] .b47-head:has(#b103-layout) {gap:5px}
#battle47 #b103-editor {
 position:absolute;inset:0;z-index:10;background:#09141260;touch-action:none;
}
#battle47 #b103-editor[hidden] {display:none}
#battle47 .b103-safe-area {
 position:absolute;pointer-events:none;visibility:hidden;
 inset:max(4px,env(safe-area-inset-top,0px)) max(4px,env(safe-area-inset-right,0px))
       max(4px,env(safe-area-inset-bottom,0px)) max(4px,env(safe-area-inset-left,0px));
}
#battle47 .b103-toolbar {
 position:absolute;z-index:1;top:var(--touch-top);left:50%;transform:translateX(-50%);
 display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:4px;
 width:max-content;max-width:98%;padding:5px;color:#fae5b8;background:#13231ff5;
 border:1px solid #a48a54;border-radius:6px;font-size:12px;
}
#battle47 .b103-toolbar button {min-height:40px;padding:4px 7px;font-size:12px}
#battle47 #b103-status {flex-basis:100%;text-align:center;font-size:11px}
#battle47 .b103-handle {
 position:absolute;display:grid;place-items:center;min-width:0;padding:0;touch-action:none;
 border:1px dashed #e9c880;border-radius:8px;background:#142b23e8;color:#ffedc5;
 font-size:clamp(10px,2.8vw,14px);font-weight:700;cursor:grab;
}
#battle47 .b103-handle:is([data-control=stick],[data-control=attack],[data-control^=skill]) {border-radius:50%}
#battle47 .b103-handle:active {cursor:grabbing;border-style:solid;background:#504628f5}
#battle47:is(.b87-pvp,.survival85)[data-touch100] .b54-upgrade[hidden] {display:flex;visibility:hidden;pointer-events:none}
@media (max-width:480px) {
 #battle47 .b103-toolbar {top:calc(var(--touch-top) + 52px)}
}

#battle47.survival85[data-touch100] .s85-status {
 top:calc(var(--touch-top) + 28px);
 gap:1px;padding:3px 5px;font-size:10px;line-height:1.3;
 background:#13211bc2;
}
#battle47.survival85[data-touch100] .s85-status b {font-size:12px}
#battle47.survival85[data-touch100] #b47-blue {display:none}
#battle47.survival85[data-touch100] #b54-support {z-index:4}
#battle47.survival85[data-touch100] #b54-consumables {bottom:var(--touch-bottom);left:calc(var(--touch-left) + 70px)}
#battle47.survival85[data-touch100] #b47-target {
 right:calc(var(--touch-right) + var(--touch-flank) + var(--touch-skill) + 6px);
}
#battle47.survival85[data-touch100] #s85-offer {padding-top:calc(var(--touch-top) + 46px)}
#battle47.survival85[data-touch100] #s85-offer > section {touch-action:pan-y}
#battle47.survival85[data-touch100] #s85-offer #s85-options button {touch-action:manipulation}
@media (orientation:landscape) {
 #battle47.survival85[data-touch100] .s85-status {
  left:calc(var(--touch-left) + var(--touch-map) + 10px);transform:none;
  width:clamp(128px,25vw,205px);text-align:left;
 }
 #battle47.survival85[data-touch100] .s85-status>div {justify-content:flex-start}
}
@media (orientation:portrait) {
 #battle47.survival85[data-touch100] #b54-consumables {max-width:45%;left:calc(var(--touch-left) + 68px)}
 #battle47.survival85[data-touch100] #b54-consumables button {max-width:100%}
}

/* 活動入口與活動說明 */
#world #system-shortcuts #wide-activity107 {
 --shortcut-ink:#ffe8a1;
 --shortcut-tint:#5c4e27;
 --shortcut-edge:#cbb46d;
}
@media (pointer:fine) {
 #world #system-shortcuts #wide-activity107 {display:block}
}
#mobile-activity-dialog {
 width:min(420px,calc(100% - 24px - var(--game-safe-left,0px) - var(--game-safe-right,0px)));
 padding:clamp(10px,2.8vw,17px);
}
#mobile-activity-dialog h2 {font-size:22px;color:#fff1d3}
#mobile-activity-dialog .mobile-activity-options {
 grid-template-columns:minmax(0,1fr);
 gap:8px;
}
#mobile-activity-dialog .mobile-activity-options > button {
 display:grid;
 gap:3px;
 min-height:58px;
 padding:8px 12px;
 border-width:1px 1px 1px 4px;
 border-color:var(--activity-edge);
 background:linear-gradient(var(--activity-top),var(--activity-bottom));
}
#mobile-activity-dialog [data-mobile-activity-entry="activity-pvp109"] {
 --activity-edge:#dcab61;--activity-top:#553922;--activity-bottom:#332416;
}
#mobile-activity-dialog [data-mobile-activity-entry="activity-daily109"] {
 --activity-edge:#b9a3e0;--activity-top:#48385d;--activity-bottom:#2f243e;
}
#mobile-activity-dialog [data-mobile-activity-entry="activity-mirror109"] {
 --activity-edge:#7bc7b8;--activity-top:#254f4d;--activity-bottom:#182f31;
}
#mobile-activity-dialog .mobile-activity-options > button strong {
 color:#fff5de;
 font-size:19px;
 line-height:1.35;
}
#mobile-activity-dialog .mobile-activity-options > button span {
 color:#f3ebdd;
 font-size:16px;
 font-weight:500;
 line-height:1.4;
}
#mobile-activity-dialog .mobile-activity-options > button:focus-visible {
 outline:2px solid #fff2d1;
 outline-offset:2px;
}
#battle47 .b47-mode > p,
#battle47 .b47-content .b47-note,
#battle47 .b89-difficulty small {
 color:#f0ede2;
 font-size:clamp(17px,1.65vw,19px);
 line-height:1.55;
 overflow-wrap:anywhere;
}
#battle47 .b47-mode > p {margin:5px 0 10px}


/* 天堂無界進場確認 */
#b47-queue-notice{width:min(355px,calc(100% - 26px));box-sizing:border-box;padding:16px;border:1px solid #c79d64;border-radius:8px;background:#252018;color:#fff3d9}
#b47-queue-notice::backdrop{background:#13100985}
#b47-queue-notice h2{margin:0;color:#ffdf9d;font-size:22px}
#b47-queue-notice p{margin:10px 0;font-size:16px;line-height:1.45}
#b47-queue-notice #b47-queue-error{color:#ffc4bd}
#b47-queue-notice>div{display:flex;gap:8px;justify-content:flex-end}
#b47-queue-notice button{min-height:44px;padding:6px 13px;touch-action:manipulation}
#b47-queue-notice [data-queue-confirm]{color:#291b0e;background:#f2ce97;border-color:#e6bd83}
#b47-queue-notice button:disabled{opacity:.55}


.b114-guide {
 width:min(580px,calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
 max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
 margin:auto;padding:0;color:#efe4ce;background:#192422;border:1px solid #b49b68;border-radius:8px;
 font:14px/1.45 var(--game-chinese-font,system-ui);overflow:hidden;
}
.b114-guide[open] {display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.b114-guide::backdrop {background:#08110ed0}
.b114-guide h2 {margin:0;padding:11px 14px 6px;font-size:18px;color:#ffe2a6}
.b114-guide dl {margin:0;padding:2px 14px 8px;overflow:auto;overscroll-behavior:contain}
.b114-guide dl>div {padding:5px 0;border-bottom:1px solid #a88b5d3b}
.b114-guide dt {color:#ffe3ac;font-weight:700}
.b114-guide dd {margin:0}
.b114-guide-actions {display:flex;justify-content:end;gap:7px;padding:6px 12px 9px;background:#192422}
.b114-guide-actions button {min-height:43px}
.b114-guide-actions [data-guide114="ok"] {color:#fff0c8;background:#5b4729;border-color:#c2a269}
#battle47 .b114-fold {
 display:flex;align-items:center;justify-content:space-between;gap:4px;
 min-width:0;width:100%;min-height:24px;padding:0;border:0;background:none;
 text-align:inherit;color:inherit;line-height:1.15;cursor:pointer;pointer-events:auto;
}
#battle47 .b114-fold::after {content:"−";color:#e9d49d;font-size:14px}
#battle47 .b114-fold[aria-expanded="false"]::after {content:"+"}
#battle47 .b114-fold:focus-visible {outline:1px solid #ffe297}
#battle47 .b114-player-title {display:flex;align-items:baseline;min-width:0}
#battle47 #b47-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#battle47 #b47-level {white-space:nowrap}
#battle47 .b114-stage-body:not([hidden]) {display:grid;gap:inherit}
#battle47 .b114-stage-body>div:first-of-type {display:flex;align-items:center;gap:5px;justify-content:inherit}
#battle47 .s85-status[data-folded114] {width:max-content;max-width:min(52vw,230px)}
#battle47 .b47-player[data-folded114] {padding-block:3px;z-index:5}
#battle47 .b47-player[data-folded114] :is(.b47-health,.b47-mana) {height:3px;margin-block:2px}
#battle47 [data-act="guide114"] {white-space:nowrap;margin-inline-start:auto}
@media (pointer:coarse) {
 #battle47 .b114-fold {min-height:29px}
}

/* Touch terrain 119 */
#battle47.b87-pvp[data-touch100] #b47-stick-zone {
 --stick-size:clamp(100px,29dvh,126px);
 width:calc(var(--stick-size) + 30px);
 height:calc(var(--stick-size) + 22px);
}
#battle47.b87-pvp[data-touch100] #b47-stick {
 left:calc(var(--stick-size)/2 + 10px);
 transform:translateX(-50%);
}
#battle47.b87-pvp[data-touch100] #b47-stick.held > i {will-change:transform}
@media (orientation:portrait) {
 #battle47.b87-pvp[data-touch100] #b47-stick-zone {--stick-size:clamp(98px,29vw,118px)}
}
