* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body, #app, #map {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: #111;
}
#map {
  position: absolute;
  inset: 0;
}
#topbar {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}
.brand, .badge {
  background: rgba(15,15,15,.82);
  color: #fff;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 13px;
}
.badge {
  color: #ffd900;
  font-size: 11px;
}
.hint {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 58px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(92vw, 520px);
  background: rgba(15,15,15,.80);
  color: white;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14);
  pointer-events: none;
}
.controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 8px;
  background: rgba(15,15,15,.82);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  backdrop-filter: blur(14px);
}
.btn {
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.11);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.btn:disabled {
  opacity: .35;
}
.btn-primary {
  background: #ffd900;
  color: #111;
}
.icon {
  font-size: 22px;
  line-height: 22px;
}
.toast {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  transform: translate(-50%, 20px);
  background: rgba(0,0,0,.86);
  color: white;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.api-error {
  position: absolute;
  z-index: 50;
  inset: 16px;
  margin: auto;
  max-width: 520px;
  height: max-content;
  background: #fff;
  color: #111;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 20px 70px rgba(0,0,0,.4);
}
.api-error h1 { font-size: 20px; margin-top: 0; }
.api-error p { line-height: 1.45; }
.hidden { display: none; }

/* Etiquetas del grid */
.sector-label {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #ffd900;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0 0 4px #000;
  pointer-events: none;
  user-select: none;
}
.location-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1687ff;
  border: 3px solid white;
  box-shadow: 0 1px 7px rgba(0,0,0,.55);
  transform: translate(-50%, -50%);
}
@media (max-width: 390px) {
  .controls { gap: 5px; left: 6px; right: 6px; }
  .btn { min-height: 50px; font-size: 10px; }
  .hint { font-size: 12px; }
}
