:root {
  --sky-color: #4a90e2;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "Inter", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

body {
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.24), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--sky-color), #ffffff 10%), var(--sky-color));
  color: #ffffff;
  display: grid;
  place-items: center;
  transition: background 600ms ease-in-out;
}

body.error-mode {
  background-image: var(--rabbit-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

main {
  text-align: center;
  padding: 1rem;
  width: min(980px, calc(100vw - 2rem));
  display: grid;
  justify-items: center;
  margin-top: -1.5rem;
}

#time {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

#meta {
  margin-top: 0.75rem;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  opacity: 0.92;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

#forecast {
  margin-top: 1rem;
  width: min(980px, 100%);
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.24);
  border-radius: 0.75rem;
  backdrop-filter: blur(4px);
}

#forecast h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

#forecastList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.45rem;
}

.forecast-item,
.forecast-empty {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  padding: 0.45rem 0.5rem;
  display: grid;
  grid-template-columns: 1fr 0.7fr 0.55fr 0.8fr;
  gap: 0.35rem;
  font-size: 0.78rem;
  align-items: center;
}

.forecast-empty {
  grid-column: 1 / -1;
  justify-content: center;
  text-align: center;
}

#timeline {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.4rem;
  max-width: min(1000px, calc(100vw - 7rem));
  margin: 0 auto;
  padding: 0.6rem 0.9rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 0.75rem;
  backdrop-filter: blur(4px);
}

#timeline label,
#historyLabel {
  font-size: 0.86rem;
}

#historySlider {
  width: 100%;
}

#refreshButton {
  position: fixed;
  right: 1rem;
  bottom: 5.9rem;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f2740;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

#refreshButton:hover {
  background: #ffffff;
}

#refreshButton:disabled {
  opacity: 0.75;
  cursor: wait;
}

@media (max-width: 760px) {
  main {
    margin-top: -1.2rem;
  }

  .forecast-item {
    grid-template-columns: 1fr 1fr;
    font-size: 0.8rem;
  }
}
