/* Banana Towers: workshop and battle controls stay outside the canvas. */
.tower-shell{aspect-ratio:auto;background:#dce6cc}.tower-viewport{position:relative;aspect-ratio:16/9;overflow:hidden}#towerCanvas{display:block;width:100%;height:100%;touch-action:none;cursor:pointer}
.tower-menu{align-items:flex-start;text-align:left;padding:6%;background:linear-gradient(90deg,#fff3d6f5,#fff3d6c4 42%,#fff3d600 82%)}.tower-menu h2{font-size:clamp(36px,5vw,66px);line-height:1.02;letter-spacing:-2px;margin:14px 0}.tower-menu h2 em{display:block}.tower-menu p{max-width:270px;font-size:13px;line-height:1.5}.tower-menu .panel-eyebrow{font-size:9px}.tower-menu .play-button{min-height:48px}
.tower-hud{display:flex;align-items:center;gap:15px;min-height:40px;padding:4px 14px;font-size:11px;background:#faf2db;color:#295e46;flex-shrink:0}.tower-hud strong{margin-left:auto;font:700 20px 'Rubik',sans-serif}.tower-hud .hud-icon{width:38px;height:38px;background:#fff9e6;border-radius:50%;flex-shrink:0}#towerTurn{font-size:10px;color:#567353}
.tower-below{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:20px}.tower-shell .glide-overlay{z-index:5}.tower-shell .glide-result-card{max-width:500px;max-height:100%;overflow-y:auto}.tower-shell .glide-result-card h2{font-size:25px}.tower-shell .glide-overlay{overflow-y:auto}
.play-stage .tower-shell{display:flex;flex-direction:column}.play-stage .tower-viewport{flex:1;min-height:0;aspect-ratio:auto}.play-stage .tower-controls,.play-stage .tower-hud{position:relative}.play-stage #towerPauseButton{display:none}.play-stage .tower-hud{min-height:34px}.play-stage .tower-menu{inset:0}

/* Clear workshop steps, direct equipment choices, and explicit purchase feedback. */
.tower-controls{flex:none;min-height:0;background:#fbf5e3;border-top:1px solid #b9c7a2;color:#285d43}
.tower-mobile-panels,.tower-mobile-weapon-hint{display:none}
.tower-workshop{display:flex;flex-direction:column;min-height:0}
.tower-workshop-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 18px 12px;border-bottom:1px solid #dce0c5;flex:none}
.tower-workshop-header h3{font:700 18px/1.2 'Rubik',sans-serif;margin:0 0 4px;color:#245c40}
#towerSelected{font-size:11px;color:#677b5b}.tower-wallet{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid #ddbd59;border-radius:11px;background:#fae7a5;flex-shrink:0}.tower-wallet small{font-size:11px}.tower-wallet strong{font:700 23px/1 'Rubik',sans-serif;color:#466035;font-variant-numeric:tabular-nums}
.tower-workshop-body{display:grid;grid-template-columns:minmax(145px,.75fr) minmax(285px,1.65fr) minmax(190px,1fr);gap:16px;padding:14px 18px;min-height:0;overscroll-behavior:contain;scrollbar-color:#9db481 transparent;scrollbar-width:thin}
.tower-workshop-body>section{min-width:0}.tower-step{display:flex;align-items:center;gap:6px;margin:0 0 10px;font:700 12px/1.3 'DM Sans',sans-serif;color:#355f43}.tower-step>span{display:grid;place-items:center;flex:none;width:21px;height:21px;border-radius:50%;background:#e0e9c9;color:#42744e;font-size:10px}.tower-step>small{margin-left:auto;font-size:9px;font-weight:500;color:#557e52}
.tower-floor-buttons{display:grid;grid-template-columns:repeat(3,minmax(44px,1fr));gap:6px}
.tower-controls button{font-family:'DM Sans',sans-serif;touch-action:manipulation;user-select:none;-webkit-user-select:none;cursor:pointer;transition:background .12s,border-color .12s;box-sizing:border-box}
.tower-floor-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:54px;min-width:44px;padding:6px;border:1px solid #b8c6a0;border-bottom:3px solid #a2b58c;border-radius:9px;background:#fffdf2;color:#466b4a}.tower-floor-card b{font:700 18px/1 'Rubik',sans-serif}.tower-floor-card small{font-size:10px;white-space:nowrap}.tower-floor-card[aria-pressed="true"]{border-color:#29714e;background:#d9eac3;color:#23593d;box-shadow:inset 0 0 0 1px #29714e}.tower-floor-card[aria-pressed="true"]::after{content:'✓';position:absolute;top:2px;right:4px;font-size:10px}
.tower-weapon-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.tower-weapon-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;min-height:128px;padding:8px 6px 23px;border:1px solid #b8c6a0;border-bottom:3px solid #a2b58c;border-radius:11px;background:#fffdf2;color:#325c43;text-align:center;overflow-wrap:anywhere}.tower-weapon-card svg{width:54px;height:40px;flex:none}.tower-weapon-card b{font-size:11px;line-height:1.25}.tower-weapon-card small{font-size:10px;line-height:1.3;color:#718162}.tower-weapon-card[aria-pressed="true"]{background:#fff0b9;border-color:#a48c35;box-shadow:inset 0 0 0 1px #a48c35}.tower-equipped{position:absolute;bottom:5px;left:4px;right:4px;font-size:9px;font-weight:800;color:#6c702f}.tower-equipped::before{content:'✓ ';font-weight:900}
.tower-upgrade-benefit{font-size:10px;line-height:1.3;color:#6a7e5c;margin:0 0 8px}.tower-purchases{display:grid;gap:9px}.tower-purchases>div{min-width:0}.tower-purchase{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:47px;padding:8px 10px;border:1px solid #4f8d64;border-bottom:3px solid #397951;border-radius:9px;background:#edf4d9;color:#2b6745;text-align:left}.tower-purchase>span:first-child{display:flex;flex-direction:column;gap:4px;min-width:0}.tower-purchase b{font-size:11px;line-height:1.2}.tower-purchase small{font-size:10px;line-height:1.2}.tower-purchase>span:last-child{font-size:22px}.tower-purchase:disabled{background:#eeeeda;border-color:#c8ceb2;color:#6e7a60;cursor:default}.tower-price{display:block;margin:4px 1px 0;color:#507047;font-size:10px;line-height:1.3;min-height:13px}.tower-price[data-short="true"]{color:#93613c}
.tower-workshop-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:10px 18px;border-top:1px solid #dce0c5;background:#f2efd9;flex:none}.tower-workshop-footer p{font-size:11px;color:#657c57;margin:0}#towerBattle{display:flex;justify-content:space-between;align-items:center;gap:25px;min-width:205px;min-height:48px;padding:10px 16px;border:1px solid #246548;border-bottom:3px solid #1d553e;border-radius:10px;background:#25825b;color:#fff9e7;font-size:14px;font-weight:800}#towerBattle>span:last-child{font-size:22px}
/* Combat: six direct targets plus two named, timed abilities. */
.tower-battle-controls{display:grid;grid-template-columns:minmax(240px,1fr) minmax(270px,.9fr);align-items:center;gap:22px;padding:12px 18px}.tower-target-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.tower-target-heading b{font-size:12px}.tower-target-heading small{font-size:10px;color:#628059}.tower-enemy-buttons{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:5px}.tower-enemy-card{position:relative;display:flex;align-items:center;justify-content:center;min-width:44px;min-height:46px;padding:7px 9px 12px;border:1px solid #b2c4a6;border-bottom:3px solid #96b194;border-radius:8px;background:#fffdf1;color:#385f47;font:700 16px 'Rubik',sans-serif}.tower-enemy-card[aria-pressed="true"]{border-color:#2b7957;background:#daf0d0;box-shadow:inset 0 0 0 1px #2b7957}.tower-enemy-card[aria-pressed="true"]::before{content:'↓';position:absolute;right:5px;top:1px;font-size:12px}.tower-enemy-card[data-destroyed="true"]{color:#8a9480;background:#e5e8d6;border-color:#d0d5c2;cursor:default}.tower-enemy-card[data-destroyed="true"] b{text-decoration:line-through}.tower-target-health{position:absolute;left:6px;right:6px;bottom:5px;height:4px;border-radius:3px;background:#d9ddc4;overflow:hidden}.tower-target-health>span{display:block;height:100%;background:#5e9c71;border-radius:3px}.tower-targets p{font-size:10px;line-height:1.3;margin:6px 0 0;color:#697e59}
.tower-abilities{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;gap:5px 8px;min-width:0}.tower-ability{position:relative;display:flex;align-items:center;gap:8px;min-width:0;min-height:59px;padding:8px 10px 13px;border:1px solid #5a9a88;border-bottom:3px solid #408071;border-radius:10px;text-align:left;background:#daf0e5;color:#2c6b54;overflow:hidden}.tower-ability svg{width:26px;height:26px;flex:none}.tower-ability>span:not(.tower-ability-progress){display:flex;flex-direction:column;gap:5px;min-width:0}.tower-ability b{font-size:12px;line-height:1.2}.tower-ability small{font-size:10px;line-height:1.2}.tower-ability kbd{margin-left:auto;padding:2px 4px;font-size:9px;color:inherit;border:1px solid #6b9d8055;background:#ffffef50}.tower-storm{background:#fae5a0;border-color:#b09545;color:#655f2b}.tower-ability:disabled{cursor:default;background:#e9eedb;border-color:#acbca0;color:#6b7d60}.tower-ability[data-active="true"]{background:#bce6ce;border-color:#3d9a72;color:#22633e}.tower-abilities>small{font-size:10px;line-height:1.3;color:#697e59;margin:0 2px}.tower-abilities #towerShield{grid-area:1/1}.tower-abilities #towerShieldDescription{grid-area:2/1}.tower-abilities #towerStorm{grid-area:1/2}.tower-abilities #towerStormDescription{grid-area:2/2}.tower-ability-progress{position:absolute;bottom:0;left:0;right:0;height:4px;background:#658c6640}.tower-ability-progress>span{display:block;height:100%;background:#418a63}.tower-storm .tower-ability-progress>span{background:#a18735}
.tower-between{padding:20px;text-align:center;font:700 16px 'Rubik',sans-serif}.tower-controls :focus-visible{outline:3px solid #ce990c;outline-offset:2px}.tower-controls button:disabled{cursor:default}.tower-floor-card:disabled,.tower-weapon-card:disabled{opacity:.7}
@media(hover:hover){.tower-floor-card:not(:disabled):hover,.tower-enemy-card:not(:disabled):hover{border-color:#377b55;background:#e6efd3}.tower-weapon-card:not(:disabled):hover{border-color:#9a873c;background:#fff3cc}.tower-purchase:not(:disabled):hover{background:#dceec6}#towerBattle:not(:disabled):hover{background:#1d704f}}
@media(max-width:800px){.tower-workshop-body{grid-template-columns:1fr;gap:12px}.tower-floor-buttons{grid-template-columns:repeat(6,minmax(44px,1fr));overflow-x:auto;padding:2px;gap:5px}.tower-step{margin-bottom:7px}.tower-weapon-card{min-height:96px;padding-top:6px;gap:3px}.tower-weapon-card svg{width:42px;height:30px}.tower-purchases{grid-template-columns:1fr 1fr;gap:10px}.tower-workshop-header{padding:11px 14px}.tower-workshop-body{padding:11px 14px}.tower-workshop-footer{padding:9px 14px}.tower-battle-controls{gap:12px;padding:10px 14px;grid-template-columns:1fr}.tower-abilities{grid-template-columns:1fr 1fr}.tower-targets p{display:none}.tower-workshop-header h3{font-size:16px}}
@media(max-width:600px){.tower-below{grid-template-columns:1fr;gap:12px}.tower-hud{gap:8px;font-size:10px;padding:5px 9px;flex-wrap:wrap}.tower-hud strong{font-size:17px}.tower-workshop-header{padding:10px 12px;gap:8px}.tower-wallet{padding:7px 9px;gap:6px}.tower-wallet small{font-size:10px}.tower-wallet strong{font-size:21px}.tower-workshop-body{padding:10px 12px;gap:10px}.tower-step{font-size:11px;gap:5px}.tower-step>span{width:18px;height:18px}.tower-floor-card{min-height:46px;gap:3px}.tower-floor-card b{font-size:16px}.tower-floor-card small{font-size:9px}.tower-weapon-card{min-height:104px;gap:4px;padding:6px 5px 20px}.tower-weapon-card b{font-size:11px}.tower-weapon-card small{font-size:10px}.tower-weapon-card svg{width:40px;height:28px}.tower-equipped{font-size:9px;bottom:4px}.tower-workshop-footer{padding:9px 12px;gap:8px}.tower-workshop-footer p{font-size:10px;max-width:115px;line-height:1.4}#towerBattle{min-width:160px;min-height:46px;font-size:13px;gap:10px;padding:9px 12px}.tower-battle-controls{padding:9px 12px;gap:10px}.tower-enemy-buttons{overflow-x:auto;padding:2px;gap:4px}.tower-target-heading b{font-size:11px}.tower-target-heading small{font-size:10px}.tower-ability{min-height:56px;padding:7px 9px 11px;gap:7px}.tower-ability b{font-size:12px}.tower-ability svg{width:24px;height:24px}.tower-ability kbd{display:none}.tower-menu{padding:5%;justify-content:center;gap:8px}.tower-menu h2{font-size:38px;margin:5px 0}.tower-menu p{font-size:11px;margin:5px 0;max-width:230px}.tower-menu .panel-eyebrow{font-size:8px}.tower-menu .play-button{min-height:44px;padding:8px 14px;font-size:11px}.tower-shell .glide-result-card{padding:16px}.tower-shell .glide-result-card h2{font-size:20px}}
@media(any-pointer:coarse){.tower-shell .score-entry input{font-size:16px}.tower-ability kbd{display:none}}
@media(prefers-reduced-motion:reduce){.tower-controls button{transition:none}}

/* Phone workshop: one task at a time, with floors and Battle always in reach.
   Only the active equipment panel scrolls on unusually short screens. */
@media(max-width:600px),(max-height:530px) and (orientation:landscape),(max-width:1024px) and (any-pointer:coarse){
 .tower-workshop-header{min-height:38px;padding:5px 10px;gap:8px}
 .tower-workshop-header h3,.tower-wallet small{display:none}
 #towerSelected{font-size:13px;font-weight:700;color:#295e46}
 .tower-wallet{padding:4px 9px;gap:5px;border-radius:8px;flex-direction:row}
 .tower-wallet::before{content:'🍌';font-size:15px}.tower-wallet strong{font-size:18px}
 .tower-workshop-body{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:44px 44px minmax(0,1fr);gap:6px;padding:5px 8px 7px;overflow:hidden}
 .tower-workshop-body>section{min-height:0}
 .tower-step{display:none}
 .tower-floor-buttons{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));height:44px;gap:3px;padding:0;overflow:visible}
 .tower-floor-card{min-height:44px;height:44px;padding:5px;gap:0;flex-direction:row;border-radius:8px}
 .tower-floor-card b{font-size:18px}.tower-floor-card small{display:none}
 .tower-floor-card[aria-pressed="true"]::after{top:3px;right:5px}
 .tower-mobile-panels{display:grid;grid-template-columns:1fr 1fr;gap:4px;min-width:0;padding:0;border-radius:9px;background:#e8ead4}
 .tower-mobile-panels button{min-height:44px;min-width:0;padding:5px 8px;border:1px solid transparent;border-radius:8px;background:transparent;color:#526947;font-size:12px;font-weight:800;line-height:1.2}
 .tower-mobile-panels button[aria-pressed="true"]{background:#2a7751;border-color:#246443;color:#fff9e5}
 .tower-workshop[data-panel="weapons"] .tower-upgrades-group,.tower-workshop[data-panel="build"] .tower-weapons-group{display:none}
 .tower-weapons-group,.tower-upgrades-group{grid-row:3;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;padding:1px 2px 3px}
 .tower-weapon-options{gap:6px}
 .tower-weapon-card{min-height:80px;padding:5px 4px 18px;gap:3px;border-radius:9px}
 .tower-weapon-card svg{width:38px;height:26px}.tower-weapon-card b{font-size:12px;line-height:1.15}
 .tower-weapon-card small{display:none}.tower-equipped{font-size:9px;bottom:3px}
 .tower-mobile-weapon-hint{display:block;margin:5px 0 0;text-align:center;color:#466b4a;font-size:11px;line-height:1.3}
 .tower-upgrade-benefit{font-size:11px;margin:0 0 6px}
 .tower-purchases{grid-template-columns:1fr 1fr;gap:8px}
 .tower-purchase{min-height:52px;padding:7px 8px;gap:4px}
 .tower-purchase b{font-size:12px}.tower-purchase small{font-size:11px}.tower-purchase>span:last-child{font-size:20px}
 .tower-price{font-size:11px;line-height:1.2;margin-top:5px}
 .tower-workshop-footer{padding:6px 8px;gap:0}.tower-workshop-footer p{display:none}
 #towerBattle{width:100%;min-width:0;min-height:48px;padding:8px 14px;font-size:15px;gap:8px}
 .tower-battle-controls{padding:8px;grid-template-columns:minmax(0,1fr);gap:8px}
 .tower-target-heading{margin-bottom:5px}.tower-target-heading b{font-size:12px}.tower-target-heading small{font-size:10px}
 .tower-enemy-buttons{grid-template-columns:repeat(6,minmax(44px,1fr));gap:4px;padding:0;overflow:visible}
 .tower-enemy-card{min-height:48px;padding:6px 7px 12px;font-size:18px}
 .tower-ability{min-height:58px;padding:8px 9px 12px;gap:7px}.tower-ability b{font-size:13px}.tower-ability small{font-size:11px}
 .tower-abilities>small{font-size:10px}.tower-ability kbd,.tower-targets p{display:none}
 .play-stage .tower-workshop{height:100%;width:100%;overflow:hidden}
 .play-stage .tower-workshop-body{flex:1;min-height:0}
 .play-stage .tower-shell[data-phase="build"] .tower-controls{height:min(330px,55%);max-height:none;display:flex;flex-direction:column;overflow:hidden}
 .play-stage .tower-shell[data-phase="battle"] .tower-controls{max-height:50%;overflow:auto}
 .play-stage .tower-hud{min-height:28px;padding:3px 10px;gap:8px;font-size:10px;flex-wrap:nowrap}
 .play-stage .tower-hud strong{font-size:16px}.play-stage #towerTurn{display:none}
 .play-stage .tower-menu{align-items:center;text-align:center}.play-stage .tower-menu p{max-width:270px}
}
@media(max-width:600px) and (orientation:portrait){.tower-viewport{aspect-ratio:640/680}}
/* Same side dock for building and battling: rotation never puts the controls
   across the arena, and targeting does not require precision taps on the art. */
@media(orientation:landscape) and (max-height:530px),(orientation:landscape) and (max-width:1024px) and (any-pointer:coarse){
 .play-stage .tower-shell[data-mode="playing"],.play-stage .tower-shell[data-mode="paused"]{display:grid;grid-template-columns:minmax(0,1fr) clamp(300px,38vw,340px);grid-template-rows:minmax(0,1fr) 28px}
 .play-stage .tower-viewport{grid-area:1/1;min-width:0;min-height:0;position:relative}
 .play-stage .tower-shell[data-phase] .tower-controls{grid-area:1/2/3/3;height:100%;max-height:none;border-top:0;border-left:1px solid #b9c7a2;min-height:0;min-width:0;overflow:hidden;display:flex;flex-direction:column}
 .play-stage .tower-hud{grid-area:2/1;overflow:hidden}.play-stage #towerIsland{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .play-stage .tower-battle-controls{height:100%;display:flex;flex-direction:column;justify-content:center;overflow:auto;padding:10px;gap:16px}
 .play-stage .tower-targets,.play-stage .tower-abilities{width:100%}
 .play-stage .tower-enemy-buttons{grid-template-columns:repeat(3,minmax(44px,1fr));gap:5px}
 .play-stage .tower-enemy-card{min-height:48px}
 .play-stage .tower-ability{min-height:66px}
 .play-stage .tower-abilities{gap:5px 6px}
 .play-stage .tower-between{margin:auto;padding:10px}
 .play-stage .tower-menu{padding:3% 7%;gap:8px;align-items:flex-start;text-align:left}.play-stage .tower-menu h2{font-size:38px;margin:4px 0}.play-stage .tower-menu p{margin:4px 0}
}
@media(orientation:landscape) and (max-height:380px){
 .play-stage .tower-workshop-header{min-height:32px;padding:3px 8px}
 .play-stage .tower-workshop-body{gap:4px;padding-top:2px;padding-bottom:2px}
 .play-stage .tower-mobile-weapon-hint{display:none}
 .play-stage .tower-workshop-footer{padding:4px 8px}
 .play-stage .tower-battle-controls{gap:8px;padding:8px}
}
