/*
 * Full-bleed WebGL shell.
 *
 * Everything here exists to guarantee one thing: the canvas is the only
 * pixel-producing element on the page, and it is exactly the size of the
 * viewport. Any gap between the canvas and the viewport shows the page
 * background, which is what produced the white bands in the stock template.
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #061315; /* matches the darkest tone in the artwork */
  color: #e0e6ed;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  background: #061315;
}

#unity-canvas {
  display: block; /* inline would add a descender gap under the canvas */
  width: 100%;
  height: 100%;
  background: #061315;
  outline: none;
  touch-action: none; /* let Unity own all pointer gestures */
}

/* ---------------------------------------------------------------- loader */

#loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: radial-gradient(ellipse at 50% 45%, #0f2a2c 0%, #061315 70%);
  transition: opacity 0.4s ease;
}

#loader.done {
  opacity: 0;
  pointer-events: none;
}

#loader-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(0, 230, 118, 0.13);
  border: 2px solid #00e676;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

#loader-track {
  width: min(320px, 62vw);
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

#loader-fill {
  width: 0%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f5a623, #f97316);
  transition: width 0.2s ease;
}

#loader-label {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #90a4ae;
}

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

/* ---------------------------------------------------------------- banner */

#banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  padding: 8px;
  /* Keep clear of the iOS home indicator. */
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}

.banner-line {
  margin: 4px auto;
  max-width: 640px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  background: rgba(11, 37, 39, 0.94);
}

.banner-line.warning {
  background: #8a6d1f;
  color: #fff;
}

.banner-line.error {
  background: #8a2b28;
  color: #fff;
}
