:root {
  color-scheme: dark;
  --bg: #0b1220;
  --hud: rgba(12, 18, 32, 0.9);
  --accent: #e11d48;
  --text: #f8fafc;
  --muted: #94a3b8;
  --hud-bottom: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  overflow: hidden;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body.embed #map,
body:not(.embed) #map {
  position: absolute;
  inset: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #0b1220;
}

.hud {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--hud-bottom) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--hud);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  pointer-events: auto;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-row.products {
  flex-wrap: wrap;
  gap: 6px;
}

#btnPlay, #btnWorld, #btnBase, .prod {
  height: 34px;
  border: 0;
  border-radius: 17px;
  background: rgba(148, 163, 184, 0.25);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 0 11px;
}

#btnPlay {
  background: var(--accent);
  min-width: 40px;
}

.prod.active {
  background: var(--accent);
}

#frameSlider {
  flex: 1;
  accent-color: var(--accent);
}

#frameLabel {
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}

.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  flex: 1;
}

.meteo-age {
  font-size: 11px;
  font-weight: 650;
  color: #cbd5e1;
  line-height: 1.3;
  flex: 1;
  font-variant-numeric: tabular-nums;
}

.meteo-age.stale {
  color: #fbbf24;
}

.meteo-age.refreshing {
  color: #7dd3fc;
}

.status {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  max-width: 92%;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--hud);
  font-size: 12px;
  color: var(--muted);
  z-index: 1000;
  pointer-events: none;
  text-align: center;
}

.status.hidden { display: none; }

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.45) !important;
  color: #cbd5e1 !important;
  font-size: 10px !important;
  margin-bottom: calc(var(--hud-bottom) + 110px) !important;
}

.airport-label {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(225, 29, 72, 0.55);
  color: #fff;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.wind-arrow {
  color: #38bdf8;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  transform-origin: center center;
}

.jet-arrow {
  color: #fbbf24;
}

.leaflet-control-velocity {
  background: rgba(12, 18, 32, 0.82) !important;
  color: #e2e8f0 !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  margin-bottom: calc(var(--hud-bottom) + 118px) !important;
}

.velocity-overlay {
  pointer-events: none;
}

/* —— Sat Color: foto HD (pinch/pan), no tiles —— */
.satcolor-viewer {
  position: absolute;
  inset: 0;
  z-index: 900;
  background: #000;
  overflow: hidden;
  touch-action: none;
}

.satcolor-viewer.hidden {
  display: none;
}

.satcolor-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.satcolor-stage img {
  max-width: none;
  max-height: none;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.satcolor-meta {
  position: absolute;
  top: calc(52px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(12, 18, 32, 0.82);
  font-size: 11px;
  color: #e2e8f0;
  line-height: 1.35;
  pointer-events: none;
  text-align: center;
}

.satcolor-feeds {
  flex-wrap: wrap;
  gap: 6px;
}

.satcolor-feeds.hidden {
  display: none;
}

.satcolor-feeds .feed {
  height: 30px;
  border: 0;
  border-radius: 15px;
  background: rgba(148, 163, 184, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  padding: 0 10px;
}

.satcolor-feeds .feed.active {
  background: var(--accent);
}

body.satcolor-mode #timelineRow {
  display: none;
}

body.satcolor-mode #btnBase,
body.satcolor-mode #btnWorld {
  display: none;
}

/* Copy SEO / accesible: en el HTML inicial para crawlers; no tapa el mapa */
.meteo-seo {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  color: var(--text);
}

.meteo-seo a {
  color: #fda4af;
}

body.embed .meteo-seo {
  display: none;
}

/* Chrome de sitio (ordenador / navegador; oculto en WebView embed=1) */
.meteo-site-chrome {
  display: none;
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 1100;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border-radius: 12px;
  background: var(--hud);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  pointer-events: auto;
}

.meteo-site-chrome .chrome-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.meteo-site-chrome .chrome-sep {
  color: var(--muted);
}

.meteo-site-chrome .chrome-title {
  color: #fda4af;
}

body:not(.embed) .meteo-site-chrome {
  display: inline-flex;
}

body:not(.embed) .status {
  top: calc(56px + env(safe-area-inset-top));
}

@media (min-width: 900px) {
  body:not(.embed) .hud {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 48px));
  }

  body:not(.embed) #btnPlay,
  body:not(.embed) #btnWorld,
  body:not(.embed) #btnBase,
  body:not(.embed) .prod {
    height: 38px;
    font-size: 13px;
    padding: 0 14px;
    cursor: pointer;
  }
}

