
@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;      /* prevents double-tap zoom on most browsers */
  -webkit-text-size-adjust: 100%;
}

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

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

#viewport {
  position: fixed;
  inset: 0;

  /* ✅ use real visible viewport height on mobile */
  height: 100svh;   /* stable viewport height */
  height: 100dvh;   /* dynamic viewport height (newer browsers) */
  width: 100vw;

  /* safe area */
  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; /* IMPORTANT */
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  overflow: hidden;
  touch-action: none;
}


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

#overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay {
  position: absolute;
  user-select: none;
  pointer-events: none;
}

#items {
  position: absolute;
  inset: 0;
}

.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;
}

.screen-text {
  color: #000000;
  font-family: "Proxima Nova", sans-serif;
  font-size: 44px;          
  line-height: 1.2;
  text-align: center;
   white-space: pre-wrap;     /* \n becomes line breaks AND wrapping still works */
  overflow-wrap: anywhere;   /* wrap long tokens */
  word-break: break-word;    /* fallback */
  box-sizing: border-box;
  display: block;
}



#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; }



#hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px 0px 40px 0px;
  pointer-events: none;
}

#badges {
  height: 140px;
  width: 1220px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 100px;
  pointer-events: none;
}
#badges-layer {
  position: absolute;
  inset: 0;          
  pointer-events: none;       
}

#ui-layer {
  position: absolute;
  inset: 0;        /* 1920x1080 design space */
  pointer-events: none;
}


#modalBackdrop {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 100;
}

#modal {
  position: absolute;
  opacity: 0;
  transform: scale(0.94);
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
#modal img {
  -webkit-user-drag: none;
  user-drag: none;
}

#modalBackdrop.no-bg {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none; 
}

#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); /* overshoot */
  }
  100% {
    transform: scale(1);
  }
}


/* dim/blur stays here */
#modalBackdrop.with-bg{
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.15);
}

.popup-shell{
  position: relative;
  border-radius: 20px;
  padding: 60px 120px;
  background: #eef0bf; /* your yellow */
}
.popup-shell-large{
  position: relative;
  border-radius: 50px;
  padding: 60px 120px;
  background: #eef0bf; /* your yellow */
}
.popup-shell-large-top{
  position: relative;
  border-radius: 50px;
  padding: 60px 80px;
  background: #eef0bf; /* your yellow */
}
.popup-shell-large-left{
  position: relative;
  border-radius: 50px;
  padding: 60px 120px 60px 70px;
  background: #eef0bf; /* your yellow */
}
.popup-shadow{
  box-shadow: 6px 6px 4px rgba(0,0,0,0.4); /* instructions has shadow */
}
.popup-no-shadow{
  box-shadow: none; /* bg popup no shadow */
}

.popup-close{
  position:absolute;
  right: 20px;
  top: 20px;
  height: auto;
  cursor: pointer;
}
.popup-close-large{
  position:absolute;
  right: 35px;
  top: 35px;
  height: auto;
  cursor: pointer;
}


.popup-body-row {
  display: flex;
  align-items: center;
  gap: 70px;
}

.popup-body-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  text-align: center;
}

.popup-modal-image.top {
  display: block;
}


.popup-modal-image{
  height: auto;
  display:block;
}
.popup-modal-image.left{ order: 0; }
.popup-center{ flex: 1; text-align:center; }

.popup-text{
  font-family: "Proxima Nova", system-ui, sans-serif;
  font-weight: 700;
  font-size: 42px;
  line-height: 1.05;
  color: #111;
}

.popup-btn{
  margin-top: 40px;
  height:auto;
  cursor:pointer;
}

.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;
}

.ui-button:hover {
  transform: scale(1.06);
  filter: brightness(1.05);
}

.ui-button:active {
  transform: scale(0.98);
}

.hidden {
  display: none !important;
}


@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;
}


/* --- Sound toggle --- */
#soundToggle{
  position:absolute;
  right: 38px;
  bottom: 36px;
  z-index: 60;
  cursor: pointer;
  pointer-events: auto;
}
#soundToggle.hidden{ display:none !important; }




/* --- Restart button (bottom-left) --- */
#restartBtn{
  position: absolute;
  left: 38px;
  bottom: 36px;
  z-index: 65;

  padding: 14px 22px;
  border: 0;
  border-radius: 22px;

  font-family: "Proxima Nova", system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.5px;

  background: rgba(0,0,0,0.75);
  color: #fff;

  cursor: pointer;
  pointer-events: auto;

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

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

#restartBtn:hover { transform: scale(1.06); filter: brightness(1.05); }
#restartBtn:active { transform: scale(0.98); }
#restartBtn.hidden{ display:none !important; }

/* --- Restart confirm popup (YES/NO) --- */
.restart-confirm-title{
  font-family: "Proxima Nova", system-ui, sans-serif;
  font-weight: 800;
  font-size: 44px;
  line-height: 1.05;
  text-align: center;
  color: #111;
}

.restart-confirm-actions{
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 28px;
}

.restart-confirm-btn{
  border: 0;
  border-radius: 999px;
  padding: 12px 34px;

  font-family: "Proxima Nova", system-ui, sans-serif;
  font-weight: 800;
  font-size: 34px;

  cursor: pointer;
  pointer-events: auto;

  background: #2f7d3b;
  color: #fff;

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

.restart-confirm-btn:hover { transform: scale(1.06); filter: brightness(1.05); }
.restart-confirm-btn:active { transform: scale(0.98); }

.restart-confirm-close{
  position: absolute;
  right: 22px;
  top: 16px;

  border: 0;
  background: transparent;
  color: #111;

  font-size: 50px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;

  transition: transform 140ms ease, filter 140ms ease;
}
.restart-confirm-close:hover { transform: scale(1.08); filter: brightness(1.05); }
.restart-confirm-close:active { transform: scale(0.98); }