/* --------------------------------------------------------
   MAPA ISOMETRICO  Estilos v3.1
   -------------------------------------------------------- */

.iso-map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a1628;
  cursor: grab;
}
.iso-map-wrap:active { cursor: grabbing; }

#iso-canvas {
  display: block;
  position: absolute;
  top: 0; left: 0;
  image-rendering: pixelated;
}

/* -- Controles del mapa ------------------------------- */
.iso-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.iso-ctrl-btn {
  width: 36px; height: 36px;
  background: rgba(13,13,13,.85);
  border: 1px solid rgba(192,57,43,.4);
  border-radius: 6px;
  color: #e8e8e8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  backdrop-filter: blur(4px);
}
.iso-ctrl-btn:hover {
  background: rgba(192,57,43,.25);
  border-color: #c0392b;
}
.iso-ctrl-btn svg { width: 18px; height: 18px; }

/* FIX 1: Indicador de zoom numerico */
.iso-zoom-level {
  width: 36px;
  height: 22px;
  background: rgba(13,13,13,.85);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: 4px;
  color: #c0392b;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  letter-spacing: .02em;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.iso-ctrl-sep {
  height: 1px;
  background: rgba(192,57,43,.2);
  margin: 2px 0;
}

/* -- Minimapa ----------------------------------------- */
.iso-minimap {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 140px;
  height: 100px;
  background: rgba(10,10,10,.85);
  border: 1px solid rgba(192,57,43,.35);
  border-radius: 6px;
  overflow: hidden;
  z-index: 10;
  backdrop-filter: blur(4px);
}
#iso-minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.iso-minimap__viewport {
  position: absolute;
  border: 1px solid #c0392b;
  background: rgba(192,57,43,.15);
  pointer-events: none;
  transition: transform .05s;
}
.iso-minimap__label {
  position: absolute;
  top: 4px; left: 6px;
  font-size: .6rem;
  color: #c0392b;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* -- Coordenadas -------------------------------------- */
.iso-coords {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,10,.75);
  border: 1px solid rgba(192,57,43,.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .72rem;
  color: #aaa;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.iso-coords span { color: #c0392b; font-weight: 700; }


/* -- Loading overlay ---------------------------------- */
.iso-loading {
  position: absolute;
  inset: 0;
  background: #0a1628;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 50;
  color: #e8e8e8;
  font-size: .9rem;
}
.iso-loading__bar-wrap {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}
.iso-loading__bar {
  height: 100%;
  background: #c0392b;
  border-radius: 2px;
  width: 0%;
  transition: width .1s;
}
.iso-loading__text { color: #888; font-size: .78rem; }


/* -- Panel de info de celda ------------------------------- */
.iso-cell-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 175px;
    background: rgba(10,10,10,.92);
    border: 1px solid rgba(192,57,43,.45);
    border-radius: 8px;
    display: none;
    flex-direction: column;
    z-index: 15;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0,0,0,.6);
}

/* FIX 2: Header con titulo del terreno bien posicionado */
.iso-cell-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    border-radius: 8px 8px 0 0;
    gap: 6px;
}
.iso-cell-panel__title {
    font-size: .82rem;
    font-weight: 700;
    color: #c0392b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.iso-cell-panel__close {
    background: none; border: none; cursor: pointer;
    color: #888; padding: 0;
    width: 18px; height: 18px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.iso-cell-panel__close svg   { width: 14px; height: 14px; }
.iso-cell-panel__close:hover { color: #e8e8e8; }

.iso-cell-panel__body {
    padding: 8px 10px;
    display: flex; flex-direction: column; gap: 5px;
}
.iso-cell-panel__row {
    display: flex; align-items: center;
    gap: 5px; font-size: .72rem; color: #aaa;
}
.iso-cp-icon        { width: 11px; height: 11px; flex-shrink: 0; color: #000; }
.iso-cell-panel__row span   { flex-shrink: 0; }
.iso-cell-panel__row strong { color: #e8e8e8; font-weight: 600; margin-left: auto; }

.iso-cell-panel__footer {
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.iso-cell-panel__btn {
    width: 100%; padding: 6px; border: none;
    border-radius: 5px; cursor: pointer;
    font-size: .75rem; font-weight: 700;
    display: flex; align-items: center;
    justify-content: center; gap: 5px;
    background: #fff; color: #fff;
    transition: filter .2s;
}
.iso-cell-panel__btn:hover { filter: brightness(1.15); }
.iso-cell-panel__btn svg   { width: 13px; height: 13px; }

/* Mobile */
@media (max-width: 768px) {
    .iso-cell-panel {
        top: auto; left: 0; right: 0; bottom: 0;
        width: 100%; border-radius: 12px 12px 0 0;
        border-left: none; border-right: none; border-bottom: none;
    }
    .iso-cell-panel__body { flex-direction: row; flex-wrap: wrap; }
    .iso-cell-panel__row  { width: 45%; }
}