#unity-container { position: absolute }
#unity-container.unity-desktop { width: 100%; height: 100%; left: 50%; top: 50%; transform: translate(-50%, -50%) }

/* ─── DESKTOP: PORTRAIT or NARROW LANDSCAPE (867px–1200px wide) ──────────────
   The game is landscape (16:9), so we letterbox it vertically:
   full screen width, height = 9/16 of that width, centered vertically.        */
@media (orientation: portrait), (max-width: 1200px) and (min-width: 867px) {
  #unity-container.unity-desktop {
    width: 100vw;
    height: 56.25vw;     /* 9/16 of viewport width = correct landscape height */
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    max-height: 100vh;
  }
}

/* ─── MOBILE: PORTRAIT (phone held upright) ───────────────────────────────────
   The game is landscape (16:9), so we letterbox it:
   full screen width, height = 9/16 of that width, centered vertically.        */
#unity-container.unity-mobile {
  position: fixed;
  width: 100vw;
  height: 56.25vw;     /* 9/16 of viewport width = correct landscape height */
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  max-height: 100vh;
}

/* ─── MOBILE: LANDSCAPE (phone rotated sideways) ──────────────────────────────
   Now the viewport IS landscape, so fill it completely — full width AND height.
   The aspect ratio naturally matches the game so no bars appear at all.        */
@media (orientation: landscape) {
  #unity-container.unity-mobile {
    width: 100vw;
    height: 100vh;
    top: 0;
    transform: none;   /* Cancel the portrait translateY(-50%) centering */
    max-height: none;
  }
}

#unity-canvas { background: #231F20 }

.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── DESKTOP PORTRAIT / NARROW: canvas fill ─────────────────────────────────
   When the desktop container switches to letterbox mode, the canvas must also
   fill it completely (same rule as the mobile canvas).                         */
@media (orientation: portrait), (max-width: 1200px) and (min-width: 867px) {
  .unity-desktop #unity-canvas {
    width: 100%;
    height: 100%;
    display: block;
  }
}

#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }
#unity-footer { position: relative }
.unity-mobile #unity-footer { display: none }
#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

* { margin: 0; }
html, body { width: 100%; height: 100%; padding: 0; margin: 0; background: #000; }
canvas { display: block; }
