* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07111f;
}

body {
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #173a66;
}

#liveForecast {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .18), transparent 50%),
    linear-gradient(135deg, #8ba9c6 0%, #3e79b8 45%, #173c69 100%);
}

body.live-mode #liveForecast { display: block; }
body.live-mode #forecastCanvas { display: none; }

#outlookMap {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1920px;
  height: 1080px;
  pointer-events: none;
}

.forecast-grid {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.forecast-grid.hourly {
  left: 1.563%;
  top: 18.981%;
  width: 96.875%;
  height: 72.222%;
}

.forecast-grid.ten-day {
  left: 1.563%;
  top: 18.519%;
  width: 96.875%;
  height: 74.074%;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.forecast-column {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .98);
  background: linear-gradient(#5e91c5 0%, #2f67a6 42%, #112f59 100%);
  color: #fff;
  text-align: center;
}

.forecast-column-header {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f7f7f5;
  color: #05070a;
  line-height: 1;
  text-transform: uppercase;
}

.hourly .forecast-column-header {
  height: 6.667%;
  font-size: clamp(26px, 2.23vw, 43px);
  font-weight: 900;
}

.ten-day .forecast-column-header {
  height: 11.42%;
}

.forecast-day {
  font-size: clamp(28px, 2.24vw, 43px);
  font-weight: 900;
}

.ten-day .is-tonight .forecast-day {
  font-size: clamp(18px, 1.4vw, 27px);
}

.forecast-date {
  margin-top: 4px;
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: clamp(18px, 1.4vw, 27px);
  font-weight: 500;
}

.forecast-weather-icon {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  object-fit: contain;
  border: 0;
  pointer-events: none;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, .35));
}

.forecast-weather-icon > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.forecast-weather-icon {
  width: 94%;
}

.forecast-holiday-icon {
  position: absolute;
  top: 11.5%;
  left: 55%;
  width: 46%;
  height: 13.5%;
  transform: translateX(-50%);
  object-fit: contain;
  border: 0;
  pointer-events: none;
  filter: drop-shadow(0 7px 9px rgba(0, 0, 0, .42));
}

.forecast-holiday-icon > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hourly .forecast-weather-icon {
  top: 18%;
  height: 28%;
}

.ten-day .forecast-weather-icon {
  top: 21%;
  height: 31%;
}

.forecast-pop,
.forecast-condition,
.forecast-temperature,
.forecast-wind,
.forecast-high,
.forecast-low {
  position: absolute;
  left: 5%;
  right: 5%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Arial Narrow", Arial, sans-serif;
  line-height: 1.04;
  text-transform: uppercase;
}

.forecast-pop {
  top: 40.5%;
  height: 9%;
  font-size: clamp(24px, 1.93vw, 37px);
  font-weight: 800;
  left: auto;
  right: 7%;
  width: 86%;
  justify-content: flex-end;
  text-align: right;
}

.forecast-condition {
  top: 52%;
  height: 21%;
  font-size: clamp(24px, 1.76vw, 34px);
  font-weight: 800;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.hourly .forecast-condition {
  overflow: hidden;
}

.hourly .forecast-temperature {
  top: 78%;
  height: 13%;
  font-size: clamp(58px, 4.48vw, 86px);
  font-weight: 900;
}

.hourly .forecast-temperature.is-three-digit {
  font-size: clamp(54px, 4.17vw, 80px);
}

.forecast-wind {
  bottom: .5%;
  height: 9%;
  font-size: clamp(21px, 1.72vw, 33px);
  font-weight: 700;
}

.ten-day .forecast-pop {
  top: 44.5%;
  height: 7%;
}

.ten-day .forecast-condition {
  top: 55.5%;
  height: 21%;
}

.ten-day .forecast-condition.is-compact {
  font-size: clamp(19px, 1.5vw, 29px);
}

.ten-day .forecast-condition.is-tight {
  font-size: clamp(17px, 1.3vw, 25px);
}

.forecast-high {
  top: 80%;
  height: 12%;
  font-size: clamp(54px, 4.17vw, 80px);
  font-weight: 900;
}

.forecast-low {
  bottom: 0;
  height: 10%;
  font-size: clamp(36px, 2.6vw, 50px);
  font-weight: 700;
}

#renderStatus {
  position: fixed;
  left: 18px;
  bottom: 18px;
  padding: 9px 12px;
  border: 1px solid rgba(128, 205, 255, .5);
  border-radius: 4px;
  background: rgba(3, 12, 21, .86);
  color: #eaf7ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}

body.ready #renderStatus { display: none; }
