:root{--ink:#183936;--cream:#fff8e8;--gold:#ffc83d;--lime:#a7dc45;--coral:#ff6b55;--panel:rgba(18,48,43,.92)}
#battle .upgrade-hero{display:flex;align-items:center;justify-content:center;padding:4px}#battle .upgrade-hero img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;transform:none}
#battle .tower-stats>span.upgrade-stat-preview{border:1px solid rgba(117,244,188,.35);background:linear-gradient(145deg,rgba(25,83,69,.96),rgba(24,63,58,.96))}#battle .tower-stats b{display:flex;align-items:baseline;gap:4px;white-space:nowrap}#battle .tower-stats b strong{color:#fff7ce;font:inherit}#battle .tower-stats b i{color:#84d6bf;font-size:.82em;font-style:normal}#battle .tower-stats b em{color:#8ff4c7;font-size:.94em;font-style:normal;text-shadow:0 0 8px rgba(101,239,180,.32)}
#battleConfirmDetail:empty{display:none}
.upgrade-panel.opposite-side{left:auto;right:18px}.battle-confirm-icon .upgrade-effect-svg{width:32px;height:32px;color:#ffe16b}
.wave-panel.final-wave{display:none}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;overflow:hidden;background:#102f2b;color:var(--cream);font-family:"Trebuchet MS",Verdana,sans-serif;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}img,canvas{-webkit-user-drag:none;user-drag:none}button{font:inherit}
.screen{display:none;position:fixed;inset:0}.screen.active{display:block}.eyebrow{margin:0 0 6px;color:#ffd76b;font-size:12px;font-weight:900;letter-spacing:2px}.subtitle{margin:4px 0 0;color:#d3e9d6}
#campaign{overflow:auto;background:radial-gradient(circle at 50% 15%,#397c5b,#163b35 60%,#102a29)}#campaign:before{content:"";position:fixed;inset:0;opacity:.18;pointer-events:none;background-image:radial-gradient(#d5efae 1px,transparent 1px);background-size:22px 22px}
.campaign-head{position:relative;display:flex;align-items:center;gap:18px;max-width:1300px;margin:auto;padding:34px 36px 24px}.campaign-head h1{font-size:clamp(30px,4vw,56px);line-height:.9;margin:0;text-shadow:0 4px #12312d}.brand-mark{display:grid;place-items:center;width:66px;height:66px;border-radius:22px;background:linear-gradient(145deg,#ffda5a,#ff8d43);color:white;font-size:42px;box-shadow:0 8px 0 #a94b35,0 15px 30px #10231d}.campaign-stats{margin-left:auto;display:flex;align-items:center;gap:18px;font-size:18px;color:#ffda58}
.world-wrap{position:relative;display:grid;grid-template-columns:minmax(650px,1fr) 330px;gap:30px;max-width:1300px;margin:0 auto;padding:20px 36px 50px}.world-map{position:relative;min-height:650px;border:3px solid #6cad60;border-radius:40px;background:linear-gradient(165deg,rgba(105,171,91,.9),rgba(28,88,65,.95)),url('assets/meadow-map.png') center/cover;box-shadow:inset 0 0 80px #1c563e,0 24px 50px #0d2822;overflow:hidden}.world-map:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 48%,rgba(255,255,255,.05) 50%,transparent 52%);pointer-events:none}
.route{position:absolute;height:7px;transform-origin:0 50%;background:#d5e98a;opacity:.7;box-shadow:0 2px #416d3d}.node{position:absolute;z-index:2;width:48px;height:48px;border:3px solid #ffe08a;border-radius:50%;transform:translate(-50%,-50%);background:linear-gradient(#fff7c7,#ffbd40);color:#643d20;font-weight:900;box-shadow:0 5px 0 #8a512b,0 8px 14px #16382f;cursor:pointer;transition:.18s}.node:hover:not(:disabled),.node.selected{transform:translate(-50%,-50%) scale(1.18);filter:brightness(1.08)}.node.selected{outline:5px solid rgba(255,255,255,.25)}.node:disabled{filter:grayscale(1);opacity:.55;cursor:not-allowed;background:#71927c;border-color:#a2b7a8;color:#d7e0d8;box-shadow:0 5px 0 #3c574b}.node.boss{width:58px;height:58px;background:linear-gradient(#ff9c61,#ff5b52);color:white}.node-stars{position:absolute;left:50%;bottom:-20px;transform:translateX(-50%);white-space:nowrap;color:#ffe268;font-size:11px;text-shadow:0 2px #57401e}.node-stars:empty{display:none}#stageStars{color:#ffe268;letter-spacing:1px}
.stage-card{align-self:center;position:sticky;top:30px;padding:20px;border:2px solid #547b65;border-radius:28px;background:rgba(14,49,42,.94);box-shadow:0 18px 40px #0a211c}.stage-art{height:150px;border-radius:20px;margin-bottom:20px;display:grid;place-items:center;background:radial-gradient(circle,#fde886,#f2854d 45%,#4c5269 46%,#222f3e 68%);font-size:74px}.stage-card h2{font-size:28px;margin:0 0 10px}.stage-card>p:not(.eyebrow):not(.hint){color:#c9dfd3;line-height:1.5}.stage-meta{display:flex;gap:7px;margin:18px 0}.stage-meta span{padding:7px 9px;border-radius:10px;background:#254f46;font-size:11px;text-transform:uppercase}.primary{width:100%;border:0;border-radius:14px;padding:15px 18px;background:linear-gradient(#ffdf62,#ffb633);color:#513719;font-weight:900;box-shadow:0 5px 0 #b97428;cursor:pointer;transition:.15s}.primary:hover{filter:brightness(1.08);transform:translateY(-1px)}.primary:active{transform:translateY(3px);box-shadow:0 2px 0 #b97428}.primary span{float:right}.ghost{border:1px solid #668a79;border-radius:11px;padding:9px 14px;background:#234a42;color:#e7f3e9;cursor:pointer}.hint{font-size:11px;text-align:center;color:#87aa98!important;margin-bottom:0!important}
#battle{background:#6ba638}#game{position:absolute;width:100%;height:100%;object-fit:cover}.glass{background:var(--panel);border:2px solid rgba(255,255,255,.13);box-shadow:0 8px 20px rgba(7,31,27,.32);backdrop-filter:blur(8px)}.topbar{position:absolute;z-index:4;display:flex;align-items:center;gap:16px;left:50%;top:14px;transform:translateX(-50%);min-width:min(820px,calc(100% - 24px));padding:10px 13px;border-radius:18px}.icon-btn{width:44px;height:44px;border:0;border-radius:12px;background:#315d50;color:white;font-size:21px;font-weight:900;cursor:pointer}.realm-title{min-width:200px;flex:1}.realm-title small{display:block;color:#a8cc9c;font-size:9px;letter-spacing:1.7px}.realm-title strong{font-size:17px}.stat{display:flex;align-items:center;gap:7px;padding:6px 12px;border-left:1px solid #4f7569}.stat i{font-style:normal;font-size:22px}.stat small{font-size:8px;color:#9ac1ac;letter-spacing:1px}.heart i{color:#ff6c69}.coin i{color:#ffd34f;text-shadow:0 0 8px #ffb119}.speed{font-size:14px}
.tower-dock{position:absolute;z-index:4;left:50%;bottom:14px;transform:translateX(-50%);display:flex;gap:8px;padding:8px;border-radius:20px;max-width:calc(100% - 24px);overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}.tower-card{position:relative;flex:0 0 96px;width:96px;height:82px;border:2px solid transparent;border-radius:14px;background:#285348;color:white;cursor:pointer;padding:6px;text-align:left;transition:.15s}.tower-card:hover,.tower-card.selected{background:#3b7060;border-color:#ffdd65;transform:translateY(-5px)}.tower-card.locked{filter:grayscale(.8);opacity:.55}.tower-card .rune{float:left;font-size:30px;margin:9px 7px 0 2px}.tower-card strong{display:block;margin-top:6px;font-size:11px}.tower-card small{font-size:9px;color:#b7d5c4}.tower-card em{display:block;color:#ffd553;font-size:11px;font-style:normal;margin-top:4px}.tower-card kbd{position:absolute;right:6px;top:5px;padding:2px 4px;border-radius:4px;background:#163c34;color:#9cc1b0;font:9px inherit}
.wave-panel{position:absolute;z-index:4;right:18px;bottom:22px;width:270px;padding:10px;border-radius:16px;text-align:center}.wave-panel p{font-size:11px;margin:0 0 8px;color:#c6ddcf;line-height:1.35}.wave-panel .primary{width:100%}.compact{padding:10px;font-size:12px}.upgrade-panel{display:none;position:absolute;z-index:5;left:18px;bottom:22px;width:235px;padding:14px;border-radius:18px}.upgrade-panel.show{display:grid;grid-template-columns:56px 1fr;gap:9px}.upgrade-panel .close{position:absolute;right:7px;top:5px;border:0;background:none;color:#aac8b7;font-size:20px}.upgrade-hero{grid-row:1/3;display:grid;place-items:center;height:56px;border-radius:15px;background:#315e52;font-size:32px}.upgrade-panel small{color:#ffd45a;font-size:9px;letter-spacing:1px}.upgrade-panel h3{margin:2px 0;font-size:16px}.upgrade-panel p{font-size:10px;color:#b6d0c1;margin:0}.upgrade-panel button{grid-column:1/3}.danger{color:#ffc7bd;border-color:#8c514a}.toast{position:absolute;z-index:8;left:50%;top:90px;transform:translate(-50%,-20px);padding:10px 18px;border-radius:20px;background:#183e35;color:#fff;opacity:0;pointer-events:none;transition:.25s}.toast.show{opacity:1;transform:translate(-50%,0)}
.result{display:none;position:absolute;z-index:10;inset:0;background:rgba(8,33,29,.7);place-items:center}.result.show{display:grid}.result-card{width:min(390px,calc(100% - 30px));padding:28px;border-radius:30px;text-align:center}.big-rune{font-size:62px}.result-card h2{font-size:30px;margin:5px}.result-stars{color:#ffda4e;font-size:40px;letter-spacing:5px;text-shadow:0 4px #8c581c}.result-card p{color:#c7dbd0}.result-card .ghost{margin-top:12px}
.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.result-actions .ghost{width:100%}.result-actions .result-exit{border-color:#658077;color:#dce9e2}.upgrade-stars{color:#ffd95b!important;font-size:11px!important;letter-spacing:1px;text-shadow:0 0 7px rgba(255,207,70,.35)}
.obsidian-count,.obsidian{color:#cba6ff!important;text-shadow:0 0 10px #7e4fc7}.stat.diamond{color:#91edff;text-shadow:0 0 9px rgba(74,199,232,.62)}.stat.diamond i{font-size:17px}.fusion-btn{border-color:#7659a0;background:#382f58}.fusion-modal{display:none;position:fixed;z-index:20;inset:0;background:rgba(5,20,18,.8);place-items:center;padding:15px}.fusion-modal.show{display:grid}.fusion-card{position:relative;width:min(780px,100%);max-height:92vh;overflow:auto;padding:28px;border-radius:28px;text-align:center;background:linear-gradient(160deg,rgba(31,55,52,.97),rgba(42,31,66,.97))}.fusion-card .close{position:absolute;right:14px;top:10px;border:0;background:none;color:#c8d8ce;font-size:27px;cursor:pointer}.fusion-card h2{margin:3px 0 8px;font-size:31px}.fusion-card h3{font-size:18px;margin:7px 0 1px;color:#ffe29a}.fusion-copy,.fusion-card>p:not(.eyebrow){color:#bdd0c7;font-size:12px;line-height:1.5}.lab-wallet{display:flex;justify-content:space-between;margin:15px 0 10px;padding:10px 14px;border-radius:12px;background:#222f3d;color:#aabdb4;font-size:10px;letter-spacing:1px}.lab-wallet strong{color:#c49aff;font-size:15px}.recipe-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.recipe-option{padding:13px;border:1px solid #5a6771;border-radius:18px;background:rgba(20,42,41,.7)}.recipe-option.unlocked{border-color:#9e7bdd;box-shadow:inset 0 0 20px rgba(144,101,225,.12)}.recipe-option p{min-height:32px;margin:5px 0 9px;color:#bdd0c7;font-size:10px;line-height:1.45}.recipe-option .primary{width:100%}.recipe-visual{display:flex;align-items:center;justify-content:center;gap:7px;height:92px}.recipe-parents{display:flex;align-items:center;justify-content:center}.parent-orb,.evolved-orb{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:#1d423b;border:2px solid #56796e}.parent-orb img,.evolved-orb img{width:58px;height:58px;object-fit:contain}.evolved-orb{width:82px;height:82px;border-color:#b18bff;box-shadow:0 0 22px rgba(151,102,255,.32)}.evolved-orb img{width:92px;height:92px}.fusion-plus,.fusion-arrow{font-size:16px;color:#f5da75}.element-tags{color:#9db9ae;text-transform:uppercase;font-size:8px;letter-spacing:1px}.unlocked-note{font-size:9px!important;margin-bottom:0}.tower-card.special{background:linear-gradient(145deg,#44376c,#254f50);border-color:#7f65a9}.tower-card.special.locked:after{content:'EVOLVE IN LAB';position:absolute;inset:0;display:grid;place-items:center;background:rgba(22,26,35,.82);color:#d7b8ff;font-size:9px;font-weight:900}.tower-card.special .tower-sprite{filter:drop-shadow(0 0 6px #a478ff)}
.campaign-stats button{white-space:nowrap}.save-btn{color:#ffe583;font-size:19px}.element-picker{padding:12px;border-radius:16px;background:rgba(16,38,37,.7)}.element-picker p{margin:0 0 9px;color:#d6e6dc;font-size:10px;letter-spacing:1px;text-transform:uppercase}.element-picker>div,.third-step>div{display:flex;flex-wrap:wrap;justify-content:center;gap:7px}.element-choice,.third-choice{border:1px solid #536e68;border-radius:12px;background:#294a45;color:#cfe0d6;cursor:pointer}.element-choice{display:grid;gap:2px;min-width:86px;padding:8px;font-size:9px;text-transform:uppercase}.element-choice span{font-size:24px}.element-choice.selected,.third-choice.selected{border-color:#ffdf66;background:#5b4f32;color:#fff5b3;box-shadow:0 0 15px rgba(255,216,86,.2)}.element-choice:disabled{opacity:.3;cursor:not-allowed}.branch-builder{margin-top:12px}.branch-empty{display:grid;grid-template-columns:auto 1fr auto auto 1fr auto auto 1fr;align-items:center;gap:7px;padding:18px;border:1px dashed #647770;border-radius:16px;color:#a9bbb1;font-size:9px;text-align:left}.branch-empty b{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#584778;color:#e2c9ff}.branch-empty i{color:#ffe06c}.branch-label{margin:0;padding:8px;border-radius:10px;background:#263c4b;color:#d6b9ff;font-size:10px;letter-spacing:1px}.third-step{padding:11px}.third-step small{display:block;margin-bottom:7px;color:#9db9ae;font-size:8px;letter-spacing:1px}.third-choice{padding:7px 9px;font-size:9px}.fusion-result{display:grid;grid-template-columns:190px 1fr 130px;align-items:center;gap:12px;padding:12px;border:1px solid #8569b0;border-radius:18px;background:linear-gradient(145deg,rgba(67,49,100,.72),rgba(30,67,62,.72));text-align:left}.fusion-result .recipe-visual{height:86px}.fusion-result-copy h3{margin:0 0 3px}.fusion-result-copy p{margin:0 0 5px;color:#bfd0c7;font-size:10px}.fusion-result-copy small{color:#ffe491;font-size:9px}.evolved-orb{position:relative}.evolved-orb i{position:absolute;right:-7px;bottom:-5px;padding:3px 5px;border-radius:8px;background:#192c2a;font-size:12px;font-style:normal}.unlocked-heading{margin:18px 0 8px!important;text-align:left}.unlocked-recipes{grid-template-columns:repeat(3,minmax(0,1fr))}.collection-item{display:grid;grid-template-columns:50px 1fr;align-items:center;gap:7px;text-align:left}.collection-item img{width:54px;height:54px;object-fit:contain}.collection-item h3{margin:0;font-size:12px}.collection-item b{grid-column:1/3;color:#afdf9d;font-size:8px;text-align:right}.empty-collection{grid-column:1/-1;margin:0;padding:16px;border:1px dashed #596d66;border-radius:14px;color:#9db1a6;font-size:10px}.placement-head>span,.upgrade-hero{position:relative}.placement-head>span i,.upgrade-hero i{position:absolute;right:1px;bottom:1px;padding:2px;border-radius:5px;background:#18352f;font-size:9px;font-style:normal}
.heart-drop{animation:heartDrop .32s ease-out}@keyframes heartDrop{0%{transform:scale(1)}35%{transform:scale(1.3);background:#6f2f37}100%{transform:scale(1)}}
.placement-info{display:none;position:absolute;z-index:5;left:18px;bottom:22px;width:260px;padding:14px;border-radius:18px}.placement-info.show{display:block}.placement-head{display:flex;align-items:center;gap:10px}.placement-head>span{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:#315e52;font-size:27px}.placement-head small{color:#ffd45a;font-size:9px;letter-spacing:1px}.placement-head h3{margin:2px 0;font-size:17px}.placement-info>p{margin:9px 0;color:#b9d2c4;font-size:10px;line-height:1.4}.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.stat-grid>span{padding:7px 8px;border-radius:9px;background:#244c43}.stat-grid small{display:block;color:#88ad9c;font-size:7px;letter-spacing:.7px}.stat-grid b{font-size:12px;color:#fff7ce}.placement-tip{margin-top:9px;padding:7px;border-radius:8px;background:#3c5a3a;color:#e9efad;font-size:9px;text-align:center}.upgrade-panel{width:285px}.upgrade-panel.show{grid-template-columns:56px 1fr}.upgrade-panel .tower-stats{grid-column:1/3}.tower-stats>span{padding:6px}.upgrade-choice{grid-column:1/3;display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:8px;width:100%;padding:9px;border:1px solid #52796b;border-radius:12px;background:#285348;color:white;text-align:left;cursor:pointer}.upgrade-choice[hidden]{display:none!important}.upgrade-choice:hover:not(:disabled){border-color:#ffdb60;background:#36695c}.upgrade-choice:disabled{opacity:.45;cursor:not-allowed}.upgrade-choice .choice-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:#3e6b5e;color:#ffdc58;font-size:20px}.upgrade-choice.speed-choice .choice-icon{background:#315f68;color:#90edff}.upgrade-choice strong,.upgrade-choice small{display:block}.upgrade-choice strong{font-size:11px}.upgrade-choice small{margin-top:2px;color:#a9c9b8;font-size:8px;letter-spacing:0}.upgrade-choice b{color:#ffd856;font-size:10px}.upgrade-choice i{font-style:normal}.upgrade-panel .danger{grid-column:1/3}
.tower-card{overflow:hidden;padding-bottom:23px}.tower-card em{position:absolute;right:7px;bottom:5px;margin:0;padding:2px 6px;border-radius:7px;background:#173f36;line-height:1.2}
.tower-card .tower-sprite{position:absolute;left:2px;top:2px;width:44px;height:54px;object-fit:contain;filter:drop-shadow(0 3px 2px rgba(8,28,24,.45))}.tower-card strong,.tower-card small{margin-left:40px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.placement-head>span,.upgrade-hero{overflow:hidden}.placement-head>span img,.upgrade-hero img{width:64px;height:64px;object-fit:contain;filter:drop-shadow(0 3px 2px rgba(8,28,24,.4))}.upgrade-hero img{width:72px;height:72px}
@media(max-width:900px){.world-wrap{grid-template-columns:1fr;padding:12px}.world-map{min-height:600px}.stage-card{position:relative;top:auto}.campaign-head{padding:24px 18px}.brand-mark{display:none}.campaign-stats{font-size:14px}.tower-card{flex-basis:63px;width:63px}.tower-card strong,.tower-card small,.tower-card kbd{display:none}.tower-card .rune{font-size:29px;float:none;text-align:center;margin:0}.wave-panel{right:8px;bottom:100px}.upgrade-panel{left:8px;bottom:100px}.upgrade-panel.opposite-side{left:auto;right:8px}.realm-title{min-width:0}.topbar{gap:5px}.stat{padding:5px}.topbar .icon-btn{width:36px;height:36px}.realm-title strong{font-size:12px}}
@media(max-width:520px){.campaign-head h1{font-size:30px}.campaign-head .subtitle{font-size:11px}.campaign-stats .ghost{display:none}.world-map{min-height:540px}.world-wrap{padding:5px}.topbar{top:5px}.realm-title{display:none}.tower-dock{gap:3px}.tower-card{flex-basis:49px;width:49px;height:58px}.tower-card .rune{font-size:23px}.tower-card em{font-size:9px;text-align:center}.wave-panel{width:160px}.recipe-grid{grid-template-columns:1fr}.recipe-option p{min-height:0}}
@media(max-width:900px){.placement-info{left:8px;bottom:100px}.upgrade-panel{width:270px}}
@media(max-width:520px){.placement-info{width:225px}.placement-info .stat-grid{grid-template-columns:repeat(4,1fr)}.placement-info .stat-grid>span{padding:5px}.placement-info>p{display:none}.upgrade-panel{width:260px;max-height:360px;overflow:auto}}
@media(max-width:900px){.tower-card{padding:4px 3px 17px}.tower-card em{left:50%;right:auto;bottom:2px;transform:translateX(-50%);width:100%;padding:0;background:transparent;text-align:center;font-size:8px}}
@media(max-width:900px){.tower-card .tower-sprite{left:50%;top:0;transform:translateX(-50%);width:43px;height:43px}.tower-card strong,.tower-card small{margin-left:0}}
.tower-card.special.locked:not(.fusion-locked):after{display:none}
@media(max-width:520px){.topbar{width:calc(100% - 8px);min-width:0;padding:5px 4px;gap:2px}.topbar .stat{padding:2px 4px}.topbar .stat i{font-size:16px}.topbar .stat b{font-size:13px}.topbar .stat small{font-size:6px}.topbar .icon-btn{width:33px;height:36px}.fusion-card{padding:24px 16px}.parent-orb{width:68px;height:68px}.parent-orb img{width:74px;height:74px}.evolved-orb{width:92px;height:92px}.evolved-orb img{width:104px;height:104px}}
@media(max-width:700px){.fusion-result{grid-template-columns:1fr;text-align:center}.fusion-result .primary{width:100%}.branch-empty{grid-template-columns:auto 1fr}.branch-empty i{display:none}.unlocked-recipes{grid-template-columns:1fr}.element-choice{min-width:68px}.campaign-stats{gap:6px}.campaign-stats button{padding:8px;font-size:9px}}

#home{overflow:hidden;background:radial-gradient(circle at 50% 25%,#5aa96b 0,#1c5849 42%,#0c2928 78%)}
#home:before,#home:after{content:"";position:absolute;left:-10%;right:-10%;bottom:-18%;height:55%;border-radius:50% 50% 0 0;background:#183f35;box-shadow:0 -35px 80px rgba(164,225,102,.18)}
#home:after{bottom:-34%;left:24%;right:-18%;background:#102f2d;transform:rotate(-8deg)}
.home-card{position:relative;z-index:2;width:min(520px,calc(100% - 34px));margin:9vh auto 0;text-align:center}.home-rune{display:grid;place-items:center;width:92px;height:92px;margin:0 auto 22px;border-radius:31px;background:linear-gradient(145deg,#ffe476,#ff914d);box-shadow:0 9px 0 #9e4b38,0 20px 55px rgba(255,190,71,.25);font-size:58px}.home-card h1{margin:0;color:#fff8df;font-size:clamp(58px,9vw,104px);line-height:.78;letter-spacing:-5px;text-shadow:0 7px #143e37}.home-actions{display:grid;gap:13px;width:min(310px,100%);margin:48px auto}.home-continue{padding:14px;font-weight:900}.home-continue:disabled{opacity:.4;cursor:not-allowed}
.campaign-head{justify-content:flex-end;gap:10px;padding-top:18px;padding-bottom:8px}.campaign-head .ghost{min-width:120px;font-weight:900}.world-wrap{padding-top:10px}.difficulty-picker{display:grid;gap:7px;margin:15px 0}.difficulty-picker button{display:grid;grid-template-columns:92px 1fr;align-items:center;padding:9px 11px;border:1px solid #52786c;border-radius:12px;background:#21473f;color:#d8e8de;text-align:left;cursor:pointer}.difficulty-picker button.selected{border-color:#ffdb5d;background:#564d31;box-shadow:0 0 0 2px rgba(255,219,93,.15)}.difficulty-picker strong{font-size:11px;color:#fff2a8}.difficulty-picker small{font-size:9px;color:#a9c5b5}.stage-art{transition:.25s}
.toast{position:fixed}.result-card.special-loot{border-color:#d1a8ff;box-shadow:0 0 70px rgba(143,83,255,.35)}
#ending{overflow:hidden;display:none;background:linear-gradient(#66c9ee 0 43%,#74bd56 44%,#285d43 100%)}#ending.active{display:grid;place-items:center}.ending-rays{position:absolute;left:50%;top:17%;width:900px;height:900px;transform:translate(-50%,-50%);background:repeating-conic-gradient(from 0deg,rgba(255,246,168,.35) 0 9deg,transparent 9deg 18deg);border-radius:50%;animation:endingSpin 35s linear infinite}.ending-party{position:absolute;left:0;right:0;bottom:7%;display:flex;justify-content:center;gap:clamp(12px,4vw,60px);font-size:clamp(38px,7vw,90px);filter:drop-shadow(0 7px #275941);animation:endingBounce 1.1s ease-in-out infinite alternate}.ending-party span:nth-child(even){animation-delay:.3s}.ending-card{position:relative;z-index:2;width:min(560px,calc(100% - 28px));padding:35px;border-radius:34px;text-align:center;background:rgba(18,59,53,.9)}.ending-card h2{margin:5px 0 12px;font-size:clamp(32px,6vw,54px);color:#fff2a0}.ending-card p{color:#d8eadf;line-height:1.6}.ending-loot{margin:20px 0;padding:12px;border-radius:14px;background:#3c315d;color:#d9baff;font-weight:900}.ending-card .ghost{width:100%;margin-top:12px}@keyframes endingSpin{to{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes endingBounce{to{transform:translateY(-18px)}}
@media(max-width:700px){.campaign-head{padding:10px}.campaign-head .ghost{min-width:0;flex:1;padding:8px;font-size:10px}.difficulty-picker button{grid-template-columns:80px 1fr}.home-card{margin-top:11vh}.home-actions{margin-top:38px}}

/* Evolution Lab: large, game-readable branch and combat preview */
.fusion-card{width:min(1040px,100%);padding:32px;text-align:left}.fusion-card>.eyebrow,.fusion-card>h2,.fusion-card>.fusion-copy{text-align:center}.fusion-card>h2{font-size:38px}.fusion-copy,.fusion-card>p:not(.eyebrow){font-size:14px}.lab-wallet{font-size:12px;padding:13px 17px}.element-picker{padding:18px;border:1px solid #456a60;background:linear-gradient(145deg,rgba(22,55,50,.92),rgba(31,47,61,.92))}.element-picker h3{margin:0 0 14px;color:#fff2b0;font-size:17px;text-align:center}.element-choice{min-width:118px;padding:12px 15px;border-width:2px;font-size:13px}.element-choice span{font-size:34px}.element-choice strong{font-size:13px}.branch-builder{margin-top:16px}.branch-empty{grid-template-columns:40px 1fr 40px 1fr 40px 1fr;padding:22px;font-size:13px}.branch-empty b{width:32px;height:32px;font-size:14px}.branch-head{display:flex;align-items:center;justify-content:space-between;padding:13px 17px;border-radius:14px 14px 0 0;background:#352d55}.branch-head span{color:#c8aaff;font-size:11px;font-weight:900;letter-spacing:1.5px}.branch-head strong{font-size:16px;color:#fff3bc}.third-step{padding:18px;border:1px solid #625482;background:#201f38}.third-step h3{margin:0 0 3px!important;color:#fff;font-size:18px}.third-step p{margin:0 0 13px;color:#aebfb9;font-size:13px}.third-step>div{justify-content:flex-start}.third-choice{display:flex;align-items:center;gap:8px;padding:10px 14px;border-width:2px;font-size:13px}.third-choice span{font-size:22px}.third-choice strong{font-size:13px}.fusion-result{grid-template-columns:250px minmax(0,1fr);align-items:stretch;gap:24px;padding:22px;border-radius:0 0 22px 22px;background:linear-gradient(135deg,#3e3168,#203f46 62%,#214d43)}.fusion-hero{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:330px;padding:20px;border-radius:20px;background:radial-gradient(circle at 50% 38%,rgba(209,175,255,.23),rgba(13,32,34,.5))}.fusion-hero .recipe-parents{margin-bottom:13px}.fusion-hero .fusion-arrow{font-size:27px;transform:rotate(90deg);margin:5px}.fusion-hero .evolved-orb{width:132px;height:132px;border-radius:35px}.fusion-hero .evolved-orb img{width:148px;height:148px}.fusion-title span{color:#cdb1ff;font-size:11px;font-weight:900;letter-spacing:1.6px}.fusion-title h2{margin:3px 0 15px;color:#fff0a7;font-size:32px}.fusion-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.fusion-stat-grid>span{display:grid;grid-template-columns:30px 1fr;padding:12px;border:1px solid #52736d;border-radius:14px;background:rgba(18,42,42,.7)}.fusion-stat-grid i{grid-row:1/4;font-size:23px;font-style:normal;color:#ffe17a}.fusion-stat-grid small,.fusion-stat-grid strong,.fusion-stat-grid em{grid-column:2}.fusion-stat-grid small{color:#b1c8bf;font-size:11px}.fusion-stat-grid strong{color:#fff;font-size:24px}.fusion-stat-grid em{color:#89a99e;font-size:10px;font-style:normal}.skills-title{margin:17px 0 9px!important;color:#ffe195!important;font-size:17px!important}.ability-list{display:grid;grid-template-columns:1fr 1fr;gap:9px}.ability-list>div{display:flex;gap:10px;padding:11px;border-radius:13px;background:rgba(15,35,37,.62)}.ability-list>div>i{display:grid;place-items:center;flex:0 0 34px;height:34px;border-radius:10px;background:#55467a;color:#ffe083;font-size:20px;font-style:normal}.ability-list strong{display:block;color:#fff;font-size:13px}.ability-list p{margin:3px 0 0;color:#b9cec5;font-size:12px;line-height:1.35}.evolve-action{margin-top:15px;font-size:14px}.evolve-action:disabled{cursor:not-allowed;filter:saturate(.45);opacity:.7}.unlocked-heading{font-size:20px!important}.unlocked-recipes{grid-template-columns:repeat(3,minmax(0,1fr))}.evolution-collection-card{display:grid;grid-template-columns:62px 1fr;gap:10px;align-items:center;padding:12px;border:1px solid #5d6e78;border-radius:16px;background:#213f3e;color:#fff;text-align:left;cursor:pointer}.evolution-collection-card:hover{border-color:#d1abff;background:#304f4d;transform:translateY(-2px)}.evolution-collection-card img{width:64px;height:64px;object-fit:contain}.collection-copy{display:grid;gap:2px}.collection-copy em{color:#ffe18c;font-size:15px;font-style:normal}.collection-copy strong{font-size:14px}.collection-copy small{color:#a9c0b6;font-size:11px}.evolution-collection-card>b{grid-column:1/3;padding-top:8px;border-top:1px solid #47615c;color:#cbb0ff;font-size:11px;text-align:right;text-transform:uppercase}.empty-collection{font-size:13px}
@media(max-width:760px){.fusion-card{padding:24px 14px}.fusion-result{grid-template-columns:1fr}.fusion-hero{min-height:230px}.fusion-stat-grid{grid-template-columns:1fr}.ability-list{grid-template-columns:1fr}.unlocked-recipes{grid-template-columns:1fr}.branch-empty{grid-template-columns:34px 1fr}.element-choice{min-width:86px}.third-step>div{justify-content:center}}

/* Evolution Lab: direct three-row monster builder */
.fusion-slots{display:grid;gap:10px}.fusion-slot-row{display:grid;grid-template-columns:165px minmax(0,1fr);align-items:center;gap:12px;padding:10px;border:1px solid #476a62;border-radius:16px;background:rgba(13,39,37,.5)}.fusion-slot-label{display:flex;align-items:center;gap:11px}.fusion-slot-label>b{display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:13px;background:linear-gradient(145deg,#7257a0,#4b3d73);color:#fff2ad;font-size:20px}.fusion-slot-label span{display:grid;gap:2px}.fusion-slot-label strong{color:#fff;font-size:14px}.fusion-slot-label small{color:#91afa5;font-size:10px}.fusion-slot-options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}.fusion-slot-row.optional .fusion-slot-options{grid-template-columns:repeat(7,minmax(0,1fr))}.fusion-monster-choice{display:grid;place-items:center;min-width:0;height:76px;padding:3px;border:2px solid transparent;border-radius:13px;background:#244943;color:#c6d8ce;cursor:pointer}.fusion-monster-choice img{width:52px;height:52px;margin-bottom:-5px;object-fit:contain;filter:drop-shadow(0 3px 3px rgba(0,0,0,.3))}.fusion-monster-choice strong{font-size:10px}.fusion-monster-choice:hover:not(:disabled){background:#316158}.fusion-monster-choice.selected{border-color:#ffdf66;background:linear-gradient(145deg,#685936,#4d4936);color:#fff2aa;box-shadow:0 0 14px rgba(255,221,91,.2)}.fusion-monster-choice:disabled{filter:grayscale(.7);opacity:.24;cursor:not-allowed}.fusion-none span{font-size:27px;line-height:1}.fusion-placeholder{display:grid;place-items:center;gap:5px;padding:26px;border:1px dashed #617971;border-radius:18px;background:rgba(20,43,42,.5);text-align:center}.fusion-placeholder>span{color:#caa8ff;font-size:28px}.fusion-placeholder strong{color:#fff0aa;font-size:16px}.fusion-placeholder small{color:#9bb3aa;font-size:11px}.fusion-result-head{display:flex;align-items:center;justify-content:space-between;padding:12px 17px;border-radius:16px 16px 0 0;background:#352d55}.fusion-result-head span{color:#c8aaff;font-size:11px;font-weight:900;letter-spacing:1.5px}.fusion-result-head strong{color:#fff3bc;font-size:15px}.fusion-result-head+.fusion-result{border-radius:0 0 22px 22px}
.fusion-monster-choice>small{color:#ffe07b;font-size:8px;font-weight:900;line-height:1}.collection-price{display:block;margin-top:4px;color:#ffdf76;font-size:8px;font-weight:900;letter-spacing:.4px}.fusion-result:not(.base-preview) .fusion-stat-grid{grid-template-columns:repeat(4,1fr)}
@media(max-width:760px){.fusion-result:not(.base-preview) .fusion-stat-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.fusion-slot-row{grid-template-columns:1fr}.fusion-slot-label{justify-content:center}.fusion-slot-options,.fusion-slot-row.optional .fusion-slot-options{display:flex;overflow-x:auto}.fusion-monster-choice{flex:0 0 76px}.fusion-result-head{align-items:flex-start;gap:6px;flex-direction:column}}

/* Installable mobile app and fixed game viewport */
html,body,#app{width:100%;height:100%;height:100dvh;overscroll-behavior:none;touch-action:manipulation}
body{padding:0 env(safe-area-inset-right) 0 env(safe-area-inset-left)}
.screen{height:100%;height:100dvh}
#battle{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);background:#091d1c}
#battle.active{display:grid;place-items:center}
.game-frame{position:relative;width:min(100%,calc(100dvh * 16 / 9));max-height:100%;aspect-ratio:16/9;overflow:hidden;background:#6ba638;box-shadow:0 0 70px rgba(0,0,0,.5)}
.game-frame #game{inset:0;width:100%;height:100%;object-fit:fill;background:transparent;z-index:2}
#stageBackdrop{position:absolute;inset:0;z-index:1;width:100%;height:100%;pointer-events:none}
.rotate-gate{display:none;position:fixed;z-index:100;inset:0;place-items:center;align-content:center;padding:32px;background:rgba(7,25,24,.97);color:#fff;text-align:center}.rotate-gate h2{margin:20px 0 18px;color:#fff0a2;font-size:28px}.rotate-phone{position:relative;width:70px;height:112px;margin:auto;border:6px solid #ffe068;border-radius:14px;color:transparent;animation:rotateDevice 1.8s ease-in-out infinite}.rotate-phone:after{content:"";position:absolute;left:50%;bottom:5px;width:8px;height:8px;transform:translateX(-50%);border-radius:50%;background:#ffe068}.rotate-phone i{position:absolute;right:-46px;top:26px;color:#8fe5b1;font-size:38px;font-style:normal}.rotate-gate .ghost{min-width:150px}@keyframes rotateDevice{0%,35%{transform:rotate(0)}65%,100%{transform:rotate(90deg)}}

@media (pointer:coarse) and (orientation:portrait){body.play-mode .rotate-gate{display:grid}}

@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){
  .home-card{display:grid;grid-template-columns:minmax(280px,1fr) 300px;grid-template-rows:auto auto;align-items:center;column-gap:36px;width:min(820px,calc(100% - 40px));height:100%;margin:0 auto}.home-card h1{grid-row:1/3;font-size:clamp(54px,11vh,82px);letter-spacing:-3px}.home-actions{width:100%;margin:0;gap:8px}.home-actions .primary,.home-continue{padding:10px}
  #campaign{overflow:hidden}.campaign-head{height:48px;max-width:none;padding:6px 10px}.campaign-head .ghost{min-width:96px;padding:7px 10px;font-size:10px}.world-wrap{grid-template-columns:minmax(0,1fr) 250px;gap:8px;width:100%;max-width:none;height:calc(100dvh - 48px);padding:4px 8px 8px}.world-map{min-height:0;height:100%;border-width:2px;border-radius:18px}.stage-card{position:relative;top:auto;align-self:stretch;height:100%;padding:11px 12px;border-radius:18px;overflow:auto}.stage-art{display:none}.stage-card .eyebrow{font-size:8px}.stage-card h2{margin-bottom:4px;font-size:18px}.stage-card>p:not(.eyebrow):not(.hint){margin:4px 0;font-size:9px;line-height:1.3}.stage-meta{margin:7px 0;gap:4px}.stage-meta span{padding:4px 5px;font-size:7px}.difficulty-picker{gap:4px;margin:7px 0}.difficulty-picker button{grid-template-columns:62px 1fr;padding:5px 6px}.difficulty-picker strong{font-size:9px}.difficulty-picker small{font-size:7px}.stage-card .primary{padding:9px;font-size:10px}.stage-card .hint{display:none}.node{width:30px;height:30px;border-width:2px;font-size:9px;box-shadow:0 3px 0 #8a512b,0 4px 7px #16382f}.node.boss{width:36px;height:36px}.node-stars{display:block;bottom:-12px;padding:2px 3px;border-radius:7px;background:rgba(22,55,47,.92);color:#ffe268;font-size:6px;line-height:1;letter-spacing:-.4px;text-shadow:none;box-shadow:0 1px 3px rgba(8,29,24,.55)}.node-stars:empty{display:none}.route{height:4px}.fusion-modal{padding:6px}.fusion-card{max-height:96dvh;padding:18px}.fusion-card>h2{font-size:27px}.fusion-copy{font-size:10px!important}.element-picker{padding:10px}.element-choice{min-width:75px;padding:6px;font-size:9px}.element-choice span{font-size:24px}.fusion-result{grid-template-columns:170px 1fr;padding:12px}.fusion-hero{min-height:220px}.fusion-stat-grid>span{padding:8px}.ability-list>div{padding:7px}
  .game-frame{width:min(100%,calc(100dvh * 16 / 9));height:auto}.topbar{top:5px;width:calc(100% - 10px);min-width:0;gap:3px;padding:4px 5px;border-width:1px;border-radius:13px}.topbar .icon-btn{flex:0 0 32px;width:32px;height:32px;border-radius:9px;font-size:15px}.realm-title{min-width:106px}.realm-title small{font-size:6px;letter-spacing:.8px}.realm-title strong{font-size:10px}.topbar .stat{gap:3px;padding:2px 5px}.topbar .stat i{font-size:14px}.topbar .stat b{font-size:10px}.topbar .stat small{font-size:5px}.tower-dock{left:5px;right:158px;bottom:5px;transform:none;justify-content:flex-start;gap:3px;max-width:none;padding:4px;border-width:1px;border-radius:13px}.tower-card{flex:0 0 52px;width:52px;height:56px;padding:2px 2px 14px;border-radius:10px}.tower-card:hover,.tower-card.selected{transform:translateY(-2px)}.tower-card .tower-sprite{left:50%;top:-2px;width:39px;height:42px;transform:translateX(-50%)}.tower-card strong,.tower-card small,.tower-card kbd{display:none}.tower-card em{left:50%;right:auto;bottom:1px;width:100%;padding:0;transform:translateX(-50%);background:none;font-size:8px;text-align:center}.wave-panel{right:5px;bottom:5px;width:148px;padding:5px;border-width:1px;border-radius:13px}.wave-panel p{margin-bottom:4px;font-size:7px}.wave-panel .primary{padding:8px 5px;font-size:9px;box-shadow:0 3px 0 #b97428}.placement-info,.upgrade-panel{left:5px;bottom:68px;width:220px;max-height:calc(100% - 116px);padding:9px;border-width:1px;border-radius:13px;overflow:auto}.placement-head>span{width:38px;height:38px}.placement-head h3{font-size:13px}.placement-info>p{margin:5px 0;font-size:8px}.placement-info .stat-grid>span{padding:4px}.placement-tip{margin-top:5px;padding:4px;font-size:7px}.upgrade-panel.show{grid-template-columns:43px 1fr;gap:5px}.upgrade-hero{height:43px}.upgrade-panel h3{font-size:13px}.upgrade-choice{grid-template-columns:26px 1fr auto;padding:5px}.upgrade-choice .choice-icon{width:25px;height:25px}.upgrade-choice strong{font-size:9px}.upgrade-choice small{font-size:7px}.toast{top:50px;font-size:9px}.result-card{max-height:94%;padding:16px;overflow:auto}.big-rune{font-size:38px}.result-card h2{font-size:22px}.result-stars{font-size:28px}.result-card p{font-size:10px}
}

/* Minimal mobile-only install prompt */
.mobile-landscape-chip,.pwa-install-banner{display:none}
@media (pointer:coarse){
  .mobile-landscape-chip{display:inline-flex;align-items:center;justify-content:center;margin:14px auto 0;padding:6px 11px;border-radius:999px;background:rgba(10,38,34,.62);color:#cce2d4;font-size:9px;font-weight:900;letter-spacing:.8px;text-transform:uppercase}
  .pwa-install-banner{position:fixed;z-index:130;top:max(8px,env(safe-area-inset-top));left:50%;display:flex;align-items:center;gap:9px;width:min(430px,calc(100% - 16px));min-height:64px;padding:8px 45px 8px 9px;border:1px solid rgba(255,255,255,.16);border-radius:17px;background:rgba(15,48,43,.97);box-shadow:0 12px 32px rgba(3,18,16,.5);color:#fff;opacity:0;pointer-events:none;transform:translate(-50%,-130%);transition:transform .38s cubic-bezier(.2,.8,.2,1),opacity .25s ease;backdrop-filter:blur(14px)}
  .pwa-install-banner.show{opacity:1;pointer-events:auto;transform:translate(-50%,0)}
  .pwa-install-banner img{flex:0 0 43px;width:43px;height:43px;border-radius:12px}.pwa-install-banner>div{min-width:0;flex:1;text-align:left}.pwa-install-banner strong,.pwa-install-banner small{display:block}.pwa-install-banner strong{overflow:hidden;font-size:12px;white-space:nowrap;text-overflow:ellipsis}.pwa-install-banner small{margin-top:3px;color:#a9c9ba;font-size:9px}.pwa-install-action{padding:8px 11px;border:0;border-radius:10px;background:#ffd455;color:#493a1e;font-size:10px;font-weight:900;cursor:pointer}.pwa-install-dismiss{position:absolute;right:3px;top:3px;width:38px;height:38px;border:0;background:transparent;color:#a8c2b5;font-size:22px;cursor:pointer}
}
@media (pointer:coarse) and (orientation:landscape){.mobile-landscape-chip{grid-column:2;margin:8px 0 0}}

/* Fallback for mobile browsers that report a desktop-like pointer */
@media (orientation:landscape) and (max-width:1100px){
  .wave-panel{right:8px;bottom:128px;width:220px;padding:8px}
  .wave-panel p{margin-bottom:6px;font-size:9px}
  .wave-panel .primary{padding:9px 7px;font-size:10px}
}

/* Mobile browser access is install-only; installed PWAs keep the normal title actions. */
body.mobile-browser-gate .home-actions{display:none}
body.mobile-browser-gate .pwa-install-banner{position:fixed;z-index:130;top:max(8px,env(safe-area-inset-top));left:50%;display:flex;align-items:center;gap:9px;width:min(430px,calc(100% - 16px));min-height:64px;padding:8px 45px 8px 9px;border:1px solid rgba(255,255,255,.16);border-radius:17px;background:rgba(15,48,43,.97);box-shadow:0 12px 32px rgba(3,18,16,.5);color:#fff;opacity:0;pointer-events:none;transform:translate(-50%,-130%);transition:transform .38s cubic-bezier(.2,.8,.2,1),opacity .25s ease;backdrop-filter:blur(14px)}
body.mobile-browser-gate .pwa-install-banner.show{opacity:1;pointer-events:auto;transform:translate(-50%,0)}
body.mobile-browser-gate .pwa-install-banner img{flex:0 0 43px;width:43px;height:43px;border-radius:12px}
body.mobile-browser-gate .pwa-install-banner>div{min-width:0;flex:1;text-align:left}
body.mobile-browser-gate .pwa-install-banner strong,body.mobile-browser-gate .pwa-install-banner small{display:block}
body.mobile-browser-gate .pwa-install-banner strong{overflow:hidden;font-size:12px;white-space:nowrap;text-overflow:ellipsis}
body.mobile-browser-gate .pwa-install-banner small{margin-top:3px;color:#a9c9ba;font-size:9px}
body.mobile-browser-gate .pwa-install-action{padding:8px 11px;border:0;border-radius:10px;background:#ffd455;color:#493a1e;font-size:10px;font-weight:900;cursor:pointer}
body.mobile-browser-gate .pwa-install-action:disabled{cursor:default;opacity:.7}
body.mobile-browser-gate .pwa-install-dismiss{position:absolute;right:3px;top:3px;width:38px;height:38px;border:0;background:transparent;color:#a8c2b5;font-size:22px;cursor:pointer}
body.mobile-browser-gate .pwa-install-banner.minimized{left:auto;right:max(8px,env(safe-area-inset-right));width:auto;min-height:0;padding:5px;transform:translate(0,0)}
body.mobile-browser-gate .pwa-install-banner.minimized img,body.mobile-browser-gate .pwa-install-banner.minimized>div,body.mobile-browser-gate .pwa-install-banner.minimized .pwa-install-dismiss{display:none}

/* Placement information never captures map input and clears itself when aiming beneath it. */
.placement-info{pointer-events:none;transition:opacity .16s ease,transform .16s ease}
.placement-info.peek{opacity:.1;transform:translateY(4px)}

/* Two-slot evolution collection with reversible, paid removal. */
.evolution-collection-card{display:block;padding:0;overflow:hidden}
.collection-preview{display:grid;grid-template-columns:62px 1fr;gap:10px;align-items:center;width:100%;padding:12px;border:0;background:transparent;color:#fff;text-align:left;cursor:pointer}
.collection-preview:hover{background:rgba(255,255,255,.05)}
.collection-preview img{width:64px;height:64px;object-fit:contain}
.collection-preview>b{grid-column:1/3;padding-top:8px;border-top:1px solid #47615c;color:#cbb0ff;font-size:11px;text-align:right;text-transform:uppercase}
.devolve-action{width:100%;padding:9px 12px;border:0;border-top:1px solid #594f65;background:#332c42;color:#e4c8ff;font-size:10px;font-weight:900;cursor:pointer}
.devolve-action:hover:not(:disabled){background:#493653;color:#fff}
.devolve-action:disabled{opacity:.4;cursor:not-allowed}

/* The battle dock grows only as cards are unlocked; no empty evolution slots. */
@media (orientation:landscape) and (max-width:1100px), (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){
  .tower-dock{right:auto;width:max-content;max-width:calc(100% - 168px)}
}

/* Wave control is a clean standalone button. Status remains available to game logic. */
.wave-panel{right:14px;bottom:14px;width:270px;padding:0;border:0;background:transparent;box-shadow:none;backdrop-filter:none}
.wave-panel p{display:none}
@media (orientation:landscape) and (max-width:1100px), (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){
  .wave-panel{right:5px;bottom:5px;width:148px;padding:0}
}

/* Hard bounds prevent browser pointer quirks from stretching the dock or wave control. */
.tower-dock{right:auto!important;width:max-content!important;min-width:0!important;max-width:calc(100% - 190px)!important;justify-content:flex-start}
.tower-dock{scrollbar-width:none}.tower-dock::-webkit-scrollbar{display:none}
.wave-panel{right:8px!important;bottom:8px!important;width:156px!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important}
.wave-panel .primary{padding:11px 9px;font-size:11px}
@media (orientation:landscape) and (max-height:700px){
  .game-frame{width:100%;height:100%;max-height:none;aspect-ratio:auto}
}

/* Tactical placement and sale confirmation */
.battle-confirm{position:absolute;z-index:8;left:50%;bottom:108px;display:none;grid-template-columns:54px minmax(150px,1fr) auto;align-items:center;gap:11px;width:min(560px,calc(100% - 28px));padding:10px 11px;border-radius:19px;transform:translate(-50%,12px);opacity:0;transition:opacity .16s ease,transform .16s ease}
.battle-confirm.show{display:grid;transform:translate(-50%,0);opacity:1}
.battle-confirm-icon{display:grid;place-items:center;width:54px;height:54px;border-radius:15px;background:linear-gradient(145deg,#3f7463,#264f48)}.battle-confirm-icon img{width:66px;height:66px;object-fit:contain;filter:drop-shadow(0 4px 3px rgba(7,26,22,.45))}
.battle-confirm-copy{display:grid;gap:2px;min-width:0}.battle-confirm-copy small{color:#ffe06b;font-size:8px;font-weight:900;letter-spacing:1.3px}.battle-confirm-copy strong{overflow:hidden;color:#fff8dd;font-size:15px;white-space:nowrap;text-overflow:ellipsis}.battle-confirm-copy span{color:#afcbbd;font-size:10px}
.battle-confirm-actions{display:flex;gap:7px}.battle-confirm-actions button{width:auto;min-width:78px;padding:10px 12px;font-size:10px}.battle-confirm-actions .primary{box-shadow:0 4px 0 #b97428}.battle-confirm-actions .confirm-danger{background:linear-gradient(#ff8b73,#e14e45);color:#fff;box-shadow:0 4px 0 #8f322d}
@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){.battle-confirm{bottom:70px;grid-template-columns:40px minmax(125px,1fr) auto;gap:7px;width:min(460px,calc(100% - 176px));padding:6px 7px;border-radius:14px}.battle-confirm-icon{width:40px;height:40px;border-radius:11px}.battle-confirm-icon img{width:49px;height:49px}.battle-confirm-copy small{font-size:6px}.battle-confirm-copy strong{font-size:11px}.battle-confirm-copy span{font-size:8px}.battle-confirm-actions{gap:4px}.battle-confirm-actions button{min-width:58px;padding:7px 8px;font-size:8px}}
@media(max-width:560px) and (orientation:portrait){.battle-confirm{bottom:20px;grid-template-columns:44px 1fr;padding:8px}.battle-confirm-actions{grid-column:1/3}.battle-confirm-actions button{flex:1}}

/* Cinematic title screen */
#home{isolation:isolate;background:#102f2b url('assets/scenery/meadow-ground-v2.webp') center/cover}
#home:before{z-index:-2;inset:0;height:auto;border-radius:0;background:linear-gradient(90deg,rgba(8,35,31,.97) 0%,rgba(12,48,40,.88) 37%,rgba(15,51,39,.25) 72%,rgba(9,30,28,.58) 100%);box-shadow:none}
#home:after{z-index:-1;left:0;right:0;bottom:0;height:34%;border-radius:0;background:linear-gradient(transparent,rgba(4,24,22,.78));transform:none}
.home-card{display:grid;grid-template-columns:minmax(360px,.8fr) minmax(520px,1.35fr);align-items:center;gap:clamp(20px,4vw,70px);width:min(1280px,calc(100% - 56px));height:100%;margin:0 auto;text-align:left}
.home-brand{position:relative;z-index:4}.home-kicker{display:flex;align-items:center;gap:9px;margin:0 0 18px;color:#ffd75c;font-size:11px;font-weight:900;letter-spacing:2px}.home-kicker span{font-size:17px;filter:drop-shadow(0 0 8px #ffba40)}
.home-card h1{margin:0;color:#fff8df;font-size:clamp(62px,7.2vw,108px);line-height:.75;letter-spacing:-5px;text-align:left;text-shadow:0 7px 0 #123d35,0 14px 28px rgba(4,25,22,.44)}.home-card h1 em{color:#ffcf49;font-style:normal}
.home-tagline{margin:26px 0 19px;color:#daeadf;font-size:clamp(15px,1.35vw,20px);font-weight:700;line-height:1.45;text-shadow:0 2px 4px #0b2a25}
.home-features{display:flex;align-items:center;gap:7px}.home-features span{padding:7px 10px;border:1px solid rgba(185,224,165,.25);border-radius:999px;background:rgba(18,60,51,.72);color:#b9d1c3;font-size:9px;font-weight:900;letter-spacing:.5px;text-transform:uppercase;backdrop-filter:blur(6px)}.home-features b{color:#ffe170;font-size:12px}
.home-actions{display:grid;grid-template-columns:1.15fr .85fr;gap:10px;width:min(390px,100%);margin:26px 0 0}.home-actions .primary,.home-continue{min-height:48px;padding:12px 15px}.home-continue{background:rgba(28,76,65,.82)}
.home-scene{position:relative;align-self:center;min-width:0;aspect-ratio:1.34;border:2px solid rgba(223,244,190,.27);border-radius:42px;background:linear-gradient(rgba(115,176,80,.11),rgba(40,101,61,.18));box-shadow:inset 0 0 70px rgba(255,240,143,.08),0 38px 80px rgba(3,23,20,.5);overflow:hidden;transform:perspective(1200px) rotateY(-3deg)}
.home-scene:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 72% 17%,rgba(255,225,105,.38),transparent 27%),linear-gradient(180deg,transparent 55%,rgba(7,38,31,.32));pointer-events:none}.home-scene-sun{position:absolute;right:10%;top:7%;width:22%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,rgba(255,236,145,.45),rgba(255,207,72,.08) 52%,transparent 72%);filter:blur(2px)}
.home-battlefield{position:absolute;inset:0}.home-trail{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.home-trail path{fill:none;stroke-linecap:round}.trail-shadow{stroke:rgba(71,57,31,.62);stroke-width:92}.trail-road{stroke:#d7ad69;stroke-width:75}.trail-stitch{stroke:#f2d796;stroke-width:3;stroke-dasharray:9 15;opacity:.75}
.home-castle{position:absolute;z-index:2;right:-5%;top:19%;width:37%;filter:drop-shadow(0 13px 10px rgba(9,29,20,.52))}.home-pad{position:absolute;z-index:3;display:grid;place-items:center;width:19%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,#93ca50 52%,#396f44 54% 66%,#153f38 68%);box-shadow:0 8px 0 rgba(12,53,43,.75),0 15px 20px rgba(6,28,24,.3)}.home-pad:after{content:"";position:absolute;inset:14%;border:2px dashed rgba(237,255,161,.56);border-radius:50%}.home-pad img{position:relative;z-index:2;width:116%;height:116%;object-fit:contain;filter:drop-shadow(0 7px 4px rgba(6,31,26,.45));animation:homeKeeper 2.2s ease-in-out infinite}.pad-fire{left:10%;bottom:8%}.pad-ice{left:41%;top:6%;transform:scale(.9)}.pad-ice img{animation-delay:-1.1s}
.home-enemy{position:absolute;z-index:3;width:12%;height:19%;object-fit:contain;filter:drop-shadow(0 7px 3px rgba(9,28,22,.42));animation:homeMarch 1.15s ease-in-out infinite}.enemy-orc{left:48%;bottom:13%;width:14%;height:23%}.enemy-goblin{left:61%;bottom:23%;animation-delay:-.38s}.enemy-wolf{left:72%;bottom:33%;animation-delay:-.76s}
.home-shot{position:absolute;z-index:4;width:5.5%;aspect-ratio:1;border-radius:50%;animation:homeShot 1.45s linear infinite}.shot-fire{left:27%;bottom:25%;background:radial-gradient(circle at 35% 35%,#fff6b0 0 12%,#ffbd2f 25%,#ff5a20 55%,transparent 72%);box-shadow:0 0 18px #ff692c}.shot-ice{left:52%;top:24%;background:radial-gradient(circle at 35% 35%,#fff 0 14%,#8be8ff 30%,#38a5ff 58%,transparent 72%);box-shadow:0 0 18px #6edfff;animation-delay:-.72s}.home-impact{position:absolute;z-index:5;font-style:normal;font-size:26px;animation:homeImpact 1.45s ease-out infinite}.impact-fire{left:48%;bottom:28%;color:#ffcb41;text-shadow:0 0 15px #ff4b20}.impact-ice{left:70%;top:38%;color:#bff7ff;text-shadow:0 0 15px #42bfff;animation-delay:-.72s}
.home-evolution-badge{position:absolute;z-index:6;right:3%;bottom:3%;display:grid;gap:3px;padding:8px 11px;border:1px solid rgba(209,175,255,.55);border-radius:16px;background:linear-gradient(145deg,rgba(49,39,79,.94),rgba(21,67,59,.92));box-shadow:0 8px 20px rgba(6,25,23,.4)}.home-evolution-badge small{color:#d2b8ff;font-size:7px;font-weight:900;letter-spacing:1.3px;text-align:center}.home-evolution-badge>span{display:flex;align-items:center;color:#ffe46e;font-size:10px}.home-evolution-badge img{width:31px;height:31px;object-fit:contain}.home-evolution-badge img.evolved{width:40px;height:40px}.home-evolution-badge b{font-size:10px}
.home-scene-caption{position:absolute;z-index:7;left:5%;top:4%;display:flex;align-items:center;gap:7px;color:#e9f5df;font-size:8px;font-weight:900;letter-spacing:1.6px}.home-scene-caption i{width:18px;height:1px;background:#ffd65e}
@keyframes homeKeeper{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-5px) rotate(1deg)}}@keyframes homeMarch{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(3px) rotate(2deg)}}@keyframes homeShot{0%{transform:translate(0,0) scale(.55);opacity:0}12%{opacity:1}82%{opacity:1}100%{transform:translate(245%,20%) scale(1);opacity:0}}@keyframes homeImpact{0%,77%{transform:scale(0) rotate(0);opacity:0}83%{transform:scale(1.35) rotate(20deg);opacity:1}100%{transform:scale(.3) rotate(70deg);opacity:0}}
@media(max-width:850px) and (orientation:portrait){.home-card{grid-template-columns:1fr;grid-template-rows:auto minmax(260px,44vh);gap:14px;width:min(600px,calc(100% - 28px));height:auto;padding:7vh 0 3vh}.home-brand{text-align:center}.home-kicker{justify-content:center;margin-bottom:12px;font-size:8px}.home-card h1{text-align:center;font-size:clamp(52px,15vw,78px)}.home-tagline{margin:18px 0 13px;font-size:13px}.home-features{justify-content:center}.home-actions{margin:18px auto 0}.home-scene{width:100%;height:100%;aspect-ratio:auto;border-radius:26px;transform:none}.home-evolution-badge{transform:scale(.85);transform-origin:right bottom}}
@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){.home-card{display:grid;grid-template-columns:minmax(310px,.78fr) minmax(440px,1.3fr);grid-template-rows:1fr;column-gap:24px;width:min(1080px,calc(100% - 28px));height:100%;margin:0 auto}.home-card h1{grid-row:auto;font-size:clamp(52px,12vh,72px);letter-spacing:-3px}.home-kicker{margin-bottom:10px;font-size:8px}.home-tagline{margin:16px 0 12px;font-size:12px}.home-features span{padding:5px 7px;font-size:7px}.home-actions{margin-top:14px;gap:7px}.home-actions .primary,.home-continue{min-height:38px;padding:8px}.home-scene{max-height:92vh;border-radius:28px;transform:none}.mobile-landscape-chip{grid-column:auto;margin:8px 0 0}}
@media(prefers-reduced-motion:reduce){.home-pad img,.home-enemy,.home-shot,.home-impact{animation:none}}

/* v29 — unified illustrated adventure interface */
:root{--forest-950:#081f1d;--forest-900:#102f2b;--forest-800:#173f38;--forest-700:#255648;--leaf:#91cc5a;--parchment:#fff3cf;--sun:#ffd657;--sun-deep:#d88b2f;--violet:#b99be8;--line:rgba(236,247,206,.18);--panel:linear-gradient(155deg,rgba(21,61,52,.96),rgba(10,39,36,.97))}
button{letter-spacing:.01em}.primary{border:1px solid #fff0a3;border-radius:16px;background:linear-gradient(180deg,#ffe477,#ffc13f);box-shadow:0 5px 0 #9e5a29,0 10px 24px rgba(7,29,25,.32);color:#4d341c;text-transform:uppercase;letter-spacing:.07em}.ghost{border:1px solid rgba(205,232,190,.22);background:linear-gradient(180deg,rgba(48,94,78,.92),rgba(28,70,61,.95));box-shadow:inset 0 1px rgba(255,255,255,.08),0 4px 10px rgba(5,27,24,.22);color:#eef7df}.glass{background:var(--panel);border-color:var(--line);box-shadow:inset 0 1px rgba(255,255,255,.06),0 12px 28px rgba(3,20,18,.38)}

/* Journey map */
#campaign{overflow:hidden;background:#0b2d2a url('assets/scenery/meadow-ground-v2.webp') center/cover}#campaign:before{opacity:1;background:linear-gradient(180deg,rgba(8,37,33,.78),rgba(8,31,29,.38) 30%,rgba(6,27,25,.8)),radial-gradient(circle at 20% 20%,rgba(255,220,95,.12),transparent 30%);background-size:auto}
.campaign-head{z-index:5;justify-content:flex-start;width:100%;max-width:1440px;height:78px;padding:12px 26px;gap:10px}.campaign-brand{display:flex;align-items:center;gap:11px;margin-right:auto}.campaign-brand>span{display:grid;place-items:center;width:46px;height:46px;border:1px solid #ffe797;border-radius:15px;background:linear-gradient(145deg,#ffdd62,#e9903c);box-shadow:0 4px 0 #8d5030;color:white;font-size:25px;text-shadow:0 2px #a0582e}.campaign-brand div{display:grid}.campaign-brand small{color:#aad199;font-size:8px;font-weight:900;letter-spacing:2px}.campaign-brand strong{color:#fff4cd;font-size:20px;line-height:1.05}.campaign-resources{display:flex;gap:6px;margin-right:8px}.campaign-resources span{min-width:76px;padding:9px 12px;border:1px solid var(--line);border-radius:13px;background:rgba(8,39,35,.75);color:#ffe06d;font-size:13px;text-align:center}.campaign-resources span+span{color:#d1b5ff}.campaign-head .ghost{min-width:0;height:43px;padding:8px 13px;font-size:11px;font-weight:900}.campaign-head .fusion-btn{border-color:rgba(204,170,255,.4);background:linear-gradient(180deg,#51406f,#332e53)}
.world-wrap{grid-template-columns:minmax(0,1fr) 330px;gap:18px;width:100%;max-width:1440px;height:calc(100dvh - 78px);padding:4px 26px 22px}.world-map-shell{position:relative;min-width:0;height:100%;border:1px solid rgba(223,241,190,.36);border-radius:36px;background:rgba(18,66,51,.54);box-shadow:0 24px 60px rgba(2,22,19,.46);overflow:hidden}.world-map-shell:before{content:"";position:absolute;z-index:2;inset:0;border:12px solid rgba(16,64,49,.46);border-radius:35px;box-shadow:inset 0 0 0 1px rgba(247,233,167,.14);pointer-events:none}.world-map{height:100%;min-height:0;border:0;border-radius:0;background:linear-gradient(135deg,rgba(112,176,83,.52),rgba(28,91,67,.65)),url('assets/meadow-map.png') center/cover;box-shadow:inset 0 0 100px rgba(7,45,35,.65)}.world-map:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 78% 20%,rgba(255,229,119,.17),transparent 23%),linear-gradient(110deg,transparent 60%,rgba(6,45,39,.2));pointer-events:none}.world-map:after{background:linear-gradient(90deg,rgba(12,55,43,.16),transparent 20% 76%,rgba(8,39,34,.35));opacity:1}
.chapter-ribbon{position:absolute;z-index:5;left:28px;top:24px;display:grid;min-width:220px;padding:11px 18px 12px;border:1px solid rgba(255,235,158,.38);border-radius:16px;background:linear-gradient(145deg,rgba(38,77,59,.96),rgba(17,55,48,.94));box-shadow:0 7px 18px rgba(7,35,29,.36)}.chapter-ribbon span{color:#ffd65a;font-size:8px;font-weight:900;letter-spacing:2px}.chapter-ribbon strong{margin-top:2px;color:#fff2c8;font-size:18px}.chapter-ribbon small{margin-top:2px;color:#a8c9b2;font-size:9px}.map-compass{position:absolute;z-index:4;right:26px;top:22px;display:grid;place-items:center;width:60px;height:60px;border:1px solid rgba(255,240,184,.25);border-radius:50%;background:rgba(15,56,47,.55);color:#f8e4a3}.map-compass b{position:absolute;top:4px;font-size:8px;letter-spacing:1px}.map-compass i{font-size:25px;font-style:normal;text-shadow:0 0 10px #ffdf68}.map-legend{position:absolute;z-index:5;left:50%;bottom:17px;display:flex;gap:15px;padding:8px 13px;border:1px solid rgba(222,241,204,.18);border-radius:999px;background:rgba(10,45,39,.82);color:#bed3c3;font-size:8px;font-weight:900;letter-spacing:.4px;transform:translateX(-50%);white-space:nowrap}.map-legend span{display:flex;align-items:center;gap:5px}.map-legend i{display:grid;place-items:center;width:14px;height:14px;border-radius:50%;font-size:8px;font-style:normal}.legend-current{border:2px solid #ffe16b;background:#ffbc42}.legend-cleared{color:#ffe069}.legend-mystery{background:#587467;color:#dce6da}
.route{height:10px;border:2px solid rgba(116,97,54,.28);border-radius:999px;background:#e6d28c;box-shadow:0 4px 0 rgba(47,80,45,.5),0 0 0 4px rgba(214,232,134,.13);opacity:.82}.route:after{content:"";position:absolute;inset:2px 4px;border-top:1px dashed rgba(102,73,38,.45)}.route-unknown{background:linear-gradient(90deg,#d4c57f,rgba(175,193,132,.18));border-style:dashed;opacity:.45;box-shadow:none}
.node{width:64px;height:64px;border:3px solid #dff0b4;background:radial-gradient(circle at 45% 35%,#5e9b59,#2a644a 70%);box-shadow:0 7px 0 #184838,0 11px 20px rgba(6,36,29,.45);color:white}.node-icon{display:grid;place-items:center;width:100%;height:100%;font-size:29px;filter:drop-shadow(0 3px 2px rgba(6,29,24,.45))}.node:hover:not(:disabled),.node.selected{transform:translate(-50%,-50%) scale(1.1);filter:brightness(1.08)}.node.selected{border-color:#fff2a1;outline:7px solid rgba(255,220,80,.22);background:radial-gradient(circle at 45% 35%,#ffdf68,#e99441 72%);box-shadow:0 7px 0 #8b5331,0 0 28px rgba(255,213,70,.48)}.node.cleared:after{content:"✓";position:absolute;right:-6px;top:-6px;display:grid;place-items:center;width:21px;height:21px;border:2px solid #ebf8cc;border-radius:50%;background:#4d9b54;color:#fff;font-size:11px}.node.mystery{border-color:#8ca596;background:radial-gradient(circle,#6e8b7c,#415f53);box-shadow:0 6px 0 #2b493e;opacity:.72}.node.boss{width:76px;height:76px;border-color:#ffd789;background:radial-gradient(circle,#da7652,#753f4b 72%)}.node.current:not(.selected){animation:questPulse 1.8s ease-in-out infinite}.node-stars{bottom:-19px;padding:2px 5px;border-radius:999px;background:rgba(12,54,45,.9);font-size:9px;text-shadow:none}.you-are-here{position:absolute;left:50%;top:-24px;padding:3px 7px;border-radius:999px;background:#ffe169;color:#554021;font-size:7px;letter-spacing:1px;transform:translateX(-50%)}@keyframes questPulse{50%{box-shadow:0 7px 0 #184838,0 0 0 10px rgba(255,224,93,.2)}}
.stage-card{align-self:stretch;top:0;height:100%;padding:15px;border:1px solid rgba(227,242,204,.24);border-radius:28px;background:linear-gradient(165deg,rgba(22,64,55,.98),rgba(10,39,36,.98));box-shadow:inset 0 1px rgba(255,255,255,.06),0 20px 45px rgba(3,24,21,.42);overflow:auto}.stage-art{position:relative;height:165px;margin-bottom:16px;border:1px solid rgba(255,244,191,.23);border-radius:20px;box-shadow:inset 0 -35px 45px rgba(12,45,36,.32);font-size:67px;overflow:hidden}.stage-art:after{content:"";position:absolute;left:10%;right:10%;bottom:-18%;height:42%;border-radius:50%;background:rgba(15,65,48,.55)}.stage-art #stageRune{position:relative;z-index:2;filter:drop-shadow(0 7px 3px rgba(13,43,33,.4))}.quest-flag{position:absolute;z-index:3;left:10px;top:10px;padding:5px 8px;border-radius:8px;background:rgba(13,47,40,.84);color:#ffe078;font-size:7px;font-weight:900;letter-spacing:1.4px}.stage-card h2{color:#fff3ce;font-size:26px;line-height:1.05}.stage-card>p:not(.eyebrow):not(.hint){margin:8px 0;color:#bed5c6;font-size:12px;line-height:1.45}.stage-meta{flex-wrap:wrap;margin:12px 0}.stage-meta span{border:1px solid rgba(194,224,180,.12);background:rgba(37,82,69,.72);font-size:8px}.stage-meta #stageStars{color:#ffe06a;text-transform:none}.difficulty-picker{gap:5px;margin:11px 0}.difficulty-picker button{grid-template-columns:78px 1fr;padding:8px 9px;border-color:rgba(182,217,173,.16);background:rgba(28,70,61,.75)}.difficulty-picker button.selected{border-color:#f6d76a;background:linear-gradient(90deg,rgba(111,91,47,.78),rgba(46,75,55,.8));box-shadow:inset 3px 0 #ffd95d}.difficulty-picker strong{font-size:10px}.difficulty-picker small{font-size:8px}.stage-card .primary{padding:13px}.hint{color:#82a797!important}

/* Battle, lab and endings share the same carved game chrome */
.topbar{border-radius:20px}.icon-btn{border:1px solid rgba(216,239,201,.16);background:linear-gradient(180deg,#3d7563,#285a4e);box-shadow:0 3px 0 #163f37}.tower-dock{border-radius:20px}.tower-card{border-color:rgba(211,235,195,.09);background:linear-gradient(155deg,#326554,#224b43);box-shadow:inset 0 1px rgba(255,255,255,.05)}.tower-card:hover,.tower-card.selected{border-color:#ffe06b;background:linear-gradient(155deg,#57734b,#4d5f3e)}.upgrade-panel,.placement-info{border-radius:20px}.result{background:radial-gradient(circle,rgba(21,75,59,.35),rgba(5,26,24,.88))}.result-card,.ending-card{border:1px solid rgba(255,237,161,.3);background:linear-gradient(160deg,rgba(28,72,59,.97),rgba(17,47,43,.98));box-shadow:0 25px 70px rgba(2,20,18,.58)}.fusion-modal{background:radial-gradient(circle at 50% 20%,rgba(72,52,103,.38),rgba(5,24,22,.92))}.fusion-card{border-color:rgba(203,171,255,.28);background:linear-gradient(155deg,rgba(30,66,57,.98),rgba(40,31,66,.98))}.fusion-slot-row,.fusion-result,.evolution-collection-card{box-shadow:inset 0 1px rgba(255,255,255,.04)}#ending{background:#173f38 url('assets/scenery/meadow-ground-v2.webp') center/cover}#ending:after{content:"";position:absolute;inset:0;background:linear-gradient(rgba(42,114,79,.25),rgba(8,37,32,.76));pointer-events:none}

@media(max-width:900px){.campaign-brand div{display:none}.campaign-resources span{min-width:52px;padding:7px}.world-wrap{grid-template-columns:minmax(0,1fr) 285px;padding:4px 10px 10px}.chapter-ribbon{left:18px;top:18px}.stage-card{position:relative}.campaign-head{padding:8px 12px}.campaign-head .ghost{min-width:0}.world-map{min-height:0}}
@media(max-width:700px){.campaign-head{height:54px}.campaign-brand>span{width:35px;height:35px;border-radius:11px}.campaign-resources{margin-right:0}.campaign-resources span{min-width:43px;padding:6px;font-size:10px}.campaign-head .ghost{height:36px;padding:6px 8px}.campaign-head .ghost>span:not(:first-child){display:none}.world-wrap{height:calc(100dvh - 54px);grid-template-columns:minmax(0,1fr) 235px;gap:6px;padding:2px 5px 5px}.world-map-shell{border-radius:18px}.world-map-shell:before{border-width:5px;border-radius:17px}.chapter-ribbon{left:10px;top:9px;min-width:0;padding:7px 9px}.chapter-ribbon strong{font-size:12px}.chapter-ribbon small{display:none}.map-compass{right:9px;top:8px;width:38px;height:38px}.map-compass i{font-size:17px}.map-legend{bottom:6px;gap:7px;padding:5px 7px;font-size:6px}.node{width:43px;height:43px;border-width:2px;box-shadow:0 4px 0 #184838,0 6px 10px rgba(6,36,29,.4)}.node-icon{font-size:20px}.node.boss{width:51px;height:51px}.you-are-here{top:-17px;padding:2px 4px;font-size:5px}.node-stars{bottom:-13px;font-size:6px}.route{height:6px}.stage-card{padding:8px;border-radius:15px}.stage-art{display:grid;height:72px;margin-bottom:7px;border-radius:12px;font-size:34px}.quest-flag{padding:3px 5px;font-size:5px}.stage-card .eyebrow{font-size:6px}.stage-card h2{font-size:16px}.stage-card>p:not(.eyebrow):not(.hint){margin:4px 0;font-size:8px}.stage-meta{margin:5px 0;gap:3px}.stage-meta span{padding:3px 4px;font-size:6px}.difficulty-picker{margin:5px 0}.difficulty-picker button{grid-template-columns:53px 1fr;padding:4px 5px}.difficulty-picker strong{font-size:7px}.difficulty-picker small{font-size:6px}.stage-card .primary{padding:8px;font-size:8px}.stage-card .hint{display:none}}

/* Tablet play mode: scale controls to the available canvas instead of using phone sizing. */
@media (orientation:landscape) and (min-width:800px) and (max-width:1440px) and (min-height:540px){
  .topbar{top:clamp(8px,1.2vw,16px);width:min(94%,980px);gap:clamp(5px,.7vw,10px);padding:clamp(7px,.8vw,11px);border-width:2px;border-radius:clamp(15px,1.6vw,21px)}
  .topbar .icon-btn{flex:0 0 clamp(44px,4.2vw,54px);width:clamp(44px,4.2vw,54px);height:clamp(44px,4.2vw,54px);border-radius:clamp(11px,1.1vw,15px);font-size:clamp(17px,1.7vw,22px)}
  .realm-title{min-width:clamp(150px,17vw,220px)}.realm-title small{font-size:clamp(8px,.72vw,10px);letter-spacing:1.3px}.realm-title strong{font-size:clamp(14px,1.35vw,18px)}
  .topbar .stat{gap:clamp(4px,.5vw,7px);padding:5px clamp(8px,.9vw,13px)}.topbar .stat i{font-size:clamp(18px,1.8vw,23px)}.topbar .stat b{font-size:clamp(14px,1.35vw,18px)}.topbar .stat small{font-size:clamp(7px,.62vw,9px)}
  .tower-dock{left:clamp(8px,1vw,16px)!important;bottom:clamp(8px,1vw,16px)!important;right:auto!important;width:max-content!important;max-width:calc(100% - clamp(205px,19vw,270px))!important;gap:clamp(5px,.65vw,9px);padding:clamp(6px,.7vw,10px);border-width:2px;border-radius:clamp(16px,1.7vw,22px);transform:none}
  .tower-card{flex:0 0 clamp(76px,7.4vw,102px);width:clamp(76px,7.4vw,102px);height:clamp(76px,6.7vw,92px);padding:5px 5px 23px;border-width:2px;border-radius:clamp(12px,1.25vw,17px)}
  .tower-card .tower-sprite{left:3px;top:3px;width:clamp(50px,4.6vw,64px);height:clamp(55px,5.1vw,70px);transform:none}.tower-card strong,.tower-card small{display:block;margin-left:clamp(42px,4.1vw,57px)}.tower-card strong{margin-top:7px;font-size:clamp(9px,.82vw,12px)}.tower-card small{font-size:clamp(7px,.68vw,10px)}.tower-card kbd{display:block;font-size:9px}.tower-card em{left:auto;right:6px;bottom:4px;width:auto;padding:2px 6px;background:#173f36;font-size:clamp(9px,.78vw,11px);transform:none}
  .wave-panel{right:clamp(8px,1vw,16px)!important;bottom:clamp(8px,1vw,16px)!important;width:clamp(180px,17vw,235px)!important}.wave-panel .primary{min-height:clamp(48px,4.5vw,58px);padding:12px 10px;font-size:clamp(12px,1.05vw,15px)}
  .placement-info,.upgrade-panel{left:clamp(8px,1vw,16px);bottom:clamp(102px,9vw,132px);width:clamp(280px,27vw,350px);max-height:calc(100% - 180px);padding:clamp(13px,1.25vw,18px);border-width:2px;border-radius:20px}.placement-head>span{width:54px;height:54px}.placement-head h3,.upgrade-panel h3{font-size:17px}.placement-info>p{font-size:11px}.placement-info .stat-grid>span{padding:7px}.placement-tip{padding:7px;font-size:9px}.upgrade-panel.show{grid-template-columns:56px 1fr;gap:9px}.upgrade-hero{height:56px}.upgrade-choice{grid-template-columns:34px 1fr auto;padding:9px}.upgrade-choice .choice-icon{width:32px;height:32px}.upgrade-choice strong{font-size:11px}.upgrade-choice small{font-size:9px}
  .fusion-card{width:min(94vw,1100px);padding:clamp(24px,3vw,38px)}.fusion-monster-choice{height:clamp(82px,8vw,104px)}.fusion-monster-choice img{width:clamp(58px,5.5vw,74px);height:clamp(58px,5.5vw,74px)}.fusion-monster-choice strong{font-size:clamp(10px,.9vw,13px)}
}

/* v31 — responsive keeper archive and evolution workbench */
.fusion-modal{padding:clamp(8px,2vw,24px)}
.fusion-card{width:min(1180px,100%);max-height:calc(100dvh - clamp(16px,4vw,48px));padding:clamp(22px,3vw,38px);border:1px solid rgba(212,185,255,.38);border-radius:clamp(20px,2.5vw,34px);scrollbar-color:#6c5b88 transparent;scrollbar-width:thin}
.fusion-card .close{z-index:3;right:clamp(10px,1.6vw,20px);top:clamp(8px,1.2vw,15px);display:grid;place-items:center;width:42px;height:42px;border:1px solid rgba(220,234,218,.16);border-radius:13px;background:rgba(13,43,39,.8);font-size:25px;line-height:1}
.lab-heading{max-width:720px;margin:0 auto 20px;text-align:center}.lab-heading .eyebrow{font-size:10px;letter-spacing:2.4px}.lab-heading h2{margin:3px 0 8px;color:#fff5d6;font-size:clamp(30px,4vw,44px);line-height:1}.lab-heading .fusion-copy{margin:0;color:#bbd0c6;font-size:clamp(11px,1.25vw,14px);line-height:1.5}
.lab-wallet{position:relative;align-items:center;margin:0 0 22px;padding:12px 16px;border:1px solid rgba(200,224,193,.12);border-radius:14px;background:linear-gradient(90deg,rgba(14,47,42,.94),rgba(47,38,70,.88));box-shadow:inset 0 1px rgba(255,255,255,.04)}.lab-wallet span{display:flex;align-items:center;gap:8px}.lab-wallet span:last-child{justify-content:flex-end}.lab-wallet strong{padding:5px 9px;border-radius:9px;background:rgba(183,142,242,.1)}
.lab-section-heading{display:flex;align-items:center;gap:11px;margin:0 0 9px}.lab-section-heading>span{display:grid;place-items:center;flex:0 0 28px;height:28px;border:1px solid #d4b2ff;border-radius:9px;background:#564375;color:#fff1ad;font-size:12px;font-weight:900}.lab-section-heading div{display:grid;gap:2px}.lab-section-heading strong{color:#fff3c6;font-size:14px}.lab-section-heading small{color:#91afa5;font-size:10px}.lab-section-heading.result-heading{margin-top:22px}
.element-picker{padding:clamp(10px,1.6vw,18px);border:1px solid rgba(155,205,177,.34);border-radius:20px;background:linear-gradient(145deg,rgba(16,54,47,.9),rgba(27,43,57,.92));box-shadow:inset 0 1px rgba(255,255,255,.04)}
.element-picker>.fusion-slots{display:grid;width:100%;grid-template-columns:minmax(0,1fr);justify-content:stretch;gap:9px}.fusion-slot-row{grid-template-columns:190px minmax(0,1fr);gap:14px;width:100%;padding:9px 11px;border-color:rgba(126,173,151,.3);border-radius:16px;background:rgba(10,37,34,.44)}.fusion-slot-row.waiting{background:rgba(11,31,31,.3)}.fusion-slot-label>b{border:1px solid rgba(216,185,255,.22);background:linear-gradient(145deg,#765ca0,#493b6b);box-shadow:0 3px 0 #302844}.fusion-slot-label strong{font-size:13px}.fusion-slot-label small{font-size:9px;line-height:1.25}
.fusion-slot-options{gap:6px}.fusion-slot-row.optional .fusion-slot-options{grid-template-columns:repeat(7,minmax(66px,1fr))}.fusion-monster-choice{height:78px;border-color:rgba(190,224,200,.07);background:linear-gradient(155deg,#28564c,#20453f);transition:transform .16s ease,border-color .16s ease,background .16s ease}.fusion-monster-choice:hover:not(:disabled){border-color:#8bcda8;background:linear-gradient(155deg,#387060,#28584e);transform:translateY(-2px)}.fusion-monster-choice.selected{border-color:#ffe06a;background:linear-gradient(155deg,#716039,#4a4939);box-shadow:inset 0 0 0 1px rgba(255,240,151,.15),0 5px 15px rgba(8,27,24,.25)}.fusion-monster-choice img{width:52px;height:52px}.fusion-monster-choice strong{font-size:9px}.fusion-monster-choice:disabled{opacity:.2}.fusion-none{border-style:dashed}.fusion-none span{display:grid;place-items:center;width:37px;height:37px;margin:0 0 5px;border-radius:11px;background:rgba(173,194,179,.08);color:#b9cbc0;font-size:24px}.fusion-none.selected span{background:rgba(255,225,105,.12);color:#ffe377}
.branch-builder{margin-top:0;scroll-margin-top:16px}.fusion-placeholder{min-height:150px;padding:30px;border-color:rgba(169,199,182,.4);background:radial-gradient(circle at 50% 10%,rgba(128,88,176,.13),rgba(10,39,36,.48))}.fusion-placeholder>span{display:grid;place-items:center;width:44px;height:44px;border:1px solid rgba(205,170,255,.32);border-radius:14px;background:#3b3157;font-size:22px}.fusion-placeholder strong{font-size:17px}.fusion-placeholder small{font-size:11px}
.fusion-result-head{padding:13px clamp(14px,2vw,22px);border:1px solid rgba(205,177,249,.24);border-bottom:0;background:linear-gradient(90deg,#41335f,#2c3e51)}.fusion-result-head span{display:flex;align-items:center;gap:7px}.fusion-result-head span:before{content:"";width:7px;height:7px;border-radius:50%;background:#cfabff;box-shadow:0 0 9px #b580ff}.fusion-result-head strong{font-size:clamp(11px,1.4vw,15px)}
.fusion-result{grid-template-columns:minmax(210px,270px) minmax(0,1fr);gap:clamp(18px,2.4vw,30px);padding:clamp(17px,2.4vw,28px);border-color:rgba(206,179,249,.28);background:linear-gradient(135deg,rgba(61,47,95,.94),rgba(25,62,60,.96) 60%,rgba(24,71,56,.94))}.fusion-hero{min-height:310px;border:1px solid rgba(213,192,255,.16);background:radial-gradient(circle at 50% 38%,rgba(203,168,255,.25),rgba(11,36,35,.58) 68%);box-shadow:inset 0 1px rgba(255,255,255,.05)}.fusion-title h2{font-size:clamp(27px,3vw,36px)}.monster-summary{max-width:700px;margin:-8px 0 16px;color:#bcd2c8;font-size:12px;line-height:1.5}
.base-orb{position:relative;display:grid;place-items:center;width:170px;height:170px;border:2px solid color-mix(in srgb,var(--element),#fff 20%);border-radius:48px;background:radial-gradient(circle,rgba(255,255,255,.13),color-mix(in srgb,var(--element),transparent 72%));box-shadow:0 0 35px color-mix(in srgb,var(--element),transparent 72%),inset 0 0 30px rgba(5,28,26,.4)}.base-orb:after{content:"";position:absolute;inset:10px;border:1px dashed rgba(255,255,255,.17);border-radius:39px}.base-orb img{position:relative;z-index:1;width:190px;height:190px;object-fit:contain;filter:drop-shadow(0 9px 6px rgba(4,22,21,.5))}.base-orb i{position:absolute;z-index:2;right:-8px;bottom:-7px;display:grid;place-items:center;width:43px;height:43px;border:2px solid var(--element);border-radius:14px;background:#122f2c;font-size:21px;font-style:normal}.base-preview .fusion-hero>small{margin-top:28px;color:#a9c5b6;font-size:8px;font-weight:900;letter-spacing:1.6px}
.fusion-stat-grid.base-stat-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.fusion-stat-grid>span{border-color:rgba(146,190,167,.24);background:rgba(9,36,35,.56)}.fusion-stat-grid>span:hover{border-color:rgba(255,223,111,.38);background:rgba(18,50,46,.72)}.base-stat-grid>span{grid-template-columns:26px 1fr;padding:11px 9px}.base-stat-grid i{font-size:19px}.base-stat-grid strong{font-size:20px}.base-stat-grid small{font-size:9px}.base-stat-grid em{font-size:8px}
.ability-list>div{border:1px solid rgba(177,211,189,.1);background:rgba(9,34,34,.55)}.ability-list>div>i{background:linear-gradient(145deg,#68518d,#40365d);box-shadow:inset 0 1px rgba(255,255,255,.08)}.base-tip{display:flex;align-items:center;gap:10px;margin-top:14px;padding:10px 12px;border:1px dashed rgba(255,221,101,.3);border-radius:13px;background:rgba(112,91,45,.16)}.base-tip>span{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:9px;background:#6d5a35;color:#ffe16d;font-size:18px}.base-tip p{margin:0;color:#b9ccc2;font-size:10px;line-height:1.35}.base-tip strong{display:block;color:#fff0a7;font-size:11px}.unlocked-heading{display:flex;align-items:center;gap:7px;margin-top:25px!important;color:#fff0aa!important}.unlocked-heading span{color:#caa8ff}.unlocked-recipes{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}.empty-collection{padding:18px;border-color:rgba(166,195,178,.35);background:rgba(10,36,34,.35);text-align:center}

@media(max-width:900px){
  .fusion-card{padding:26px 18px}.fusion-slot-row{grid-template-columns:160px minmax(0,1fr);gap:9px}.fusion-slot-label{gap:8px}.fusion-slot-label>b{flex-basis:34px;height:34px}.fusion-slot-options{gap:5px}.fusion-slot-row.optional .fusion-slot-options{grid-template-columns:repeat(7,minmax(58px,1fr))}.fusion-monster-choice{height:72px}.fusion-monster-choice img{width:47px;height:47px}.fusion-result{grid-template-columns:210px minmax(0,1fr)}.fusion-hero{min-height:260px}.base-orb{width:138px;height:138px;border-radius:39px}.base-orb img{width:158px;height:158px}.fusion-stat-grid.base-stat-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:700px){
  .fusion-modal{padding:0}.fusion-card{width:100%;max-height:100dvh;height:100dvh;padding:21px 12px 28px;border-width:0;border-radius:0}.fusion-card .close{position:fixed;right:9px;top:8px;width:38px;height:38px}.lab-heading{padding:0 36px;margin-bottom:14px}.lab-heading .eyebrow{font-size:7px;letter-spacing:1.5px}.lab-heading h2{font-size:29px}.lab-heading .fusion-copy{font-size:10px}.lab-wallet{margin-bottom:17px;padding:9px 10px;font-size:8px}.lab-wallet strong{font-size:12px}.lab-section-heading{margin-left:2px}.lab-section-heading small{font-size:8px}.element-picker{padding:8px}.fusion-slot-row{grid-template-columns:1fr;padding:8px}.fusion-slot-label{justify-content:flex-start}.fusion-slot-label>b{flex-basis:31px;height:31px;border-radius:9px;font-size:15px}.fusion-slot-label strong{font-size:11px}.fusion-slot-label small{font-size:8px}.fusion-slot-options,.fusion-slot-row.optional .fusion-slot-options{display:flex;justify-content:flex-start;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:3px}.fusion-monster-choice{flex:0 0 68px;height:68px;scroll-snap-align:start}.fusion-monster-choice img{width:43px;height:43px}.fusion-none span{width:31px;height:31px;margin-bottom:3px}.fusion-result-head{align-items:flex-start;gap:4px;padding:10px 12px}.fusion-result-head strong{font-size:10px}.fusion-result{grid-template-columns:1fr;gap:14px;padding:14px}.fusion-hero{min-height:185px;padding:13px}.base-orb{width:120px;height:120px;border-radius:34px}.base-orb img{width:140px;height:140px}.base-preview .fusion-hero>small{margin-top:20px}.monster-summary{margin:-8px 0 12px;font-size:10px}.fusion-stat-grid.base-stat-grid{grid-template-columns:repeat(2,1fr)}.ability-list{grid-template-columns:1fr}.unlocked-recipes{grid-template-columns:1fr}.fusion-placeholder{min-height:125px;padding:20px}.fusion-placeholder strong{font-size:14px}.fusion-placeholder small{font-size:9px}
}
@media(orientation:landscape) and (max-height:700px){
  .fusion-modal{padding:4px}.fusion-card{width:min(1120px,100%);height:auto;max-height:calc(100dvh - 8px);padding:15px 18px 22px;border-radius:18px}.lab-heading{margin-bottom:9px}.lab-heading .eyebrow{font-size:7px}.lab-heading h2{font-size:25px}.lab-heading .fusion-copy{font-size:9px!important}.lab-wallet{margin-bottom:10px;padding:7px 11px}.lab-section-heading{margin-bottom:6px}.lab-section-heading.result-heading{margin-top:12px}.element-picker{padding:7px}.fusion-slots{gap:5px}.fusion-slot-row{grid-template-columns:150px minmax(0,1fr);padding:5px 7px}.fusion-slot-label>b{flex-basis:30px;height:30px;font-size:14px}.fusion-slot-label strong{font-size:10px}.fusion-slot-label small{font-size:7px}.fusion-monster-choice{height:62px}.fusion-monster-choice img{width:41px;height:41px}.fusion-none span{width:29px;height:29px;margin-bottom:2px}.fusion-result{grid-template-columns:180px minmax(0,1fr);gap:14px;padding:12px}.fusion-hero{min-height:190px}.base-orb{width:115px;height:115px}.base-orb img{width:132px;height:132px}.fusion-title h2{font-size:25px}.monster-summary{font-size:9px}.fusion-stat-grid>span{padding:7px}.ability-list>div{padding:7px}.ability-list p{font-size:9px}.skills-title{margin:10px 0 6px!important}.base-tip{margin-top:8px;padding:6px 8px}
}

/* Onyx milestone loot and combination-specific hidden mastery */
.onyx-resource{color:#d9ffff!important;text-shadow:0 0 9px #5c9ba0!important}.diamond-resource{color:#8feaff!important;text-shadow:0 0 9px rgba(66,190,223,.55)!important}.campaign-resources .diamond-resource{border-color:rgba(129,226,255,.22);background:linear-gradient(145deg,rgba(20,54,62,.9),rgba(12,35,42,.95))}.campaign-resources .onyx-resource{border-color:rgba(170,232,231,.2);background:linear-gradient(145deg,rgba(21,54,55,.9),rgba(12,32,38,.95));color:#d9ffff}.stat.onyx{color:#d9ffff;text-shadow:0 0 8px #55949a}.stat.onyx i{color:#d9ffff;font-size:19px}.lab-wallet{display:grid;grid-template-columns:repeat(4,1fr)}.lab-wallet>span{justify-content:center}.lab-wallet>span:first-child{justify-content:flex-start}.lab-wallet>span:last-child{justify-content:flex-end}.lab-wallet .onyx-resource,.lab-wallet .diamond-resource{background:rgba(124,205,205,.08)}.stage-earnings{margin:12px 0;padding:11px;border:1px solid rgba(166,228,213,.22);border-radius:13px;background:rgba(8,38,36,.55)}.stage-earnings>small{display:block;margin-bottom:7px;color:#9fc6bb;font-size:8px;font-weight:900;letter-spacing:1.2px}.stage-earnings>span{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.stage-earnings b{padding:7px;border-radius:9px;background:rgba(26,67,59,.75);color:#eafff5;font-size:12px}.stage-earnings b:first-child{color:#91edff}.stage-earnings b:nth-child(2){color:#d5b9ff}.stage-earnings b:last-child{color:#d9ffff}
.hidden-mastery{margin-top:18px;padding:14px;border:1px solid rgba(170,230,229,.25);border-radius:17px;background:linear-gradient(145deg,rgba(10,37,40,.82),rgba(35,32,55,.86));box-shadow:inset 0 1px rgba(255,255,255,.04)}.hidden-mastery>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}.hidden-mastery>header>div{display:flex;align-items:center;gap:9px}.hidden-mastery>header span{display:grid;place-items:center;width:34px;height:34px;border:1px solid rgba(204,249,246,.28);border-radius:11px;background:#193c40;color:#d9ffff;font-size:18px;text-shadow:0 0 8px #8fd6d4}.hidden-mastery>header p{margin:0}.hidden-mastery>header strong,.hidden-mastery>header small{display:block}.hidden-mastery>header strong{color:#eaffff;font-size:13px}.hidden-mastery>header small{margin-top:2px;color:#8fb6b3;font-size:9px}.hidden-mastery>header>b{color:#c9eeee;font-size:9px;letter-spacing:.7px;white-space:nowrap}.hidden-skill-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.hidden-skill-card{position:relative;display:grid;grid-template-columns:38px minmax(0,1fr);gap:9px;padding:11px;border:1px solid rgba(151,189,188,.18);border-radius:14px;background:rgba(8,31,34,.62);overflow:hidden}.hidden-skill-card.mastered{border-color:rgba(167,239,218,.5);background:linear-gradient(145deg,rgba(24,67,60,.8),rgba(20,49,54,.82));box-shadow:inset 3px 0 #83d7b0}.hidden-skill-number{position:absolute;right:8px;top:7px;color:#658986;font-size:9px;font-weight:900}.hidden-skill-card>i{display:grid;place-items:center;width:38px;height:38px;border:1px solid rgba(200,244,240,.18);border-radius:12px;background:linear-gradient(145deg,#2c5958,#253547);color:#dcffff;font-size:20px;font-style:normal}.hidden-skill-card>div:nth-of-type(2){min-width:0}.hidden-skill-card small,.hidden-skill-card strong{display:block}.hidden-skill-card small{color:#8dc0bb;font-size:7px;font-weight:900;letter-spacing:1px}.hidden-skill-card strong{margin-top:2px;padding-right:14px;color:#fff2bc;font-size:11px}.hidden-skill-card p{min-height:39px;margin:4px 0 8px;color:#aac5c0;font-size:9px;line-height:1.4}.hidden-skill-card button{grid-column:1/3;width:100%;padding:8px;border:1px solid rgba(181,231,223,.25);border-radius:9px;background:linear-gradient(180deg,#346e65,#254f4c);color:#e7fffb;font-size:8px;font-weight:900;letter-spacing:.6px;cursor:pointer}.hidden-skill-card button:hover:not(:disabled){border-color:#d9ffff;filter:brightness(1.12)}.hidden-skill-card button:disabled{cursor:not-allowed;opacity:.48}.hidden-skill-card.mastered button{border-color:rgba(142,216,175,.2);background:rgba(25,69,58,.7);color:#9fe0b7;opacity:1}.hidden-mastery-note{margin:10px 2px 0;color:#8faeaa;font-size:8px;line-height:1.4}.collection-mastery{display:block;margin-top:4px;color:#bde9e6;font-size:7px;font-weight:900;letter-spacing:.5px}.collection-copy .collection-mastery{color:#bde9e6}
@media(max-width:900px){.campaign-resources span{min-width:46px}.hidden-skill-grid{grid-template-columns:1fr}.hidden-skill-card p{min-height:0}.topbar .onyx{padding-left:5px;padding-right:5px}}
@media(max-width:700px){.lab-wallet{grid-template-columns:repeat(4,1fr);gap:3px}.lab-wallet>span{display:grid;justify-items:center;gap:2px}.lab-wallet>span:last-child{justify-content:stretch}.lab-wallet strong{padding:4px}.hidden-mastery{padding:10px}.hidden-mastery>header{align-items:flex-start;flex-direction:column}.hidden-mastery>header>b{padding-left:43px}.hidden-skill-card{grid-template-columns:34px minmax(0,1fr);padding:9px}.campaign-resources .onyx-resource,.campaign-resources .diamond-resource{display:inline-flex}.campaign-resources span{min-width:38px!important;padding:5px!important}.stage-earnings{margin:8px 0;padding:8px}.stage-earnings b{padding:5px;font-size:9px}}

/* v39 — five clear chapters, ten stages each, no-scroll quest launcher */
.chapter-tabs{position:absolute;z-index:6;left:18px;right:18px;top:15px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.chapter-tab{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:6px;min-width:0;height:48px;padding:6px 9px;border:1px solid rgba(220,240,202,.2);border-radius:13px;background:linear-gradient(180deg,rgba(31,78,64,.96),rgba(16,55,49,.96));color:#d5e7d8;text-align:left;cursor:pointer;box-shadow:0 4px 10px rgba(5,31,26,.25)}.chapter-tab small{color:#ffd966;font-size:7px;font-weight:900;letter-spacing:1px}.chapter-tab strong{overflow:hidden;font-size:10px;white-space:nowrap;text-overflow:ellipsis}.chapter-tab span{padding:3px 5px;border-radius:7px;background:rgba(8,38,34,.58);color:#a9c6b6;font-size:7px}.chapter-tab.selected{border-color:#ffe16c;background:linear-gradient(180deg,#665b36,#3d593e);box-shadow:inset 0 -3px #e9ad3d,0 5px 14px rgba(5,31,26,.32)}.chapter-tab.locked{filter:saturate(.25);opacity:.45;cursor:not-allowed}
.world-map .node{display:grid;place-items:center;align-content:center;gap:1px;width:58px;height:58px}.world-map .node-number{font-size:18px;line-height:1}.world-map .node-status{min-height:8px;color:#ffe277;font-size:6px;font-weight:900;letter-spacing:.7px}.world-map .node.mystery .node-number{color:#c1d0c6}.world-map .node.mystery .node-status:after{content:'LOCKED';color:#9fb3a8}.world-map .node.boss .node-status{color:#ffe08a}.world-map .node.boss{width:68px;height:68px}
#campaign .stage-card{display:flex;flex-direction:column;justify-content:center;gap:clamp(12px,2.2vh,24px);height:100%;min-height:0;padding:clamp(18px,2.2vw,30px);overflow:hidden;text-align:center}#campaign .stage-card h2{margin:0;color:#fff2cb;font-size:clamp(25px,2.6vw,38px);line-height:1.05}#campaign .stage-card .difficulty-picker{display:grid;gap:clamp(7px,1.4vh,13px);margin:0}#campaign .stage-card .difficulty-picker button{display:block;min-height:clamp(44px,7vh,62px);padding:10px;border-radius:15px;text-align:center}#campaign .stage-card .difficulty-picker strong{font-size:clamp(12px,1.15vw,16px);text-transform:uppercase}#campaign .stage-card #playBtn{flex:0 0 auto;margin:0;padding:clamp(13px,1.6vh,18px);font-size:clamp(12px,1.1vw,16px);letter-spacing:.8px}#campaign .stage-card #playBtn:disabled{filter:grayscale(.8);opacity:.45;cursor:not-allowed}
@media(max-width:900px){.chapter-tabs{left:10px;right:10px;top:9px;gap:4px}.chapter-tab{grid-template-columns:1fr;height:38px;padding:4px 5px;text-align:center}.chapter-tab small{font-size:6px}.chapter-tab strong{font-size:8px}.chapter-tab span{display:none}.world-map .node{width:47px;height:47px}.world-map .node-number{font-size:14px}.world-map .node.boss{width:55px;height:55px}#campaign .stage-card{gap:10px;padding:12px}#campaign .stage-card h2{font-size:21px}#campaign .stage-card .difficulty-picker{gap:6px}#campaign .stage-card .difficulty-picker button{min-height:40px;padding:7px}#campaign .stage-card #playBtn{padding:11px}}
@media(max-width:700px){.chapter-tabs{left:6px;right:6px;top:6px}.chapter-tab{height:30px;border-radius:8px}.chapter-tab strong{display:none}.chapter-tab small{font-size:6px}.world-map .node{width:37px;height:37px}.world-map .node-number{font-size:11px}.world-map .node-status{font-size:4px}.world-map .node.boss{width:43px;height:43px}#campaign .stage-card{justify-content:space-between;gap:5px;padding:8px}#campaign .stage-card h2{font-size:16px}#campaign .stage-card .difficulty-picker{gap:4px}#campaign .stage-card .difficulty-picker button{min-height:31px;padding:5px;border-radius:9px}#campaign .stage-card .difficulty-picker strong{font-size:8px}#campaign .stage-card #playBtn{padding:9px 5px;font-size:8px}}
@media(orientation:landscape) and (max-height:700px){.hidden-mastery{margin-top:10px;padding:9px}.hidden-mastery>header{margin-bottom:7px}.hidden-skill-grid{grid-template-columns:1fr 1fr}.hidden-skill-card{padding:8px}.hidden-skill-card p{min-height:0;margin:2px 0 5px;font-size:8px}.hidden-skill-card button{padding:6px}.lab-wallet{grid-template-columns:repeat(4,1fr)}}

/* v40 — every cleared stage carries its exact one-to-three-star rating */
.world-map .node-rating{position:absolute;left:50%;bottom:-18px;display:block;min-width:43px;padding:3px 5px;border:1px solid rgba(255,226,105,.34);border-radius:999px;background:rgba(10,45,39,.96);color:#ffe168;font-size:10px;font-weight:900;line-height:1;letter-spacing:1px;white-space:nowrap;transform:translateX(-50%);box-shadow:0 3px 8px rgba(4,24,21,.4);text-shadow:0 1px #73521d}.world-map .node.cleared{margin-bottom:3px}
@media(max-width:900px){.world-map .node-rating{bottom:-15px;min-width:37px;padding:2px 4px;font-size:8px}}
@media(max-width:700px){.world-map .node-rating{bottom:-12px;min-width:31px;padding:2px 3px;font-size:6px;letter-spacing:.5px}}

/* v41 — brief keeper stats and a compact tap-again placement preview */
.placement-info{transition:opacity .16s ease,transform .16s ease}.placement-info.show{animation:keeperInfoIn .18s ease-out}@keyframes keeperInfoIn{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.battle-confirm{bottom:96px;grid-template-columns:42px minmax(120px,1fr) auto;gap:8px;width:min(440px,calc(100% - 24px));padding:7px 8px;border-radius:15px;pointer-events:none}.battle-confirm-icon{width:42px;height:42px;border-radius:12px}.battle-confirm-icon img{width:52px;height:52px}.battle-confirm-copy{gap:1px}.battle-confirm-copy small{font-size:6px;letter-spacing:1.1px}.battle-confirm-copy strong{font-size:12px}.battle-confirm-copy span{font-size:8px}.battle-confirm-actions{gap:5px;pointer-events:auto}.battle-confirm-actions button{min-width:62px;padding:8px 9px;font-size:8px}.battle-confirm-actions .primary{box-shadow:0 3px 0 #b97428}
#battleConfirm.placement-preview{left:clamp(74px,var(--placement-x),calc(100% - 74px));right:auto;top:clamp(74px,var(--placement-y),calc(100% - 78px));bottom:auto;display:none;grid-template-columns:1fr;width:auto;padding:5px;border-radius:12px;pointer-events:auto}#battleConfirm.placement-preview.show{display:grid}#battleConfirm.placement-preview.placement-above{transform:translate(-50%,calc(-100% - 50px))}#battleConfirm.placement-preview.placement-below{transform:translate(-50%,50px)}#battleConfirm.placement-preview .battle-confirm-icon,#battleConfirm.placement-preview .battle-confirm-copy{display:none}#battleConfirm.placement-preview .battle-confirm-actions{gap:5px}#battleConfirm.placement-preview .battle-confirm-actions button{min-width:66px;padding:8px 11px;font-size:8px}
@media(max-width:700px){.battle-confirm{left:auto;right:5px;bottom:68px;grid-template-columns:34px minmax(90px,1fr) auto;width:min(390px,calc(100% - 10px));gap:5px;padding:5px 6px;border-radius:12px;transform:translateY(9px)}.battle-confirm.show{transform:none}.battle-confirm-icon{width:34px;height:34px;border-radius:9px}.battle-confirm-icon img{width:43px;height:43px}.battle-confirm-copy strong{font-size:10px}.battle-confirm-copy span{font-size:7px}.battle-confirm-actions button{min-width:52px;padding:7px 6px;font-size:7px}.upgrade-panel.opposite-side{left:auto;right:5px}}
@media(orientation:landscape) and (max-height:700px){.battle-confirm{left:50%;right:auto;bottom:68px;width:min(410px,calc(100% - 176px));grid-template-columns:34px minmax(100px,1fr) auto;padding:5px 6px;transform:translate(-50%,8px)}.battle-confirm.show{transform:translate(-50%,0)}#battleConfirm.placement-preview{left:clamp(65px,var(--placement-x),calc(100% - 65px));right:auto;top:clamp(63px,var(--placement-y),calc(100% - 72px));bottom:auto;width:auto;padding:4px}#battleConfirm.placement-preview.placement-above{transform:translate(-50%,calc(-100% - 42px))}#battleConfirm.placement-preview.placement-below{transform:translate(-50%,42px)}#battleConfirm.placement-preview .battle-confirm-actions button{min-width:57px;padding:6px 8px;font-size:7px}.battle-confirm-icon{width:34px;height:34px}.battle-confirm-icon img{width:43px;height:43px}.battle-confirm-actions button{min-width:54px;padding:7px}}

/* v75 — escalating milestone bosses and unified in-game confirmations */
.action-modal{position:fixed;z-index:190;inset:0;display:none;place-items:center;padding:18px;background:rgba(4,18,17,.78);backdrop-filter:blur(9px)}.action-modal.show{display:grid}.action-card{position:relative;display:grid;grid-template-columns:76px minmax(0,1fr);gap:15px;width:min(520px,100%);padding:24px;border:1px solid rgba(255,224,112,.28);border-radius:24px;background:linear-gradient(145deg,rgba(25,68,59,.98),rgba(15,42,48,.98));box-shadow:0 22px 70px rgba(0,0,0,.52),inset 0 1px rgba(255,255,255,.09)}.action-card .close{position:absolute;right:10px;top:8px;width:36px;height:36px;border:0;background:transparent;color:#c7ddd1;font-size:26px;cursor:pointer}.action-modal-icon{display:grid;place-items:center;align-self:start;width:76px;height:76px;border:1px solid rgba(194,234,204,.18);border-radius:20px;background:linear-gradient(145deg,#3d725f,#234a48);color:#ffe16d;font-size:31px;box-shadow:inset 0 1px rgba(255,255,255,.1)}.action-modal-icon img{width:88px;height:88px;object-fit:contain;filter:drop-shadow(0 5px 4px rgba(3,17,15,.55))}.action-modal-copy{align-self:center;padding-right:22px}.action-modal-copy .eyebrow{margin:0;color:#ffe16d;font-size:8px;font-weight:900;letter-spacing:1.7px}.action-modal-copy h2{margin:5px 0;color:#fff5d8;font-size:24px;line-height:1.1}.action-modal-copy>p:last-child{margin:7px 0 0;color:#b9d1c3;font-size:11px;line-height:1.45}.action-modal-actions{grid-column:1/3;display:grid;grid-template-columns:1fr 1.3fr;gap:9px;margin-top:3px}.action-modal-actions button{min-height:45px}.action-modal-actions .confirm-danger{background:linear-gradient(#ff8b73,#d94b43);color:#fff;box-shadow:0 4px 0 #842d29}.boss-card .boss-portrait img{object-fit:contain;filter:drop-shadow(0 4px 4px rgba(5,18,16,.5))}.boss-locked .boss-portrait img{filter:grayscale(1) brightness(.18) drop-shadow(0 4px 4px rgba(5,18,16,.5))}
@media(max-width:560px){.action-modal{padding:10px}.action-card{grid-template-columns:58px minmax(0,1fr);gap:10px;padding:18px 14px;border-radius:19px}.action-modal-icon{width:58px;height:58px;border-radius:15px;font-size:25px}.action-modal-icon img{width:68px;height:68px}.action-modal-copy h2{font-size:19px}.action-modal-copy>p:last-child{font-size:9px}.action-modal-actions{grid-column:1/3}.action-modal-actions button{min-height:40px}}
@media(orientation:landscape) and (max-height:700px){.action-modal{padding:6px}.action-card{grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:9px;width:min(610px,calc(100% - 28px));padding:12px 14px;border-radius:16px}.action-card .close{right:3px;top:2px;width:28px;height:28px;font-size:21px}.action-modal-icon{width:52px;height:52px;border-radius:13px;font-size:23px}.action-modal-icon img{width:62px;height:62px}.action-modal-copy{padding-right:14px}.action-modal-copy h2{margin:2px 0;font-size:17px}.action-modal-copy>p:last-child{margin-top:3px;font-size:8px}.action-modal-actions{grid-column:auto;display:flex;gap:6px;margin:0;padding-right:15px}.action-modal-actions button{min-width:72px;min-height:36px;padding:8px;font-size:8px}}

/* Stage 1 quick guide */
.battle-tutorial{position:absolute;z-index:30;inset:0;display:none;pointer-events:none}.battle-tutorial.show{display:block}.tutorial-focus{position:absolute;border:3px solid #ffe16a;border-radius:16px;box-shadow:0 0 0 5px rgba(255,225,106,.18),0 0 22px rgba(255,197,55,.72);transition:left .22s ease,top .22s ease,width .22s ease,height .22s ease;animation:tutorialPulse 1.5s ease-in-out infinite}.tutorial-card{position:absolute;width:min(270px,calc(100% - 20px));padding:14px 15px;border-color:rgba(255,225,106,.52);border-radius:17px;color:#f4fbf5;box-shadow:0 14px 34px rgba(5,25,22,.48);pointer-events:auto;transition:left .22s ease,top .22s ease}.tutorial-card small{color:#ffd85a;font-size:7px;font-weight:900;letter-spacing:1.4px}.tutorial-card h3{margin:4px 0 4px;color:#fff6d1;font-size:16px}.tutorial-card p{margin:0;color:#c3d9cc;font-size:10px;line-height:1.45}.tutorial-actions{display:flex;align-items:center;justify-content:space-between;margin-top:10px}.tutorial-actions button{border:0;font:inherit;font-size:8px;font-weight:900;cursor:pointer}.tutorial-skip{padding:5px 0;background:transparent;color:#9db9aa}.tutorial-skip:hover{color:#fff}.tutorial-next{padding:7px 12px;border-radius:9px!important;background:#ffd75c;color:#503b1e}.tutorial-next[hidden]{display:none}@keyframes tutorialPulse{50%{box-shadow:0 0 0 9px rgba(255,225,106,.08),0 0 27px rgba(255,197,55,.8)}}
@media(max-width:700px){.tutorial-card{width:min(225px,calc(100% - 12px));padding:9px 10px;border-radius:13px}.tutorial-card h3{font-size:12px}.tutorial-card p{font-size:8px}.tutorial-actions{margin-top:6px}.tutorial-actions button{font-size:7px}.tutorial-next{padding:6px 9px}.tutorial-focus{border-width:2px;border-radius:12px}}
@media(prefers-reduced-motion:reduce){.tutorial-focus{animation:none;transition:none}.tutorial-card{transition:none}}

/* v50 — two player saves, clearer Continue actions, and an enemy glossary */
.home-actions{align-items:stretch;grid-template-columns:minmax(130px,.9fr) minmax(170px,1.1fr)}.home-actions>.primary{height:100%;min-height:58px}.continue-slots{display:grid;gap:8px}.continue-slots:empty{display:none}.continue-slot{position:relative;display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px;width:100%;min-height:58px;padding:9px 13px;border:1px solid #b8e8be;border-radius:15px;background:linear-gradient(180deg,#4f916a,#2d674f);color:#f5fff4;text-align:left;box-shadow:0 5px 0 #183f34,0 9px 18px rgba(8,31,26,.28);cursor:pointer;transition:transform .14s ease,filter .14s ease,box-shadow .14s ease}.continue-slot:hover{filter:brightness(1.1);transform:translateY(-1px)}.continue-slot:active{transform:translateY(3px);box-shadow:0 2px 0 #183f34}.continue-slot strong{font-size:12px}.continue-slot small{grid-column:1;color:#c4dfca;font-size:7px;font-weight:900;letter-spacing:.7px;text-transform:uppercase}.continue-slot>span{grid-column:2;grid-row:1/3;color:#ffe06a;font-size:18px;font-weight:900}.save-modal,.glossary-modal{position:fixed;z-index:90;inset:0;display:none;place-items:center;padding:16px;background:rgba(4,20,18,.78);backdrop-filter:blur(9px)}.save-modal.show,.glossary-modal.show{display:grid}.save-card,.glossary-card{position:relative;border-radius:25px;background:linear-gradient(145deg,#183e38,#172f3d)}.save-card{width:min(510px,100%);padding:28px;text-align:left}.save-card .close,.glossary-card .close{position:absolute;right:12px;top:9px;width:36px;height:36px;border:0;background:transparent;color:#bfd7ca;font-size:26px;cursor:pointer}.save-card>.eyebrow,.glossary-card>.eyebrow{margin:0;color:#ffe076;font-size:8px;font-weight:900;letter-spacing:1.7px}.save-card h2,.glossary-card h2{margin:5px 0 7px;color:#fff4d1;font-size:28px}.save-card>p:not(.eyebrow),.glossary-intro{margin:0 0 17px;color:#a9c4b7;font-size:10px;line-height:1.45}.save-slot-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.save-slot-option{display:grid;gap:4px;min-height:118px;padding:16px;border:1px solid #527b6c;border-radius:16px;background:linear-gradient(145deg,#28594e,#203f45);color:#eef9ef;text-align:left;box-shadow:0 5px 0 #122f2d;cursor:pointer}.save-slot-option:hover{border-color:#ffe06a;filter:brightness(1.08)}.save-slot-option>span{color:#ffe06a;font-size:9px;font-weight:900;letter-spacing:1.3px}.save-slot-option strong{font-size:18px}.save-slot-option small{color:#b4cfc1;font-size:9px;line-height:1.4}.save-slot-option em{margin-top:auto;color:#d9a9ff;font-size:8px;font-style:normal;font-weight:900}.glossary-open{display:grid;grid-template-columns:36px 1fr auto;align-items:center;gap:9px;width:100%;margin-top:10px;padding:10px 12px;border:1px solid rgba(255,224,106,.32);border-radius:13px;background:linear-gradient(145deg,rgba(74,92,52,.75),rgba(32,71,61,.82));color:#fff5c0;text-align:left;cursor:pointer}.glossary-open>span{display:grid;place-items:center;height:34px;border-radius:10px;background:#345f51;color:#ffe06a;font-size:20px}.glossary-open b,.glossary-open small{display:block}.glossary-open b{font-size:11px}.glossary-open small{margin-top:2px;color:#a9c3b6;font-size:8px}.glossary-open i{font-size:17px;font-style:normal}.glossary-card{width:min(1050px,100%);max-height:92vh;padding:26px;overflow:auto;text-align:left}.glossary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:10px}.enemy-card{display:grid;grid-template-columns:78px 1fr;gap:11px;padding:12px;border:1px solid rgba(177,215,191,.18);border-radius:16px;background:rgba(8,35,34,.58)}.enemy-card>img{grid-row:1/5;width:82px;height:92px;object-fit:contain;filter:drop-shadow(0 5px 3px rgba(4,18,17,.5))}.enemy-card header{display:flex;align-items:start;justify-content:space-between;gap:8px}.enemy-card h3{margin:0;color:#fff1b8;font-size:14px}.enemy-card header span{padding:3px 6px;border-radius:7px;background:#31584f;color:#bfe0ce;font-size:7px;font-weight:900;text-transform:uppercase}.enemy-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.enemy-stats span{padding:6px;border-radius:8px;background:#1e4540}.enemy-stats small,.enemy-stats b{display:block}.enemy-stats small{color:#82aa99;font-size:6px;letter-spacing:.7px}.enemy-stats b{margin-top:2px;color:#eef9ee;font-size:10px}.affinity-row{display:grid;grid-template-columns:52px 1fr;align-items:center;gap:5px}.affinity-row>small{color:#8fb1a3;font-size:7px;font-weight:900;text-transform:uppercase}.affinity-tags{display:flex;flex-wrap:wrap;gap:4px}.affinity-tags span{padding:3px 6px;border-radius:7px;font-size:8px;font-weight:900}.affinity-tags.weak span{background:rgba(255,215,76,.14);color:#ffe370}.affinity-tags.resist span{background:rgba(255,104,86,.12);color:#ffad9e}.enemy-role{margin:0;color:#a9c2b7;font-size:8px;line-height:1.35}
@media(max-width:700px){.home-actions{grid-template-columns:1fr}.home-actions>.primary{min-height:42px}.continue-slots{grid-template-columns:1fr 1fr}.continue-slot{min-height:44px;padding:7px 9px;border-radius:11px}.continue-slot strong{font-size:9px}.continue-slot small{font-size:6px}.save-modal,.glossary-modal{padding:5px}.save-card{padding:20px 14px}.save-slot-options{gap:7px}.save-slot-option{min-height:96px;padding:11px}.save-slot-option strong{font-size:14px}.glossary-card{width:100%;height:100dvh;max-height:none;padding:19px 10px;border:0;border-radius:0}.glossary-card h2{font-size:23px}.glossary-grid{grid-template-columns:1fr}.enemy-card{grid-template-columns:62px 1fr;padding:9px}.enemy-card>img{width:66px;height:75px}}

/* v43 — full-volume audio mixer and game identity */
.home-footer{display:flex;align-items:center;justify-content:space-between;width:min(310px,100%);margin:7px auto 0;color:#8fb5a6;font-size:9px}.home-footer small{letter-spacing:.5px}.home-footer b{color:#e8d38a}.home-settings{padding:4px 0;border:0;background:transparent;color:#cce6d5;font:inherit;font-weight:900;cursor:pointer}.home-settings:hover{color:#ffe16d}.settings-modal{position:fixed;z-index:80;inset:0;display:none;place-items:center;padding:18px;overflow:hidden;background:rgba(5,23,20,.7);backdrop-filter:blur(8px)}.settings-modal.show{display:grid}.settings-card{position:relative;width:min(410px,100%);max-height:calc(100dvh - 36px);padding:28px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#547b65 transparent;border-radius:25px;background:linear-gradient(145deg,#183e38,#162f3c);text-align:left}.settings-card .close{position:absolute;right:11px;top:9px;width:35px;height:35px;border:0;background:transparent;color:#bdd5c7;font-size:25px;cursor:pointer}.settings-card .eyebrow{margin:0;color:#ffe076;font-size:9px;letter-spacing:1.8px}.settings-card h2{margin:5px 0 18px;color:#fff4d2;font-size:29px}.audio-controls{display:grid;gap:14px}.audio-controls label{display:grid;gap:8px;padding:10px 11px;border:1px solid rgba(185,220,195,.15);border-radius:14px;background:rgba(8,35,33,.38)}.audio-controls label>span{display:flex;justify-content:space-between;align-items:center;color:#e7f3e8;font-size:12px}.audio-controls output{min-width:45px;padding:3px 6px;border-radius:8px;background:#365f50;color:#ffe171;font-size:10px;font-weight:900;text-align:center}.audio-controls input{width:100%;accent-color:#ffce54;cursor:pointer}.settings-reset{width:100%;margin-top:14px;padding:10px;font-weight:900}.settings-card footer{display:grid;gap:4px;margin-top:18px;padding-top:13px;border-top:1px solid rgba(184,215,197,.14);color:#dcecdf}.settings-card footer strong{font-size:11px}.settings-card footer strong span{color:#ffe076}.settings-card footer small{color:#83a79a;font-size:8px}.topbar #settingsBtn{font-size:19px}@media(max-width:700px){.settings-modal{padding:9px}.settings-card{width:min(370px,100%);max-height:calc(100dvh - 18px);padding:20px;border-radius:19px}.settings-card h2{font-size:24px;margin-bottom:13px}.audio-controls{gap:8px}.audio-controls label{gap:6px;padding:8px 9px}.home-footer{font-size:7px}}
@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){.settings-modal{padding:6px}.settings-card{width:min(520px,calc(100% - 12px));max-height:calc(100dvh - 12px);padding:14px 18px 16px;border-radius:18px}.settings-card .close{right:7px;top:4px;width:31px;height:31px;font-size:22px}.settings-card .eyebrow{font-size:7px;letter-spacing:1.4px}.settings-card h2{margin:2px 0 9px;font-size:22px}.audio-controls{gap:5px}.audio-controls label{gap:4px;padding:6px 8px;border-radius:10px}.audio-controls label>span{font-size:9px}.audio-controls output{min-width:40px;padding:2px 5px;font-size:8px}.audio-controls input{height:16px}.settings-reset{margin-top:7px;padding:7px;font-size:9px}.glossary-open{grid-template-columns:28px 1fr auto;gap:7px;margin-top:7px;padding:6px 8px;border-radius:10px}.glossary-open>span{height:28px;border-radius:8px;font-size:16px}.glossary-open b{font-size:9px}.glossary-open small{font-size:7px}.settings-card footer{margin-top:9px;padding-top:8px}.settings-card footer strong{font-size:9px}.settings-card footer small{font-size:7px}}

/* v52 — compact home utilities and dual glossary */
.home-utility-row{display:flex;align-items:center;justify-content:flex-end;gap:8px;width:min(310px,100%);margin:10px auto 0}.home-utility-row .mobile-landscape-chip{margin:0}.home-settings{min-height:40px;padding:9px 14px;border:1px solid #668a79;border-radius:10px;background:#234a42;color:#e7f3e9;font-size:12px;font-weight:900;cursor:pointer}.home-settings:hover{border-color:#ffe16d;color:#fff4b1;background:#2d5a50}.glossary-open{grid-template-columns:34px 1fr auto}.glossary-open b{font-size:12px}.glossary-tabs{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:10px 0 12px;padding:4px;border-radius:12px;background:#102f31}.glossary-tabs button{padding:9px;border:0;border-radius:9px;background:transparent;color:#9ebcaf;font-size:10px;font-weight:900;cursor:pointer}.glossary-tabs button.active{background:#365f50;color:#ffe274;box-shadow:0 2px 0 #183d35}.glossary-section[hidden]{display:none}.monster-card{border-color:rgba(255,220,100,.2);background:linear-gradient(145deg,rgba(30,72,61,.78),rgba(15,48,49,.78))}.monster-card>img{filter:drop-shadow(0 5px 3px rgba(4,18,17,.5)) drop-shadow(0 0 8px rgba(255,221,103,.1))}
.game-version-chip{display:inline-flex;align-items:center;min-height:40px;padding:8px 12px;border:1px solid rgba(148,184,165,.32);border-radius:10px;background:rgba(10,38,34,.54);color:#a9c8b8;font-size:10px;font-weight:900;letter-spacing:.7px;text-transform:uppercase}.hero-mastery{border-color:rgba(202,166,255,.3);background:linear-gradient(145deg,rgba(38,31,61,.88),rgba(25,52,51,.86))}.hero-mastery>header span{color:#d9b9ff}.inherited-passives{margin-top:16px;padding:12px;border:1px solid rgba(202,166,255,.22);border-radius:15px;background:rgba(36,29,54,.62)}.inherited-passives header strong,.inherited-passives header small{display:block}.inherited-passives header strong{color:#ead7ff;font-size:12px}.inherited-passives header small{margin-top:2px;color:#9faebb;font-size:8px}.inherited-passives>div{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:9px}.inherited-passives>div>span{display:grid;grid-template-columns:26px 1fr;gap:2px 7px;padding:7px;border-radius:10px;background:rgba(17,42,43,.72)}.inherited-passives i{grid-row:1/3;align-self:center;color:#ffe07a;font-style:normal;text-align:center}.inherited-passives b{color:#e9f5ed;font-size:9px}.inherited-passives small{color:#9db8af;font-size:8px}.hero-passive-list{display:grid;gap:5px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(176,211,191,.14)}.hero-passive-list>span{position:relative;display:block;padding:6px 54px 6px 8px;border-radius:8px;background:rgba(8,32,32,.46)}.hero-passive-list b,.hero-passive-list small{display:block}.hero-passive-list b{color:#f4e3ac;font-size:8px}.hero-passive-list small{margin-top:2px;color:#a6beb5;font-size:7px;line-height:1.3}.hero-passive-list em{position:absolute;right:7px;top:7px;color:#8ecbab;font-size:6px;font-style:normal;font-weight:900}.hero-passive-list .locked{opacity:.58}.hero-passive-list .locked em{color:#c8a9ec}
/* v55 — modal controls always stay above the mobile install prompt */
.settings-modal,.save-modal,.glossary-modal,.fusion-modal{z-index:150}

/* v91 — compact battle HUD, icon-only hero roster, and quick speed control */
#battle .battle-status{left:14px;top:14px;display:flex;width:auto;min-width:0;padding:0;gap:6px;transform:none;border:0;background:transparent;box-shadow:none;backdrop-filter:none}
#battle .battle-status .stat{min-width:72px;min-height:38px;justify-content:center;gap:6px;padding:6px 12px;border:1px solid rgba(255,255,255,.18);border-radius:9px;background:linear-gradient(180deg,rgba(18,27,27,.93),rgba(5,15,16,.9));box-shadow:0 4px 0 rgba(4,13,14,.5),0 7px 15px rgba(3,12,13,.28)}
#battle .battle-status .stat i{font-size:20px;line-height:1}#battle .battle-status .stat b{color:#fff;font-size:16px;line-height:1;text-shadow:0 2px 2px #000}
#battle .battle-status .heart i{color:#ff624f}#battle .battle-status .coin i{color:#ffd22f}#battle .battle-status .wave-stat i{color:#e6e4d8;font-size:18px}
.battle-quick-controls{position:absolute;z-index:6;right:14px;top:14px;display:flex;align-items:center;gap:8px}.battle-settings-button,.battle-speed-button{display:grid;place-items:center;width:48px;height:48px;padding:0;border:1px solid rgba(210,238,222,.35);border-radius:12px;line-height:1;box-shadow:0 4px 0 #102f2b,0 8px 18px rgba(2,16,18,.34),inset 0 1px rgba(255,255,255,.13);cursor:pointer;transition:transform .12s ease,filter .12s ease,box-shadow .12s ease}.battle-settings-button{background:linear-gradient(180deg,#376b5d,#1b433c);color:#fff0b0}.battle-settings-button svg{width:25px;height:25px;overflow:visible;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 2px 1px rgba(3,21,19,.55))}.battle-speed-button{grid-template-columns:auto auto;gap:2px;background:linear-gradient(180deg,#2f6758,#173a35);color:#fff5bd;font-family:inherit}.battle-speed-button span{font-size:22px;font-weight:900}.battle-speed-button b{font-size:14px;text-shadow:0 2px 2px #09201d}.battle-settings-button:hover,.battle-speed-button:hover{filter:brightness(1.1);transform:translateY(-1px)}.battle-settings-button:focus-visible,.battle-speed-button:focus-visible{outline:3px solid #ffe071;outline-offset:3px}.battle-settings-button:active,.battle-speed-button:active{transform:translateY(3px);box-shadow:0 1px 0 #102f2b,0 4px 10px rgba(2,16,18,.3),inset 0 1px rgba(255,255,255,.1)}

#battle .tower-dock{left:14px!important;right:auto!important;bottom:9px!important;display:flex;width:max-content!important;min-width:0!important;max-width:calc(100% - 190px)!important;gap:7px;padding:8px 0 10px;border:0;border-radius:0;transform:none;background:transparent;box-shadow:none;backdrop-filter:none;overflow-x:auto;overflow-y:visible}
#battle .tower-card{position:relative;flex:0 0 53px;width:53px;height:53px;padding:0;border:2px solid #d7d7c3;border-radius:50%;background:radial-gradient(circle at 50% 34%,#537f6c,#173c36 72%);box-shadow:0 4px 0 #102c28,0 7px 13px rgba(4,20,18,.45);overflow:visible}
#battle .tower-card:hover,#battle .tower-card.selected{border-color:#ffe067;background:radial-gradient(circle at 50% 34%,#66896b,#3b584a 72%);transform:translateY(-4px);box-shadow:0 4px 0 #745625,0 0 0 3px rgba(255,224,103,.22),0 8px 15px rgba(4,20,18,.45)}
#battle .tower-card.locked{filter:grayscale(.85);opacity:.55}
#battle .tower-card .tower-sprite{position:absolute;left:50%;top:50%;width:58px;height:58px;transform:translate(-50%,-56%);object-fit:contain;filter:drop-shadow(0 3px 2px rgba(7,24,22,.55))}
#battle .tower-card .tower-element{position:absolute;right:-3px;top:-4px;display:grid;place-items:center;min-width:17px;height:17px;padding:0 2px;border:1px solid #a7c3b3;border-radius:9px;background:#173a34;color:#fff2a8;font-size:8px;font-weight:900;line-height:1}
#battle .tower-card em{position:absolute;left:50%;right:auto;bottom:-7px;width:auto;min-width:37px;margin:0;padding:2px 4px;transform:translateX(-50%);border:1px solid rgba(255,226,93,.6);border-radius:8px;background:rgba(13,28,27,.95);color:#ffdb4f;font-size:8px;font-style:normal;font-weight:900;line-height:1.2;text-align:center;white-space:nowrap}
#battle .tower-card.special{border-color:#b997e8;background:radial-gradient(circle at 50% 34%,#675b8f,#273e46 72%)}#battle .tower-card.special .tower-sprite{filter:drop-shadow(0 0 5px #9f79e7)}

#battle .wave-panel{right:14px!important;bottom:14px!important;width:150px!important}#battle .wave-panel .primary{min-height:46px;padding:10px 8px;border-radius:12px;font-size:11px}
.battle-settings-controls{display:none;margin:16px 0 0;padding:14px;border:1px solid rgba(255,221,113,.23);border-radius:17px;background:rgba(7,29,29,.5)}body[data-screen="battle"] .battle-settings-controls{display:block}.battle-settings-controls>header{display:flex;align-items:center;gap:10px;margin-bottom:11px}.battle-settings-controls>header>span{display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:12px;background:#655432;color:#ffe16d;font-size:19px;font-weight:900}.battle-settings-controls header b,.battle-settings-controls header small{display:block}.battle-settings-controls header b{color:#fff2be;font-size:13px}.battle-settings-controls header small{margin-top:2px;color:#9db8ad;font-size:9px}.battle-settings-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.battle-settings-grid button{display:grid;grid-template-columns:30px 1fr;grid-template-rows:auto auto;align-items:center;gap:1px 7px;min-height:61px;padding:8px;border:1px solid rgba(190,221,203,.18);border-radius:12px;background:#23483f;color:#fff;text-align:left;cursor:pointer}.battle-settings-grid button:hover{border-color:#ffe079;background:#315c4f}.battle-settings-grid button>span{grid-row:1/3;display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#173b35;color:#ffe06c;font-size:17px;font-weight:900}.battle-settings-grid button small{color:#91afa3;font-size:8px}.battle-settings-grid button b{font-size:10px}.battle-settings-grid .battle-exit-control{border-color:rgba(229,124,103,.27)}.battle-settings-grid .battle-exit-control>span{color:#ffc2b5}.settings-resume{margin-top:9px;padding:11px;font-size:11px}

@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){
  #battle .battle-status{left:7px;top:7px;gap:4px}#battle .battle-status .stat{min-width:55px;min-height:30px;padding:4px 7px;border-radius:7px}#battle .battle-status .stat i{font-size:14px}#battle .battle-status .stat b{font-size:11px}
  .battle-quick-controls{right:7px;top:7px;gap:5px}.battle-settings-button,.battle-speed-button{width:38px;height:38px;border-radius:9px;box-shadow:0 3px 0 #102f2b,0 6px 12px rgba(2,16,18,.3)}.battle-settings-button svg{width:20px;height:20px}.battle-speed-button span{font-size:18px}.battle-speed-button b{font-size:10px}
  #battle .tower-dock{left:7px!important;bottom:7px!important;max-width:calc(100% - 170px)!important;gap:5px;padding:7px 0 8px}
  #battle .tower-card{flex-basis:40px;width:40px;height:40px;border-width:2px}#battle .tower-card .tower-sprite{width:43px;height:43px}#battle .tower-card .tower-element{right:-2px;top:-3px;min-width:14px;height:14px;border-width:1px;font-size:6px}#battle .tower-card em{bottom:-6px;min-width:31px;padding:1px 3px;font-size:6px}
  #battle .wave-panel{right:7px!important;bottom:7px!important;width:132px!important}#battle .wave-panel .primary{min-height:38px;padding:8px 6px;font-size:9px}
  .battle-confirm{bottom:76px}.placement-info,.upgrade-panel{bottom:67px}
  .battle-settings-controls{margin-top:8px;padding:9px}.battle-settings-controls>header{margin-bottom:7px}.battle-settings-controls>header>span{flex-basis:31px;height:31px}.battle-settings-grid button{min-height:49px;padding:6px}.settings-resume{margin-top:6px;padding:8px}
}
@media(pointer:coarse){.home-utility-row{justify-content:space-between}.home-settings{min-height:38px;padding:8px 13px;font-size:11px}}

/* v93 — keep the selected-hero brief out of the playable field. */
#battle .placement-info{left:14px;bottom:84px;width:min(342px,calc(100% - 196px));padding:10px 12px;pointer-events:none}
#battle .placement-info .placement-head{gap:8px}
#battle .placement-info .placement-head>span{width:44px;height:44px}
#battle .placement-info .placement-head h3{font-size:15px}
#battle .placement-info>p,#battle .placement-info .placement-tip{display:none}
#battle .placement-info .stat-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin-top:8px}
#battle .placement-info .stat-grid>span{min-width:0;padding:5px 6px}
#battle .placement-info .stat-grid small{overflow:hidden;font-size:6px;letter-spacing:.35px;text-overflow:ellipsis;white-space:nowrap}
#battle .placement-info .stat-grid b{font-size:12px}

/* Price stays readable even when the hero roster switches to icon-only cards. */
#battle .tower-dock{padding-bottom:14px}
#battle .tower-card em{bottom:-11px;min-width:45px;padding:3px 6px;font-size:11px;letter-spacing:.15px;text-shadow:0 1px 1px #000}

@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){
  #battle .placement-info{left:7px;bottom:62px;width:min(250px,calc(100% - 160px));padding:7px 8px}
  #battle .placement-info .placement-head>span{width:34px;height:34px}
  #battle .placement-info .placement-head h3{font-size:11px}
  #battle .placement-info .stat-grid{margin-top:5px}
  #battle .placement-info .stat-grid>span{padding:3px 4px}
  #battle .placement-info .stat-grid small{font-size:5px}
  #battle .placement-info .stat-grid b{font-size:9px}
  #battle .tower-dock{padding-bottom:11px}
  #battle .tower-card em{bottom:-9px;min-width:38px;padding:2px 4px;font-size:8px}
}

/* v92 — on-map speed control and final-boss death cinematic */
.battle-speed-button{display:grid;grid-template-columns:1fr;width:48px;color:#fff5bd}.battle-speed-button b{font-size:16px;letter-spacing:.2px}
.final-boss-cinematic{position:absolute;z-index:18;inset:0;display:none;place-items:center;overflow:hidden;background:radial-gradient(circle at center,rgba(65,31,84,.2),rgba(2,8,15,.78));pointer-events:auto}.final-boss-cinematic.show{display:grid}.final-boss-last-words{position:relative;z-index:3;display:grid;grid-template-columns:150px minmax(0,1fr);align-items:center;gap:20px;width:min(650px,calc(100% - 32px));padding:24px 28px;border:1px solid rgba(239,206,255,.38);border-radius:26px;background:linear-gradient(145deg,rgba(37,24,58,.97),rgba(10,36,42,.98));box-shadow:0 28px 90px rgba(0,0,0,.7),inset 0 1px rgba(255,255,255,.1);animation:finalWordsIn .35s ease-out}.final-boss-last-words img{width:150px;height:150px;object-fit:contain;filter:drop-shadow(0 0 22px rgba(174,96,255,.6))}.final-boss-last-words .eyebrow{margin:0;color:#d9a9ff;font-size:9px}.final-boss-last-words h2{margin:5px 0 10px;color:#fff1bd;font-size:29px}.final-boss-last-words blockquote{margin:0 0 16px;color:#e3ddec;font-size:14px;font-weight:700;font-style:italic;line-height:1.55}.final-boss-last-words .primary{width:auto;min-width:210px}.final-boss-cinematic.exploding .final-boss-last-words{display:none}.final-boss-flash{position:absolute;z-index:2;inset:0;pointer-events:none}.final-boss-cinematic.exploding .final-boss-flash{animation:finalBossFlash 1.65s steps(1,end)}.final-boss-fireworks{position:absolute;z-index:1;inset:0;pointer-events:none}.final-boss-fireworks i{position:absolute;left:var(--boss-x);top:var(--boss-y);width:14px;height:5px;border-radius:999px;background:var(--spark);box-shadow:0 0 11px var(--spark),0 0 24px var(--spark);opacity:0;transform-origin:left center;animation:finalBossSpark 1.25s cubic-bezier(.12,.62,.24,1) var(--delay) forwards}.final-boss-fireworks:before,.final-boss-fireworks:after{content:"";position:absolute;left:var(--boss-x);top:var(--boss-y);width:20px;height:20px;border:7px solid #fff3a3;border-radius:50%;transform:translate(-50%,-50%) scale(.1);opacity:0;box-shadow:0 0 28px #ffbd4a,0 0 70px #c65aff;animation:finalBossRing 1.25s ease-out forwards}.final-boss-fireworks:after{border-color:#8df5ff;animation-delay:.28s}
@keyframes finalWordsIn{from{opacity:0;transform:scale(.9) translateY(16px)}to{opacity:1;transform:none}}@keyframes finalBossSpark{0%{opacity:0;transform:rotate(var(--angle)) translateX(0) scale(.4)}10%{opacity:1}72%{opacity:1}100%{opacity:0;transform:rotate(var(--angle)) translateX(var(--distance)) scale(.1)}}@keyframes finalBossRing{0%{opacity:1;transform:translate(-50%,-50%) scale(.1)}70%{opacity:.8}100%{opacity:0;transform:translate(-50%,-50%) scale(13)}}@keyframes finalBossFlash{0%,18%,39%,62%,100%{background:transparent}8%{background:rgba(255,249,210,.92)}27%{background:rgba(225,238,255,.78)}49%{background:rgba(255,201,123,.7)}72%{background:rgba(255,255,255,.48)}}
@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){.battle-speed-button{width:38px}.battle-speed-button b{font-size:12px}.final-boss-last-words{grid-template-columns:96px minmax(0,1fr);gap:13px;width:min(570px,calc(100% - 20px));padding:13px 17px;border-radius:18px}.final-boss-last-words img{width:96px;height:96px}.final-boss-last-words .eyebrow{font-size:7px}.final-boss-last-words h2{margin:2px 0 5px;font-size:20px}.final-boss-last-words blockquote{margin-bottom:8px;font-size:10px;line-height:1.4}.final-boss-last-words .primary{min-width:165px;padding:10px;font-size:9px}}
@media(max-width:700px){.home-utility-row{width:100%}.glossary-tabs{position:sticky;top:-19px;z-index:3;background:#17343b}.glossary-tabs button{font-size:9px}.inherited-passives>div{grid-template-columns:1fr}.game-version-chip{min-height:38px;font-size:9px}}
@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){.home-utility-row{margin-top:8px}.home-settings{min-height:36px;padding:7px 12px;font-size:10px}.glossary-card{padding-top:15px}.glossary-card h2{margin-bottom:5px}.glossary-tabs{margin:5px 0 8px}}

/* Distinct realm scenes and a progression-aware boss archive */
.home-actions{margin-top:18px}.home-utility-row{margin-top:8px}.glossary-tabs{grid-template-columns:repeat(3,1fr)}
.boss-glossary-grid{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}.boss-card{grid-template-columns:92px minmax(0,1fr);border-color:rgba(255,210,95,.26);background:linear-gradient(145deg,rgba(47,42,54,.9),rgba(15,48,48,.88));box-shadow:inset 0 1px rgba(255,242,190,.05)}.boss-portrait{position:relative;grid-row:1/9;display:grid;place-items:center;align-self:start;width:88px;height:112px;border:1px solid rgba(231,207,138,.22);border-radius:15px;background:radial-gradient(circle at 50% 34%,rgba(255,224,139,.16),rgba(11,29,31,.62) 68%);overflow:hidden}.boss-portrait img{width:94px;height:104px;object-fit:contain;filter:drop-shadow(0 7px 5px rgba(4,14,18,.65))}.boss-portrait span{position:absolute;right:6px;bottom:6px;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#4d745d;color:#ffe477;font-size:10px;font-weight:900}.boss-title{margin:-5px 0 1px;color:#cdbf9a;font-size:8px;font-weight:900;letter-spacing:.65px;text-transform:uppercase}.boss-defense{display:grid;grid-template-columns:1fr 1fr;gap:5px}.boss-defense span{padding:6px;border-radius:8px;background:rgba(22,59,56,.76)}.boss-defense small,.boss-defense b{display:block}.boss-defense small{color:#82aa99;font-size:6px;letter-spacing:.7px}.boss-defense b{margin-top:2px;color:#eef9ee;font-size:9px}.boss-locked{border-color:rgba(153,166,168,.14);background:linear-gradient(145deg,rgba(38,45,48,.88),rgba(21,35,39,.9));color:#7f9190}.boss-locked .boss-portrait{border-color:rgba(154,168,170,.12);background:radial-gradient(circle,rgba(104,118,120,.12),rgba(8,18,22,.7))}.boss-locked .boss-portrait img{filter:grayscale(1) brightness(0) opacity(.62)}.boss-locked .boss-portrait span{background:#3e484b;color:#899698}.boss-locked h3,.boss-locked .enemy-role,.boss-locked .affinity-row>small{color:#7e8d8d}.boss-locked .enemy-stats span{background:rgba(55,67,69,.42)}.boss-locked .enemy-stats small,.boss-locked .enemy-stats b{color:#748384}.boss-unavailable{color:#687777;font-size:8px;font-weight:900;letter-spacing:.35px}
@media(max-width:700px){.boss-glossary-grid{grid-template-columns:1fr}.boss-card{grid-template-columns:72px minmax(0,1fr)}.boss-portrait{width:68px;height:90px}.boss-portrait img{width:75px;height:84px}.glossary-tabs button{padding-inline:5px;font-size:8px}}

/* v111 — restrained production palette, scalable atmosphere, and boss skills */
:root{--ink:#162a29;--cream:#f4efe2;--gold:#d7bd78;--lime:#91aa78;--coral:#b96c5d;--panel:rgba(15,31,31,.94)}
.game-frame{background:#283b37;box-shadow:0 0 0 1px rgba(220,207,165,.12),0 24px 85px rgba(0,0,0,.62)}
.game-frame::before,.game-frame::after{content:"";position:absolute;inset:0;z-index:3;pointer-events:none}
.game-frame::before{background:radial-gradient(ellipse at center,transparent 54%,rgba(6,12,13,.16) 78%,rgba(3,8,9,.4) 100%);mix-blend-mode:multiply}
.game-frame::after{opacity:.12;background-image:linear-gradient(115deg,rgba(255,255,255,.035),transparent 32%,rgba(0,0,0,.05) 72%);box-shadow:inset 0 0 80px rgba(2,9,10,.3)}
html[data-graphics-mode="medium"] .game-frame::after{opacity:.06}
html[data-graphics-mode="low"] .game-frame::before,html[data-graphics-mode="low"] .game-frame::after{display:none}
#stageBackdrop{filter:saturate(.78) contrast(1.08) brightness(.91)}
html[data-graphics-mode="medium"] #stageBackdrop{filter:saturate(.7) contrast(1.06) brightness(.92)}
html[data-graphics-mode="low"] #stageBackdrop{filter:saturate(.62) contrast(1.04) brightness(.94)}
#battle .battle-status .stat{border-color:rgba(222,211,178,.2);background:linear-gradient(180deg,rgba(27,33,33,.95),rgba(8,15,16,.94));box-shadow:0 4px 0 rgba(3,9,10,.62),0 10px 22px rgba(1,8,9,.32),inset 0 1px rgba(255,255,255,.06)}
.battle-settings-button,.battle-speed-button{border-color:rgba(211,201,169,.3);background:linear-gradient(180deg,#3b514c,#1c302e);color:#e5d4a1}
#battle .tower-card{border-color:#a8aaa0;background:radial-gradient(circle at 50% 34%,#52655d,#1b302e 72%);box-shadow:0 4px 0 #0c1d1b,0 8px 18px rgba(2,11,11,.52)}
#battle .tower-card:hover,#battle .tower-card.selected{border-color:#d7c17f;background:radial-gradient(circle at 50% 34%,#667167,#34453f 72%);box-shadow:0 4px 0 #665634,0 0 0 3px rgba(215,193,127,.16),0 10px 22px rgba(2,11,11,.48)}
.enemy-card>img,.home-enemy{filter:saturate(.42) contrast(1.1) brightness(.96) drop-shadow(0 5px 3px rgba(4,18,17,.55))}
.monster-card>img{filter:saturate(.4) contrast(1.1) brightness(.96) drop-shadow(0 5px 3px rgba(4,18,17,.55))}
.boss-card .boss-portrait img{filter:saturate(.82) contrast(1.08) drop-shadow(0 7px 5px rgba(4,14,18,.68))}
.affinity-tags.weak span{background:rgba(213,193,130,.12);color:#dfcd98}.affinity-tags.resist span{background:rgba(157,126,113,.13);color:#c6aca2}

.boss-skill-panel{position:absolute;z-index:7;left:50%;top:15px;display:grid;grid-template-columns:40px minmax(150px,1fr);grid-template-rows:auto 3px;align-items:center;gap:6px 10px;width:min(340px,calc(100% - 430px));padding:8px 11px 7px;transform:translate(-50%,-18px);border:1px solid rgba(211,194,142,.28);border-radius:13px;background:linear-gradient(180deg,rgba(24,29,31,.96),rgba(8,16,18,.94));box-shadow:0 5px 0 rgba(4,10,11,.5),0 12px 28px rgba(0,0,0,.38),inset 0 1px rgba(255,255,255,.06);opacity:0;pointer-events:none;transition:opacity .25s ease,transform .25s ease}
.boss-skill-panel.show{opacity:1;transform:translate(-50%,0)}
.boss-skill-sigil{grid-row:1/3;display:grid;place-items:center;width:40px;height:40px;border:1px solid rgba(219,202,149,.25);border-radius:10px;background:#293735;color:#d9c48a;font:22px Georgia,serif;box-shadow:inset 0 0 16px rgba(215,190,120,.07)}
.boss-skill-copy{display:grid;grid-template-columns:1fr auto;gap:1px 8px;min-width:0}.boss-skill-copy small{grid-column:1/3;overflow:hidden;color:#9eaa9f;font-size:6px;font-weight:900;letter-spacing:1.2px;text-overflow:ellipsis;white-space:nowrap}.boss-skill-copy strong{overflow:hidden;color:#eee4c7;font:700 12px Georgia,serif;text-overflow:ellipsis;white-space:nowrap}.boss-skill-copy span{align-self:center;color:#aebbb1;font-size:7px;font-weight:900;letter-spacing:.4px;white-space:nowrap}.boss-skill-meter{grid-column:2;height:3px;border-radius:3px;background:#172321;overflow:hidden}.boss-skill-meter i{display:block;width:100%;height:100%;transform:scaleX(0);transform-origin:left;background:#b7aa80;transition:transform .18s linear}.boss-skill-panel.casting{border-color:rgba(210,176,116,.55);animation:bossSkillWarning .7s ease-in-out infinite alternate}.boss-skill-panel.casting .boss-skill-meter i{background:#d18c66}.boss-skill-panel.active{border-color:rgba(217,204,158,.55)}.boss-skill-panel.active .boss-skill-sigil{color:#f0dda1;box-shadow:inset 0 0 20px rgba(218,194,124,.18),0 0 16px rgba(203,177,105,.12)}
@keyframes bossSkillWarning{to{box-shadow:0 5px 0 rgba(4,10,11,.5),0 0 22px rgba(191,119,72,.22),inset 0 1px rgba(255,255,255,.06)}}
.boss-signature{display:grid;grid-template-columns:34px 1fr;gap:8px;padding:8px;border:1px solid rgba(205,185,128,.2);border-radius:10px;background:rgba(26,39,38,.74)}.boss-signature>i{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#303b38;color:#d8c184;font:20px Georgia,serif}.boss-signature span{display:grid;gap:1px}.boss-signature small{color:#978f78;font-size:6px;font-weight:900;letter-spacing:.9px}.boss-signature b{color:#e5dcc1;font-size:10px}.boss-signature em{color:#9fac9f;font-size:7px;font-style:normal;line-height:1.3}
html[data-graphics-mode="low"] .glass{backdrop-filter:none}
@media (orientation:landscape) and (max-height:700px),(pointer:coarse) and (orientation:landscape){.boss-skill-panel{top:7px;width:min(285px,calc(100% - 350px));grid-template-columns:31px minmax(120px,1fr);gap:4px 7px;padding:5px 8px}.boss-skill-sigil{width:31px;height:31px;border-radius:8px;font-size:16px}.boss-skill-copy strong{font-size:9px}.boss-skill-copy small{font-size:5px}.boss-skill-copy span{font-size:6px}}
@media(max-width:760px) and (orientation:portrait){.boss-skill-panel{top:64px;width:min(330px,calc(100% - 24px))}}
@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){.home-actions{margin-top:10px}.home-utility-row{margin-top:5px}}
.graphics-settings{display:grid;gap:9px;margin-top:13px;padding:11px;border:1px solid rgba(185,220,195,.15);border-radius:14px;background:rgba(8,35,33,.38)}.graphics-settings>div:first-child{display:grid;gap:2px}.graphics-settings b{color:#e7f3e8;font-size:12px}.graphics-settings small{color:#8fb5a6;font-size:8px;line-height:1.35}.graphics-mode-control{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:4px;border-radius:11px;background:#0c2b2d}.graphics-mode-control button{min-height:34px;border:1px solid transparent;border-radius:8px;background:transparent;color:#9db9ae;font-size:10px;font-weight:900;cursor:pointer}.graphics-mode-control button:hover{color:#fff1ad}.graphics-mode-control button.active{border-color:#7ea58c;background:linear-gradient(180deg,#416f5b,#2d574d);color:#ffe274;box-shadow:0 2px 0 #132f2b,0 0 12px rgba(255,218,93,.1)}
@media (orientation:landscape) and (max-height:700px), (pointer:coarse) and (orientation:landscape){.graphics-settings{grid-template-columns:minmax(108px,1fr) minmax(210px,1.35fr);align-items:center;gap:8px;margin-top:7px;padding:7px 8px;border-radius:10px}.graphics-settings b{font-size:9px}.graphics-settings small{font-size:6px}.graphics-mode-control{gap:3px;padding:3px}.graphics-mode-control button{min-height:27px;font-size:8px}}

/* Finale storybook: one bounded card keeps every page and action in the viewport. */
#ending{overflow:auto;padding:clamp(8px,2vw,24px);background:#071c26}#ending:after{background:radial-gradient(circle at 50% 20%,rgba(95,120,221,.24),transparent 42%),linear-gradient(rgba(5,19,31,.2),rgba(4,17,27,.88))}#ending.active{display:grid;place-items:center}.ending-story-shell{position:relative;z-index:2;display:grid;grid-template-columns:minmax(0,1.35fr) minmax(310px,.75fr);width:min(1080px,100%);height:min(760px,calc(100dvh - clamp(16px,4vw,48px)));min-height:0;border:1px solid rgba(255,236,166,.35);border-radius:clamp(20px,3vw,34px);overflow:hidden;background:#123c3d;box-shadow:0 30px 80px rgba(0,0,0,.56)}.ending-art-frame{position:relative;min-height:0;overflow:hidden;background:#102c3b}.ending-art-frame:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 45%,rgba(8,35,39,.68)),linear-gradient(0deg,rgba(5,27,33,.34),transparent 40%);pointer-events:none}.ending-art-frame img{width:100%;height:100%;object-fit:cover;object-position:center;animation:endingArtIn .65s ease both}.ending-story-shell .ending-card{display:flex;min-height:0;width:auto;margin:0;padding:clamp(18px,3vw,34px);border:0;border-radius:0;background:linear-gradient(160deg,rgba(23,68,62,.98),rgba(12,37,43,.99));box-shadow:none;text-align:left;flex-direction:column;justify-content:center}.ending-story-shell .ending-card .eyebrow{margin:0 0 8px;color:#ffe39a;font-size:clamp(9px,1.1vw,12px);letter-spacing:2.2px}.ending-story-shell .ending-card h2{margin:0;color:#fff1ae;font-size:clamp(34px,4.4vw,59px);line-height:.93;text-shadow:0 4px 0 rgba(63,47,26,.55)}.ending-story-shell .ending-card p:not(.eyebrow){margin:16px 0;color:#d7eadf;font-size:clamp(13px,1.5vw,17px);line-height:1.55}.ending-story-shell .ending-loot{margin:0 0 16px;padding:10px 12px;border:1px solid rgba(216,180,255,.35);font-size:clamp(10px,1.1vw,13px);line-height:1.4}.ending-progress{display:flex;gap:7px;margin:0 0 18px}.ending-progress i{width:24px;height:5px;border-radius:999px;background:rgba(209,237,217,.22);transition:.25s}.ending-progress i.active{background:#ffe069;box-shadow:0 0 12px rgba(255,224,105,.75)}.ending-story-shell .primary{margin-top:0}.ending-story-shell .ghost{width:100%;margin-top:12px}.ending-story-shell [hidden]{display:none!important}@keyframes endingArtIn{from{opacity:.2;transform:scale(1.06)}to{opacity:1;transform:scale(1)}}
@media(max-width:760px){#ending{padding:8px}.ending-story-shell{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;width:min(620px,100%);height:calc(100dvh - 16px);max-height:760px;border-radius:20px}.ending-art-frame{min-height:0}.ending-art-frame:after{background:linear-gradient(0deg,rgba(8,35,39,.62),transparent 48%)}.ending-story-shell .ending-card{padding:16px 18px 17px;text-align:center}.ending-story-shell .ending-card .eyebrow{margin-bottom:6px;font-size:8px}.ending-story-shell .ending-card h2{font-size:clamp(29px,9vw,42px)}.ending-story-shell .ending-card p:not(.eyebrow){margin:9px 0 12px;font-size:12px;line-height:1.4}.ending-progress{justify-content:center;margin-bottom:12px}.ending-progress i{width:20px;height:4px}.ending-story-shell .ending-loot{margin-bottom:11px;padding:8px;font-size:9px}.ending-story-shell .primary{padding:12px}.ending-story-shell .ghost{margin-top:9px;padding:8px}}
@media(max-height:580px) and (orientation:landscape){#ending{padding:6px}.ending-story-shell{height:calc(100dvh - 12px);grid-template-columns:1.45fr minmax(270px,.55fr)}.ending-story-shell .ending-card{padding:13px 17px}.ending-story-shell .ending-card h2{font-size:clamp(28px,4.2vw,40px)}.ending-story-shell .ending-card p:not(.eyebrow){margin:7px 0;font-size:11px}.ending-progress{margin-bottom:8px}.ending-story-shell .primary{padding:10px}.ending-story-shell .ghost{margin-top:7px;padding:7px}}

/* Keep battle upgrades quick; the complete mechanics stay in Evolution Lab. */
#battle .upgrade-panel{width:260px}
#battle .upgrade-panel.show{grid-template-columns:48px minmax(0,1fr);gap:7px}
#battle .upgrade-hero{height:48px;border-radius:13px}
#battle .upgrade-progress{grid-column:1/3;display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:10px;background:#244c43}
#battle .upgrade-progress small{margin-right:auto;color:#91b4a4;font-size:7px}
#battle .upgrade-progress .upgrade-stars{font-size:10px!important}
#battle .upgrade-progress>span{color:#b9d2c4;font-size:8px;font-weight:900}
#battle .upgrade-choice{padding:7px 8px}
#battle .upgrade-lab-note{grid-column:1/3;margin:0;padding:2px 4px;color:#89aa9c;font-size:7px;line-height:1.35;text-align:center}
@media (orientation:landscape) and (max-height:700px),(pointer:coarse) and (orientation:landscape){#battle .upgrade-panel{width:205px}#battle .upgrade-panel.show{grid-template-columns:38px minmax(0,1fr);gap:5px}#battle .upgrade-hero{height:38px}#battle .upgrade-progress{padding:5px 7px}#battle .upgrade-choice{padding:5px}#battle .upgrade-lab-note{font-size:6px}}
