/* =========================================================
   Dreams — WebGL Template styles
   Canvas aspect ratio: 16:9 (1920×1080)
   ========================================================= */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #231F20;
  font-family: Arial, sans-serif;
}

/* ── Background image ──────────────────────────────────── */
#background {
  position: fixed;
  inset: 0;
  background-image: url("background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.6) blur(2px);
  transform: scale(1.04);
  z-index: 0;
}

/* ── Game wrapper — full viewport, centres the container ─ */
#game-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1;
}

/* ── Game container — fixed 16:9, max 1920×1080 ─────────
   width = min(viewport_w - 2*padding, (viewport_h - 2*padding) * 16/9, 1920px)
   ───────────────────────────────────────────────────────── */
#game-container {
  position: relative;
  width: min(
    calc(100vw - 48px),
    calc((100vh - 48px) * (16 / 9)),
    1920px
  );
  aspect-ratio: 16 / 9;
  max-height: 1080px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.7);
  border-radius: 16px;
  overflow: hidden;
}

/* ── Unity canvas — fills the container exactly ─────────── */
#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Loading overlay ─────────────────────────────────────── */
#loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #231F20;
  transition: opacity 0.5s ease;
  z-index: 10;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 420px;
  max-width: 80%;
}

/* ── Logo ────────────────────────────────────────────────── */
#loading-logo {
  width: 280px;
  max-width: 100%;
  height: auto;
}

/* ── Progress bar ────────────────────────────────────────── */
#progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}

#progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 3px;
  transition: width 0.25s ease;
}

/* ── Progress label ──────────────────────────────────────── */
#progress-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  letter-spacing: 0.08em;
}
