:root {
  --bg: #0b0e14;
  --panel: #111621;
  --card: #181f2e;
  --border: #283247;
  --text: #f3f6fc;
  --muted: #93a1b8;
  --orange: #ff6b35;
  --amber: #f7b801;
  --red: #ff3b5c;
  --cyan: #38bdf8;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, select, input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr 410px;
  width: 100vw;
  height: 100dvh;
}

/* Interactive Map Area */
.map-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070b12;
}

.map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #070b12;
  z-index: 1;
}

/* Custom Target Crosshair Marker */
.target-crosshair-icon {
  background: transparent;
  border: none;
}

.target-crosshair {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.target-crosshair:active {
  cursor: grabbing;
}

.cross-ring {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid #ff3b5c;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 59, 92, 0.7), inset 0 0 6px rgba(255, 59, 92, 0.4);
  animation: pulseCrosshair 1.8s infinite ease-in-out;
}

.cross-dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff3b5c;
}

@keyframes pulseCrosshair {
  0% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.85; }
}

.map-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: rgba(17, 22, 33, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.map-top-left {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-badge {
  text-decoration: none;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.4px;
  padding: 8px 14px;
  background: rgba(17, 22, 33, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  border-radius: 10px;
}

.brand-badge:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.city-picker select {
  background: rgba(17, 22, 33, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.map-bottom-left {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.zoom-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zoom-controls button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(17, 22, 33, 0.85);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.zoom-controls button:hover {
  background: #232c40;
}

.scale-legend {
  background: rgba(17, 22, 33, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.scale-bar {
  width: 44px;
  height: 5px;
  border: 1.5px solid #fff;
  border-top: none;
  display: inline-block;
}

.ring-legend {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(17, 22, 33, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  padding: 5px 10px;
  border-radius: 999px;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: calc(100% - 32px);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.ring-legend::-webkit-scrollbar {
  display: none;
}

.ring-legend[hidden],
.panel-view[hidden] {
  display: none !important;
}

.legend-chip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.legend-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.legend-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.legend-chip.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: #fff;
}

/* Right Control Sidebar */
.control-sidebar {
  background: var(--panel);
  border-left: 1px solid var(--border);
  height: 100dvh;
  overflow-y: auto;
  padding: 24px 22px 32px;
}

.sidebar-header h1,
.sidebar-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  margin: 0 0 6px;
  letter-spacing: -0.4px;
}

.sidebar-header p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13.5px;
}

.control-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  margin-bottom: 14px;
}

.group-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0 0 12px;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.mat-card {
  background: #101520;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 4px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}

.mat-card:hover {
  transform: translateY(-2px);
  border-color: #4b5d82;
}

.mat-card.active {
  border-color: var(--orange);
  background: rgba(255, 107, 53, 0.12);
}

.mat-sphere {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: block;
  box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.65);
}

.mat-sphere.iron {
  background: radial-gradient(circle at 35% 30%, #cbd5e1, #475569 70%, #1e293b);
}

.mat-sphere.stone {
  background: radial-gradient(circle at 35% 30%, #d6ccc2, #7f6a58 70%, #3d312a);
}

.mat-sphere.carbon {
  background: radial-gradient(circle at 35% 30%, #64748b, #1e293b 70%, #090d16);
}

.mat-sphere.comet {
  background: radial-gradient(circle at 35% 30%, #e0f2fe, #38bdf8 65%, #0369a1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45), inset -4px -4px 8px rgba(0, 0, 0, 0.5);
}

.mat-sphere.gold {
  background: radial-gradient(circle at 35% 30%, #fef08a, #eab308 65%, #854d0e);
}

.mat-name {
  font-size: 11.5px;
  font-weight: 700;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.slider-head label {
  font-size: 14px;
  font-weight: 700;
}

.slider-head strong {
  font-size: 14px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
  cursor: pointer;
}

.slider-sub {
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

.launch-btn {
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff6b35 0%, #f72585 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}

.launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 107, 53, 0.5);
}

.launch-btn.reset {
  background: #253047;
  box-shadow: none;
  margin-top: 14px;
}

.launch-btn.reset:hover {
  background: #303e5c;
}

/* Aftermath Report Cards & Tabs matching Neal.fun */
.impact-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--orange);
  margin-bottom: 4px;
}

.report-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin: 12px 0 16px;
  scrollbar-width: thin;
}

.report-tabs::-webkit-scrollbar {
  height: 4px;
}
.report-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.tab-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: #ffffff;
  border-color: #4b5d82;
}

.tab-btn.active {
  background: #253047;
  color: #ffffff;
  border-color: var(--orange);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
}

.report-cards {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid #4b5d82;
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

.stat-card.highlight {
  border-left-color: var(--orange);
  background: rgba(255, 107, 53, 0.08);
}

.stat-kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.stat-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #cbd5e1;
}

@media (max-width: 860px) {
  html, body {
    overflow: hidden !important;
    height: 100dvh !important;
  }
  .app-shell {
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }
  .map-viewport {
    flex: 1 1 50% !important;
    min-height: 220px !important;
    height: 50dvh !important;
  }
  .control-sidebar {
    flex: 1 1 50% !important;
    min-height: 0 !important;
    height: 50dvh !important;
    overflow-y: auto !important;
    border-left: none !important;
    border-top: 1px solid var(--border) !important;
  }
}

/* Leaflet Dark Space Theme */
.leaflet-bar a {
  background-color: rgba(17, 22, 33, 0.9) !important;
  color: #f3f6fc !important;
  border-bottom: 1px solid #283247 !important;
  backdrop-filter: blur(8px);
}
.leaflet-bar a:hover {
  background-color: #283247 !important;
  color: #38bdf8 !important;
}
.leaflet-control-layers {
  background: rgba(17, 22, 33, 0.92) !important;
  color: #f3f6fc !important;
  border: 1px solid #283247 !important;
  border-radius: 8px !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  font-size: 13px !important;
  font-weight: 600;
}
.leaflet-control-layers-expanded {
  padding: 8px 12px !important;
}
.leaflet-control-layers label {
  cursor: pointer;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.leaflet-container .leaflet-control-attribution {
  background: rgba(11, 14, 20, 0.8) !important;
  color: #94a3b8 !important;
  font-size: 10px !important;
}
.leaflet-container .leaflet-control-attribution a {
  color: #cbd5e1 !important;
}


/* Unified Wonderworld Games Brand Pill */
.ww-home-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  color: inherit;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}
.ww-home-pill:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
  border-color: color-mix(in srgb, currentColor 32%, transparent);
  transform: translateY(-1px);
  color: inherit;
}
.ww-home-pill .ww-logo-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}
.ww-home-pill .ww-text-short {
  display: none;
}
@media (max-width: 600px) {
  .ww-home-pill {
    padding: 5px 9px 5px 5px;
    gap: 5px;
    font-size: 12.5px;
  }
  .ww-home-pill .ww-text-full {
    display: none;
  }
  .ww-home-pill .ww-text-short {
    display: inline;
  }
}

/* Keyless Clean Dark Mode Tile Inversion */
.dark-map-tiles {
  filter: brightness(0.65) invert(1) contrast(3.2) hue-rotate(200deg) saturate(0.3) brightness(0.7) !important;
}

/* Hypervelocity Particle FX Canvas */
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
}

/* Incandescent Thermal Flash Overlay */
.impact-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  background: radial-gradient(circle at center, #ffffff 0%, #fff7ed 35%, #fed7aa 65%, rgba(255, 87, 34, 0.85) 100%);
  transition: opacity 0.1s ease;
}

.impact-flash.detonate {
  animation: thermalFlash 1.6s cubic-bezier(0.12, 0.9, 0.22, 1) forwards;
}

@keyframes thermalFlash {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
    filter: brightness(2.2);
  }
  30% {
    opacity: 0.85;
    background: radial-gradient(circle at center, #ffffff 0%, #ffedd5 30%, #ff5722 65%, rgba(13, 17, 23, 0.95) 100%);
  }
  100% {
    opacity: 0;
  }
}

/* Seismic Earthquake Camera Rumble */
.map-viewport.rumble {
  animation: seismicRumble 1.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes seismicRumble {
  0% { transform: translate(0, 0) rotate(0deg); }
  8% { transform: translate(-10px, 8px) rotate(-0.6deg); }
  16% { transform: translate(12px, -9px) rotate(0.5deg); }
  24% { transform: translate(-9px, 9px) rotate(-0.4deg); }
  32% { transform: translate(8px, -7px) rotate(0.3deg); }
  40% { transform: translate(-6px, 6px) rotate(-0.25deg); }
  48% { transform: translate(5px, -5px) rotate(0.2deg); }
  58% { transform: translate(-4px, 3px) rotate(-0.15deg); }
  68% { transform: translate(3px, -2px) rotate(0.1deg); }
  80% { transform: translate(-1.5px, 1.5px) rotate(-0.05deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Authentic Scorch Mark & Excavation Crater Decal */
.crater-scorch-icon {
  background: transparent !important;
  border: none !important;
}

.crater-scorch-decal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 69, 0, 0.95) 0%, rgba(180, 40, 0, 0.88) 20%, rgba(40, 15, 10, 0.92) 50%, rgba(15, 10, 10, 0.85) 75%, transparent 100%);
  box-shadow: 0 0 25px 8px rgba(255, 87, 34, 0.7), inset 0 0 35px rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scorchPulse 3s infinite alternate ease-in-out;
}

.crater-molten-pit {
  width: 35%;
  height: 35%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7ed 0%, #facc15 30%, #ff5722 70%, #7f1d1d 100%);
  box-shadow: 0 0 18px 6px #ff5722;
}

@keyframes scorchPulse {
  0% { filter: brightness(1) drop-shadow(0 0 8px #ff5722); }
  100% { filter: brightness(1.35) drop-shadow(0 0 22px #ff3b30); }
}

/* Zone Highlighting & Interactive Focus */
.leaflet-interactive.blast-active-ring {
  filter: drop-shadow(0 0 10px currentColor) drop-shadow(0 0 20px currentColor) !important;
  animation: activeRingGlow 2.2s infinite ease-in-out !important;
}

@keyframes activeRingGlow {
  0%, 100% { stroke-width: 3.5px; stroke-opacity: 1; fill-opacity: 0.32; }
  50% { stroke-width: 5px; stroke-opacity: 0.85; fill-opacity: 0.45; }
}

/* Smooth Launch Button State */
.launch-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none !important;
}


/* Cosmic Blast Zone Tooltips */
.leaflet-tooltip.blast-zone-tooltip {
  background: rgba(15, 23, 42, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px) !important;
}
.leaflet-tooltip.blast-zone-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.94) !important;
}

/* -------------------------------------------------------------
   Map Mode Theming (Streets Default vs Dark Mode) & WGames Brand Pill
   ------------------------------------------------------------- */
.theme-toggle-btn {
  background: rgba(17, 22, 33, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.theme-toggle-btn:hover {
  transform: translateY(-1px);
}

/* Streets Map Mode (Default Light Map) */
body.map-mode-streets .ww-home-pill {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(126, 34, 206, 0.35) !important;
  color: #1e1b4b !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
}
body.map-mode-streets .ww-home-pill:hover {
  background: #ffffff !important;
  border-color: #9333ea !important;
  color: #581c87 !important;
}
body.map-mode-streets .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}
body.map-mode-streets .theme-toggle-btn:hover {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.35) !important;
}
body.map-mode-streets .city-picker select {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Dark Map Mode */
body.map-mode-dark .ww-home-pill {
  background: rgba(26, 20, 48, 0.92) !important;
  border: 1px solid rgba(192, 132, 252, 0.4) !important;
  color: #f3e8ff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}
body.map-mode-dark .ww-home-pill:hover {
  background: rgba(38, 28, 70, 0.98) !important;
  border-color: rgba(192, 132, 252, 0.7) !important;
  color: #ffffff !important;
}
body.map-mode-dark .theme-toggle-btn {
  background: rgba(17, 22, 33, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}
body.map-mode-dark .theme-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.98) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}
body.map-mode-dark .city-picker select {
  background: rgba(17, 22, 33, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

/* -------------------------------------------------------------
   Prominent Floating Map Category Tabs (Matching Neal.fun)
   ------------------------------------------------------------- */
.map-category-tabs {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px);
  padding: 6px;
  border-radius: 999px;
  display: flex;
  gap: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  max-width: calc(100% - 32px);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.map-category-tabs[hidden] {
  display: none !important;
}
.map-category-tabs::-webkit-scrollbar {
  display: none;
}
.map-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.map-tab-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}
.map-tab-btn.active {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.map-tab-btn .tab-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Builder View Simulation Preview Hint */
.builder-zones-hint {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 16px 0 14px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.builder-zones-hint strong {
  color: #e2e8f0;
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

/* Sticky Report Tabs in Sidebar */
.report-tabs {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 10;
  padding-top: 4px;
}


/* ==========================================================================
   PROMINENT FLOATING MAP CATEGORY TABS (ALWAYS VISIBLE & HIGH CONTRAST)
   ========================================================================== */
.map-category-tabs {
  position: absolute !important;
  bottom: 18px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 9999 !important;
  background: rgba(13, 17, 23, 0.95) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.28) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  padding: 5px 8px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.4) !important;
  max-width: calc(100% - 24px) !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  pointer-events: auto !important;
}

.map-category-tabs::-webkit-scrollbar {
  display: none !important;
}

.map-tab-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
  padding: 7px 14px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  transition: all 0.16s ease !important;
  white-space: nowrap !important;
  user-select: none !important;
}

.map-tab-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-1px) !important;
}

.map-tab-btn.active {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.45) !important;
}

/* Category Color Indicator Dots */
.tab-dot {
  width: 9px !important;
  height: 9px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}
.dot-all { background: linear-gradient(135deg, #ef4444 0%, #facc15 35%, #38bdf8 70%, #c084fc 100%) !important; box-shadow: 0 0 6px rgba(255,255,255,0.9) !important; }
.dot-crater { background: #ffffff !important; box-shadow: 0 0 6px rgba(255,255,255,0.9) !important; }
.dot-fireball { background: #ff5722 !important; box-shadow: 0 0 6px rgba(255,87,34,0.9) !important; }
.dot-shockwave { background: #facc15 !important; box-shadow: 0 0 6px rgba(250,204,21,0.9) !important; }
.dot-wind { background: #38bdf8 !important; box-shadow: 0 0 6px rgba(56,189,248,0.9) !important; }
.dot-earthquake { background: #c084fc !important; box-shadow: 0 0 6px rgba(192,132,252,0.9) !important; }

/* In Builder View: Tab Chips */
.builder-zones-hint {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  margin: 16px 0 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  text-align: center !important;
}

.builder-zones-hint .hint-title {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: #94a3b8 !important;
}

.builder-tab-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  justify-content: center !important;
}

.builder-chip {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.15s ease !important;
}

.builder-chip:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.builder-chip.active {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
}

.builder-zones-hint .hint-sub {
  font-size: 11px !important;
  color: #64748b !important;
}

/* Reposition Map Hint Above the Tabs */
.map-hint {
  position: absolute !important;
  bottom: 74px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 30 !important;
  pointer-events: none !important;
}

/* Suppress redundant conflicting ring-legend */
.ring-legend {
  display: none !important;
}

@media (max-width: 860px) {
  .map-category-tabs {
    bottom: 10px !important;
    padding: 4px 6px !important;
    gap: 4px !important;
    max-width: calc(100% - 16px) !important;
  }
  .map-tab-btn {
    padding: 6px 9px !important;
    font-size: 12px !important;
    gap: 4px !important;
  }
  .map-hint {
    bottom: 60px !important;
    font-size: 11.5px !important;
    padding: 6px 12px !important;
  }
}

.map-category-tabs[hidden] {
  display: none !important;
}

/* ==========================================================================
   FLOATING AFTERMATH CONTROL BAR (Visible right after an asteroid is dropped)
   ========================================================================== */
.aftermath-control-bar {
  position: absolute !important;
  bottom: 68px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  max-width: calc(100% - 24px) !important;
  pointer-events: auto !important;
  animation: slideUpAftermath 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.aftermath-control-bar[hidden],
.map-hint[hidden],
#map-hint[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes slideUpAftermath {
  from {
    opacity: 0;
    transform: translate(-50%, 25px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.aftermath-header {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.btn-view-aftermath {
  background: linear-gradient(135deg, #ef4444 0%, #ea580c 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.45) !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 800 !important;
  letter-spacing: -0.2px !important;
  padding: 8px 18px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  animation: pulseViewAftermath 2s infinite ease-in-out;
}

@keyframes pulseViewAftermath {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.55);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 6px 26px rgba(239, 68, 68, 0.85);
  }
}

.btn-view-aftermath:hover {
  transform: translateY(-1px) scale(1.02) !important;
  filter: brightness(1.1) !important;
}

.btn-launch-another-pill {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  backdrop-filter: blur(12px) !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
}

.btn-launch-another-pill:hover {
  background: rgba(30, 41, 59, 0.98) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  transform: translateY(-1px) !important;
}


@media (max-width: 860px) {
  .aftermath-control-bar {
    bottom: 54px !important;
    gap: 6px !important;
    max-width: calc(100% - 16px) !important;
  }
  .btn-view-aftermath {
    font-size: 12px !important;
    padding: 7px 14px !important;
  }
  .btn-launch-another-pill {
    font-size: 11.5px !important;
    padding: 7px 11px !important;
  }
}
