:root{
  --bg:#0b0f17; --card:#101826; --card2:#0f1724; --text:#e6edf3; --muted:#98a5b3;
  --green:#22c55e; --red:#ef4444; --border:#1d2636; --shadow:0 12px 34px -16px rgba(0,0,0,.6); --title:#74c0fc;
}
*{box-sizing:border-box} html,body{height:100%}
body{
  margin:0; background:radial-gradient(100% 140% at 0 0,#0a1322,#0b0f17); color:var(--text);
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Arial;
}
a{color:#9ecbff}
main{width:min(1200px,100%); margin:0 auto; padding:0 18px 56px}

.header{padding:26px 16px 12px; text-align:center}
.title{margin:0; font-weight:900; letter-spacing:.3px; font-size:clamp(24px,3.4vw,40px); color:var(--title)}
.subtitle{margin-top:8px; color:#bcd0e0; font-size:14px; display:flex; gap:8px; align-items:center; justify-content:center}

.grid-2{display:grid; grid-template-columns:1.15fr .95fr; gap:18px}
@media (max-width:980px){.grid-2{grid-template-columns:1fr}}
.full-span{ grid-column:1 / -1; }

.card{background:var(--card); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow)}
.pad{padding:16px 18px}
.card-h{display:flex; align-items:center; gap:8px; font-weight:800; color:#d7e3f1; margin:0 0 12px}
.hint{color:var(--muted); font-size:12px}

/* WEATHER CARD - REDESIGN MODERNO */
.w-grid{display:grid; grid-template-columns:1fr; gap:18px}
@media (max-width:720px){.w-grid{grid-template-columns:1fr}}

/* Card principal de temperatura - Glassmorphism style */
.w-temp{
  background: linear-gradient(135deg, rgba(15,33,54,0.9), rgba(15,23,36,0.95));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 24px 28px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 30px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.w-temp::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(59,130,246,0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(249,115,22,0.05), transparent);
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Conteúdo principal do card */
.w-temp-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

.w-temp-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}

.w-temp-location svg {
  width: 12px;
  height: 12px;
}

.w-temp-value {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.w-temp-number {
  font-size: clamp(56px, 8vw, 72px);
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  transition: transform 0.3s ease;
}

.w-temp-unit {
  font-size: 24px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-top: 8px;
}

.w-temp-desc {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

.w-temp-feels {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

.w-temp-feels svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Ícone do clima */
.w-temp-icon-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.w-temp-icon-wrap::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,200,87,0.15), transparent 70%);
  border-radius: 50%;
  animation: iconPulse 4s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.w-temp .icon {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.4));
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.w-temp:hover .icon {
  transform: scale(1.1) rotate(5deg);
}

/* Range de temperatura - Mini e Max */
.w-temp-range {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.w-temp-range-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.w-temp-range-item svg {
  width: 16px;
  height: 16px;
}

.w-temp-range-item.max {
  color: #f97316;
}

.w-temp-range-item.min {
  color: #60a5fa;
}

/* Estados dinâmicos baseados no clima */
.w-temp[data-weather="Clear"][data-period="day"] {
  background: linear-gradient(135deg, rgba(30,58,82,0.95), rgba(15,33,54,0.98));
  border-color: rgba(255,223,89,0.2);
}

.w-temp[data-weather="Clear"][data-period="day"]::before {
  background: 
    radial-gradient(circle at 85% 20%, rgba(255,223,89,0.2) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(251,191,36,0.08) 0%, transparent 40%);
}

.w-temp[data-weather="Clear"][data-period="day"] .w-temp-icon-wrap::before {
  background: radial-gradient(circle, rgba(255,200,87,0.25), transparent 70%);
}

.w-temp[data-weather="Clear"][data-period="night"] {
  background: linear-gradient(135deg, rgba(10,25,41,0.98), rgba(5,11,20,0.98));
  border-color: rgba(147,197,253,0.15);
}

.w-temp[data-weather="Clear"][data-period="night"]::before {
  background: 
    radial-gradient(circle at 80% 20%, rgba(147,197,253,0.1) 0%, transparent 50%),
    radial-gradient(circle at 10% 60%, rgba(99,102,241,0.05) 0%, transparent 40%);
}

.w-temp[data-weather="Clear"][data-period="night"] .w-temp-icon-wrap::before {
  background: radial-gradient(circle, rgba(147,197,253,0.15), transparent 70%);
}

.w-temp[data-weather="Clouds"][data-period="day"] {
  background: linear-gradient(135deg, rgba(30,46,66,0.95), rgba(20,27,40,0.98));
  border-color: rgba(148,163,184,0.2);
}

.w-temp[data-weather="Clouds"][data-period="day"]::before {
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(156,163,175,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(148,163,184,0.1) 0%, transparent 50%);
}

.w-temp[data-weather="Clouds"][data-period="night"] {
  background: linear-gradient(135deg, rgba(15,26,42,0.98), rgba(10,15,26,0.98));
  border-color: rgba(100,116,139,0.2);
}

.w-temp[data-weather="Rain"],
.w-temp[data-weather="Drizzle"] {
  background: linear-gradient(135deg, rgba(26,41,66,0.95), rgba(13,21,32,0.98));
  border-color: rgba(96,165,250,0.25);
}

.w-temp[data-weather="Rain"]::before,
.w-temp[data-weather="Drizzle"]::before {
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(96,165,250,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(59,130,246,0.08) 0%, transparent 50%);
}

.w-temp[data-weather="Thunderstorm"] {
  background: linear-gradient(135deg, rgba(30,27,61,0.95), rgba(13,10,31,0.98));
  border-color: rgba(167,139,250,0.3);
  animation: thunderGlow 4s ease-in-out infinite;
}

@keyframes thunderGlow {
  0%, 90%, 100% { box-shadow: 0 4px 30px rgba(0,0,0,0.3); }
  92%, 96% { box-shadow: 0 4px 60px rgba(167,139,250,0.4), inset 0 0 30px rgba(167,139,250,0.1); }
}

.w-temp[data-weather="Snow"] {
  background: linear-gradient(135deg, rgba(30,41,59,0.95), rgba(15,23,42,0.98));
  border-color: rgba(186,230,253,0.3);
}

/* Gradientes dinâmicos por temperatura */
.w-temp[data-temp-range="cold"] {
  border-color: rgba(59,130,246,0.35) !important;
}

.w-temp[data-temp-range="cold"]::before {
  background: 
    radial-gradient(circle at 50% 0%, rgba(59,130,246,0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(99,102,241,0.08) 0%, transparent 50%) !important;
}

.w-temp[data-temp-range="cold"] .w-temp-number {
  color: #60a5fa !important;
}

.w-temp[data-temp-range="warm"] {
  border-color: rgba(249,115,22,0.35) !important;
}

.w-temp[data-temp-range="warm"]::before {
  background: 
    radial-gradient(circle at 50% 0%, rgba(249,115,22,0.12) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(251,146,60,0.06) 0%, transparent 50%) !important;
}

.w-temp[data-temp-range="warm"] .w-temp-number {
  color: #f97316 !important;
}

.w-temp[data-temp-range="hot"] {
  border-color: rgba(239,68,68,0.4) !important;
}

.w-temp[data-temp-range="hot"]::before {
  background: 
    radial-gradient(circle at 50% 0%, rgba(239,68,68,0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(249,115,22,0.08) 0%, transparent 50%) !important;
}

.w-temp[data-temp-range="hot"] .w-temp-number {
  color: #ef4444 !important;
}

/* Indicadores de alerta com pulse */
.stat.alert {
  background: linear-gradient(135deg, rgba(239,68,68,.08), rgba(249,115,22,.05));
  border-color: rgba(249,115,22,.4);
  animation: alertPulse 2.5s ease-in-out infinite;
}

@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(249,115,22,.2), inset 0 0 10px rgba(239,68,68,.05); }
  50% { box-shadow: 0 0 20px rgba(249,115,22,.4), inset 0 0 15px rgba(239,68,68,.1); }
}

.stat.alert .lh {
  color: #fbbf24 !important;
  font-weight: 900;
}

.stat.alert .val {
  color: #f97316 !important;
  font-weight: 900;
}

/* Indicador extremo */
.stat.extreme {
  background: linear-gradient(135deg, rgba(239,68,68,.2), rgba(239,68,68,.1));
  border-color: rgba(239,68,68,.6);
  animation: extremePulse 1.5s ease-in-out infinite;
}

@keyframes extremePulse {
  0%, 100% { box-shadow: 0 0 15px rgba(239,68,68,.3), inset 0 0 15px rgba(239,68,68,.1); }
  50% { box-shadow: 0 0 25px rgba(239,68,68,.5), inset 0 0 20px rgba(239,68,68,.2); }
}

.stat.extreme .lh,
.stat.extreme .val {
  color: #ef4444 !important;
  font-weight: 900;
}

/* Grupos de stats - REDESIGN */
.w-stats-group {
  margin-bottom: 0;
}

.w-stats-group-title {
  display: none;
}

/* Stats Grid - Layout moderno */
.w-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width:1200px) { .w-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width:820px) { .w-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:520px) { .w-stats { grid-template-columns: 1fr 1fr; gap: 10px; } }

.stat {
  background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(15,23,36,0.9));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.stat:hover::before {
  opacity: 1;
}

.stat .lh {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat .lh svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.stat .val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1.1;
}

.stat .hint {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: -4px;
}

/* Cores específicas para cada stat */
.stat#stat-maxmin .lh svg { color: #f97316; }
.stat#stat-feels .lh svg { color: #a78bfa; }
.stat#stat-umid .lh svg { color: #60a5fa; }
.stat#stat-press .lh svg { color: #34d399; }
.stat#stat-rain .lh svg { color: #38bdf8; }
.stat#stat-wind .lh svg { color: #94a3b8; }
.stat#stat-rad .lh svg { color: #fbbf24; }
.stat#stat-sunrise .lh svg { color: #fb923c; }
.stat#stat-sunset .lh svg { color: #f472b6; }

/* Widget de Sol (nascer/pôr) - Linha do tempo */
.sun-timeline {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(15,23,36,0.9));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sun-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sun-timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.sun-timeline-item svg {
  width: 18px;
  height: 18px;
}

.sun-timeline-item.sunrise { color: #fb923c; }
.sun-timeline-item.sunset { color: #f472b6; }

.sun-timeline-item span {
  font-weight: 700;
}

.sun-timeline-bar {
  position: relative;
  height: 6px;
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
  border-radius: 10px;
  overflow: visible;
}

.sun-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #fb923c, #fbbf24, #f472b6);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.sun-timeline-indicator {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #fbbf24;
  border: 2px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(251,191,36,0.5);
  transition: left 0.5s ease;
}

@media (max-width:520px) {
  .sun-timeline { grid-column: span 2; }
}

/* Partículas de chuva */
.rain-particle {
  position: absolute;
  width: 1px;
  height: 12px;
  background: linear-gradient(to bottom, transparent, rgba(96,165,250,.6));
  animation: rainFall linear infinite;
  pointer-events: none;
}

@keyframes rainFall {
  to { transform: translateY(200px); }
}

/* Partículas de neve */
.snow-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,.8);
  border-radius: 50%;
  animation: snowFall linear infinite;
  pointer-events: none;
}

@keyframes snowFall {
  to { 
    transform: translateY(200px) translateX(20px);
    opacity: 0;
  }
}

/* Nuvens flutuantes - melhoradas */
.cloud-particle {
  position: absolute;
  background: rgba(156,163,175,.15);
  border-radius: 100px;
  animation: cloudFloat linear infinite;
  pointer-events: none;
  box-shadow: 
    0 0 20px rgba(156,163,175,.1),
    inset -10px -5px 15px rgba(255,255,255,.05);
}

.cloud-particle::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 10%;
  width: 60%;
  height: 80%;
  background: inherit;
  border-radius: 50%;
}

.cloud-particle::after {
  content: '';
  position: absolute;
  top: -20%;
  right: 15%;
  width: 50%;
  height: 70%;
  background: inherit;
  border-radius: 50%;
}

@keyframes cloudFloat {
  0% { transform: translateX(-150px); }
  100% { transform: translateX(calc(100% + 150px)); }
}

/* Raios de sol - melhorado */
.sun-ray {
  position: absolute;
  top: 30%;
  right: 15%;
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,223,89,.3), transparent);
  transform-origin: top center;
  animation: sunRotate 25s linear infinite;
  pointer-events: none;
  opacity: 0.6;
}

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

/* Estilos antigos removidos - nova estrutura */
.w-temp .hint { display: none; }
.w-temp .big { display: none; }

.weather-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: -6px;
  color: rgba(255,255,255,0.42);
  font-size: 12px;
}

.weather-alerts {
  display: grid;
  gap: 8px;
}

.weather-alerts[hidden] {
  display: none;
}

.weather-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(116,192,252,0.18);
  border-radius: 12px;
  background: rgba(14,37,62,0.55);
}

.weather-alert::before {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: #74c0fc;
  flex: 0 0 auto;
}

.weather-alert.warning {
  border-color: rgba(249,115,22,0.35);
  background: rgba(72,38,15,0.45);
}

.weather-alert.warning::before {
  background: #f97316;
}

.weather-alert.danger {
  border-color: rgba(239,68,68,0.45);
  background: rgba(74,18,25,0.48);
}

.weather-alert.danger::before {
  background: #ef4444;
}

.weather-alert-title {
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 800;
}

.weather-alert-message {
  margin-top: 2px;
  color: rgba(255,255,255,0.56);
  font-size: 12px;
}

/* Versão compacta ajustada */
.card.compact .w-temp { min-height: 180px; padding: 20px 24px; }
.card.compact .w-temp-number { font-size: clamp(48px, 7vw, 64px); }
.card.compact .w-temp-icon-wrap { width: 120px; height: 120px; }
.card.compact .w-temp .icon { width: 100px; height: 100px; }
.card.compact .w-stats { gap: 10px; }
.card.compact .stat .val { font-size: 20px; }

@media (max-width:720px) {
  .w-temp { 
    grid-template-columns: 1fr;
    text-align: center;
    padding: 20px;
  }
  .w-temp-main { align-items: center; }
  .w-temp-icon-wrap { 
    position: absolute;
    right: 10px;
    top: 10px;
    width: 80px;
    height: 80px;
  }
  .w-temp .icon { width: 70px; height: 70px; }
  .w-temp-range { justify-content: center; }
}

/* SATÉLITE */
.sat-wrap{position:relative; overflow:hidden; border-radius:12px; border:1px solid var(--border); cursor:pointer; transition: transform .3s ease;}
.sat-wrap:hover{transform: scale(1.02);}
.sat-badge{position:absolute; right:10px; top:10px; background:#0b1220; border:1px solid var(--border); color:#9ecbff; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:800}
.sat-img{display:block; width:100%; height:330px; object-fit:cover; background:#0b1220; transition: opacity .5s ease;}

/* CÂMERAS */
.camera-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.camera-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(420px, 100%);
  padding: 9px 12px;
  background: rgba(15,23,42,0.82);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}

.camera-search svg {
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,0.45);
  flex: 0 0 auto;
}

.camera-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
}

.camera-search input::placeholder {
  color: rgba(255,255,255,0.38);
}

.camera-filter {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: rgba(15,23,42,0.82);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}

.camera-filter-btn {
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  background: transparent;
  color: rgba(255,255,255,0.62);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.camera-filter-btn.active {
  background: rgba(116,192,252,0.18);
  color: #d9efff;
}

@media (max-width:720px) {
  .camera-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .camera-search,
  .camera-filter {
    width: 100%;
  }

  .camera-filter-btn {
    flex: 1 1 0;
  }
}

.section-title{display:flex; align-items:center; gap:8px; font-size:18px; font-weight:900; color:#d7e3f1}
.cams{display:grid; grid-template-columns:repeat(2,1fr); gap:18px}
@media (max-width:980px){.cams{grid-template-columns:1fr}}
.cam{
  background:var(--card); 
  border:1px solid var(--border); 
  border-radius:12px; 
  box-shadow:var(--shadow); 
  overflow:hidden; 
  cursor:pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.cam:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px -20px rgba(0,0,0,.8);
}
.cam .thumb{width:100%; height:210px; object-fit:cover; display:block; transition: transform .3s ease;}
.cam:hover .thumb {transform: scale(1.05);}
.cam .badge{position:absolute; right:10px; top:10px; padding:2px 8px; border-radius:999px; color:#fff; font-size:12px; font-weight:800}
.cam .online{background:var(--green)} .cam .offline{background:var(--red)} .cam .connecting{background:#f59e0b; animation: pulse 1.5s infinite}
.cam .body{padding:12px 14px} .cam .name{margin:0 0 2px; font-weight:800} .cam .loc{margin:0; font-size:13px; color:#9fb0bf} .cam .cta{margin:6px 0 0; font-size:12px; color:#8ecaff}
.cam[hidden] { display: none; }

.cam.is-featured {
  grid-column: span 2;
}

.cam.is-featured .thumb {
  height: 360px;
}

.cam.is-featured .name {
  font-size: 18px;
}

@media (min-width:1280px) {
  main { width:min(1360px,100%); }
  .cams { grid-template-columns:repeat(3,1fr); }
}

@media (max-width:980px) {
  .cam.is-featured {
    grid-column: span 1;
  }

  .cam.is-featured .thumb {
    height: 240px;
  }
}

@media (max-width:520px) {
  main { padding-inline: 12px; }
  .header { padding-inline: 12px; }
  .subtitle { flex-wrap: wrap; }
  .cam .thumb,
  .cam.is-featured .thumb {
    height: 190px;
  }
}

/* MODAL DE CAMERA */
.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(0,0,0,.86);
}

.camera-modal.is-open {
  display: flex;
}

.camera-modal-dialog {
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

.camera-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.camera-modal-title {
  min-width: 0;
}

.camera-modal-title > div:first-child {
  font-weight: 800;
}

.camera-modal-title > div:last-child {
  margin-top: 2px;
  color: #9fb0bf;
  font-size: 12px;
}

.camera-modal-actions,
.camera-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.camera-modal-body {
  padding: 12px;
}

.camera-media {
  position: relative;
  width: 100%;
  min-height: 320px;
  max-height: 72vh;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

.camera-media img,
.camera-media video {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.camera-media img {
  display: block;
}

.camera-media video {
  display: none;
}

.camera-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.72);
}

.camera-state[hidden],
.stream-status[hidden] {
  display: none;
}

.camera-state-content {
  text-align: center;
  color: #fff;
  font-size: 13px;
}

.camera-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border: 3px solid #333;
  border-top-color: #22c55e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.stream-status {
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.stream-status.connecting {
  background: #f59e0b;
}

.stream-status.error {
  background: var(--red);
}

.stream-status.reconnecting {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

.camera-controls {
  justify-content: center;
  margin-top: 10px;
}

@media (max-width:640px) {
  .camera-modal {
    padding: 0;
    align-items: stretch;
  }

  .camera-modal-dialog {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .camera-modal-header {
    align-items: flex-start;
  }

  .camera-media {
    min-height: 240px;
    max-height: 68vh;
  }

  .camera-media img,
  .camera-media video {
    max-height: 68vh;
  }

  .camera-controls .btn {
    flex: 1 1 calc(50% - 8px);
  }
}

/* MAPAS */
.map-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px}
@media (max-width:980px){.map-grid{grid-template-columns:1fr}}
.leaflet-map{width:100%; height:330px; border-radius:12px; border:1px solid var(--border); overflow:hidden}

footer{padding:28px 16px; text-align:center; color:#c3cfdb96; font-size:14px}
footer a{color:#9ecbff}
.btn{display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid var(--border); border-radius:10px; background:#111827; color:#e5e7eb; cursor:pointer; transition: background .2s ease;}
.btn:hover {background:#1f2937;}

/* Pulso de atualização */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}
.updating {
  animation: pulse 1s ease-in-out;
}

/* Removidos estilos do gráfico de raios */

/* ===== PRÓXIMAS HORAS ===== */
.hourly-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.hourly-strip::-webkit-scrollbar { height: 4px; }
.hourly-strip::-webkit-scrollbar-track { background: transparent; }
.hourly-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.hourly-item {
  flex: 0 0 72px;
  background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(15,23,36,0.9));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  cursor: default;
}
.hourly-item:hover {
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(20,32,56,0.9), rgba(15,25,45,0.95));
}
.hourly-item.current {
  border-color: rgba(116,192,252,0.35);
  background: linear-gradient(135deg, rgba(15,35,65,0.9), rgba(10,28,55,0.95));
}
.hourly-hour {
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.3px;
}
.hourly-item.current .hourly-hour { color: #74c0fc; }
.hourly-icon { width: 32px; height: 32px; object-fit: contain; }
.hourly-temp {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.hourly-pop {
  font-size: 10px;
  font-weight: 600;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 2px;
}
.hourly-pop.zero { color: rgba(255,255,255,0.2); }
.hourly-wind {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}

.meteogram {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.meteogram-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(34px, 1fr));
  align-items: end;
  gap: 6px;
  min-height: 128px;
}

.meteogram-bar {
  display: grid;
  grid-template-rows: 18px 72px 18px;
  gap: 5px;
  align-items: end;
  min-width: 0;
}

.meteogram-temp {
  color: rgba(255,255,255,0.75);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.meteogram-stack {
  position: relative;
  height: 72px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  overflow: hidden;
}

.meteogram-temp-fill,
.meteogram-rain-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 999px 999px 0 0;
}

.meteogram-temp-fill {
  background: linear-gradient(180deg, #fbbf24, #f97316);
}

.meteogram-rain-fill {
  min-height: 2px;
  background: linear-gradient(180deg, rgba(56,189,248,0.65), rgba(37,99,235,0.82));
}

.meteogram-hour {
  color: rgba(255,255,255,0.38);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.meteogram-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: rgba(255,255,255,0.35);
  font-size: 10px;
}

.cam.weather-watch {
  border-color: rgba(56,189,248,0.45);
  box-shadow: 0 16px 48px -22px rgba(56,189,248,0.75), var(--shadow);
}

.cam.weather-watch .cta {
  color: #38bdf8;
  font-weight: 800;
}

/* Light mode */
.light .hourly-item {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(248,250,252,0.95));
  border-color: rgba(0,0,0,0.08);
}
.light .hourly-item:hover { background: rgba(255,255,255,1); border-color: rgba(0,0,0,0.15); }
.light .hourly-item.current { border-color: rgba(37,99,235,0.35); background: rgba(239,246,255,0.95); }
.light .hourly-hour { color: rgba(0,0,0,0.5); }
.light .hourly-item.current .hourly-hour { color: #2563eb; }
.light .hourly-temp { color: #1e293b; }
.light .hourly-wind { color: rgba(0,0,0,0.3); }
.light .meteogram { border-top-color: rgba(0,0,0,0.08); }
.light .meteogram-stack { background: linear-gradient(180deg, rgba(15,23,42,0.08), rgba(15,23,42,0.03)); }
.light .meteogram-temp { color: rgba(15,23,42,0.72); }
.light .meteogram-hour,
.light .meteogram-caption { color: rgba(15,23,42,0.42); }

/* ===== DARK/LIGHT TOGGLE ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-left: 8px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }

/* ===== PREVISÃO 5 DIAS ===== */
.forecast-section { margin-top: 18px; }
.forecast-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 480px) { .forecast-strip { grid-template-columns: repeat(5, 1fr); gap: 6px; } }
.forecast-day {
  background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(15,23,36,0.9));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.forecast-day:hover { border-color: rgba(255,255,255,0.14); transform: translateY(-2px); }
.forecast-day-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.5); }
.forecast-day-date { font-size: 10px; color: rgba(255,255,255,0.3); }
.forecast-day-icon { width: 36px; height: 36px; object-fit: contain; }
.forecast-day-max  { font-size: 16px; font-weight: 800; color: #f97316; }
.forecast-day-min  { font-size: 13px; font-weight: 600; color: #60a5fa; }
.forecast-day-rain { font-size: 10px; color: #38bdf8; display: flex; align-items: center; gap: 3px; }
.forecast-loading  { text-align: center; color: rgba(255,255,255,0.3); padding: 20px; font-size: 13px; grid-column: 1/-1; }

/* Removido badge de alerta de raios */

/* ===== UV INDICATOR ===== */
.uv-low       { color: #22c55e !important; }
.uv-moderate  { color: #fbbf24 !important; }
.uv-high      { color: #f97316 !important; }
.uv-very-high { color: #ef4444 !important; }
.uv-extreme   { color: #a855f7 !important; }

/* ===== LIGHT MODE OVERRIDES ===== */
.light body { background: linear-gradient(135deg, #f0f4f8, #e8edf5); color: #1a2332; }
.light .card { background: linear-gradient(135deg, #ffffff, #f8fafc) !important; border-color: rgba(0,0,0,0.08) !important; }
.light .title { color: #1e3a5f; }
.light .subtitle { color: #4b6080; }
.light a { color: #2563eb; }
.light .card-h { color: #1e3a5f; }
.light .w-temp {
  background: linear-gradient(135deg, rgba(240,248,255,0.95), rgba(230,240,255,0.98)) !important;
  border-color: rgba(59,130,246,0.2) !important;
}
.light .w-temp-number { color: #1e293b !important; }
.light .w-temp-desc   { color: #334155 !important; }
.light .w-temp-location, .light .w-temp-feels { color: rgba(0,0,0,0.5) !important; }
.light .weather-meta { color: rgba(0,0,0,0.45); }
.light .weather-alert {
  background: rgba(239,246,255,0.95);
  border-color: rgba(37,99,235,0.16);
}
.light .weather-alert.warning {
  background: rgba(255,247,237,0.95);
  border-color: rgba(249,115,22,0.25);
}
.light .weather-alert.danger {
  background: rgba(254,242,242,0.95);
  border-color: rgba(239,68,68,0.3);
}
.light .weather-alert-title { color: #1e293b; }
.light .weather-alert-message { color: rgba(30,41,59,0.62); }
.light .stat {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(248,250,252,0.95)) !important;
  border-color: rgba(0,0,0,0.08) !important;
}
.light .stat .val { color: #1e293b !important; }
.light .stat .lh  { color: rgba(0,0,0,0.5) !important; }
.light .stat .hint { color: rgba(0,0,0,0.35) !important; }
.light .sun-timeline {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(248,250,252,0.95)) !important;
  border-color: rgba(0,0,0,0.08) !important;
}
.light .forecast-day {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(248,250,252,0.95));
  border-color: rgba(0,0,0,0.08);
}
.light .forecast-day-name { color: rgba(0,0,0,0.5); }
.light .forecast-day-date { color: rgba(0,0,0,0.3); }
.light .cam { background: #fff !important; border-color: rgba(0,0,0,0.1) !important; }
.light .cam .name { color: #1e293b; }
.light .cam .loc  { color: #4b6080; }
.light .camera-search,
.light .camera-filter {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.08);
}
.light .camera-search svg,
.light .camera-filter-btn {
  color: rgba(0,0,0,0.52);
}
.light .camera-search input {
  color: #1e293b;
}
.light .camera-search input::placeholder {
  color: rgba(0,0,0,0.38);
}
.light .camera-filter-btn.active {
  background: rgba(37,99,235,0.12);
  color: #1d4ed8;
}
.light .camera-modal-dialog,
.light .help-modal-dialog {
  background: #ffffff;
}
.light .camera-modal-header {
  border-bottom-color: rgba(0,0,0,0.08);
}
.light .camera-modal-title > div:first-child {
  color: #1e293b;
}
.light .camera-modal-title > div:last-child {
  color: #4b6080;
}
.light footer { color: rgba(0,0,0,0.45); }
.light .btn { background: #f1f5f9; border-color: rgba(0,0,0,0.1); color: #334155; }
/* Removidos overrides light mode do gráfico de raios */
.light .theme-toggle { border-color: rgba(0,0,0,0.15); background: rgba(0,0,0,0.05); color: rgba(0,0,0,0.7); }
.light .section-title { color: #1e3a5f; }
.light .hint { color: rgba(0,0,0,0.4) !important; }
.light .help-btn { border-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.7); }

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