/* ─── Custom Properties ────────────────────────────────────────────────────── */

:root {
  --sky-clear-top:    #87CEEB;
  --sky-clear-bottom: #FDB347;
  --sky-cloudy-top:   #B0C4DE;
  --sky-cloudy-bottom:#D3D3D3;
  --sky-night-top:    #0a1628;
  --sky-night-bottom: #1a1a3a;
  --card-bg:          rgba(255, 255, 255, 0.90);
  --card-border:      rgba(255, 255, 255, 0.65);
  --text-primary:     #2C1810;
  --text-secondary:   #6B5344;
  --text-name:        #C85A00;
  --text-muted:       #8D7464;
  --stat-bg:          rgba(255, 255, 255, 0.55);
  --btn-primary-bg:   #F4A225;
  --btn-primary-hover:#E8921A;
  --btn-secondary-bg: #2C1810;
  --btn-ghost-border: rgba(44, 24, 16, 0.28);
  --error-color:      #B83232;
  --radius-card:      24px;
  --radius-btn:       12px;
  --radius-stat:      12px;
  --transition-bg:    background 1.2s ease, backdrop-filter 1.2s ease;
}

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  background: linear-gradient(160deg, var(--sky-clear-top) 0%, var(--sky-clear-bottom) 100%);
  transition: var(--transition-bg);
  overflow-x: hidden;
}

body.state-cloudy,
body.state-error {
  background: linear-gradient(160deg, var(--sky-cloudy-top) 0%, var(--sky-cloudy-bottom) 100%);
}

body.state-night {
  background: linear-gradient(160deg, var(--sky-night-top) 0%, var(--sky-night-bottom) 100%);
}

body.state-night .sky-layer { opacity: 1; }
body.state-night .sun-rays  { display: none; }

/* Ensure HTML hidden attribute always wins over CSS display properties */
[hidden] { display: none !important; }

/* ─── Screen-reader Only ───────────────────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── Sky Layer / Sun Rays ─────────────────────────────────────────────────── */

.sky-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}

body.state-sunny .sky-layer {
  opacity: 1;
}

.sun-rays {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 200vmax;
  height: 200vmax;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 220, 100, 0.15) 0deg 10deg,
    transparent 10deg 20deg
  );
  animation: spin-rays 80s linear infinite;
}

@keyframes spin-rays {
  to { transform: translateX(-50%) rotate(360deg); }
}

/* Star field — visible only in state-night */
body.state-night .sky-layer::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: white;
  box-shadow:
    87px   42px  0 0   rgba(255,255,255,0.90),
    203px  67px  0 1px rgba(255,255,255,0.80),
    156px 178px  0 0   rgba(255,255,255,0.60),
    312px 121px  0 1px rgba(255,255,255,0.90),
    94px  312px  0 0   rgba(255,255,255,0.50),
    267px 289px  0 0   rgba(255,255,255,0.60),
    178px 445px  0 0   rgba(255,255,255,0.70),
    42px  523px  0 0   rgba(255,255,255,0.40),
    132px 634px  0 0   rgba(255,255,255,0.50),
    224px 756px  0 0   rgba(255,255,255,0.40),
    398px  56px  0 0   rgba(255,255,255,0.70),
    534px  45px  0 1px rgba(255,255,255,0.60),
    489px 145px  0 0   rgba(255,255,255,0.90),
    445px 234px  0 0   rgba(255,255,255,0.50),
    623px 267px  0 0   rgba(255,255,255,0.70),
    412px 512px  0 0   rgba(255,255,255,0.60),
    534px 389px  0 1px rgba(255,255,255,0.80),
    567px 678px  0 0   rgba(255,255,255,0.40),
    478px 734px  0 0   rgba(255,255,255,0.50),
    356px 823px  0 0   rgba(255,255,255,0.30),
    756px  89px  0 1px rgba(255,255,255,0.90),
    712px 178px  0 0   rgba(255,255,255,0.80),
    867px 156px  0 0   rgba(255,255,255,0.60),
    689px 423px  0 0   rgba(255,255,255,0.50),
    834px 334px  0 0   rgba(255,255,255,0.60),
    923px 156px  0 0   rgba(255,255,255,0.50),
    867px 445px  0 1px rgba(255,255,255,0.80),
    801px 567px  0 0   rgba(255,255,255,0.40),
    678px 712px  0 0   rgba(255,255,255,0.70),
    745px 834px  0 0   rgba(255,255,255,0.30),
   1034px  89px  0 0   rgba(255,255,255,0.70),
   1112px 267px  0 1px rgba(255,255,255,0.90),
   1189px 178px  0 0   rgba(255,255,255,0.60),
   1078px 445px  0 0   rgba(255,255,255,0.50),
   1234px 534px  0 0   rgba(255,255,255,0.80),
   1056px 623px  0 0   rgba(255,255,255,0.40),
   1145px 756px  0 0   rgba(255,255,255,0.50),
   1267px 312px  0 0   rgba(255,255,255,0.60),
   1312px  89px  0 1px rgba(255,255,255,0.70),
   1189px 845px  0 0   rgba(255,255,255,0.30),
   1423px  67px  0 0   rgba(255,255,255,0.80),
   1489px 234px  0 1px rgba(255,255,255,0.90),
   1534px 412px  0 0   rgba(255,255,255,0.50),
   1412px 578px  0 0   rgba(255,255,255,0.60),
   1623px 156px  0 0   rgba(255,255,255,0.70),
   1567px 734px  0 0   rgba(255,255,255,0.40),
   1712px  89px  0 1px rgba(255,255,255,0.80),
   1678px 345px  0 0   rgba(255,255,255,0.60),
   1756px 512px  0 0   rgba(255,255,255,0.50),
   1489px 845px  0 0   rgba(255,255,255,0.30),
   1845px 134px  0 0   rgba(255,255,255,0.70),
   1912px 267px  0 0   rgba(255,255,255,0.50),
   1867px 445px  0 1px rgba(255,255,255,0.80),
   1934px 623px  0 0   rgba(255,255,255,0.40);
  animation: star-twinkle 6s ease-in-out infinite;
}

@keyframes star-twinkle {
  0%, 100% { opacity: 1;    }
  50%       { opacity: 0.55; }
}

/* ─── Card ─────────────────────────────────────────────────────────────────── */

.card {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 2.75rem 2.25rem 2.25rem;
  max-width: 520px;
  width: 90%;
  margin: 4rem auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ─── Header ───────────────────────────────────────────────────────────────── */

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.site-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.site-tagline {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ─── Location Section ─────────────────────────────────────────────────────── */

#location-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ─── City Form Wrapper + Suggestions Dropdown ─────────────────────────────── */

.city-form-wrapper {
  position: relative;
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(44, 24, 16, 0.12);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  list-style: none;
  padding: 0.375rem 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.925rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  transition: background 0.1s;
}

.suggestion-item:hover,
.suggestion-item[aria-selected="true"] {
  background: rgba(244, 162, 37, 0.13);
}

.suggestion-item__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(44, 24, 16, 0.15);
}

.city-form {
  display: flex;
  gap: 0.5rem;
}

.city-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(44, 24, 16, 0.18);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.city-input::placeholder {
  color: var(--text-muted);
}

.city-input:focus {
  border-color: var(--btn-primary-bg);
  box-shadow: 0 0 0 3px rgba(244, 162, 37, 0.20);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn--primary {
  background: var(--btn-primary-bg);
  color: #fff;
  padding: 0.875rem 1.5rem;
  width: 100%;
  box-shadow: 0 2px 8px rgba(244, 162, 37, 0.30);
}

.btn--primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 162, 37, 0.40);
}

.btn--secondary {
  background: var(--btn-secondary-bg);
  color: #fff;
  padding: 0.75rem 1.125rem;
  flex-shrink: 0;
}

.btn--secondary:hover:not(:disabled) {
  background: #3D2318;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--btn-ghost-border);
  color: var(--text-secondary);
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(44, 24, 16, 0.06);
}

/* ─── Share Actions ────────────────────────────────────────────────────────── */

.share-actions {
  display: flex;
  gap: 0.375rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.btn--share {
  background: var(--btn-primary-bg);
  color: #fff;
  padding: 0.5rem 0.875rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(244, 162, 37, 0.30);
}

.btn--share:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 162, 37, 0.40);
}

.btn--tweet {
  background: #000;
  color: #fff;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-btn);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn--tweet:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

.btn--facebook {
  background: #1877F2;
  color: #fff;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-btn);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
  border: none;
}

.btn--facebook:hover {
  background: #166FE5;
  transform: translateY(-1px);
}

/* ─── Copy Toast ────────────────────────────────────────────────────────────── */

.copy-toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  background: rgba(44, 24, 16, 0.92);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1000;
  pointer-events: none;
  animation: toast-show 2.2s ease forwards;
}

@keyframes toast-show {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0);    }
  70%  { opacity: 1; transform: translateX(-50%) translateY(0);    }
  100% { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}

/* ─── Status Section ───────────────────────────────────────────────────────── */

#status-section {
  text-align: center;
  padding: 1rem 0;
}

.status-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  animation: pulse-text 1.6s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ─── Result Section ───────────────────────────────────────────────────────── */

#result-section {
  text-align: center;
  outline: none;
}

/* ─── Map View ──────────────────────────────────────────────────────────────── */

.map-view {
  width: 100%;
  height: 210px;
  border-radius: 16px;
  overflow: hidden;
  margin: 1.5rem 0 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14), 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.map-view .leaflet-control-attribution {
  font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.75);
}

.map-pin {
  width: 14px;
  height: 14px;
  background: #F4A225;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.40), 0 0 0 4px rgba(244, 162, 37, 0.28);
  animation: map-pin-pulse 2s ease-in-out infinite;
}

@keyframes map-pin-pulse {
  0%, 100% { box-shadow: 0 1px 5px rgba(0,0,0,0.40), 0 0 0 4px rgba(244,162,37,0.28); }
  50%       { box-shadow: 0 1px 5px rgba(0,0,0,0.40), 0 0 0 9px rgba(244,162,37,0);   }
}

.result-city {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

body.state-sunny #result-city {
  animation: result-item-in 0.4s ease-out 0.5s both;
}

.result-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

body.state-sunny #result-date {
  animation: result-item-in 0.4s ease-out 0.6s both;
}

body.state-sunny #result-headline {
  animation: headline-focus-in 0.55s ease-out 0.75s both;
}

@keyframes result-item-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes headline-focus-in {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: blur(0); }
}

.result-headline {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  font-style: normal;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.result-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 5.25rem;
  font-weight: 700;
  color: var(--text-name);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.25rem;
  outline: none;
  text-shadow: 0 0 32px rgba(244, 162, 37, 0.50), 0 3px 10px rgba(200, 90, 0, 0.18);
}

@keyframes name-reveal {
  0%   { opacity: 0; transform: scale(0.15); }
  50%  { opacity: 1; transform: scale(1.06); }
  65%  { transform: scale(0.96); }
  78%  { transform: scale(1.04); }
  89%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.result-name.is-revealed {
  animation:
    name-reveal    1.1s ease-out forwards,
    name-lock-glow 1.5s ease-out forwards;
}

@keyframes name-lock-glow {
  0%   { text-shadow: 0 0 60px rgba(255, 200, 50, 0.95), 0 0 30px rgba(244, 162, 37, 0.8); }
  100% { text-shadow: 0 0 32px rgba(244, 162, 37, 0.50), 0 3px 10px rgba(200, 90, 0, 0.18); }
}

.not-sunny-message {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.6;
}

/* ─── Sun Graphic ──────────────────────────────────────────────────────────── */

.sun-graphic {
  display: none;
  margin: 0 auto 1.25rem;
  width: 72px;
  height: 72px;
}

body.state-sunny .sun-graphic {
  display: block;
  animation:
    sun-pop-in      0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0s    both,
    sun-anticipate  0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s both;
}

@keyframes sun-anticipate {
  0%   { transform: scale(1)    rotate(0deg);  }
  20%  { transform: scale(1.20) rotate(12deg); }
  45%  { transform: scale(0.88) rotate(-8deg); }
  70%  { transform: scale(1.15) rotate(9deg);  }
  100% { transform: scale(1)    rotate(0deg);  }
}

@keyframes sun-pop-in {
  from { opacity: 0; transform: scale(0.5) rotate(-20deg); }
  to   { opacity: 1; transform: scale(1)   rotate(0deg);   }
}

.sun-halo {
  transform-origin: 50px 50px;
  animation: sun-halo-pulse 2.4s ease-in-out infinite;
}

.sun-rays-group {
  transform-origin: 50px 50px;
  animation: sun-rays-pulse 2.4s ease-in-out infinite;
}

@keyframes sun-halo-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.7;  }
  50%       { transform: scale(1.45); opacity: 0.12; }
}

@keyframes sun-rays-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;    }
  50%       { transform: scale(1.13); opacity: 0.5;  }
}

/* ─── Moon Graphic ─────────────────────────────────────────────────────────── */

.moon-graphic {
  display: none;
  margin: 0 auto 1.25rem;
  width: 136px;
  height: 136px;
  align-items: center;
  justify-content: center;
}

body.state-night .moon-graphic {
  display: flex;
  animation: sun-pop-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.moon-img {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 14px rgba(200, 210, 255, 0.45));
}

/* ─── Weather Graphic (non-sunny icons) ───────────────────────────────────── */

#weather-graphic {
  display: none;
  margin: 0 auto 1.25rem;
  width: 72px;
  height: 72px;
}

body.state-cloudy #weather-graphic {
  display: block;
}

.wx-icon {
  display: none;
  width: 72px;
  height: 72px;
}

#weather-graphic[data-category="cloud"]   .wx-icon--cloud   { display: block; }
#weather-graphic[data-category="fog"]     .wx-icon--fog     { display: block; }
#weather-graphic[data-category="drizzle"] .wx-icon--drizzle { display: block; }
#weather-graphic[data-category="rain"]    .wx-icon--rain    { display: block; }
#weather-graphic[data-category="snow"]    .wx-icon--snow    { display: block; }
#weather-graphic[data-category="storm"]   .wx-icon--storm   { display: block; }

body.state-cloudy #weather-graphic .wx-icon {
  animation: sun-pop-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Cloud: gentle float */
#weather-graphic[data-category="cloud"] .wx-cloud-body {
  animation: wx-cloud-float 3.6s ease-in-out infinite;
}

@keyframes wx-cloud-float {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-4px); }
}

/* Fog: lines drift left-right at staggered phases */
.wx-fog-line--1 { animation: wx-fog-drift 2.8s ease-in-out infinite alternate; }
.wx-fog-line--2 { animation: wx-fog-drift 2.8s ease-in-out 0.6s  infinite alternate; }
.wx-fog-line--3 { animation: wx-fog-drift 2.8s ease-in-out 1.2s  infinite alternate; }

@keyframes wx-fog-drift {
  from { transform: translateX(-4px); opacity: 0.55; }
  to   { transform: translateX(4px);  opacity: 1;    }
}

/* Drizzle: slow near-vertical fall */
#weather-graphic[data-category="drizzle"] .wx-drop--1 { animation: wx-drizzle-fall 2.4s linear 0s    infinite; }
#weather-graphic[data-category="drizzle"] .wx-drop--2 { animation: wx-drizzle-fall 2.4s linear 0.8s  infinite; }
#weather-graphic[data-category="drizzle"] .wx-drop--3 { animation: wx-drizzle-fall 2.4s linear 1.6s  infinite; }

@keyframes wx-drizzle-fall {
  0%   { transform: translateY(0);    opacity: 0;   }
  15%  { opacity: 1; }
  80%  { opacity: 0.8; }
  100% { transform: translateY(14px); opacity: 0;   }
}

/* Rain: faster angled fall */
#weather-graphic[data-category="rain"] .wx-drop--1 { animation: wx-rain-fall 1.2s linear 0s   infinite; }
#weather-graphic[data-category="rain"] .wx-drop--2 { animation: wx-rain-fall 1.2s linear 0.3s infinite; }
#weather-graphic[data-category="rain"] .wx-drop--3 { animation: wx-rain-fall 1.2s linear 0.6s infinite; }
#weather-graphic[data-category="rain"] .wx-drop--4 { animation: wx-rain-fall 1.2s linear 0.9s infinite; }

@keyframes wx-rain-fall {
  0%   { transform: translateY(0)    translateX(0);    opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(16px) translateX(-4px); opacity: 0; }
}

/* Snow: flakes fall and rotate */
.wx-flake--1 { animation: wx-snow-fall 3.2s ease-in-out 0s    infinite; }
.wx-flake--2 { animation: wx-snow-fall 3.2s ease-in-out 1.05s infinite; }
.wx-flake--3 { animation: wx-snow-fall 3.2s ease-in-out 2.1s  infinite; }

@keyframes wx-snow-fall {
  0%   { transform: translateY(0)    rotate(0deg);  opacity: 0;   }
  10%  { opacity: 1; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(14px) rotate(45deg); opacity: 0;   }
}

/* Storm: cloud floats, lightning double-flashes */
#weather-graphic[data-category="storm"] .wx-cloud-body {
  animation: wx-cloud-float 4s ease-in-out infinite;
}

.wx-lightning {
  transform-origin: 44px 54px;
  animation: wx-lightning-flash 2.2s ease-in-out infinite;
}

@keyframes wx-lightning-flash {
  0%, 40%, 80%, 100% { opacity: 1;   transform: scale(1);    }
  50%                 { opacity: 0.1; transform: scale(0.92); }
  60%                 { opacity: 0.9; transform: scale(1.05); }
  70%                 { opacity: 0.1; transform: scale(0.95); }
}

/* ─── Weather Stats ────────────────────────────────────────────────────────── */

.weather-stats {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.stat {
  background: var(--stat-bg);
  border-radius: var(--radius-stat);
  padding: 0.65rem 0.875rem;
  text-align: center;
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat__label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat__value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* ─── Error Section ────────────────────────────────────────────────────────── */

#error-section {
  text-align: center;
  padding: 0.5rem 0;
}

.error-icon {
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.error-text {
  color: var(--error-color);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .card {
    padding: 2rem 1.375rem 1.75rem;
    margin: 1.5rem auto;
    width: 94%;
  }

  .site-title {
    font-size: 1.6rem;
  }

  .result-name {
    font-size: 4rem;
  }

  .weather-stats {
    flex-direction: column;
  }

  .stat {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}

@media (max-width: 360px) {
  .result-name {
    font-size: 3.25rem;
  }
}
