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

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

.forest-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 2000px;
  height: 1125px;
  transform-origin: 0 0;
  background: url("../../assets/world/polana-pierwszych-world-v2.webp") center/100% 100% no-repeat;
  box-shadow: inset 0 0 130px #000b;
  will-change: transform;
}

.forest-world::after {
  content: "";
  position: absolute;
  z-index: 70;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px #020806d9;
}

.forest-walker {
  position: absolute;
  z-index: 30;
  left: 390px;
  top: 915px;
  width: 78px;
  height: 117px;
  transform: translate(-50%, -88%);
  transform-origin: 50% 88%;
  pointer-events: none;
  will-change: left, top, transform;
}

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

.forest-walker-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 4px;
  width: 47px;
  height: 15px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #0205039c;
  filter: blur(2px);
}

.forest-companion {
  position: absolute;
  z-index: 3;
  left: -62px;
  bottom: -3px;
  width: 68px;
  height: 68px;
  transition: transform .2s ease;
}

.forest-companion img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 5px #000a);
}

.forest-walker.walking .forest-companion { animation: forest-companion-step .42s ease-in-out infinite alternate; }

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

.forest-hotspot i,
.forest-gate i {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 25px;
  height: 25px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 1px solid #ead17dbb;
  border-radius: 50%;
  background: #0a1b13d9;
  box-shadow: 0 0 0 7px #e8c75f17, 0 0 20px #ead16f80;
  transition: .18s transform, .18s box-shadow, .18s background;
}

.forest-hotspot i::before { content: "✦"; color: #f1d36d; font-size: .78rem; }
.forest-gate i::before { content: "⌂"; color: #f1d36d; font-size: .86rem; }
.forest-swamp-gate i::before { content: "➜"; }
.forest-swamp-gate b {
  position: absolute;
  left: 50%;
  top: 67px;
  min-width: max-content;
  transform: translateX(-50%);
  color: #8e9891;
  font-size: .48rem;
  letter-spacing: .08em;
  pointer-events: none;
}
.forest-swamp-gate.unlocked b { color: #d9c46f; text-shadow: 0 0 9px #d0ae43; }
.forest-swamp-gate:not(.unlocked) i { border-color: #717a7488; box-shadow: none; filter: grayscale(1); }

.forest-hotspot span,
.forest-gate span {
  position: absolute;
  left: 50%;
  bottom: -15px;
  min-width: max-content;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  border: 1px solid #b9aa7f77;
  border-radius: 8px;
  background: #07130deb;
  color: #f5ecd7;
  padding: 5px 8px;
  box-shadow: 0 5px 15px #0009;
  font-size: .66rem;
  font-weight: 900;
  pointer-events: none;
  transition: .18s opacity, .18s transform;
}

.forest-hotspot:hover i,
.forest-hotspot:focus-visible i,
.forest-gate:hover i,
.forest-gate:focus-visible i {
  transform: translate(-50%, -50%) scale(1.2);
  background: #654d18ed;
  box-shadow: 0 0 0 11px #e8c75f24, 0 0 29px #f1d36dbd;
}

.forest-hotspot:hover span,
.forest-hotspot:focus-visible span,
.forest-gate:hover span,
.forest-gate:focus-visible span {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.forest-hotspot.used i {
  border-color: #74807888;
  background: #17221ddd;
  box-shadow: none;
  filter: grayscale(1);
  opacity: .48;
}
.forest-hotspot.used i::before { content: "✓"; color: #a9b4ac; }
.forest-hotspot.targeted i { animation: forest-target 1s ease-in-out infinite; }
.forest-hotspot.searching i { animation: forest-search .55s ease-in-out infinite alternate; }

.forest-roster-toggle {
  position: absolute;
  z-index: 92;
  right: 18px;
  top: 64px;
  border: 1px solid #b9aa7f66;
  border-radius: 11px;
  background: #07130de8;
  color: #f4ecd7;
  padding: 9px 12px;
  box-shadow: 0 8px 24px #0008;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}
.forest-roster-toggle b { margin-left: 6px; color: #e0c66e; }

.forest-roster {
  position: absolute;
  z-index: 91;
  right: 18px;
  top: 108px;
  width: min(390px, calc(100vw - 36px));
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid #b9aa7f66;
  border-radius: 16px;
  background: #07130df2;
  color: #f4ecd7;
  padding: 13px;
  box-shadow: 0 16px 45px #000b;
  backdrop-filter: blur(8px);
  transition: .2s opacity, .2s transform;
}
.forest-roster.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.forest-roster h3 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 1rem; }
.forest-roster > p { margin: 0 0 10px; color: #aab8af; font-size: .67rem; }
.forest-roster-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.forest-roster-entry { min-width: 0; text-align: center; }
.forest-roster-entry div { height: 48px; border: 1px solid #ffffff15; border-radius: 9px; background: #ffffff0a; padding: 2px; }
.forest-roster-entry img { width: 100%; height: 100%; object-fit: contain; }
.forest-roster-entry.unknown img { filter: brightness(0) opacity(.45); }
.forest-roster-entry span { display: block; overflow: hidden; margin-top: 4px; color: #c8d0ca; font-size: .56rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.forest-roster-entry.unknown span { color: #777f7a; }
.forest-roster h4 { margin: 12px 0 7px; color: #908979; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; }
.forest-roster-grid.unavailable { grid-template-columns: repeat(4, 1fr); }
.forest-roster-grid.unavailable .forest-roster-entry { opacity: .38; filter: grayscale(.75); }

.forest-help {
  position: absolute;
  z-index: 88;
  left: 18px;
  bottom: 70px;
  display: grid;
  max-width: 280px;
  border: 1px solid #b9aa7f55;
  border-radius: 12px;
  background: #07130dd9;
  color: #f4ecd7;
  padding: 9px 12px;
  box-shadow: 0 7px 24px #0008;
  pointer-events: none;
}
.forest-help strong { color: #e3c774; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.forest-help span { margin-top: 2px; font-size: .72rem; font-weight: 900; }
.forest-help small { margin-top: 3px; color: #9cab9f; font-size: .61rem; }

.forest-minimap {
  position: absolute;
  z-index: 87;
  right: 18px;
  bottom: 70px;
  width: 150px;
  height: 84px;
  overflow: hidden;
  border: 1px solid #c0b18177;
  border-radius: 11px;
  background: url("../../assets/world/polana-pierwszych-world-v2.webp") center/cover no-repeat;
  box-shadow: 0 8px 25px #0009, inset 0 0 18px #000b;
  pointer-events: none;
}
.forest-minimap::after { content: "MAPA"; position: absolute; left: 6px; top: 5px; color: #e1cb7e; font-size: .48rem; font-weight: 1000; letter-spacing: .12em; }
.forest-minimap span { position: absolute; width: 8px; height: 8px; transform: translate(-50%, -50%); border: 2px solid white; border-radius: 50%; background: #d4ac38; box-shadow: 0 0 10px #ffe078; }

.forest-touch-controls { display: none; }

#forest-view .world-team-hud,
#forest-view .location-chip,
#forest-view .forest-roster-toggle,
#forest-view .forest-roster,
#forest-view .forest-help,
#forest-view .forest-minimap { cursor: default; }

#forest-view .forest-live-message {
  z-index: 96;
  pointer-events: none;
}

@keyframes forest-step {
  from { transform: translateY(0) rotate(-1.2deg); }
  to { transform: translateY(-4px) rotate(1.2deg); }
}
@keyframes forest-look {
  50% { transform: translateY(-4px) rotate(4deg); }
}
@keyframes forest-companion-step {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}
@keyframes forest-target {
  50% { box-shadow: 0 0 0 15px #f0ce622b, 0 0 32px #f2d56ad9; }
}
@keyframes forest-search {
  from { transform: translate(-50%, -50%) scale(1); }
  to { transform: translate(-50%, -50%) scale(1.28); background: #8d681c; }
}

@media (max-width: 720px) {
  #forest-view .world-team-hud { width: 164px; max-height: 136px; overflow: hidden; }
  #forest-view .location-chip { display: none; }
  .forest-roster-toggle { right: 8px; top: 8px; }
  .forest-roster { right: 8px; top: 51px; width: min(360px, calc(100vw - 16px)); }
  .forest-roster-grid { grid-template-columns: repeat(6, 1fr); }
  .forest-help { display: none; }
  .forest-minimap { right: 8px; bottom: 155px; width: 108px; height: 61px; }
  .forest-touch-controls {
    position: absolute;
    z-index: 94;
    right: 10px;
    bottom: 54px;
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 42px);
    gap: 4px;
  }
  .forest-touch-controls button {
    border: 1px solid #c4b47a77;
    border-radius: 11px;
    background: #07130de8;
    color: #ead37f;
    font-size: 1rem;
    font-weight: 900;
    touch-action: none;
  }
  .forest-touch-controls button:nth-child(1) { grid-column: 2; }
  .forest-touch-controls button:nth-child(2) { grid-column: 1; grid-row: 2; }
  .forest-touch-controls button:nth-child(3) { grid-column: 2; grid-row: 2; }
  .forest-touch-controls button:nth-child(4) { grid-column: 3; grid-row: 2; }
  #forest-view .forest-live-message { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; transform: none; padding-right: 150px; text-align: left; }
  .forest-walker { width: 70px; height: 105px; }
  .forest-companion { left: -54px; width: 60px; height: 60px; }
}
