#cave-map { min-width: 0; }
.em-chart {
  container-type: inline-size;
  --em-gold: #ffd38a;
  --em-water: #9bc7ba;
  --em-line: #63766d;
  --em-cream: #fff1d3;
  min-width: 0;
  color: var(--em-cream);
  text-align: left;
}
.em-viewport {
  position: relative;
  overflow: auto;
  max-height: min(29dvh, 244px);
  overscroll-behavior: contain;
  scrollbar-color: #81745c #20231f;
  scrollbar-width: thin;
  border: 1px solid #8d8b6a77;
  border-radius: 3px;
  background-color: #151b19;
  background-image: linear-gradient(#97bf9f0b 1px, transparent 1px),linear-gradient(90deg, #97bf9f0b 1px, transparent 1px);
  background-size: 12px 12px;
}
.em-plane {
  position: relative;
  min-width: calc(var(--em-cols) * 43px);
  min-height: calc(var(--em-rows) * 37px);
  width: 100%;
  height: clamp(92px, calc(var(--em-rows) * 54px), 240px);
  isolation: isolate;
}
.em-tunnels { position: absolute; width: 100%; height: 100%; inset: 0; overflow: visible; pointer-events: none; fill: none; }
.em-tunnels line { stroke-linecap: round; }
.em-known { stroke: var(--em-water); stroke-width: 2; }
.em-frontier { stroke: #89968a; stroke-width: 1.5; }
.em-blocked { stroke: var(--em-gold); stroke-width: 2; stroke-dasharray: 3 5; }
#cave-map .em-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  width: 34px;
  min-width: 0;
  height: 29px;
  min-height: 0;
  margin: 0;
  border: 1px solid #7c9586;
  border-radius: 2px;
  background: #26332e;
  color: var(--em-water);
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  text-shadow: none;
  touch-action: manipulation;
}
#cave-map .em-pin > svg { display: block; width: 24px; height: 20px; }
#cave-map .em-pin[data-kind="here"] { color: var(--em-gold); border-color: var(--em-gold); background: #443928; }
#cave-map .em-pin[data-kind="seen"][data-biome="1"] { color: #a6d9da; border-color: #669c9b; background: #203332; }
#cave-map .em-pin[data-kind="seen"][data-biome="2"] { color: #edb18c; border-color: #ae805f; background: #3c2a25; }
#cave-map .em-pin[data-kind="frontier"] { border-color: #617168; color: #bac5b7; background: #1d2521; border-style: dashed; }
#cave-map .em-pin[aria-pressed="true"] { outline: 2px solid var(--em-gold); outline-offset: 2px; }
#cave-map .em-pin:focus-visible { outline: 3px solid #fff8de; outline-offset: 2px; z-index: 3; }
.em-room-shape, .em-strata, .em-unknown { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linejoin: round; }
.em-you { fill: var(--em-gold); }
.em-checkpoint { fill: #81cdd3; stroke: #c9ffff; stroke-width: 1; }
.em-pin-name { display: none; }
.em-detail { padding: 7px 0 0; line-height: 1.35; }
.em-detail-name { display: block; margin: 0; color: var(--em-gold); font-size: 1rem; font-weight: 750; }
.em-detail-info { display: block; color: #dedbc9; margin-top: 2px; font-size: .86rem; }
@media (min-width: 820px) and (min-height: 550px) {
  .em-plane { height: clamp(130px, calc(var(--em-rows) * 64px), 280px); }
}
@container (min-width: 460px) {
  .em-pin-name {
    position: absolute; display: block; text-align: center; top: calc(100% + 3px); left: 50%;
    transform: translateX(-50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: min(110px, calc(100cqw / var(--em-cols) - 7px)); font: 600 .72rem/1.2 "Segoe UI", sans-serif; color: #e2e6d9; pointer-events: none;
    padding: 1px 3px; background: #151b19e6; text-transform: none;
  }
}
@media (max-height: 440px) and (orientation: landscape) {
  .em-pin-name { display: none; }
  .em-viewport { max-height: min(35dvh, 135px); }
  .em-plane { height: clamp(68px, calc(var(--em-rows) * 36px), 132px); min-height: calc(var(--em-rows) * 32px); }
  #cave-map .em-pin { width: 30px; height: 25px; }
  .em-detail { padding-top: 4px; }
  .em-detail-name { font-size: .9rem; display: inline; margin-right: 7px; }
  .em-detail-info { font-size: .78rem; display: inline; }
}
@media (hover: hover) { #cave-map .em-pin:hover { border-color: var(--em-gold); } }
@media (forced-colors: active) {
  #cave-map .em-pin { border: 1px solid ButtonText; }
  #cave-map .em-pin[aria-pressed="true"] { outline: 2px solid Highlight; }
  .em-tunnels line { stroke: CanvasText; }
}
