* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: #000000;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  user-select: none;
}

#asciiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
  touch-action: none;
  cursor: grab;
}

#asciiCanvas:active {
  cursor: grabbing;
}

.walk-prompt,
.tour-hud {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(14px);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.walk-prompt {
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 215, 110, 0.72);
  background: rgba(16, 14, 10, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ffe999;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(255, 210, 72, 0.3);
}

.walk-prompt.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.walk-prompt:hover {
  border-color: rgba(255, 225, 135, 0.85);
  background: rgba(20, 16, 10, 0.9);
}

.walk-prompt:active {
  transform: translateX(-50%) scale(0.96);
}

.tour-hud {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: transparent;
  border: none;
}

.tour-hud.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.tour-btn {
  min-height: 36px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 10, 12, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.14s ease, border-color 0.16s ease;
}

.tour-btn:active {
  transform: scale(0.95);
}

.tour-btn.exit {
  border-color: rgba(255, 95, 110, 0.58);
  color: #ff99a4;
  box-shadow: 0 0 18px rgba(255, 75, 95, 0.18);
}

.joy-pad {
  display: none;
  position: fixed;
  left: calc(18px + env(safe-area-inset-left));
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(14, 14, 18, 0.36);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  touch-action: none;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.joy-pad.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: rgba(255, 222, 128, 0.45);
  border: 1.5px solid rgba(255, 235, 175, 0.85);
  box-shadow: 0 0 12px rgba(255, 210, 80, 0.22);
  pointer-events: none;
  transition: background-color 0.14s ease;
}

.joy-pad.active .joy-knob {
  background: rgba(255, 225, 130, 0.78);
}

@media (pointer: coarse), (max-width: 900px) {
  .joy-pad {
    display: block;
  }
}

@media (max-width: 420px) {
  .walk-prompt {
    font-size: 12px;
    padding: 10px 16px;
  }
  .tour-btn {
    padding: 7px 16px;
    font-size: 11.5px;
  }
}
