/* RESET */
body {
  padding: 0;
  margin: 0;
}

/* UNITY CONTAINER BASE */
#unity-container {
  position: absolute;
}

/* DESKTOP CENTERING */
#unity-container.unity-desktop {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* MOBILE FULLSCREEN CONTAINER */
#unity-container.unity-mobile {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;     /* ← Key change: canvas fills, banner pushed to bottom */
  align-items: center;
  background: #000;
  overflow: hidden;
  box-sizing: border-box;
  padding: 
    env(safe-area-inset-top, 0px) 
    env(safe-area-inset-right, 0px) 
    env(safe-area-inset-bottom, 0px) 
    env(safe-area-inset-left, 0px);
}

/* CANVAS BASE */
#unity-canvas {
  background: #231F20;
}

/* MOBILE CANVAS - fills available space */
.unity-mobile #unity-canvas {
  flex: 1 1 auto;                     /* grow to fill remaining space */
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* LOADING BAR */
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 99999;
}

#unity-logo {
  width: 154px;
  height: 130px;
  background: url('unity-logo-dark.png') no-repeat center;
}

/* PROGRESS BAR */
#unity-progress-bar-empty {
  width: 141px;
  height: 18px;
  margin-top: 10px;
  margin-left: 6.5px;
  background: url('progress-bar-empty-dark.png') no-repeat left;
  position: relative;
  overflow: hidden;
  box-sizing: content-box;
}

#unity-progress-bar-full {
  width: 0%;
  height: 18px;
  background: url('progress-bar-full-dark.png') no-repeat left;
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: content-box;
}

/* FOOTER */
#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;
  color: white;
  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;
}

/* ──────────────────────────────────────────────
   CLICKABLE BOTTOM BANNER
──────────────────────────────────────────────── */
.unity-mobile #bottom-banner {
  flex: 0 0 90px;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  background: none;
  border: none;
  position: relative;
  z-index: 9999;
  pointer-events: auto;
  border-radius: 10px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

/* iOS PWA ONLY: Taller banner → shrink canvas more → fix bottom crop */
body.is-ios.is-pwa #bottom-banner {
  flex: 0 0 120px;                    /* adjust between 110–130px if needed */
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

/* Android ONLY: Shorter banner → more canvas height → slight zoom-in */
body.is-android:not(.is-ios) #bottom-banner {
  flex: 0 0 75px;                     /* adjust 70–80px */
  padding-bottom: 0;
}

/* Extra safety for very tall iOS PWA screens */
@media screen and (max-aspect-ratio: 10/19) {
  body.is-ios.is-pwa #bottom-banner {
    flex: 0 0 130px;
  }
  #bottom-banner {
    margin-top: 10px;
    margin-bottom: 10px;
  }
}

/* Remove old brittle calc-based overrides */
.banner-visible #unity-container.unity-mobile #unity-canvas {
  height: auto !important;
  max-height: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
}

/* CAROUSEL WRAPPER */
.ad-banner-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* MOBILE SCROLL CONTAINER */
.ad-scroll-container-mobile {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 0 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ad-scroll-container-mobile::-webkit-scrollbar {
  display: none;
}

/* SLIDES */
.ad-scroll-container-mobile .ad-slide {
  flex: 0 0 auto;
  width: 100%;
  max-width: 300px;
  scroll-snap-align: center;
  display: block !important;
  text-decoration: none !important;
  border: none !important;
}

/* LINK STATES */
.ad-scroll-container-mobile .ad-slide:link,
.ad-scroll-container-mobile .ad-slide:visited,
.ad-scroll-container-mobile .ad-slide:hover,
.ad-scroll-container-mobile .ad-slide:active,
.ad-scroll-container-mobile .ad-slide:focus {
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* IMAGES */
.ad-scroll-container-mobile .ad-slide img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

/* ENSURE INNER CONTAINER DOESN’T FIGHT CENTERING */
.unity-mobile #bottom-banner .ad-scroll-container-mobile {
  height: auto;
  margin: 0;
  padding: 0 10px;
}

/* iPhone browser only (not PWA) — extra fullscreen nudge + push banner off */
@supports (-webkit-touch-callout: none) {
  body:not(.is-pwa) #unity-canvas {
    height: 100% !important;
    max-height: 100% !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body:not(.is-pwa) #bottom-banner {
    display: none !important;
  }
}