/* Dungeon Runner on a phone: the game's menu, centred while it fits and from the top when it is taller than the screen
   (so its title and tabs can be scrolled to), and the touch pad (phone.js). */
#overlay.show { align-items: flex-start; }
#overlay > .panel { margin-block: auto; }
canvas#game { touch-action: none; }

.dr-pad { position: fixed; left: 0; right: 0; bottom: 96px; height: 150px; z-index: 20; pointer-events: none; user-select: none; -webkit-user-select: none; }
.dr-pad[hidden] { display: none; }
.dr-stick, .dr-b, .dr-pause { pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent; }
.dr-stick { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: 6px; width: 128px; height: 128px; border-radius: 50%;
  background: rgba(233, 228, 242, 0.07); border: 2px solid rgba(233, 228, 242, 0.22); }
.dr-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(232, 193, 90, 0.35); border: 2px solid rgba(232, 193, 90, 0.7); }
.dr-buttons { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: 6px; display: grid; gap: 10px;
  grid-template-columns: auto auto; grid-template-areas: "special potion" "fire fire"; }
.dr-b, .dr-b:hover { font: 700 13px "Segoe UI", system-ui, sans-serif; color: #e9e4f2; letter-spacing: 0.04em; border-radius: 999px; padding: 0;
  width: 64px; height: 44px; background: rgba(34, 29, 51, 0.6); border: 2px solid rgba(154, 147, 171, 0.55); }
.dr-fire, .dr-fire:hover { grid-area: fire; width: 138px; height: 58px; font-size: 16px; color: #241703; background: rgba(232, 193, 90, 0.55); border-color: rgba(243, 216, 136, 0.85); }
.dr-special { grid-area: special; } .dr-potion { grid-area: potion; } .dr-potion, .dr-potion:hover { border-color: rgba(74, 140, 255, 0.7); }
.dr-b.is-down { filter: brightness(1.5); transform: scale(0.95); }
.dr-pause { position: fixed; top: 112px; right: max(12px, env(safe-area-inset-right)); width: 44px; height: 36px; border-radius: 8px; padding: 0;
  font: 700 14px "Segoe UI", system-ui, sans-serif; color: #e9e4f2; background: rgba(18, 15, 28, 0.75); border: 1px solid #4a4166; }
.dr-hint { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); margin: 0; padding: 5px 12px; border-radius: 999px;
  background: rgba(10, 8, 16, 0.8); color: #e8c15a; font: 600 13px "Segoe UI", system-ui, sans-serif; white-space: nowrap; }
.dr-hint[hidden] { display: none; }
@media (max-height: 600px) {   /* a short screen, or the game in its frame on a phone: a smaller pad leaves more dungeon */
  .dr-pad { bottom: 94px; height: 108px; } .dr-stick { width: 100px; height: 100px; } .dr-knob { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .dr-b { width: 56px; height: 36px; font-size: 12px; } .dr-fire { width: 122px; height: 46px; font-size: 15px; } .dr-buttons { gap: 8px; }
  .dr-hint { bottom: 112px; font-size: 12px; } .dr-pause { top: 100px; }
}
