/* Exact ABODEN HERO controls: use the supplied PNG artwork directly. */
#controls{
  position:relative;
  padding:18px 4px 22px;
  gap:18px;
  background:transparent;
}
#controls::before{display:none!important}
#controls>div{display:flex;gap:16px;align-items:center}
.control-hint{display:none!important}

#controls button[data-action]{
  width:96px;
  height:96px;
  min-width:96px;
  padding:0!important;
  border:0!important;
  outline:0;
  border-radius:0!important;
  background-color:transparent!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:contain!important;
  color:transparent!important;
  font-size:0!important;
  line-height:0;
  text-shadow:none!important;
  box-shadow:none!important;
  transform:none!important;
  overflow:visible;
  filter:none;
  transition:transform .07s ease,filter .07s ease;
}
#controls button[data-action]::before,
#controls button[data-action]::after,
#controls button[data-action] small{display:none!important}

#controls button[data-action="left"]{background-image:url('../assets/ui/buttons/left.png')!important}
#controls button[data-action="right"]{background-image:url('../assets/ui/buttons/right.png')!important}
#controls button[data-action="jump"]{background-image:url('../assets/ui/buttons/jump.png')!important}
#controls button[data-action="shoot"]{background-image:url('../assets/ui/buttons/shoot.png')!important}
#controls button[data-action="dash"]{background-image:url('../assets/ui/buttons/dash.png')!important}

#controls button[data-action]:hover{filter:brightness(1.05)}
#controls button[data-action]:active,
#controls button[data-action].held{
  transform:translateY(2px) scale(.95)!important;
  filter:brightness(1.16) saturate(1.08);
}
#controls button[data-action]:focus-visible{
  outline:2px solid #fff!important;
  outline-offset:2px;
}

/* Header utility controls use their individual supplied PNGs. */
.tools{gap:7px}
.tools button{
  width:50px!important;
  height:50px!important;
  min-width:50px;
  padding:0!important;
  border:0!important;
  outline:0;
  border-radius:0!important;
  background-color:transparent!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:contain!important;
  color:transparent!important;
  font-size:0!important;
  text-shadow:none!important;
  box-shadow:none!important;
  transform:none!important;
  transition:transform .07s ease,filter .07s ease;
}
.tools button::before,.tools button::after{display:none!important}
#pause{background-image:url('../assets/ui/buttons/pause.png')!important}
#sound{background-image:url('../assets/ui/buttons/sound.png')!important}
.tools button:hover{filter:brightness(1.06)}
.tools button:active{transform:translateY(1px) scale(.95)!important;filter:brightness(1.15)}
.tools button:focus-visible{outline:2px solid #fff!important;outline-offset:2px}

/* Exact START MISSION artwork supplied by the user. */
.primary{
  width:290px!important;
  height:78px!important;
  min-width:0!important;
  padding:0!important;
  border:0!important;
  outline:0;
  border-radius:0!important;
  background-color:transparent!important;
  background-image:url('../assets/ui/start-mission-exact.png')!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:contain!important;
  color:transparent!important;
  font-size:0!important;
  text-shadow:none!important;
  box-shadow:none!important;
  transform:none!important;
}
.primary::before,.primary::after,.primary span{display:none!important}
.primary:hover{filter:brightness(1.06)}
.primary:active{transform:translateY(2px) scale(.985)!important;filter:brightness(1.13)}
.primary:focus-visible{outline:2px solid #fff!important;outline-offset:2px}

@media(max-width:650px){
  #controls{padding:12px 0 14px;gap:8px}
  #controls>div{gap:6px}
  #controls button[data-action]{width:70px;height:70px;min-width:70px}
  .tools button{width:43px!important;height:43px!important;min-width:43px}
  .primary{width:250px!important;height:67px!important}
}

@media(max-width:430px){
  /* Reserve space for the sound and pause buttons on narrow phones. */
  #hud .health,#hud .progress{width:calc((100vw - 126px)/2)!important;flex:none}
  #controls button[data-action]{width:62px;height:62px;min-width:62px}
  #controls>div{gap:3px}
  .primary{width:225px!important;height:61px!important}
}

/* The action changes after a pause or Chapter 1 victory. Keep its real label visible. */
#overlay:is([data-mode="paused"],[data-mode="won"]) .primary{
  width:min(100%,290px)!important;height:auto!important;min-height:56px;
  aspect-ratio:auto;padding:12px 18px!important;
  background:linear-gradient(180deg,#b92732,#68131a)!important;
  border:1px solid #ff6972!important;border-radius:8px!important;
  color:#fff!important;font-size:16px!important;
}

@media(orientation:landscape) and (max-height:600px){
  #controls{
    inset:auto max(14px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
    padding:0;
  }
  #controls>div{gap:5px}
  #controls button[data-action]{
    width:66px;
    height:66px;
    min-width:66px;
    opacity:.92;
    pointer-events:auto;
  }
  .tools button{width:42px!important;height:42px!important;min-width:42px}
}
