:root {
  --bg: #f4f5f7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.88);
  --text: #0f1720;
  --muted: #5f6b7a;
  --line: rgba(15, 23, 32, 0.08);
  --shadow: 0 28px 80px rgba(15, 23, 32, 0.10);
  --radius: 26px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: Inter, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.98), rgba(244,245,247,0.88) 45%, rgba(233,236,240,0.96) 100%);
}

.loading-overlay {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -10px);
  z-index: 20;
  min-width: min(92vw, 180px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.loading-overlay:not([hidden]) {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.is-loading .app-shell {
  opacity: 0.42;
  transform: scale(0.995);
}

body.is-loading .loading-overlay {
  animation: loading-pulse 900ms ease-in-out infinite alternate;
}

@keyframes loading-pulse {
  from {
    transform: translate(-50%, 0) scale(1);
  }
  to {
    transform: translate(-50%, 0) scale(1.02);
  }
}

.app-shell {
  width: min(100%, 760px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.weather-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,250,252,0.78));
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.refresh-button,
.data-link,
.data-back {
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.refresh-button:hover,
.data-link:hover,
.data-back:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.9);
  border-color: rgba(15, 23, 32, 0.15);
}

.visual-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
}

.weather-icon {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  border-radius: 22px;
  background: linear-gradient(140deg, rgba(255,255,255,0.9), rgba(241,244,247,0.76));
  border: 1px solid rgba(15, 23, 32, 0.05);
}

.temperature-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.temperature {
  margin: 0;
  font-size: clamp(3.3rem, 9vw, 5.5rem);
  line-height: 0.95;
  font-weight: 600;
  letter-spacing: -0.06em;
}

.location {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  max-width: 32ch;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.meta-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.value {
  font-size: 0.98rem;
  color: var(--text);
}

.map-card {
  margin-top: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  min-height: 280px;
  height: 320px;
  display: flex;
  flex-direction: column;
}

.map-frame {
  width: 100%;
  height: 100%;
  min-height: 230px;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 230px;
  border: 0;
  display: block;
}

.map-link {
  display: inline-block;
  margin: 12px 16px 16px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.map-link:hover {
  text-decoration: underline;
}

.data-shell {
  width: min(100%, 960px);
}

.data-card {
  padding: 24px;
}

.data-intro h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: -0.04em;
}

.data-intro p {
  margin: 0;
  color: var(--muted);
}

.data-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 14px;
}

.summary-pill {
  background: rgba(15, 23, 32, 0.05);
  border: 1px solid rgba(15, 23, 32, 0.08);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.note-card {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(244,247,250,0.78));
  border: 1px solid rgba(15, 23, 32, 0.08);
}

.note-card strong {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.note-card span {
  color: var(--text);
  line-height: 1.5;
}

.data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-panel {
  min-height: 190px;
}

.data-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
}

.data-list li + li {
  margin-top: 8px;
}

@media (max-width: 680px) {
  body { padding: 14px; }
  .weather-card { padding: 16px; }
  .header-actions { justify-content: flex-end; }
  .visual-row { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .temperature-wrap { align-items: center; }
  .meta-grid,
  .data-grid { grid-template-columns: 1fr; }
}
