:root {
  --rx: 21.8deg;
  --rz: 0deg;
  --s: 1.8;
}

html,
body {
  margin: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

body {
  padding: 2rem;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 20% 80%, #a6c6dd 0%, transparent 40%),
    linear-gradient(180deg, #b7d1e6 0%, #d5e6f2 50%, #eef6fb 100%);
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

body * {
  transition: all 0.25s cubic-bezier(0.6, 0.1, 0.1, 0.7);
}

.panel_left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}
.panel_left_top {
  margin: 0 4rem 0 0;
  padding: 0 0 0 1rem;
}

.panel_left_top > * {
  margin: 0;
}

.panel_left_top > p {
  margin: 0;
  line-height: 2.75rem;
  font-size: 48px;
  font-weight: 700;
  color: #2f5f88;
}

.panel_left_top > h4 {
  padding: 0.5rem 0.25rem 0;
  font-size: 12px;
  color: #3c5f7f;
  font-weight: 200;
}

.panel_left_bottom {
  box-sizing: border-box;
  width: 100%;
  flex-grow: 1;
  padding: 0 1rem;

  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

.panel_left_bottom > * {
  justify-content: center;
}

/* Layout 2 */
.panel_left_bottom.layout_2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, auto);
}
.panel_left_bottom.layout_2 * {
  font-size: 14px !important;
}

.panel_left_bottom.layout_2 > div:hover {
  cursor: grab;
  box-shadow:
    3px 3px 6px rgba(85, 91, 100, 0.5),
    -1px -1px 2px rgba(255, 255, 255, 0.7);
}

.ban_animate,
.ban_animate * {
  transition: none !important;
}

.panel_right {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  /* display: none; */
}

.panel_right_top {
  /* flex: 1; */
  flex: 0 0 1;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
  flex: 3;
  flex-grow: 1;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  /* transform: skew(-30deg, 0); */
}

#map.layout_2 {
  mask-image: radial-gradient(circle at center, #000 30%, transparent 45%);
  width: 50%;
  height: 50%;
  position: fixed;
  right: -10%;
  bottom: 5%;
  z-index: -1;
  opacity: 0.35;
}

#building {
  width: 100%;
  height: 100%;
  display: block;
  filter: blur(0.2px);
}

#log,
#log2 {
  color: #fff;
  font-family: monospace;
  text-shadow:
    0 0 0.5rem #2f5f88,
    0 0 1rem #2f5f88;
  text-align: right;
  padding: 1rem;
  margin: 0;
}

#log {
  position: absolute;
  bottom: 0;
  right: 0;
}

#log2 {
  display: none;
  position: fixed;
  top: 2rem;
  right: 2rem;
}

#log2.layout_2 {
  display: initial;
}

#bg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  z-index: -1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* background: rgba(85, 85, 85, 0.8); */
}

#bg,
#bg * {
  transition: opacity 0.2s;
}

#source_sky {
  display: none;
}

#sky {
  display: none;
  width: 100%;
  /* height: 75%; */
  background: url(../img/sky1.png) top / 100% 100% no-repeat;
  overflow: hidden;
  z-index: 1;
  position: relative;
  opacity: 0.5;
}

#blocker {
  width: 100%;
  position: absolute;
  top: 0;
  background:
    radial-gradient(circle at 20% 80%, #a6c6dd 0%, transparent 40%),
    linear-gradient(180deg, #b7d1e6 0%, #d5e6f2 50%, #eef6fb 100%);
}

#ground {
  position: absolute;
  opacity: 0;
  top: -100%;
  width: 100%;
  height: 200%;
  background-image: url("../img/concrete_floor_worn_02_diff_2k.avif");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: auto 200%;
  /* transform-origin: top center; */
  transform-origin: center center;
  filter: grayscale(0.2) brightness(0.9);
  box-sizing: border-box;
  flex-grow: 1;

  /* transform: rotateX(21.8deg) scale(1.8); */
  transform: rotateX(var(--rx)) rotateZ(var(--rz)) scale(var(--s));
  will-change: transform, opacity;
  z-index: -1;
}

#progress {
  position: fixed;
  left: 0;
  bottom: 0;
  height: 0.5rem;
  width: 0%;

  background: linear-gradient(to bottom, #7fd3ff 0%, #4da9e6 40%, #2d7bb5 100%);

  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);

  transition: width 0.05s linear;
}

.button {
  /* padding: 1rem 0 0; */
  padding: 0 0 1rem 1rem;
  position: absolute;
  bottom: 0;
}

#chat {
  position: fixed;
  width: 60%;
  height: 100%;
  left: 20%;
  top: 0%;
  opacity: 0;
  transform: scale(0.9);
  transform-origin: center center;
  pointer-events: none;
}

#chat.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#chat > iframe {
  width: 100%;
  height: 100%;
  user-select: none;
}

#chatBtn {
  position: fixed;
  left: 3.5rem;
  bottom: 1.5rem;

  width: 4rem;
  height: 4rem;
  padding: 0;
  border: 0;
  outline: none;
  cursor: pointer;
  position: fixed;

  display: grid;
  place-items: center;

  background: linear-gradient(
    180deg,
    rgba(159, 208, 245, 0.22),
    rgba(90, 169, 230, 0.16)
  );

  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  box-shadow:
    inset 8px 8px 18px rgba(255, 255, 255, 0.22),
    inset -10px -12px 20px rgba(0, 0, 0, 0.08),
    0 10px 30px rgba(90, 169, 230, 0.2);

  border-radius: 43% 57% 51% 49% / 39% 42% 58% 61%;
  animation:
    morphA 5s ease-in-out infinite,
    floatA 5.5s ease-in-out infinite;

  overflow: hidden;
}

#chatBtn::before,
#chatBtn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

#chatBtn::before {
  mix-blend-mode: screen;
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.45),
    transparent 28%
  );
  opacity: 0.55;
  animation: highlightA 5s ease-in-out infinite;
}

#chatBtn::after {
  inset: 16%;
  background: radial-gradient(
    circle at 40% 35%,
    rgba(255, 255, 255, 0.18),
    transparent 50%
  );
  filter: blur(8px);
}

#chatBtn img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

#chatBtn:hover > img {
  animation: rotateA 0.075s infinite;
}

#chatBtn:active {
  transform: scale(0.98);
}

@keyframes morphA {
  0% {
    border-radius: 43% 57% 51% 49% / 39% 42% 58% 61%;
  }
  20% {
    border-radius: 55% 45% 60% 40% / 47% 31% 69% 53%;
  }
  40% {
    border-radius: 38% 62% 46% 54% / 56% 45% 55% 44%;
  }
  60% {
    border-radius: 61% 39% 52% 48% / 35% 58% 42% 65%;
  }
  80% {
    border-radius: 49% 51% 36% 64% / 60% 43% 57% 40%;
  }
  100% {
    border-radius: 43% 57% 51% 49% / 39% 42% 58% 61%;
  }
}

@keyframes floatA {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(2px, -3px) rotate(1deg);
  }
  50% {
    transform: translate(-2px, 2px) rotate(-1deg);
  }
  75% {
    transform: translate(3px, 1px) rotate(0.5deg);
  }
}

@keyframes highlightA {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes rotateA {
  0%,
  100% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
}
