@font-face {
  font-family: 'Segment7Standard';
  src: url('/Segment7Standard.otf') format('opentype');
  font-weight: normal;
}

label {
  display: block;
}

body {
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  background: #000;
  color: #e3e2e0;
  margin: 0;
  padding: 0;
  user-select: none;
  overflow: hidden;
  height: 100svh;
  width: 100svw;
}

#battery {
  margin: 0 auto;
  width: 1rem;
  display: flex;
  flex-direction: column;
  background: #000;
}

#battery-body {
  position: relative;
  height: 1.75rem;
  border: 1px solid #fff;
  width: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

#battery-button {
  margin: 0 0.2rem;
  background: #fff;
  height: 0.2rem;
}

#battery-level {
  position: absolute;
  background: #0a0;
  width: 100%;
  text-align: center;
  color: #fff !important;
  font-size: 0;
}

#battery-level.charging { background: #aa0; }
#battery-level.low { background: #f00; }

.views.is-night {
  opacity: 0.7;
}

* {
  box-sizing: border-box;
}

.views {
  position: fixed;
  top: 0;
  left: 0;
  height: 100svh;
  width: 100vw;
  display: grid;
  grid-template-columns: 100%;
}

.view-button {
  position:relative;
}

.view-button.active {
  background: #333;
}

.view-button:hover {
  background: #444 !important;
}

.view-button img {
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  transform: translate(-50%,-50%);
  filter: invert();
  left: 50%;
  top: 50%;
}

.view {
  display: none;
  grid-row: 1;
  grid-column: 1;
}

.view.show {
  display: block;
}

.view.clock {
  position: relative;
  grid-template-rows: calc(100% - 3rem) 3rem;
  grid-template-columns: calc(100% - 10rem) 10rem;
}

.view.clock.show {
  display: grid;
}

.time {
  grid-row:1;
  grid-column: 1;
  font-size: 13rem;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  padding-left: 1rem;
  text-shadow: 0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000,0 0 0.5rem #000;
}

.time.overlay {
  position: relative;
  opacity: 0.7;
  z-index: 2;
}

.digits {
  font-family: "Segment7Standard";
  position:relative;
}

.timesep {
  margin-top: -10%;
}

#date {
  grid-row:2;
  grid-column:1;
  font-size: 2rem;
  text-align: center;
  line-height: 1;
}

#weather {
  grid-column: 2;
  grid-row-start: 1;
  grid-row-end: 3;
  display: flex;
  flex-direction: column;
  justify-content: start;
  text-align: center;
  background: rgba(0,0,0,0.6);
  z-index: 3;
}

.condition-img {
  margin-top: 0.5rem;
}

#condition {
  height: 5rem;
  width: 5rem;
  filter: invert();
}

#tempbox {
  font-size: 3rem;
  display: flex;
  justify-content: center;
  align-items: end;
}

.unit {
  font-size: 75%;
}

.unit.deg {
  font-size: 50%;
}

#rainbox {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  border-radius: 0.5rem;
  margin: 0 0.5rem;
  padding: 0 0.5rem;
}

#rainbox.raining {
  background: #3355abaa;
}

#windbox {
  margin-bottom: 0.5rem;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

#winddir {
  background: #fff;
  border-radius: 100%;
  padding: 8px 6px 8px 10px;
}

#windouter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#windouter .unit {
  font-size: 75%;
}

#misc {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: auto 0.5rem 1.5rem;
}

#temps-scroller {
  position: absolute;
  opacity: 0.8;
  width: calc(100svw - 3.5rem);
  height: 100svh;
  top: 0;
  left: 0;
  z-index: 1;
  transition: opacity 5s;
}

.views.is-night #temps-scroller {
  opacity: 0.6;
}

#scale {
  position: absolute;
  top: 16px;
  left: 0;
  height: calc(100svh - 16px);
}

#scale div {
  background-color: rgba(0,0,0,0.4);
  padding: 0.125rem 0.5rem 0.125rem 0;
  border-radius: 0 100% 100% 0;
  left: 12px;
  position: absolute;
  transform: translateY(-50%);
  font-size: 0.8rem;
}

#scale div:before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 12px 12px 0px;
  border-color: transparent rgba(0,0,0,0.4) transparent transparent;
  position: absolute;
  top: 0;
  left: -12px;
}

#scale .p40 {
  top: 0;
  transform: none !important;
}

#scale .p40:before {
  border-width: 0px 12px 24px 0px;
}

#scale .p30 {
  top: 20%
}

#scale .p20 {
  top: 40%
}

#scale .p10 {
  top: 60%;
}

#scale .zero {
  background-color: transparent;
  top: 80%;
  display: none;
}

#scale .n10 {
  bottom: 0;
  transform: none !important;
}

#scale .n10:before {
  border-width: 24px 12px 0px 0px;
}

#temps-max, #temps-min {
  position: absolute;
  left: 0;
  width: 200svw;
  height: 0;
  border-top: 1px solid #fff;
  box-shadow: 0 0 3px #000;
  top: 20px;
}

#temps-inner {
  position: absolute;
  height: 100%;
  width: 200%;
  left:0;
  transition: left 0.3s linear;
}

#temps-pos, #temps-neg, #daylight, #rain {
  display: flex;
  align-items:stretch;
  flex-wrap: nowrap;
}

#rain-meter {
  height: 16px;
  width: 100%;
  display: flex;
  width: 100%;
}

.rain-hour {
  width: 2.083333333333333%;
  position: relative;
}

.rain-hour.thunder:after {
  content: '⚡';
  font-size: 16px;
}

#temps-pos {
  top: 16px;
  height: calc(80% - 24px);
  width: 100%;
}

#temps-inner>div>div,.weather-grid>div {
  height:100%;
  width: 4.1666666666666666666666666666667%;
}

#daylight {
  height: 8px;
  width: 100%;
  line-height: 1;
  font-size: 12px;
  text-shadow: 0 0 1px #000,0 0 1px #000,0 0 1px #000,0 0 1px #000;
}

.day {
  background:#3fa3da;
}

.night {
  background: #444;
}

.day + .night {
  background: linear-gradient(to right, #3fa3da, #444);
}

.night + .day {
  background: linear-gradient(to right, #444, #3fa3da);
}

#daylight>div>div {
  transform: translate(3px, -20%);
}

#temps-neg {
  height: 20%;
  width: 100%;
}

.columns {
  display: flex;
  flex-wrap: wrap;
}

.columns .header {
  padding: 0.25rem;
  background: #333;
  font-weight: bold;
  text-align:center;
  font-size: 1.3rem;
  width: 100%;
}

.columns .column {
  padding: 0.5rem;
  width: 50%;
}

.columns .label {
  padding: 0.5rem 0;
}

input:not([type="checkbox"]) {
  width: 100%;
  background: #000;
  border: 2px solid #fff;
  border-radius: 0.5rem;
  padding: 0.5rem;
  color: #fff;
  transition: box-shadow 0.2s;
  box-shadow: 0 0 0 0 #fff;
}

input:focus {
  outline: none !important;
  box-shadow: 0 0 0.25rem 0.25rem #fff;
}

.controls {
  padding: 0.5rem;
}

button {
  background: #000;
  border: 2px solid #fff;
  border-radius: 0.5rem ;
  padding: 0.5rem 2rem;
  color: #fff;
  transition: background-color 0.2s;
}

button:hover {
  background: #222;
}

.buttonbox {
  display: flex;
  flex-wrap: wrap;
  margin: 0.5rem 0;
  align-items: center;
  justify-content: center;
}

.buttonbox button {
  margin-right: 1rem;
}

#weather-tabs {
  display: flex;
  grid-row: 1;
}

.weather-tab {
  width: 50%;
  display: block;
  border-radius: 0;
  border: 0;
  padding: 1rem;
  background: #222;
  color: #fff;
}

.weather-tab.active {
  background: #333;
}

#weather-outer {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-rows: 3rem 2rem 1.5rem 1.5rem 1.5rem calc(100svh - 9.5rem);
}

.daybreak {
  border-left: 2px solid #fff;
}

.daytick {
  border-left: 1px solid #aaa;
}

.day.daytick {
  border-left: 1px solid #333;
}

.weather-grid {
  display: flex;
  width: 200%;
  align-items: stretch;
  flex-wrap: nowrap;
  text-align: center;
  position: relative;
}

#weather-temps {
  grid-row: 6;
}

#weather-cond {
  grid-row: 2;
  align-items: center;
  padding: 0.25rem 0;
}

#weather-cond img {
  filter: invert();
  max-height: 1.5rem;
  max-width: 100%;
  height: auto;
}

#weather-temps>div {
  position: relative;
}

#weather-temps span {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 100%;
  padding: 0 0.2rem 0.2rem;
  width: 1.5rem;
  height: 1.5rem;
  color: #000;
  display: block;
  left: 50%;
}

#weather-rain {
  grid-row: 3;
  font-size: 0.75rem;
  align-items: center;
}

#weather-rain>div {
  padding: 0.2rem 0 0 0;
}

#weather-wind {
  grid-row: 5;
  font-size: 0.8rem;
}

#weather-wdir {
  grid-row: 4;
  padding: 0.2rem;
}

#weather-wdir img {
  padding: 0.2rem;
  border-radius: 100%;
  background: #fff;
  width: 1.25rem;
  height: 1.25rem;
}

.timer.show {
  display: grid;
  grid-template-columns: 33.3333% 33.3333% 33.3333%;
  grid-template-rows: 50% 50%;
}

.timer>div {
  position: relative;
  padding: 1rem;
  text-align: center;
}

#colorbox {
  display: flex;
  flex-wrap: nowrap;
  margin: 0.5rem 2rem 0.25rem 2rem;
  border: 1px solid #ddd;
}

#colorbox>div {
  width: 2%;
  height: 2rem;
  text-align: center;
}

#colorlabel {
  display: flex;
  flex-wrap: nowrap;
  margin: 0 2rem 0.5rem 2rem;
}

#colorlabel div {
  width: 20%;
  text-align: left;
}

#colorlabel div.first-child {
  text-align: left;
}

#colorlabel div:nth-child(6) {
  width: 10%;
  text-align: right;
}

#colorlabel div:nth-child(5) {
  width: 10%;
  text-align: left;
}

.form-grid {
  display: flex;
  flex-wrap: wrap;
}

.form-grid>* {
  width: 50% !important;
  margin-bottom: 0.25rem !important;
}

.hide-scale .scale {
  display: none !important;
}

.hide-minmax #temps-min,.hide-minmax #temps-max {
  display: none !important;
}

@media (orientation: portrait) {
  .views {
    grid-template-columns: 100%;
    grid-template-rows: 100%;
  }

  .view {
    grid-row: 1;
    grid-column: 1;
    width: 100%;
  }

  .timer.show {
    grid-template-rows: 33.3333% 33.3333% 33.3333%;
    grid-template-columns: 50% 50%;
  }
  #weather {
    flex-direction: row;
    flex-wrap: wrap;
    position: fixed;
    bottom: 2.5rem;
    left: 0;
    width: 100svw;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
  }
  .view.clock.show {
    grid-template-columns: 100%;
  }
  .time {
    flex-direction: column;
    grid-column-start: 1;
    grid-column-end: 1;
    padding-top: 1rem;
    justify-content: start;
  }
  .timesep {
    display: none;
  }
  #temps-scroller {
    width: 100%;
    height: calc(100svh - 15rem);
  }
  #scale {
    height: calc(100svh - 15rem);
  }
  #condition {
    width: 4rem;
    height: 4rem;
  }
  .view.clock.show {
    grid-template-rows: calc(100svh - 2.5rem) 2.5rem;
  }
  #winddir {
    margin-right: 0.75rem;
  }
}
