/* Focus controls: show only what is useful right now */
.action.notarget{display:none}                       /* freeze / smoke / mud only appear when someone is in range */
body.autoassist #chestBtn{display:none} /* auto-help already opens timed chests */
.actions{grid-template-columns:repeat(auto-fit,minmax(64px,1fr))!important}
.action.dig{min-height:64px;font-size:1.05em}
.action.cooling{opacity:.55}
@media(max-width:700px){
  .hudbtns .small{padding:6px 9px}
  .hudbtns .small{font-size:0}                         /* icon only on phones */
  .hudbtns .small .ic{margin:0;width:22px;height:22px}
}
body.lastmin #timeLeft{color:#ffb347}
body.last10 #timeLeft{color:#ff5a4d;animation:lastpulse .6s ease-in-out infinite alternate}
@keyframes lastpulse{to{transform:scale(1.25)}}

/* Upgrade picker pop-up (does not pause or block the game) */
.canvaswrap{position:relative}
.uppick{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:30;width:min(94%,430px);background:linear-gradient(180deg,#5a3b22f5,#3e2916f5);border:3px solid #ffd45b;border-radius:16px;padding:8px 10px 6px;box-shadow:0 8px 24px #000a;animation:uppop .25s ease-out}
.uppick.hidden{display:none}
@keyframes uppop{from{transform:translate(-50%,24px);opacity:0}}
.uphead{display:flex;justify-content:space-between;align-items:center;color:#ffe9a8;font-size:14px;margin-bottom:6px}
.upx{background:none;border:0;color:#ffe9a8;font-size:16px;padding:2px 8px;min-height:0}
.upcards{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.upcard{position:relative;display:flex;flex-direction:column;align-items:center;gap:1px;padding:8px 4px 6px;min-height:92px;border-radius:12px;background:linear-gradient(180deg,#4f7090,#2f4d69);border:2px solid #86b0d4;color:#fff}
.upcard:active{transform:scale(.95)}
.upcard img{width:34px;height:34px;object-fit:contain}
.upcard b{font-size:12px;line-height:1.2}
.upcard small{font-size:10px;opacity:.85;line-height:1.2}
.upcost{display:flex;align-items:center;gap:3px;font-weight:900;font-size:13px;color:#9be7ff}
.upcost img{width:15px;height:15px}
.upcard em{position:absolute;top:2px;left:5px;font-size:10px;opacity:.6;font-style:normal}
.upbar{height:4px;background:#0006;border-radius:3px;margin-top:6px;overflow:hidden}
.upbar i{display:block;height:100%;background:#ffd45b;transform-origin:left}
@keyframes upcount{from{transform:scaleX(1)}to{transform:scaleX(0)}}
.upoff{background:none;border:0;color:#ffe9a8aa;font-size:10px;padding:2px;min-height:0;display:block;margin:2px auto 0}

/* Declutter: one slim HUD row on phones, pop-up floats above the controls */
@media(max-width:700px){
  body.ingame .hud{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:4px!important;padding:4px 6px!important;border-width:2px!important;border-radius:14px!important}
  body.ingame .hud small{display:none!important}
  body.ingame .hud .stat{flex:1 1 0!important;min-width:0!important;gap:4px!important;padding:0 2px!important}
  body.ingame .hud .stat img{width:22px!important;height:22px!important}
  body.ingame .hud b{font-size:15px!important}
  body.ingame .hud .stat.rank{display:none!important}
  body.ingame .hud .stat.score img{display:none!important}
  body.ingame .hudbtns{display:flex!important;flex:0 0 auto!important;gap:4px!important;margin:0!important;grid-template-columns:none!important;width:auto!important}
  body.ingame .hudbtns .small{width:34px!important;height:34px!important;min-height:0!important;padding:0!important;display:flex!important;align-items:center;justify-content:center;position:relative}
  body.ingame .hudbtns .small .ic{width:20px!important;height:20px!important;margin:0!important}
  body.ingame .controls{padding:8px 10px!important;border-width:2px!important}
  .uppick{position:fixed;bottom:calc(var(--ctl-h,168px) + 14px)}
}
.uppick{animation:none}

/* Side panel: compact, no shop */
#sidePanel [data-g="none"]{display:none!important}
#sidePanel .sheethead{display:none}
@media(max-width:700px){#sidePanel .sheethead{display:flex}}
@media(min-width:701px){body.ingame .controls{width:fit-content;justify-self:center;max-width:100%}}
#shopDot{display:none!important}

/* Short or narrow screens (small phones, phones in landscape): compact pop-up and HUD */
@media(max-height:700px),(max-width:400px){
  .upcard{min-height:62px;padding:4px 2px;gap:0}
  .upcard small{display:none}
  .upcard img{width:26px;height:26px}
  .upcard b{font-size:11px}
  .uphead{margin-bottom:3px;font-size:12px}
  .uppick{padding:5px 8px 4px}
  .upoff{display:none}
  .upbar{margin-top:3px}
}
@media(max-width:400px){
  body.ingame .hud .stat.crys img{display:none!important}
  body.ingame .hudbtns{gap:3px!important}
  body.ingame .hudbtns .small{width:30px!important;height:30px!important}
  body.ingame .hud b{font-size:14px!important}
}
@media(orientation:landscape) and (max-height:500px){
  .uppick{width:min(62%,430px);bottom:6px!important}
}
@media(max-width:400px){
  body.ingame .hudbtns .small{width:27px!important;height:27px!important}
  body.ingame .hudbtns .small .ic{width:17px!important;height:17px!important}
  body.ingame .hud .stat{flex:0 1 auto!important;white-space:nowrap}
  body.ingame .hud .stat.time{flex:1 0 auto!important}
  body.ingame .hud b{font-size:13px!important}
}
