* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#map {
  width: 100%;
  height: 100%;
  transition: filter 0.6s ease;
}

/* Vinheta escura nas bordas no modo fantasia */
.fantasy-active-body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(5, 3, 15, 0.6) 100%);
}

/* --- Botão de toggle --- */
#controls {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

#toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  background: #1a1a2e;
  color: #e0e0e0;
}

#toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}

#toggle-btn.fantasy-active {
  background: linear-gradient(135deg, #6c3483, #1a5276);
  color: #fff;
  box-shadow: 0 4px 24px rgba(108, 52, 131, 0.5);
}

#toggle-icon {
  font-size: 22px;
}

/* --- Painel de informação --- */
#info-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 340px;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(20, 20, 35, 0.95);
  color: #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
}

#info-panel.hidden {
  display: none;
}

#close-panel {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
}

#close-panel:hover {
  color: #fff;
}

#panel-content h3 {
  margin-bottom: 8px;
  color: #f1c40f;
}

#panel-content .marker-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 12px;
}

#panel-content .marker-type.treasure { background: #f39c12; color: #1a1a2e; }
#panel-content .marker-type.npc { background: #2ecc71; color: #1a1a2e; }
#panel-content .marker-type.enemy { background: #e74c3c; color: #fff; }

#panel-content .description {
  font-style: italic;
  color: #bbb;
  margin-bottom: 12px;
  line-height: 1.5;
}

#panel-content .meta-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

#panel-content .meta-label {
  font-weight: 600;
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#panel-content .meta-value {
  color: #e0e0e0;
  margin-bottom: 6px;
}

#panel-content .loot-list, #panel-content .inventory-list {
  list-style: none;
  padding: 0;
}

#panel-content .loot-list li, #panel-content .inventory-list li {
  padding: 4px 0;
  font-size: 14px;
  color: #ccc;
}

#panel-content .dialogue {
  background: rgba(255,255,255,0.05);
  padding: 10px;
  border-radius: 8px;
  margin-top: 6px;
  font-style: italic;
  line-height: 1.6;
  color: #ddd;
}

/* --- Loading --- */
#loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 35, 0.9);
  color: #e0e0e0;
  padding: 20px 32px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 30;
}

#loading.hidden {
  display: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #f1c40f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Region banner --- */
#region-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 35, 0.9);
  color: #f1c40f;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  z-index: 15;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(241, 196, 15, 0.3);
  transition: opacity 0.4s ease;
}

/* --- Responsivo --- */
@media (max-width: 480px) {
  #info-panel {
    width: calc(100% - 32px);
    right: 16px;
    left: 16px;
  }

  #toggle-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}
