/* styles/world-map.css
 * Мини-карта слева внизу и окно полной карты.
 * Карта чёрная: неразведанное не рисуется вовсе. */

/* ===== Мини-карта ===== */
#map-panel.minimap {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 208px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  user-select: none;
  font-family: system-ui, sans-serif;
}

.minimap-location {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  background: rgba(18, 16, 12, 0.92);
  border: 1px solid #5a4a2a;
  border-radius: 6px;
  color: #ead9ac;
  font: inherit;
  font-size: 11px;
  line-height: 14px;
  text-align: left;
  cursor: pointer;
}
.minimap-location:hover { border-color: #8a7a50; }
.minimap-location-short {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.minimap-location-full {
  display: block;
  color: #cbbd97;
  font-size: 10px;
  line-height: 13px;
  white-space: normal;
}
.minimap-location.expanded { border-color: #a08a55; }
.minimap-location.expanded .minimap-location-full::before {
  content: '';
  display: block;
  height: 3px;
}

.minimap-frame {
  position: relative;
  width: 100%;
  background: #000;
  border: 2px solid #5a4a2a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}
#minimap-canvas {
  display: block;
  width: 100%;
  height: 150px;
  cursor: pointer;
  touch-action: none;
}
.minimap-controls {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: flex;
  gap: 4px;
}
.map-zoom-btn,
.map-fit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: rgba(20, 18, 14, 0.9);
  border: 1px solid #6a5a3a;
  border-radius: 5px;
  color: #ead9ac;
  font: 600 15px/1 system-ui, sans-serif;
  cursor: pointer;
}
.map-zoom-btn:hover,
.map-fit-btn:hover { background: #35301f; border-color: #a08a55; }
.minimap-hint {
  position: absolute;
  left: 6px;
  bottom: 7px;
  color: rgba(214, 196, 150, 0.75);
  font-size: 9px;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.minimap-frame:hover .minimap-hint { opacity: 1; }

/* ===== Полная карта ===== */
#world-map {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  background: rgba(4, 4, 4, 0.78);
}
#world-map[hidden] { display: none; }

.world-map-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1280px, 96vw);
  height: min(840px, 93vh);
  background: #100e0a;
  border: 2px solid #6a5a3a;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.world-map-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid #3a3222;
  background: #16130d;
}
.world-map-title {
  color: #f2e3b8;
  font: 600 16px/1.2 system-ui, sans-serif;
  letter-spacing: 0.02em;
}
.world-map-location {
  flex: 1;
  min-width: 0;
  color: #cbbd97;
  font-size: 11px;
  line-height: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.world-map-progress {
  color: #9fb48f;
  font-size: 11px;
  white-space: nowrap;
}
.world-map-close {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(30, 26, 18, 0.9);
  border: 1px solid #6a5a3a;
  border-radius: 6px;
  color: #e8d8b0;
  font: 400 20px/1 system-ui, sans-serif;
  cursor: pointer;
}
.world-map-close:hover { background: #3a3122; }

.world-map-body {
  position: relative;
  flex: 1;
  min-height: 0;
}
#world-map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#world-map-canvas.dragging { cursor: grabbing; }

.world-map-controls {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
}
.world-map-controls .map-zoom-btn,
.world-map-controls .map-fit-btn {
  width: 30px;
  height: 30px;
  font-size: 17px;
  background: rgba(14, 12, 9, 0.9);
}
.world-map-scale {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 7px;
  background: rgba(14, 12, 9, 0.8);
  border: 1px solid #4a3f2a;
  border-radius: 5px;
  color: #cbbd97;
  font-size: 10px;
}
.world-map-hint {
  position: absolute;
  left: 12px;
  top: 12px;
  color: rgba(203, 189, 151, 0.65);
  font-size: 10px;
  pointer-events: none;
}

/* ===== Слои ===== */
.world-map-layers {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 176px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 8px;
  background: rgba(12, 11, 8, 0.9);
  border: 1px solid #4a3f2a;
  border-radius: 8px;
}
.world-map-layers-title {
  color: #f0e0b0;
  font: 600 11px/1.3 system-ui, sans-serif;
  margin-bottom: 6px;
  text-align: center;
}
.map-layer-group { margin-bottom: 7px; }
.map-layer-group:last-child { margin-bottom: 0; }
.map-layer-group-title {
  color: #8f805f;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.map-layer-toggle {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 2px;
  padding: 2px 6px;
  background: rgba(35, 38, 34, 0.9);
  border: 1px solid #4d4632;
  border-radius: 4px;
  color: #e8dcc0;
  font-size: 10px;
  line-height: 14px;
  text-align: left;
  cursor: pointer;
}
.map-layer-toggle:hover { border-color: #8a7a50; background: #35382f; }
.map-layer-toggle.off { opacity: 0.42; }
.map-layer-toggle::before { content: '● '; color: #9fc08a; }
.map-layer-toggle.off::before { content: '○ '; color: #7a7460; }

@media (max-width: 760px) {
  .world-map-window {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 0;
  }
  #world-map { padding: 0; }
  .world-map-layers {
    width: 150px;
    top: 8px;
    right: 8px;
    padding: 6px;
  }
  .world-map-location { display: none; }
  #minimap-canvas { height: 130px; }
}
