html, body {
  height: 100%;
}

body {
  background-color: #000000;
  color: #00ff00;
  font-family: Courier, monospace;
  text-align: center;
  margin: 0;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

#container {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  width: 100%;
}

#clock {
  font-size: 180px;
  line-height: 1;
}

#dateWeekday {
  font-size: 64px;
  margin-top: 20px;
}

#condition-icon {
  margin-right: 0.15em;
}

#temp-block {
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  margin-top: 24px;
}

/* Tap the temperature or wind to switch °C/km/h <-> °F/mph (and date order) */
#temp-block, #wind {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-user-select: none;
  user-select: none;
}

#temp-main {
  font-size: 120px;
  margin-right: 24px;
}

#temp-range {
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  justify-content: center;
  font-size: 44px;
  text-align: left;
}

#weather-info {
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  margin-top: 24px;
}

#rain, #humidity {
  font-size: 44px;
  margin-right: 40px;
  white-space: nowrap;
}

#humidity {
  color: #66ccff;
}

#wind {
  font-size: 40px;
  white-space: nowrap;
}

#wind-direction-icon {
  display: inline-block;
}

/* Rain text colors */
.rain-dry  { color: #ffff66; }
.rain-wet  { color: #66ccff; }

/* Wind speed colors */
.wind-calm     { color: #66ffcc; }
.wind-moderate { color: #ff9933; }
.wind-strong   { color: #ff3333; }

/* Dim the whole weather block when data is stale */
.stale {
  opacity: 0.45;
}

/* Today's birthdays line (hidden when nobody has a birthday today) */
#birthdays {
  font-size: 32px;
  margin-top: 24px;
  color: #ffcc00;   /* gold */
}

.hidden {
  display: none;
}

/* ---------------------------------------------------------------------------
   Phone layout. The desktop/iPad sizes above are fixed pixels tuned for a
   large screen; on a narrow phone they overflow (the clock and wind spill off
   the edges). Below ~600px we switch to viewport-relative sizes so everything
   scales to the phone's width, and let the weather rows wrap instead of
   running off-screen.
   --------------------------------------------------------------------------- */
@media (max-width: 600px) {
  #container {
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px;
  }

  #clock {
    font-size: 17vw;   /* 8 monospace chars (HH:MM:SS) fit the width */
  }

  #dateWeekday {
    font-size: 9vw;
    margin-top: 3vw;
  }

  #temp-block {
    margin-top: 4vw;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
  }

  #temp-main {
    font-size: 16vw;
    margin-right: 4vw;
  }

  #temp-range {
    font-size: 6vw;
  }

  #weather-info {
    margin-top: 4vw;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
  }

  #rain, #humidity {
    font-size: 5.5vw;
    margin-right: 5vw;
  }

  #wind {
    font-size: 5.5vw;
  }

  #birthdays {
    font-size: 4.5vw;
    margin-top: 4vw;
  }
}
