* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: radial-gradient(circle at 20% 10%, #1a1e2b, #0b0d14);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 16px;
  color: #eef5ff;
}

.header {
  text-align: center;
  margin-bottom: 20px;
}

.site-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #e0f0ff, #7bc8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.datetime {
  font-size: 1.2rem;
  font-weight: 500;
  color: #b8d6ff;
  background: rgba(255,255,255,0.05);
  padding: 8px 18px;
  border-radius: 40px;
  border: 1px solid rgba(100, 180, 255, 0.3);
  display: inline-block;
  letter-spacing: 0.5px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  .site-title {
    font-size: 1.3rem;
  }
}

.card {
  background: rgba(18, 22, 30, 0.85);
  border: 1px solid rgba(74, 144, 226, 0.25);
  border-radius: 28px;
  padding: 18px 14px 16px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
  position: relative;
}

.card:hover {
  border-color: rgba(0, 212, 255, 0.6);
  box-shadow: 0 20px 40px rgba(0, 180, 255, 0.25);
}

.park-title {
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #b3e0ff, #6ccbff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coords {
  font-size: 0.65rem;
  font-weight: 400;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 20px;
  color: #a0c6f0;
}

.data-freshness {
  font-size: 0.55rem;
  color: #6b8ab0;
  text-align: right;
  margin-bottom: 4px;
}

.current-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0;
}

.weather-emoji {
  font-size: 2.5rem;
  line-height: 1;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}

.temp-value {
  font-size: 2.8rem;
  font-weight: 600;
  background: linear-gradient(to right, #f0f9ff, #d6ecff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.temp-degree {
  font-size: 1.3rem;
  font-weight: 500;
  margin-left: 2px;
  color: #8bb9ff;
}

.section-title {
  font-size: 0.55rem;
  color: #7f9bc0;
  text-align: center;
  margin: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hourly-strip {
  background: rgba(10, 14, 23, 0.7);
  border-radius: 18px;
  padding: 8px 4px;
  margin: 4px 0;
  border: 1px solid rgba(55, 110, 180, 0.35);
}

.hourly-row {
  display: flex;
  justify-content: space-around;
}

.hourly-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
  gap: 2px;
  padding: 4px 2px;
  min-height: 90px;
  justify-content: flex-start;
}

.hourly-cell.now-cell {
  background: rgba(255, 170, 46, 0.2);
  border-radius: 10px;
  padding: 4px 2px;
  border: 1px solid rgba(255, 170, 46, 0.5);
}

.hour-time {
  font-size: 0.65rem;
  font-weight: 500;
  color: #b0caf0;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.now-badge {
  font-size: 0.5rem;
  background: #ffaa2e;
  color: #1a1e2b;
  padding: 1px 4px;
  border-radius: 6px;
  font-weight: 700;
}

.hour-emoji {
  font-size: 1.4rem;
  line-height: 1;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hour-temp {
  font-weight: 600;
  font-size: 0.75rem;
  color: #e2edff;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hour-rain {
  font-size: 0.6rem;
  color: #7ec8ff;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rain-graph {
  background: rgba(10, 14, 23, 0.7);
  border-radius: 18px;
  padding: 8px 6px 14px;
  margin: 4px 0;
  border: 1px solid rgba(55, 110, 180, 0.35);
}

.rain-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 35px;
  gap: 4px;
}

.rain-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.rain-bar {
  width: 100%;
  background: linear-gradient(to top, #4a90d9, #7bc8ff);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
}

.rain-bar.now {
  background: linear-gradient(to top, #ff8c2e, #ffb366);
  box-shadow: 0 0 8px rgba(255, 140, 46, 0.5);
}

.rain-value {
  font-size: 0.5rem;
  color: #b0caf0;
  margin-top: 2px;
}

.daily-table {
  background: rgba(10, 14, 23, 0.7);
  border-radius: 14px;
  padding: 6px;
  margin: 4px 0;
  border: 1px solid rgba(55, 110, 180, 0.35);
}

.daily-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(55, 110, 180, 0.15);
}

.daily-row:last-child { border-bottom: none; }

.daily-row.today {
  background: rgba(255, 170, 46, 0.2);
  border: 1px solid rgba(255, 170, 46, 0.5);
  border-radius: 6px;
}

.daily-day {
  font-size: 0.65rem;
  font-weight: 600;
  color: #ffd966;
  width: 70px;
  flex-shrink: 0;
}

.daily-icon {
  font-size: 1.1rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.daily-temp {
  font-size: 0.8rem;
  color: #e2edff;
  width: 45px;
  text-align: center;
  flex-shrink: 0;
}

.daily-rain {
  font-size: 0.7rem;
  color: #7ec8ff;
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

.timer-section {
  margin-top: auto;
  background: rgba(0, 20, 40, 0.7);
  border-radius: 18px;
  padding: 10px;
  border: 1px solid rgba(0, 180, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.timer-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7f9bc0;
  margin-bottom: 4px;
}

.timer-display {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(180deg, #ffd966, #f0b34b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rain-amount {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 4px;
}

.rain-amount.wet { color: #ff6b6b; }
.rain-amount.dry { color: #2ee6b0; }

.rain-ended {
  font-size: 0.55rem;
  color: #94afcf;
  margin-top: 2px;
}

.rain-note {
  font-size: 0.55rem;
  color: #94afcf;
  margin-top: 4px;
}

.refresh-btn {
  display: block;
  margin: 20px auto;
  padding: 12px 30px;
  background: #1a3a5a;
  color: white;
  border: 1px solid rgba(0, 180, 255, 0.3);
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.refresh-btn:hover {
  background: #2a4a6a;
  border-color: rgba(0, 212, 255, 0.6);
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: #7f9bc0;
  padding: 50px;
  font-size: 1.2rem;
}

.error-card {
  text-align: center;
  padding: 30px;
  color: #ff6b6b;
}

.provider-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.provider-btn {
  padding: 10px 20px;
  background: rgba(18, 22, 30, 0.7);
  color: #7f9bc0;
  border: 1px solid rgba(74, 144, 226, 0.25);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s;
}

.provider-btn:hover {
  border-color: rgba(0, 180, 255, 0.5);
  color: #bdd6ff;
}

.provider-btn.active {
  background: rgba(0, 180, 255, 0.2);
  border-color: rgba(0, 212, 255, 0.7);
  color: #ffd966;
  box-shadow: 0 0 15px rgba(0, 180, 255, 0.3);
}
/* Убираем белую полоску в PWA на iOS */
:root {
  --safe-area-inset-top: env(safe-area-inset-top);
}

body {
  padding-top: env(safe-area-inset-top);
  background-color: #0b0d14;
}

@supports (-webkit-touch-callout: none) {
  body {
    padding-top: env(safe-area-inset-top);
    background-color: #0b0d14;
  }
}

/* Кнопки групп */
.group-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.group-btn {
  padding: 12px 20px;
  background: #1a3a5a;
  color: white;
  border: 1px solid rgba(0, 180, 255, 0.3);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s;
}

.group-btn:hover {
  background: #2a4a6a;
  border-color: rgba(0, 212, 255, 0.6);
}

.group-btn.active {
  background: rgba(0, 180, 255, 0.25);
  border-color: rgba(0, 212, 255, 0.7);
  color: #ffd966;
  box-shadow: 0 0 15px rgba(0, 180, 255, 0.3);
}

.now-badge {
  font-size: 0.5rem;
  background: #ffaa2e;
  color: #1a1e2b;
  padding: 1px 4px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}
.soil-status-badge {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  padding: 8px 16px;
  border-radius: 14px;
  display: block;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}