/* 0.5.3: one battlefield with fixed, textured 3D combat formations. */
:root{--t53-left:250px;--t53-right:306px;--t53-top:114px}
body{font-size:15px;line-height:1.45;background:#080e18}
#navigation{overflow-x:auto;scrollbar-width:thin;flex-wrap:nowrap}
#navigation .nav-item{min-width:max-content;font-size:13px;gap:7px;padding:10px 12px}
#navigation .nav-item span{font-size:13px}
#topbar .currency strong{font-size:19px}
body[data-page=home] #viewport,body[data-page=dungeon] #viewport{
 position:fixed;left:calc(var(--t53-left) + 18px);right:calc(var(--t53-right) + 18px);top:var(--t53-top);bottom:64px;
 width:auto;height:auto;background:#111823 url('/assets/backdrops/tactical-front.webp') center 52%/cover no-repeat;
 border:1px solid #344555;border-radius:18px;overflow:hidden;box-shadow:0 12px 44px #0009;
}
body[data-page=home] #viewport::before,body[data-page=dungeon] #viewport::before{
 content:'';position:absolute;inset:0;background:linear-gradient(180deg,#05080c15,#0b111b15 55%,#05080c80);pointer-events:none;
}
#scene{position:absolute;inset:0;width:100%!important;height:100%!important;background:transparent}
#world-labels{position:absolute;inset:0;pointer-events:none;overflow:hidden}
#battle-unit-bars{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:3}
body:not([data-page=home]):not([data-page=dungeon]) #viewport{visibility:hidden;pointer-events:none}
.t53-unit-bar{position:absolute;width:46px;height:7px;border:1px solid #07101d;background:#151c28e8;box-shadow:0 1px 4px #000b;transform:translate(-50%,-100%);border-radius:4px}
.t53-unit-bar i{display:block;height:100%;border-radius:4px;background:#54d7a0}
.t53-unit-bar.enemy i{background:#f07f7e}.t53-unit-bar.boss{width:108px;height:9px}.t53-unit-bar.boss i{background:#ffbb61}
.t53-unit-bar span{position:absolute;top:-17px;left:0;right:0;text-align:center;color:#fff;font-size:10px;line-height:15px;font-weight:800;text-shadow:0 1px 3px #000,1px 0 3px #000}
.t53-flying-coin{position:fixed;width:21px;height:21px;border-radius:50%;background:radial-gradient(circle at 30% 20%,#fff5bb,#fac75b 50%,#b56c22);border:2px solid #ffe5a2;color:#754416;box-shadow:0 0 15px #ffb432;display:grid;place-items:center;font-size:14px;z-index:10000;pointer-events:none}
/* UI panels never cover the formation or crop horizontally. */
body[data-page=dungeon] #app{overflow:hidden}
.v48-hud-left,.v48-hud-right{position:fixed!important;top:calc(var(--t53-top) + 4px)!important;bottom:14px!important;height:auto!important;max-height:none!important;margin:0!important;box-sizing:border-box;pointer-events:auto;background:linear-gradient(160deg,#142233f5,#0b1422f7);border:1px solid #3c5064;border-radius:14px}
.v48-hud-left{left:10px!important;width:var(--t53-left)!important;padding:12px!important;overflow:auto;scrollbar-width:thin}
.v48-hud-right{right:10px!important;width:var(--t53-right)!important;padding:12px!important;display:flex;flex-direction:column;gap:9px;overflow:hidden}
.v48-hud-header h2{font-size:20px;margin:3px 0}.v48-hud-header h2 strong{font-size:37px}.v48-hud-header p{font-size:13px;margin:5px 0;color:#a9ecd9}
.v48-hud-left .eyebrow{font-size:11px;letter-spacing:.1em}
.v48-phase-time{padding:12px;margin:4px 0}.v48-phase-time>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:8px}.v48-phase-time small{font-size:12px;line-height:1.4}.v48-phase-time b{font-size:25px;line-height:1.1;white-space:nowrap}
.v48-hud-numbers{gap:7px;margin:8px 0}.v48-hud-numbers>div{padding:8px;min-width:0}.v48-hud-numbers small{font-size:10px;line-height:1.2}.v48-hud-numbers b{font-size:21px;line-height:1.3}
.v51-boss-indicator{display:none}.v52-boss-health{margin:8px 0;padding:10px}.v52-boss-health>strong{font-size:11px}.v52-boss-health>span{font-size:13px}
.v48-chest{padding:11px;margin:8px 0;background:linear-gradient(140deg,#2a2631,#131d2e);border:1px solid #997747;border-radius:12px;overflow:visible}
.v48-chest-heading{display:flex;gap:8px;align-items:center}.v48-chest-heading img{width:56px;height:56px;object-fit:contain;flex-shrink:0}.v48-chest-heading b{font-size:23px;display:block}.v48-chest-heading b small{font-size:12px}.v48-chest-heading span{font-size:11px;color:#f0ce8c;font-weight:800}
.v48-chest p,.v48-chest>small{font-size:12px;line-height:1.4;display:block;margin:8px 0}.v48-chest-buttons{display:flex;gap:6px}.v48-chest-buttons .btn{flex:1;font-size:11px!important;min-width:0;min-height:42px;letter-spacing:0;padding:7px;white-space:normal}
.v48-hud-left>.btn{font-size:12px;min-height:39px;margin:7px 0;white-space:normal;line-height:1.3;letter-spacing:0}
.v48-roster-title b{font-size:31px}.v48-roster-title b span{font-size:13px}.v48-roster-title small{font-size:12px}.v48-attack-stat{font-size:14px}
.v48-rarity-pills span{font-size:11px;padding:4px 7px}.v48-roster-buttons .btn{font-size:11px;min-height:36px;line-height:1.35}
.v48-roster-scroll{overflow:auto;min-height:0;flex:1;scrollbar-width:thin}.v51-status-card{width:100%;box-sizing:border-box;grid-template-columns:42px minmax(0,1fr) 31px;padding:10px 7px;gap:7px;margin-bottom:8px}.v51-status-card img{height:58px;width:40px;object-fit:contain}.v48-roster-name b{font-size:14px}.v48-roster-name span{font-size:10px}.v51-status-card small{font-size:11px;white-space:normal;line-height:1.4}.v51-unit-ability{font-size:11px;line-height:1.4}.v51-elite-tag{font-size:10px;line-height:1.4}.v51-hud-bars .v51-bar{display:grid;grid-template-columns:25px minmax(25px,1fr) 54px;gap:5px;align-items:center;margin:4px 0}.v51-hud-bars span,.v51-hud-bars strong{font-size:10px}.v51-hud-bars i{height:7px;overflow:hidden;border-radius:4px}.v48-retire-one{font-size:9px;line-height:1.2;overflow-wrap:anywhere}
.v48-hunt-controls{position:fixed!important;left:calc(var(--t53-left) + 18px)!important;right:calc(var(--t53-right) + 18px)!important;bottom:12px!important;min-height:42px;padding:8px 13px!important;background:#152438ed;border-radius:10px;display:flex;justify-content:space-between;gap:12px;pointer-events:auto;box-sizing:border-box}
.v48-hunt-controls>span{font-size:12px!important;line-height:1.3;max-width:75%}.v48-hunt-controls .btn{font-size:11px;min-height:30px;padding:4px 8px;letter-spacing:0}
.v48-phase-banner{position:fixed;left:calc(var(--t53-left) + 30px);right:calc(var(--t53-right) + 30px);top:126px;max-width:none;transform:none;pointer-events:none;text-align:center}
.v52-transition-visible{min-width:0;box-sizing:border-box}.v52-transition-visible b{font-size:25px!important}.v52-transition-visible>span{font-size:14px}
.v52-drop-announcement{position:relative;padding:10px;font-size:13px}.v52-drop-announcement small{font-size:12px}
/* Sanctuary has its own readable team roster. */
.v48-lobby-intro{position:fixed;left:10px;top:118px;bottom:14px;width:var(--t53-left);padding:17px;overflow:auto}.v48-lobby-intro h1{font-size:31px;line-height:1.15}.v48-lobby-intro>p{font-size:14px}.v48-lobby-buttons .btn{font-size:12px;min-height:43px}.v48-lobby-foot{font-size:12px;line-height:1.4}.v48-team-panel{position:fixed;right:10px;top:118px;bottom:14px;width:var(--t53-right)}.v48-team-info b{font-size:13px}.v48-team-info small{font-size:11px}.v48-team-row{min-height:38px;grid-template-columns:20px 32px minmax(0,1fr)}.v48-team-row img{width:29px;height:35px}.v51-lobby-medic small{font-size:12px}.v48-lobby-caption{bottom:22px;max-width:calc(100vw - var(--t53-left) - var(--t53-right) - 60px);font-size:12px}
/* General menus, richer art, normal-sized text. */
.panel-page{padding:24px 28px 50px;max-width:1540px;margin:0 auto;box-sizing:border-box}.panel-page p{font-size:15px;line-height:1.5}.panel-page small{font-size:12px}.page-title h1{font-size:34px}.page-title .eyebrow{font-size:12px}.btn{font-size:12px;letter-spacing:.02em;min-height:40px}.panel-page .btn{font-size:13px}.btn:disabled{cursor:not-allowed;opacity:.44}.notice{font-size:14px!important;line-height:1.5}
.v52-home-menu{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;padding:24px}.v52-home-menu-item{padding:12px;min-height:130px;display:grid;grid-template-columns:56px 1fr;grid-template-rows:auto auto;gap:4px 10px;text-align:left;align-items:center;background:linear-gradient(145deg,#2c3849e8,#101c2eea);border:1px solid #8d7451;border-radius:12px}.v52-home-menu-item>span{grid-row:1/3;width:56px;height:68px;display:grid;place-items:center}.v52-home-menu-item>span img{width:54px;height:68px;object-fit:contain;filter:drop-shadow(0 3px 8px #000)}.v52-home-menu-item b{font-size:13px;letter-spacing:.03em}.v52-home-menu-item small{font-size:12px;line-height:1.35}.v52-home-menu-item:hover{background:#344860;border-color:#f4cc7e;transform:translateY(-2px)}
.t53-kit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.t53-kit{display:grid;grid-template-columns:104px 1fr;gap:20px;background:linear-gradient(140deg,#1d344b,#142031);border:1px solid #526e85;border-radius:16px;padding:22px}.t53-kit>img{width:100px;height:140px;object-fit:contain;align-self:center}.t53-kit span{font-size:12px;letter-spacing:.12em;color:#84e9cf}.t53-kit h3{font-size:25px;margin:8px 0}.t53-kit p{margin:6px 0}.t53-kit strong{display:block;color:#f3cc87;font-size:23px}.t53-kit small{display:block;margin:10px 0}.t53-kit .btn{margin-right:8px;margin-bottom:6px}.t53-supplies{margin-bottom:24px}.t53-supplies h2{font-size:28px;margin:4px 0}.t53-supplies label{max-width:650px;display:block;font-size:15px;margin:18px 0}.t53-supplies select{font-size:15px;padding:12px}
.t53-lab{display:flex;justify-content:space-between;gap:24px;align-items:center}.t53-lab>div{flex:1}.t53-lab>div:last-child{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}.t53-lab .btn{white-space:normal;line-height:1.4}.t53-barracks-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:24px 0}.t53-barracks-toolbar>div{flex-basis:100%}.barracks-detail{font-size:15px}.barracks-detail .btn{margin-top:12px}.barracks-detail h2{font-size:24px}.barracks-detail strong{font-size:20px;color:#f2ca82}.barrack-person b{font-size:15px}.barrack-person small{font-size:13px}.barrack-person select{font-size:13px}.barrack-assignment{margin:15px 0 26px}.t53-stock-reason{font-size:12px!important;min-height:38px;color:#8ae4c5;font-weight:700}.crate-pack p{font-size:14px}.crate-pack .btn{min-height:42px;font-size:13px}.crate-pack h3{font-size:23px}.medic-showcase{position:relative!important;height:220px!important;overflow:hidden;flex-shrink:0}.medic-showcase img{position:static!important;width:100%!important;height:100%!important;object-fit:contain!important}.pack-medic p{font-size:14px}.crate-pack-render{height:170px}
.v52-fusion-card:disabled{opacity:.42}.v52-fusion-card small{font-size:13px}.v52-fusion-card b{font-size:15px}.v52-fusion-tabs .chip{font-size:14px}.v52-fusion-grid{margin-top:20px}.v52-plan-card p{font-size:16px}
@media(min-width:1700px){:root{--t53-left:285px;--t53-right:350px}.v51-status-card{grid-template-columns:50px minmax(0,1fr) 40px}.v51-status-card img{width:47px;height:64px}.v51-status-card small{font-size:13px}.v51-unit-ability{font-size:12px}.v48-roster-name b{font-size:16px}.v51-hud-bars span,.v51-hud-bars strong{font-size:11px}}
@media(max-width:1190px){:root{--t53-left:218px;--t53-right:275px}.v52-home-menu{grid-template-columns:repeat(4,minmax(0,1fr))}.t53-kit-grid{grid-template-columns:1fr}.v48-lobby-intro h1{font-size:27px}.v48-hunt-controls>span{display:none}.v48-hunt-controls{justify-content:flex-end}.v51-status-card{grid-template-columns:35px minmax(0,1fr) 29px;gap:5px}.v51-status-card img{width:33px}.v48-roster-name span{display:none}}
@media(max-width:800px){:root{--t53-top:110px}.panel-page{padding:18px 12px 40px}.v52-home-menu{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px}.t53-lab{display:block}.t53-lab>div:last-child{grid-template-columns:1fr;margin-top:14px}.v52-home-menu-item small{display:none}.v52-home-menu-item{grid-template-columns:48px 1fr;min-height:86px}.t53-kit{grid-template-columns:70px 1fr;padding:16px;gap:12px}.t53-kit>img{width:65px}.barrack-person{flex-wrap:wrap}.v48-hud-left,.v48-hud-right{position:relative!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;width:auto!important;margin:12px!important;overflow:visible!important}.v48-hud-right{height:520px!important;overflow:hidden!important}.v48-hunt-overlay{position:relative;padding-top:55vh;overflow:visible;display:block;pointer-events:auto}body[data-page=dungeon] #app{overflow:auto}body[data-page=dungeon] #viewport{left:8px;right:8px;top:114px;height:52vh;bottom:auto;position:absolute}.v48-hunt-controls{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;margin:12px}.v48-phase-banner{left:20px;right:20px;top:134px}.v48-team-panel{width:220px}.v48-lobby-intro{width:205px}body[data-page=home] #viewport{left:8px;right:8px;bottom:12px}.v48-lobby-caption{display:none}.v48-lobby-intro,.v48-team-panel{background:#101c2cce}.v48-lobby-intro h1{font-size:24px}.v48-lobby-intro p{font-size:12px}}
.t53-compatible-field{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.t53-compat-unit{position:absolute;width:13%;height:19%;transform:translate(-50%,-100%);transition:opacity .25s;z-index:2;pointer-events:none;filter:drop-shadow(0 7px 5px #0007)}
.t53-compat-unit img{width:100%;height:100%;object-fit:contain;object-position:center bottom}.t53-compat-unit.foe img{filter:hue-rotate(98deg) saturate(.55)}.t53-compat-unit.heavy img{filter:hue-rotate(166deg) saturate(.55)}.t53-compat-unit.boss{width:26%;height:33%}.t53-compat-unit.boss img{filter:saturate(.7)}
.t53-compat-unit.ko{opacity:0}.t53-compat-unit.transit{opacity:0;transition:opacity 3.8s}
.t53-compat-health{position:absolute;top:0;left:15%;right:15%;height:6px;border:1px solid #0b1522;background:#182133;box-shadow:0 1px 5px #000;border-radius:4px;z-index:4}
.t53-compat-health i{display:block;height:100%;background:#6ad4ad;border-radius:4px}.foe .t53-compat-health i{background:#e78876}.boss .t53-compat-health i{background:#ffc269}.t53-compat-health span{position:absolute;top:-17px;width:100%;text-align:center;color:#fff;text-shadow:0 1px 4px #000;font-size:10px;font-weight:800}
.t53-compat-beam{position:absolute;height:2px;transform-origin:0 50%;z-index:5;box-shadow:0 0 6px #ffc45c44;pointer-events:none}.t53-compat-pulse{position:absolute;width:90px;height:40px;border:2px solid;border-radius:50%;z-index:6;pointer-events:none}

/* Explicitly override the old .playing canvas expansion. */
@media(min-width:801px){
 body[data-page=home] #viewport,body[data-page=dungeon] #viewport,
 body.playing[data-page=home] #viewport,body.playing[data-page=dungeon] #viewport{
 left:calc(var(--t53-left) + 18px)!important;right:calc(var(--t53-right) + 18px)!important;
 top:var(--t53-top)!important;bottom:64px!important;width:auto!important;height:auto!important;
 transform:none!important;max-width:none!important;
 }
 .v48-lobby-intro,.v48-team-panel{top:calc(var(--t53-top) + 4px)!important}
}
#app{top:var(--t53-top)!important}
.v48-phase-banner{top:calc(var(--t53-top) + 12px)}
#navigation .nav-item{padding:8px 9px;font-size:12px}
#navigation .nav-item span{font-size:12px}
.v51-hud-bars span,.v51-hud-bars strong{font-size:11px}
.v51-medic-ability,.v51-unit-ability{font-size:12px;line-height:1.4}
body:not([data-page=home]):not([data-page=dungeon]) #viewport{opacity:0!important;visibility:hidden!important}
.t53-lab .btn.lab-credit{font-size:13px!important}
.v52-intro-top{padding:15px 28px;font-size:11px}
.v52-intro-content{max-width:650px;margin:0 0 16px 40px;padding-top:20px}
.v52-intro-content h1{font-size:clamp(38px,4.2vw,62px);line-height:1.05;letter-spacing:-1.5px;margin:12px 0}
.v52-intro-content p{font-size:15px;line-height:1.5;max-width:600px}
.v52-info-pills{gap:6px;margin:14px 0}.v52-info-pills span{padding:7px 9px;font-size:10px}
.v52-welcome-action .btn{min-height:44px;padding:11px 20px;font-size:13px}
.v52-progress-line{margin-top:8px;padding:8px 20px;font-size:13px}
.v52-home-menu{padding:16px 24px 24px;gap:10px}
.v52-home-menu-item{min-height:94px;grid-template-columns:45px 1fr;padding:10px;gap:4px 7px}
.v52-home-menu-item>span{width:45px;height:55px}.v52-home-menu-item>span img{width:43px;height:55px}
.v52-home-menu-item b{font-size:12px}.v52-home-menu-item small{font-size:11px;text-align:left}
@media(max-height:740px){.v52-intro-content{padding-top:4px}.v52-intro-content h1{font-size:40px}.v52-intro-content p{font-size:14px}.v52-info-pills{margin:9px 0}.v52-home-menu-item{min-height:78px}.v52-home-menu-item small{display:none}}

/* Prioritize the chest and timer on short laptop screens. */
.v48-hud-left{display:flex!important;flex-direction:column;gap:7px!important}
.v48-hud-left>*{flex-shrink:0}
.v48-hud-header{order:0}.v48-phase-time{order:1}.v52-boss-health{order:2}.v48-chest{order:3}
.v48-hud-left>.btn{order:4}.v48-hud-numbers{order:5}.v48-hud-left>.lab-credit{order:6}.v52-drop-announcement{order:4}
.v51-hud-bars{gap:0!important;margin:5px 0!important}
.v51-hud-bars .v51-bar{min-height:0!important;padding:0!important;line-height:14px!important;margin:2px 0!important}
.v51-unit-ability{margin:5px 0 0!important;font-size:11px!important;line-height:1.3!important}
.v51-elite-tag{margin-top:4px!important;font-size:10px!important;line-height:1.3!important}
.v51-status-card{min-height:0!important}.t53-medic-compact{padding:7px!important}
.t53-medic-compact .v51-support-lock{font-size:21px}.t53-medic-compact img{height:50px}
@media(max-height:760px) and (min-width:801px){
 .v48-hud-header h2 strong{font-size:29px}.v48-hud-header h2{margin:2px 0}.v48-hud-header p{font-size:12px;margin:3px 0}
 .v48-phase-time{padding:8px;margin:1px 0}.v48-phase-time b{font-size:23px}.v48-phase-time small{font-size:11px}.v48-phase-time>small{display:none}
 .v48-chest{padding:9px;margin:2px 0}.v48-chest-heading img{width:42px;height:42px}.v48-chest-heading b{font-size:21px}
 .v48-chest p{font-size:11px;margin:5px 0}.v48-chest>small{display:none}.v48-chest-buttons .btn{min-height:37px;font-size:10px!important}
 .v48-hud-left>.btn{margin:0;min-height:32px}.v48-hud-numbers{margin:1px 0}.v48-hud-numbers>div{padding:5px}.v48-hud-numbers b{font-size:16px}
 .v48-hud-right{gap:5px}.v48-roster-title>div>small:not(.v51-medic-count){font-size:11px}.v48-roster-title>div>small:nth-of-type(2){display:none}
 .v48-roster-title b{font-size:25px}.v48-roster-title b span{font-size:12px}.v48-rarity-pills span{font-size:10px;padding:2px 5px}
 .v48-roster-buttons .btn{min-height:29px;font-size:10px}.v51-status-card{padding:6px!important}.v51-status-card img{height:44px}
}
