/* NPC-Begegnungs-Modal auf der Karte mit vollflächigem Porträt. */
#game-modal.npc-map-modal-shell,
.npc-map-modal-shell {
  --accent: #5f7a3f;
  --accent-light: #79965a;
  --accent-deep: #34461f;
  --accent-ink: #f6f2e4;
  --surface: #12181a;
  --surface-2: #1c2320;
  --ink: #efe9d8;
  --ink-muted: rgba(239, 233, 216, 0.62);
  --line: rgba(226, 211, 177, 0.14);
  width: min(92vw, 520px);
  min-width: 0;
  max-width: calc(100vw - 24px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(226, 211, 177, 0.24);
  border-radius: 20px;
  background: linear-gradient(160deg, #1a221f, #10161a 70%);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.66), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: left;
}

.npc-map-modal-shell #game-modal-content {
  padding: 0;
  margin: 0;
}

.npc-map-modal-shell #game-modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line);
  background: rgba(16, 22, 26, 0.94);
  backdrop-filter: blur(10px);
}

.npc-map-card,
.npc-map-contact {
  display: flex;
  flex-direction: column;
}

/* Quadratisches Porträt mit lesbarem Namen im unteren Bildbereich. */
.npc-map-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, rgba(132, 164, 102, 0.28), transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(115deg, rgba(95, 122, 63, 0.18), rgba(31, 37, 34, 0.5) 60%);
  background-size: auto, 26px 26px, 26px 26px, auto;
}

.npc-map-stage:not(:has(img)) {
  aspect-ratio: auto;
  min-height: 190px;
}

.npc-map-card-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #c4d58e;
  font-size: 4rem;
}

.npc-map-card-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.npc-map-card-copy {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  min-width: 0;
  padding: 60px 22px 22px;
  background: linear-gradient(transparent, rgba(9, 14, 13, 0.84) 58%, rgba(9, 14, 13, 0.96));
  text-shadow: 0 2px 9px rgba(0, 0, 0, 0.8);
}

.npc-map-card h2,
.npc-map-contact h2 {
  margin: 0;
  color: #fff;
  font-family: "Special Elite", cursive;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.npc-map-description {
  margin: 0;
  padding: 16px 20px 0;
  text-align: left;
  color: rgba(239, 233, 216, 0.78);
  font-size: 0.86rem;
  line-height: 1.45;
}

.npc-map-speech {
  position: relative;
  width: 100%;
  margin-top: 16px;
}

.npc-map-speech::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-top: 1px solid rgba(187, 199, 143, 0.55);
  border-left: 1px solid rgba(187, 199, 143, 0.55);
  background: #20352b;
}

.npc-map-response {
  position: relative;
  max-height: clamp(100px, 30vw, 150px);
  margin: 0;
  padding: 14px 16px;
  overflow-y: auto;
  border: 1px solid rgba(187, 199, 143, 0.55);
  border-radius: 15px;
  background: rgba(27, 47, 36, 0.94);
  color: #fff;
  font-family: "Special Elite", cursive;
  font-size: 1rem;
  line-height: 1.55;
  text-shadow: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.17);
}

/* Fakten: Label links mit Icon, Wert rechts, nie umbrechende Labels */
.npc-map-facts {
  margin: 14px 20px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.npc-map-facts div {
  min-height: 40px;
  padding: 6px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.npc-map-facts div:first-child {
  border-top: 0;
}

.npc-map-facts dt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.npc-map-facts dt i {
  color: #c4d58e;
  font-size: 0.9rem;
}

.npc-map-facts dd {
  margin: 0;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
}

.npc-map-actions {
  padding: 16px 20px 6px;
  display: grid;
  gap: 9px;
}

.npc-map-card .npc-map-talk,
.npc-map-card .npc-map-trade {
  display: flex;
  width: 100%;
  min-height: 50px;
  margin: 0;
  font-size: 1rem;
}

/* Kontakt-Ansicht mit Angeboten */
.npc-map-offers {
  margin: 14px 20px 6px;
  display: grid;
  gap: 8px;
}

.npc-map-offers > p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.npc-map-offer {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
}

.npc-map-offer > i {
  font-size: 1.1rem;
  color: #c4d58e;
}

.npc-map-offer span,
.npc-map-offer strong,
.npc-map-offer small {
  display: block;
}

.npc-map-offer strong {
  font-size: 0.9rem;
}

.npc-map-offer small {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

@media (max-width: 520px) {
  .npc-map-card-copy {
    padding: 50px 16px 16px;
  }

  .npc-map-description,
  .npc-map-facts,
  .npc-map-actions,
  .npc-map-offers {
    padding-left: 16px;
    padding-right: 16px;
    margin-left: 0;
    margin-right: 0;
  }

  .npc-map-facts {
    margin: 12px 16px 0;
    padding: 0;
  }

  .npc-map-response {
    padding: 11px 13px;
  }

  .npc-map-offers {
    margin: 12px 16px 6px;
    padding: 0;
  }
}
.npc-map-challenge { margin: 14px 0; padding: 14px; border: 1px solid rgba(187,199,143,.25); border-radius: 12px; background: rgba(187,199,143,.07); }
.npc-map-challenge h3 { margin: 0 0 8px; color: #bbc78f; font-size: 1rem; }
.npc-map-challenge p { margin: 0 0 8px; }
.npc-map-challenge ul { margin: 8px 0 12px; padding-left: 20px; }
.npc-map-challenge .npc-map-offer { width: 100%; }
