/* ── Persistent avatar + dialogue ────────────────────────────────── */

.avatar-wrap {
  position: fixed;
  bottom: 3.5rem;
  right: 2%;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  z-index: 150;
}

/* RPG dark panel with pixel border and right-pointing tail */
.avatar-dialogue {
  position: relative;
  background: #100e20;
  border: 2px solid #4840a0;
  box-shadow:
    inset 2px 2px 0 0 #6860c0,
    inset -2px -2px 0 0 #08061a;
  color: #c8d8f8;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.67rem;
  line-height: 1.75;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  padding: 10px 14px;
  max-width: 200px;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  image-rendering: pixelated;
}

/* Right-pointing tail toward the avatar */
.avatar-dialogue::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left: 8px solid #4840a0;
}

.avatar-dialogue.visible {
  opacity: 1;
  transform: translateX(0);
}

.avatar-badge-img {
  width: 134px;
  height: 178px;
  height: auto;
  image-rendering: pixelated;
  transition: transform 0.12s ease;
  display: block;
}

.avatar-wrap:hover .avatar-badge-img {
  transform: scale(1.08);
}

.avatar-link {
  text-decoration: none;
  display: block;
}

/* ── Bottom-left HUD (help + home) — pixel-art icon buttons ─────── */

.hud-left {
  position: fixed;
  bottom: 3.5rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 150;
}

.hud-btn {
  width: 34px;
  height: 34px;
  background: #100e20;
  color: #a8c0f8;
  border: 2px solid #4840a0;
  box-shadow:
    inset 2px 2px 0 0 #6860c0,
    inset -2px -2px 0 0 #08061a,
    0 2px 0 0 #08061a;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.1s ease, transform 0.07s ease, box-shadow 0.07s ease;
  line-height: 1;
  image-rendering: pixelated;
}

.hud-btn:hover {
  filter: brightness(1.25);
  box-shadow:
    inset 2px 2px 0 0 #6860c0,
    inset -2px -2px 0 0 #08061a,
    0 2px 0 0 #08061a,
    0 0 10px rgba(100, 120, 240, 0.5);
}

.hud-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 2px 2px 0 0 #6860c0,
    inset -2px -2px 0 0 #08061a,
    0 0 0 0 #08061a;
}

/* ── Help modal — RPG inventory panel ──────────────────────────────── */

.help-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 26, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.help-modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.help-modal {
  background: #0e0c1e;
  border: 3px solid #4840a0;
  box-shadow:
    inset 3px 3px 0 0 #6860c0,
    inset -3px -3px 0 0 #08061a,
    0 12px 32px rgba(0, 0, 0, 0.7);
  color: #c8d8f8;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.72rem;
  line-height: 1.85;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  padding: 0 0 1.5rem;
  max-width: 360px;
  width: 90%;
  position: relative;
  overflow: hidden;
  image-rendering: pixelated;
}

/* Title bar strip */
.help-modal h2 {
  background: #3830a0;
  color: #f0ecff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.6rem 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 0 0 #08061a;
}

.help-modal p {
  padding: 0 1.5rem;
}

.help-modal p + p {
  margin-top: 0.6rem;
}

.help-modal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #c8d8f8;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.12s ease;
  line-height: 1;
}

.help-modal-close:hover {
  opacity: 1;
}
