/* Mini-Map Styles */

.minimap-canvas {
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: crosshair;
  image-rendering: pixelated;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.minimap-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.minimap-title {
  margin: 0;
  font-size: 16px;
  flex: 1;
  color: #e2e8f0;
}

.minimap-refresh-btn {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
}
.minimap-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.minimap-layer-select {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 12px;
  cursor: pointer;
}
.minimap-layer-select option {
  background: #1e1e2e;
  color: #e2e8f0;
}

.minimap-info {
  min-height: 24px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
  transition: all 0.15s;
}

.info-hint {
  opacity: 0.6;
  font-style: italic;
}

.info-tile {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.info-tile strong {
  color: #e2e8f0;
}

.info-agent {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: center;
}
.info-agent strong {
  color: #e2e8f0;
  font-size: 14px;
}

.minimap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 11px;
  color: #94a3b8;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legend-section strong {
  display: block;
  margin-bottom: 4px;
  color: #cbd5e1;
  font-size: 11px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Stats panel */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 12px;
  margin-top: 10px;
}

.stats-section {
  min-width: 140px;
}
.stats-section strong {
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
  font-size: 12px;
}

.stats-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.stats-label {
  min-width: 55px;
  color: #94a3b8;
  font-size: 11px;
}

.stats-bar-bg {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}

.stats-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.stats-value {
  min-width: 28px;
  text-align: right;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 11px;
}

.stats-resource {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
  color: #94a3b8;
}

/* ── Light Mode ────────────────────────────────────────── */
body:not(.dark-mode) .minimap-canvas {
  border-color: rgba(0, 0, 0, 0.15);
}
body:not(.dark-mode) .minimap-title {
  color: #1e293b;
}
body:not(.dark-mode) .minimap-refresh-btn,
body:not(.dark-mode) .minimap-layer-select {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
  color: #1e293b;
}
body:not(.dark-mode) .minimap-layer-select option {
  background: #fff;
  color: #1e293b;
}
body:not(.dark-mode) .minimap-info {
  background: rgba(0, 0, 0, 0.04);
  color: #475569;
}
body:not(.dark-mode) .minimap-legend {
  border-color: rgba(0, 0, 0, 0.08);
  color: #475569;
}
body:not(.dark-mode) .legend-section strong,
body:not(.dark-mode) .stats-section strong {
  color: #334155;
}
body:not(.dark-mode) .legend-swatch {
  border-color: rgba(0, 0, 0, 0.15);
}
body:not(.dark-mode) .info-tile strong,
body:not(.dark-mode) .info-agent strong {
  color: #1e293b;
}
body:not(.dark-mode) .stats-bar-bg {
  background: rgba(0, 0, 0, 0.06);
}
body:not(.dark-mode) .stats-value {
  color: #1e293b;
}
body:not(.dark-mode) .stats-label,
body:not(.dark-mode) .stats-resource {
  color: #475569;
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .minimap-canvas {
    max-width: 100%;
    touch-action: none;
  }
  .minimap-controls {
    flex-wrap: wrap;
  }
  .minimap-legend {
    flex-direction: column;
    gap: 8px;
  }
  .stats-grid {
    flex-direction: column;
    gap: 10px;
  }
  .info-tile, .info-agent {
    flex-direction: column;
    gap: 2px;
  }
}
