:root {
  --bg: #0b0b0b;
  --text: #f2f2f2;
  --muted: #a9a9a9;
  --line: #2a2a2a;
  --accent: #d6d6d6;
  --overlay-w: clamp(210px, 24vw, 300px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  overscroll-behavior: none;
}

body.forecast-page {
  overflow: hidden;
}

h1 {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
}

.block {
  border: 1px solid #3a3a3a;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}

.overlay {
  position: absolute;
  z-index: 10;
  background: rgba(12, 12, 12, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid #313131;
  border-radius: 11px;
  padding: 9px 11px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  max-width: calc(100vw - 28px);
}

.ranks {
  left: max(14px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  width: var(--overlay-w);
}

.playback {
  left: 50%;
  transform: translateX(-50%);
  bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px));
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  row-gap: 7px;
  width: min(420px, calc(100vw - 32px));
}

button {
  width: 38px;
  height: 38px;
  margin: 0;
  background: #1d1d1d;
  color: var(--text);
  border: 1px solid #3c3c3c;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1;
  transition: transform 120ms ease, background 150ms ease;
}

button:hover {
  background: linear-gradient(180deg, #2e2e2e 0%, #242424 100%);
}

button:active {
  transform: translateY(1px);
}

.value {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #eaf2fb;
}

.playback-time {
  align-self: center;
  font-size: 0.86rem;
  letter-spacing: 0.15px;
  color: #dfdfdf;
}

#hourSlider {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  height: 14px;
  background: transparent;
}

#hourSlider::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  border: 1px solid #3b3b3b;
  background: #6a6a6a;
}

#hourSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2px;
  height: 16px;
  border-radius: 2px;
  border: none;
  background: #e8e8e8;
  margin-top: -7px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

#hourSlider::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  border: 1px solid #3b3b3b;
  background: #6a6a6a;
}

#hourSlider::-moz-range-thumb {
  width: 2px;
  height: 16px;
  border-radius: 2px;
  border: none;
  background: #e8e8e8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

ol {
  margin: 0;
  padding-left: 16px;
}

li {
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.28;
}

.legend {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #333;
}

.legend h3 {
  margin: 0 0 6px 0;
  font-size: 0.68rem;
  text-transform: none;
  letter-spacing: 0.9px;
  color: #d5d5d5;
  font-weight: 600;
}

.legend-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  height: 8px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.legend-bar .seg {
  display: block;
  width: 100%;
  height: 100%;
}

.legend-bar .seg.c1 { background: #4396B9; }
.legend-bar .seg.c2 { background: #78E0CD; }
.legend-bar .seg.c3 { background: #E0FDBC; }
.legend-bar .seg.c4 { background: #FBEDB8; }
.legend-bar .seg.c5 { background: #F2B163; }
.legend-bar .seg.c6 { background: #C14452; }

.legend-scale {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  color: #bbbbbb;
  font-size: 0.66rem;
  letter-spacing: 0.4px;
  text-transform: lowercase;
}

.map-wrap {
  position: relative;
  height: 100dvh;
  min-height: 100vh;
}

.loading-overlay {
  position: fixed;
  top: var(--vv-top, 0px);
  left: 0;
  right: 0;
  height: var(--vvh, 100dvh);
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: blur(4px);
  transition: opacity 220ms ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-stack {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.loading-logo {
  width: 108px;
  height: 108px;
  display: block;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-top-color: #ffffff;
  animation: loading-spin 0.85s linear infinite;
}

.loading-card {
  width: min(320px, calc(100vw - 28px));
  border: 1px solid #2f2f2f;
  border-radius: 12px;
  background: rgba(14, 14, 14, 0.95);
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

@keyframes loading-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay.error .loading-card {
  border-color: #8a3a3a;
}

.loading-overlay.error .loading-title {
  color: #ffb7b7;
}

.map-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  padding: 8px 10px;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #eaeaea;
  font-size: 0.82rem;
  line-height: 1.3;
  max-width: 220px;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.map-tooltip .tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.map-tooltip .tooltip-row {
  color: #c8c8c8;
}

.logo-menu {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 20;
}

.logo-menu summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}

.logo-menu summary::-webkit-details-marker {
  display: none;
}

.logo-menu img {
  width: 100px;
  height: 100px;
  display: block;
  border: none;
  background: transparent;
  padding: 0;
}

.logo-menu[open] img {
  border-color: transparent;
}

.menu-card {
  position: absolute;
  right: 0;
  margin-top: 8px;
  min-width: 140px;
  background: rgba(12, 12, 12, 0.9);
  border: 1px solid #2f2f2f;
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.menu-card a {
  color: #e6e6e6;
  text-decoration: none;
  font-size: 0.86rem;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-card a:hover {
  background: rgba(255, 255, 255, 0.08);
}

#map {
  width: 100%;
  height: 100%;
  background: #080d11;
  touch-action: none;
}

.tagline {
  margin: 6px 0 8px;
  color: #cfcfcf;
  font-size: 0.75rem;
  line-height: 1.3;
}

.info-pop {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  top: max(120px, calc(env(safe-area-inset-top) + 110px));
  z-index: 20;
  width: 28px;
  min-height: 28px;
}

.info-pop summary {
  list-style: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid #333;
  color: #e7e7e7;
  font-size: 0.86rem;
  font-weight: 600;
  position: absolute;
  top: 0;
  right: 0;
}

.info-pop summary::-webkit-details-marker {
  display: none;
}

.info-card {
  position: absolute;
  top: 36px;
  right: 0;
  margin-top: 0;
  width: min(240px, calc(100vw - 28px));
  background: rgba(12, 12, 12, 0.92);
  border: 1px solid #2f2f2f;
  border-radius: 10px;
  padding: 10px 12px;
  color: #d8d8d8;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.page {
  min-height: 100vh;
  padding: 90px 20px 40px;
  display: flex;
  justify-content: center;
}

.page-card {
  width: min(900px, calc(100vw - 40px));
  background: rgba(12, 12, 12, 0.85);
  border: 1px solid #2f2f2f;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.page-card h1 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  letter-spacing: 0.7px;
}

.page-card h2 {
  margin: 18px 0 8px 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #d0d0d0;
}

.page-card p,
.page-card li {
  color: #c9c9c9;
  font-size: 0.95rem;
  line-height: 1.5;
}

.page-card ul {
  padding-left: 18px;
}

.report-img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid #2b2b2b;
  margin: 10px 0 22px;
}

@media (min-width: 901px) {
  .report-img {
    width: 50%;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 900px) {
  :root {
    --overlay-w: clamp(240px, 46vw, 320px);
  }

  .overlay {
    backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 8px 9px;
  }

  .playback {
    width: min(360px, calc(100vw - 24px));
    grid-template-columns: 34px 1fr;
    column-gap: 8px;
    row-gap: 6px;
  }

  button {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .playback-time {
    font-size: 0.8rem;
  }
}

@media (max-width: 560px) {
  .overlay {
    border-radius: 12px;
    padding: 10px 11px;
    background: rgba(14, 14, 14, 0.88);
    border-color: #3a3a3a;
  }

  .ranks {
    left: 50%;
    transform: translateX(-50%);
    top: max(8px, env(safe-area-inset-top));
    width: calc(100vw - 16px);
    max-width: 420px;
  }

  .playback {
    top: calc(max(8px, env(safe-area-inset-top)) + 252px);
    left: max(10px, env(safe-area-inset-left));
    bottom: auto;
    width: min(200px, calc((100vw - 20px) * 0.62));
    max-width: 200px;
    min-width: 0;
    transform: none;
    grid-template-columns: 32px 1fr;
    row-gap: 6px;
    padding-bottom: 8px;
  }

  #topZones {
    margin: 0;
    padding-left: 15px;
  }

  #topZones li {
    margin: 3px 0;
    font-size: 0.78rem;
  }

  #topZones li:nth-child(n + 4) {
    display: none;
  }

  #topZones li:nth-child(n + 4) {
    display: none;
  }

  .legend {
    margin-top: 8px;
    padding-top: 8px;
  }

  .legend h3 {
    margin-bottom: 5px;
  }

  .legend-bar {
    height: 7px;
  }

  .legend-scale {
    font-size: 0.63rem;
    margin-top: 3px;
  }

  button {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }

  .playback-time {
    font-size: 0.78rem;
  }

  #hourSlider {
    height: 12px;
  }

  #hourSlider::-webkit-slider-thumb {
    height: 14px;
    margin-top: -6px;
  }

  #hourSlider::-moz-range-thumb {
    height: 14px;
  }

  .logo-menu img {
    width: 95px;
    height: 95px;
  }

  .menu-card {
    min-width: 130px;
  }

  .info-pop {
    top: max(118px, calc(env(safe-area-inset-top) + 102px));
  }
}

@media (max-width: 390px) {
  .ranks,
  .playback {
    width: 50vw;
    min-width: 170px;
  }

  .overlay {
    padding: 9px 10px;
  }

  #topZones li {
    font-size: 0.75rem;
  }

  .playback {
    grid-template-columns: 34px 1fr;
  }

  button {
    width: 34px;
    height: 34px;
    font-size: 0.84rem;
  }
}
