:root{--bg:#090d1d;--panel:#111a32;--panel2:#172344;--line:#354365;--text:#edf4ff;--muted:#9baac9;--mint:#66f4d6;--gold:#ffd17e;--violet:#b8a5ff;--pink:#ff7fb5;--red:#ff7281}
    *{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--bg);font-family:ui-sans-serif,system-ui,-apple-system,"Noto Sans TC","Microsoft JhengHei",sans-serif;color:var(--text)}
    button{font:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:3px solid var(--mint);outline-offset:2px}
    #game{display:block;width:100vw;height:100vh;touch-action:none;position:absolute;inset:0}
    #vignette{pointer-events:none;position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,transparent 35%,rgba(3,5,16,.51) 100%)}
    #topHUD{position:absolute;z-index:3;top:0;left:0;right:0;pointer-events:none;padding:calc(13px + env(safe-area-inset-top)) 19px 12px;display:none;background:linear-gradient(180deg,rgba(4,7,22,.90),rgba(4,7,22,.06));gap:14px;align-items:flex-start}
    .hudcol{flex:1;min-width:0}.hudRow{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.hsmall{font-weight:700;font-size:12px;color:var(--muted);letter-spacing:.07em}.hudTitle{font-size:16px;font-weight:900;white-space:nowrap}.pill{border:1px solid #476083;border-radius:999px;background:#101b35c9;padding:5px 10px;color:#f2f8ff;font-size:12px;font-weight:850;white-space:nowrap}
    #timer{font-size:27px;letter-spacing:.045em;font-weight:1000;text-align:center;text-shadow:0 3px 20px #081d35}#phaseLabel{font-size:10px;text-transform:uppercase;text-align:center;letter-spacing:.16em;color:var(--mint);font-weight:850}
    .bar{position:relative;overflow:hidden;height:10px;border:1px solid #40526e;background:#0a1126;border-radius:999px}.bar>i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#ff6d87,#ffb3ab);border-radius:inherit;box-shadow:0 0 17px #ff738388}.bar.xp>i{background:linear-gradient(90deg,#55dcd9,#a8ffe7);box-shadow:0 0 17px #5cf2dc88}
    #xpBar{position:absolute;top:0;left:0;right:0;height:4px;background:#0b1223;pointer-events:none;z-index:5;display:none}#xpFill{height:100%;width:0;background:linear-gradient(90deg,#6cdeff,#70ffda);box-shadow:0 0 12px #76ffe2}
    #soundBtnGame{pointer-events:auto;min-width:40px;height:42px;border-radius:14px;background:#15223be0;border:1px solid #49607d;color:#e6f9fa;font-size:19px;cursor:pointer}#pauseBtn{pointer-events:auto;min-width:42px;height:42px;border-radius:14px;background:#15223be0;border:1px solid #49607d;color:#e6f9fa;font-size:21px;font-weight:bold}
    #bottomHUD{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(14px + env(safe-area-inset-bottom));display:none;z-index:4;pointer-events:none;justify-content:center;align-items:flex-end;width:min(90vw,560px)}
    #loadoutHUD{display:flex;flex-direction:column;gap:5px;align-items:center;width:100%}
    .slotRow{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;width:100%}
    #passiveHUD{grid-template-columns:repeat(5,minmax(0,1fr))}
    .loadoutSlot.futureSpecial{border-color:#c5a9ff80;background:linear-gradient(150deg,#302342d9,#191b39d9)}
    .loadoutSlot.futureSpecial .slotIcon{color:#dfc7ff;background:#2d2246;border-color:#9f7ac2}
    .loadoutSlot.futureSpecial .slotName{color:#e3d2ff}
    @media(max-width:680px){#passiveHUD .futureSpecial{padding:3px 2px;gap:2px}#passiveHUD .futureSpecial .slotName{font-size:8px}#passiveHUD .futureSpecial .slotTag{font-size:6px}}

    .loadoutSlot{min-width:0;height:44px;border:1px solid #496489;background:linear-gradient(160deg,#10233bde,#0b172ccc);border-radius:11px;box-shadow:0 4px 12px #0005,inset 0 1px 0 #ffffff12;display:flex;align-items:center;gap:5px;padding:4px 6px;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
    .loadoutSlot.skill{position:relative;overflow:hidden;isolation:isolate}
    .loadoutSlot.skill .cdShade{position:absolute;z-index:3;inset:0 auto 0 0;width:0%;background:rgba(0,0,0,.70);pointer-events:none;transition:width .09s linear}
    .loadoutSlot.skill .cdTime{position:absolute;z-index:4;inset:0;display:none;place-items:center;font-weight:1000;font-size:15px;color:#fff;text-shadow:0 1px 4px #000,0 0 8px #000;pointer-events:none;font-variant-numeric:tabular-nums}
    .loadoutSlot.skill.cooling .cdTime{display:grid}
    .loadoutSlot.passive{background:linear-gradient(160deg,#18243dde,#101828cc)}
    .loadoutSlot.empty{opacity:.38;border-style:dashed}
    .slotIcon{width:24px;height:24px;border-radius:7px;display:grid;place-items:center;font-size:14px;font-weight:1000;color:#fff;background:#19314c;border:1px solid #5d7ca3;box-shadow:inset 0 1px 0 #ffffff16;flex:0 0 auto}
    .slotMain{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}
    .slotName{font-size:10px;font-weight:950;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#f3f8ff}
    .slotMeta{display:flex;align-items:center;justify-content:space-between;gap:7px}
    .slotTag{display:inline-flex;align-items:center;gap:4px;font-size:8px;font-weight:1000;letter-spacing:.05em;color:#daf3ff;background:#0b1728c9;border:1px solid #47617f;border-radius:999px;padding:2px 5px;white-space:nowrap}
    .slotLevel{font-size:10px;font-weight:1000;color:#f8fbff;background:#ffffff12;border-radius:999px;padding:1px 5px;white-space:nowrap}
    .slotHint{font-size:9px;color:#98acc7;letter-spacing:.08em;text-transform:uppercase}
    #dangerBanner{position:absolute;top:24%;left:50%;transform:translateX(-50%);font-size:clamp(23px,5vw,55px);font-weight:1000;color:#ffbdcc;letter-spacing:.13em;white-space:nowrap;z-index:4;text-shadow:0 0 35px #e93d76,0 3px 5px #111;pointer-events:none;opacity:0;transition:opacity .2s}
    .overlay{position:absolute;inset:0;display:none;z-index:10;background:rgba(5,9,23,.70);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);overflow:auto;padding:20px;align-items:center;justify-content:center}
    .overlay.show{display:flex}.panel{width:min(930px,100%);max-height:min(94vh,900px);overflow:auto;border-radius:24px;background:linear-gradient(147deg,rgba(22,33,62,.98),rgba(11,17,36,.98));border:1px solid #506385;box-shadow:0 35px 110px #020512ad,0 0 60px #3e6fa51c;padding:clamp(20px,4vw,37px);position:relative}
    .panel:before{content:'';position:absolute;inset:0 0 auto;height:3px;border-radius:24px 24px 0 0;background:linear-gradient(90deg,#55e7e2,#7e82ff,#ff7cad)}
    .brand{text-align:center;color:#78ecd5;font-size:10px;font-weight:1000;letter-spacing:.43em;text-transform:uppercase;margin-bottom:5px}
    h1{text-align:center;font-weight:1000;letter-spacing:.05em;margin:0;font-size:clamp(35px,7vw,68px);line-height:1.18;text-shadow:0 6px 0 #253858,0 10px 35px #68fdf52d}
    .subtitle{text-align:center;color:#afbed9;font-size:13px;margin:13px auto 23px;line-height:1.7;max-width:650px}
    .sectionTitle{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:950;margin:10px 0 10px;color:#e5efff}.sectionTitle:after{content:'';height:1px;flex:1;background:#445477}
    .classes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.classCard{text-align:left;border:1px solid #435478;background:linear-gradient(145deg,#172745,#121b32);color:#eef9ff;border-radius:16px;padding:16px 13px;transition:transform .15s,border-color .15s,background .15s;min-height:127px}.classCard:hover{transform:translateY(-2px);border-color:#85dbef}.classCard.selected{border:2px solid var(--mint);background:linear-gradient(145deg,#21414d,#142139);padding:15px 12px;box-shadow:0 0 22px #52f3df27}.classIcon{font-size:31px;display:block;margin-bottom:6px}.className{font-size:15px;font-weight:950}.classDesc{font-size:11px;color:#b7c5d9;line-height:1.6;display:block;margin-top:4px}
    .shopRow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.shopBtn{background:#18233f;border:1px solid #415370;color:#e4eeff;padding:11px;border-radius:13px;text-align:left;min-height:76px}.shopBtn b{display:block;font-size:12px}.shopBtn small{display:block;margin-top:6px;color:#b2c6da;font-size:10px}.shopBtn:disabled{opacity:.50;cursor:not-allowed}.shopBtn:not(:disabled):hover{border-color:#e6c77e;background:#222b42}
    .menuFooter{margin-top:19px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.stats{display:flex;gap:13px;flex-wrap:wrap;color:#c4d1e5;font-size:12px}.stats strong{color:#ffe3a3}.primary{background:linear-gradient(98deg,#6becdc,#a6fff1);border:0;border-radius:14px;padding:13px 29px;color:#092938;font-weight:1000;letter-spacing:.035em;box-shadow:0 8px 25px #29e1cf37;min-height:46px}.primary:hover{filter:brightness(1.07)}.secondary{border:1px solid #6786a0;color:#e1f5ff;border-radius:13px;padding:12px 20px;background:#1a2e4a;font-weight:800;min-height:46px}
    #levelOverlay{z-index:20}#levelPanel{max-width:850px}.choiceGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin-top:18px}.choice{border:1px solid #51668c;text-align:left;background:linear-gradient(155deg,#1f3152,#17223e);color:#ebf4ff;padding:18px 16px;border-radius:17px;min-height:203px;transition:transform .16s,border-color .16s,box-shadow .16s}.choice:hover{border-color:#a3f3e6;transform:translateY(-3px);box-shadow:0 8px 30px #55edda1c}.choiceIcon{font-size:36px}.choiceType{display:block;font-size:10px;font-weight:900;color:#7eead7;letter-spacing:.1em;margin:10px 0 5px}.choice strong{display:block;font-size:17px}.choice p{font-size:12px;color:#b7c7db;line-height:1.6;margin:8px 0}.choice .hint{font-size:10px;color:#a3b1ca}.levelTitle{text-align:center;margin:3px 0 5px;font-size:clamp(25px,5vw,40px);font-weight:1000}.center{text-align:center}.muted{color:#adbad2}.recap{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:17px 0}.recapItem{background:#15243d;border:1px solid #334e6e;border-radius:14px;padding:13px 7px;text-align:center}.recapItem b{display:block;font-size:clamp(22px,4vw,32px);font-variant-numeric:tabular-nums}.recapItem small{font-size:10px;color:#b1bdd4}.buttonRow{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:18px}
    #dashBtn{display:none;position:absolute;z-index:4;right:20px;bottom:calc(112px + env(safe-area-inset-bottom));width:65px;height:65px;border:2px solid #84eee0a0;border-radius:50%;background:#153447dd;box-shadow:0 0 23px #4ccec427;color:#c5fff3;font-weight:900;font-size:11px;line-height:1.35;pointer-events:auto}#dashBtn:disabled{border-color:#5a6884;color:#99a6c1;background:#19213add;opacity:.75}
    #touchArea{display:none;position:absolute;z-index:4;bottom:calc(25px + env(safe-area-inset-bottom));left:23px;width:130px;height:130px;border-radius:50%;border:2px solid #a5fff244;background:#60ffec13;touch-action:none;pointer-events:auto}#stick{position:absolute;top:37px;left:37px;width:52px;height:52px;border-radius:50%;border:2px solid #9afff4a0;background:#9afff458;box-shadow:0 0 16px #6debdc42;pointer-events:none}
    #pauseOverlay .panel,#resultOverlay .panel{max-width:520px}.tiny{font-size:10px;color:#879db8;text-align:center;margin:16px 0 0}.badge{display:inline-block;padding:5px 10px;background:#1d3d4d;color:#9cffe8;border-radius:999px;font-size:11px;font-weight:900;letter-spacing:.12em}
    #soundBtn{position:absolute;right:20px;top:19px;border:1px solid #52627e;background:#19223b;color:#fff;width:39px;height:37px;border-radius:11px;font-size:18px}
    @media(max-width:680px){.overlay{padding:10px;align-items:center}.panel{border-radius:19px;padding:19px 14px;max-height:95dvh}.subtitle{font-size:11px;margin-bottom:14px}.classes{gap:6px}.classCard{min-height:120px;padding:12px 8px}.classCard.selected{padding:11px 7px}.classIcon{font-size:25px}.className{font-size:12px}.classDesc{font-size:10px}.shopRow{gap:6px}.shopBtn{padding:9px 7px}.shopBtn b{font-size:11px}.shopBtn small{font-size:9px}.menuFooter{justify-content:center}.stats{justify-content:center;font-size:11px}.primary{width:100%}.choiceGrid{gap:7px}.choice{min-height:180px;padding:12px 8px}.choice strong{font-size:13px}.choiceIcon{font-size:29px}.choice p{font-size:10px}.choiceType{font-size:9px}.choice .hint{font-size:9px}.levelTitle{font-size:26px}#topHUD{padding:calc(9px + env(safe-area-inset-top)) 8px 9px;gap:5px}#timer{font-size:23px}.hudTitle{font-size:11px}.hsmall{font-size:9px}.pill{padding:4px 6px;font-size:10px}#pauseBtn{height:36px;min-width:36px}#bottomHUD{left:50%;right:auto;bottom:calc(154px + env(safe-area-inset-bottom));width:min(95vw,540px)}.slotRow{gap:4px}.loadoutSlot{height:40px;padding:3px 4px;border-radius:9px;gap:3px}.slotIcon{width:21px;height:21px;font-size:13px;border-radius:6px}.slotName{font-size:9px}.slotTag{font-size:7px;padding:1px 3px}.slotLevel{font-size:9px;padding:1px 3px}.slotHint{font-size:8px}#touchArea{display:block}.recap{gap:5px}.recapItem{padding:12px 3px}.recapItem b{font-size:21px}.recapItem small{font-size:9px}}
    @media(max-height:700px){.panel{padding-top:18px;padding-bottom:18px}.subtitle{margin:8px auto 12px}.classCard{min-height:104px}.classIcon{font-size:24px}.shopBtn{min-height:60px}.menuFooter{margin-top:12px}}
    @media(pointer:coarse){#touchArea{display:block}#dashBtn{display:block}.controlsHelp{display:none}}
    @media(max-width:680px){#dashBtn{display:block}}
    :root{--bg:#07171d;--panel:#0c242f;--panel2:#123646;--line:#326a7d;--mint:#56ebd0}
    #game{image-rendering:auto}
    .panel{background:linear-gradient(155deg,rgba(12,38,50,.98),rgba(9,20,39,.98));border-color:#3f788b}
    .classCard.selected{background:linear-gradient(150deg,#1b5359,#132e43)}
    .classIcon{filter:drop-shadow(0 2px 9px #75ffe255)}
    .classDesc{font-size:11px}
    .stage-flare{position:absolute;z-index:6;inset:0;pointer-events:none;opacity:0;background:radial-gradient(circle,#98ffe458 0%,#16caed18 34%,transparent 62%);transition:opacity .25s}
    .stage-flare.on{opacity:1}
    #evoNext{font-size:10px}
    @media(max-width:680px){#evoNext{font-size:9px}#hudStage{font-size:9px;padding:3px 5px}.classDesc{font-size:9px}}
/* DATA SURVIVORS v0.2: original trainer UI; no official sprites */
#menuOverlay{padding:0;background:#04131bd6;backdrop-filter:blur(7px)}
.hubShell{width:min(1370px,100vw);height:min(94dvh,930px);display:flex;flex-direction:column;border:1px solid #3a8290;background:linear-gradient(138deg,#0c2635,#091622 75%);border-radius:20px;box-shadow:0 30px 100px #0009;position:relative;overflow:hidden}
.hubTop{height:76px;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #2d5968;padding:14px 23px;background:#0e2735;gap:10px}
.hubLogo{display:flex;gap:10px;align-items:center}.hubLogo b{display:block;font-size:22px;letter-spacing:2px}.hubLogo small{display:block;color:#7db2ba;font-size:10px;letter-spacing:2px}.hubMark{font-size:27px;font-weight:900;background:#35d8cc22;border:1px solid #56d6d7;border-radius:13px;color:#76f1db;padding:4px 12px}
.hubTopRight{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.resPill{white-space:nowrap;font-weight:850;font-size:13px;padding:9px 12px;border:1px solid #3d6673;border-radius:12px;background:#152d3b;color:#e3f7f1}
#soundBtn{position:static;min-width:40px;height:39px;margin:0}
.hubBody{flex:1;display:grid;grid-template-columns:207px minmax(0,1fr);min-height:0}.hubSide{display:flex;flex-direction:column;gap:8px;border-right:1px solid #255368;padding:14px 12px;background:#0b1e2d;overflow:auto}.trainerBox{text-align:center;border:1px solid #355768;background:radial-gradient(circle at 50% 30%,#224456,#132735);border-radius:16px;padding:13px 8px;margin-bottom:5px}.trainerBox b{font-size:13px;display:block;margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trainerBox small{font-size:10px;color:#74c9c3}
.trainerPortrait{height:86px;width:83px;margin:auto;position:relative;overflow:hidden}.trainerHair{height:43px;width:43px;background:#263046;position:absolute;top:12px;left:20px;border-radius:46% 48% 32% 33%;z-index:2}.trainerFace{height:42px;width:32px;background:#e5b48b;position:absolute;top:27px;left:25px;border-radius:13px 13px 14px 14px;z-index:3;display:flex;gap:10px;justify-content:center;align-items:center}.trainerFace i{width:3px;height:5px;background:#173147;border-radius:2px}.trainerShirt{position:absolute;width:66px;height:40px;bottom:-7px;left:8px;border-radius:23px 23px 8px 8px;background:#3dc9b4;border:5px solid #123044}
#hubNav{display:flex;flex-direction:column;gap:3px}#hubNav button{text-align:left;background:transparent;border:1px solid transparent;border-radius:12px;color:#a8cbd6;padding:11px 14px;font-weight:800;font-size:14px}#hubNav button.selected{color:#c3fff3;background:#1a4855;border-color:#368b8d}#hubNav button:hover{background:#1a3848;color:#fff}.hubFoot{margin-top:auto;text-align:center;font-size:10px;line-height:1.6;color:#638a99;padding:15px 0 3px}
.hubMain{padding:24px 27px;overflow:auto;min-height:0;background:radial-gradient(ellipse at 85% 5%,#1c485633,transparent 60%)}.hubHeading{font-size:clamp(23px,3vw,32px);font-weight:950;margin:0 0 7px}.hubSub{font-size:13px;color:#a6c4cd;margin:0 0 22px;line-height:1.7}.hubGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.hubTile,.dataCard,.rosterCard,.stageCard,.missionCard,.perksCard{padding:17px;background:linear-gradient(145deg,#173745dd,#102633f2);border:1px solid #345b6a;border-radius:16px}.hubTile{min-height:132px;text-align:left;color:#eafaf9;transition:transform .12s,border-color .12s}.hubTile:hover,.rosterCard:hover,.stageCard:not(:disabled):hover{border-color:#62dace;transform:translateY(-2px)}.tileIcon{font-size:27px;display:block;margin-bottom:5px}.hubTile strong{display:block;font-size:16px}.hubTile small{display:block;margin-top:6px;font-size:11px;line-height:1.5;color:#9eb9c5}.dividerLine{border-top:1px solid #375461;margin:20px 0}.dataCard h3,.missionCard h3{font-size:15px;margin:0 0 9px}.dataCard p,.rosterCard small,.stageCard small,.missionCard p{font-size:11px;color:#9fbdcb;line-height:1.6}.metricRow{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0}.metric{padding:10px 14px;border:1px solid #456a78;border-radius:12px;background:#112f40;color:#b0d9dc;font-size:12px}.metric b{display:block;font-size:20px;color:#f4ffff}
.hubBtn{border-radius:11px;padding:10px 16px;font-size:12px;font-weight:900;color:#062733;background:#7ee9db;border:0;min-height:39px}.hubBtn.secondary{background:#1c3e4d;color:#d9edf2;border:1px solid #54818c}.hubBtn:disabled{opacity:.42;cursor:not-allowed}.hubBtn:hover:not(:disabled){filter:brightness(1.13)}.hubActionRow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.sectionMini{margin:17px 0 10px;font-weight:900;color:#d8fffa;font-size:15px}.rosterGrid,.stageGrid,.missionGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.rosterCard,.stageCard{color:inherit;text-align:left;cursor:pointer}.rosterCard.chosen{border-color:#9dffe5;box-shadow:0 0 0 1px #55d5bb}.rosterCard.activeMate{background:linear-gradient(140deg,#275b52,#173b43)!important;border-color:#6df7c3;box-shadow:0 0 0 1px #4cb88d,0 0 15px #66ffc526}.rosterCard.activeMate .badgeActive{color:#e4ffe9;font-weight:1000;font-size:11px;display:inline-block;margin-bottom:5px}.rosterCard.activeMate:hover{background:linear-gradient(140deg,#306b5f,#1b454a)!important}.bagOverWarning{border:1px solid #e2a36b;background:#432c26;border-radius:12px;padding:11px 15px;color:#ffe8cf;font-weight:800;font-size:13px;margin:8px 0 14px}.sellWarning{border:1px solid #786b55;padding:10px;border-radius:11px;margin-top:9px;font-size:12px;color:#bcd1d6}.sellWarning button{margin-top:5px}.sellWarning b{color:#ffd296}.rosterCard b,.stageCard b{display:block;font-size:14px;margin-bottom:8px}.rosterCard .emoji{font-size:32px;display:block;margin-bottom:5px}.miniTag{display:inline-block;border-radius:7px;padding:4px 7px;background:#28515c;font-size:10px;margin:3px 3px 3px 0;color:#bdf4ef}.progress{height:7px;background:#14242e;border-radius:10px;overflow:hidden;border:1px solid #416a75;margin-top:8px}.progress>i{display:block;height:100%;background:linear-gradient(90deg,#30afa8,#c3fa87)}.statGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.statBox{padding:9px;background:#112935;border:1px solid #2e5362;border-radius:9px;font-size:11px;color:#abcbd4}.statBox strong{color:#d4fffb;display:block;font-size:18px}
.missionCard{display:flex;flex-direction:column;justify-content:space-between;min-height:142px}.missionCard h3{margin-bottom:7px}.missionCard p{margin:0 0 10px}.missionCard button{align-self:flex-start}.perksCard{margin-bottom:10px}.perksCard>div{display:flex;align-items:center;justify-content:space-between;gap:10px}.perksCard h3{margin:0;font-size:15px}.perksCard p{margin:6px 0 0;font-size:12px;color:#a6c6ce}.gachaLayout{display:grid;grid-template-columns:1fr 1fr;gap:16px}.gachaBanner{border:1px solid #59a4a0;background:radial-gradient(circle at 50% 20%,#246c7b,#11283b 75%);border-radius:18px;padding:25px;text-align:center}.gachaOrb{font-size:88px;line-height:1.2;filter:drop-shadow(0 0 18px #41dbcc)}.rateRow{display:flex;align-items:center;gap:9px;font-size:12px;margin:10px 0}.rateTrack{height:8px;background:#173746;border-radius:20px;flex:1;overflow:hidden}.rateTrack i{display:block;height:100%;background:#4ac9c2}.resultBox{max-height:300px;overflow:auto;margin-top:15px}.gachaResult{padding:10px;border-bottom:1px solid #2e4f5c;color:#d3eaf0;font-size:12px}.gachaResult b{color:#a3fff1}
.starterGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:18px}.starterBtn{padding:23px 12px;min-height:190px;border-radius:15px;border:1px solid #4a6675;background:#133444;color:#effffb}.starterBtn .emoji{display:block;font-size:56px;margin-bottom:12px}.starterBtn b{font-size:19px;display:block}.starterBtn small{display:block;color:#a2c9d0;margin-top:7px}.starterBtn:hover{border-color:#67e6d9;background:#1b4d56}
.stageCard{min-height:138px}.stageCard.selected{border-color:#73dfc6;background:#1e4b50}.stageCard:disabled{opacity:.55;cursor:not-allowed}.stageCard .boss{font-size:12px;color:#fbc6a3}.playBar{position:sticky;bottom:-24px;background:#091b27f7;border-top:1px solid #396a76;padding:13px 3px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.hubToast{position:absolute;bottom:18px;left:50%;transform:translate(-50%,20px);opacity:0;transition:.2s;background:#123c47;color:#b5fff0;padding:10px 18px;border:1px solid #4dc2b8;border-radius:10px;pointer-events:none;font-size:12px;max-width:min(80vw,650px);text-align:center;z-index:18}.hubToast.show{opacity:1;transform:translate(-50%,0)}
#refreshActions{margin:12px 0 0;display:flex;justify-content:center;gap:9px;flex-wrap:wrap}#refreshActions .hubBtn{font-size:11px}.choice{position:relative}.refreshOne{position:absolute;top:8px;right:8px;border-radius:8px;padding:6px 8px;background:#31475c;color:#baf9ef;border:1px solid #658c98;z-index:2;font-size:10px;cursor:pointer}.refreshOne:disabled{opacity:.35}
@media(max-width:810px){.hubShell{height:100dvh;border-radius:0}.hubTop{height:auto;min-height:66px;padding:9px 12px;align-items:flex-start}.hubTopRight{justify-content:flex-end}.hubLogo b{font-size:18px}.hubLogo small{font-size:8px}.resPill{font-size:11px;padding:6px 7px}.hubBody{grid-template-columns:82px minmax(0,1fr)}.hubSide{padding:9px 4px}.trainerBox{padding:8px 3px}.trainerBox b,.trainerBox small{font-size:9px}.trainerPortrait{transform:scale(.72);height:61px;margin-top:-10px;margin-bottom:-8px}#hubNav button{text-align:center;font-size:20px;padding:7px 0}#hubNav button span{display:block;font-size:9px}.hubFoot{font-size:7px}.hubMain{padding:15px 11px}.hubGrid,.rosterGrid,.missionGrid,.stageGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.hubTile{padding:11px;min-height:122px}.hubTile strong{font-size:12px}.hubTile small{font-size:10px}.rosterCard,.stageCard,.dataCard,.missionCard{padding:11px}.hubHeading{font-size:22px}.hubSub{font-size:11px}.gachaLayout{grid-template-columns:1fr}.statGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.starterGrid{gap:6px}.starterBtn{padding:13px 5px;min-height:145px}.starterBtn .emoji{font-size:37px}.starterBtn b{font-size:13px}.starterBtn small{font-size:9px}.playBar{bottom:-15px}}
@media(max-width:470px){.hubLogo small{display:none}.hubLogo b{font-size:16px}.hubMark{font-size:18px;padding:5px 8px}.hubTopRight{gap:4px}.resPill{font-size:10px;padding:5px 6px}#soundBtn{min-width:31px;width:31px;height:31px;font-size:13px}.hubBody{grid-template-columns:69px minmax(0,1fr)}.trainerBox b{font-size:8px}#hubNav button{font-size:17px}#hubNav button span{font-size:8px}.rosterGrid,.stageGrid,.missionGrid{grid-template-columns:1fr}}


/* User-provided Agumon illustration, converted to a transparency-safe embedded PNG. */
.digiSprite{display:inline-block;object-fit:contain;vertical-align:middle;max-width:100%;filter:drop-shadow(0 5px 6px #0006);user-select:none;pointer-events:none}
.starterSprite{width:88px;height:104px;margin:0 auto 7px;display:block}
.rosterSprite{width:72px;height:82px;margin:0 0 7px;display:block}
.homeSprite{height:88px;width:75px;object-fit:contain;margin-right:12px}
.detailSprite{height:126px;width:100px;object-fit:contain;flex:0 0 auto}
.summonSprite{height:34px;width:28px;margin-right:6px}
.digiMateBanner{display:flex;align-items:center;gap:18px;background:radial-gradient(circle at 15% 30%,#386353,#153345 68%);border:1px solid #417c79;border-radius:13px;padding:12px 17px;margin-bottom:12px;min-height:135px}
.digiMateBanner strong{font-size:21px;color:#f4fff8}.digiMateBanner p{font-size:12px;margin:6px 0;color:#a8d2ce}
.artNotice{font-size:11px;color:#8edfd5;margin:9px 0 16px}
.gachaResult:has(.summonSprite){display:flex;align-items:center;gap:4px}
@media(max-width:810px){.starterSprite{width:60px;height:76px}.rosterSprite{height:71px;width:65px}.detailSprite{height:110px;width:88px}.homeSprite{height:73px;width:64px}}
@media(max-width:470px){.digiMateBanner{gap:8px;padding:9px}.digiMateBanner strong{font-size:16px}.digiMateBanner p{font-size:11px}}

  
    /* v0.2.2: Sprite previews and subtle CSS idle animations; preserve pixel edges. */
    .digiSprite{image-rendering:pixelated;transform-origin:50% 87%;will-change:transform;animation:digiBob 1.12s ease-in-out infinite}
    .digiSprite.motionBreath{animation:digiBreath 1.42s ease-in-out infinite}
    .digiSprite.motionSway{animation:digiSway 1.34s ease-in-out infinite}
    .digiSprite.motionHop{animation:digiHop 1.28s ease-in-out infinite}
    @keyframes digiBob{0%,100%{transform:translateY(1px) scale(1,1)}50%{transform:translateY(-5px) scale(1.028,.973)}}
    @keyframes digiBreath{0%,100%{transform:translateY(0px) scale(1,1)}50%{transform:translateY(-2px) scale(1.055,.955)}}
    @keyframes digiSway{0%,100%{transform:translateY(0) rotate(-3deg)}50%{transform:translateY(-3px) rotate(3deg)}}
    @keyframes digiHop{0%,100%{transform:translateY(0) scale(1)}44%{transform:translateY(-13px) scale(.96,1.04)}74%{transform:translateY(-3px) scale(1.05,.94)}}
    .digiGalleryHero{display:grid;grid-template-columns:minmax(180px,1.05fr) minmax(230px,1fr);gap:18px;background:linear-gradient(145deg,#194053,#102738);border:1px solid #4a8891;padding:15px;border-radius:18px;margin-bottom:18px}
    .digiGalleryStage{height:245px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;border-radius:14px;background:linear-gradient(180deg,#315f76,#397c8a 70%,#2d6958 70%,#1b463e)}
    .digiGalleryStage:before{content:'';position:absolute;inset:0;opacity:.3;background:linear-gradient(transparent 94%,#b5e7df88 96%) 0 0/20px 20px,linear-gradient(90deg,transparent 94%,#b5e7df88 96%) 0 0/20px 20px}
    .digiGalleryStageGround{position:absolute;bottom:24px;height:19px;width:155px;background:#082a34a9;filter:blur(6px);border-radius:50%}
    .galleryHeroSprite{width:min(90%,220px);height:210px;object-fit:contain;position:relative;z-index:2;filter:drop-shadow(0 13px 13px #051b26aa)}
    .digiGalleryInfo h3{margin:10px 0 7px;font-size:27px}.digiGalleryInfo p{font-size:13px;color:#b7d6e0;line-height:1.6}
    .digiGalleryGrid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.digiGalleryCard{min-width:0;border:1px solid #326575;border-radius:14px;padding:11px 6px;background:#142f40;color:#e8f8f5;display:flex;flex-direction:column;align-items:center;gap:3px}.digiGalleryCard:hover{border-color:#8cf2dc;background:#1b4253}.digiGalleryCard.selected{border:2px solid #78f6d5;background:#1b5662;padding:10px 5px}.digiGalleryCard b{font-size:13px}.digiGalleryCard span:not(.digiSprite){font-size:9px;color:#a3ccd2;line-height:1.4;text-align:center}.galleryThumb{width:100%;max-width:102px;height:105px;object-fit:contain;margin:2px auto 6px}
    @media(max-width:810px){.digiGalleryGrid{grid-template-columns:repeat(3,minmax(0,1fr))}.digiGalleryHero{grid-template-columns:1fr;gap:10px}.digiGalleryStage{height:200px}.galleryHeroSprite{height:175px}.digiGalleryInfo h3{font-size:22px}}
    @media(max-width:420px){.digiGalleryGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.digiGalleryCard{padding:7px 3px}.galleryThumb{height:92px}}
    @media(prefers-reduced-motion:reduce){.digiSprite{animation:none!important;will-change:auto}}

    /* v0.3.0 player-facing discovery silhouettes: no dev-only animation controls. */
    .digiGalleryCard.locked{background:#101c2c;border-color:#344055;color:#8795aa}
    .digiGalleryCard.locked:hover{background:#16273b;border-color:#687a96}
    .digiSprite.dexSilhouette{filter:brightness(0)!important;opacity:.74;animation:none!important}
    .digiGalleryHero .locked .digiGalleryStageGround{opacity:.35}
    .digiGalleryCard.locked b{letter-spacing:.12em;color:#b5c1d0}
    .digiGalleryStage.locked{background:linear-gradient(180deg,#1c2c45,#213953 70%,#20394a 70%,#192f42)}

    /* v0.3.1 six-stat and combat affinity panels */
    .statHead{display:flex;justify-content:space-between;align-items:baseline;gap:5px}
    .statHead b{color:#accfd7;font-size:12px}.statHead strong{font-size:19px;color:#ecfffc}
    .statMeter{height:5px;border-radius:9px;overflow:hidden;background:#203a48;margin:6px 0 5px}
    .statMeter i{height:100%;display:block;border-radius:9px}
    .statBox small{font-size:10px;color:#9fc4ca;line-height:1.45;display:block;min-height:29px}
    .mateStyle{font-size:12px!important;font-weight:800!important;color:#9de7d2!important}
    .mateExplanation{font-size:11px;color:#b2d0d7;background:#0c2633;border:1px solid #345662;border-radius:10px;margin-top:12px;padding:10px;line-height:1.55}
    .typeGuide{margin-top:13px;background:linear-gradient(120deg,#103343,#12263b);border:1px solid #397989;border-radius:14px;padding:15px;color:#d6f4f0}
    .typeGuideTitle{font-size:14px;font-weight:900;line-height:1.7;margin-bottom:11px}
    .typeGuideLines{display:grid;grid-template-columns:1fr 1fr;gap:8px}
    .typeGuideLines>div{display:flex;flex-direction:column;gap:5px;padding:10px;border:1px solid #2c5461;background:#0b2735;border-radius:9px;line-height:1.4}
    .typeGuideLines b{font-size:12px;color:#9bead8}.typeGuideLines span{font-size:11px;color:#c9dce3}
    .typeGuide p{margin:12px 0 0;color:#94bfc6;font-size:10px;line-height:1.55}
    @media(max-width:670px){.typeGuideLines{grid-template-columns:1fr}}
  
  /* v0.3.3: evolution card and multi-tier Dex */
  .evoOptionCard{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
  .evoSprite{font-size:45px!important;display:inline-block;min-width:55px;min-height:55px;line-height:1.2}
  .evoOptionCard h3{margin:2px 0 1px;font-size:17px}
  .evoOptionCard p{font-size:12px}
  .evoOptionCard button{margin-top:6px}
  .digiGalleryCard .emoji.dexSilhouette,.digiGalleryStage .emoji.dexSilhouette{color:#02090e!important;filter:brightness(0)!important;text-shadow:0 0 10px #294e5a55}
  .digiGalleryCard.locked{background:#10212c}
  .digiGalleryCard .emoji.galleryThumb{font-size:36px}
  .digiGalleryHero .emoji.galleryHeroSprite{font-size:90px;line-height:1.4}
  @media(max-width:700px){.evoOptionCard{padding:11px}.evoOptionCard h3{font-size:15px}.evoOptionCard p{font-size:11px}}


/* v0.3.3g — readable five-tier quality cards */
.choiceWrap{border-radius:15px;transition:filter .16s}
.choiceWrap .choice{border:2px solid var(--rare-border,#c2d0df)!important;background:linear-gradient(145deg,var(--rare-bg,#172d3a),#0b1b2b)!important;box-shadow:inset 0 1px 0 #ffffff22,0 4px 14px #06132444;min-height:235px;transition:transform .13s,box-shadow .13s}
.choiceWrap .choice:hover{transform:translateY(-3px);box-shadow:0 0 20px var(--rare-glow,#dce6ed44),inset 0 1px 0 #ffffff33}
.qualityRibbon{display:block;margin:0 auto 9px;padding:5px 13px;border:1px solid var(--rare-border);border-radius:999px;background:var(--rare-glow);font-size:13px;line-height:1.4;font-weight:950;letter-spacing:1.4px;color:var(--rare-text,#f5faff);width:max-content;max-width:90%}
.qualityBonus{display:block;border-top:1px solid #ffffff25;margin:9px 0 2px;padding-top:7px;color:var(--rare-text);font-size:12px;font-weight:800}
.choiceWrap.quality-common{--rare-border:#9dacbe;--rare-bg:#233343;--rare-glow:#dde5f01e;--rare-text:#f8fcff}
.choiceWrap.quality-uncommon{--rare-border:#5ed08f;--rare-bg:#174b3a;--rare-glow:#3beb8a23;--rare-text:#a4ffc9}
.choiceWrap.quality-rare{--rare-border:#4a9de9;--rare-bg:#183a66;--rare-glow:#2b8cff38;--rare-text:#aadfff}
.choiceWrap.quality-epic{--rare-border:#b97bff;--rare-bg:#402860;--rare-glow:#b25cff40;--rare-text:#ead1ff}
.choiceWrap.quality-legendary{--rare-border:#ffa84d;--rare-bg:#61401a;--rare-glow:#ff9d2f50;--rare-text:#ffe19d}
.quality-legendary .choice{animation:qualityPulse 2.6s ease-in-out infinite}
@keyframes qualityPulse{50%{box-shadow:0 0 22px #ff9a3b66,inset 0 1px 0 #ffffff40}}
@media(max-width:620px){.choiceWrap .choice{min-height:200px}.qualityRibbon{font-size:11px;padding:4px 8px}.qualityBonus{font-size:10px}}

/* v0.3.3g – original collectible-card aesthetic inspired by digimon-style decks.
   Entirely CSS composition: no outside files, no external copyrighted trading-card frames. */
#levelOverlay{background:radial-gradient(ellipse at 50% 35%,rgba(23,55,90,.82),rgba(4,8,20,.93) 69%);backdrop-filter:blur(8px)}
#levelPanel{width:min(1060px,100%);max-width:1060px;border-radius:22px;background:radial-gradient(ellipse at 50% -15%,#234e74 0,transparent 56%),linear-gradient(143deg,#0a1a32,#050a1b 80%);border:1px solid #89bfe4a6;box-shadow:0 45px 120px #030714d9,inset 0 0 65px #4f91bb1a;padding:clamp(14px,3vw,27px)}
#levelPanel:before{height:4px;background:linear-gradient(90deg,#ffbb59,#cfe5ff,#96f7ff,#ffbb59)}
.tcgHeadingChip{font-size:10px;letter-spacing:.34em;color:#8ceae3;font-weight:1000;text-shadow:0 0 15px #56f9da99}
#levelPanel .tcgHeading{color:#f7f8ff;text-align:center;font-size:clamp(24px,4vw,38px);margin:5px 0 0;text-shadow:0 4px 0 #253852,0 0 20px #6addff55;letter-spacing:.11em}
.tcgSubhead{color:#b1d4e8;font-size:12px;margin:5px 0 0;letter-spacing:.03em}
#levelPanel .choiceGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(8px,1.6vw,17px);margin:18px auto 12px;max-width:960px;align-items:stretch}
#levelPanel .choiceWrap{--card-accent:#7de4ef;--card-ink:#8cb6d9;min-width:0;position:relative;border-radius:17px;padding:4px;background:linear-gradient(140deg,#d0e5f2 0%,var(--rare-border) 24%,#213b59 57%,var(--rare-border) 86%,#e2f4ff 100%);box-shadow:0 4px 0 #061326,0 14px 26px #010819aa,0 0 18px var(--rare-glow);transition:transform .18s,box-shadow .18s;isolation:isolate}
#levelPanel .choiceWrap:hover{transform:translateY(-7px) scale(1.012);z-index:3;box-shadow:0 5px 0 #061326,0 23px 40px #010819e8,0 0 32px var(--rare-glow)}
#levelPanel .choiceWrap:focus-within{outline:2px solid #fbefc5;outline-offset:4px;z-index:2}
#levelPanel .choiceWrap .choice{position:relative;width:100%;height:100%;border:1px solid #101e34!important;border-radius:13px;text-align:left;padding:0!important;color:#f2faff!important;background:#0c1729!important;min-height:354px;display:flex;flex-direction:column;overflow:hidden;box-shadow:inset 0 0 0 1px #b4d4e94d!important;transition:none;animation:none!important}
#levelPanel .choiceWrap .choice:hover{transform:none;box-shadow:inset 0 0 0 1px #d1ebff88!important}
#levelPanel .choice .tcgTop{height:38px;display:flex;align-items:center;gap:8px;padding:4px 10px;background:linear-gradient(90deg,#e6e7e4 0%,#9bb7c7 45%,#546f88 100%);color:#182739;border-bottom:2px solid #172d42;flex:0 0 auto}
#levelPanel .tcgNumber{height:29px;width:29px;flex:0 0 29px;display:grid;place-items:center;border-radius:50%;border:3px solid #eef6f9;background:linear-gradient(160deg,#204467,#07182e);color:#fff;font-size:17px;font-weight:1000;box-shadow:0 1px 0 #142a3b,0 0 0 2px #1b395c}
#levelPanel .tcgType{font-size:10px;line-height:1.05;font-weight:1000;letter-spacing:.04em;min-width:0;flex:1}
#levelPanel .tcgType .typeMinor{display:block;color:#163146;opacity:.78;font-size:9px;letter-spacing:.08em;margin-top:1px}
#levelPanel .tcgType .typeMajor{display:block;font-size:11px;font-weight:1000}
#levelPanel .tcgTopLevel{font-size:12px;font-weight:1000;white-space:nowrap;border:1px solid #2b4860;border-radius:6px;padding:4px;background:#d9f4f6af}
#levelPanel .tcgVisual{position:relative;isolation:isolate;height:165px;overflow:hidden;background:radial-gradient(circle at 52% 60%,var(--card-accent) 0,transparent 44%),linear-gradient(135deg,#26485a,#102239 65%,#050c19)}
#levelPanel .tcgVisual:before{content:'';position:absolute;inset:-60%;z-index:-1;background:repeating-conic-gradient(from 9deg at 50% 58%,#ffffff21 0 8deg,transparent 8deg 21deg);opacity:.48;transform:rotate(14deg)}
#levelPanel .tcgVisual:after{content:'';position:absolute;inset:0;pointer-events:none;border-bottom:3px solid var(--rare-border);background:linear-gradient(180deg,transparent 68%,#061022dd)}
#levelPanel .tcgSeal{position:absolute;width:160px;height:160px;border:2px solid #ffffff45;border-radius:50%;left:calc(50% - 80px);top:3px;box-shadow:0 0 0 10px #ffffff14,0 0 0 25px #ffffff0b,inset 0 0 18px #ecfcff40;transform:rotate(22deg)}
#levelPanel .tcgSeal:before,#levelPanel .tcgSeal:after{content:'';position:absolute;inset:20px;border:2px dashed #ffffff60;border-radius:50%}
#levelPanel .tcgSeal:after{inset:40px;border-style:solid;opacity:.55}
#levelPanel .tcgCreature{position:absolute;right:-6px;bottom:-9px;width:73%;height:100%;display:grid;place-items:end center;filter:drop-shadow(0 7px 2px #030d16e0) drop-shadow(0 0 11px var(--card-accent));z-index:1}
#levelPanel .tcgCreature img{display:block;height:93%;width:100%;object-fit:contain;object-position:center bottom;image-rendering:pixelated}
#levelPanel .tcgGlyph{position:absolute;z-index:2;left:11px;bottom:10px;font-size:40px;line-height:1;filter:drop-shadow(0 4px 2px #10192b) drop-shadow(0 0 8px #fffa);text-shadow:0 0 15px var(--card-accent)}
#levelPanel .tcgVisualLabel{position:absolute;left:12px;top:8px;z-index:2;border-radius:4px;background:#071627c9;border:1px solid #b5d6e27a;color:#ebfbff;font-size:10px;font-weight:900;padding:4px 8px;letter-spacing:.08em}
#levelPanel .tcgBody{display:flex;flex:1;flex-direction:column;padding:10px 12px 12px;background:linear-gradient(164deg,#1b3347 0,#102439 47%,#0b1a2e 100%)}
#levelPanel .tcgNameRow{display:flex;align-items:center;gap:7px;min-width:0}
#levelPanel .tcgSkillName{font-size:clamp(15px,1.5vw,19px);font-weight:1000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#ffffff;text-shadow:0 2px 3px #020814}
#levelPanel .tcgElementChip{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:1000;border-radius:999px;padding:4px 8px;background:#0a1628ce;border:1px solid #47637d;color:#eaf7ff;white-space:nowrap}
#levelPanel .tcgRarity{font-size:10px;font-weight:1000;color:var(--rare-text);background:var(--rare-glow);border:1px solid var(--rare-border);border-radius:6px;padding:4px 6px;white-space:nowrap;flex:0 0 auto}
#levelPanel .tcgSkillDesc{font-size:11px!important;color:#c4d9e6!important;margin:7px 0 8px!important;line-height:1.47!important;min-height:30px}
#levelPanel .tcgBonus{display:block;border:1px solid var(--rare-border);background:linear-gradient(90deg,var(--rare-glow),#07101f);padding:7px;border-radius:7px;color:var(--rare-text);font-size:11px;font-weight:900;line-height:1.45;margin-top:auto}
#levelPanel .tcgBottom{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-top:8px;color:#aacbd8;font-size:10px;font-weight:950}
#levelPanel .tcgSelect{font-size:11px;color:#fceacb;background:#46587788;padding:4px 9px;border-radius:8px}
#levelPanel .choiceWrap.quality-legendary{background:linear-gradient(145deg,#fff0bc,#ffb85d,#d67829,#fff1a3);box-shadow:0 0 30px #f6b85e70,0 14px 31px #010819b8}
#levelPanel .quality-legendary .tcgVisual{background:radial-gradient(circle at 55% 55%,#f7bd4ca6,transparent 50%),linear-gradient(135deg,#8a4328,#392038 77%)}
#levelPanel .quality-epic .tcgVisual{background:radial-gradient(circle at 55% 55%,#b971f899,transparent 48%),linear-gradient(135deg,#59306e,#15203e 77%)}
#levelPanel .quality-rare .tcgVisual{background:radial-gradient(circle at 55% 55%,#58b4f899,transparent 48%),linear-gradient(135deg,#195a79,#112542 77%)}
#levelPanel .quality-uncommon .tcgVisual{background:radial-gradient(circle at 55% 55%,#5bedab88,transparent 47%),linear-gradient(135deg,#215d53,#142f40 77%)}
#levelPanel .choiceWrap .refreshOne{position:absolute;right:9px;top:46px;z-index:9;background:#06162bdf;border:1px solid #b6e8ff99;color:#eaffff;border-radius:8px;font-size:11px;padding:5px 7px}
#levelPanel #refreshActions{display:flex;justify-content:center;margin:10px auto}
#levelPanel #refreshActions button{font-size:11px!important;padding:7px 16px!important;border-radius:9px!important}
@media(max-width:760px){#levelOverlay{padding:7px;align-items:center}#levelPanel{width:100%;max-height:96dvh;padding:14px 10px}#levelPanel .choiceGrid{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:thin;scrollbar-color:#91b8d9 #102036;padding:8px 6px 12px;margin:9px 0}#levelPanel .choiceWrap{flex:0 0 min(72vw,250px);scroll-snap-align:center}#levelPanel .choiceWrap .choice{min-height:342px}#levelPanel .tcgVisual{height:145px}#levelPanel .tcgSubhead{font-size:10px}#levelPanel .tcgHeading{font-size:25px}}
@media(max-height:570px){#levelPanel .choiceWrap .choice{min-height:270px}#levelPanel .tcgVisual{height:110px}#levelPanel .tcgSkillDesc{min-height:0;margin:5px 0}#levelPanel .tcgBody{padding:6px 8px}#levelPanel .choiceGrid{margin:6px auto}}
@media(prefers-reduced-motion:reduce){#levelPanel .choiceWrap:hover{transform:none}}


/* v0.3.3g: slim card picker; leave the map visible. Art occupies ~half of prior height. */
#levelOverlay{background:rgba(4,11,25,.37)!important;backdrop-filter:blur(1.8px)!important}
#levelPanel{width:min(755px,94vw)!important;max-width:755px!important;padding:13px 15px!important;max-height:83dvh;overflow-y:auto;border-radius:16px!important;background:linear-gradient(150deg,#0c2039ee,#071325eb)!important;box-shadow:0 20px 50px #01071299!important}
#levelPanel .tcgHeading{font-size:clamp(19px,2.5vw,27px)!important;margin-top:0!important}
#levelPanel .tcgHeadingChip{font-size:9px!important}
#levelPanel .tcgSubhead{font-size:11px!important;margin:2px 0!important}
#levelPanel .choiceGrid{max-width:705px!important;gap:10px!important;margin:9px auto 7px!important}
#levelPanel .choiceWrap{border-radius:12px!important;padding:3px!important}
#levelPanel .choiceWrap .choice{min-height:260px!important;border-radius:9px!important}
#levelPanel .choice .tcgTop{height:31px!important;padding:3px 7px!important;gap:5px!important}
#levelPanel .tcgNumber{height:24px!important;width:24px!important;flex-basis:24px!important;font-size:13px!important}
#levelPanel .tcgType{font-size:10px!important}
#levelPanel .tcgTopLevel{font-size:10px!important;padding:3px!important}
#levelPanel .tcgVisual{height:80px!important}
#levelPanel .tcgSeal{width:100px!important;height:100px!important;left:calc(50% - 50px)!important;top:-8px!important}
#levelPanel .tcgCreature{width:50%!important;height:90%!important;right:8px!important;bottom:0!important}
#levelPanel .tcgCreature img{height:96%!important;object-fit:contain!important}
#levelPanel .tcgGlyph{font-size:28px!important;bottom:8px!important}
#levelPanel .tcgVisualLabel{font-size:9px!important;top:5px!important;padding:3px 6px!important}
#levelPanel .tcgBody{padding:8px 9px 9px!important}
#levelPanel .tcgSkillName{font-size:16px!important;white-space:normal!important;line-height:1.13!important;overflow:visible!important}
#levelPanel .tcgRarity{font-size:15px!important;padding:4px 7px!important;border-radius:6px!important;box-shadow:0 0 10px var(--rare-glow)!important}
#levelPanel .tcgSkillDesc{font-size:13px!important;line-height:1.36!important;margin:6px 0!important;min-height:33px!important}
#levelPanel .tcgBonus{font-size:13px!important;line-height:1.35!important;padding:6px 7px!important}
#levelPanel .tcgBottom{margin-top:5px!important;font-size:9px!important}
#levelPanel #refreshActions{margin:6px auto 0!important}
#levelPanel #refreshActions button{padding:6px 10px!important}
#levelPanel .choiceWrap .refreshOne{top:34px!important;padding:4px!important;font-size:9px!important}
@media(max-width:760px){
  #levelPanel{width:95vw!important;padding:10px 8px!important;max-height:88dvh!important}
  #levelPanel .choiceGrid{gap:8px!important;margin:6px 0!important;padding:5px 4px 8px!important}
  #levelPanel .choiceWrap{flex:0 0 min(67vw,218px)!important}
  #levelPanel .choiceWrap .choice{min-height:262px!important}
  #levelPanel .tcgVisual{height:74px!important}
  #levelPanel .tcgSkillDesc{font-size:12px!important}
  #levelPanel .tcgRarity{font-size:14px!important}
}
@media(max-height:560px){#levelPanel .tcgVisual{height:58px!important}#levelPanel .choiceWrap .choice{min-height:231px!important}}

/* v0.3.3i: attack cards show partner art; passive cards show a dedicated circuit chip. */
#levelPanel .passiveCard .tcgVisual{background:radial-gradient(ellipse at 50% 50%,#ffe6a828,transparent 62%),linear-gradient(120deg,#1b3043,#122b3e 56%,#092032)}
#levelPanel .passiveCard .tcgSeal{border-color:#f2cf7b66;box-shadow:0 0 0 10px #ffe2a310,0 0 0 22px #ffe2a307}
#levelPanel .tcgPassiveVisual{display:flex;align-items:center;justify-content:center}
#levelPanel .tcgChip{position:absolute;z-index:2;left:50%;top:50%;transform:translate(-50%,-40%) rotate(-5deg);width:68px;height:55px;border:2px solid #ffe8ae;border-radius:13px;background:linear-gradient(140deg,#b67d41,#6c4e2a 29%,#30445c 29%,#12253b 70%,#6e9cb7 100%);box-shadow:0 2px 0 #241a1b,0 0 0 5px #ffd17717,0 0 27px #ffc76167,inset 0 0 12px #0009}
#levelPanel .tcgChip:before,#levelPanel .tcgChip:after{content:'';position:absolute;left:-12px;right:-12px;height:6px;background:repeating-linear-gradient(90deg,transparent 0 9px,#efdb9b 9px 15px,transparent 15px 22px);border-radius:4px}
#levelPanel .tcgChip:before{top:7px}#levelPanel .tcgChip:after{bottom:7px}
#levelPanel .tcgChipFace{position:absolute;inset:6px 7px;display:grid;place-items:center;background:radial-gradient(circle,#0f4163 15%,#081524 95%);border:1px solid #9edcf1;border-radius:7px;font-size:29px;line-height:1;text-shadow:0 0 11px #ffeeb7}
#levelPanel .tcgChipTag{position:absolute;right:9px;bottom:6px;font-size:10px;letter-spacing:.11em;color:#f3e2b6;font-weight:1000;text-shadow:0 1px 3px #08101b}
#levelPanel .passiveCard .tcgSkillName{color:#ffd59a!important}
.mobileChoiceNav{display:none}
@media(max-width:760px){
  #levelOverlay{padding:7px!important}
  #levelPanel{width:min(94vw,470px)!important;max-width:470px!important;max-height:min(76dvh,620px)!important;padding:13px 12px!important;overflow-y:auto!important}
  #levelPanel .tcgHeading{font-size:21px!important}
  #levelPanel .tcgSubhead{font-size:11px!important;line-height:1.5!important;margin:5px 0!important}
  #mobileChoiceNav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:9px 0 3px}
  #mobileChoiceNav .mobileChoiceTab{display:flex;flex-direction:column;gap:3px;align-items:center;min-width:0;padding:7px 3px;border-radius:10px;border:1px solid #54738b;color:#dceaf8;background:#102239;box-shadow:inset 0 1px 0 #ffffff12}
  #mobileChoiceNav .mobileChoiceTab.active{background:#1c3551;border-color:var(--tab-color);box-shadow:0 0 12px #74c1ea28,inset 0 2px 0 var(--tab-color)}
  #mobileChoiceNav .mobileChoiceTab span{font-size:10px;line-height:1;font-weight:1000;background:var(--tab-color);color:#0e2134;border-radius:50%;width:17px;height:17px;display:grid;place-items:center}
  #mobileChoiceNav .mobileChoiceTab b{font-size:10px;line-height:1.2;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%}
  #mobileChoiceNav .mobileChoiceTab small{font-size:10px;color:var(--tab-color);font-weight:900}
  #levelPanel .choiceGrid{width:100%!important;max-width:none!important;display:flex!important;align-items:stretch;gap:8px!important;overflow-x:auto!important;scroll-snap-type:x mandatory!important;scrollbar-width:none;padding:5px 1px 9px!important;margin:4px 0 2px!important}
  #levelPanel .choiceGrid::-webkit-scrollbar{display:none}
  #levelPanel .choiceWrap{flex:0 0 calc(100% - 2px)!important;min-width:0!important;scroll-snap-align:start!important}
  #levelPanel .choiceWrap .choice{min-height:252px!important}
  #levelPanel .tcgVisual{height:80px!important}
  #levelPanel .tcgSkillName{font-size:18px!important}
  #levelPanel .tcgSkillDesc{font-size:13px!important;min-height:26px!important}
  #levelPanel .tcgBonus{font-size:13px!important;line-height:1.3!important}
  #levelPanel .tcgChip{width:73px;height:58px}
  #levelPanel .tcgChipFace{font-size:29px}
  #levelPanel .tcgRarity{font-size:15px!important}
  #levelPanel .tcgNameRow{gap:6px!important;flex-wrap:wrap}
  #levelPanel .tcgElementChip{font-size:9px!important}
  #levelPanel #refreshActions{margin:3px auto 0!important}
  #levelPanel .tcgTopLevel{font-size:11px!important}
}
@media(max-width:375px){#levelPanel .tcgSkillName{font-size:16px!important}#levelPanel .tcgElementChip{display:none}#levelPanel .tcgBonus{font-size:12px!important}}
@media(max-height:600px) and (max-width:760px){#levelPanel{max-height:89dvh!important}#levelPanel .tcgVisual{height:62px!important}#levelPanel .choiceWrap .choice{min-height:236px!important}}

/* v0.3.3k.2: 3.5s Devimon blood-moon entrance; audio keeps playing independently. */
#bossIntroOverlay{position:absolute;inset:0;z-index:23;display:none;align-items:center;justify-content:center;pointer-events:none;background:radial-gradient(ellipse at center,rgba(37,3,26,.24),rgba(5,0,10,.66));overflow:hidden}
#bossIntroOverlay.show{display:flex}
#bossIntroOverlay::before{content:'';position:absolute;inset:0;background:rgba(255,19,55,.09);animation:bossIntroVeil .42s ease-in-out infinite alternate}
#bossIntroArt{position:relative;width:min(83vw,900px);max-height:35vh;object-fit:contain;filter:drop-shadow(0 0 22px #f7235895);animation:bossIntroReveal 3.5s ease-out both,bossIntroGlow .29s ease-in-out infinite alternate}
#bossIntroOverlay .bossIntroEdge{position:absolute;inset:0;border:3px solid rgba(255,49,98,.25);box-shadow:inset 0 0 100px rgba(222,34,65,.18);animation:bossIntroVeil .40s ease-in-out infinite alternate}
/* Stage 3 Gatomon shares the 3.5-second boss presentation with gold/orange trim. */
#bossIntroOverlay.gatomonIntro{background:radial-gradient(ellipse at center,rgba(65,35,10,.34),rgba(8,5,20,.80))}
#bossIntroOverlay.gatomonIntro::before{background:rgba(244,171,65,.09)}
#bossIntroOverlay.gatomonIntro .bossIntroEdge{border-color:rgba(255,171,49,.37);box-shadow:inset 0 0 100px rgba(221,143,35,.20)}
#bossIntroOverlay.gatomonIntro.missingGatomonArt #bossIntroArt{visibility:hidden}
#bossIntroOverlay.gatomonIntro.missingGatomonArt::after{content:'迪路獸 登場';position:absolute;font:bold clamp(27px,5vw,66px) system-ui,sans-serif;color:#ffe2a4;text-shadow:0 3px 5px #260b1c,0 0 22px #e9a43c}

@keyframes bossIntroVeil{from{opacity:.25}to{opacity:.86}}
@keyframes bossIntroGlow{from{filter:drop-shadow(0 0 10px #ee305a65) brightness(.98)}to{filter:drop-shadow(0 0 35px #f91f7bb0) brightness(1.17)}}
@keyframes bossIntroReveal{0%{opacity:0;transform:scale(.87)}13%{opacity:1;transform:scale(1.035)}22%{transform:scale(1)}82%{opacity:1}100%{opacity:0;transform:scale(1.035)}}
@media(max-width:680px){#bossIntroArt{width:93vw;max-height:30vh}}
@media(prefers-reduced-motion:reduce){#bossIntroArt{animation:none;opacity:1;transform:none}#bossIntroOverlay::before,#bossIntroOverlay .bossIntroEdge{animation:none}}

/* v0.3.3k.16: 10 mates/page; compact, responsive roster only (not evolution options). */
.mateRosterToolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:14px 0 10px;padding:11px 12px;background:#102e3b;border:1px solid #346170;border-radius:13px}
.mateRosterToolbar label{display:flex;align-items:center;gap:8px;color:#bfdfde;font-size:12px;font-weight:850;flex-wrap:wrap}
.mateRosterToolbar select{background:#173c4c;border:1px solid #4f8d91;border-radius:9px;color:#e5fffb;padding:8px 10px;max-width:100%;font:inherit;font-size:12px;font-weight:800;min-height:36px}
.mateRosterToolbar select:focus-visible{outline:2px solid #8cebd4;outline-offset:2px}
.mateRosterMeta{color:#a8cad2;font-size:11px;font-weight:750}
.rosterGrid.mateRosterGrid{grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
.mateRosterGrid .rosterCard{min-width:0;padding:11px 9px}
.mateRosterGrid .rosterCard b{font-size:12px;line-height:1.5;overflow-wrap:anywhere;margin-bottom:5px}
.mateRosterGrid .rosterCard small{font-size:10px;overflow-wrap:anywhere}
.mateRosterGrid .rosterSprite{width:60px;height:68px}
.mateRosterGrid .miniTag{font-size:9px;padding:3px 5px;margin:2px 2px 2px 0}
.mateRosterPager{display:flex;align-items:center;justify-content:center;gap:9px;flex-wrap:wrap;margin:13px 0 16px}
.mateRosterPager .hubBtn{padding:8px 14px;min-height:36px}
.mateRosterPager .pageLabel{font-size:12px;color:#c4e6e2;min-width:90px;text-align:center;font-weight:850}
@media(max-width:1100px){.rosterGrid.mateRosterGrid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:810px){.rosterGrid.mateRosterGrid{grid-template-columns:repeat(3,minmax(0,1fr))}.mateRosterToolbar{padding:9px}}
@media(max-width:530px){.rosterGrid.mateRosterGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.mateRosterGrid .rosterCard{padding:9px 7px}.mateRosterToolbar{align-items:flex-start;flex-direction:column}.mateRosterToolbar label{width:100%;justify-content:space-between}.mateRosterToolbar select{flex:1;min-width:0}.mateRosterPager{gap:5px}.mateRosterPager .hubBtn{padding:8px 10px}}

/* v0.3.3k.18 — Digital Street: standalone offline visual hub; menus keep existing game logic. */
#townOverlay{position:absolute;inset:0;display:none;z-index:10;padding:0;overflow:hidden;background:#162e36;backdrop-filter:none;user-select:none;-webkit-user-select:none}
#townOverlay.show{display:block}
#townCanvas{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;touch-action:none;display:block}
#townOverlay:after{content:"";pointer-events:none;position:absolute;inset:0;background:linear-gradient(90deg,#0a132966,transparent 15%,transparent 85%,#08142c66),linear-gradient(0deg,#07142455,transparent 20%,transparent 85%,#07142433)}
#townTop{position:absolute;z-index:3;left:16px;right:16px;top:calc(11px + env(safe-area-inset-top));display:flex;justify-content:space-between;gap:12px;align-items:flex-start;pointer-events:none}
.townIdentity{background:#0b203de5;border:1px solid #62c5b9aa;border-radius:15px;padding:9px 14px;box-shadow:0 3px 14px #0008;backdrop-filter:blur(6px)}
.townIdentity strong{display:block;font-size:clamp(14px,1.6vw,20px);color:#f4fff5;letter-spacing:.08em}.townIdentity small{display:block;color:#a3eadd;font-weight:750;font-size:10px;margin-top:3px}
.townOnline{font-size:11px;font-weight:900;color:#dceff9;background:#102d46e5;border:1px solid #5385a6bd;border-radius:12px;padding:10px 13px;text-align:right;box-shadow:0 3px 10px #0007}
#townOverlay .townDock{position:absolute;z-index:4;top:24%;display:flex;flex-direction:column;gap:10px;max-height:60%;overflow-y:auto;scrollbar-width:none}
#townOverlay .townDock::-webkit-scrollbar{display:none}
#townLeftDock{left:clamp(10px,1.7vw,26px)}#townRightDock{right:clamp(10px,1.7vw,26px)}
.townDock button{width:clamp(119px,13vw,172px);min-height:52px;background:linear-gradient(145deg,#122c43eb,#092035ed);border:1px solid #5a99a9b8;box-shadow:0 4px 13px #061220b0, inset 0 1px #ffffff22;color:#e5f8ff;border-radius:13px;padding:8px 11px;display:flex;align-items:center;gap:11px;font-weight:900;font-size:12px;text-align:left;transition:background .16s,transform .16s}
.townDock button:hover,.townDock button:focus-visible{transform:translateY(-2px);background:#235468f5;border-color:#9dffe2}
.townDock button .townIco{font-size:22px;flex:0 0 27px;text-align:center;text-shadow:0 3px #0008}
.townDock button.townQuest{background:linear-gradient(120deg,#1a5e57e8,#124363ed);border:1px solid #94ecbd;color:#f4ffeb}
.townDock button small{display:block;font-size:9px;font-weight:750;color:#aad1dc;margin-top:2px}
#townBottom{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(15px + env(safe-area-inset-bottom));z-index:4;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:9px;pointer-events:none;max-width:80vw}
.townHint{padding:8px 13px;font-size:11px;font-weight:800;color:#e3f3ef;background:#122a3fdc;border:1px solid #6d9faa8f;border-radius:999px;text-align:center;box-shadow:0 3px 12px #0009}
#townJoy{position:absolute;z-index:5;bottom:calc(28px + env(safe-area-inset-bottom));left:20px;width:108px;height:108px;border-radius:50%;background:#203c5388;border:2px solid #b2e9e38c;display:none;touch-action:none;box-shadow:inset 0 0 25px #73d7dd1f,0 4px 13px #0008}
#townJoyHandle{position:absolute;left:32px;top:32px;width:40px;height:40px;border-radius:50%;background:linear-gradient(140deg,#b5f9ebaa,#389eabbf);border:2px solid #dcfff4;box-shadow:0 0 15px #5ceec766}
#townMenuBack{background:#1b5062;color:#eaffff;border:1px solid #7ae9d8;border-radius:11px;min-width:98px;min-height:40px;font-size:12px;font-weight:950;padding:8px 14px;cursor:pointer;white-space:nowrap}
#menuOverlay{z-index:11}#starterOverlay{z-index:12}
@media(max-width:700px){
  #townTop{left:7px;right:7px;top:calc(5px + env(safe-area-inset-top));gap:4px}.townIdentity{padding:6px 8px;border-radius:10px}.townIdentity strong{font-size:13px}.townIdentity small{font-size:8px}.townOnline{padding:6px 7px;font-size:8px;border-radius:9px;max-width:45%}
  #townOverlay .townDock{top:21%;gap:5px;max-height:57%}
  #townLeftDock{left:5px}#townRightDock{right:5px}
  .townDock button{width:86px;min-height:39px;padding:4px 5px;gap:3px;font-size:10px;border-radius:9px;box-shadow:0 2px 7px #0007}
  .townDock button .townIco{font-size:15px;flex:0 0 19px}.townDock button small{display:none}
  #townBottom{bottom:calc(6px + env(safe-area-inset-bottom));max-width:73vw}.townHint{font-size:9px;padding:5px 8px}
  #townJoy{display:block;bottom:calc(13px + env(safe-area-inset-bottom));left:9px;width:89px;height:89px}#townJoyHandle{left:26px;top:26px;width:33px;height:33px}
  #townMenuBack{min-width:76px;padding:7px;font-size:11px}
}
@media(max-height:530px){#townOverlay .townDock{top:18%;gap:4px;max-height:67%}.townDock button{min-height:36px}.townHint{display:none}}


/* v0.3.3k.22 — context windows over the live Digital Street. */
#menuOverlay{
  z-index:11;
  padding:clamp(16px,2.3vh,30px) clamp(14px,2.7vw,45px);
  align-items:center;justify-content:center;
  background:rgba(4,13,28,.34)!important;
  backdrop-filter:blur(1.1px)!important;
  -webkit-backdrop-filter:blur(1.1px)!important;
  overscroll-behavior:contain;
}
#menuOverlay .hubShell{
  width:min(1150px,83vw);height:min(87dvh,850px);
  min-width:0;min-height:0;max-width:100%;max-height:100%;
  margin:auto;flex-shrink:1;
  border:1px solid #7ab6c5;border-radius:22px;
  box-shadow:0 24px 85px #000b,0 0 0 1px #d1f8e52a,inset 0 1px #ffffff17;
  background:linear-gradient(138deg,#0e3040f7,#081829fa 80%);
  overflow:hidden;
}
#menuOverlay[data-panel-size="compact"] .hubShell{width:min(885px,76vw);height:min(80dvh,750px)}
#menuOverlay .hubTop{min-height:66px;padding:12px 19px;flex:0 0 auto}
#menuOverlay .hubLogo{min-width:0}
#menuOverlay .hubLogo b{font-size:19px}
#menuOverlay .hubTopRight{min-width:0}
#menuOverlay .hubBody{min-height:0;flex:1;overflow:hidden}
#menuOverlay .hubSide{scrollbar-width:thin;scrollbar-color:#4c8793 transparent}
#menuOverlay .hubMain{scrollbar-width:thin;scrollbar-color:#4c8793 #102c3a;overscroll-behavior:contain}
#menuOverlay #townMenuBack{min-width:77px;min-height:36px;border-radius:10px;border:1px solid #8de9d6;background:linear-gradient(140deg,#20596a,#14394e);color:#eafffb;padding:7px 12px;font-weight:950}
#menuOverlay #townMenuBack:hover{background:#286e78}
#menuOverlay #townMenuBack:focus-visible{outline:2px solid #ffffff;outline-offset:3px}
#menuOverlay .townSheetGrip{display:none}
#menuOverlay .hubLogo:after{display:none;content:attr(data-panel-title)}
@media(max-width:810px){
  #menuOverlay{align-items:flex-end;justify-content:center;padding:0;background:rgba(6,17,30,.25)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  #menuOverlay .hubShell,#menuOverlay[data-panel-size="compact"] .hubShell{
    width:100vw;max-width:100vw;height:89dvh;max-height:89dvh;
    margin:0;border-radius:21px 21px 0 0;border-bottom:0;
    box-shadow:0 -13px 46px #000a,0 -2px 0 #a1e9d15c;
  }
  #menuOverlay .townSheetGrip{display:flex;justify-content:center;align-items:center;height:16px;flex:0 0 16px;pointer-events:none}
  #menuOverlay .townSheetGrip:after{content:"";width:44px;height:4px;border-radius:99px;background:#9ac9d1b0}
  #menuOverlay .hubTop{display:flex;flex-direction:column;align-items:stretch;gap:7px;padding:1px 12px 9px;min-height:0;height:auto}
  #menuOverlay .hubLogo{display:flex;align-items:center;gap:5px;max-width:100%;height:25px;flex:0 0 25px}
  #menuOverlay .hubLogo .hubMark,#menuOverlay .hubLogo b,#menuOverlay .hubLogo small{display:none}
  #menuOverlay .hubLogo:after{display:block;font-size:17px;font-weight:950;line-height:24px;color:#d8fff8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #menuOverlay .hubTopRight{display:flex;width:100%;justify-content:flex-start;align-items:center;flex-wrap:wrap;gap:5px}
  #menuOverlay #townMenuBack{order:-1;min-height:33px;min-width:62px;padding:5px 10px;font-size:11px}
  #menuOverlay .resPill{padding:5px 7px;font-size:10px;border-radius:8px;line-height:1.2}
  #menuOverlay #soundBtn{width:30px;min-width:30px;height:30px;font-size:13px;margin-left:auto}
  #menuOverlay .hubBody{grid-template-columns:64px minmax(0,1fr);min-height:0;overflow:hidden}
  #menuOverlay .hubSide{padding:7px 3px;gap:5px}
  #menuOverlay .trainerBox{padding:5px 2px;margin-bottom:1px}
  #menuOverlay .trainerPortrait{transform:scale(.6);height:52px;margin-top:-14px;margin-bottom:-9px}
  #menuOverlay .trainerBox b{font-size:8px}
  #menuOverlay .trainerBox small{font-size:7px}
  #menuOverlay #hubNav button{padding:7px 1px;font-size:17px;line-height:1.15}
  #menuOverlay #hubNav button span{font-size:8px;line-height:1.2}
  #menuOverlay .hubFoot{display:none}
  #menuOverlay .hubMain{padding:12px 9px 18px;overflow-x:hidden;overflow-y:auto}
}
@media(max-width:410px){
  #menuOverlay .hubBody{grid-template-columns:59px minmax(0,1fr)}
  #menuOverlay .hubTop{padding-left:8px;padding-right:8px}
  #menuOverlay .hubMain{padding:10px 7px 16px}
  #menuOverlay .resPill{font-size:9px;padding:5px 5px}
  #menuOverlay #townMenuBack{min-width:59px;padding:5px 7px}
}
@media(max-width:810px) and (max-height:560px){
  #menuOverlay .hubShell,#menuOverlay[data-panel-size="compact"] .hubShell{height:92dvh;max-height:92dvh}
  #menuOverlay .townSheetGrip{height:10px;flex-basis:10px}
  #menuOverlay .hubTop{gap:3px;padding-bottom:4px}
  #menuOverlay .hubLogo{height:20px;flex-basis:20px}
  #menuOverlay .hubLogo:after{font-size:14px}
  #menuOverlay .trainerBox{display:none}
}


/* v0.3.3k.22 — game camera renders approved original pixel-art town, not generated cobblestones. */
#townCanvas{image-rendering:auto}
#townOverlay{background:#071e43}
#townOverlay .townIdentity,#townOverlay .townOnline{box-shadow:0 4px 20px #041227ad}

/* v0.3.3k.22 — crisp lossless city, unified bottom-right quick menu. */
#townCanvas{image-rendering:pixelated!important}
#townOverlay .townQuickDock{
  position:absolute;z-index:7;right:clamp(10px,1.7vw,24px);
  bottom:calc(16px + env(safe-area-inset-bottom));display:flex;flex-direction:column;
  align-items:flex-end;gap:9px;max-width:calc(100vw - 18px);pointer-events:auto
}
#townQuickToggle{
  min-width:152px;min-height:50px;border-radius:15px;border:1px solid #8cece5;
  background:linear-gradient(140deg,#1c7180f7,#123a64f7);color:#f1ffff;
  font-size:14px;font-weight:950;display:flex;align-items:center;justify-content:center;
  gap:10px;padding:9px 16px;box-shadow:0 6px 24px #00172cbb,inset 0 1px #ffffff42;
  cursor:pointer;touch-action:manipulation
}
#townQuickToggle[aria-expanded="true"]{background:linear-gradient(135deg,#295f77,#122b4b);border-color:#c1fdf0}
#townQuickToggle .townToggleMark{font-size:23px;line-height:1}
#townQuickToggle .townToggleChevron{font-size:16px;opacity:.78}
#townQuickPanel{
  width:min(350px,calc(100vw - 26px));max-height:min(72dvh,430px);
  padding:13px;overflow-y:auto;overscroll-behavior:contain;
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
  border-radius:17px;background:linear-gradient(160deg,#0c2845ef,#06192fe9);
  border:1px solid #80dce4b9;box-shadow:0 8px 35px #001527bb;
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)
}
#townQuickPanel[hidden]{display:none!important}
#townOverlay .townQuickDock .townDock{
  display:contents!important;position:static!important;inset:auto!important;
  overflow:visible!important;max-height:none!important
}
#townOverlay #townQuickPanel .townDock button{
  width:100%;min-width:0;min-height:52px;padding:8px 9px;gap:7px;
  font-size:12px;line-height:1.25;border-radius:10px
}
#townOverlay #townQuickPanel .townDock button .townIco{font-size:22px;flex:0 0 26px}
#townOverlay #townQuickPanel .townDock button small{font-size:9px;display:block}
#townOverlay #townQuickPanel .townDock .townQuest{border-color:#e8d490;background:linear-gradient(130deg,#396c59,#215969)}
@media(max-width:700px){
  #townOverlay .townQuickDock{right:9px;bottom:calc(11px + env(safe-area-inset-bottom));gap:6px}
  #townQuickToggle{min-height:45px;min-width:123px;border-radius:12px;font-size:12px;padding:7px 10px;gap:6px}
  #townQuickToggle .townToggleMark{font-size:19px}
  #townQuickPanel{width:min(268px,calc(100vw - 110px));padding:8px;gap:6px;max-height:min(66dvh,350px);border-radius:13px}
  #townOverlay #townQuickPanel .townDock button{min-height:43px;padding:6px 5px;gap:5px;font-size:10px}
  #townOverlay #townQuickPanel .townDock button .townIco{font-size:17px;flex:0 0 20px}
  #townOverlay #townQuickPanel .townDock button small{display:none}
  #townBottom{bottom:calc(70px + env(safe-area-inset-bottom));left:50%;max-width:68vw}
}
@media(max-height:530px){
  #townQuickPanel{max-height:68dvh;gap:5px;padding:7px}
  #townOverlay #townQuickPanel .townDock button{min-height:36px}
  #townQuickToggle{min-height:39px}
  #townBottom .townHint{display:none}
}


/* v0.3.3k.22: larger right-bottom quick menu, 11 functions total. */
#townQuickToggle{min-width:185px;min-height:61px;font-size:16px;padding:11px 19px;gap:11px}
#townQuickToggle .townToggleMark{font-size:26px}
#townQuickPanel{width:min(400px,calc(100vw - 25px));max-height:min(78dvh,545px);padding:14px;gap:10px}
#townOverlay #townQuickPanel .townDock button{min-height:62px;font-size:14px;padding:10px 12px;gap:9px}
#townOverlay #townQuickPanel .townDock button .townIco{font-size:24px;flex-basis:30px}
#townOverlay #townQuickPanel .townDock button small{font-size:10px}
@media(max-width:700px){
  #townQuickToggle{min-width:155px;min-height:56px;font-size:14px;padding:8px 13px}
  #townQuickToggle .townToggleMark{font-size:23px}
  #townQuickPanel{width:min(320px,calc(100vw - 103px));max-height:70dvh;padding:10px;gap:7px}
  #townOverlay #townQuickPanel .townDock button{min-height:55px;font-size:12px;padding:7px 8px;gap:6px}
  #townOverlay #townQuickPanel .townDock button .townIco{font-size:21px;flex-basis:25px}
  #townOverlay #townQuickPanel .townDock button small{display:none}
  #townBottom{bottom:calc(88px + env(safe-area-inset-bottom))}
}
@media(max-height:530px){
  #townQuickPanel{max-height:67dvh}
  #townOverlay #townQuickPanel .townDock button{min-height:47px}
  #townQuickToggle{min-height:47px}
}
/* Independent compact MMORPG-style floating service windows. */
#townServiceOverlay[hidden]{display:none!important}
#townServiceOverlay{position:absolute;inset:0;z-index:9;display:flex;align-items:center;justify-content:center;
  background:#06172865;backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px);padding:20px;overscroll-behavior:contain}
.townServicePanel{width:min(720px,82vw);height:min(650px,82dvh);display:flex;flex-direction:column;overflow:hidden;
  background:linear-gradient(140deg,#14354af8,#081d34f8);border:1px solid #74c9df;border-radius:20px;
  box-shadow:0 21px 72px #001225d9;color:#e6f9ff}
.townServiceHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 21px;
  border-bottom:1px solid #4e8195;background:#113d50;flex:0 0 auto}
.townServiceHeading{display:flex;align-items:center;gap:10px;font-size:21px}
#townServiceClose{border:1px solid #78c7c8;border-radius:11px;background:#245267;color:#edfffa;
  font-size:13px;font-weight:900;padding:9px 15px;white-space:nowrap}
.townServiceBody{flex:1;min-height:0;overflow-y:auto;padding:20px;scrollbar-width:thin;scrollbar-color:#427f97 #0e2539}
.townServiceFooter{flex:0 0 auto;padding:10px 18px;border-top:1px solid #395d71;
  background:#0b2738;color:#9ebfce;font-size:11px;text-align:center}
.townServiceIntro{font-size:12px;color:#b9d6e0;margin:0 0 16px;line-height:1.8}
.townServiceCard{border:1px solid #3e728b;background:#15344c;border-radius:13px;padding:15px;margin-bottom:12px;
  box-shadow:inset 0 1px 0 #ffffff10}
.townServiceCard h3{font-size:16px;margin:0 0 6px;color:#f5fff9}
.townServiceCard p{margin:6px 0;color:#c3dbe6;font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}
.townServiceMeta{font-size:11px;color:#88bcd1;margin-bottom:8px}
.townServiceTag{display:inline-block;font-size:10px;color:#e8f4ff;border:1px solid #598da2;border-radius:8px;padding:3px 7px;margin:0 0 8px}
.townServiceActions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;margin-top:12px}
.townServiceAction{border:1px solid #65c8c6;background:#1a5764;color:#e9fffb;border-radius:10px;padding:10px 14px;font-weight:900;min-height:40px}
.townServiceAction:disabled{opacity:.55;cursor:not-allowed}
.townServiceEmpty{border:1px dashed #497b8e;border-radius:14px;padding:35px 15px;text-align:center;color:#bad0df;font-size:13px;line-height:1.8}
/* Mailbox: clear two-tab navigation and durable reward receipt details. */
.townMailTabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 15px}
.townMailTab{min-width:0;min-height:44px;padding:8px 10px;background:#123049;color:#b8d9e5;border:1px solid #477689;border-radius:10px;cursor:pointer;font:inherit;font-weight:850;font-size:12px;line-height:1.35}
.townMailTab.is-active{background:#23647a;border-color:#85dbe1;color:#fff;box-shadow:inset 0 0 0 1px #a3e9e555}
.townMailTab:focus-visible,.townMailHistoryDetails summary:focus-visible{outline:2px solid #a2ebed;outline-offset:2px}
.townMailHistoryCard{border-color:#517f8a}
.townMailHistoryDetails{margin-top:9px;border-top:1px solid #456e82;padding-top:10px}
.townMailHistoryDetails summary{cursor:pointer;color:#afe8ef;font-size:12px;font-weight:850;list-style-position:inside;padding:5px 0}
.townMailRewardDetails{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;margin:10px 0 0;padding:0;list-style:none}
.townMailRewardDetails li{padding:7px 9px;background:#0d2c41;border:1px solid #41667b;border-radius:8px;color:#e7f7fa;font-size:12px;overflow-wrap:anywhere}
@media(max-width:540px){
  .townMailTabs{gap:6px}
  .townMailTab{font-size:11px;padding:8px 5px}
  .townMailRewardDetails{grid-template-columns:1fr}
}
.townServiceField{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;font-size:13px;font-weight:800;color:#cae9ee}
.townServiceField input,.townServiceField select,.townServiceField textarea{background:#0c2538;color:#efffff;
  border:1px solid #4d879c;border-radius:9px;padding:11px 12px;font:inherit;font-size:13px;min-height:40px;width:100%;box-sizing:border-box}
.townServiceField textarea{min-height:120px;resize:vertical;line-height:1.6}
.townServiceNote{font-size:11px;color:#a4d1d2;line-height:1.7}
@media(max-width:810px){
  #townServiceOverlay{align-items:flex-end;padding:0;background:#07162444;backdrop-filter:none;-webkit-backdrop-filter:none}
  .townServicePanel{width:100%;height:89dvh;max-height:89dvh;border-radius:19px 19px 0 0;border-bottom:0}
  .townServiceHeader{padding:12px 14px}.townServiceHeading{font-size:17px}
  .townServiceBody{padding:13px 11px}.townServiceFooter{padding:8px 12px;font-size:10px}
}
@media(max-width:810px) and (max-height:560px){.townServicePanel{height:92dvh;max-height:92dvh}.townServiceHeader{padding:6px 12px}}

/* k.23: existing trainer preview; paper-doll not yet enabled */
#trainerSidebarCanvas{display:block;width:70px;height:86px;margin:0 auto;image-rendering:pixelated;}
#trainerRoleCanvas{display:block;width:132px;height:162px;max-width:100%;image-rendering:pixelated;}
@media(max-width:810px){#trainerSidebarCanvas{width:66px;height:81px;transform:none!important;margin:0 auto!important}}
@media(max-width:470px){#trainerSidebarCanvas{width:52px;height:64px}}
    #bossIntroOverlay.etemonIntro{background:radial-gradient(ellipse at center,rgba(153,58,8,.24),rgba(31,8,0,.83))}
    #bossIntroOverlay.etemonIntro::before{background:rgba(255,146,23,.11)}
    #bossIntroOverlay.etemonIntro #bossIntroArt{filter:drop-shadow(0 0 23px rgba(255,135,19,.55));width:min(95vw,1050px);max-height:45vh}
  
/* k.37 : Adventure 01 illustrated stage-select world map.  Not a gameplay terrain change. */
.adventureMapWrap{margin:12px 0 16px;overflow:hidden;border-radius:18px;border:1px solid #4b899c;background:#0f385e;box-shadow:0 13px 32px #020c1b70}
.adventureMapTop{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:9px;padding:12px 16px;background:linear-gradient(100deg,#193b5a,#1f5264);border-bottom:1px solid #70bccc55}
.adventureMapTop strong{font-size:16px;color:#f3ead1;letter-spacing:.3px}.adventureMapTop small{display:block;margin-top:3px;color:#bbdfea;font-size:11px}.adventureMapProgress{font-size:11px;padding:7px 11px;border-radius:24px;border:1px solid #6bd8d777;background:#10485d;color:#b8f4dc;font-weight:800}
.adventureMapPan{width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-color:#76beca #154765;scrollbar-width:thin;}
.adventureMapScene{position:relative;width:100%;min-width:890px;aspect-ratio:1120/730;isolation:isolate;overflow:hidden;background:#0e6795}
.adventureMapArt{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.adventurePin{position:absolute;z-index:2;left:calc(var(--x) * 1%);top:calc(var(--y) * 1%);transform:translate(-50%,-50%);display:flex;align-items:center;flex-direction:column;min-width:125px;width:clamp(125px,13%,156px);min-height:105px;padding:0;border:0;background:none;color:#fff;filter:drop-shadow(0 3px 3px #08263c9c);cursor:pointer}
.adventurePin:disabled{opacity:.78;cursor:not-allowed;filter:grayscale(.42) drop-shadow(0 2px 3px #001c31)}
.adventurePin:focus-visible{outline:3px solid #fceba1;outline-offset:2px;border-radius:16px}
.adventurePinCrest{display:grid;place-items:center;position:relative;width:53px;height:53px;border:4px solid #f7de91;border-radius:50%;background:linear-gradient(145deg,#335c8a,#172c52);box-shadow:0 0 0 3px #2b425c,0 4px 0 #08283b,0 0 0 6px #78a8bb88;font-size:23px;text-shadow:0 1px 3px #0009;transition:transform .18s}
.adventurePin:not(:disabled):hover .adventurePinCrest{transform:translateY(-4px) scale(1.08);box-shadow:0 0 0 3px #2b425c,0 4px 0 #08283b,0 0 17px #f6d57e}
.adventurePin.isCurrent .adventurePinCrest{background:linear-gradient(145deg,#4ccbbd,#187990);border-color:#fff4b6;box-shadow:0 0 0 4px #31758f,0 0 0 8px #edecb168,0 0 22px #c3ffca}
.adventurePin.isClear .adventurePinCrest{background:linear-gradient(145deg,#53a675,#286653)}
.adventurePin.isLocked .adventurePinCrest{background:linear-gradient(145deg,#636b82,#35455d);border-color:#bcc5c6}
.adventurePinNum{position:absolute;top:-10px;left:-12px;min-width:24px;height:24px;display:grid;place-items:center;border-radius:99px;background:#fce5a1;border:2px solid #8b5835;color:#584026;font-size:11px;font-weight:1000}
.adventurePinLabel{max-width:100%;min-width:120px;margin-top:5px;padding:5px 9px 6px;border:1px solid #ffe4a1c7;border-radius:5px 5px 10px 10px;background:linear-gradient(#fff0c6,#d4a86f);color:#513b2a;box-shadow:0 3px 0 #553c29bb,0 5px 7px #061f3677;font-weight:1000;font-size:12px;line-height:1.1;white-space:nowrap;text-align:center}
.adventurePin.isCurrent .adventurePinLabel{background:linear-gradient(#fff5c8,#a8e5c5);border-color:#fdf1b0;color:#144c4e}
.adventurePin.isLocked .adventurePinLabel{background:linear-gradient(#c9c3af,#98989d);border-color:#a8b9ba;color:#4e5764}
.adventurePinStatus{font-size:9px;font-weight:850;color:#fff6dd;text-shadow:0 2px 4px #0d274c,0 0 4px #031528;margin-top:7px;line-height:1}
.adventureMapInfo{background:linear-gradient(135deg,#102c42,#173951);padding:12px 16px 14px;border-top:1px solid #65b2ca75;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.adventureMapInfoTitle{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.adventureMapInfoTitle strong{font-size:16px;color:#e9fff2}.adventureMapInfo p{margin:6px 0 0;color:#bddde7;font-size:12px}.adventureMapInfo .advTag{padding:3px 9px;border-radius:99px;border:1px solid #78b9bb66;color:#ffe8aa;background:#214760;font-size:10px;font-weight:750}
.adventureMapTip{display:none;margin-top:3px;font-size:10px;color:#bdd4e1}
@media(max-width:760px){.adventureMapScene{min-width:850px}.adventureMapTip{display:block}.adventureMapTop strong{font-size:14px}.adventureMapTop{padding:10px}.adventureMapInfo{padding:11px}.adventurePin{min-width:110px}.adventurePinLabel{min-width:108px;font-size:11px}}


/* Six-stat partner panel: actual level-adjusted values, then red training gains.
   IVs affect the base number internally, but are intentionally not shown. */
.mateStatPanel{margin-top:14px;padding:15px 16px 14px;border:1px solid #44778d;border-radius:15px;background:linear-gradient(143deg,#183852,#10293c 72%,#142b41);box-shadow:inset 0 1px rgba(220,247,255,.09),0 5px 15px rgba(3,13,28,.13)}
.mateStatPanelHeader{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px 16px;margin-bottom:13px}
.mateStatPanelHeader h3{margin:0 0 4px;font-size:17px;letter-spacing:.06em;color:#ecf9ff}
.mateStatPanelHeader p{margin:0;font-size:11px;color:#a6c7d9;line-height:1.4}
.mateStatLegend{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;font-size:10px;color:#caddea;font-weight:700}
.mateStatLegend span{display:inline-flex;align-items:center;gap:6px}
.mateStatLegend i{display:block;width:15px;height:9px;border-radius:3px}
.mateStatLegendBase{background:linear-gradient(90deg,#f4cf62,#70bad6)}
.mateStatLegendBonus{background:#f05b76}
.mateStatRows{display:grid;gap:8px}
.mateStatRow{padding:10px 12px 9px;background:linear-gradient(110deg,rgba(11,33,56,.86),rgba(18,44,68,.78));border:1px solid rgba(109,165,193,.28);border-radius:10px;min-width:0}
.mateStatMain{display:grid;grid-template-columns:90px minmax(110px,1fr) minmax(155px,max-content);gap:12px;align-items:center}
.mateStatLabel{display:flex;align-items:center;gap:8px;color:#eaf7ff;font-weight:800;letter-spacing:.025em;font-size:12px;min-width:0}
.mateStatIcon{display:grid;place-items:center;flex:0 0 25px;width:25px;height:25px;background:color-mix(in srgb,var(--mate-stat-color) 12%,#132842);border:1px solid color-mix(in srgb,var(--mate-stat-color) 50%,transparent);border-radius:7px;color:var(--mate-stat-color);font-size:14px;line-height:1}
.mateStatTrack{display:flex;width:100%;height:11px;overflow:hidden;border-radius:99px;background:#091c33;border:1px solid #355372;box-shadow:inset 0 1px 3px rgba(0,0,0,.35);min-width:0}
.mateStatBaseFill,.mateStatBonusFill{display:block;height:100%;flex-shrink:0}
.mateStatBaseFill{background:var(--mate-stat-color);box-shadow:inset 0 2px rgba(255,255,255,.26)}
.mateStatBonusFill{background:linear-gradient(180deg,#ff8891,#e84264);box-shadow:inset 2px 0 rgba(11,30,49,.38),inset 0 2px rgba(255,255,255,.18)}
.mateStatNumbers{display:flex;justify-content:flex-end;align-items:baseline;gap:6px;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:13px;line-height:1.3}
.mateStatBaseNumber{color:#e9f1fa;font-weight:850}
.mateStatBonusNumber{color:#ff8191;font-weight:950}
.mateStatTotalNumber{color:#fff;font-size:14px;font-weight:950}
.mateStatFooter{display:flex;justify-content:space-between;align-items:center;gap:8px;min-width:0;padding-left:33px;margin-top:6px}
.mateStatFooter small{font-size:10px;color:#9fbfd2;line-height:1.3}
.mateStatUpgrade.hubBtn{flex:0 0 auto;padding:5px 10px;font-size:10px;line-height:1.25;border-radius:7px;min-height:27px;color:#e4edf7}
.mateStatUpgrade.hubBtn:not(:disabled):hover{border-color:#e7b9a2;color:#fff}
.mateStatUpgrade.hubBtn:disabled{opacity:.55}
.mateStatPanel .mateExplanation{margin-top:12px;background:rgba(8,27,45,.54);border-color:rgba(92,140,173,.35);color:#b9d3e1;line-height:1.6}
@media(max-width:710px){
 .mateStatMain{grid-template-columns:79px minmax(78px,1fr) minmax(143px,max-content);gap:8px}
 .mateStatNumbers{gap:4px;font-size:12px}
 .mateStatTotalNumber{font-size:12px}
 .mateStatIcon{width:23px;height:23px;flex-basis:23px}
 .mateStatFooter{padding-left:30px}
}
@media(max-width:510px){
 .mateStatPanel{padding:13px 10px}
 .mateStatRow{padding:10px 9px 8px}
 .mateStatMain{grid-template-columns:minmax(80px,1fr) auto;gap:8px}
 .mateStatLabel{grid-column:1;grid-row:1;font-size:12px}
 .mateStatNumbers{grid-column:2;grid-row:1;font-size:12px}
 .mateStatTrack{grid-column:1/-1;grid-row:2;height:12px;margin-top:1px}
 .mateStatFooter{padding-left:0;margin-top:9px}
 .mateStatFooter small{font-size:9px}
 .mateStatUpgrade.hubBtn{font-size:10px;padding:6px 7px}
 .mateStatPanelHeader h3{font-size:16px}
}
@media(max-width:340px){
 .mateStatNumbers{gap:3px;font-size:11px}
 .mateStatTotalNumber{font-size:11px}
 .mateStatFooter{flex-wrap:wrap}
}


/* Partner dashboard v2: select on the left, inspect stats/evolution/management
   on the right. Internal desktop scroll never pushes the detail below the roster. */
#hubContent:has(.dsPartnerWorkspace){padding:13px 17px;overflow:auto}
.dsPartnerPageHead{display:flex;justify-content:space-between;align-items:center;gap:8px 16px;margin-bottom:10px;min-width:0}
.dsPartnerPageHead h2{margin:0;font-size:21px;line-height:1.3;color:#e8fbfa;font-weight:950;letter-spacing:.05em}
.dsPartnerPageHead p{margin:3px 0 0;font-size:11px;color:#a8c8d1}
.dsPartnerHeadCounts{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.dsPartnerHeadCounts span{font-size:11px;color:#bfdae2;border:1px solid #355e6a;background:#132f40;padding:6px 10px;border-radius:9px;white-space:nowrap}
.dsPartnerHeadCounts strong{color:#f6fff9;font-size:12px}
.dsPartnerWorkspace{display:grid;grid-template-columns:minmax(290px,41%) minmax(0,1fr);gap:11px;height:clamp(440px,calc(94dvh - 180px),760px);min-height:0;max-width:100%;align-items:stretch}
.dsPartnerLibrary,.dsPartnerDetail{min-width:0;min-height:0;background:linear-gradient(145deg,#143448,#102b3c);border:1px solid #386475;border-radius:14px;box-shadow:inset 0 1px rgba(240,255,255,.065);overflow:hidden}
.dsPartnerLibrary{display:flex;flex-direction:column;padding:11px}
.dsPartnerLibraryHead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:3px 3px 6px}
.dsPartnerLibraryHead strong{font-size:14px;color:#eafcfb}
.dsPartnerLibraryHead small{font-size:10px;color:#a4c6d3}
.dsPartnerRosterToolbar.mateRosterToolbar{margin:0 0 9px;padding:8px;background:#0f2b3b;border-radius:10px;gap:6px}
.dsPartnerRosterToolbar label{font-size:11px}
.dsPartnerRosterToolbar select{font-size:11px;padding:5px 8px;min-height:31px;max-width:180px}
.dsPartnerRosterScroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#4c8295 #102c3b;padding:3px 3px 4px}
.rosterGrid.dsPartnerRosterGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.dsPartnerRosterGrid .rosterCard{display:flex;flex-direction:column;align-items:center;text-align:center;gap:3px;min-width:0;min-height:119px;padding:8px 5px;border-radius:10px}
.dsPartnerRosterGrid .rosterSprite{height:63px;width:63px;max-width:100%;margin:0}
.dsPartnerRosterGrid .rosterCard b{font-size:11px;margin:0;line-height:1.15;overflow-wrap:anywhere}
.dsPartnerRosterGrid .rosterCard small{font-size:10px;line-height:1.2;color:#b2c8d6}
.dsPartnerRosterGrid .badgeActive{font-size:9px!important;margin:0;position:absolute;top:2px;left:4px}
.dsPartnerRosterGrid .rosterCard{position:relative}
.dsPartnerPager.mateRosterPager{margin:9px 0 5px;gap:5px;flex-wrap:nowrap}
.dsPartnerPager .hubBtn{padding:5px 8px;min-height:30px;font-size:10px}
.dsPartnerPager .pageLabel{min-width:56px;font-size:11px}
.dsPartnerDetail{display:flex;flex-direction:column}
.dsPartnerHero{display:flex;align-items:center;gap:11px;flex:0 0 auto;padding:10px 13px 9px;min-width:0;background:radial-gradient(ellipse at 14% 35%,rgba(82,141,151,.24),transparent 62%),linear-gradient(125deg,#1a4250,#16364c);border-bottom:1px solid rgba(123,187,195,.24)}
.dsPartnerPortrait{width:100px;height:103px;flex:0 0 100px;display:grid;place-items:center;overflow:hidden;background:radial-gradient(ellipse at center,#295c69,#132c42 65%);border:1px solid #447b88;border-radius:12px}
.dsPartnerPortrait .detailSprite{width:91px;height:98px;max-width:100%;object-fit:contain;margin:0;image-rendering:pixelated}
.dsPartnerHeroInfo{min-width:0;flex:1}
.dsPartnerNameLine{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.dsPartnerNameLine h3{font-size:19px;color:#f2fffa;margin:0;font-weight:950;line-height:1.25;overflow-wrap:anywhere}
.dsPartnerNameLine .miniTag{margin:0;font-size:10px;color:#9bffe3;border-color:#418c78}
.dsPartnerPills{display:flex;gap:4px;flex-wrap:wrap;margin:5px 0}
.dsPartnerPills span{font-size:10px;background:#16455b;color:#d4f6f2;padding:2px 6px;border:1px solid #386f7e;border-radius:6px}
.dsPartnerRole{font-size:10px;color:#accee0;margin:4px 0;line-height:1.35;max-width:100%}
.dsPartnerHeroBottom{display:flex;align-items:center;justify-content:space-between;gap:5px 10px;flex-wrap:wrap;margin-top:5px}
.dsPartnerHeroBottom small{font-size:10px;color:#a9d0da}
.dsPartnerActivate.hubBtn{padding:5px 12px;min-height:28px;border-radius:8px;font-size:10px}
.dsPartnerTabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;flex:0 0 auto;padding:7px 10px;background:#142f40;border-bottom:1px solid #2e5968}
.dsPartnerTabs button{border:1px solid transparent;background:#193749;color:#b6d4df;cursor:pointer;border-radius:8px;min-height:36px;padding:5px 4px;font-size:12px;font-weight:850;white-space:nowrap}
.dsPartnerTabs button span{margin-right:5px}
.dsPartnerTabs button.is-active{background:#286170;color:#e8fff8;border-color:#70d6ce;box-shadow:inset 0 1px rgba(255,255,255,.12)}
.dsPartnerTabs button:focus-visible{outline:2px solid #8debe7;outline-offset:1px}
.dsPartnerDetailScroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#568598 #0b283b;padding:8px 9px 10px}
.dsPartnerDetailScroll .mateStatPanel{border:0;box-shadow:none;margin:0;padding:6px 7px;background:transparent}
.dsPartnerDetailScroll .mateStatPanelHeader{margin-bottom:7px;gap:5px 10px}
.dsPartnerDetailScroll .mateStatPanelHeader h3{font-size:14px;margin:0}
.dsPartnerDetailScroll .mateStatPanelHeader p{display:none}
.dsPartnerDetailScroll .mateStatLegend{font-size:9px;gap:7px}
.dsPartnerDetailScroll .mateStatLegend i{width:11px;height:7px}
.dsPartnerDetailScroll .mateStatRows{gap:5px}
.dsPartnerDetailScroll .mateStatRow{padding:6px 9px 5px;border-radius:8px}
.dsPartnerDetailScroll .mateStatMain{grid-template-columns:78px minmax(70px,1fr) minmax(112px,max-content);gap:8px}
.dsPartnerDetailScroll .mateStatLabel{font-size:11px;gap:5px}
.dsPartnerDetailScroll .mateStatIcon{flex-basis:21px;width:21px;height:21px;font-size:12px}
.dsPartnerDetailScroll .mateStatTrack{height:10px}
.dsPartnerDetailScroll .mateStatNumbers{font-size:12px;gap:4px}
.dsPartnerDetailScroll .mateStatTotalNumber{font-size:12px}
.dsPartnerDetailScroll .mateStatFooter{margin-top:3px;padding-left:26px}
.dsPartnerDetailScroll .mateStatFooter small{display:none}
.dsPartnerDetailScroll .mateStatUpgrade.hubBtn{font-size:10px;padding:4px 9px;min-height:25px}
.dsPartnerDetailScroll .mateExplanation{display:none}
.dsPartnerTabSection{padding:6px 8px 12px}
.dsPartnerSectionTitle{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 12px}
.dsPartnerSectionTitle h3{font-size:15px;color:#e4fff8;margin:0}
.dsPartnerSectionTitle small{font-size:10px;color:#9fbecb}
.dsPartnerEvoGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.dsPartnerEvoCard{display:flex;flex-direction:column;gap:8px;min-width:0;padding:10px;border-radius:10px;border:1px solid #37677a;background:linear-gradient(135deg,#123244,#0e2639)}
.dsPartnerEvoHead{display:flex;align-items:center;gap:8px;min-width:0}
.dsPartnerEvoHead .evoSprite{width:68px;height:78px;flex:0 0 68px;object-fit:contain;font-size:42px!important}
.dsPartnerEvoHead div{min-width:0}
.dsPartnerEvoHead b{display:block;font-size:13px;color:#eafdf8;overflow-wrap:anywhere}
.dsPartnerEvoHead small{display:block;font-size:10px;color:#accbd5;line-height:1.4;margin-top:4px}
.dsPartnerEvoRequirements{display:flex;flex-wrap:wrap;gap:6px;font-size:10px;line-height:1.4}
.dsPartnerEvoRequirements span{border:1px solid #375e6c;background:#122d40;border-radius:6px;padding:4px 6px}
.dsPartnerEvoRequirements .is-ok{color:#ace6ca}
.dsPartnerEvoRequirements .is-short{color:#ffb4a6}
.dsPartnerEvolveBtn.hubBtn{margin-top:auto;width:100%;padding:7px 4px;min-height:35px;font-size:11px}
.dsPartnerFinePrint,.dsPartnerEmptyEvo{font-size:11px;color:#adcad8;line-height:1.6}
.dsPartnerMaterials{margin-top:12px;border:1px solid #376475;padding:11px;border-radius:10px;background:#122f41;color:#c3e5e5;font-size:11px}
.dsPartnerMaterials summary{cursor:pointer;font-weight:850;color:#dcf9f0;font-size:11px}
.dsPartnerMaterials>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}
.dsPartnerMaterials .typeGuide{margin:12px 0 0}
.dsPartnerManageInfo{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.dsPartnerManageInfo span{border:1px solid #315e6f;border-radius:8px;padding:10px;color:#bdd7df;background:#132d3d;font-size:11px}
.dsPartnerManageInfo b{color:#eefcf9}
.dsPartnerManageActions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.dsPartnerSellNote{font-size:11px;line-height:1.6;color:#f2c5ae}
.dsMateMobilePicker{display:none}
@media(max-width:1000px){
 #hubContent:has(.dsPartnerWorkspace){padding:9px 10px}
 .dsPartnerPageHead{margin-bottom:7px}
 .dsPartnerPageHead h2{font-size:19px}
 .dsPartnerPageHead p{display:none}
 .dsPartnerHeadCounts span{font-size:10px;padding:4px 7px}
 .dsMateMobilePicker{display:block;margin:0 0 9px;padding:8px 9px;background:#103344;border:1px solid #336679;border-radius:11px}
 .dsMateMobilePicker label{display:block;font-size:10px;color:#b5dee0;font-weight:850;margin-bottom:5px}
 .dsMateMobileControls{display:flex;gap:7px}
 .dsMateMobileControls select{flex:1;min-width:0;background:#183c4f;color:#eefffa;border:1px solid #4f8393;border-radius:8px;font-size:12px;padding:7px 8px;min-height:37px;max-width:100%}
 .dsMateMobileControls .hubBtn{font-size:10px;min-height:37px;padding:6px 10px;white-space:nowrap}
 .dsPartnerWorkspace{display:flex;flex-direction:column;gap:9px;height:auto;max-height:none;min-height:0}
 .dsPartnerLibrary{display:none}
 .dsMobileListOpen .dsPartnerLibrary{display:flex;min-height:0;max-height:min(420px,55dvh);flex:0 0 auto}
 .dsPartnerLibraryHead{padding:0 3px 4px}
 .dsPartnerRosterScroll{min-height:0;max-height:320px}
 .dsPartnerDetail{min-height:0;overflow:visible}
 .dsPartnerDetailScroll{overflow:visible;min-height:0;padding:7px 8px 9px}
 .dsPartnerHero{padding:9px 10px;gap:10px}
 .dsPartnerPortrait{width:85px;height:90px;flex-basis:85px}
 .dsPartnerPortrait .detailSprite{height:84px;width:79px}
 .dsPartnerNameLine h3{font-size:17px}
 .dsPartnerRole{display:none}
 .dsPartnerPills{margin:5px 0}
 .dsPartnerHeroBottom{margin-top:5px}
 .dsPartnerDetailScroll .mateStatPanel{padding:5px}
}
@media(max-width:550px){
 .dsPartnerPageHead{align-items:center}
 .dsPartnerPageHead h2{font-size:17px}
 .dsPartnerPageHead .dsPartnerHeadCounts span:last-child{display:none}
 .dsPartnerDetailScroll .mateStatRows{gap:4px}
 .dsPartnerDetailScroll .mateStatRow{padding:5px 7px}
 .dsPartnerDetailScroll .mateStatMain{grid-template-columns:minmax(76px,1fr) auto;gap:5px}
 .dsPartnerDetailScroll .mateStatLabel{grid-column:1;grid-row:1}
 .dsPartnerDetailScroll .mateStatNumbers{grid-column:2;grid-row:1;gap:3px;font-size:11px}
 .dsPartnerDetailScroll .mateStatTrack{grid-column:1/-1;grid-row:2;height:9px}
 .dsPartnerDetailScroll .mateStatFooter{padding-left:0;margin-top:2px}
 .dsPartnerDetailScroll .mateStatUpgrade.hubBtn{font-size:9px;min-height:24px;padding:3px 7px}
 .dsPartnerDetailScroll .mateStatPanelHeader{align-items:center;flex-direction:row}
 .dsPartnerDetailScroll .mateStatPanelHeader h3{font-size:13px}
 .dsPartnerDetailScroll .mateStatLegend{font-size:8px}
 .dsPartnerEvoGrid{grid-template-columns:1fr}
 .dsPartnerEvoHead .evoSprite{width:68px;height:74px}
 .dsPartnerTabs button{min-height:35px;font-size:11px}
 .dsPartnerTabs button span{margin-right:3px}
 .dsPartnerHeroBottom .dsPartnerActivate{font-size:10px}
}
@media(max-width:365px){
 .dsPartnerHeadCounts{display:none}
 .dsPartnerHero{gap:6px}
 .dsPartnerPortrait{width:70px;height:78px;flex-basis:70px}
 .dsPartnerPortrait .detailSprite{width:65px;height:75px}
 .dsPartnerNameLine h3{font-size:15px}
 .dsPartnerPills span{font-size:9px;padding:2px 4px}
 .dsPartnerDetailScroll .mateStatNumbers{font-size:10px}
 .dsPartnerDetailScroll .mateStatTotalNumber{font-size:10px}
}


/* On the narrowest phones, keep the requested original + red bonus legible.
   The full total remains accessible in the bar's screen-reader label. */
@media(max-width:410px){
 .dsPartnerDetailScroll .mateStatTotalNumber{display:none}
 .dsPartnerDetailScroll .mateStatNumbers{gap:5px}
 .dsPartnerDetailScroll .mateStatBaseNumber{font-size:12px}
 .dsPartnerDetailScroll .mateStatBonusNumber{font-size:12px}
}


/* Bit shop: bulk quantity selection & material chest opening, desktop/mobile. */
.dsShopGrid .dsShopProduct{display:flex;flex-direction:column;gap:8px;min-width:0}
.dsShopItemIcon{font-size:37px;line-height:1.1}
.dsShopProduct h3{margin:2px 0;font-size:17px}
.dsShopProduct p{margin:0;color:#b7d6df;font-size:12px;line-height:1.6;flex:1}
.dsShopUnitPrice{color:#9ee4d7;font-size:12px;font-weight:800}
.dsShopDailyQuota{display:block;font-size:11px;font-weight:850;color:#ffd994;line-height:1.5;min-height:18px}
.dsShopQuantityRow{display:grid;grid-template-columns:40px minmax(0,1fr) 40px;gap:7px;align-items:center;margin-top:6px}
.dsShopQtyBtn,.dsShopPreset{border:1px solid #5e9eb1;background:#17445a;color:#ebfffb;border-radius:9px;min-height:39px;cursor:pointer;font-weight:900;touch-action:manipulation}
.dsShopQtyBtn{font-size:23px;line-height:1}
.dsShopQtyInput{min-width:0;width:100%;min-height:40px;padding:6px 8px;border:1px solid #64b8be;border-radius:9px;background:#0a2534;color:#fff;text-align:center;font-size:18px;font-weight:900;box-sizing:border-box}
.dsShopQtyInput::-webkit-inner-spin-button,.dsShopQtyInput::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.dsShopQtyInput{-moz-appearance:textfield;appearance:textfield}
.dsShopQtyPresets{display:flex;align-items:center;gap:6px}
.dsShopPreset{flex:1;min-width:0;min-height:34px;font-size:11px;padding:5px}
.dsShopQtyBtn:disabled,.dsShopPreset:disabled{opacity:.4;cursor:not-allowed}
.dsShopQtyBtn:not(:disabled):active,.dsShopPreset:not(:disabled):active{transform:scale(.96)}
.dsShopTotal{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:3px;padding:9px 0;border-top:1px solid #4c737b;color:#adcdd6;font-size:12px}
.dsShopTotal strong{font-size:15px;color:#ffdf91;white-space:nowrap}
.dsShopPurchase{width:100%;min-width:0;white-space:normal;padding:10px 7px}
.dsShopReveal{position:fixed;inset:0;z-index:2147483643;display:flex;align-items:center;justify-content:center;background:rgba(1,11,26,.88);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);padding:calc(12px + env(safe-area-inset-top)) 13px calc(12px + env(safe-area-inset-bottom));box-sizing:border-box;overscroll-behavior:contain}
.dsShopRevealPanel{width:min(510px,100%);max-height:100%;overflow-y:auto;box-sizing:border-box;border:2px solid #8ce9da;border-radius:22px;background:radial-gradient(ellipse at 50% 23%,#23627a,#10283b 65%,#071b2b);box-shadow:0 0 65px #5af5f744,inset 0 1px 0 #ffffff44;padding:19px 18px 22px;text-align:center;color:#f1ffff}
.dsShopRevealOverline{font-size:11px;font-weight:950;letter-spacing:.12em;color:#93e7d9}
.dsShopRevealPanel h2{font-size:clamp(19px,5vw,25px);font-weight:1000;margin:12px 0 0;color:#fff3d1}
.dsShopChestScene{height:186px;position:relative;display:grid;place-items:center;overflow:hidden;margin:4px auto 0}
.dsShopChestHalo{position:absolute;width:190px;height:115px;left:50%;top:50%;transform:translate(-50%,-36%);background:radial-gradient(ellipse,#ffed9e91,#97ffff44 43%,transparent 70%);filter:blur(7px);opacity:.65}
.dsShopChest{position:relative;width:144px;height:128px;filter:drop-shadow(0 14px 7px #0014229e)}
.dsShopChestLid{position:absolute;top:17px;left:11px;width:122px;height:49px;display:grid;place-items:center;background:linear-gradient(160deg,#ffe89f,#b87939 40%,#704021 64%,#352d39);border:6px solid #eebd61;border-bottom:8px solid #6d3953;border-radius:29px 29px 8px 8px;box-sizing:border-box;color:#fff7ca;font-size:28px;box-shadow:inset 0 4px #fff5b172;transform-origin:15% 95%;transition:transform .44s cubic-bezier(.2,1.4,.5,1)}
.dsShopChestBase{position:absolute;bottom:8px;left:4px;width:136px;height:83px;display:grid;place-items:center;border-radius:8px 8px 24px 24px;background:linear-gradient(140deg,#c78640 0%,#e6b55d 35%,#996234 65%,#653944 100%);border:7px solid #f8d27d;box-shadow:inset 0 -15px #5f3f4080;color:#fff4b8;font-size:36px;text-shadow:0 2px 4px #805238}
.dsShopSpark{position:absolute;font-size:27px;color:#fff6bc;opacity:0}
.dsShopSparkA{top:20px;left:19%}.dsShopSparkB{right:12%;top:32px}.dsShopSparkC{left:56%;top:0;font-size:20px}
.dsShopReveal.isOpening .dsShopChest{animation:dsShopChestShake .68s ease-in-out infinite alternate}
.dsShopReveal.isOpening .dsShopChestHalo{animation:dsShopGlow 1s ease-in-out infinite alternate}
.dsShopReveal.isRevealed .dsShopChestLid{transform:translate(-22px,-44px) rotate(-25deg)}
.dsShopReveal.isRevealed .dsShopChestHalo{opacity:1}
.dsShopReveal.isRevealed .dsShopSpark{opacity:1;animation:dsShopSparkle 1.4s ease-in-out infinite alternate}
.dsShopRevealSummary{font-size:12px;color:#b6e3ec;margin:1px 0 14px}
.dsShopRewards[hidden]{display:none!important}
.dsShopRewards h3{font-size:17px;color:#ffe19c;margin:12px 0}
.dsShopRewardGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;text-align:left}
.dsShopRewardCard{display:flex;align-items:center;gap:8px;min-width:0;padding:11px 9px;background:linear-gradient(130deg,#1e515c,#163443);border:1px solid #639b99;border-radius:11px;font-size:12px}
.dsShopRewardIcon{font-size:22px;flex:0 0 27px}
.dsShopRewardName{flex:1;overflow-wrap:anywhere}
.dsShopRewardCard strong{font-size:16px;color:#ffe5a6}
.dsShopRevealSaved{font-size:11px;color:#8be1b3;margin:12px 0}
.dsShopRevealActions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.dsShopRevealActions button{min-width:110px}
.dsShopRevealActions button[hidden]{display:none!important}
@keyframes dsShopChestShake{0%{transform:translate(-2px,0) rotate(-3deg)}100%{transform:translate(2px,-3px) rotate(3deg)}}
@keyframes dsShopGlow{from{opacity:.35;transform:translate(-50%,-35%) scale(.8)}to{opacity:.95;transform:translate(-50%,-40%) scale(1.16)}}
@keyframes dsShopSparkle{from{transform:translateY(8px) scale(.72);opacity:.5}to{transform:translateY(-15px) scale(1.15);opacity:1}}
@media(max-width:760px){
  .dsShopGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dsShopProduct{padding:11px}
  .dsShopProduct h3{font-size:14px}
  .dsShopProduct p{font-size:11px}
  .dsShopQuantityRow{grid-template-columns:32px minmax(0,1fr) 32px;gap:3px}
  .dsShopQtyBtn{min-height:37px;font-size:19px}
  .dsShopQtyInput{font-size:16px;min-height:37px;padding:4px}
  .dsShopPreset{font-size:10px;min-height:30px}
  .dsShopRevealPanel{padding:15px 12px 17px;border-radius:18px}
  .dsShopChestScene{height:160px}
  .dsShopRewardCard{padding:9px 6px;font-size:11px;gap:4px}
  .dsShopRewardIcon{font-size:19px;flex-basis:22px}
}
@media(max-width:430px){.dsShopGrid{grid-template-columns:1fr}.dsShopRewardGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){
  .dsShopChest,.dsShopChestHalo,.dsShopSpark{animation:none!important}
  .dsShopChestLid{transition:none}
}


/* Partner roster: multi-select sale. Kept compact in the existing dashboard. */
.dsBulkToggleBtn.hubBtn{font-size:11px;min-height:31px;padding:5px 10px;white-space:nowrap}
.dsBulkSellPanel{display:flex;flex-direction:column;gap:7px;padding:9px;margin:0 0 8px;background:linear-gradient(125deg,#163e49,#123344);border:1px solid #51888e;border-radius:10px}
.dsBulkSellPanel p{margin:0;color:#bde0e1;font-size:10px;line-height:1.5}
.dsBulkSellQuick{display:flex;gap:7px;flex-wrap:wrap}
.dsBulkSellQuick .hubBtn{flex:1;min-height:30px;padding:5px 8px;font-size:11px}
.dsBulkSellSummary{display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap;color:#bde4e3;font-size:11px}
.dsBulkSellSummary strong{color:#ffe7a5;font-size:13px}
.dsBulkSellSubmit.hubBtn{min-height:36px;padding:7px 10px;font-size:12px}
.dsPartnerRosterGrid .rosterCard.dsBulkCard{position:relative;transition:border-color .14s,background-color .14s,box-shadow .14s}
.dsPartnerRosterGrid .rosterCard.dsBulkCard .dsBulkCheck{position:absolute;top:5px;right:5px;display:grid;place-items:center;width:22px;height:22px;border:2px solid #79b2bf;border-radius:7px;background:#0d2b3a;color:#ffffff;font-weight:950;font-size:15px;line-height:1;z-index:2}
.dsPartnerRosterGrid .rosterCard.dsBulkSelected{border:2px solid #83edd6!important;background:linear-gradient(145deg,#225866,#164455)!important;box-shadow:inset 0 0 0 1px #59c8b3,0 0 10px #55cbb249}
.dsPartnerRosterGrid .rosterCard.dsBulkSelected .dsBulkCheck{border-color:#a5fff0;background:#319c81;color:#ffffff}
.dsPartnerRosterGrid .rosterCard.dsBulkCard:disabled{opacity:.50;cursor:not-allowed;filter:saturate(.70)}
.dsPartnerRosterGrid .rosterCard.dsBulkCard:disabled .dsBulkCheck{font-size:12px;border-color:#778995;background:#30434e;opacity:.92}
.dsPartnerRosterGrid .rosterCard.dsBulkCard:focus-visible{outline:2px solid #e8fff8;outline-offset:2px}
@media(max-width:1000px){
  .dsMateMobileControls{flex-wrap:wrap}
  .dsMateMobileControls select{flex:1 1 125px}
  .dsMateMobileControls .dsBulkMobileEntry{min-width:85px}
  .dsMobileListOpen .dsPartnerLibrary:has(.dsBulkSellPanel){max-height:min(540px,70dvh)}
  .dsBulkSellPanel{gap:5px;padding:7px}
  .dsPartnerRosterToolbar{flex-wrap:wrap}
  .dsBulkToggleBtn.hubBtn{min-height:34px}
}
@media(max-width:440px){
  .dsBulkSellSummary{flex-direction:column;gap:3px}
  .dsBulkSellQuick .hubBtn{font-size:10px}
}

/* 30-day Adventure Pass Season 01: responsive 50-level reward track. */
#hubContent:has(.dsPassPage){padding:12px 17px;overflow-y:auto}
.dsPassPage{display:flex;flex-direction:column;gap:12px;min-width:0;color:#e7f5f8}
.dsPassHero{display:grid;grid-template-columns:minmax(0,1fr) minmax(205px,265px);gap:18px;align-items:center;padding:18px;border:1px solid #4a8290;border-radius:18px;background:radial-gradient(circle at 85% 15%,#7ab4c72b,transparent 46%),linear-gradient(115deg,#153c53,#10283b 62%,#172b4d);box-shadow:inset 0 1px rgba(255,255,255,.10)}
.dsPassEyebrow{font-size:10px;font-weight:900;letter-spacing:.15em;color:#95e7db}
.dsPassHero h2{margin:5px 0 6px;font-size:24px;line-height:1.2;color:#f7fffa;font-weight:950}
.dsPassHeroText p{margin:0 0 12px;color:#bed8e1;font-size:11px;line-height:1.5}
.dsPassRemaining{display:inline-flex;padding:5px 10px;border-radius:30px;border:1px solid #b4d7a66e;color:#ebf9c8;background:#5582672e;font-weight:850;font-size:12px}
.dsPassLevelPanel{padding:12px 14px;border:1px solid #3f7888;background:#0e293cbd;border-radius:13px;display:flex;flex-direction:column;gap:5px}
.dsPassLevelPanel>span{font-size:11px;color:#b3dfe2}
.dsPassLevelPanel>b{font-size:28px;color:#fff3c8;line-height:1.1}
.dsPassLevelPanel>b small{font-size:13px;color:#afc8d9;font-weight:700}
.dsPassLevelPanel>small{font-size:10px;color:#bad5dd}
.dsPassXpRail{height:10px;background:#0c1a30;border:1px solid #396072;border-radius:20px;overflow:hidden}
.dsPassXpRail>i{display:block;height:100%;background:linear-gradient(90deg,#57cbb6,#e7d68e);border-radius:20px;transition:width .2s}
.dsPassOverview{display:flex;flex-wrap:wrap;gap:7px}
.dsPassOverview span{font-size:11px;color:#bedce5;background:#153649;border:1px solid #3b6676;border-radius:8px;padding:7px 10px}
.dsPassOverview b{color:#e7fbc4}
.dsPassActions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dsPassActions>.hubBtn{font-size:12px;min-height:37px}
.dsPassRewards{padding:13px;background:linear-gradient(120deg,#12334a,#0f293d);border:1px solid #395f76;border-radius:15px;min-width:0;overflow:hidden}
.dsPassRewardsHead{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 12px}
.dsPassRewardsHead h3{font-size:16px;color:#f4fffa;margin:0 0 3px}
.dsPassRewardsHead p{margin:0;font-size:10px;color:#a9ced6}
.dsPassRewardsHead>span{color:#fce0a5;font-size:12px;font-weight:900;white-space:nowrap}
.dsPassRanges{display:flex;gap:7px;overflow-x:auto;padding-bottom:9px;scrollbar-width:thin}
.dsPassRanges .dsPassRange{border:1px solid #4b7788;border-radius:8px;min-width:75px;min-height:33px;flex:1;background:#173e52;color:#c9e8e8;font-weight:850;cursor:pointer;font-size:12px}
.dsPassRanges .dsPassRange.active{border-color:#e4cf8f;color:#fff3cc;background:#45637b;box-shadow:inset 0 0 0 1px #c3be8c66}
.dsPassRanges .dsPassRange:focus-visible{outline:2px solid #a3f3ef;outline-offset:1px}
.dsPassRail{display:flex;gap:9px;overflow-x:auto;padding:5px 2px 11px;scrollbar-width:thin;scrollbar-color:#548ca1 #092738;scroll-snap-type:x proximity;overscroll-behavior-x:contain;min-width:0}
.dsPassCard{position:relative;flex:0 0 155px;min-height:208px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:12px 8px 10px;background:linear-gradient(145deg,#1b485a,#143345);border:1px solid #467587;border-radius:12px;scroll-snap-align:start;overflow:hidden}
.dsPassCard.dsPassPurple{border-color:#ae89e8;background:linear-gradient(140deg,#51417a,#262c51)}
.dsPassCard.dsPassGold{border-color:#e8c67c;background:linear-gradient(140deg,#66502a,#383847);box-shadow:inset 0 1px #fce3a55e}
.dsPassCard.is-claimed{opacity:.74;border-color:#5a977f}
.dsPassCard.is-locked{opacity:.66}
.dsPassCardLevel{align-self:stretch;text-align:left;color:#c0e6e8;font-size:11px;letter-spacing:.08em;font-weight:950}
.dsPassGold .dsPassCardLevel{color:#ffe7b1}
.dsPassCardIcon{width:66px;height:66px;display:grid;place-items:center;font-size:34px;border:1px solid #5c9aa09e;border-radius:50%;background:radial-gradient(circle,#5ca5ab32,#193b50);filter:drop-shadow(0 3px 7px #081b28)}
.dsPassPurple .dsPassCardIcon{border-color:#e0b8ff99;background:radial-gradient(circle,#b481ed50,#3d2b61)}
.dsPassGold .dsPassCardIcon{border-color:#ffe6aeac;background:radial-gradient(circle,#e7bc6d55,#684826)}
.dsPassCardName{font-size:12px;line-height:1.4;color:#f1fffd;overflow-wrap:anywhere;min-height:28px;display:grid;place-items:center}
.dsPassCardCount{font-size:11px;font-weight:850;color:#f4db9e;margin-top:-8px}
.dsPassCardAction{margin-top:auto;width:100%;min-height:29px;display:flex;align-items:center;justify-content:center}
.dsPassClaimBtn.hubBtn{width:100%;min-height:29px;font-size:10px;padding:4px}
.dsPassState{font-size:10px;color:#b1c3d0}
.dsPassState.ready{color:#ffe3a5}
.dsPassState.done{color:#a2f6cd}
.dsPassChoose,.dsPassInfo,.dsPassPacks{background:#123145;border:1px solid #3b6a79;border-radius:13px;padding:14px}
.dsPassChoose{border-color:#d6b473;background:linear-gradient(130deg,#3c3b43,#182f47);box-shadow:inset 0 1px #e6c58552}
.dsPassChooseTitle{color:#ffeca9;font-size:16px;font-weight:950}
.dsPassChoose p,.dsPassInfo p,.dsPassPacks p{color:#b6d7dc;font-size:11px;line-height:1.65;margin:7px 0}
.dsPassChooseRow,.dsPassPacks>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}
.dsPassChooseRow select{flex:1 1 190px;min-width:0;color:#effffb;background:#102a3e;border:1px solid #8b9d9c;border-radius:9px;padding:9px;font-size:13px;min-height:40px}
.dsPassChooseRow .hubBtn{flex:1 1 165px;min-height:40px}
.dsPassInfo h3,.dsPassPacks h3{font-size:14px;color:#ebfff5;margin:0 0 5px}
.dsPassPacks>div span{flex:1 1 100px;font-size:12px;color:#c6e4e0}
.dsPassPacks>div b{color:#ffe7a3;font-size:15px}
.dsPassPacks .hubBtn{min-height:34px}
@media(max-width:760px){
 #hubContent:has(.dsPassPage){padding:9px 10px}
 .dsPassPage{gap:9px}
 .dsPassHero{grid-template-columns:minmax(0,1fr);padding:13px;gap:9px}
 .dsPassHero h2{font-size:21px}
 .dsPassLevelPanel{padding:9px 12px}
 .dsPassLevelPanel>b{font-size:24px}
 .dsPassRewards{padding:9px}
 .dsPassCard{flex-basis:146px;min-height:200px}
 .dsPassActions>.hubBtn{flex:1 1 130px}
 .dsPassRewardsHead p{display:none}
 .dsPassRewardsHead h3{font-size:14px}
 .dsPassOverview span{padding:6px 8px}
}
@media(max-width:380px){
 .dsPassCard{flex-basis:137px}
 .dsPassHero h2{font-size:19px}
 .dsPassRanges .dsPassRange{min-width:67px;font-size:11px}
}
@media(prefers-reduced-motion:reduce){.dsPassXpRail>i{transition:none}}

/* Digital Street: optional, moderated public chat (v1). */
#dsLobbyChat{position:absolute;z-index:9;left:clamp(9px,1.7vw,24px);bottom:calc(18px + env(safe-area-inset-bottom));width:min(350px,calc(100vw - 25px));box-sizing:border-box;font-family:system-ui,"Noto Sans TC",sans-serif;color:#e8f9fb;font-size:12px;user-select:text;-webkit-user-select:text;pointer-events:auto}
#dsLobbyChat{display:flex;flex-direction:column-reverse;gap:7px}
#dsLobbyChat[hidden],#dsChatPanel[hidden],#dsChatReportForm[hidden],#dsChatAdmin[hidden],#dsChatReports[hidden]{display:none!important}
#dsLobbyChat button{font:inherit;cursor:pointer;color:#eefffb;border:1px solid #528e9b;background:#20586b;border-radius:8px;padding:6px 9px}
#dsLobbyChat button:disabled{cursor:not-allowed;opacity:.45}
#dsChatToggle{width:100%;min-height:48px!important;font-size:14px!important;font-weight:900!important;background:linear-gradient(135deg,#1a6475,#143757)!important;border:1px solid #86ded4!important;display:flex;align-items:center;justify-content:space-between;gap:10px;box-shadow:0 5px 23px #061528a6}
#dsChatState{font-size:10px;font-weight:700;color:#b8ced5}
#dsChatToggle{position:relative}
#dsChatUnread.dsChatUnread{position:absolute;right:-5px;top:-5px;z-index:3;width:14px;height:14px;min-width:14px;min-height:14px;border-radius:50%;background:#f44454;border:2px solid #fff7f7;box-shadow:0 0 0 2px #672633,0 2px 9px #ed4156a3;pointer-events:none}
#dsChatUnread[hidden]{display:none!important}
#dsChatToggle.has-unread{border-color:#ff8c96!important}
@media (prefers-reduced-motion:no-preference){
  #dsChatUnread:not([hidden]){animation:dsUnreadPulse 2.2s ease-in-out infinite}
  @keyframes dsUnreadPulse{0%,100%{box-shadow:0 0 0 2px #672633,0 2px 9px #ed4156a3}55%{box-shadow:0 0 0 4px #b34b5c66,0 2px 14px #ff5368dd}}
}
#dsChatState.live{color:#9affe0}
#dsChatPanel{margin-bottom:7px;display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid #5295a0;border-radius:13px;background:linear-gradient(155deg,#102d44f7,#0a2138f7);box-shadow:0 10px 33px #000b;max-height:min(70dvh,540px);overflow-y:auto;overscroll-behavior:contain;backdrop-filter:blur(8px)}
.dsChatHeader{display:flex;align-items:center;justify-content:space-between;gap:7px}
.dsChatHeader strong{font-size:13px;line-height:1.3}
#dsChatRefresh{flex:none;min-width:32px;height:30px;font-size:17px!important;padding:3px!important}
#dsChatStatus,#dsChatNotice{margin:0;font-size:10px;line-height:1.45;color:#a7d7d9;overflow-wrap:anywhere}
.dsChatRules{padding:7px 9px;margin:0;border:1px solid #3b697b;border-radius:8px;background:#142e42;color:#d1dacb;font-size:10px;line-height:1.45}
#dsChatFeed{display:flex;flex-direction:column;gap:7px;min-height:80px;height:205px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#508696 #173246;border-radius:9px;padding:8px;background:#081a2fb8;border:1px solid #385c70}
.dsChatEmpty{color:#a7bfc9;font-size:11px;line-height:1.5;text-align:center;margin:auto 0}
.dsChatMessage{background:#193c4f;border:1px solid #375f73;border-radius:9px;padding:7px 8px;overflow-wrap:anywhere}
.dsChatMessage.mine{background:#205149;border-color:#3d897b}
.dsChatMeta{display:flex;align-items:center;gap:6px;min-width:0}
.dsChatMeta strong{font-size:11px;color:#edfff6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dsChatMeta time{margin-left:auto;color:#9cbac5;font-size:10px;flex:none}
.dsChatStaff{padding:2px 5px;border:1px solid #efd18b;border-radius:6px;color:#ffe5a3;font-weight:800;font-size:9px;white-space:nowrap}
.dsChatBody{white-space:pre-wrap;word-break:break-word;font-size:12px;margin:5px 0 7px;line-height:1.6;color:#f2fcfa}
.dsChatMessageTools{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
#dsLobbyChat .dsChatMessageTools button{padding:2px 5px;font-size:10px;background:transparent;color:#b9dce4;border-color:#376779}
#dsLobbyChat .dsChatMessageTools button:hover{background:#235b71}
#dsChatForm{display:flex;flex-direction:column;gap:6px}
#dsChatForm label{font-size:10px;color:#b5d6d7;font-weight:700}
.dsChatSendRow{display:flex;gap:6px}
#dsChatInput{flex:1;min-width:0;border:1px solid #568c98;background:#091e30;color:#f7fffe;min-height:39px;padding:8px 10px;border-radius:8px;font-size:13px;box-sizing:border-box;user-select:text}
#dsChatSend{min-width:55px;min-height:39px}
#dsChatNotice{min-height:15px;color:#ffdd9d}
#dsChatReportForm{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:8px;border:1px solid #7b879a;background:#213548;border-radius:9px}
#dsChatReportForm label{font-size:11px;font-weight:800}
#dsChatReportForm select{min-width:130px;flex:1;background:#0d2639;color:#eafffc;border:1px solid #668e9d;border-radius:7px;padding:5px;font-size:12px}
#dsChatAdmin{padding:8px;border:1px solid #a2a679;background:#2c3543;border-radius:9px}
.dsChatAdminActions{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.dsChatAdminActions strong{color:#ffdea0}
#dsLobbyChat .dsChatAdminActions button{font-size:11px;padding:5px 7px}
#dsChatReports{margin-top:8px;padding-top:7px;border-top:1px solid #788889;max-height:150px;overflow-y:auto}
#dsChatReports>p{margin:2px 0 7px;font-size:10px}
.dsChatReportItem{padding:7px;border:1px solid #607581;border-radius:8px;background:#182d40;margin-bottom:7px}
.dsChatReportItem strong{display:block;font-size:11px;color:#ffe1a2}
.dsChatReportItem p{margin:5px 0;color:#deecf1;font-size:11px;word-break:break-word}
@media(max-width:700px){
 #dsLobbyChat{left:9px;bottom:calc(112px + env(safe-area-inset-bottom));width:min(320px,calc(100vw - 20px))}
 #dsLobbyChat:not(.expanded){width:155px}
 #dsChatToggle{min-height:36px!important;font-size:12px!important;padding:7px 9px!important}
 #dsChatState{font-size:9px}
 #dsChatPanel{padding:8px;max-height:min(56dvh,405px);gap:6px}
 #dsChatFeed{height:160px;min-height:70px}
 #dsChatInput{font-size:16px}
 .dsChatRules{font-size:9px}
}
@media(max-height:550px){
 #dsChatPanel{max-height:calc(100dvh - 165px)}
 #dsChatFeed{min-height:50px;height:105px}
}

/* Myotismon: blood moon entrance uses its own predecoded illustration. */
#bossIntroOverlay.myotismonIntro{background:radial-gradient(ellipse at center,rgba(89,5,18,.37),rgba(12,0,7,.9))}
#bossIntroOverlay.myotismonIntro::before{background:rgba(240,13,42,.11)}
#bossIntroOverlay.myotismonIntro .bossIntroEdge{border-color:rgba(240,22,48,.47);box-shadow:inset 0 0 105px rgba(234,28,42,.25)}
#bossIntroOverlay.myotismonIntro #bossIntroArt{filter:drop-shadow(0 0 26px rgba(252,27,45,.58));width:min(96vw,1200px);max-height:48vh}
#bossIntroOverlay.myotismonIntro.missingGatomonArt #bossIntroArt{visibility:hidden}
#bossIntroOverlay.myotismonIntro.missingGatomonArt::after{content:'吸血魔獸降臨';position:absolute;font:bold clamp(28px,5vw,69px) system-ui,sans-serif;color:#ffd7be;text-shadow:0 3px 5px #220008,0 0 25px #f32943}


/* Chapter 3: responsive dialogue / cinematic transcript (isolated from hub UI). */
#story3StoryUi{font-family:system-ui,"Noto Sans TC",sans-serif}
#story3StoryUi button{touch-action:manipulation;cursor:pointer}
.story3-log-fab{position:fixed;right:max(14px,env(safe-area-inset-right));top:68px;z-index:36;
  border:1px solid #e5b9ee9c;border-radius:12px;padding:10px 13px;
  color:#fff0ff;background:#241735ed;font-weight:800;font-size:13px;
  box-shadow:0 4px 18px #0903159c}
.story3-log-fab[hidden]{display:none!important}
.story3-scene-layer,.story3-log-layer{display:none;position:fixed;inset:0;z-index:120;
  align-items:center;justify-content:flex-end;flex-direction:column;
  background:radial-gradient(ellipse at 48% 35%,#4b183b9c,#0b0517eb 76%);
  overflow:auto;padding:clamp(8px,2vw,22px)}
.story3-scene-layer.show,.story3-log-layer.show{display:flex}
.story3-scene-layer:before{content:'';position:absolute;inset:0;pointer-events:none;
  background:repeating-linear-gradient(90deg,transparent 0 25px,#6d2d5320 26px 27px);
  opacity:.28}
.story3-scene-title{position:absolute;top:max(20px,env(safe-area-inset-top));left:50%;
  transform:translateX(-50%);font-size:clamp(12px,1.6vw,17px);font-weight:900;
  white-space:nowrap;letter-spacing:.14em;color:#ffe5d6;text-shadow:0 2px 10px #07000f}
#story3SceneCanvas{position:relative;display:block;width:min(92vw,900px);height:auto;
  max-height:50vh;object-fit:contain;filter:drop-shadow(0 8px 10px #000a)}
.story3-dialogue{position:relative;z-index:1;margin-top:5px;width:min(94vw,940px);
  border:2px solid #dfb7e9;border-radius:17px;padding:17px 21px 12px;
  background:linear-gradient(130deg,#22152ef5,#110f27f7);
  box-shadow:0 0 0 3px #090712b9,0 15px 35px #000a;color:#fff6fa}
.story3-speaker{display:inline-flex;background:linear-gradient(95deg,#a44179,#552b86);
  padding:7px 17px;margin-top:-31px;border:1px solid #ebaccf;border-radius:10px;
  font-size:17px;font-weight:1000;letter-spacing:.09em}
.story3-line{font-size:clamp(17px,2.1vw,23px);font-weight:750;line-height:1.55;
  min-height:70px;padding:11px 1px 6px;white-space:pre-wrap}
.story3-dialogue-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.story3-dialogue-actions button,.story3-log-header button{border:1px solid #bea2d6;
  border-radius:9px;padding:10px 14px;color:#fff0fa;font-weight:850;
  background:#54366c;font-size:13px}
.story3-dialogue-actions #story3SceneNext{background:#8e335b;border-color:#ffcbe3}
.story3-dialogue-actions button:hover,.story3-log-header button:hover{filter:brightness(1.18)}
.story3-log-layer{z-index:130;background:#070915ed;justify-content:center;backdrop-filter:blur(6px)}
.story3-log-panel{width:min(93vw,820px);height:min(78vh,650px);display:flex;flex-direction:column;
  border:2px solid #b9a3df;border-radius:18px;overflow:hidden;
  background:linear-gradient(155deg,#211833,#100f25);box-shadow:0 15px 45px #000b}
.story3-log-header{display:flex;gap:12px;flex-wrap:wrap;align-items:center;
  justify-content:space-between;padding:15px 18px;background:#352445;border-bottom:1px solid #795a8d}
.story3-log-header strong{font-size:clamp(15px,2vw,20px);color:#ffecdf}
.story3-log-entries{padding:16px 21px;overflow:auto;flex:1;line-height:1.7}
.story3-log-entries p{margin:0 0 14px;padding-bottom:11px;color:#f6e8fb;
  border-bottom:1px solid #a387c222;font-size:clamp(14px,1.8vw,18px)}
.story3-log-entries strong{color:#ffbfca;margin-right:8px}
@media (max-width:700px){
  .story3-log-fab{top:58px;right:8px;font-size:11px;padding:7px 9px}
  .story3-scene-layer{justify-content:flex-end;padding:8px 7px calc(12px + env(safe-area-inset-bottom))}
  .story3-scene-title{font-size:11px;top:12px}
  #story3SceneCanvas{width:min(98vw,570px);max-height:42vh}
  .story3-dialogue{width:100%;padding:14px 12px 12px;border-radius:13px}
  .story3-speaker{font-size:14px;padding:5px 11px;margin-top:-24px}
  .story3-line{font-size:16px;min-height:65px;line-height:1.45}
  .story3-dialogue-actions{gap:5px}
  .story3-dialogue-actions button{font-size:12px;padding:9px 10px}
  .story3-log-panel{height:82vh}
  .story3-log-entries{padding:13px}
}
@media (prefers-reduced-motion:reduce){
  #story3SceneCanvas{filter:none}
}

/* 2026-11-18: readable long-form update notices and account-level unread dots */
#townOverlay .townQuickDock [data-town-service="news"].townNewsUnread,
#townOverlay #townQuickToggle.townNewsUnread{
  position:relative;
}
#townOverlay .townQuickDock [data-town-service="news"].townNewsUnread::after,
#townOverlay #townQuickToggle.townNewsUnread::after{
  content:"";
  position:absolute;
  top:6px;right:8px;width:10px;height:10px;border-radius:50%;
  background:#ff3f64;
  box-shadow:0 0 0 2px #102d43,0 0 10px #ff577a;
  pointer-events:none;
}
.townServiceCard p.townBulletinBody{
  margin:8px 0 0;
  white-space:pre-wrap;
  font-size:13px;
  line-height:1.8;
  color:#d4e8f1;
}
.townBulletinBody strong{font-weight:850;color:#f3fff9}
.townBulletinBody .townNoticeHeading{
  display:inline-block;color:#94ffdc;font-size:14px;line-height:1.7;
  margin-top:4px;
}
.townBulletinBody .townNoticeDivider{
  display:block;height:1px;margin:2px 0;background:#496879;
}
@media(max-width:650px){
  .townServiceCard p.townBulletinBody{font-size:12px;line-height:1.8}
  .townBulletinBody .townNoticeHeading{font-size:13px}
  #townOverlay .townQuickDock [data-town-service="news"].townNewsUnread::after,
  #townOverlay #townQuickToggle.townNewsUnread::after{
    width:9px;height:9px;top:4px;right:5px;
  }
}


/* Mobile combat HUD v1: 8 icon-only skills/passives and reliable dash */
@media (max-width:1000px) and (pointer:coarse), (max-width:600px) {
  /* A single thin row of 4 passive + 4 active slots stays ABOVE both
     virtual controls, leaving the center of the battle field visible. */
  #bottomHUD{
    left:50%;right:auto;bottom:calc(174px + env(safe-area-inset-bottom));
    width:calc(100vw - 14px);max-width:430px;
    transform:translateX(-50%);pointer-events:none;
  }
  #loadoutHUD{
    display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    align-items:center;gap:4px;width:100%;
  }
  #passiveHUD,#weaponHUD{
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    gap:3px;width:100%;min-width:0;
  }
  #passiveHUD .futureSpecial{display:none!important}
  #bottomHUD .loadoutSlot{
    min-width:0;height:40px;padding:2px 1px 1px;border-radius:8px;
    display:flex;flex-direction:column;align-items:center;
    justify-content:center;gap:0;overflow:hidden;
    box-shadow:0 2px 5px #0006;
  }
  #bottomHUD .slotIcon{
    width:22px;height:22px;font-size:14px;line-height:1;
    border-radius:5px;flex:0 0 auto;
  }
  #bottomHUD .slotMain{
    display:block;flex:0 0 auto;width:100%;min-width:0;height:12px;
    text-align:center;overflow:hidden;
  }
  #bottomHUD .slotName,
  #bottomHUD .slotTag,
  #bottomHUD .slotHint{display:none!important}
  #bottomHUD .slotMeta{display:flex;justify-content:center;gap:0;width:100%}
  #bottomHUD .slotLevel{
    display:block;padding:0 1px;font-size:9px;font-weight:1000;
    line-height:12px;white-space:nowrap;background:transparent;
    border-radius:0;text-shadow:0 1px 2px #000;
  }
  /* Cooldown shade remains visible; large countdown text cannot cover
     the icon or obscure the level on tiny displays. */
  #bottomHUD .loadoutSlot.skill.cooling .cdTime{display:none}
  #dashBtn{
    display:block;right:17px;bottom:calc(26px + env(safe-area-inset-bottom));
    width:72px;height:72px;z-index:6;
    touch-action:none;-webkit-user-select:none;user-select:none;
    -webkit-tap-highlight-color:transparent;
    font-size:12px;line-height:1.3;
  }
}
@media (max-width:900px) and (max-height:440px) and (pointer:coarse){
  /* Landscape phones have much less vertical space. */
  #bottomHUD{bottom:calc(104px + env(safe-area-inset-bottom))}
  #bottomHUD .loadoutSlot{height:36px}
  #dashBtn{width:60px;height:60px;bottom:calc(14px + env(safe-area-inset-bottom))}
  #touchArea{
    left:16px;bottom:calc(8px + env(safe-area-inset-bottom));
    width:100px;height:100px;
  }
  #stick{left:22px;top:22px}
}


/* 2026-11-18 · Author profile (town feature menu)
   The five buttons open creator-owned external sites; no save mutations. */
#townServiceOverlay.authorMode .townServicePanel{
  width:min(560px,92vw);height:min(630px,86dvh);
}
#townServiceOverlay.authorMode .townServiceFooter{display:none}
#townServiceOverlay.authorMode .townServiceBody{
  display:flex;align-items:stretch;justify-content:flex-start;
  padding:clamp(12px,3vw,23px);
}
.townAuthorCard{
  flex:0 0 auto;margin:auto;
  width:100%;max-width:490px;min-width:0;padding:22px 19px 17px;
  border:1px solid #5c94a9;border-radius:20px;
  background:radial-gradient(ellipse at 50% -20%,#3067788a,transparent 70%),
             linear-gradient(145deg,#14394dbf,#0c2239f2);
  box-shadow:0 10px 26px #0016245c,inset 0 1px 0 #ffffff20;
  text-align:center;
}
.townAuthorEmblem{
  width:64px;height:64px;border-radius:22px;margin:0 auto 11px;
  display:grid;place-items:center;font-size:37px;
  border:1px solid #e8b9d8;background:linear-gradient(145deg,#60445e,#1d5365);
  box-shadow:0 6px 22px #c377ae30;
}
.townAuthorEmblem img{
  display:block;width:88%;height:88%;object-fit:contain;
  image-rendering:pixelated;pointer-events:none;
}
.townAuthorEyebrow{
  font-size:11px;font-weight:900;letter-spacing:.13em;color:#9ceadf;
}
.townAuthorCard h3{
  font-size:22px;line-height:1.3;margin:7px 0 12px;color:#fff4fc;
  text-shadow:0 3px 14px #0006;
}
.townAuthorIntro{
  margin:0 auto!important;font-size:14px!important;line-height:1.95!important;
  color:#d7ecf1!important;white-space:pre-line!important;max-width:410px;
}
.townAuthorDivider{
  width:80%;height:1px;background:linear-gradient(90deg,transparent,#89d9e3,transparent);
  margin:18px auto 14px;
}
.townAuthorLinkHeading{
  color:#a7e9e7;font-size:12px;font-weight:850;margin-bottom:11px;
}
.townAuthorLinks{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;
}
.townAuthorLink{
  display:flex;align-items:center;justify-content:center;gap:8px;
  min-width:0;min-height:53px;padding:10px 9px;
  border:1px solid #6eb7c4;border-radius:12px;
  background:linear-gradient(145deg,#1c5369,#12334b);
  color:#f4fcff;text-decoration:none;font-size:14px;font-weight:900;
  box-shadow:0 4px 11px #0014226b;touch-action:manipulation;
  transition:transform .14s ease,filter .14s ease,border-color .14s ease;
}
.townAuthorLink:hover{transform:translateY(-2px);filter:brightness(1.12)}
.townAuthorLink:focus-visible{outline:3px solid #a7f1ea;outline-offset:2px}
.townAuthorLink>span:first-child{font-size:18px;line-height:1}
.townAuthorLink .townAuthorExternal{font-size:13px;opacity:.75;margin-left:1px}
.townAuthorLink.youtube{border-color:#ed8c98;background:linear-gradient(145deg,#71364e,#4c3048)}
.townAuthorLink.facebook{border-color:#85b6fa;background:linear-gradient(145deg,#254d82,#1a3658)}
.townAuthorLink.instagram{border-color:#d6a3ef;background:linear-gradient(145deg,#683c79,#563f72)}
.townAuthorLink.discord{border-color:#a4acff;background:linear-gradient(145deg,#4957a3,#313e7e)}
/* Fifth button gets an easy-to-tap, full-width row on desktop and mobile. */
.townAuthorLink.coffee{grid-column:1 / -1;border-color:#eec386;background:linear-gradient(145deg,#8b5835,#66412c)}
.townAuthorFootnote{
  margin:13px 2px 0!important;font-size:11px!important;line-height:1.6!important;
  color:#bacbd9!important;
}
@media(max-width:810px){
  #townServiceOverlay.authorMode .townServicePanel{
    width:100%;height:min(625px,88dvh);max-height:88dvh;
    border-radius:20px 20px 0 0;
  }
  #townServiceOverlay.authorMode .townServiceBody{padding:12px 11px}
  .townAuthorCard{padding:16px 12px 14px;border-radius:15px}
  .townAuthorEmblem{width:53px;height:53px;border-radius:18px;font-size:29px;margin-bottom:8px}
  .townAuthorCard h3{font-size:19px;margin:5px 0 9px}
  .townAuthorIntro{font-size:13px!important;line-height:1.8!important}
  .townAuthorDivider{margin:12px auto 10px}
  .townAuthorLink{min-height:47px;font-size:13px;padding:8px 6px;gap:5px}
  .townAuthorLinks{gap:8px}
}
@media(max-width:360px){
  .townAuthorCard{padding:12px 9px}
  .townAuthorIntro{font-size:12px!important;line-height:1.7!important}
  .townAuthorLink{font-size:12px}
  .townAuthorFootnote{font-size:10px!important}
}
@media(prefers-reduced-motion:reduce){
  .townAuthorLink{transition:none}
  .townAuthorLink:hover{transform:none}
}


/* 2026-11-18 Mobile combat HUD: skill/passive row closest to screen bottom. */
@media (max-width:1000px) and (pointer:coarse), (max-width:600px){
  #bottomHUD{
    bottom:calc(9px + env(safe-area-inset-bottom));
    width:calc(100vw - 14px);
  }
  #touchArea{
    bottom:calc(84px + env(safe-area-inset-bottom));
  }
  #dashBtn{
    bottom:calc(115px + env(safe-area-inset-bottom));
  }
}
@media (max-width:900px) and (max-height:440px) and (pointer:coarse){
  #bottomHUD{bottom:calc(6px + env(safe-area-inset-bottom))}
  #touchArea{bottom:calc(56px + env(safe-area-inset-bottom))}
  #dashBtn{bottom:calc(77px + env(safe-area-inset-bottom))}
}

/* Pause status panel: responsive, read-only, scrollable in mobile portrait. */
#pauseOverlay .pausePanel{
  width:min(880px,100%);max-width:880px;
  height:min(790px,90dvh);max-height:90dvh;
  display:flex;flex-direction:column;overflow:hidden;
  padding:clamp(15px,3vw,26px);
}
.pauseIntro{text-align:center;flex:0 0 auto;margin-bottom:11px}
.pauseIntro h2{margin:4px 0;font-size:clamp(23px,4vw,31px);line-height:1.25;color:#fff4dc}
.pauseIdentity{font-size:12px;color:#a8e8da;line-height:1.6;margin:4px 0 0}
.pauseScroll{
  flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  padding:1px 5px 8px 1px;scrollbar-width:thin;scrollbar-color:#4f869a transparent;
}
.pauseSection{min-width:0;margin:0 0 13px}
.pauseSectionTitle{
  display:flex;align-items:center;gap:9px;margin:0 0 8px;
  color:#c6fff0;font-size:14px;font-weight:900;line-height:1.35;text-align:left;
}
.pauseSectionTitle small{margin-left:auto;font-size:10px;font-weight:700;color:#8daabb;white-space:nowrap}
.pauseStatGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.pauseStatItem{
  min-width:0;display:flex;flex-direction:column;gap:4px;
  padding:9px 10px;border:1px solid #38657a;border-radius:10px;
  background:linear-gradient(145deg,#163747b8,#10253baf);text-align:left;
}
.pauseStatItem span{color:#a6c8d5;font-size:10px;line-height:1.4}
.pauseStatItem strong{color:#f4f9ff;font-size:17px;line-height:1.15;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.pauseStatNote{font-size:10px;line-height:1.55;color:#8ba9bc;text-align:left;margin:6px 2px 0}
.pauseLoadoutColumns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.pauseSkillList{display:flex;flex-direction:column;gap:7px}
.pauseSkillEntry{display:flex;align-items:flex-start;gap:9px;min-width:0;padding:9px;border:1px solid #395e79;border-radius:11px;background:#0d2539b8;text-align:left}
.pauseSkillIcon{flex:0 0 36px;display:grid;place-items:center;width:36px;height:36px;border:1px solid #6388a1;border-radius:9px;background:#19344d;font-size:20px}
.pauseSkillMain{flex:1;min-width:0}
.pauseSkillTop{display:flex;justify-content:space-between;gap:6px;align-items:center}
.pauseSkillTop strong{color:#f4faff;font-size:12px;overflow-wrap:anywhere}
.pauseSkillLevel{font-size:10px;font-weight:900;flex:0 0 auto;padding:2px 5px;color:#9dffe2;background:#173b45;border-radius:7px}
.pauseSkillType{font-size:10px;color:#9cc8dd;line-height:1.5;margin-top:2px}
.pauseSkillDesc{font-size:11px;color:#d2e2ef;line-height:1.5;margin:5px 0 0}
.pauseSkillAug{font-size:10px;color:#ffdfa3;line-height:1.5;margin-top:5px}
.pauseEmpty{font-size:12px;color:#97afbf;text-align:left;border:1px dashed #3b6470;border-radius:10px;padding:15px 10px;margin:0}
#pauseOverlay .pauseActions{
  display:flex;flex:0 0 auto;margin:8px 0 0;
  padding-top:11px;border-top:1px solid #345d73;gap:9px;
}
#pauseOverlay .pauseActions button{flex:1;min-width:0;min-height:44px;padding:10px 10px;font-size:13px}
#pauseOverlay .pauseActions .primary{width:auto}
@media (max-width:680px){
  #pauseOverlay{padding:calc(7px + env(safe-area-inset-top)) 8px calc(7px + env(safe-area-inset-bottom))}
  #pauseOverlay .pausePanel{width:100%;height:min(720px,90dvh);padding:14px 12px}
  .pauseIntro{margin-bottom:8px}
  .pauseIntro h2{font-size:24px}
  .pauseIdentity{font-size:10px}
  .pauseStatGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .pauseStatItem{padding:8px}
  .pauseStatItem strong{font-size:15px}
  .pauseLoadoutColumns{grid-template-columns:minmax(0,1fr);gap:0}
  .pauseSectionTitle{font-size:12px}
  .pauseSkillEntry{padding:8px}
  #pauseOverlay .pauseActions button{font-size:12px}
}

/* Creator credit: non-intrusive provenance text; does not affect gameplay. */
.hubCredit{font-size:10px;line-height:1.7;color:#98bdc9}
.townAuthorProvenance{
  margin:10px auto 0!important;
  padding:9px 10px;
  max-width:420px;
  font-size:10px!important;
  line-height:1.65!important;
  color:#a5c5d2!important;
  border-top:1px solid #4b7280;
  text-align:center;
}
@media(max-width:810px){
 .townAuthorProvenance{font-size:9px!important;line-height:1.6!important;padding:8px 3px}
}

/* Public cooperative beta entry: separate from solo progress. */
.townDock button.townCoopLaunch{border-color:#e2c987;background:linear-gradient(145deg,#264550,#122e42)}
.townCoopLaunch .townIco{filter:drop-shadow(0 0 3px #fff2b0)}
#hubNav #hubCoopLaunch{color:#ffdeaf;border-color:#6b6650;background:#263b42}
#hubNav #hubCoopLaunch:hover{background:#345b60;color:#fff0b5}
.hubBtn.coopTestBtn{background:#214657;color:#d2f9ef;border:1px solid #77c7c5}
@media(max-width:700px){.playBar .coopTestBtn{flex:1 1 135px}}


/* 2026-11-19: leaner Digi Card Selection UI (desktop + mobile).
   A single attribute label appears on the artwork; no duplicate type/element chips.
   Functionality, card rarity, and per-card reroll actions remain unchanged. */
#levelPanel .choice .tcgTop{
  height:35px!important;
  gap:6px!important;
  padding:4px 8px!important;
}
#levelPanel .tcgType{
  display:flex;align-items:center;
  flex:1;min-width:0;line-height:1.1;
}
#levelPanel .tcgType .typeMajor{
  display:block;
  font-size:clamp(15px,1.55vw,18px)!important;
  line-height:1.1!important;
  letter-spacing:.015em;
  white-space:nowrap;
  font-weight:1000;
}
#levelPanel .tcgTopLevel{font-size:10px!important;flex:none}
#levelPanel .tcgVisualLabel{
  top:5px!important;left:9px!important;
  padding:5px 9px!important;
  border-radius:6px;
  font-size:13px!important;
  font-weight:1000;
  line-height:1.2;
  letter-spacing:.01em;
  max-width:calc(100% - 100px);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  background:#071627eb;
  box-shadow:0 2px 7px #0007;
}
#levelPanel .tcgNameRow{
  display:flex;align-items:center;
  flex-wrap:nowrap!important;min-width:0;
  gap:7px!important;
}
#levelPanel .tcgSkillName{
  flex:1 1 auto;min-width:0;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  font-size:clamp(15px,1.5vw,18px)!important;
  line-height:1.24!important;
}
#levelPanel .tcgRarity{
  flex:0 0 auto;
  font-size:12px!important;
  padding:4px 6px!important;
}
#levelPanel .tcgBody{min-width:0}
#levelPanel .tcgBonus{
  overflow-wrap:anywhere;
  line-height:1.35!important;
}
#levelPanel .choiceWrap .refreshOne{
  top:41px!important;right:9px!important;
  min-width:68px;min-height:34px;
  padding:6px 9px!important;
  font-size:12px!important;font-weight:1000;
  letter-spacing:.015em;
  border:2px solid #b9eaff;
  border-radius:9px;
  color:#fff;
  background:linear-gradient(145deg,#294c68,#102c49);
  box-shadow:0 3px 7px #0009,0 0 0 1px #143047;
  white-space:nowrap;
  touch-action:manipulation;
}
#levelPanel .choiceWrap .refreshOne:focus-visible{
  outline:3px solid #ffec94;outline-offset:2px;
}
@media(max-width:760px){
  #levelPanel .choice .tcgTop{height:35px!important;padding:4px 8px!important}
  #levelPanel .tcgType .typeMajor{font-size:18px!important}
  #levelPanel .tcgVisualLabel{font-size:13px!important;padding:5px 9px!important}
  #levelPanel .tcgSkillName{font-size:18px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #levelPanel .tcgRarity{font-size:13px!important}
  #levelPanel .choiceWrap .refreshOne{
    top:41px!important;right:8px!important;
    min-height:38px;min-width:76px;
    font-size:13px!important;padding:7px 10px!important;
  }
}
@media(max-width:375px){
  #levelPanel .tcgSkillName{font-size:16px!important}
}
@media(max-height:560px) and (max-width:760px){
  #levelPanel .choiceWrap .refreshOne{top:38px!important;min-height:31px;padding:5px 8px!important}
  #levelPanel .tcgVisualLabel{padding:4px 8px!important}
}


/* 2026-11-19 · Stage-select mobile UX: entire Adventure 01 map fits one view.
   Keep the original illustrated 1120×730 SVG and pin coordinates; only scale.
   No horizontal pan or sideways swipe, and a full-width readable stage summary. */
.playBarInfo{flex:1 1 260px;min-width:0}
.playBarStageTitle{display:block;font-size:16px;line-height:1.45;color:#e7fff4;overflow-wrap:anywhere}
.playBarDetails{font-size:11px;color:#a4c5cf;line-height:1.55;overflow-wrap:anywhere}
.playBarExperience{font-size:12px;line-height:1.55;overflow-wrap:anywhere}
.adventureMapInfoContent{flex:1 1 100%;min-width:0}
.adventureMapInfo p{line-height:1.6;overflow-wrap:anywhere}

@media (max-width:760px){
  /* The SVG and all 8 stage pins share a common responsive coordinate space. */
  .adventureMapWrap{width:100%;min-width:0;margin:10px 0 13px;overflow:hidden}
  .adventureMapPan{
    width:100%!important;overflow:hidden!important;
    overscroll-behavior:contain;
    touch-action:pan-y;
    scrollbar-width:none;
  }
  .adventureMapPan::-webkit-scrollbar{display:none}
  .adventureMapScene{
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:auto!important;aspect-ratio:1120 / 730!important;
    overflow:hidden;
  }
  .adventureMapArt{width:100%;height:100%}
  .adventurePin{
    width:clamp(45px,16%,64px)!important;
    min-width:0!important;
    min-height:47px!important;
    padding:0!important;gap:0;
    touch-action:manipulation;
    filter:drop-shadow(0 1px 2px #08263cbb);
  }
  .adventurePinCrest{
    width:clamp(27px,8vw,36px)!important;
    height:clamp(27px,8vw,36px)!important;
    border-width:2px!important;
    box-shadow:0 0 0 2px #2b425c,0 2px 0 #08283b!important;
    font-size:clamp(13px,3.9vw,18px)!important;
  }
  .adventurePin.isCurrent .adventurePinCrest{
    box-shadow:0 0 0 2px #31758f,0 0 0 5px #edecb168,0 0 12px #c3ffca!important;
  }
  .adventurePinNum{
    top:-6px;left:-7px;
    min-width:17px;height:17px;
    border-width:1px;font-size:9px;
  }
  .adventurePinLabel{
    display:block;min-width:0!important;
    width:max-content!important;max-width:76px!important;
    padding:3px 4px 4px!important;margin-top:3px!important;
    border-radius:5px!important;
    font-size:clamp(8px,2.35vw,10px)!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    text-align:center;
    box-shadow:0 2px 2px #061f3677;
  }
  /* Lock and clear status are represented by the pin icon on small screens. */
  .adventurePinStatus{display:none!important}
  .adventureMapTop{padding:9px 10px;gap:5px}
  .adventureMapTop strong{font-size:13px}
  .adventureMapTop small{font-size:10px;line-height:1.45}
  .adventureMapTip{display:block;font-size:10px;line-height:1.5}
  .adventureMapProgress{font-size:10px;padding:5px 8px}
  .adventureMapInfo{display:block;padding:10px 12px}
  .adventureMapInfoContent{width:100%;min-width:0}
  .adventureMapInfoTitle{gap:5px;flex-wrap:wrap;min-width:0}
  .adventureMapInfoTitle strong{font-size:14px}
  .adventureMapInfo .advTag{font-size:10px}
  .adventureMapInfo p{font-size:11px;line-height:1.6;white-space:normal;word-break:normal}
  /* No more 1-character-per-line text squeezed between two wide buttons. */
  .playBar{
    /* Keep the selected stage and launch buttons reachable while browsing materials. */
    position:sticky!important;bottom:0!important;z-index:8;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;
    gap:9px!important;
    width:100%!important;min-width:0!important;
    padding:13px 10px!important;
    margin-top:8px;
    border-radius:12px;
    flex-wrap:initial!important;
  }
  .playBarInfo{
    grid-column:1 / -1;grid-row:1;
    display:block!important;
    width:100%!important;min-width:0!important;
    flex:none!important;
    overflow-wrap:break-word;
    word-break:normal;
    padding:0 2px 3px;
  }
  .playBarStageTitle{font-size:16px;line-height:1.5;margin-bottom:4px}
  .playBarDetails{font-size:12px;line-height:1.6}
  .playBarExperience{font-size:12px;line-height:1.65;margin-top:6px}
  .playBar>.hubBtn{
    min-width:0!important;max-width:100%!important;
    width:100%!important;
    min-height:48px;
    margin:0!important;
    padding:9px 6px!important;
    font-size:12px!important;
    line-height:1.35;
    white-space:normal;
    overflow-wrap:anywhere;
    text-align:center;
  }
}
@media(max-width:360px){
  .adventurePin{width:45px!important}
  .adventurePinCrest{width:27px!important;height:27px!important}
  .adventurePinLabel{font-size:8px!important;padding:2px 3px!important}
  .playBar{gap:6px!important;padding:11px 7px!important}
  .playBar>.hubBtn{font-size:11px!important}
}

/* Chapter 4: the uploaded 3:1 Malomyotismon arrival banner uses the shared 3.5s sequence. */
#bossIntroOverlay.malomyotismonIntro{background:radial-gradient(ellipse at center,rgba(126,5,22,.36),rgba(11,0,7,.9))}
#bossIntroOverlay.malomyotismonIntro::before{background:rgba(244,32,35,.10)}
#bossIntroOverlay.malomyotismonIntro .bossIntroEdge{border-color:rgba(255,151,31,.60);box-shadow:inset 0 0 80px rgba(245,24,40,.25)}
#bossIntroOverlay.malomyotismonIntro #bossIntroArt{width:min(98vw,1320px);max-height:52vh;filter:drop-shadow(0 0 20px rgba(240,36,38,.48))}
#bossIntroOverlay.malomyotismonIntro.missingGatomonArt #bossIntroArt{visibility:hidden}
#bossIntroOverlay.malomyotismonIntro.missingGatomonArt::after{content:'究極吸血魔獸 降臨';position:absolute;font:bold clamp(28px,5vw,70px) system-ui,sans-serif;color:#ffe3ae;text-shadow:0 3px 6px #26040a,0 0 25px #ef353a}


/* Role-page full-body male/female original art: sharp, unblurred and displayed
   BEHIND readable UI cards. Old 80x120 role portraits are not used. */
.dsRolePage{position:relative;isolation:isolate;min-height:750px;overflow:hidden}
.dsRolePage>:not(.dsRoleWatermark){position:relative;z-index:1}
.dsRoleWatermark{
  display:block;position:absolute;z-index:0;
  top:25px;right:-8px;
  width:min(64%,460px);height:auto;aspect-ratio:2/3;
  object-fit:contain;object-position:right top;
  opacity:.80;
  image-rendering:auto;
  filter:none!important;
  pointer-events:none;user-select:none;
}
.dsRolePage .dataCard{
  /* Text stays readable; the clear full-body art remains visible on the right. */
  background:linear-gradient(90deg,rgba(20,54,68,.98) 0%,rgba(19,51,65,.88) 52%,rgba(15,40,53,.24) 100%);
}
/* Leave the large trainer artwork visible: the first two cards stop at
   approximately 43% of the role page, the name field at 55%.
   The other cards and the statistics row keep their original width. */
.dsRolePage > .dsRoleAppearanceCard,
.dsRolePage > .dsRoleGenderCard{
  box-sizing:border-box;
  width:43%;
  max-width:340px;
  min-width:260px;
  margin-right:auto;
}
.dsRolePage > .dsRoleNameCard{
  box-sizing:border-box;
  width:55%;
  max-width:415px;
  min-width:330px;
  margin-right:auto;
}
.dsRoleNameCard #trainerNameInput{
  flex:1 1 160px;
  min-width:0;
  box-sizing:border-box;
}
@media(max-width:700px){
  /* The old 100%-width mobile override covered the illustration.
     Keep the first two cards in the left column and the name card slightly
     wider for editable text, without allowing horizontal overflow. */
  .dsRolePage > .dsRoleAppearanceCard,
  .dsRolePage > .dsRoleGenderCard{
    width:clamp(180px,66%,250px);
    max-width:100%;
    min-width:0;
    margin-left:0;
  }
  .dsRolePage > .dsRoleNameCard{
    width:clamp(226px,82%,320px);
    max-width:100%;
    min-width:0;
    margin-left:0;
  }
  .dsRoleGenderCard .hubActionRow,
  .dsRoleNameCard .hubActionRow{
    display:flex;
    flex-wrap:nowrap;
    gap:6px;
  }
  .dsRoleGenderCard .hubActionRow .hubBtn,
  .dsRoleNameCard .hubActionRow .hubBtn{
    flex:0 0 auto;
    padding-left:10px;
    padding-right:10px;
  }
  .dsRoleNameCard #trainerNameInput{
    width:0;
    flex:1 1 0;
    min-width:0;
    max-width:none!important;
  }
}
.dsRoleAppearanceCard{
  display:flex;align-items:center;justify-content:flex-start;
  gap:13px;flex-wrap:wrap;min-height:142px;
  padding-left:15px;position:relative;
}
.dsRoleAppearanceCard #trainerRoleCanvas{
  display:block;flex:0 0 88px;width:88px;height:108px;
  image-rendering:pixelated;
}
.dsRoleAppearanceText{flex:0 1 auto;min-width:0;text-align:left}
.dsRolePage .dataCard,.dsRolePage .metricRow{position:relative}
@media(max-width:810px){
  .dsRolePage{min-height:640px}
  .dsRoleWatermark{top:65px;right:-6px;width:min(59%,350px);opacity:.76}
  .dsRoleAppearanceCard{gap:9px;padding-left:12px;flex-wrap:nowrap}
  .dsRoleAppearanceCard #trainerRoleCanvas{flex-basis:76px;width:76px;height:93px}
}
@media(max-width:470px){
  .dsRoleWatermark{top:116px;right:-6px;width:62%;opacity:.76}
  .dsRolePage .dataCard{
    background:linear-gradient(90deg,rgba(20,54,68,.98) 0%,rgba(19,51,65,.94) 60%,rgba(15,40,53,.40) 100%);
  }
  .dsRoleAppearanceCard{padding-left:9px;gap:6px}
  .dsRoleAppearanceCard #trainerRoleCanvas{flex-basis:58px;width:58px;height:72px}
  .dsRoleAppearanceText h3{font-size:12px}
  .dsRoleAppearanceText p{font-size:10px}
}

/* The male purple/gold gala full-body illustration sat too far right.
   Adjust only that costume, not female/default portraits or in-town sprites.
   Preserve its size and aspect ratio; move horizontally without cropping. */
.dsRolePage[data-gender="male"][data-outfit="openfest"] .dsRoleWatermark{
  right:52px;  /* 60px left of the previous -8px desktop position */
}
@media(max-width:810px){
  .dsRolePage[data-gender="male"][data-outfit="openfest"] .dsRoleWatermark{
    right:30px;
  }
}
@media(max-width:470px){
  .dsRolePage[data-gender="male"][data-outfit="openfest"] .dsRoleWatermark{
    right:7px; /* retain room for the portrait on narrow phones */
  }
}


/* Compact notice board: text at top, whole banner below, text-only as a row. */
.townNewsIntro{margin-bottom:10px;line-height:1.45}
.townNewsList{display:grid;gap:10px;padding-bottom:12px}
.townNewsItem{overflow:hidden;border:1px solid #49788c;border-radius:13px;
  background:linear-gradient(120deg,#16394f,#102b43 80%);
  box-shadow:0 7px 18px #0418283d,inset 0 1px #ffffff0c}
.townNewsItem[open]{border-color:#84d5cd;box-shadow:0 8px 21px #05192e80}
.townNewsSummary{display:grid;grid-template-columns:minmax(0,1fr) 34px;
  align-items:center;list-style:none;cursor:pointer;min-height:60px;outline-offset:-3px}
.townNewsSummary::-webkit-details-marker{display:none}
.townNewsSummary::marker{content:''}
.townNewsSummary:hover{background:#24708b22}
.townNewsSummary:focus-visible{outline:2px solid #91e9db}
.townNewsSummaryText{min-width:0;display:flex;flex-direction:column;
  justify-content:center;gap:4px;padding:12px 15px}
.townNewsMeta{display:flex;flex-wrap:wrap;gap:4px 9px;align-items:center;
  color:#a8cbd9;font-size:10px;line-height:1.4}
.townNewsCategory,.townNewsLatest{font-size:10px;padding:2px 6px;
  background:#27566d;border-radius:5px;color:#caffef}
.townNewsLatest{background:#695231;color:#ffedba}
.townNewsTitle{color:#f1ffff;font-weight:800;font-size:15px;line-height:1.35;
  overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.townNewsExcerpt{font-size:11px;color:#b7d9e4;line-height:1.45;
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.townNewsChevron{align-self:center;justify-self:center;color:#9de9e5;
  font-size:24px;transition:transform .2s ease}
.townNewsItem[open] .townNewsChevron{transform:rotate(180deg)}
/* Illustrated notices: short text header (red-marked region), image below
   across the entire card (blue-marked region). Never crop banner edges. */
.townNewsWithImage .townNewsSummary{grid-template-rows:auto auto}
.townNewsWithImage .townNewsSummaryText{grid-column:1;grid-row:1;padding:12px 16px}
.townNewsWithImage .townNewsChevron{grid-column:2;grid-row:1}
.townNewsArtwork{grid-column:1/-1;grid-row:2;display:block;
  width:100%;min-width:0;max-height:none;overflow:hidden;
  line-height:0;background:transparent}
.townNewsArtwork img{display:block;position:static;
  width:100%;height:auto;max-width:100%;aspect-ratio:auto;
  object-fit:contain;object-position:center;background:transparent}
.townNewsItem:hover .townNewsArtwork img{filter:brightness(1.04)}
/* No image: remove the thumbnail area entirely and make a short headline row. */
.townNewsCompact .townNewsSummary{min-height:58px}
.townNewsCompact .townNewsSummaryText{flex-direction:row;flex-wrap:wrap;
  justify-content:flex-start;align-items:center;column-gap:14px;row-gap:4px;
  padding:11px 15px}
.townNewsCompact .townNewsMeta{flex:0 0 auto}
.townNewsCompact .townNewsTitle{flex:1 1 190px;font-size:14px;
  display:block;white-space:nowrap;text-overflow:ellipsis}
.townNewsCompact .townNewsExcerpt,.townNewsCompact .townNewsArtwork{display:none}
.townNewsDetail{border-top:1px solid #416a7c;background:#102b43;
  padding:16px clamp(13px,3vw,22px) 17px}
.townNewsDetailTop{font-size:11px;color:#9ce8d6;font-weight:800;margin-bottom:11px}
.townNewsDetail .townBulletinBody{margin:0;white-space:normal;
  overflow-wrap:anywhere;color:#d7e7f1;font-size:13px;line-height:1.4}
.townNewsDetail .townBulletinBody strong{color:#f5fffb;font-weight:850}
.townNewsDetail .townNoticeHeading{display:block;color:#93fbdc;
  margin:7px 0 3px;font-size:14px;line-height:1.4}
.townNewsDetail .townNoticeDivider{display:block;height:1px;background:#416a7d;margin:2px 0}
.townNewsDetailEnd{text-align:center;color:#83b4c7;font-size:11px;margin-top:17px;
  padding-top:10px;border-top:1px solid #385468}
@media(max-width:600px){
  .townNewsSummary{grid-template-columns:minmax(0,1fr) 26px}
  .townNewsSummaryText{padding:10px 12px;gap:4px}
  .townNewsWithImage .townNewsSummaryText{padding:10px 12px}
  .townNewsTitle{font-size:13px}
  .townNewsExcerpt{font-size:10px}
  .townNewsMeta{font-size:9px;gap:3px 7px}
  .townNewsChevron{font-size:20px}
  .townNewsCompact .townNewsSummaryText{flex-direction:column;
    align-items:flex-start;gap:4px;padding:9px 11px}
  .townNewsCompact .townNewsTitle{flex:initial;width:100%;font-size:13px}
  .townNewsDetail{padding:13px}
  .townNewsDetail .townBulletinBody{font-size:12px;line-height:1.45}
}
@media(prefers-reduced-motion:reduce){.townNewsChevron{transition:none}}

/* Official launch bulletin: preserve Markdown title and rewards as readable
   block-level text while still escaping notice HTML in the renderer. */
.townNewsDetail .townBulletinBody .townNoticeTitle{
  display:block;font-size:18px;line-height:1.45;margin:0 0 4px;
  color:#ffe2a1;font-weight:900
}
.townNewsDetail .townBulletinBody .townNoticeParagraph{
  margin:0 0 5px;line-height:1.4
}
.townNewsDetail .townBulletinBody .townNoticeList{
  list-style:none;display:flex;flex-direction:column;gap:1px;
  padding:0;margin:2px 0 5px
}
.townNewsDetail .townBulletinBody .townNoticeBulletItem{
  position:relative;display:block;padding-left:14px;margin:0;
  line-height:1.3;color:#e6f6fa
}
.townNewsDetail .townBulletinBody .townNoticeBulletItem::before{
  content:'•';position:absolute;left:1px;top:0;color:#dceef7
}
@media(max-width:600px){
  .townNewsDetail .townBulletinBody .townNoticeTitle{font-size:16px}
}

/* Numbered update headings (①–⑧): gold without recoloring ordinary notice paragraphs or sections. */
.townNewsDetail .townBulletinBody .townNoticeHeading.townNoticeNumberHeading{
  color:#ffdb52;font-size:16px;font-weight:900;line-height:1.5;
  margin-top:11px;margin-bottom:4px
}
@media(max-width:600px){
  .townNewsDetail .townBulletinBody .townNoticeHeading.townNoticeNumberHeading{font-size:15px}
}

/* Highlight only the five H2 section titles in the opening announcement. */
.townNewsLaunch .townBulletinBody .townNoticeHeading:not(.townNoticeTitle){
  color:#ffdb52;font-size:15px;font-weight:900;line-height:1.4;
  margin-top:7px;margin-bottom:2px
}
@media(max-width:600px){
  .townNewsLaunch .townBulletinBody .townNoticeHeading:not(.townNoticeTitle){font-size:14px}
}

/* Official launch gift: mailbox unread dot also appears on the collapsed town menu. */
#townOverlay .townQuickDock [data-town-service="mail"].townMailUnread,
#townOverlay #townQuickToggle.townMailUnread{position:relative}
#townOverlay .townQuickDock [data-town-service="mail"].townMailUnread::after,
#townOverlay #townQuickToggle.townMailUnread::after{
  content:"";position:absolute;top:6px;right:8px;width:10px;height:10px;
  border-radius:50%;background:#ff3f64;
  box-shadow:0 0 0 2px #102d43,0 0 10px #ff577a;pointer-events:none
}

/* 2026-11-22: direct Opening Festival shortcut beside the town quick menu. */
#townOverlay #townQuickBar{
  display:flex;align-items:stretch;justify-content:flex-end;
  gap:10px;max-width:100%
}
#townOverlay #townEventShortcut{
  display:flex;align-items:center;justify-content:center;gap:8px;
  min-width:112px;min-height:61px;padding:10px 14px;
  border:1px solid #ffc978;border-radius:15px;
  background:linear-gradient(135deg,#76518b,#463057);
  color:#fff0c6;font:950 16px system-ui,"Noto Sans TC",sans-serif;
  box-shadow:0 6px 24px #00172cbb,inset 0 1px #ffffff38;
  cursor:pointer;touch-action:manipulation;white-space:nowrap
}
#townOverlay #townEventShortcut:hover{filter:brightness(1.12)}
#townOverlay #townEventShortcut:focus-visible{
  outline:2px solid #ffeda3;outline-offset:2px
}
#townOverlay #townEventShortcut .townEventShortcutIcon{font-size:22px;line-height:1}
@media(max-width:700px){
  #townOverlay #townQuickBar{gap:7px}
  #townOverlay #townEventShortcut{
    min-width:91px;min-height:56px;border-radius:12px;
    padding:8px 10px;gap:5px;font-size:14px
  }
  #townOverlay #townEventShortcut .townEventShortcutIcon{font-size:19px}
}
@media(max-height:530px){
  #townOverlay #townEventShortcut{min-height:47px}
}

/* Opening-day notice: CSS-only ticker, lightweight on mobile, no canvas work. */
#townLaunchTicker{
 position:absolute;z-index:6;top:calc(71px + env(safe-area-inset-top));left:50%;
 transform:translateX(-50%);width:min(760px,calc(100% - 32px));height:36px;
 display:flex;align-items:center;overflow:hidden;box-sizing:border-box;
 border:1px solid rgba(243,190,99,.72);border-radius:10px;
 background:rgba(23,28,44,.92);color:#ffe9be;
 box-shadow:0 5px 18px #0007;pointer-events:none;
}
.townLaunchTickerLabel{
 flex:0 0 auto;position:relative;z-index:1;padding:0 12px;
 height:100%;display:flex;align-items:center;
 background:#694126;color:#fff0d0;
 font:800 12px system-ui,sans-serif;white-space:nowrap;
}
.townLaunchTickerWindow{min-width:0;flex:1;overflow:hidden;white-space:nowrap}
.townLaunchTickerText{
 display:inline-block;white-space:nowrap;
 padding-left:100%;will-change:transform;
 animation:townLaunchTickerScroll 18s linear infinite;
 font:800 14px system-ui,"Noto Sans TC",sans-serif;
}
@keyframes townLaunchTickerScroll{
 from{transform:translateX(0)}
 to{transform:translateX(-100%)}
}
@media(max-width:640px){
 #townLaunchTicker{top:calc(57px + env(safe-area-inset-top));height:30px;width:calc(100% - 14px)}
 .townLaunchTickerLabel{font-size:10px;padding:0 7px}
 .townLaunchTickerText{font-size:12px;animation-duration:15s}
}
@media(prefers-reduced-motion:reduce){
 .townLaunchTickerText{padding-left:8px;animation:none}
 .townLaunchTickerWindow{overflow-x:auto;scrollbar-width:none}
}

/* PC combat dash reminder. Hidden on touch/mobile; no animation or extra timers. */
#desktopDashHint{display:none;position:absolute;z-index:5;
  right:18px;bottom:calc(20px + env(safe-area-inset-bottom));
  align-items:center;gap:10px;min-width:162px;padding:9px 12px;
  border:1px solid #69dbcf;border-radius:12px;
  background:rgba(11,29,45,.92);color:#d9fff9;
  box-shadow:0 4px 17px #0008;pointer-events:none;
  font-family:system-ui,"Noto Sans TC",sans-serif}
#desktopDashHint .dsDashKey{display:grid;place-items:center;min-width:58px;
  padding:8px 9px;border-radius:8px;border:1px solid #a4fff0;
  background:linear-gradient(#254958,#143040);font-size:12px;font-weight:950;
  letter-spacing:.04em;color:#e9fff7}
#desktopDashHint .dsDashDetails{display:flex;flex-direction:column;gap:3px}
#desktopDashHint strong{font-size:13px;line-height:1.2}
#desktopDashHint small{color:#a7f4e6;font-size:11px;font-weight:850;
  font-variant-numeric:tabular-nums;white-space:nowrap}
#desktopDashHint.cooling{border-color:#687891;color:#b8c4dc}
#desktopDashHint.cooling .dsDashKey{border-color:#60748e;color:#aebfd5;background:#1a2a3c}
#desktopDashHint.cooling small{color:#ffdcaa}
@media (min-width:681px) and (pointer:fine){
  body.dsCombatActive #desktopDashHint{display:flex}
}


/* Mobile power v2: battle settings belong inside the pause panel. */
#soundBtnGame{display:none!important}
#pauseOverlay .pauseSettings{padding:12px 13px;border:1px solid #39778b;border-radius:12px;background:#10283bcf}
#pauseOverlay .pauseSettings .pauseSectionTitle{margin-bottom:12px}
.pauseControlGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.pauseVolumeControl{display:flex;flex-direction:column;gap:8px;padding:11px 12px;
  border:1px solid #355f7b;border-radius:9px;background:#172d45;min-width:0}
.pauseVolumeControl>span{display:flex;align-items:center;justify-content:space-between;gap:10px;
  font-size:13px;font-weight:700;color:#e4f6fb}
.pauseVolumeControl output{color:#b2e6fe;font-variant-numeric:tabular-nums}
.pauseVolumeControl input[type=range]{display:block;width:100%;min-height:28px;accent-color:#83dbff;
  cursor:pointer;touch-action:pan-x}
.pausePowerRow{display:none;align-items:center;justify-content:space-between;gap:10px;
  padding:12px 2px 1px;margin-top:6px}
.pausePowerInfo{display:flex;flex-direction:column;gap:4px;font-weight:750;font-size:13px;color:#e6f5ff}
.pausePowerInfo small{font-size:11px;font-weight:500;color:#afc9d6;line-height:1.4}
#pausePowerToggle{flex:0 0 auto;border:1px solid #769aab;border-radius:9px;
  padding:10px 13px;background:#1b334b;color:#e2efff;font-size:13px;font-weight:800;
  min-height:42px;cursor:pointer;white-space:nowrap}
#pausePowerToggle[aria-pressed=true]{background:#225440;border-color:#7adea3;color:#f0fff0}
.pauseCoopMessage{margin:10px 0 0;font-size:12px;color:#ffe4a5;line-height:1.55}
.pauseCoopMessage[hidden]{display:none!important}
@media(max-width:1024px) and (pointer:coarse){
  .pausePowerRow{display:flex}
}
@media(max-width:600px){
  #pauseOverlay .pauseSettings{padding:10px}
  .pauseControlGrid{grid-template-columns:1fr;gap:9px}
  .pauseVolumeControl{padding:9px 11px}
  .pausePowerInfo{max-width:68%}
  .pausePowerInfo small{font-size:10px}
  #pausePowerToggle{padding:9px 11px}
}

/* 2026-11-23 · Unified player settings. One control surface in the street,
   the existing pause panel in combat. Hide the replaced floating shortcuts. */
#soundBtn,#soundBtnGame,#dsAudioMixer,.dsMobilePowerButton,
#dsMobileCameraBattle,#dsMobileCameraTown{display:none!important}
.dsTownSettings{display:grid;gap:12px;padding:3px 0 12px}
.dsTownSettingsGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.dsTownSettingsCard{display:flex;flex-direction:column;gap:9px;
  background:#14354c;border:1px solid #47839a;border-radius:13px;padding:14px;
  min-width:0;color:#e9fcff;font-weight:800;font-size:13px}
.dsTownSettingsCard>span{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dsTownSettingsCard output{color:#9deedb;font-weight:900;font-variant-numeric:tabular-nums}
.dsTownSettingsCard input[type=range]{width:100%;min-height:30px;accent-color:#79deed;
  touch-action:pan-x;cursor:pointer}
.dsTownSettingsCard input:disabled{opacity:.4}
.dsTownSettingsCard small,.dsTownSettingsHint{color:#acc9d8;font-size:11px;
  font-weight:500;line-height:1.55}
.dsTownSettingsZoom{margin-top:2px}
.dsTownSettingsTest{justify-self:start;min-height:42px}
.dsTownSettingsHint{margin:-5px 0 2px}
.dsTownSettingsPower{display:flex;align-items:center;justify-content:space-between;
  gap:15px;padding:14px;background:#14354c;border:1px solid #47839a;
  border-radius:13px;color:#e9fcff;font-size:13px;font-weight:800}
.dsTownSettingsPower small{display:block;margin-top:5px;color:#adcbd6;
  font-size:11px;font-weight:500}
#townSettingsPowerToggle{min-height:43px;padding:9px 13px;flex:0 0 auto;
  border:1px solid #77b0b4;background:#1d4456;color:#eafffb;
  border-radius:9px;font-size:12px;font-weight:850;cursor:pointer}
#townSettingsPowerToggle[aria-pressed=true]{background:#24614b;border-color:#8cecb2}
.pauseAudioTestRow{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:9px 0}
.pauseAudioTestRow button{background:#255668;border:1px solid #6db5bd;
  color:#d9fcff;border-radius:9px;padding:9px 12px;font-weight:850;
  min-height:39px;cursor:pointer}
.pauseAudioTestRow small{font-size:11px;color:#acc7d7}
@media(max-width:600px){
  .dsTownSettingsGrid{grid-template-columns:1fr}
  .dsTownSettingsCard{padding:11px 12px}
  .dsTownSettingsPower{padding:11px 12px}
}

/* 2026-11-23 Floating combat touch joystick: anchored at the first finger,
   not a fixed 100px D-pad. HUD and dash remain fully touchable. */
@media (pointer:coarse){
  #touchArea,#touchArea.dsFloatingJoyActive{
    display:block;position:fixed;top:0;left:0;bottom:auto;right:auto;
    width:138px;height:138px;z-index:6;
    box-sizing:border-box;border-radius:50%;
    transform:translate(-50%,-50%) scale(.88);
    opacity:0;pointer-events:none;touch-action:none;
    border:2px solid rgba(176,255,239,.56);
    background:rgba(37,111,118,.16);
    box-shadow:0 0 21px rgba(91,247,210,.19);
    transition:opacity .09s linear;
  }
  #touchArea.dsFloatingJoyActive{opacity:.92;transform:translate(-50%,-50%) scale(1)}
  #touchArea #stick{
    position:absolute;left:39px;top:39px;width:56px;height:56px;
    box-sizing:border-box;border:2px solid rgba(197,255,245,.88);
    background:rgba(121,255,224,.35);border-radius:50%;
    pointer-events:none;box-shadow:0 0 16px rgba(115,255,232,.25);
  }
}

/* 2026-11-23: Town-only mobile zoom shortcut; combat zoom stays in Pause. */
#townOverlay .townCameraControl{
  display:none;align-items:center;justify-content:center;gap:5px;
  padding:5px 7px;background:#102f48eb;border:1px solid #7bd9df;
  border-radius:12px;box-shadow:0 4px 14px #00182bbd;
  color:#dffbfa;font-weight:850;font-size:12px;pointer-events:auto;
  align-self:flex-end;
}
#townOverlay .townCameraControl button{
  min-width:34px;min-height:34px;padding:3px 6px;border-radius:8px;
  border:1px solid #71b7c4;background:#20556a;color:#fff;font-size:19px;
  font-weight:900;touch-action:manipulation;cursor:pointer;
}
#townOverlay .townCameraControl button:disabled{opacity:.4;cursor:default}
#townOverlay .townCameraControl output{text-align:center;min-width:34px;font-variant-numeric:tabular-nums}
@media(pointer:coarse) and (max-width:1024px){
  #townOverlay .townCameraControl{display:flex}
}
@media(max-height:530px){
  #townOverlay .townCameraControl{padding:3px 5px}
  #townOverlay .townCameraControl button{min-height:30px;min-width:31px}
}

/* 2026-11-23: Compact battle HUD; gear buffs must never force vertical text
   or stretch the black header gradient down the mobile battlefield. */
#mobileCombatStatus{display:none}
#mobileCombatStatus[hidden]{display:none!important}
@media (max-width:680px), (max-height:530px) and (pointer:coarse){
  #topHUD{
    background:linear-gradient(180deg,rgba(4,7,22,.75),rgba(4,7,22,0))
      0 0/100% 86px no-repeat;
    align-items:flex-start;
  }
  #topHUD #evoNext{display:none!important}
  #topHUD #phaseLabel{
    font-size:10px;letter-spacing:0;line-height:1.3;
    word-break:keep-all;overflow-wrap:normal;
    max-width:min(44vw,175px);margin:1px auto 0;
  }
  #topHUD #mobileCombatStatus:not([hidden]){
    display:block;position:absolute;left:50%;top:100%;
    transform:translateX(-50%);margin-top:5px;
    max-width:calc(100vw - 20px);width:max-content;
    padding:5px 10px;border-radius:10px;
    background:rgba(18,32,56,.83);border:1px solid rgba(153,126,217,.7);
    box-shadow:0 2px 11px rgba(0,0,0,.25);
    color:#ffe0c2;text-shadow:0 1px 2px rgba(0,0,0,.8);
    text-align:center;font-size:11px;font-weight:850;line-height:1.5;
    white-space:normal;word-break:keep-all;overflow-wrap:normal;
    pointer-events:none;z-index:1;
  }
}
@media(max-width:375px){
  #topHUD #mobileCombatStatus:not([hidden]){font-size:10px;padding:4px 7px}
}

/* 2026-11-23: optional fixed combat touchpad (default is free-drag). */
.pauseBattleJoystickRow,.dsTownSettingsJoy{display:none!important}
@media(pointer:coarse){
  .pauseBattleJoystickRow,.dsTownSettingsJoy{display:flex!important}
  body.dsFixedBattleJoy #touchArea,
  body.dsFixedBattleJoy #touchArea.dsFloatingJoyActive{
    display:block!important;position:fixed!important;
    left:calc(18px + env(safe-area-inset-left))!important;
    top:auto!important;bottom:calc(22px + env(safe-area-inset-bottom))!important;
    transform:none!important;opacity:.86;width:138px;height:138px;z-index:8;
    transition:opacity .12s ease;
  }
  body.dsFixedBattleJoy.dsCombatActive #touchArea{pointer-events:auto!important;touch-action:none}
  body.dsFixedBattleJoy:not(.dsCombatActive) #touchArea{opacity:0!important;pointer-events:none!important}
  body.dsFixedBattleJoy.dsCombatActive #touchArea.dsFloatingJoyActive{opacity:1}
}
#pauseBattleJoystickToggle[aria-pressed="true"],
#townSettingsBattleJoyToggle[aria-pressed="true"]{
  background:#24614b;border-color:#8cecb2;color:#eafff0
}

/* Feedback: private official reply and unread indicator, desktop + mobile. */
#townOverlay .townQuickDock [data-town-service="feedback"].townFeedbackUnread,
#townOverlay #townQuickToggle.townFeedbackUnread{position:relative}
#townOverlay .townQuickDock [data-town-service="feedback"].townFeedbackUnread::after,
#townOverlay #townQuickToggle.townFeedbackUnread::after{
  content:"";position:absolute;top:6px;right:8px;width:10px;height:10px;
  border-radius:50%;background:#ff3f64;
  box-shadow:0 0 0 2px #102d43,0 0 10px #ff577a;pointer-events:none
}
#townOverlay .townFeedbackOfficialReply{
  margin-top:12px;padding:12px;border:1px solid #75a8b2;border-radius:11px;
  background:linear-gradient(130deg,#102f46,#173e53);overflow-wrap:anywhere
}
#townOverlay .townFeedbackOfficialHead{display:flex;flex-wrap:wrap;gap:5px 12px;justify-content:space-between;color:#f9dc86}
#townOverlay .townFeedbackOfficialHead small{font-size:12px;color:#c0dae3}
#townOverlay .townFeedbackOfficialReply p{white-space:pre-wrap;line-height:1.65;color:#e8fff6;margin:10px 0}
#townOverlay .townFeedbackOfficialReply button{max-width:100%;white-space:normal}
@media(max-width:700px){
  #townOverlay .townQuickDock [data-town-service="feedback"].townFeedbackUnread::after,
  #townOverlay #townQuickToggle.townFeedbackUnread::after{width:9px;height:9px;top:4px;right:5px}
  #townOverlay .townFeedbackOfficialReply{padding:9px}
}

/* 2026-11-23: always-visible direct adventure button, above existing event/menu
   row. Keeping it on a separate row prevents mobile tap targets from shrinking
   and lets the built-in zoom controls stay in the same flex dock flow. */
#townOverlay .townQuickDock #townAdventureShortcut{
  align-self:stretch;box-sizing:border-box;width:100%;min-width:235px;max-width:100%;
  display:flex;align-items:center;justify-content:center;gap:10px;
  min-height:58px;padding:9px 18px;border-radius:15px;
  border:1px solid #a7f0bf;
  background:linear-gradient(135deg,#287857,#145d67 85%);
  color:#f5fff5;font:950 18px system-ui,"Noto Sans TC",sans-serif;
  box-shadow:0 6px 24px #00172cbb,inset 0 1px #ffffff38;
  cursor:pointer;touch-action:manipulation;white-space:nowrap
}
#townOverlay #townAdventureShortcut .townAdventureShortcutIcon{font-size:25px;line-height:1}
#townOverlay #townAdventureShortcut:hover{filter:brightness(1.1)}
#townOverlay #townAdventureShortcut:focus-visible{outline:3px solid #f2ffb5;outline-offset:2px}
@media(max-width:700px){
  #townOverlay .townQuickDock #townAdventureShortcut{
    align-self:flex-end;width:178px;min-width:0;max-width:calc(100vw - 24px);
    min-height:50px;padding:8px 12px;border-radius:12px;
    font-size:15px;gap:7px;white-space:nowrap
  }
  #townOverlay #townAdventureShortcut .townAdventureShortcutIcon{font-size:21px}
}
@media(max-height:530px){
  #townOverlay .townQuickDock #townAdventureShortcut{min-height:43px;padding:6px;font-size:14px}
  #townOverlay #townAdventureShortcut .townAdventureShortcutIcon{font-size:19px}
}

/* 2026-11-23: truly standalone adventure selector, no hub sidebar.
   One #hubContent moves between mounts; never duplicate its event handlers. */
#adventureOverlay{
  z-index:11;align-items:center;justify-content:center;
  padding:clamp(14px,2.3vh,28px) clamp(12px,2vw,34px);
  background:rgba(4,13,28,.40)!important;
  backdrop-filter:blur(1.1px)!important;
  -webkit-backdrop-filter:blur(1.1px)!important;
  overscroll-behavior:contain
}
#adventureOverlay .adventureShell{
  width:min(1180px,94vw);height:min(89dvh,900px);
  min-width:0;min-height:0;max-width:100%;max-height:100%;
  box-sizing:border-box;margin:auto;flex-shrink:1;
  display:flex;flex-direction:column;overflow:hidden;
  border:1px solid #74bfc1;border-radius:20px;
  background:linear-gradient(135deg,#0c3141f9,#071829fa 78%);
  box-shadow:0 24px 85px #000b,0 0 0 1px #c0ffe520
}
#adventureOverlay .adventureGrip{display:none}
#adventureOverlay .adventureHeader{
  flex:0 0 auto;min-width:0;display:flex;align-items:center;justify-content:space-between;
  gap:14px;padding:14px 19px;background:#0d2938;
  border-bottom:1px solid #397481
}
#adventureOverlay .adventureHeader h2{
  flex:0 1 auto;min-width:0;margin:0;
  font-size:21px;line-height:1.35;letter-spacing:.03em;color:#f2fffb
}
#adventureOverlay .adventureHeaderActions{
  display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:7px
}
#adventureOverlay #adventureClose{
  min-height:38px;padding:7px 14px;border-radius:10px;
  border:1px solid #91ebda;background:#205869;color:#ecfffc;
  font-size:13px;font-weight:950;cursor:pointer;touch-action:manipulation
}
#adventureOverlay #adventureClose:hover{background:#276d75}
#adventureOverlay #adventureClose:focus-visible{outline:2px solid #fff;outline-offset:3px}
#adventureOverlay #adventureContentMount{
  min-width:0;min-height:0;width:100%;flex:1;overflow:hidden
}
#adventureOverlay #adventureContentMount > #hubContent{
  box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;
  padding:17px 22px 28px;overflow:auto;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:#4c8793 #102c3a
}
/* Fixed width independent of the expandable quick panel prevents the
   adventure launcher from stretching when the menu opens. */
#townOverlay .townQuickDock #townAdventureShortcut{
  align-self:flex-end;width:min(305px,calc(100vw - 26px));min-width:0;max-width:calc(100vw - 26px);
  flex:0 0 auto
}
@media(max-width:810px){
  #adventureOverlay{
    align-items:flex-end;justify-content:center;padding:0;
    background:rgba(6,17,30,.28)!important;
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important
  }
  #adventureOverlay .adventureShell{
    width:100vw;max-width:100vw;height:89dvh;max-height:89dvh;
    margin:0;border-radius:21px 21px 0 0;border-bottom:0;
    box-shadow:0 -13px 46px #000a,0 -2px 0 #a1e9d15c
  }
  #adventureOverlay .adventureGrip{display:flex;justify-content:center;align-items:center;height:16px;flex:0 0 16px;pointer-events:none}
  #adventureOverlay .adventureGrip:after{content:"";width:44px;height:4px;border-radius:99px;background:#9ac9d1b0}
  #adventureOverlay .adventureHeader{flex-direction:column;align-items:stretch;gap:8px;padding:2px 12px 9px}
  #adventureOverlay .adventureHeader h2{font-size:18px;line-height:25px}
  #adventureOverlay .adventureHeaderActions{justify-content:flex-start;gap:5px}
  #adventureOverlay #adventureClose{min-width:63px;min-height:34px;padding:5px 10px;font-size:11px}
  #adventureOverlay .resPill{font-size:10px;padding:5px 7px;line-height:1.2}
  #adventureOverlay #adventureContentMount > #hubContent{padding:12px 10px 20px;overflow-x:hidden}
}
@media(max-width:410px){
  #adventureOverlay .adventureHeader{padding-left:9px;padding-right:9px}
  #adventureOverlay .resPill{font-size:9px;padding:5px}
  #adventureOverlay #adventureContentMount > #hubContent{padding:10px 8px 18px}
}
@media(max-width:810px) and (max-height:560px){
  #adventureOverlay .adventureShell{height:92dvh;max-height:92dvh}
  #adventureOverlay .adventureGrip{height:10px;flex-basis:10px}
  #adventureOverlay .adventureHeader{gap:3px;padding-bottom:4px}
  #adventureOverlay .adventureHeader h2{font-size:15px;line-height:20px}
}

/* Mobile town CTA stays compact even when the function menu expands.
   Keep this after the desktop width rule to avoid specificity/order regressions. */
@media(max-width:700px){
  #townOverlay .townQuickDock #townAdventureShortcut{
    align-self:flex-end;width:178px;min-width:0;max-width:calc(100vw - 24px);
    flex:0 0 auto
  }
}


/* Game tutorial: same combat registries, accessible in the normal town menu. */
#menuOverlay .dsTutorialPage{min-width:0;max-width:100%;color:#deeff4;line-height:1.6}
#menuOverlay .dsTutorialPage h3{font-size:clamp(18px,2.3vw,23px);line-height:1.35;color:#e5ffe9;margin:0 0 12px}
#menuOverlay .dsTutorialPage p{line-height:1.7;margin:7px 0 10px;overflow-wrap:anywhere}
#menuOverlay .dsGuideJump{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 17px}
#menuOverlay .dsGuideJump a{border:1px solid #609fa6;background:#153e4e;color:#d7ffec;text-decoration:none;padding:7px 11px;border-radius:9px;font-size:12px;font-weight:800}
#menuOverlay .dsGuideJump a:hover,#menuOverlay .dsGuideJump a:focus-visible{background:#276474;outline-color:#8efed6}
#menuOverlay .dsGuideSection{scroll-margin-top:18px;padding:16px 17px;margin:12px 0 18px;border:1px solid #487986;border-radius:15px;background:linear-gradient(145deg,#102e41,#11273b);box-shadow:0 4px 18px #04152344}
#menuOverlay .dsGuideTips{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:9px}
#menuOverlay .dsGuideTips>div{border:1px solid #396c7d;background:#09263a;padding:10px;border-radius:10px}
#menuOverlay .dsGuideTips b{display:block;color:#f2db98;margin-bottom:3px}
#menuOverlay .dsGuideTips span{font-size:13px}
#menuOverlay .dsGuideCards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#menuOverlay .dsGuideCards>div{background:#0e3044;border:1px solid #477e86;border-radius:12px;padding:12px;min-width:0}
#menuOverlay .dsGuideCards b{color:#f6e1a3}
#menuOverlay .dsGuideCards p{font-size:13px}
#menuOverlay .dsGuideCards strong{display:block;color:#9cf1c3;font-size:13px}
#menuOverlay .dsGuideHint{font-size:12px;color:#b8d8db}
#menuOverlay .dsGuideTableScroll{overflow-x:auto;overscroll-behavior-x:contain;max-width:100%;border:1px solid #446e7e;border-radius:10px;margin:12px 0;scrollbar-width:thin}
#menuOverlay .dsGuideTable{border-collapse:collapse;min-width:max-content;width:100%;font-size:13px;text-align:center}
#menuOverlay .dsGuideTable caption{text-align:left;caption-side:top;padding:10px 12px;color:#ffe19a;font-weight:900;background:#133c4c}
#menuOverlay .dsGuideTable th,#menuOverlay .dsGuideTable td{white-space:nowrap;padding:8px 10px;border-bottom:1px solid #355765;border-right:1px solid #355765}
#menuOverlay .dsGuideTable th{color:#f3fffc;background:#1c4050;font-weight:800}
#menuOverlay .dsGuideFactor{font-weight:900;font-variant-numeric:tabular-nums}
#menuOverlay .dsGuideFactor.adv{background:#1b5749;color:#b8ffe0}
#menuOverlay .dsGuideFactor.weak{background:#5b353c;color:#ffe0df}
#menuOverlay .dsGuideFactor.neutral{background:#132c3e;color:#aac7d1}
#menuOverlay .dsGuideGroup{border:1px solid #386f7a;border-radius:10px;margin:9px 0;background:#0b2a3d;overflow:hidden}
#menuOverlay .dsGuideGroup summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;padding:12px 13px;min-height:45px;font-size:16px;list-style:none;touch-action:manipulation}
#menuOverlay .dsGuideGroup summary::-webkit-details-marker{display:none}
#menuOverlay .dsGuideGroup summary:after{content:"▾";color:#dfffee;order:3}
#menuOverlay .dsGuideGroup[open] summary:after{content:"▴"}
#menuOverlay .dsGuideGroup summary span{font-size:12px;color:#b0cdd3;margin-left:auto}
#menuOverlay .dsGuideGroup[open] summary{background:#175264;border-bottom:1px solid #396c7e}
#menuOverlay .dsGuideMoveList{display:grid;gap:9px;padding:9px}
#menuOverlay .dsGuideMove{padding:11px 12px;border:1px solid #385969;border-radius:10px;background:#0a2334}
#menuOverlay .dsGuideMoveHead{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:5px 12px}
#menuOverlay .dsGuideMoveHead strong{color:#fff1c8;font-size:15px}
#menuOverlay .dsGuideKind{font-size:12px;color:#8ce5d8}
#menuOverlay .dsGuideMove p{font-size:13px;margin:6px 0 0}
@media(max-width:700px){
  #menuOverlay .dsGuideSection{padding:12px 10px;margin:10px 0}
  #menuOverlay .dsGuideCards{grid-template-columns:1fr}
  #menuOverlay .dsGuideJump a{font-size:12px;flex:1 1 auto;text-align:center;padding:7px}
  #menuOverlay .dsGuideTable th,#menuOverlay .dsGuideTable td{padding:7px 9px;font-size:12px}
  #menuOverlay .dsGuideMoveList{padding:7px}
  #menuOverlay .dsGuideMoveHead strong{font-size:14px}
}

/* Solo 1x/2x toggle: compact, accessible, no overlay or input capture. */
#soloSpeedBtn{pointer-events:auto;flex:0 0 auto;min-width:42px;height:42px;padding:0 7px;border-radius:14px;background:#15223be0;border:1px solid #49607d;color:#e6f9fa;font-size:15px;font-weight:900;white-space:nowrap;touch-action:manipulation}
#soloSpeedBtn[hidden]{display:none!important}
#soloSpeedBtn[aria-pressed="true"]{background:#20534d;border-color:#80f5cb;color:#defff3;box-shadow:0 0 9px #71efb942}
@media(max-width:680px), (max-height:530px) and (pointer:coarse){#soloSpeedBtn{min-width:38px;height:38px;padding:0 5px;font-size:14px;border-radius:10px}#topHUD:has(#soloSpeedBtn:not([hidden])) .hudcol:last-of-type{gap:4px!important}}
