* {
  padding: 0;
  margin: 0;
}

html {
  /* fix mobile viewport menu bar on iOS */
  height: -webkit-fill-available;
}

body {
  height: auto;
  /* allow root scroll on iOS */
  /* fix mobile viewport menu bar on iOS */
  min-height: -webkit-fill-available;
  width: 100%;
  text-align: center;
}

/* Use dynamic viewport height on mobile browsers that hide URL bar */
:root {
  /* set via JS: --vh = 1% of innerHeight */
}

#unity-container,
#unity-canvas {
  height: calc(var(--vh, 1vh) * 100);
}

#unity-container {
  position: fixed;
  /* fixed so root can scroll under it on iOS */
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #29404d;
  touch-action: pan-y;
  /* allow vertical pan so Safari can collapse bars */
}

#unity-canvas {
  width: 100%;
  height: 100%;
  background-color: #fff;
}

#unity-loading-container {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
  background-color: #292c2f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 40px;

  opacity: 1;
  visibility: visible;

  background-image: url('background.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

#unity-loading-container.finished {
  opacity: 0;
  visibility: collapse;
}

/*
  #unity-loading-container .logo {
    width: 15%;
  }
  */

.logo {
  user-select: none;
  width: 40%;
  top: 1%;
  right: 10px;
  position: absolute;
  transform-origin: top;
}

#unity-loading-bar {
  position: absolute;
  height: 36px;
  /*background: linear-gradient(90deg, #2a2d34, #3a3d44, #2a2d34);*/
  background: #00000014;
  background-size: 200% 100%;
  border: 5px solid #ffffff24;
  border-radius: 14px;
  overflow: hidden;
  animation: shimmer 2s infinite linear;
  bottom: 20px;
  right: 120px;
  left: 20px;
}

#loading-percentage {
  position: absolute;
  right: 16px;
  bottom: 18px;
  z-index: 20;
  font-family: system-ui, sans-serif;
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 0, 0, 0.4);
  user-select: none;
}

#loading-tip {
  position: absolute;
  left: 20px;
  right: 120px;
  /* 5px above the loading bar: bar bottom (20px) + bar height (36px) + borders (10px) + 5px */
  bottom: calc(20px + 36px + 10px + 5px);
  z-index: 20;
  font-family: system-ui, sans-serif;
  font-size: clamp(18px, 5.5vw, 40px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 0, 0, 0.4);
  user-select: none;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.5s ease;
}

/* Simple responsive sizing for small screens */
@media (max-width: 480px) {

  #loading-tip,
  #loading-percentage {
    font-size: 18px;
  }
}

@media (max-width: 360px) {

  #loading-tip,
  #loading-percentage {
    font-size: 16px;
  }
}


#unity-loading-bar-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 1%;
  height: 100%;
  background: linear-gradient(290deg, #00b7ff, #0064c2);
  box-shadow: 0 0 27px #00b7ff;
  /* transition: width 3.9s cubic-bezier(0.25, 1, 0.5, 1); */
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}
