html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: "Shrikhand", cursive;
  background-color: #14291d;
}

#forest {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  overscroll-behavior: none;
  overflow-anchor: none;
  touch-action: pan-x pan-y;
  background: #14291d;
}

#zoom-controls {
  position: fixed;
  top: 50%;
  right: max(8px, env(safe-area-inset-right));
  transform: translateY(-50%);
  z-index: 5;
  display: grid;
  gap: 1px;
}

#zoom-controls button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #f1e4db;
  background: #000;
  color: #f1e4db;
  font: 26px/1 sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

#zoom-controls button:disabled {
  color: #888;
  cursor: default;
}

#doors {
  position: relative;
  width: 5000px;
  height: 4140px;
  background: url(../img/regenwald.jpg) center top / 5000px 4140px no-repeat;
  z-index: 2;
  container-type: inline-size;
}

#door-layout {
  position: absolute;
  inset: 0;
}

.calendar-door:enabled:hover .nr {
  transform: scale(1.12);
}

.calendar-door:disabled {
  opacity: 0.7;
  cursor: default;
}

.animation-window {
  display: none;
  position: absolute;
  box-sizing: border-box;
  color: #14291d;
  z-index: 4;
}

.animation-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.animation-window.is-open {
  display: block;
  border-radius: 15%;
  filter: saturate(2);
  overflow: hidden;
}

.animation-placeholder {
  width: 100%;
  height: 100%;
}

.animation-video,
.animation-still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.animation-still {
  position: absolute;
  top: 0;
  left: 0;
}

.animation-number {
  position: absolute;
  z-index: 2;
  top: 5%;
  left: 8%;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  font:
    var(--animation-font)/1 "Shrikhand",
    cursive;
}

/* Reveal the corner number with the first visible picture of this door. */
.animation-still ~ .animation-number {
  visibility: hidden;
}

.has-picture ~ .animation-number {
  visibility: visible;
}

#controls {
  display: none;
  position: fixed;
  justify-content: center;
  align-items: center;
  z-index: 3;
  top: 0;
  left: 0;
  background: #000;
  gap: 12px;
  padding: 10px 12px;
}

#waveform {
  display: block;
  width: 180px;
  height: 40px;
  background: #000;
}

#stop {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: solid 1px #fff;
  padding: 0;
  color: #fff;
  cursor: pointer;
  background: #000;
}

#stop::before {
  content: "";
  width: 0;
  height: 0;
  border: 8px solid currentColor;
}

#credits {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  right: env(safe-area-inset-right, 0px);
  bottom: env(safe-area-inset-bottom, 0px);
  max-width: calc(100% - 16px);
  font: 13px sans-serif;
  background: #000;
  color: #f1e4db;
  position: fixed;
  z-index: 5;
}
#credits a {
  color: #ffffff;
  text-decoration: none;
}

#credits-toggle {
  display: block;
  border: 0;
  padding: 8px 12px;
  background: transparent;
  color: inherit;
  font: 12px/1.4 sans-serif;
  cursor: pointer;
}

#credits-toggle[aria-expanded="false"] + #credits-names {
  display: none;
}

#credits-names {
  padding: 10px 12px 0;
  line-height: 1.5;
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  /* Keep the minimum size in screen pixels as the rainforest zooms out. */
  #door-layout .calendar-door {
    font-size: max(var(--number-font), calc(20px / var(--scene-zoom, 1)));
  }

  .animation-number {
    font-size: max(var(--animation-font), calc(14px / var(--scene-zoom, 1)));
  }
}
