/* Phones: the HUD becomes a compact overlay and touch controls appear.
   .is-mobile is set on <body> by js/main.js */

.touch-controls { display: none; }

.is-mobile {
  --btn: clamp(40px, 15vh, 60px);
  --dpad-right: 4vw;
  --dpad-bottom: 4vh;
}

.is-mobile .game-layout { padding: 2.5vh 8px; }

.is-mobile .hud {
  position: fixed;
  top: 2.5vh;
  right: 8px;
  width: min(30vw, 240px);
  padding: 10px;
  gap: 6px;
  max-height: 52vh;
  opacity: .92;
}
.is-mobile .meter { height: 16px; }
.is-mobile .hud__stat { gap: 2px; }
.is-mobile .hud__name { font-size: .9rem; }
.is-mobile .moves { gap: 4px; padding-top: 8px; }
.is-mobile .move-card:not(.is-current) { display: none; }
.is-mobile .move-card .meter { display: none; }

.is-mobile .touch-controls {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.is-mobile .touch-controls > * { pointer-events: auto; }

.touch-btn {
  position: fixed;
  width: var(--btn);
  height: var(--btn);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--btn) * .4);
  color: var(--gold-bright);
  background: rgba(27, 21, 16, .72);
  border: 2px solid var(--border-gold);
  border-radius: 50%;
  -webkit-user-select: none;
  user-select: none;
}
.touch-btn:active { background: rgba(217, 164, 65, .45); }

.touch-btn--up    { right: calc(var(--dpad-right) + var(--btn));     bottom: calc(var(--dpad-bottom) + var(--btn) * 2); }
.touch-btn--left  { right: calc(var(--dpad-right) + var(--btn) * 2); bottom: calc(var(--dpad-bottom) + var(--btn)); }
.touch-btn--right { right: var(--dpad-right);                        bottom: calc(var(--dpad-bottom) + var(--btn)); }
.touch-btn--down  { right: calc(var(--dpad-right) + var(--btn));     bottom: var(--dpad-bottom); }

.touch-btn--shoot  { left: 4vw; bottom: 6vh; border-color: var(--hp-light); color: var(--hp-light); }
.touch-btn--toggle { left: 4vw; bottom: calc(6vh + var(--btn) + 12px); border-color: #e0802a; color: #e0802a; }

/* "Tap to travel / talk" button floats above or below the player */
.interact-btn {
  position: fixed;
  left: 25%;
  width: 30%;
  height: 15%;
  padding: 0 12px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #1a1108;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: 1px solid var(--gold-bright);
  border-radius: 12px;
  pointer-events: auto;
}
.interact-btn--top { bottom: 85%; }
.interact-btn--bottom { top: 85%; }
