:root {
  --bg: #020814;
  --panel: rgba(7, 17, 36, 0.86);
  --panel-strong: rgba(4, 12, 27, 0.95);
  --line: rgba(137, 170, 215, 0.28);
  --line-soft: rgba(137, 170, 215, 0.16);
  --text: #f2f8ff;
  --muted: #9fb2ce;
  --neon: #bcff1c;
  --cyan: #2fe7ff;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
}

body {
  overflow: hidden;
}

.surf-app {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
}

.glass-soft {
  background: rgba(7, 16, 34, 0.72);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
}

.map-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
}

.map-canvas {
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

.top-overlays {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1200;
  width: auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.search-wrap {
  position: relative;
  border-radius: 999px;
  padding: 4px;
}

.mobile-quick-controls {
  display: none;
}

.mobile-radar-btn {
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(188, 255, 28, 0.5);
  background: rgba(0, 0, 0, 0.62);
  color: #d6ffa2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.mobile-radar-btn.off {
  border-color: var(--line-soft);
  color: #dce7f8;
}

.search-wrap input {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(2, 15, 35, 0.92);
  color: #fff;
  font-size: 15px;
  padding: 0 18px;
  outline: none;
}

.search-wrap input::placeholder {
  color: #94abc8;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1500;
  display: none;
  border-radius: 12px;
  background: rgba(5, 14, 30, 0.98);
  border: 1px solid var(--line);
  overflow: hidden;
}

.suggestion {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.suggestion:hover {
  background: rgba(255, 255, 255, 0.08);
}

.suggestion strong {
  display: block;
  font-size: 13px;
}

.suggestion small {
  color: var(--muted);
}

.filters-row {
  border-radius: 999px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters-row::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.filter-btn.active {
  border-color: transparent;
  background: var(--neon);
  color: #0b1900;
  box-shadow: 0 0 18px rgba(188, 255, 28, 0.35);
}

.legend-card {
  position: absolute;
  top: 78px;
  left: 14px;
  z-index: 1100;
  width: 210px;
  border-radius: 14px;
  padding: 12px;
}

.legend-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.07em;
}

.legend-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.legend-card li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-card small {
  color: var(--muted);
  font-size: 11px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.dot.epic { background: #8f33ff; }
.dot.very-good { background: #ff9a28; }
.dot.good { background: #4de85f; }
.dot.regular { background: #30dfff; }
.dot.weak { background: #8fa1b9; }

.map-left-controls {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1100;
  width: 210px;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.ui-btn {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.ui-btn.active {
  color: #c8ff57;
  border-color: rgba(188, 255, 28, 0.55);
}

.detail-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 350px;
  z-index: 1200;
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
}

.detail-panel::-webkit-scrollbar {
  width: 7px;
}

.detail-panel::-webkit-scrollbar-thumb {
  background: rgba(143, 167, 204, 0.45);
  border-radius: 999px;
}

.detail-empty {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.detail-empty h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.detail-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.detail-title {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

.detail-title h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.detail-title span {
  color: var(--muted);
  font-size: 16px;
}

.detail-score {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 10px;
  margin-bottom: 10px;
}

.score-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.score-num {
  font-size: 54px;
  font-weight: 800;
}

.score-status {
  font-size: 34px;
  font-weight: 800;
}

.score-sub {
  margin: 7px 0 0;
  color: #c7d8f2;
  font-size: 12px;
  line-height: 1.4;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric {
  min-height: 81px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px;
}

.metric small {
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 39px;
}

.metric strong.metric-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dir-arrow {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-top: 2px solid #8defff;
  border-right: 2px solid #8defff;
  border-radius: 2px;
  transform: rotate(calc(var(--arrow-deg, 0deg) - 45deg));
  box-shadow: 0 0 10px rgba(47, 231, 255, 0.35);
}

.metric em {
  display: block;
  margin-top: 2px;
  color: #b6d6f5;
  font-style: normal;
  font-size: 12px;
}

.summary {
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px;
  color: #deebff;
  font-size: 13px;
  line-height: 1.55;
}

.detail-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.open-spot-btn {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(188, 255, 28, 0.45);
  background: linear-gradient(180deg, rgba(188, 255, 28, 0.95), rgba(161, 224, 25, 0.94));
  color: #001b00;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.alt-btn {
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
}

.camera-card {
  margin-top: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px;
}

.camera-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.camera-thumb {
  height: 120px;
  border-radius: 9px;
  background: radial-gradient(circle at 30% 30%, rgba(74, 127, 176, 0.55), rgba(9, 16, 29, 0.92));
  border: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}

.camera-thumb::before {
  content: "AO VIVO";
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 800;
  color: #98f75a;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 7px;
  border-radius: 999px;
}

.forecast-strip {
  border-radius: 14px;
  padding: 10px;
  overflow: hidden;
  flex: 0 0 auto;
}

.strip-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.strip-header h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.06em;
}

.strip-header small {
  color: var(--muted);
  font-size: 11px;
}

.day-cards {
  margin-top: 9px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 167, 204, 0.45) transparent;
  padding-bottom: 4px;
}

.day-cards::-webkit-scrollbar {
  height: 8px;
}

.day-cards::-webkit-scrollbar-thumb {
  background: rgba(143, 167, 204, 0.45);
  border-radius: 999px;
}

.day-card {
  flex: 0 0 188px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 9px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  scroll-snap-align: start;
}

.day-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(47, 231, 255, 0.3);
}

.day-card h4 {
  margin: 0;
  font-size: 15px;
}

.day-card .date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.day-card p {
  margin: 7px 0 0;
  font-size: 12px;
  color: #d6e5fb;
}

.weather-row {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #eff6ff;
}

.weather-row .weather-icon {
  font-size: 14px;
  line-height: 1;
}

.weather-row small {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}

.quality-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
}

.spot-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #041321;
  background: var(--spot-color, #30dfff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.09), 0 0 12px var(--spot-color, #30dfff), 0 0 28px color-mix(in oklab, var(--spot-color, #30dfff) 65%, transparent);
}

.spot-marker-hit {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.spot-marker::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--spot-color, #30dfff) 60%, transparent);
  opacity: 0;
}

.spot-marker.pulse::after {
  opacity: 1;
  animation: markerPulse 2.3s infinite ease-out;
}

.spot-marker.selected {
  transform: scale(1.15);
}

@keyframes markerPulse {
  0% { transform: scale(0.8); opacity: 0.95; }
  70% { transform: scale(1.5); opacity: 0.28; }
  100% { transform: scale(1.9); opacity: 0; }
}

.leaflet-tooltip.surf-tooltip,
.leaflet-popup-content-wrapper.surf-tooltip {
  background: rgba(3, 10, 22, 0.96);
  border: 1px solid var(--line-soft);
  color: #fff;
  border-radius: 10px;
}

.leaflet-tooltip.surf-tooltip::before,
.leaflet-popup-tip {
  display: none;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.leaflet-tooltip.spot-mini-label {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.leaflet-tooltip.spot-name-label {
  background: rgba(2, 10, 22, 0.86);
  border: 1px solid rgba(137, 170, 215, 0.42);
  color: #f3f8ff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.leaflet-tooltip.spot-name-label::before {
  display: none;
}

.leaflet-tooltip.spot-name-label.is-selected {
  border-color: rgba(188, 255, 28, 0.85);
  color: #dcff9a;
  box-shadow: 0 0 14px rgba(188, 255, 28, 0.38);
}

.storm-label {
  background: rgba(9, 22, 39, 0.85);
  border: 1px solid rgba(198, 255, 64, 0.45);
  color: #d6ffa2;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .detail-panel {
    width: 320px;
  }

  .legend-card,
  .map-left-controls {
    width: 190px;
  }
}

@media (max-width: 1050px) {
  body {
    overflow: auto;
  }

  .surf-app {
    height: auto;
    min-height: 100%;
  }

  .map-shell {
    height: auto;
    min-height: 760px;
    flex: 0 0 auto;
    display: grid;
    grid-template-rows: minmax(300px, 50dvh) auto auto;
    gap: 10px;
    padding-bottom: 0;
    overflow: visible;
  }

  .map-canvas {
    grid-row: 1;
  }

  .detail-panel {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    border-radius: 14px;
    max-height: min(62dvh, 720px);
    overflow: auto;
    grid-row: 2;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .detail-panel.is-empty {
    display: none;
    max-height: none;
    overflow: hidden;
  }

  .map-shell > .forecast-strip {
    grid-row: 2;
  }

  .map-shell > .detail-panel {
    grid-row: 3;
  }

  .top-overlays {
    top: 12px;
    right: 12px;
  }

  .legend-card {
    top: 100px;
  }

  .map-left-controls {
    bottom: 14px;
  }

  .day-card {
    flex-basis: 172px;
  }
}

@media (max-width: 720px) {
  .surf-app {
    padding: 8px;
    gap: 8px;
  }

  .map-shell {
    min-height: 700px;
    grid-template-rows: minmax(260px, 42dvh) auto auto;
    border-radius: 14px;
  }

  .map-canvas {
    border-radius: 14px;
  }

  .top-overlays {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .mobile-quick-controls {
    display: flex;
    justify-content: flex-start;
  }

  .search-wrap input {
    height: 42px;
    font-size: 14px;
  }

  .filters-row {
    justify-content: flex-start;
    padding: 5px;
  }

  .filter-btn {
    font-size: 10px;
    padding: 7px 11px;
  }

  .legend-card,
  .map-left-controls {
    display: none;
  }

  .detail-title h2 {
    font-size: 30px;
  }

  .detail-title span {
    font-size: 13px;
  }

  .score-num {
    font-size: 34px;
  }

  .score-status {
    font-size: 25px;
  }

  .metric strong {
    font-size: 26px;
  }

  .detail-panel {
    padding: 10px;
    max-height: min(58dvh, 600px);
  }

  .detail-panel.is-empty {
    max-height: none;
  }

  .detail-score {
    padding: 8px;
  }

  .detail-grid {
    gap: 6px;
  }

  .metric {
    min-height: 74px;
    padding: 8px;
  }

  .summary {
    font-size: 12px;
    line-height: 1.45;
  }

  .strip-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .strip-header h3 {
    font-size: 19px;
  }

  .day-cards {
    gap: 6px;
    scroll-snap-type: x mandatory;
    padding-right: 14px;
  }

  .day-card {
    flex: 0 0 58%;
    min-width: 58%;
    scroll-snap-align: center;
  }
}
