:root {
  --small-square: 5ch;
  --title-height: 6em;
}

* {
  margin: 0;
  padding: 0;
}
html,
body {
  max-height: 100vh;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

.mobile-only {
  display: none;
}

#title {
  width: 100%;
  height: var(--title-height);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1em;
  background-color: #fff;
  color: #222222;
  padding-block: 1em;
  border-bottom: solid 2px;
}

#title-text div {
  overflow: hidden;
  width: 80vw;
  display: inline-block;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}

#view-swap {
  cursor: pointer;
  padding: 0.5em 0.6em;
  color: #b3b3b3;
  background-color: #222222;
  font-weight: 800;
  font-family: "Rubik", Arial, sans-serif;
  text-transform: uppercase;
  border: none;
  outline: none;
}

#view-swap:hover,
#view-swap:focus {
  background-color: #222222;
  color: #fff;
}

#container {
  width: 100%;
  height: calc(100vh - var(--title-height));
  position: relative;
}

.google-view {
  position: absolute;
}

.main-view {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.corner {
  width: 33%;
  height: 33%;
  z-index: 2;
  transition: 200ms ease-in-out;
}

.google-el {
  width: 100%;
  height: 100%;
}

.map-sizer,
.anchor {
  position: absolute;
}

.map-sizer {
  outline: none;
  border: none;
  background-color: darkgray;
  width: var(--small-square);
  height: var(--small-square);
  opacity: 0.4;
  z-index: 3;
}

.map-sizer:hover,
.map-sizer:focus {
  opacity: 1;
}

.top {
  top: 0;
}

.bottom {
  bottom: 0;
}

.left {
  left: 0;
}

.right {
  right: 0;
}

.top .expand {
  top: 0;
}

.bottom .expand {
  bottom: 0;
}

.left .expand {
  left: 0;
}

.right .expand {
  right: 0;
}

.top .minimize {
  bottom: 0;
}

.bottom .minimize {
  top: 0;
}

.left .minimize {
  right: 0;
}

.right .minimize {
  left: 0;
}

.top.left .map-sizer {
  transform: rotate(90deg);
}

.top.right .map-sizer {
  transform: rotate(180deg);
}

.bottom.right .map-sizer {
  transform: rotate(-90deg);
}

.anchor {
  border: none;
  outline: none;
  width: fit-content;
  color: #fff;
  background-color: #000;
  padding: 1ch;
  transition: 300ms ease-in-out;
  opacity: 0;
  z-index: 1;
}

.anchor:hover,
.anchor:focus {
  opacity: 1;
}

.corner.shrunk {
  width: 0;
  height: 0;
}

.shrunk .google-el::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #fff;
  z-index: 2;
}

#pano.empty {
  position: relative;
}

#pano.empty::before {
  position: absolute;
  content: "";
  inset: 0;
  background-color: gray;
  z-index: 2;
}

#pano.empty::after {
  position: absolute;
  content: attr(data-after);
  width: 100%;
  top: 50%;
  color: white;
  text-align: center;
  z-index: 3;
}

@media only screen and (max-width: 1000px) {
  :root {
    --small-square: 3ch;
  }
  #title {
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
  #container {
    height: 100%;
  }
  .tool-menu {
    position: absolute;
    top: 0;
    right: 0;
    height: 3vh;
    width: fit-content;
    z-index: 4;
  }
  .google-view {
    width: 100%;
    height: 50%;
  }
  .corner {
    top: 0;
  }
  .main-view {
    bottom: 0;
  }
  .google-view.shrunk {
    width: 100%;
    height: 0;
  }
  .map-sizer {
    background-color: black;
  }
  .map-sizer .icon {
    display: none;
  }
  .map-sizer .mobile-only {
    display: block;
  }
  .corner .map-sizer {
    transform: rotate(0deg) !important;
    bottom: 0;
  }
  .main-view .map-sizer {
    transform: rotate(180deg) !important;
    top: 0;
  }
  .full {
    height: 100%;
  }
  .map-sizer {
    width: 100%;
    height: var(--small-square);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .map-sizer.hidden {
    display: flex;
  }
  .map-sizer img {
    width: var(--small-square);
  }
  .minimize {
    opacity: 0.6;
  }
  .full .expand {
    display: none;
  }
  :not(.shrunk):not(.full) .expand {
    display: none;
  }
  .shrunk .minimize {
    display: none;
  }
  .full .minimize {
    display: none;
  }
  .shrunk .map-sizer.expand {
    display: flex;
  }
  .anchor {
    display: none;
  }
  .main-view.shrunk {
    height: var(--small-square);
    z-index: 99;
    opacity: 0.4;
  }

  .main-view.shrunk .expand {
    height: 100%;
  }
}
