/* ── Touch HUD — only shown on touch devices ── */

#touch-hud {
  display: none; /* shown by JS when touch detected */
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

/* Joystick area — left half of screen */
#joy-area {
  position: absolute;
  left: 0; top: 0;
  width: 50%; height: 100%;
  pointer-events: auto;
  touch-action: none;
}

/* Joystick base (appears on touch) */
#joy-base {
  display: none;
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(255, 232, 31, .35);
  background: rgba(0, 0, 0, .25);
}

/* Joystick knob */
#joy-knob {
  position: absolute;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 232, 31, .55);
  border: 2px solid rgba(255, 232, 31, .8);
  box-shadow: 0 0 12px rgba(255, 232, 31, .3);
  transform: translate(-50%, -50%);
  top: 50%; left: 50%;
}

/* Look area — right half of screen */
#look-area {
  position: absolute;
  right: 0; top: 0;
  width: 50%; height: 60%;
  pointer-events: auto;
  touch-action: none;
}

/* ── Touch buttons ── */
.touch-btn {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  border: 2px solid rgba(255, 232, 31, .4);
  border-radius: 10px;
  background: rgba(0, 0, 0, .45);
  color: #ffe81f;
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  font-weight: bold;
  letter-spacing: .05em;
  text-align: center;
  padding: 0;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-btn.pressed,
.touch-btn:active {
  background: rgba(255, 232, 31, .2);
  border-color: #ffe81f;
  box-shadow: 0 0 15px rgba(255, 232, 31, .3);
}

/* Fire — top-right action, prominent */
.tb-fire {
  right: 1.2rem;
  bottom: 14rem;
  width: 72px; height: 72px;
  border-radius: 50%;
  font-size: .65rem;
  border-color: rgba(255, 34, 0, .6);
  color: #ff4422;
  background: rgba(255, 20, 0, .12);
}
.tb-fire.pressed, .tb-fire:active {
  background: rgba(255, 34, 0, .35);
  border-color: #ff2200;
  box-shadow: 0 0 20px rgba(255, 34, 0, .5);
}

/* Jump — bottom right, large */
.tb-jump {
  right: 1.2rem;
  bottom: 10rem;
  width: 72px; height: 72px;
  border-radius: 50%;
  font-size: .65rem;
}

/* Mine — middle right */
.tb-mine {
  right: 5.5rem;
  bottom: 6rem;
  width: 66px; height: 50px;
}

/* Place — far right */
.tb-place {
  right: 1.2rem;
  bottom: 5.5rem;
  width: 66px; height: 50px;
}

/* Block selectors — bottom center-left */
.tb-prev {
  left: 1rem;
  bottom: 5.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1rem;
}
.tb-next {
  left: 4rem;
  bottom: 5.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1rem;
}

/* ── Responsive adjustments for small screens ── */
@media (max-width: 600px) {
  /* Shrink HUD elements */
  #st { font-size: .6rem; }
  #mm { width: 70px; height: 70px; }
  #cp { font-size: .9rem; right: 6rem; }
  #hb { bottom: 1rem; gap: 3px; }
  .sl { width: 40px; height: 40px; }
  .sl .sw { width: 20px; height: 20px; }
  .sl .k { font-size: .45rem; }
  #hint { display: none; }

  /* Move touch buttons for smaller screen */
  .tb-fire { right: .8rem; bottom: 12rem; width: 60px; height: 60px; font-size: .58rem; }
  .tb-jump { right: .8rem; bottom: 8rem; width: 60px; height: 60px; }
  .tb-mine { right: 4.5rem; bottom: 5rem; width: 56px; height: 42px; font-size: .6rem; }
  .tb-place { right: .8rem; bottom: 4.5rem; width: 56px; height: 42px; font-size: .6rem; }
  .tb-prev { bottom: 4.5rem; width: 38px; height: 38px; }
  .tb-next { bottom: 4.5rem; width: 38px; height: 38px; }
}

/* ── Adjust pause overlay ── */
.paus-hint {
  color: #888;
  font-size: .8rem;
  margin-top: .6rem;
  letter-spacing: .15em;
}
