.swamp-exploration-view {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #031011;
}

.swamp-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
  background: #031011;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.swamp-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1536px;
  height: 1024px;
  transform-origin: 0 0;
  background: url("../../assets/world/mokradla-world.webp") center/100% 100% no-repeat;
  box-shadow: inset 0 0 120px #000d;
  will-change: transform;
}

.swamp-world::after {
  content: "";
  position: absolute;
  z-index: 70;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 80px #010708e6;
}

.swamp-walker {
  position: absolute;
  z-index: 30;
  left: 285px;
  top: 900px;
  width: 72px;
  height: 108px;
  transform: translate(-50%, -88%);
  transform-origin: 50% 88%;
  pointer-events: none;
  will-change: left, top, transform;
}

.swamp-walker > img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(.88) saturate(.82) drop-shadow(0 9px 6px #000c);
}
.swamp-walker.facing-left > img { transform: scaleX(-1); }
.swamp-walker.walking > img { animation: forest-step .34s ease-in-out infinite alternate; }
.swamp-walker.interacting > img { animation: forest-look .55s ease-in-out; }

.swamp-walker-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 4px;
  width: 45px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #020506b8;
  filter: blur(2px);
}

.swamp-companion {
  position: absolute;
  z-index: 3;
  left: -60px;
  bottom: -3px;
  width: 66px;
  height: 66px;
}
.swamp-companion img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 7px 5px #000b); }
.swamp-walker.walking .swamp-companion { animation: forest-companion-step .42s ease-in-out infinite alternate; }

.swamp-hotspot,
.swamp-gate,
.swamp-cave,
.swamp-stranger {
  position: absolute;
  z-index: 22;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #e9f5e4;
  cursor: pointer;
}

.swamp-hotspot i,
.swamp-gate i,
.swamp-cave i {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 27px;
  height: 27px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 1px solid #a8c69dbb;
  border-radius: 50%;
  background: #071918df;
  box-shadow: 0 0 0 7px #8eb59a18, 0 0 20px #8dc8ae66;
  transition: .18s transform, .18s box-shadow, .18s background;
}
.swamp-hotspot i::before { content: attr(data-number); }
.swamp-hotspot i::after { content: "✦"; color: #c9e2a4; font-size: .78rem; }
.swamp-hotspot.runic i { border-color: #6ddbea; background: #07303ae8; box-shadow: 0 0 0 8px #31c9dd1c, 0 0 25px #49d9ed9c; }
.swamp-hotspot.runic i::after { color: #91f0ff; text-shadow: 0 0 8px #48dcec; }
.swamp-hotspot.legendary-habitat { z-index: 29; }
.swamp-hotspot.legendary-habitat i {
  width: 38px;
  height: 38px;
  border: 2px solid #f2d06d;
  background: radial-gradient(circle, #6b5419, #15281d 68%);
  box-shadow: 0 0 0 9px #ebc94a20, 0 0 34px #f0c83fbf;
  animation: legendary-habitat-pulse 1.7s ease-in-out infinite alternate;
}
.swamp-hotspot.legendary-habitat i::before { content: "🌱"; font-size: 1rem; }
.swamp-hotspot.legendary-habitat i::after { content: "✦"; position: absolute; right: -7px; top: -9px; color: #fff1a3; text-shadow: 0 0 9px #fff0a0; }
.swamp-gate i::before { content: "➤"; color: #d5e6b1; font-size: .9rem; }
.swamp-return-gate { left: 245px; top: 940px; }
.swamp-next-gate { left: 900px; top: 55px; }
.swamp-next-gate.locked i::before { content: "◆"; color: #72827a; }
.swamp-next-gate.locked i { border-color: #65736b88; box-shadow: none; filter: grayscale(1); }
.swamp-cave { left: 520px; top: 355px; }
.swamp-cave i::before { content: "🔒"; font-size: .78rem; }
.swamp-cave.open i::before { content: "◇"; color: #e2d08d; }
.swamp-cave.open i { border-color: #e0c46f; box-shadow: 0 0 25px #d9b54c78; }

.swamp-stranger { left: 605px; top: 355px; width: 92px; height: 132px; transform: translate(-50%, -72%); }
.swamp-stranger img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: brightness(.88) saturate(.84) drop-shadow(0 9px 7px #000d);
  transition: transform .18s, filter .18s;
}
.swamp-stranger:hover img,
.swamp-stranger:focus-visible img { transform: scale(1.07); filter: brightness(1) saturate(.95) drop-shadow(0 10px 9px #000e); }

.swamp-hotspot span,
.swamp-gate span,
.swamp-cave span,
.swamp-stranger span {
  position: absolute;
  left: 50%;
  bottom: -14px;
  min-width: max-content;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  border: 1px solid #91a78a66;
  border-radius: 8px;
  background: #041312ef;
  color: #edf5df;
  padding: 5px 8px;
  box-shadow: 0 5px 15px #000a;
  font-size: .64rem;
  font-weight: 900;
  pointer-events: none;
  transition: .18s opacity, .18s transform;
}
.swamp-hotspot b,
.swamp-gate b,
.swamp-cave b { position: absolute; left: 50%; top: 64px; min-width: max-content; transform: translateX(-50%); color: #8fa099; font-size: .48rem; letter-spacing: .08em; pointer-events: none; }
.swamp-hotspot.legendary-habitat b { color: #d5b96e; text-shadow: 0 0 8px #c69d3d; }

.swamp-hotspot:hover i,
.swamp-hotspot:focus-visible i,
.swamp-gate:hover i,
.swamp-gate:focus-visible i,
.swamp-cave:hover i,
.swamp-cave:focus-visible i { transform: translate(-50%, -50%) scale(1.2); background: #174537ed; box-shadow: 0 0 0 11px #9dd49a20, 0 0 29px #9ce0b59c; }
.swamp-hotspot:hover span,
.swamp-hotspot:focus-visible span,
.swamp-gate:hover span,
.swamp-gate:focus-visible span,
.swamp-cave:hover span,
.swamp-cave:focus-visible span,
.swamp-stranger:hover span,
.swamp-stranger:focus-visible span { opacity: 1; transform: translateX(-50%) translateY(0); }
.swamp-hotspot.used i { border-color: #6a777188; background: #14211edd; box-shadow: none; filter: grayscale(1); opacity: .5; }
.swamp-hotspot.used i::after { content: "✓"; color: #a9b4ac; }
.swamp-hotspot.targeted i,
.swamp-gate.targeted i,
.swamp-cave.targeted i { animation: forest-target 1s ease-in-out infinite; }
.swamp-hotspot.searching i { animation: forest-search .55s ease-in-out infinite alternate; }

.swamp-key-status {
  position: absolute;
  z-index: 92;
  right: 18px;
  top: 64px;
  min-width: 170px;
  border: 1px solid #78928866;
  border-radius: 13px;
  background: #041312e8;
  color: #e9f1df;
  padding: 9px 12px;
  box-shadow: 0 8px 24px #0009;
  backdrop-filter: blur(7px);
}
.swamp-key-status > span { display: block; color: #a8b9aa; font-size: .52rem; font-weight: 1000; letter-spacing: .12em; }
.swamp-key-status div { display: inline-flex; gap: 5px; margin-top: 6px; }
.swamp-key-status i { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #64736c; border-radius: 6px; color: #77847e; font-size: .62rem; font-style: normal; font-weight: 1000; }
.swamp-key-status i.found { border-color: #d0b45f; background: #6f5a1f77; color: #fff0a8; box-shadow: 0 0 12px #d6b64c55; }
.swamp-key-status strong { float: right; margin: 10px 0 0 10px; color: #d6bd6d; font-size: .72rem; }

.swamp-help {
  position: absolute;
  z-index: 88;
  left: 18px;
  bottom: 70px;
  display: grid;
  max-width: 330px;
  border: 1px solid #78928855;
  border-radius: 12px;
  background: #041312dd;
  color: #edf3e6;
  padding: 9px 12px;
  box-shadow: 0 7px 24px #0008;
  pointer-events: none;
}
.swamp-help strong { color: #9fd0af; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.swamp-help span { margin-top: 2px; font-size: .72rem; font-weight: 900; }
.swamp-help small { margin-top: 3px; color: #91a39b; font-size: .61rem; }

.swamp-minimap {
  position: absolute;
  z-index: 87;
  right: 18px;
  bottom: 70px;
  width: 144px;
  height: 96px;
  overflow: hidden;
  border: 1px solid #7e999077;
  border-radius: 11px;
  background: url("../../assets/world/mokradla-world.webp") center/cover no-repeat;
  box-shadow: 0 8px 25px #0009, inset 0 0 18px #000b;
  pointer-events: none;
}
.swamp-minimap::after { content: "MOKRADŁA"; position: absolute; left: 6px; top: 5px; color: #a9cfb7; font-size: .46rem; font-weight: 1000; letter-spacing: .1em; }
.swamp-minimap span { position: absolute; width: 8px; height: 8px; transform: translate(-50%, -50%); border: 2px solid white; border-radius: 50%; background: #55ad91; box-shadow: 0 0 10px #82e1c3; }
.swamp-touch-controls { display: none; }
.swamp-location-chip { border-color: #6f9687; color: #cde6d7; }
#swamp-view .swamp-live-message { z-index: 96; pointer-events: none; }

@keyframes legendary-habitat-pulse {
  to { box-shadow: 0 0 0 13px #ebc94a12, 0 0 46px #f0c83fe8; filter: brightness(1.18); }
}

@media (max-width: 800px) {
  .swamp-key-status { right: 8px; top: 55px; min-width: 132px; padding: 7px 9px; }
  .swamp-key-status i { width: 20px; height: 20px; }
  .swamp-key-status strong { margin-top: 8px; }
  .swamp-help { left: 8px; bottom: 56px; max-width: 230px; padding: 7px 9px; }
  .swamp-help small { display: none; }
  .swamp-minimap { right: 8px; bottom: 56px; width: 108px; height: 72px; }
  .swamp-hotspot span,
  .swamp-gate span,
  .swamp-cave span,
  .swamp-stranger span { display: none; }
}

@media (pointer: coarse) and (max-width: 800px) {
  .swamp-touch-controls { position: absolute; z-index: 94; right: 12px; bottom: 145px; display: grid; grid-template-columns: repeat(3, 38px); grid-template-rows: repeat(2, 38px); gap: 4px; }
  .swamp-touch-controls button { border: 1px solid #8aa09477; border-radius: 9px; background: #061815d9; color: #dbe9de; font-weight: 1000; touch-action: none; }
  .swamp-touch-controls button:first-child { grid-column: 2; }
  .swamp-touch-controls button:nth-child(2) { grid-column: 1; grid-row: 2; }
  .swamp-touch-controls button:nth-child(3) { grid-column: 2; grid-row: 2; }
  .swamp-touch-controls button:nth-child(4) { grid-column: 3; grid-row: 2; }
}


/* v0.0.77 points1 — dokładne centrowanie symboli punktów Mokradeł */
.swamp-hotspot:not(.legendary-habitat) i::after {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 1em;
  height: 1em;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -50%);
  transform-origin: center;
}

/* Ziarenko Wielkiego Drzewa również siedzi idealnie w centrum głównego okręgu.
   Mała gwiazdka przy legendary-habitat zostaje osobnym akcentem w prawym górnym rogu. */
.swamp-hotspot.legendary-habitat i::before {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  line-height: 1;
  transform: translate(-50%, -50%);
}


/* v0.0.77 npc1 — Nieznajomy przy Starej Jaskini */
.swamp-stranger {
  left: 620px;
  top: 370px;
  width: 112px;
  height: 160px;
  z-index: 76;
  transform: translate(-50%, -78%);
}
.swamp-stranger img {
  filter: brightness(1.02) saturate(.9) drop-shadow(0 10px 8px #000e);
}
.swamp-stranger::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 62px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #0008;
  filter: blur(4px);
  z-index: -1;
}
.swamp-stranger span {
  bottom: -7px;
}

.swamp-dialog-backdrop {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #010706b8;
  backdrop-filter: blur(3px);
}
.swamp-dialog-backdrop[hidden] { display: none !important; }

.swamp-dialog-card {
  width: min(760px, 94vw);
  border: 1px solid #8da67a88;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 0%, #28402b55, transparent 40%),
    linear-gradient(145deg, #071713f8, #0c1d17fa);
  box-shadow: 0 24px 80px #000d, inset 0 0 45px #35542a18;
  overflow: hidden;
  color: #edf1df;
}
.swamp-dialog-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #879b6d44;
  background: #0c1b15e8;
}
.swamp-dialog-head img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 6px 5px #000b);
}
.swamp-dialog-head div { min-width: 0; }
.swamp-dialog-kicker {
  display: block;
  margin-bottom: 3px;
  color: #c9ae65;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.swamp-dialog-speaker {
  margin: 0;
  color: #fff7df;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}
.swamp-dialog-body {
  min-height: 135px;
  padding: 24px 24px 12px;
}
.swamp-dialog-line {
  margin: 0;
  color: #eef2e7;
  font-size: clamp(1rem, 2.5vw, 1.18rem);
  line-height: 1.55;
}
.swamp-dialog-line.player { color: #d8c779; }
.swamp-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
}
.swamp-dialog-actions button {
  min-width: 120px;
  border: 1px solid #c4aa5c99;
  border-radius: 12px;
  padding: 11px 18px;
  background: #1a2a21;
  color: #f4eed9;
  font-weight: 900;
  cursor: pointer;
}
.swamp-dialog-actions button:hover,
.swamp-dialog-actions button:focus-visible {
  background: #304331;
  outline: 2px solid #d6bc6c55;
}
@media (max-width: 720px) {
  .swamp-dialog-card { width: min(94vw, 620px); }
  .swamp-dialog-head { padding: 14px 15px; }
  .swamp-dialog-head img { width: 58px; height: 58px; }
  .swamp-dialog-body { min-height: 120px; padding: 20px 17px 10px; }
  .swamp-dialog-actions { padding: 12px 16px 16px; }
}
