/* Touch-first layout. Desktop styles remain unchanged. */
:root{--safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px)}
.ss-touch-tools{display:none}.ss-mobile button,.ss-mobile a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ss-mobile #world,.ss-mobile #pad,.ss-mobile #cast,.ss-mobile #charge,.ss-mobile #grid{touch-action:none}.ss-mobile:not(.ss-home):not(.game){overscroll-behavior:none;height:100dvh}.ss-mobile #overlay,.ss-mobile #ov,.ss-mobile #panel,.ss-mobile #side-story,.ss-mobile #md,.ss-mobile #editor aside{touch-action:pan-y;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.ss-mobile #panel{max-height:calc(100dvh - 24px - var(--safe-t) - var(--safe-b));max-width:100%;overflow:auto;padding:12px}.ss-mobile #panel button,.ss-mobile #panel a,.ss-mobile #side-story button{min-height:44px}.ss-mobile #overlay{padding:calc(10px + var(--safe-t)) calc(8px + var(--safe-r)) calc(10px + var(--safe-b)) calc(8px + var(--safe-l))}.ss-mobile:not(.ss-home):not(.game) header{height:calc(46px + var(--safe-t));padding:calc(3px + var(--safe-t)) calc(7px + var(--safe-r)) 3px calc(7px + var(--safe-l));pointer-events:none;gap:6px}.ss-mobile header a,.ss-mobile header button{pointer-events:auto;min-height:40px;display:grid;place-items:center;padding:6px 9px;font-size:12px;white-space:nowrap}.ss-mobile header div{min-width:0}.ss-mobile header strong,.ss-mobile header b{font-size:clamp(12px,3.5vw,18px)}.ss-mobile header small{font-size:8px}.ss-mobile #hint{display:none!important}.ss-mobile #actions small,.ss-mobile #parkActions small,.ss-mobile #battle-deck kbd,.ss-mobile #playui #jump small{display:none!important}.ss-mobile #actions button br{display:none}.ss-mobile #pad{display:grid;position:absolute;width:108px;height:108px;left:calc(12px + var(--safe-l));bottom:calc(14px + var(--safe-b));opacity:1;z-index:4}.ss-mobile #pad i{width:40px;height:40px;pointer-events:none}.ss-mobile #actions{position:absolute;display:grid;grid-template-columns:repeat(2,54px);gap:6px;right:calc(10px + var(--safe-r));left:auto;bottom:calc(14px + var(--safe-b));z-index:4;pointer-events:none}.ss-mobile #actions button,.ss-mobile #actions #cast{width:54px;height:54px;padding:2px;font-size:11px;line-height:1.1;pointer-events:auto;white-space:nowrap}.ss-mobile #actions #attack,.ss-mobile #actions #cast{background:radial-gradient(at 35% 15%,#64cffc,#18568c 60%,#0a1c38);border-color:#c4f3ff}.ss-mobile #deck,.ss-mobile #battle-deck{position:absolute;z-index:5;padding:5px;border-radius:11px;gap:3px;background:#07172be0;bottom:calc(14px + var(--safe-b));left:50%;width:calc(100% - 290px - var(--safe-l) - var(--safe-r));transform:translateX(-50%);pointer-events:none}.ss-mobile .cards,.ss-mobile .magic-cards{gap:4px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.ss-mobile .cards button,.ss-mobile .magic-cards button{min-width:0;min-height:51px;padding:3px 1px;font-size:10px;line-height:1.15;pointer-events:auto}.ss-mobile .cards button b,.ss-mobile .magic-cards button b{font-size:19px;line-height:1.1}.ss-mobile .cards button small,.ss-mobile .magic-cards button small{font-size:9px}.ss-mobile #reslabel,.ss-mobile #resonance{font-size:10px}.ss-mobile #deck .meter,.ss-mobile #battle-deck .meter{height:5px;margin:2px 0 3px}.ss-mobile #controls{inset:0;pointer-events:none}.ss-mobile .ss-touch-tools{display:flex;position:absolute;right:calc(10px + var(--safe-r));bottom:calc(140px + var(--safe-b));z-index:4;gap:4px;pointer-events:none}.ss-mobile .ss-touch-tools button{pointer-events:auto;width:44px;height:44px;padding:0;border-radius:10px;background:#0a2849c9;color:#d5f4ff;border:1px solid #8fd4f1;font-size:17px;touch-action:manipulation;box-shadow:0 2px 8px #0005}.ss-mobile .ss-touch-tools button:last-child{font-size:19px}.ss-mobile #potion{right:calc(10px + var(--safe-r));bottom:calc(190px + var(--safe-b));min-height:44px;padding:5px 9px;font-size:12px}.ss-mobile #ascend{bottom:calc(105px + var(--safe-b));min-height:44px;max-width:calc(100% - 20px);font-size:12px;z-index:6}.ss-mobile .fighters{top:calc(48px + var(--safe-t));left:calc(6px + var(--safe-l));right:calc(6px + var(--safe-r));gap:4px;grid-template-columns:minmax(0,1fr) 60px minmax(0,1fr)}.ss-mobile .fighter{padding:5px;gap:4px;max-width:280px;border-radius:9px}.ss-mobile .fighter img{width:32px;height:32px}.ss-mobile .fighter b{font-size:11px}.ss-mobile .fighter small{font-size:10px}.ss-mobile .fighter .meter{height:5px;margin:3px 0}.ss-mobile .versus{padding:4px}.ss-mobile .versus strong{font-size:25px}.ss-mobile #objective{top:calc(132px + var(--safe-t));font-size:11px;padding:4px 8px;max-width:94%;white-space:normal}.ss-mobile #hud #map{top:calc(163px + var(--safe-t));right:calc(7px + var(--safe-r));width:64px;height:64px}.ss-mobile #notice{max-width:92%;white-space:normal;font-size:20px;top:42%}.ss-mobile #combo{top:43%;font-size:16px}.ss-mobile #locktag{font-size:10px}.ss-mobile.ss-story .health{top:calc(49px + var(--safe-t));left:calc(7px + var(--safe-l));width:148px;padding:7px;font-size:11px}.ss-mobile.ss-story .health .meter{height:7px;margin:3px 0 5px}.ss-mobile.ss-story #quest{top:calc(132px + var(--safe-t));left:calc(7px + var(--safe-l));width:158px;padding:6px;font-size:10px}.ss-mobile.ss-story #mapbox{top:calc(49px + var(--safe-t));right:calc(7px + var(--safe-r));padding:4px}.ss-mobile.ss-story #mapbox canvas{width:55px;height:65px}.ss-mobile.ss-story #mapbox small{font-size:8px}.ss-mobile.ss-story #bossbar{top:calc(220px + var(--safe-t));width:70%;max-width:340px;padding:5px 8px;font-size:11px}.ss-mobile.ss-story #bossbar .meter{height:6px;margin:3px 0}.ss-mobile.ss-story #prompt{bottom:calc(200px + var(--safe-b));max-width:90%;font-size:11px;white-space:normal;text-align:center;padding:4px 8px}.ss-mobile #parkActions{bottom:calc(14px + var(--safe-b));right:calc(10px + var(--safe-r));gap:6px}.ss-mobile #parkActions button{width:60px;height:60px;font-size:12px;padding:3px}.ss-mobile .parkHud{top:calc(48px + var(--safe-t));left:6px;right:6px}.ss-mobile #sequence{top:calc(150px + var(--safe-t));max-width:80%;flex-wrap:wrap}.ss-mobile #playui #jump{right:calc(10px + var(--safe-r));bottom:calc(14px + var(--safe-b));width:65px;height:65px;font-size:12px;padding:3px}.ss-mobile #retry{right:calc(84px + var(--safe-r));bottom:calc(18px + var(--safe-b));min-height:44px}.ss-mobile #playstatus,.ss-mobile #stop{top:calc(49px + var(--safe-t));font-size:12px}.ss-mobile #mobileTabs{display:flex;position:absolute;top:calc(48px + var(--safe-t));left:6px;right:6px;justify-content:center;gap:5px;pointer-events:auto}.ss-mobile #mobileTabs button{min-height:44px;padding:5px 12px;font-size:12px}.ss-mobile #editor aside{top:calc(96px + var(--safe-t));max-height:calc(100dvh - 178px - var(--safe-t) - var(--safe-b));width:min(210px,60vw);padding:8px}.ss-mobile #editor[data-pane="tools"] #blueprint,.ss-mobile #editor[data-pane="blueprint"] #tools,.ss-mobile #editor[data-pane="none"] aside{display:none}.ss-mobile #editor[data-pane="blueprint"] #blueprint{width:min(270px,70vw)!important}.ss-mobile #editor #palette button,.ss-mobile #editor .row button{min-height:44px;font-size:11px}.ss-mobile #editbar{bottom:calc(7px + var(--safe-b));width:calc(100% - 16px);max-width:520px;justify-content:space-between;padding:6px;gap:5px}.ss-mobile #editbar button{min-height:44px}.ss-mobile #editor .ss-touch-tools{bottom:calc(73px + var(--safe-b))}.ss-mobile.ss-create #playui .ss-touch-tools,.ss-mobile.ss-mini .ss-touch-tools{bottom:calc(88px + var(--safe-b))}
@media(orientation:portrait){.ss-mobile #deck,.ss-mobile #battle-deck{bottom:calc(9px + var(--safe-b));width:calc(100% - 16px - var(--safe-l) - var(--safe-r))}.ss-mobile #deck button,.ss-mobile #battle-deck button{min-height:56px}.ss-mobile:not(.ss-mini):not(.ss-create) #pad,.ss-mobile:not(.ss-mini):not(.ss-create) #actions{bottom:calc(105px + var(--safe-b))}.ss-mobile:not(.ss-mini):not(.ss-create) .ss-touch-tools{bottom:calc(227px + var(--safe-b))}.ss-mobile #potion{bottom:calc(279px + var(--safe-b))}.ss-mobile #ascend{bottom:calc(228px + var(--safe-b));left:7px;transform:none;max-width:48%;white-space:normal}.ss-mobile.ss-story #prompt{bottom:calc(280px + var(--safe-b))}.ss-mobile.ss-story #bossbar{top:calc(198px + var(--safe-t));left:calc(7px + var(--safe-l));transform:none;width:calc(100% - 14px - var(--safe-l) - var(--safe-r));max-width:none}.ss-mobile.ss-story #quest{width:calc(100% - 83px);max-width:225px}.ss-mobile.ss-story #quest b{margin-bottom:1px}}
@media(orientation:landscape) and (max-height:550px){.ss-mobile #pad{width:94px;height:94px}.ss-mobile #actions{grid-template-columns:repeat(2,48px)}.ss-mobile #actions button,.ss-mobile #actions #cast{width:48px;height:48px}.ss-mobile #deck,.ss-mobile #battle-deck{width:calc(100% - 255px - var(--safe-l) - var(--safe-r));max-width:480px}.ss-mobile #actions,.ss-mobile #pad,.ss-mobile #deck,.ss-mobile #battle-deck{bottom:calc(7px + var(--safe-b))}.ss-mobile .ss-touch-tools{bottom:calc(112px + var(--safe-b))}.ss-mobile #potion{bottom:calc(160px + var(--safe-b))}.ss-mobile #ascend{bottom:calc(89px + var(--safe-b))}.ss-mobile #hud #map{top:calc(126px + var(--safe-t));width:53px;height:53px;left:calc(7px + var(--safe-l));right:auto}.ss-mobile #objective{top:calc(116px + var(--safe-t));max-width:65%}.ss-mobile .fighter img{width:26px;height:26px}.ss-mobile.ss-story #quest{top:calc(122px + var(--safe-t));width:140px}.ss-mobile.ss-story #bossbar{top:calc(51px + var(--safe-t));width:40%}.ss-mobile.ss-story #prompt{bottom:calc(85px + var(--safe-b))}.ss-mobile #notice{top:43%;font-size:17px}.ss-mobile #panel h1{font-size:25px}.ss-mobile #panel p{font-size:12px}.ss-mobile #panel{padding:10px}.ss-mobile.ss-mini #hud #map{top:calc(145px + var(--safe-t));right:7px;left:auto}.ss-mobile.ss-create #editor aside{max-height:calc(100dvh - 165px - var(--safe-t) - var(--safe-b))}}
/* Native survival HUD, separate from the other games. */
.ss-mobile.ss-survival #hud{top:calc(6px + var(--safe-t));left:calc(6px + var(--safe-l));right:calc(55px + var(--safe-r));gap:4px}.ss-mobile.ss-survival .pill{font-size:11px;padding:5px 8px;gap:4px}.ss-mobile.ss-survival .bar{width:min(20vw,95px);height:8px}.ss-mobile.ss-survival #acts{right:calc(10px + var(--safe-r));bottom:calc(18px + var(--safe-b));gap:7px}.ss-mobile.ss-survival .act{width:65px;height:65px;font-size:12px}.ss-mobile.ss-survival #bj{width:74px;height:74px;font-size:12px}.ss-mobile.ss-survival #ov{overflow:auto;justify-content:safe center;gap:10px;padding:calc(12px + var(--safe-t)) 10px calc(12px + var(--safe-b))}.ss-mobile.ss-survival #ov h1{font-size:clamp(36px,10vw,70px)}.ss-mobile.ss-survival #ov p{font-size:13px}.ss-mobile.ss-survival #ov .card{padding:9px;width:min(145px,42vw)}.ss-mobile.ss-survival #ov .card b{font-size:15px}.ss-mobile.ss-survival #ov .card span{font-size:11px}.ss-mobile.ss-survival #ov .btn{min-height:48px;font-size:19px}.ss-mobile.ss-survival #ssSurvivalPause{position:fixed;right:calc(6px + var(--safe-r));top:calc(6px + var(--safe-t));z-index:3;width:44px;height:44px;border:1px solid #d4eaff;border-radius:10px;background:#112c50d9;color:white;font-size:17px}.ss-mobile.ss-survival .ss-touch-tools{bottom:calc(103px + var(--safe-b));right:calc(10px + var(--safe-r));position:fixed}.ss-mobile.ss-survival #bh{top:calc(53px + var(--safe-t))}.ss-mobile.game{padding:calc(9px + var(--safe-t)) calc(8px + var(--safe-r)) calc(18px + var(--safe-b)) calc(8px + var(--safe-l))}.ss-mobile.game header{flex-wrap:wrap;gap:5px}.ss-mobile.game h1{font-size:19px}.ss-mobile.game .balance{font-size:11px}.ss-mobile.game button{min-height:44px}.ss-mobile.game .panel{padding:12px}
.ss-mobile.ss-home #st{padding:calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) calc(16px + var(--safe-b)) calc(10px + var(--safe-l));gap:9px}.ss-mobile.ss-home #st .rt .ib,.ss-mobile.ss-home #st .rt .cu{min-height:44px}.ss-mobile.ss-home #st .rt{grid-template-columns:minmax(0,1fr) minmax(0,1fr) repeat(3,44px)}.ss-mobile.ss-home #st .dots button{width:22px;height:22px}.ss-mobile.ss-home #st .dots{width:154px!important;gap:6px}.ss-mobile.ss-home #md .pn{max-height:calc(100dvh - 16px - var(--safe-t) - var(--safe-b));overscroll-behavior:contain}.ss-mobile.ss-home #md button{min-height:44px}.ss-mobile.ss-home #st .qp{grid-row:5;aspect-ratio:447/139;max-width:300px}.ss-mobile.ss-home #st .main{grid-row:6}.ss-mobile.ss-home #st #grid{grid-row:7}.ss-mobile.ss-home #st .ban{grid-row:8}.ss-mobile.ss-home #st .dots{grid-row:9}.ss-mobile.ss-home #st .nw{grid-row:10}.ss-mobile.ss-home #st .nav{grid-row:11}.ss-mobile.ss-home #st .logo{max-width:360px}.ss-mobile.ss-home #st .pf{max-width:330px}
@media (pointer:coarse) and (orientation:landscape){.ss-mobile.ss-home #st{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}.ss-mobile.ss-home #st .logo{grid-row:1;grid-column:1;max-width:300px}.ss-mobile.ss-home #st .pf{grid-row:1;grid-column:2;align-self:center;max-width:290px}.ss-mobile.ss-home #st .rt{grid-row:2;grid-column:1/-1;max-width:650px;justify-self:center}.ss-mobile.ss-home #st .sbar{grid-row:3;grid-column:1/-1;grid-template-columns:repeat(8,minmax(0,1fr))}.ss-mobile.ss-home #st .main{grid-row:4;grid-column:1;align-self:stretch}.ss-mobile.ss-home #st #grid{grid-row:4/6;grid-column:2;grid-template-columns:repeat(2,minmax(0,1fr))}.ss-mobile.ss-home #st .qp{grid-row:5;grid-column:1}.ss-mobile.ss-home #st .ban{grid-row:6;grid-column:1}.ss-mobile.ss-home #st .nw{grid-row:6;grid-column:2}.ss-mobile.ss-home #st .dots{grid-row:7;grid-column:1}.ss-mobile.ss-home #st .nav{grid-row:8;grid-column:1/-1;grid-template-columns:repeat(9,minmax(0,1fr))}.ss-mobile.ss-home #st .nv{min-height:54px;font-size:11px}.ss-mobile.ss-home #st .nv i{font-size:23px}}
.ss-touch-tools[hidden],#ssSurvivalPause[hidden]{display:none!important}html:not(.ss-mobile) #ssSurvivalPause{display:none!important}.ss-mobile #side-story{overflow:auto;max-height:100dvh}.ss-mobile #hud #pad,.ss-mobile #playui #pad{touch-action:none}.ss-mobile #panel button:active,.ss-mobile #hud button:active{filter:brightness(1.22)}.ss-mobile.ss-home #md .pn{padding:12px}.ss-mobile.ss-story #controls #actions{bottom:calc(14px + var(--safe-b))}@media(orientation:portrait){.ss-mobile.ss-story #controls #actions{bottom:calc(105px + var(--safe-b))}}@media(orientation:landscape) and (max-height:550px){.ss-mobile.ss-story #controls #actions{bottom:calc(7px + var(--safe-b))}}
.ss-mobile.ss-home{overflow-y:auto;overscroll-behavior-y:contain}.ss-mobile.ss-home body{touch-action:pan-y}.ss-mobile.ss-home #st .rt .cu .pl{min-width:22px}.ss-mobile #panel{position:relative}.ss-mobile #panel .choice button{min-height:44px}.ss-mobile #side-story .sidecard{max-height:calc(100dvh - 20px - var(--safe-t) - var(--safe-b));overflow:auto}.ss-mobile.ss-create #editor #blueprint{max-width:calc(100vw - 14px)}.ss-mobile.ss-create #grid{width:100%;height:auto;aspect-ratio:1}.ss-mobile #deck button small,.ss-mobile #battle-deck button small{white-space:nowrap}.ss-mobile #panel .rowbuttons{flex-wrap:wrap}.ss-mobile #panel .rowbuttons button{min-height:44px}.ss-mobile.ss-story #bossbar{pointer-events:none}.ss-mobile.ss-survival #js{z-index:2}.ss-mobile.ss-survival #ov .cards{gap:7px}.ss-mobile.ss-survival #ov a{min-height:44px;display:grid;place-items:center}
@media(orientation:portrait) and (max-height:650px){.ss-mobile.ss-story #quest{top:calc(126px + var(--safe-t));font-size:9px;padding:4px}.ss-mobile.ss-story #bossbar{top:calc(188px + var(--safe-t))}.ss-mobile:not(.ss-mini):not(.ss-create) #pad,.ss-mobile:not(.ss-mini):not(.ss-create) #actions{bottom:calc(92px + var(--safe-b))}.ss-mobile:not(.ss-mini):not(.ss-create) .ss-touch-tools{bottom:calc(208px + var(--safe-b))}.ss-mobile #potion{bottom:calc(255px + var(--safe-b))}.ss-mobile #ascend{bottom:calc(206px + var(--safe-b))}}
@media(orientation:portrait){.ss-mobile:not(.ss-mini):not(.ss-create) #pad,.ss-mobile:not(.ss-mini):not(.ss-create) #actions,.ss-mobile.ss-story #controls #actions{bottom:calc(124px + var(--safe-b))}.ss-mobile:not(.ss-mini):not(.ss-create) .ss-touch-tools{bottom:calc(243px + var(--safe-b))}.ss-mobile #potion{bottom:calc(295px + var(--safe-b))}.ss-mobile #ascend{bottom:calc(243px + var(--safe-b))}.ss-mobile.ss-story #prompt{bottom:calc(296px + var(--safe-b))}}
html.ss-mobile.game{padding:0}.ss-mobile.ss-story #toast{top:34%;max-width:92%;white-space:normal;pointer-events:none}@media(orientation:portrait){.ss-mobile.ss-story #bossbar{top:calc(211px + var(--safe-t))}}@media(orientation:landscape) and (max-height:550px){.ss-mobile.ss-story #toast{top:38%;font-size:17px}}
