/* 0) Optional: allow touch interactions */
* {
    touch-action: manipulation;
  }
  
  /* 1) Reset defaults, remove margins/padding, fill background with black */
  html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background-color: black;
    /* 2) Use Flexbox on body to center #frame vertically & horizontally */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* 3) #frame preserves a 1500×1792 aspect ratio, centered by flex parent */
  #frame {
    aspect-ratio: 2200 / 2200;
    width: 90vw;          /* scales down on small devices */
    max-width: 2200px;    /* never exceed original width on large desktops */
    background-color: black;
    overflow: hidden;     /* hide anything beyond boundaries */
    position: relative;   /* needed for absolutely positioned collage items */
    /* no border => black bars if ratio doesn't match device exactly */
  }
  
  /* #collage fills #frame */
  #collage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  
  /* Collage layers */
  .layer {
    position: absolute;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  }
  .layer.focused {
    transform: scale(1.1);
    transition: transform 0.3s ease;
  }

  /* Popups & Overlays */
  #popup-overlay,
  #warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 30;
  }
  .popup {
    background: white;
    color: black;
    border-radius: 10px;
    padding: 1.25rem;
    max-width: 90%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    font-family: "Special Elite", serif;
    line-height: 1.5;
    text-align: center;
  }
  .popup-content {
    display: flex;
    flex-direction: row;  /* side-by-side on larger screens */
    align-items: center;
    justify-content: center;
  }
  /* The image container and text container */
  .popup-img-container {
    flex: 0 0 auto;
    margin-right: 1rem;  /* space between image and text */
  }

  .popup-text-container {
    flex: 1;
    font-size: 24px;
    /* Let text fill remaining space */
  }

  /* The actual popup image */
  .popup-img {
    width: 150px;
    height: auto;
    object-fit: contain;
  }
  
  /* YouTube & video containers */
  #youtube-container, #video-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: black;
    padding: 10px;
  }
  #youtube-container iframe,
  #video-container video {
    width: 560px;
    height: 315px;
    max-width: 100%;
  }
  
  /* Base loading screen styles */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Prevent the entire loading screen from being clickable */
  pointer-events: none;
}


  /* The loading background image covers the whole screen */
#loading-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  /* Make background not receive pointer events */
  pointer-events: none;
}

/* The start button will be clickable */
#start-button {
  position: relative;
  z-index: 10;
  cursor: pointer;
  opacity: 0;
  transition: opacity 1s ease;
  /* Enable pointer events on the button */
  pointer-events: auto;
}
  
  #loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  /* First loading image is smaller by default (e.g. 300px) */
  #loading-img1.loading-image {
    width: 300px;
    height: auto;
    clip-path: inset(0 0 0 0);
    -webkit-mask-image: linear-gradient(90deg, black 0%, black 49%, transparent 51%, transparent 100%);
    mask-image: linear-gradient(90deg, black 0%, black 49%, transparent 51%, transparent 100%);
    -webkit-mask-size: 200% 100%;
    mask-size: 250% 100%;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    opacity: 1;
    animation: maskReveal 7s ease forwards;
  }
  
  /* Second loading image is slightly larger (e.g. 350px) */
  #loading-img2.loading-image {
    width: 500px;
    height: auto;
    margin-top: 20px;
    -webkit-mask-image: linear-gradient(90deg, black 0%, black 49%, transparent 51%, transparent 100%);
    mask-image: linear-gradient(90deg, black 0%, black 49%, transparent 51%, transparent 100%);
    -webkit-mask-size: 200% 100%;
    mask-size: 250% 100%;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    opacity: 1;
    animation: maskReveal 7s ease forwards;
    animation-delay: 4s; /* second image starts later */
  }
  
  /* Reveal animation (same for both) */
  @keyframes maskReveal {
    from {
      -webkit-mask-position: 100% 0;
      mask-position: 100% 0;
    }
    to {
      -webkit-mask-position: 0 0;
      mask-position: 0 0;
    }
  }
  @keyframes hoverFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
  }
  @keyframes glowPulse {
    0% { filter: drop-shadow(0 0 5px #f9e08d); }
    50% { filter: drop-shadow(0 0 20px #f9e08d); }
    100% { filter: drop-shadow(0 0 5px #f9e08d); }
  }
    
  /* 6) Mobile adjustments: keep #loading-img2 bigger than #loading-img1 */
  @media (max-width: 600px) {
    #frame {
      width: 100vw; /* fill phone width, letterbox in black if needed */
    }
  
    #start-button {
      max-width: 200%;
      width: auto;
    }
  
    #loading-img1.loading-image {
      max-width: 45%;
      width: auto;
      height: auto;
    }
    #loading-img2.loading-image {
      max-width: 85%;
      width: auto;
      height: auto;
    }
    .center-fire-gif {
        max-width: 40%;
        max-height: 40%;
  }
  .popup {
    max-width: 80%;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  /* The image container and text container */
  .popup-img-container {
    flex: 0 0 auto;
    margin-right: 10px;  /* space between image and text */
  }
  .popup-content {
    display: flex;
    flex-direction: column;  /* side-by-side on larger screens */
    align-items: center;
    justify-content: center;
  }
  .popup-text-container {
    flex: 1;
    font-size: 0.9rem;
    /* Let text fill remaining space */
  }

  /* The actual popup image */
  .popup-img {
    width: 150px;
    height: auto;
    object-fit: contain;
  }
}

@media (max-width: 480px) {
  .popup {
    max-width: 80%;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  .popup-content {
    display: flex;
    flex-direction: column;  /* side-by-side on larger screens */
    align-items: center;
    justify-content: center;
  }
  /* The image container and text container */
  .popup-img-container {
    flex: 0 0 auto;
    margin-right: 10px;  /* space between image and text */
  }

  .popup-text-container {
    flex: 1;
    font-size: 16px;
    /* Let text fill remaining space */
  }

  /* The actual popup image */
  .popup-img {
    width: 150px;
    height: auto;
    object-fit: contain;
  }
}

/* Medium devices (e.g., larger phones, up to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  #start-button {
    width: 100%;
  }
  .popup {
    max-width: 85%;
    padding: 1rem;
    font-size: 1rem;
  }
  /* The image container and text container */
  .popup-img-container {
    flex: 0 0 auto;
    margin-right: 10px;  /* space between image and text */
  }
  .popup-content {
    display: flex;
    flex-direction: row;  /* side-by-side on larger screens */
    align-items: center;
    justify-content: center;
  }
  .popup-text-container {
    flex: 1;
    font-size: 1.2rem;
    /* Let text fill remaining space */
  }

  /* The actual popup image */
  .popup-img {
    width: 150px;
    height: auto;
    object-fit: contain;
  }
}

/* Tablets (e.g., 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  #start-button {
    width: 80%;
  }
  .popup {
    max-width: 90%;
    padding: 1.25rem;
    font-size: 1rem;
  }
  /* The image container and text container */
  .popup-img-container {
    flex: 0 0 auto;
    margin-right: 10px;  /* space between image and text */
  }
  .popup-content {
    display: flex;
    flex-direction: row;  /* side-by-side on larger screens */
    align-items: center;
    justify-content: center;
  }
  .popup-text-container {
    flex: 1;
    font-size: 1.3rem;
    /* Let text fill remaining space */
  }

  /* The actual popup image */
  .popup-img {
    width: 150px;
    height: auto;
    object-fit: contain;
  }
}

/* Large devices (above 1024px) */
@media (min-width: 1025px) {
  #start-button {
    width: 80%;
  }
}

  