html{
    height: -webkit-fill-available;
}
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    width: 100vw;
    overflow: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background-color: black; /* Match your app background */
}
.ctaDiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: #fffa;
    z-index: 99;
}

.visible {
    display: block!important;
}
.hide {
    display: none!important;
}

.btn-photo,
.btn-video {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease; /* optional fade-in */
}

.sparkle {
  position: fixed;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #fff9c4, #fbc02d);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  animation: sparkle-fade 0.6s ease-out forwards;
  box-shadow: 0 0 8px #fff176, 0 0 12px #fbc02d;
}
@keyframes sparkle-fade {
  to {
    transform: scale(1.8);
    opacity: 0;
  }
}
.trail-dot {
  position: fixed;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fff9c4, #fbc02d); /* soft yellow/gold glow */
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.8;
  transform: scale(1);
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;

  /* ✨ Glow effect */
  box-shadow: 0 0 6px #fff176, 0 0 12px #fdd835, 0 0 20px #fbc02d;
}
@keyframes pulse {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(2);   opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

.trail-dot.pulse {
  animation: pulse 0.8s ease-in-out infinite;
  box-shadow: 0 0 14px rgba(255, 255, 255, 1),
              0 0 22px rgba(255, 200, 255, 0.9);
}

#title-temp {
  height: 100vh;
  width: 100%;
  position: absolute;
  z-index: 100;
  background-image: url('images/bg_start.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#title {
  display: none;
  height: 100vh;
  width: 100vw;
  position: absolute;
  z-index: 100;
  /*background-image: url('images/bg_video.jpg');*/
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#title-video {
  position: absolute;
  top: 59%;
  /*top: 50%;*/
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: 100%;
  margin-top:-20%;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: -1;
  /*object-fit: cover;*/
}
.btn-play {
  position: absolute;
  bottom: 25%;
  left: 50%;
  transform: translateX(-50%) scale(1);
  cursor: pointer;
  width: 140px; /* adjust as needed */
  height: auto;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease; /* smooth fade-in */
}
/* Only fade in */
.btn-play.visible {
  opacity: 1;
  pointer-events: auto;
}
/* Bounce animation applied after fade */
.btn-play.bouncing {
  animation: bounce 1.2s infinite ease-in-out;
}

.btn-skip {
  position: absolute;
  bottom: 5%;
  right: -2%;
  transform: translateX(-50%) scale(1);
  cursor: pointer;
  width: 100px; /* adjust as needed */
  height: auto;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease; /* smooth fade-in */
}
/* Only fade in */
.btn-skip.visible {
  opacity: 1;
  pointer-events: auto;
}
/* Bounce animation applied after fade */
.btn-skip.bouncing {
  animation: bounce 1.2s infinite ease-in-out;
}

.btn-skip-video-1 {
  position: absolute;
  bottom: 18%;
  right: -2%;
  transform: translateX(-50%) scale(1);
  cursor: pointer;
  width: 100px; /* adjust as needed */
  height: auto;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease; /* smooth fade-in */
}
/* Only fade in */
.btn-skip-video-1.visible {
  opacity: 1;
  pointer-events: auto;
}
/* Bounce animation applied after fade */
.btn-skip-video-1.bouncing {
  animation: bounce 1.2s infinite ease-in-out;
}

.btn-skip-video-2 {
  position: absolute;
  bottom: 18%;
  right: -2%;
  transform: translateX(-50%) scale(1);
  cursor: pointer;
  width: 100px; /* adjust as needed */
  height: auto;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease; /* smooth fade-in */
}
/* Only fade in */
.btn-skip-video-2.visible {
  opacity: 1;
  pointer-events: auto;
}
/* Bounce animation applied after fade */
.btn-skip-video-2.bouncing {
  animation: bounce 1.2s infinite ease-in-out;
}

.btn-start {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%) scale(1);
  cursor: pointer;
  width: 140px; /* adjust as needed */
  height: auto;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease; /* smooth fade-in */
}
/* Only fade in */
.btn-start.visible {
  opacity: 1;
  pointer-events: auto;
}
/* Bounce animation applied after fade */
.btn-start.bouncing {
  animation: bounce 1.2s infinite ease-in-out;
}



@keyframes bounce {
  0%, 100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.15);
  }
}

#santa-welcome {
  display: none;
  height: 100vh;
  width: 100vw;
  position: absolute;
  z-index: 100;
  /*background-image: url('images/bg_video.jpg');*/
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#santa-welcome-video {
  display: none;
  position: absolute;
  top: 59%;
  /*top: 50%;*/
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: 100%;
  margin-top:-20%;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: -1;
  /*object-fit: cover;*/
}
#santa-end {
  display: none;
  height: 100vh;
  width: 100vw;
  position: absolute;
  z-index: 200;
  /*background-image: url('images/bg_video.jpg');*/
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.sparkle {
  position: absolute;
  margin-top:-50px;
  margin-left:-80px;
  width: 100px;
  height: 100px;
  background: url('images/sparkle.png') no-repeat center center;
  background-size: contain;
  pointer-events: none;
  animation: sparkleFade 0.6s ease-out forwards;
  z-index: 999;
}

@keyframes sparkleFade {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.8) rotate(180deg);
  }
}


.ui-container {
    display: none;
    position: absolute;
    z-index: 90;
}
.ui-container-bottom {
    display: none;
    position: absolute;
    bottom: 2%;
    z-index: 90;
}
.ui-container-bottom-model {
    display: none;
    position: absolute;
    bottom: 2%;
    z-index: 90;
}
.ui-container-model {
    display: none;
    position: absolute;
    bottom: 20%;
    z-index: 90;
}
.container-model-1 {
    display: none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:10;
}
.container-model-2 {
    display: none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:10;
}
.container-model-3 {
    display: none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:10;
}
/* The interactive area */
.container-model-1-move {
  position: relative;
  overflow: hidden;          /* keep content from spilling out */
  touch-action: none;        /* allow us to handle pan/pinch ourselves */
}

/* The thing we move/scale */
.container-model-move {
  transform-origin: 0 0;     /* math below assumes top-left origin */
  will-change: transform;    /* smoother on mobile GPUs */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}




#start1 {
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:2;
}
#start2 {
    display:none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:2;
}
#start3 {
    display:none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:2;
}
.start-container {
    background-image: url(images/ui_portrait_bg.jpg);
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    height: 100vh;
    width: 100%;
    z-index: 2;
}
.start-img {
    display: block;
    width: 90%;
    max-width: 90%;
    margin: 0 auto; /* Center horizontally */
    height: auto;
}

.character-blue-container,
.character-red-container,
.character-orange-container {
    margin-top: -24%;
}

.instructions-container {
    margin-top: -24%;
}
#instructions-1,
#instructions-2,
#instructions-3,
#instructions-4,
#instructions-5 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 10;
  overflow: hidden;
}
.instructions-bg-bounce-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('images/ui_popup_black_bg.png'); /* your black background */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  animation: instructions-bg-bounce 16.5s ease-in-out infinite;
}
@keyframes instructions-bg-bounce {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.5) rotate(10deg);
  }
  50% {
    transform: scale(1.2) rotate(0deg);
  }
  75% {
    transform: scale(1.5) rotate(-10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
.badge-instructions-img {
    opacity: 0; /* start hidden */
    position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  z-index: 10;
}


@keyframes popMagic {
  0% {
    opacity: 0.8;
    transform: scale(0.8) rotate(-2deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
.magic-pop {
  animation: popMagic 0.4s ease-out forwards;
}
.badge-instructions-img.magic-pop {
  animation-delay: 0s; /* subtle delay */
}

.ar-scene-container {
    display: none;
    height: 100vh;
    width: 100%;
    position:relative;
    overflow-y: auto;
    z-index: 5;
}
#ar-scene {
    display: none;
    /*
    background-image: url(images/ui_ar_scene.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    */
    z-index: 5;
}
#character-blue-popup-1 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-blue-popup-2 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-blue-popup-3 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-red-popup-1 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-red-popup-2 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-red-popup-3 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-orange-popup-1 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-orange-popup-2 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}
#character-orange-popup-3 {
    display: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 100;
}

@keyframes btn-book-anim {
  0%   { transform: scale(1) rotate(0deg); }
  25%  { transform: scale(1.1) rotate(-5deg); }
  50%  { transform: scale(1) rotate(0deg); }
  75%  { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* class to trigger the animation */
.btn-book-animating {
  animation: btn-book-anim 1s ease-in-out infinite;
  transform-origin: center center; /* so it rotates from its center */
}


.collection-container {
    display: none;
    height: 100vh;
    width: 100%;
    position:relative;
    overflow-y: auto;
    z-index: 5;
}
#collection {
  display: none; /* controlled by your .show()/.hide() */
  background-image: url(images/ui_portrait_collection_bg.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 5;
  overflow: hidden; /* ensure pseudo stays inside */
}

/* this acts as your "collection-shadow" */
#collection::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-image: url('images/ui_portrait_collection_shadow_bg.jpg');
  background-size: 100% auto;
  background-position: top center;
  background-repeat: no-repeat;
  opacity: 0; /* start hidden */
  transition: opacity 1.4s ease;
  pointer-events: none; /* don’t block clicks */
}

/* add a class to trigger fade in */
#collection.fade-shadow::after {
  opacity: 1;
}
.book-blue-open-locked {
    display: none;
}
.book-blue-open {
    display: none;
}
.book-red-open-locked {
    display: none;
}
.book-red-open {
    display: none;
}
.book-orange-open-locked {
    display: none;
}
.book-orange-open {
    display: none;
}
.book-container {
  position: relative;
  display: inline-block; /* shrink to image size */
  width: 100%; /* or control with parent col */
}
.book-container img.book-base {
  width: 100%;
  height: auto;
  display: block;
}
.book-overlay {
  position: absolute;
  pointer-events: none;
  display: none;
}
.book-overlay-1 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-2 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-3 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-4 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-5 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-6 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-7 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-8 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-9 { z-index: 5;width: 100%;top: 0%;display: none; }
.book-overlay-zoom-1 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-2 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-3 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-4 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-5 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-6 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-7 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-8 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.book-overlay-zoom-9 { z-index: 5;width: auto;height: 100vh;top: 0%;display: none; }
.collection-container-zoom {
    display: none;
    height: 100vh;
    width: 100%;
    position:relative;
    overflow-y: auto;
    z-index: 10;
}
#collection-zoom {
    display: none;
    background-image: url(images/ui_portrait_collection_bg.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 10;
}
.book-blue-zoom-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  height: 100vh;
  white-space: nowrap;
}
.zoom-image {
  height: 100vh;
  width: auto;
  display: block;
}
.book-blue-close-container img,
.book-blue-open img {
  opacity: 0;
}
.book-red-close-container img,
.book-red-open img {
  opacity: 0;
}
.book-orange-close-container img,
.book-orange-open img {
  opacity: 0;
}
.magic-appear {
  animation: magicBounce 0.2s ease-out forwards;
}
@keyframes magicBounce {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(0deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.01) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
@keyframes buttonMagicBounce {
  0% {
    transform: scale(0.9) rotate(0deg);
  }
  60% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
.button-magic-bounce {
  animation: buttonMagicBounce 0.3s ease forwards;
}




.book-highlight-wrapper {
  position: relative;
  display: block;
  width: 100%; /* responsive with Bootstrap */
}

.book-highlight-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1; /* base layer */
}

/* overlay layer for the shine */
.book-highlight-wrapper .shine-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* apply your SVG mask so shine is clipped */
  -webkit-mask: url('images/book_close_mask.svg') center center / contain no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask: url('images/book_close_mask.svg') center center / contain no-repeat;
  mask-repeat: no-repeat;

  overflow: hidden; /* ensure gradient doesn't bleed outside */
  pointer-events: none;
  z-index: 2;
}

/* base gradient style (default gold) */
.book-highlight-wrapper .shine-mask::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%; /* start far left */
  width: 50%;
  height: 100%;
  background: linear-gradient(
    75deg,
    rgba(255,215,0,0) 0%,
    rgba(255,215,0,0.3) 50%,
    rgba(255,215,0,0) 100%
  );
  transform: skewX(-20deg);

  animation: shine 6s infinite;
  animation-play-state: paused; /* paused until active */
}

/* sweep then pause */
@keyframes shine {
  0%   { left: -75%; opacity: 0; }
  5%   { opacity: 1; }
  10%  { left: 125%; opacity: 1; } /* sweep across */
  15%  { opacity: 0; }
  100% { left: 125%; opacity: 0; } /* hold invisible for pause */
}

/* ✅ Blue gradient override */
.book-highlight-wrapper .shine-mask-blue::after {
  background: linear-gradient(
    75deg,
    rgba(0,191,255,0) 0%,      /* transparent blue edges */
    rgba(0,191,255,0.3) 50%,   /* soft blue center */
    rgba(0,191,255,0) 100%
  );
}

/* ✅ Red gradient override */
.book-highlight-wrapper .shine-mask-red::after {
  background: linear-gradient(
    75deg,
    rgba(255,50,50,0) 0%,      /* transparent red edges */
    rgba(255,50,50,0.3) 50%,   /* soft red center */
    rgba(255,50,50,0) 100%
  );
}

/* ✅ Orange gradient override */
.book-highlight-wrapper .shine-mask-orange::after {
  background: linear-gradient(
    75deg,
    rgba(255,165,0,0) 0%,      /* transparent orange edges */
    rgba(255,165,0,0.3) 50%,   /* soft orange center */
    rgba(255,165,0,0) 100%
  );
}

/* when collection is visible, start shine animation */
.book-highlight-wrapper .shine-mask.shine-active::after {
  animation-play-state: running;
}







#book-blue-badge-popup,
#book-red-badge-popup,
#book-orange-badge-popup,
#book-gold-badge-popup {
  display: none; /* or block when showing */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
}
#book-blue-badge-popup-zoom {
  display: none; /* set to block when you want to show */
  /*background-image: url(images/book_blue_badge_popup_zoom.jpg);*/
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20;
  overflow: hidden;
}
#book-red-badge-popup-zoom {
  display: none; /* set to block when you want to show */
  /*background-image: url(images/book_red_badge_popup_zoom.jpg);*/
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20;
  overflow: hidden;
}
#book-orange-badge-popup-zoom {
  display: none; /* set to block when you want to show */
  /*background-image: url(images/book_orange_badge_popup_zoom.jpg);*/
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20;
  overflow: hidden;
}
#book-gold-badge-popup-zoom {
  display: none; /* set to block when you want to show */
  /*background-image: url(images/book_blue_badge_popup_zoom.jpg);*/
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
}
/* Base bounce layer */
@keyframes book-badge-bg-bounce {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.5) rotate(10deg);
  }
  50% {
    transform: scale(1.2) rotate(0deg);
  }
  75% {
    transform: scale(1.5) rotate(-10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
.book-badge-bg-bounce-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  animation: book-badge-bg-bounce 16.5s ease-in-out infinite; /* tweak duration as you like */
  pointer-events: none;
}
/* Different background images per color */
.book-badge-bg-blue {
  background-image: url('images/ui_popup_blue_bg.png');
}
.book-badge-bg-red {
  background-image: url('images/ui_popup_red_bg.png');
}
.book-badge-bg-orange {
  background-image: url('images/ui_popup_orange_bg.png');
}
.book-badge-bg-gold {
  background-image: url('images/ui_popup_gold_bg.png');
}



/* full-screen background image */
.badge-full {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
}

/* overlay container */
.badge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* we'll re-enable in the flip container */
}

/* ========================== */
/* GLOW LAYERS (optional, if you still use them) */
/* ========================== */

.glow-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -14%;
  max-width: 90%;
  width: 90%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  animation: glowSpinOnly 30s linear infinite;
  z-index: 1;
}
.ui-glow {
  display: block;
  width: 100%;
  height: auto;
  animation: glowPulseOnly 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(0,255,255,0.7))
          drop-shadow(0 0 40px rgba(0,255,255,0.5));
  pointer-events: none;
}
.ui-glow-small-wrapper {
  display: none;
  position: absolute;
  top: 16%;
  left: 42%;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none; /* optional */
}

.ui-glow-rotator {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Force the rotation to use the center as the pivot */
  transform-origin: 50% 50%;
  animation: spin 6s linear infinite;
}

.ui-glow-small {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes glowRotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.glow-spin-badge-blue {
    position: absolute;left: 50%!important;
    top: 50%;margin-top: -25%!important;
    margin-left: -30%!important;
    max-width: 90%!important;
    width: 48%!important;
    transform: translate(-50%, -50%);
    transform-origin: center center;animation: glowSpinOnly 30s linear infinite;z-index: -1;
}

.glow-spin-badge-blue-off {
    display: none;
}

.glow-spin-badge-red {
    position: absolute;left: 50%!important;
    top: 50%;margin-top: 41%!important;
    margin-left: -30%!important;
    max-width: 90%!important;
    width: 48%!important;
    transform: translate(-50%, -50%);
    transform-origin: center center;animation: glowSpinOnly 30s linear infinite;z-index: -1;
}

.glow-spin-badge-red-off {
    display: none;
}

.glow-spin-badge-orange {
    position: absolute;left: 50%!important;
    top: 50%;margin-top: 108%!important;
    margin-left: -30%!important;
    max-width: 90%!important;
    width: 48%!important;
    transform: translate(-50%, -50%);
    transform-origin: center center;animation: glowSpinOnly 30s linear infinite;z-index: -1;
}

.glow-spin-badge-orange-off {
    display: none;
}

/* ========================== */
/* MEDAL FLIP + EDGE LAYERS */
/* ========================== */

.badge-flip-container {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-top: -14%;
  width: 60%;
  transform: translate(-50%, -50%);
  perspective: 1800px; /* increase perspective for more 3D feel */
  z-index: 2;
  pointer-events: auto;
}

.badge-flip-inner {
  position: relative;
  width: 100%;
  padding-top: 100%;
  transform-style: preserve-3d;
  transition: transform 1s;
}

.badge-edge-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  opacity: 0.6;              /* stronger */
  filter: brightness(0.8);
}

.layer1 { transform: translateZ(-0.8px); }
.layer2 { transform: translateZ(-1.6px); }
.layer3 { transform: translateZ(-2.4px); }
.layer4 { transform: translateZ(-3.2px); }
.layer5 { transform: translateZ(-4px); }
.layer6 { transform: translateZ(-4.8px); }
.layer7 { transform: translateZ(-5.6px); }

/* main front/back */
.badge-front-img,
.badge-back-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  z-index: 10;
}

.badge-back-img {
  transform: rotateY(180deg);
}

/* flip effect */
.badge-flip-container.flipped .badge-flip-inner {
  transform: rotateY(180deg);
}

/* For smaller badge
/* Inline variant so badges can live in normal flow (not absolutely centered) */
/* Inline variant so the stack behaves like a normal image */
.badge-front-img,
.badge-back-img {
  opacity: 1 !important;
  z-index: 10;
}
.badge-flip-container.inline {
  position: relative;
  left: auto; top: auto; margin: 0;
  width: 100%;
  transform: none;
  perspective: 1200px;
}

/* Gentle looping tilt to glimpse the back (~100°). Tweak if you want less/more. */
.badge-flip-container.tilt-90 { --tilt-deg: -120deg; }
.badge-flip-container.tilt-90 .badge-flip-inner {
  animation: badge-tilt-90 2s ease-in-out infinite;
}

@keyframes badge-tilt-90 {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(var(--tilt-deg)); }
  100% { transform: rotateY(0deg); }
}
/*

/* ========================== */
/* ANIMATIONS */
/* ========================== */

@keyframes glowSpinOnly {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes glowPulseOnly {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.2); }
}






.profile-container {
    display: none;
    height: 100vh;
    width: 100%;
    position:relative;
    overflow-y: auto;
    z-index: 15;
}
#profile {
    display: none;
    background-image: url(images/ui_bg_profile.jpg);
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 10;
}
#profile-success-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* hidden by default */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6); /* darken background */
    z-index: 999999; /* high priority */
}
#profile-success-popup img {
    max-width: 100%;
    height: auto;
}
#profile-notcreated-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* hidden by default */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6); /* darken background */
    z-index: 999999; /* high priority */
}
#profile-notcreated-popup img {
    max-width: 100%;
    height: auto;
    position: absolute;
    z-index: 1 !important;
}
#profile-map-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* hidden by default */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6); /* darken background */
    z-index: 999999; /* high priority */
}
#profile-map-popup img {
    max-width: 100%;
    height: auto;
    position: absolute;
    z-index: 1 !important;
}
.ui-profile-form {
  background-image: url('images/ui_profile_login_form.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 100%;
  position: relative;
  padding-top: 21%;
}
.login-container {
    display: none;
}
.create-account-container {
    display: none;
}
.reset-container {
    display: none;
}
.settings-container {
    display: none;
    height: 100vh;
    width: 100%;
    position:relative;
    overflow-y: auto;
    z-index: 15;
}
#settings {
    display: none;
    background-image: url(images/ui_bg_profile.jpg);
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    z-index: 10;
}

/* Position your input inside the image area */
.invisible-input {
  position: absolute;
  top: 22%;
  left: 10%;
  width: 80%;
  height: 30%;
  background: transparent;
  border: none;
  outline: none;
  color: #000;
  font-size: 1rem;
}




#collection2 {
    display: none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:5;
}


#video-recorder {
    display: none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:5;
}
#rewards {
    display: none;
    height: 100vh;
    width: 100%;
    position:absolute;
    z-index:5;
}
.btn-collection-item-1 {
    display:none;position:absolute;top:120px;left: 10%;width: 28%;
}
.btn-collection-item-2 {
    display:none;position: absolute; top: 120px; left: 50%; transform: translateX(-50%); width: 28%;
}
.btn-collection-item-3 {
    display:none;position:absolute;top:120px;right: 10%;width: 28%;
}
.btn-collection-item-4 {
    display:none;position:absolute;top:210px;left: 10%;width: 28%;
}
.btn-collection-item-5 {
    display:none;position: absolute; top: 210px; left: 50%; transform: translateX(-50%); width: 28%;
}
.btn-collection-item-6 {
    display:none;position:absolute;top:210px;right: 10%;width: 28%;
}
.btn-collection-item-7 {
    display:none;position:absolute;top:300px;left: 10%;width: 28%;
}
.btn-collection-item-8 {
    display:none;position: absolute; top: 300px; left: 50%; transform: translateX(-50%); width: 28%;
}
.btn-collection-item-9 {
    display:none;position:absolute;top:300px;right: 10%;width: 28%;
}
.btn-collection-item-10 {
    display:none;position: absolute; top: 380px; left: 50%; transform: translateX(-50%); width: 40%;
}
.btn-collection-lock-1 {
    position:absolute;top:120px;left: 10%;width: 28%;
}
.btn-collection-lock-2 {
    position: absolute; top: 120px; left: 50%; transform: translateX(-50%); width: 28%;
}
.btn-collection-lock-3 {
    position:absolute;top:120px;right: 10%;width: 28%;
}
.btn-collection-lock-4 {
    position:absolute;top:210px;left: 10%;width: 28%;
}
.btn-collection-lock-5 {
    position: absolute; top: 210px; left: 50%; transform: translateX(-50%); width: 28%;
}
.btn-collection-lock-6 {
    position:absolute;top:210px;right: 10%;width: 28%;
}
.btn-collection-lock-7 {
    position:absolute;top:300px;left: 10%;width: 28%;
}
.btn-collection-lock-8 {
    position: absolute; top: 300px; left: 50%; transform: translateX(-50%); width: 28%;
}
.btn-collection-lock-9 {
    position:absolute;top:300px;right: 10%;width: 28%;
}
.btn-collection-lock-10 {
    position: absolute; top: 380px; left: 50%; transform: translateX(-50%); width: 40%;
}
#btn-camera-video {
    display:none;
    position:absolute;
    width:30%;
    left:5%;
    bottom:5%;
    z-index:3;
}
#btn-camera-video-stop {
    display:none;
    position:absolute;
    width:30%;
    left:5%;
    bottom:5%;
    z-index:3;
}
#btn-collection-1 {
    display:none;
    position:absolute;
    width:30%;
    left: 50%;
    transform: translateX(-50%);
    bottom:5%;
    z-index:3;
}
#btn-collection-2 {
    display:none;
    position:absolute;
    width:36%;
    left: 50%;
    transform: translateX(-50%);
    bottom:5%;
    z-index:4;
}
#btn-collection-3 {
    display:none;
    position:absolute;
    width:36%;
    left: 50%;
    transform: translateX(-50%);
    bottom:5%;
    z-index:4;
}
#btn-camera-photo {
    display:none;
    position:absolute;
    width:30%;
    right:5%;
    bottom:5%;
    z-index:3;
}
#btn-snowflakes {
    display:none;
    position:absolute;
    width:30%;
    right:5%;
    bottom:20%;
    z-index:3;
}
.mt-3 {
    margin-top: -3px!important;
}
.mt-10 {
    margin-top: 10px;
}
.mt-80 {
    margin-top: 80px;
}
.snowflake {
  /*display: none;*/
  position: fixed;
  top: -10px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.8;
  color: #FFF;
}
.btn-restart-collection {
    width: 100%;
    height: 20%;
    position: absolute;
    top: 0px;
}
.btn-back-collection {
    width: 100%;
    height: 20%;
    position: absolute;
    bottom: 0px;
}
.progressbar-wrapper {
  position: relative;
  width: 100%;   /* take full width of column */
}
.progressbar-wrapper img {
  width: 100%;   /* responsive scaling */
  height: auto;  /* maintain aspect ratio */
}
.progressbar-wrapper .overlay-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;   /* scale same as base image */
  height: auto;
  pointer-events: none; /* overlays won't block clicks */
}
.ui-progressbar {
    position: relative;
  z-index: 0; /* base */
}
.ui-progressbar-1 {
    display: none;
}
.ui-progressbar-2 {
    display: none;
}
.ui-progressbar-3 {
    display: none;
}
.ui-progressbar-4 {
    display: none;
}
.ui-progressbar-5 {
    display: none;
}
.ui-progressbar-6 {
    display: none;
}
.ui-progressbar-7 {
    display: none;
}
.ui-progressbar-8 {
    display: none;
}
.ui-progressbar-9 {
    display: none;
}
.ui-progressbar-10 {
    display: none;
    position: absolute;
    z-index: 2;
}

/* === Generic popup containers === */
#profile-error-popup,
#profile-success-popup,
#profile-already-popup {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  overflow: hidden;
}

/* Frame image that scales to viewport */
#profile-error-popup > img.w-100,
#profile-success-popup > img.w-100,
#profile-already-popup > img.w-100 {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1; /* below overlay */
}

/* === Overlay container matches frame size === */
#profile-error-popup .badge-overlay,
#profile-success-popup .badge-overlay,
#profile-already-popup .badge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* do not block clicks */
  display: block;
  justify-content: center;
  align-items: center;
}

/* Glow image (centered & responsive) */
#profile-error-popup .badge-overlay .ui-glow,
#profile-success-popup .badge-overlay .ui-glow,
#profile-already-popup .badge-overlay .ui-glow {
  position: absolute;
  max-width: 80%; /* adjust size relative to frame */
  height: auto;
  z-index: 2;
}

/* Badge inner image (centered & responsive) */
#profile-error-popup-img,
#profile-success-popup-img,
#profile-already-popup-img {
  position: relative;
  max-width: 100%; /* adjust size relative to frame */
  height: auto;
  z-index: 3;
}

#donation {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 20;
  overflow: hidden;
}

/* Pop-in then loop bounce */
@keyframes donationPopIn {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes donationBounceLoop {
  0%, 100% { transform: scale(1) translateY(0); }
  50%      { transform: scale(1.05) translateY(-5px); }
}

.donation-badge-popup {
  display: block;
  position: relative;
  z-index: 1;

  /* responsive sizing */
  max-width: 100vw;   /* never wider than 90% of viewport */
  max-height: 100vh;  /* never taller than 90% of viewport */
  width: auto;
  height: auto;
  margin: 0 auto;

  /* animations */
  animation: donationPopIn 0.6s ease-out forwards, donationBounceLoop 1.4s ease-in-out infinite;
  animation-delay: 0s, 0.6s; /* bounce starts after pop-in finishes */
}

#map {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 20;
  overflow: hidden;
}

#map-container {
  display: none;
}

.pngsequence-container { position: relative; }
.pngsequence-canvas   { display:block; width: 130%!important;height: 100%!important;margin-top: -110%!important;margin-left: -16%!important; }
.pngsequence-canvas-model   { display:block; width: 100%!important;height: 52%!important;margin-top: 0%!important;margin-left: 0%!important; }

#character_blue_1_before,
#character_blue_2_before,
#character_blue_3_before,
#character_red_1_before,
#character_red_2_before,
#character_red_3_before,
#character_orange_1_before,
#character_orange_2_before,
#character_orange_3_before {
  display: none;
  height: 100vh;
  width: 100%;
  position: absolute;
  z-index: 100;
  background-color: rgba(0,0,0,0);
  /*background-color: rgba(0,0,0,0.5);*/
}

#character-found-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 100;
  overflow: hidden;
}

#santa-end-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 120;
  overflow: hidden;
}

#donation-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: 100;
  overflow: hidden;
}

#collection-donotdelete {
    position:absolute;
    bottom:0px;
    width:100%;
    height:100px;
    /*backgound-color:#000;*/
    /*opacity:0.5;*/
    z-index:9;
}
#landscape-popup {
  display:none;
  position: absolute;
  width: 100%;
  height: 100vh;
  z-index:9;
}
.bg-white {
    background-color: #fff;
}
.img-center {
  display:block;
  margin-left:auto;
  margin-right:auto;
}
.popup-container {
    width: 100%;
    text-align: center;
}
.w100 {
    width: 100%;
}
.mt100 {
  margin-top:100px;
}
.mt-22pct {
    margin-top:-22%;
}

input, textarea, select {
  font-size: 16px; /* Must be ≥16px or iOS will zoom */
}
.fixed-ui {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}
.ui_ar_hint {
  display: none;
}

/* prevents iOS auto-zoom on focus */
#profile .invisible-input {
  -webkit-text-size-adjust: 100%;
}

/* reduce rubber-banding while keyboard is open */
body.ios-input-open {
  overscroll-behavior: contain;
}

/* if any of your content uses overflow scroll, this improves feel on iOS */
.profile-container,
.login-container,
.create-account-container,
.reset-container {
  -webkit-overflow-scrolling: touch;
}