html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #f7ecd5;
}

body {
  touch-action: none;
}

#unity-container {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --available-width: calc(100vw - var(--safe-left) - var(--safe-right));
  --available-height: calc(100vh - var(--safe-top) - var(--safe-bottom));
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f7ecd5;
  background-image: url("background.jpg");
  background-size: cover;
  background-position: center;
}

#unity-canvas {
  width: min(var(--available-width), calc(var(--available-height) * 0.5625));
  height: min(var(--available-height), calc(var(--available-width) / 0.5625));
  flex-shrink: 0;
  display: block;
  background: #231F20;
  outline: none;
}

@supports (height: 100dvh) {
  #unity-container {
    --available-height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
  }
}

#unity-loading-bar {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: #f7ecd5;
  color: #75451e;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#loading-waffle {
  width: 128px;
  height: 128px;
  object-fit: contain;
  animation: waffle-spin 2s linear infinite;
}

@keyframes waffle-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #loading-waffle { animation: none; }
}

.loading-failed #loading-waffle {
  animation-play-state: paused;
}

#loading-message {
  margin: 28px 20px 16px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

#unity-progress-bar-empty {
  width: 168px;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e6d2ad;
}

#unity-progress-bar-full {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #c77822;
}

#loading-percent {
  margin-top: 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#unity-warning {
  position: absolute;
  top: 5%;
  left: 50%;
  z-index: 20;
  display: none;
  width: min(90%, 720px);
  transform: translateX(-50%);
  font: 14px/1.4 Arial, sans-serif;
  text-align: center;
}

#unity-warning > div {
  margin-bottom: 4px;
  padding: 10px;
}

#unity-warning .warning {
  background: #fff3a6;
}

#unity-warning .error {
  color: #fff;
  background: #b00020;
}
