
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  /* height: auto; */
  height: 48.5vmax;
  display: block; 
  position: relative;
  font-family: sans-serif;
  overflow: hidden;
}

/* Full-screen screens */
.screen {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s ease, visibility 1.2s;
  display: flex;
  flex-direction: column;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* Background images */
#screen1 {
  background-image: url('lab\ 1.png');
}

#screen2 {
  background-image: url('Fluid\ Mechanics\ Lab\ 2bg.png');
}



.header-bar {
  background: linear-gradient(160deg, rgba(0, 0, 200, 0.8), rgba(0, 150, 255, 0.8));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  padding: clamp(0.5rem, 2vw, 0.8rem) clamp(0.6rem, 3vw, 1rem);
  text-align: center;
}

.header-bar h1 {
  color: #fff;
  font-size: clamp(1rem, 4vw, 2rem);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  margin: 0;
  word-wrap: break-word;
}

@media (max-width: 768px) {
  .header-bar h1{
    font-size: 0.5rem;
  }
}

@media (max-width: 480px) {
  .header-bar h1{
    font-size: 0.3rem;
  }
}


/* Centered Start button */
.start-btn {
  background: rgba(255, 255, 255, 0.8);
  margin: auto;
  /* margin-bottom: 1vh; */
  position: absolute;
  top: 47%;
  right: 75%;
  padding: clamp(0.5rem, 2vw, 0.8rem) clamp(1rem, 4vw, 1.5rem);
  font-size: clamp(1rem, 3vw, 1.5rem);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.3s;
}

.start-btn:hover {
  background: rgba(255, 255, 255, 1);
}

/* Button reposition and smaller font on small screens */
@media (max-width: 480px) {
  .start-btn {
    width: 100%;
    max-width: 200px;
    font-size: clamp(0.5rem, 4vw, 1rem);
  }
}


.image-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.image-stack{
  position: relative;
  width: 100%;
  height: 100%;
}

.maintain-proportion{
  position: absolute;
  top: 21%;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
}

.apparatus {
  position: relative;
  display: inline-block;
}


/* machine image */
.img2 {
  background-image: url('adobe\ final\ machine.png'); 
  width: 100%;
  height: 83%;
}




/* upper part */
.img3 {
  background-image: url('adobe\ final\ part\ 2\ new.png');
  position: absolute;
  top: -1%;
  left: 44.5%;
  width: 12%;
  height: 14%;
  transition: transform 0.7s ease;
}


/* valve */
.img4{
  background-image: url(valve.png);
  position:absolute;
  top: 32.5%;
  left: 34%;
  width: 5%;
  height: 5%;
  transition: transform 0.8s ease;
}

@media (max-width: 768px) {
  .img4{
    left: 25%;
  }
}



/* weight */
.img5{
  background-image: url(weight-bg.png);
  top: 33%;
  left: 50%;
  width: 20%;
  height: 5%;  
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.7s ease;
}

/* @media (max-width: 768px) {
  .img5{
    left: 65%;
  }
} */


/* upper part osscilate */
@keyframes pressDownUp {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8%);
  }
  100% {
    transform: translateY(0);
  }
}


.img3.animate {
  animation: pressDownUp 0.4s ease;
}

@keyframes pressupleft {
  0%{
    transform: translate(0,0);
  }
  50%{
    transform: translate(-48%,-580%);
  }
   100%{
    transform: translate(-48%, -580%);
  } 
} 
.img5.upleft {
  animation: pressupleft .7s ease forwards;
}


/* fountain */
 .img6{
    position: absolute;
    top :22%;
    left: 35.2%;
    width: 30.625%;
    height: 15%;
    background-image: url('water-bg.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: scale(0.5) translateY(20px);
    transition: transform 1s ease, opacity 0.8s ease;
    pointer-events: none;
    z-index: 10;
  }

   .img6.active {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  .img6.active {
    animation: splashPulse 1.5s infinite ease-in-out;
  }
  
  @keyframes splashPulse {
    0% { transform: scale(1) translateY(0); opacity: 1; }
    50% { transform: scale(1.05) translateY(-5px); opacity: 0.9; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
  } 


  #stopwatch {
  position: absolute;
  top: 5%;
  right: 5%;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
  font-family: monospace;
  border-radius: 8px;
  display: none; /* Hidden initially */
  z-index: 15;
}


 .img7 {
  position: absolute;
  bottom: 64%;
  left: 47%;
  width: 6.8%;
  height: 0%;
  background-image: url('rising\ water.png'); 
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: height 30s linear, opacity 1s ease;
  z-index: 11; /* higher than img6 */
   pointer-events: none;
} 


.img7.active {
  opacity: 1;
  height: 4%; /* final height over 30s */
}


.img7.hide {
  height: 0%;
  transition: height 2s linear, opacity 3s ease;
}
@media (max-width: 1100px) {
  .img7{
    width: 9%;
    left:46.5% ;
  }
}

@media (max-width: 680px) {
  .img7{
    width: 14%;
    left:44% ;
  }
}



#collectBtn {
  position: absolute;
  top:60%;
  left: 90%;
  transform: translateX(-50%);
  padding: 12px 24px;
  font-size: 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 12;
}


#collectBtn.show {
  opacity: 1;
  pointer-events: auto;
}


#collectBtn.hidden {
  pointer-events: none;
  opacity: 0;
}


.bg-image {
  position: absolute;
  top: 47%;
  left: 52%;
  width: 3%;
  height: 10%;
  transition: transform 1s ease;
  z-index: 2; /* behind img2 and others */
}


.bg-image.up {
  transform: translateY(-10px); /* move slightly up */
}


.img2, .img3, .img4, .img5, .img6, .img7 {
  position: absolute;
  z-index: 5; 
}

