/* 8-way compass — N up, matches in-game world facing */

.pmd-dir-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-template-areas:
    "nw n ne"
    "w hub e"
    "sw s se";
  gap: 5px;
  width: 100%;
  max-width: 168px;
  margin: 0 auto;
  padding: 2px;
  outline: none;
}

.pmd-dir-pad:focus-visible {
  box-shadow: 0 0 0 2px rgba(90, 143, 212, 0.45);
  border-radius: 10px;
}

.pmd-dir-pad__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 4px 2px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: #181c26;
  color: #a8b0be;
  font: 600 10px/1.1 system-ui, sans-serif;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s, transform 0.08s;
}

.pmd-dir-pad__btn:hover {
  border-color: #3d4a62;
  background: #1e2430;
  color: #e8eaed;
}

.pmd-dir-pad__btn.is-active {
  border-color: #5a8fd4;
  background: #1a2840;
  color: #f0f4ff;
  box-shadow: 0 0 0 1px rgba(90, 143, 212, 0.25);
}

.pmd-dir-pad__btn:active {
  transform: scale(0.96);
}

.pmd-dir-pad__arrow {
  display: block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid currentColor;
  opacity: 0.55;
  transform: rotate(var(--pmd-arrow-deg, 0deg));
  transform-origin: 50% 65%;
  transition: opacity 0.12s;
}

.pmd-dir-pad__btn.is-active .pmd-dir-pad__arrow {
  opacity: 1;
  border-bottom-color: #7eb8ff;
}

.pmd-dir-pad__label {
  letter-spacing: 0.02em;
}

.pmd-dir-pad__hub {
  grid-area: hub;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  min-height: 44px;
  pointer-events: none;
}

.pmd-dir-pad__hub-arrow {
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 11px solid rgba(126, 184, 255, 0.85);
  transform: rotate(var(--pmd-arrow-deg, 90deg));
  transform-origin: 50% 65%;
  filter: drop-shadow(0 0 4px rgba(90, 143, 212, 0.35));
}
