:root {
  color-scheme: dark;
  background: #02040b;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, #101a32 0, #050812 44%, #02040b 100%);
}

#game-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

#unity-container {
  position: relative;
  width: min(calc(100vw - 16px), calc((100vh - 16px) * 0.5625));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #02040b;
  border: 1px solid rgba(69, 224, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58), 0 0 30px rgba(20, 201, 255, 0.08);
}

@supports (height: 100dvh) {
  #unity-container {
    width: min(calc(100vw - 16px), calc((100dvh - 16px) * 0.5625));
  }
}

#unity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #02040b;
}

#unity-canvas:focus {
  outline: none;
}

#unity-loading-bar {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 15%;
  background: #02040b;
}

#loading-title {
  color: #25dcff;
  font-size: clamp(26px, 5vh, 54px);
  font-weight: 800;
  letter-spacing: 0.08em;
}

#progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

#progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #00a6d7, #2be3ff);
  transition: width 120ms linear;
}

#loading-copy {
  color: rgba(224, 240, 255, 0.62);
  font-size: 12px;
  letter-spacing: 0.28em;
}

#unity-fullscreen-button {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  opacity: 0.45;
}

#unity-fullscreen-button:hover,
#unity-fullscreen-button:focus-visible {
  opacity: 1;
}

#unity-warning {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  right: 12px;
  display: none;
}

#unity-warning div {
  margin-bottom: 6px;
  padding: 10px;
  border-radius: 6px;
  color: #111;
  background: #ffd75a;
}

#unity-warning .error {
  color: white;
  background: #c92c45;
}

@media (max-width: 600px) {
  #game-shell {
    padding: 0;
  }

  #unity-container {
    width: min(100vw, calc(100vh * 0.5625));
    border: 0;
    border-radius: 0;
  }

  @supports (height: 100dvh) {
    #unity-container {
      width: min(100vw, calc(100dvh * 0.5625));
    }
  }
}
