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

.cave-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
  background: radial-gradient(circle at 70% 65%, #0b2427, #02080c 64%);
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.cave-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1672px;
  height: 941px;
  transform-origin: 0 0;
  background: url("../../assets/world/stara-jaskinia-world.webp") center/100% 100% no-repeat;
  box-shadow: inset 0 0 130px #000d;
  will-change: transform;
}

.cave-world::after {
  content: "";
  position: absolute;
  z-index: 70;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 68% 68%, transparent 0 18%, #03101618 50%, #000b 100%);
  box-shadow: inset 0 0 95px #000d;
}

.cave-walker {
  position: absolute;
  z-index: 30;
  left: 150px;
  top: 82px;
  width: 64px;
  height: 96px;
  transform: translate(-50%, -88%);
  transform-origin: 50% 88%;
  pointer-events: none;
  will-change: left, top;
}

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

.cave-walker-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 3px;
  width: 42px;
  height: 13px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #000c;
  filter: blur(2px);
}

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

.cave-hotspot,
.cave-exit,
.cave-boss {
  position: absolute;
  z-index: 22;
  width: 78px;
  height: 78px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #daf9f4;
  cursor: pointer;
}

.cave-hotspot i,
.cave-exit i,
.cave-boss i {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 1px solid #78b7b1bb;
  border-radius: 50%;
  background: #04171be8;
  box-shadow: 0 0 0 7px #50c4c118, 0 0 20px #66d4ce73;
  transition: .18s transform, .18s box-shadow, .18s background;
}
.cave-hotspot i::after { content: "✦"; color: #8fe7dd; font-size: .7rem; }
.cave-hotspot.deep i { border-color: #679cca; box-shadow: 0 0 0 7px #3977b21e, 0 0 22px #4a9fd58c; }
.cave-hotspot.deep i::after { color: #7fc8f6; }
.cave-hotspot.heart i { border-color: #9981dc; box-shadow: 0 0 0 8px #8060dc20, 0 0 25px #9c79ef9c; }
.cave-hotspot.heart i::after { color: #cab0ff; }

.cave-exit { left: 150px; top: 82px; }
.cave-exit i::before { content: "↖"; color: #d9e0bd; font-weight: 1000; }
.cave-exit i { border-color: #a6ad82; box-shadow: 0 0 18px #c5c79166; }

.cave-boss { left: 1170px; top: 640px; z-index: 29; width: 112px; height: 112px; }
.cave-boss i {
  width: 46px;
  height: 46px;
  border: 2px solid #91eafa;
  background: radial-gradient(circle, #176b78, #07151d 68%);
  box-shadow: 0 0 0 11px #50d9e528, 0 0 42px #57e5f4d1;
  animation: cave-boss-pulse 1.6s ease-in-out infinite alternate;
}
.cave-boss i::before { content: "◇"; color: #c8faff; font-size: 1.25rem; text-shadow: 0 0 9px #fff; }
.cave-boss.captured { cursor: default; filter: grayscale(.8); opacity: .58; }
.cave-boss.captured i { animation: none; box-shadow: 0 0 14px #6d858799; }

.cave-hotspot span,
.cave-exit span,
.cave-boss span,
.cave-boss b {
  position: absolute;
  left: 50%;
  min-width: max-content;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  border: 1px solid #729e9c66;
  border-radius: 8px;
  background: #031216f2;
  color: #e7fbf7;
  padding: 5px 8px;
  box-shadow: 0 5px 15px #000b;
  font-size: .61rem;
  font-weight: 900;
  pointer-events: none;
  transition: .18s opacity, .18s transform;
}
.cave-hotspot span, .cave-exit span { bottom: -14px; }
.cave-boss span { bottom: -3px; }
.cave-boss b { top: 103px; color: #8edfe8; font-size: .46rem; letter-spacing: .08em; }
.cave-hotspot:hover span, .cave-hotspot:focus-visible span,
.cave-exit:hover span, .cave-exit:focus-visible span,
.cave-boss:hover span, .cave-boss:focus-visible span,
.cave-boss:hover b, .cave-boss:focus-visible b { opacity: 1; transform: translateX(-50%) translateY(0); }
.cave-hotspot:hover i, .cave-hotspot:focus-visible i,
.cave-exit:hover i, .cave-exit:focus-visible i,
.cave-boss:hover i, .cave-boss:focus-visible i { transform: translate(-50%, -50%) scale(1.18); }
.cave-hotspot.used i { border-color: #53646788; background: #101b1ddd; box-shadow: none; filter: grayscale(1); opacity: .5; }
.cave-hotspot.used i::after { content: "✓"; color: #8c9a9b; }
.cave-hotspot.targeted i, .cave-exit.targeted i, .cave-boss.targeted i { animation: forest-target 1s ease-in-out infinite; }
.cave-hotspot.searching i { animation: forest-search .55s ease-in-out infinite alternate; }

.cave-location-chip { border-color: #568f9270; background: #031216e8; color: #b9eee9; }
.cave-roster-toggle {
  position: absolute;
  z-index: 92;
  right: 18px;
  top: 64px;
  border: 1px solid #548d916e;
  border-radius: 11px;
  background: #031216e8;
  color: #c6f4ed;
  padding: 9px 12px;
  box-shadow: 0 8px 24px #0009;
  font-size: .66rem;
  font-weight: 1000;
  letter-spacing: .07em;
  cursor: pointer;
  backdrop-filter: blur(7px);
}
.cave-roster-toggle:hover { border-color: #7bd1d2; background: #073038ee; }
.cave-roster-drawer {
  position: absolute;
  z-index: 94;
  right: 18px;
  top: 106px;
  width: min(370px, calc(100vw - 36px));
  max-height: calc(100vh - 190px);
  overflow: auto;
  transform: translateX(calc(100% + 36px));
  opacity: 0;
  border: 1px solid #57989c75;
  border-radius: 14px;
  background: #031216f3;
  color: #e4f8f5;
  box-shadow: 0 12px 34px #000c;
  transition: .22s transform, .22s opacity;
  backdrop-filter: blur(10px);
}
.cave-roster-drawer.show { transform: translateX(0); opacity: 1; }
.cave-roster-drawer header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #051a1ff7; border-bottom: 1px solid #46787b66; }
.cave-roster-drawer header small { display: block; color: #72c8c8; font-size: .5rem; letter-spacing: .12em; }
.cave-roster-drawer header strong { font-size: .78rem; }
.cave-roster-drawer header button { border: 0; background: transparent; color: #b7dddc; font-size: 1.2rem; cursor: pointer; }
.cave-roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 10px; }
.cave-roster article { display: grid; place-items: center; min-width: 0; border: 1px solid #3e6b6d69; border-radius: 10px; background: #082126b0; padding: 8px 4px; text-align: center; }
.cave-roster article img { width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 5px 5px #0009); }
.cave-roster article span { width: 100%; overflow: hidden; color: #e5f9f4; font-size: .62rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.cave-roster article small { color: #7ca3a4; font-size: .46rem; }
.cave-roster article.rare { border-color: #528ac08c; }
.cave-roster article.epic { border-color: #8e65ce9c; }
.cave-roster article.legendary { border-color: #d8ba5ca6; background: #392f164f; }
.cave-roster article.unknown img { filter: brightness(0) opacity(.55); }

.cave-help {
  position: absolute;
  z-index: 88;
  left: 18px;
  bottom: 70px;
  display: grid;
  max-width: 340px;
  border: 1px solid #56878a61;
  border-radius: 12px;
  background: #031216df;
  color: #e3f6f2;
  padding: 9px 12px;
  box-shadow: 0 7px 24px #0009;
  pointer-events: none;
}
.cave-help strong { color: #77cfcc; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }
.cave-help span { margin-top: 2px; font-size: .71rem; font-weight: 900; }
.cave-help small { margin-top: 3px; color: #779b9d; font-size: .59rem; }
.cave-minimap {
  position: absolute;
  z-index: 87;
  right: 18px;
  bottom: 70px;
  width: 167px;
  height: 94px;
  overflow: hidden;
  border: 1px solid #5a898c77;
  border-radius: 10px;
  background: url("../../assets/world/stara-jaskinia-world.webp") center/cover no-repeat;
  box-shadow: 0 7px 24px #000b, inset 0 0 25px #000b;
  opacity: .76;
}
.cave-minimap span { position: absolute; width: 8px; height: 8px; transform: translate(-50%, -50%); border: 2px solid #e6ffff; border-radius: 50%; background: #56e9e4; box-shadow: 0 0 9px #fff; }
.cave-message { border-color: #477c7d80; background: #031216e9; color: #c9ebe7; }

.battle-view-v2.cave-battle .battle-arena {
  background-image: linear-gradient(180deg, #01080b30, #01080bd9), url("../../assets/locations/arena-stara-jaskinia.webp");
  background-position: center;
  background-size: cover;
}
.battle-view-v2.cave-battle .battle-stump-platform { filter: hue-rotate(115deg) saturate(.45) brightness(.65) drop-shadow(0 14px 11px #000c); }
.battle-view-v2.cave-boss-battle .battle-title-v2 span { color: #8eeef2; }
.battle-view-v2.cave-boss-battle .enemy-hud { border-color: #60d9e28a; box-shadow: 0 0 28px #42cbd538; }
.cave-capture-card { border-color: #58cdd2 !important; background: radial-gradient(circle at 28% 45%, #145c676b, #06151bef 68%) !important; }

.boss-capture-overlay {
  position: fixed;
  z-index: 250;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at center, #0d60735c, #010509ed 62%);
  backdrop-filter: blur(8px);
}
.boss-capture-overlay[aria-hidden="true"] { display: none; }
.boss-capture-panel {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid #6de1e7a8;
  border-radius: 22px;
  background: linear-gradient(145deg, #0a2730f7, #030d13fb);
  color: #e9ffff;
  padding: clamp(22px, 5vw, 42px);
  box-shadow: 0 0 0 1px #c8ffff1c, 0 25px 80px #000, 0 0 65px #36c8d459;
  text-align: center;
  animation: cave-capture-arrive .35s ease-out;
}
.boss-capture-panel .eyebrow { color: #67dce2; }
.boss-capture-panel h2 { margin: 6px 0 8px; color: #dfffff; font-family: var(--font-display, inherit); font-size: clamp(1.7rem, 5vw, 2.6rem); }
.boss-capture-panel > p:not(.eyebrow) { margin: 0 auto 20px; max-width: 440px; color: #a9cfd2; line-height: 1.55; }
.boss-capture-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.boss-capture-stats div { display: grid; gap: 4px; border: 1px solid #4b919578; border-radius: 12px; background: #061920a8; padding: 12px; }
.boss-capture-stats span { color: #75aaad; font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.boss-capture-stats strong { color: #e8ffff; font-size: 1.05rem; }
.boss-capture-clock { margin: 18px 0; }
.boss-capture-clock > strong { display: block; margin-bottom: 7px; color: #fff2a6; font-size: 1.55rem; }
.boss-capture-clock > div { height: 8px; overflow: hidden; border-radius: 999px; background: #13252b; }
.boss-capture-clock i { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e1a744, #fff2a7, #63e3df); box-shadow: 0 0 14px #9efaf5; transition: width .08s linear; }
.boss-capture-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.boss-capture-actions .action { min-height: 48px; }
.boss-capture-panel > small { display: block; margin-top: 13px; color: #738f92; font-size: .62rem; }

@keyframes cave-boss-pulse { to { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 0 0 17px #50d9e50f, 0 0 56px #7df2f4f0; } }
@keyframes cave-capture-arrive { from { opacity: 0; transform: translateY(16px) scale(.96); } }

@media (max-width: 760px) {
  .cave-help, .cave-minimap { display: none; }
  .cave-roster-toggle { right: 10px; top: 55px; padding: 8px 10px; }
  .cave-roster-drawer { right: 10px; top: 96px; width: calc(100vw - 20px); max-height: calc(100vh - 155px); }
  .cave-roster { grid-template-columns: repeat(3, 1fr); }
  .cave-roster article img { width: 52px; height: 52px; }
  .cave-hotspot span, .cave-exit span, .cave-boss span, .cave-boss b { display: none; }
  .boss-capture-overlay { padding: 10px; }
  .boss-capture-panel { border-radius: 17px; padding: 20px 16px; }
  .boss-capture-stats, .boss-capture-actions { grid-template-columns: 1fr; }
  .boss-capture-panel > p:not(.eyebrow) { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cave-boss i, .cave-hotspot.targeted i, .cave-exit.targeted i, .cave-boss.targeted i { animation: none; }
  .boss-capture-panel { animation: none; }
}
