:root {
  --page-background: #241640;
  --progress-background: #120b21;
  --progress-fill: #4de0d0;
  --viewport-height: 100%;
  --max-aspect: 2.17;
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--page-background);
  overscroll-behavior: none;
  touch-action: none;
}

#unity-container {
  position: fixed;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  height: calc(var(--viewport-height) - var(--safe-top) - var(--safe-bottom));
}

#unity-canvas {
  display: block;
  width: min(100%, calc((var(--viewport-height) - var(--safe-top) - var(--safe-bottom)) * var(--max-aspect)));
  height: 100%;
  margin: 0 auto;
  background: var(--page-background);
  outline: none;
}

#unity-loading-bar {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  max-width: 320px;
  transform: translate(-50%, -50%);
}

#unity-progress-bar-empty {
  width: 100%;
  height: 12px;
  background: var(--progress-background);
  border-radius: 6px;
  overflow: hidden;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background: var(--progress-fill);
  transition: width 0.1s linear;
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, 0);
  display: none;
  font-family: sans-serif;
  font-size: 14px;
  text-align: center;
}

#rotate-device {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  box-sizing: border-box;
  background: var(--page-background);
  color: var(--progress-fill);
  font-family: sans-serif;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
}

#rotate-device-icon {
  width: 56px;
  height: 92px;
  border: 5px solid var(--progress-fill);
  border-radius: 10px;
  animation: rotate-device 2s ease-in-out infinite;
}

@keyframes rotate-device {
  0%, 20% { transform: rotate(0deg); }
  50%, 70% { transform: rotate(-90deg); }
  100% { transform: rotate(0deg); }
}

@media (orientation: portrait) and (pointer: coarse) {
  #rotate-device {
    display: flex;
  }
}
