@font-face {
  font-family: "Proxima Nova";
  src: url("../fonts/ProximaNova-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Proxima Nova";
  src: url("../fonts/ProximaNova-Extrabold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
b, strong{
  font-weight: 800;
}

:root { --design-w: 1920; --design-h: 1080; }

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: "Proxima Nova", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

#stage, #viewport, #app {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

#bgVideo:focus, .ui-button:focus, .item:focus { outline: none; }

#app {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#viewport {
  position: fixed;
  inset: 0;
  height: 100svh;
  height: 100dvh;
  width: 100vw;

  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);

  overflow: hidden;
  touch-action: none;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  overflow: hidden;
  touch-action: none;
  background: #000;
}

#bg {
  position: absolute;
  display: block;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
  z-index: 1;
}

#bgVideo {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: auto;
  z-index: 0;
}

#overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.overlay { position: absolute; user-select: none; pointer-events: none; }

#items { position: absolute; inset: 0; z-index: 10; }
.item { position: absolute; transform-origin: top left; user-select: none; touch-action: none; cursor: grab; }
.item.dragging { cursor: grabbing; }
.item img { display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }

#hud {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 134px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  background: rgba(66, 61, 155, 0.95);
}

#progressTrack {
  position: relative;
  height: 36px;
  width: 1340px;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
}
#progressFill {
  min-width: 20px; 
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: rgba(255,255,255,1);
}
#hudMagnifier {
  position: absolute;
  left: -210px;
  top: 50%;
  transform: translateY(-50%);
}
@keyframes magnifier-pulse {
  0%   { transform: scale(var(--mag-scale, 1)) scale(1); }
  50%  { transform: scale(var(--mag-scale, 1)) scale(1.15); }
  100% { transform: scale(var(--mag-scale, 1)) scale(1); }
}
@keyframes magnifier-glow-pulse {
  0% {
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.35))
            drop-shadow(0 0 18px rgba(255,255,255,0.18));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(255,255,255,0.55))
            drop-shadow(0 0 30px rgba(255,255,255,0.30));
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.35))
            drop-shadow(0 0 18px rgba(255,255,255,0.18));
  }
}
@keyframes magnifier-enter {
  0% {
    transform: translateX(var(--enter-x, -820px)) scale(var(--mag-scale, 1));
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(var(--mag-scale, 1));
    opacity: 1;
  }
}
@keyframes magnifier-enter-left {
  0% {
    transform: translateX(var(--enter-x, 820px)) scale(var(--mag-scale, 1));
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(var(--mag-scale, 1));
    opacity: 1;
  }
}
.magnifier-enter {
  animation: magnifier-enter 1700ms cubic-bezier(.2,.8,.2,1) forwards;
}
.magnifier-enter-left {
  animation: magnifier-enter-left 1700ms cubic-bezier(.2,.8,.2,1) forwards;
}
.magnifier-pulse {
  animation: magnifier-pulse 1.8s ease-in-out infinite,
            magnifier-glow-pulse 2.2s ease-in-out infinite;
  will-change: transform;
  transform-origin: center center !important;
}


#bgVideo.is-blurred {
  filter: blur(6px) brightness(0.9);
  transition: filter 220ms ease;
}


#ui-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

#screenLayer {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

#modalBackdrop {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 80;
}
#modalBackdrop.hidden { display: none !important; }

#modalBackdrop.no-bg {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
#modalBackdrop.with-bg {
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.15);
}

#modal {
  position: absolute;
  opacity: 0;
  transform: scale(0.94);
  will-change: transform, opacity;
  user-select: none;
  pointer-events: auto;
}
#modal.is-ready {
  opacity: 1;
  animation: modal-pop 260ms cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes modal-pop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.popup-shell {
  position: relative;
  border-radius: 60px;
  border: 10px solid #423D9B;
  padding: 70px 110px;
  background: #fff;
  box-shadow: 12px 12px 0 rgba(0,0,0,0.25);
  min-width: 880px;
}
.popup-title { font-size: 58px; font-weight: 700; margin: 0 0 18px; color: #111; }
.popup-text { font-size: 34px; line-height: 1.2; font-weight: 700; margin: 0 0 36px; color: #111; }

.popup-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 18px 70px;
  font-size: 34px;
  font-weight: 700;
  cursor: pointer;
  background: #423D9B;
  color: #fff;
  pointer-events: auto;
}

.popup-close {
  position: absolute;
  right: 26px;
  top: 26px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  cursor: pointer;
  font-size: 28px;
  pointer-events: auto;
}

.popup-outside {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 240px;
  height: auto;
  pointer-events: none;
  user-select: none;
}
.popup-outside.left { left: -170px; }
.popup-outside.right { right: -170px; }

#pauseIcon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 70;
}
#pauseIconImg {
  width: 180px;
  height: auto;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 160ms ease, transform 160ms ease;
}
#pauseIcon.show #pauseIconImg { opacity: 1; transform: scale(1); }

.ui-button {
  transform-origin: center center;
  transition: transform 160ms ease, filter 160ms ease;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.ui-button:hover { transform: scale(1.06); filter: brightness(1.05); }
.ui-button:active { transform: scale(0.98); }

#hudMagnifier.ui-button:hover {
  transform: translateY(-50%) scale(1.06);
  filter: brightness(1.05);
}

@keyframes hand-wave {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(6deg); }
  30%  { transform: rotate(-4deg); }
  45%  { transform: rotate(5deg); }
  60%  { transform: rotate(-2deg); }
  100% { transform: rotate(0deg); }
}
.anim-hand-wave { animation: hand-wave 2.2s ease-in-out infinite; }

.hidden { display: none !important; }

/* Subtle floating loops (use on each balloon with a different class) */

@keyframes balloon-float-1 {
  0%   { transform: translate(0, 0) rotate(-1.5deg); }
  25%  { transform: translate(6px, -10px) rotate(1deg); }
  50%  { transform: translate(-4px, -18px) rotate(0deg); }
  75%  { transform: translate(-8px, -9px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(-1.5deg); }
}

@keyframes balloon-float-2 {
  0%   { transform: translate(0, 0) rotate(1deg); }
  20%  { transform: translate(-7px, -8px) rotate(-0.5deg); }
  55%  { transform: translate(5px, -20px) rotate(1.5deg); }
  80%  { transform: translate(9px, -10px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(1deg); }
}

@keyframes balloon-float-3 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  30%  { transform: translate(8px, -12px) rotate(1.2deg); }
  60%  { transform: translate(-6px, -22px) rotate(-1.2deg); }
  85%  { transform: translate(-10px, -11px) rotate(0.6deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.balloon-float-1 {
  animation: balloon-float-1 5.8s ease-in-out infinite;
}

.balloon-float-2 {
  animation: balloon-float-2 6.6s ease-in-out infinite;
  animation-delay: -2.1s; /* phase offset */
}

.balloon-float-3 {
  animation: balloon-float-3 7.4s ease-in-out infinite;
  animation-delay: -4.0s; /* phase offset */
}



#fsBtn{
  position:absolute;
  top: 14px;
  right: 14px;
  z-index: 9999;
  padding: 8px;
  border: 0;
  border-radius: 8px;

  background: rgba(0,0,0,.05);
  cursor: pointer;

  display: grid;
  place-items: center;

  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition: transform 140ms ease, filter 140ms ease;
}

#fsBtn:hover { transform: scale(1.06); filter: brightness(1.05); }
#fsBtn:active { transform: scale(0.96); }

#fsBtn img{
  width: 28px;
  height: 28px;
  display:block;
  pointer-events:none;
  -webkit-user-drag:none;
}

#fsBtn.hidden{ display:none; }

.loading-pulse {
  pointer-events: none;
  animation: loading-pulse 0.9s ease-in-out infinite;
  opacity: 0.55;
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}
