html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1F1E1C;
}

/* Fixed 16:9 frame (the UI is laid out for 1920x1080), as large as fits, centred.
   index.html sets the exact size on resize; Unity matches its render size to it. */
#unity-canvas {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 56.25vw;
  display: block;
  background: #1F1E1C;
  outline: none;
  touch-action: none;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  pointer-events: none;
}

#loading img {
  width: 96px;
  height: 96px;
  border-radius: 20px;
}

#progress {
  width: min(240px, 60vw);
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

#progress-full {
  width: 0;
  height: 100%;
  background: #ffffff;
  transition: width 0.2s;
}

#banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}

/* Portrait warning: phones and tablets only (coarse pointer), never desktop windows. */
#rotate-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: #1F1E1C;
  color: #ffffff;
  text-align: center;
  font: 18px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#rotate-warning p { margin: 0; max-width: 260px; }

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

#banner .warning { background: #f5c542; color: #1F1E1C; padding: 10px; }
#banner .error { background: #c0392b; color: #ffffff; padding: 10px; }
