/* TemplateData/style.css */

/* Make the whole document fill the iframe */
html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #231F20;

  /* Strongly discourage browser gesture scrolling/zooming conflicts */
  overscroll-behavior: none;
  touch-action: none;
}

/* Container always fills available space (iframe viewport) */
#unity-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Canvas always matches container */
#unity-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: #231F20;

  /* Prevent browser panning/zooming gestures stealing drags */
  touch-action: none;
}

/* Loading + warning overlays */
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 10;
}

#unity-logo {
  width: 154px;
  height: 130px;
  background: url('composit-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-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: white;
  padding: 10px;
  display: none;
  z-index: 20;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
}

/* Footer overlay: keep UI inside bounds, don’t affect layout */
#unity-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;              /* no layout height; it’s just an overlay container */
  pointer-events: none;   /* don’t block Unity input */
  z-index: 30;
}

/* Optional branding */
#unity-logo-title-footer {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 102px;
  height: 38px;
  background: url('composit-logo-title-footer.png') no-repeat center;
  pointer-events: none;
}

#unity-build-title {
  position: absolute;
  right: 62px;
  bottom: 12px;
  line-height: 38px;
  font-family: arial;
  font-size: 18px;
  color: white;
  pointer-events: none;
}

/* Fullscreen button: always visible + clickable */
#unity-fullscreen-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  background: url('fullscreen-button.png') no-repeat center;
  cursor: pointer;
  pointer-events: auto;  /* allow clicking */
}

/* Faux fullscreen exit button (top-left X) */
#faux-exit {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: none;
  place-items: center;
  font-size: 22px;
  line-height: 42px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  z-index: 1000000;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}

/* Show X only during faux fullscreen */
body.faux-fullscreen #faux-exit {
  display: grid;
}

/* Faux fullscreen state: pin Unity to viewport */
body.faux-fullscreen #unity-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
}

/* Small screens: hide text/branding if it crowds */
@media (max-width: 640px) {
  #unity-logo-title-footer,
  #unity-build-title {
    display: none;
  }
}