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

/* Body */
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #caf7e6;
  font-family: sans-serif;
  /* --- MODIFIED --- */
  /* Removed all flex properties */
  /* display: flex; */
  /* justify-content: center; */
  /* align-items: flex-start; */
  /* padding-top: 5vh; */
}

/* Scalable & Proportional Container */
#container {
  display: flex;
  flex-direction: row;
  width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;
  background: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;

  /* --- ADDED --- */
  /* Use margins for layout */
  /* margin-top: 5vh; This pins it 5% from the top
  margin-left: auto; This centers it horizontally
  margin-right: auto; This centers it horizontally */
}

/* Left Section */
#left {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
}

/* Responsive Background Image */
#workingTable {
  width: 100%;
  height: 100%;
  object-fit: fill;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}


.stepBox {
  width: 90%;
  margin: 1vmin auto;
  padding: 1vmin;
  background-color: rgb(129, 221, 117);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: #fcd85c;
  border-left-width: 0.8vmin;
  border-left-style: solid;
  transition: background-color 0.3s, transform 0.3s;
  position: absolute;
  left: 5%;
  z-index: 50;




}

/* Right Section */
#right {
  width: 30%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Steps Panel */
#steps {
  height: 70%;
  background-color: #fef5dc;
  padding: 1vmin;
  font-size: 1.2vmin;
  overflow-y: auto;
}

/* Instructions Panel */
#instructions {
  height: 30%;
  background-color: #ae79bc;
  padding: 1vmin;
  font-size: 1.2vmin;
  overflow-y: auto;
}
.meltingEffect {
  transition: filter 30s linear;
  filter: brightness(1.3) saturate(0.6) sepia(0.3);
}

.meltedFinal {
  filter: brightness(1.5) saturate(0.4) sepia(0.5);
}

/* --- LAB EQUIPMENT --- */

/* Pipette */
#pipette {
  display: none;
  /* Hidden at start */
  position: absolute;
  top: 65%;
  left: 10%;
  width: 8%;
  /* % instead of vw */
  transform: rotate(90deg);
  z-index: 20;
  transition: transform 1s ease-in-out, top 1s ease-in-out, left 1s ease-in-out;
}

#pipette-w {
  position: relative;
  width: 50%;
  height: auto;
  z-index: 2;
}

#diethylEtherSolution {
  display: none;
  /* Hidden at start */
  position: absolute;
  width: 11.5%;
  top: 87%;
  /* % instead of vh */
  left: 20%;
  /* % instead of vw 19.5% */
  z-index: 1;
  transition: transform 1s ease-in-out;
}

#bottleSolutionPouringImage {
  display: none;
  /* Hidden at start */
  position: absolute;
  width: 40%;
  height: 36%;
  top: 25%;
  /* % instead of vh */
  left: -1.5%;
  /* % instead of vw 19.5% */
  z-index: 1;
  rotate: -4deg;
  transition: transform 1s ease-in-out;
}

/* Water Bath */
#waterBathWrapper {
  display: none;
  position: absolute;
  top: 29%;
  left: 3%;
  width: 25%;
  z-index: 100;
}

#waterBath {
  position: relative;
  width: 100%;
}

#waterBathImage {
  width: 100%;
  height: auto;
}

/* CURRENT TEMPERATURE */
#waterBathCurrentTemp {
  position: absolute;
  top: 65%;
  left: 15%;
  width: 40%;
  height: 10%;
  background-color: black;
  color: lime;
  font-family: "Courier New", monospace;
  font-size: 1.2vw;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  z-index: 101;
}

/* SET TEMPERATURE */
#waterBathSetTemp {
  position: absolute;
  top: 77%;
  left: 15%;
  width: 40%;
  height: 10%;
  background-color: black;
  color: orange;
  font-family: "Courier New", monospace;
  font-size: 1.1vw;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  z-index: 101;
}

/* CLOCK (PNG BACKGROUND + COUNTER) */
#waterBathCountdown {
  position: absolute;
  bottom: 5%;
  left: 105%;
  width: 40%;
  height: 40%;
  z-index: 101;
  overflow: hidden;
  pointer-events: none;
  background: none; /* Use the <img> inside for the clock face */
}

#waterBathCountdown .clock-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

#waterBathCountdown #waterBathTime {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Arial", sans-serif;
  font-size: 1.6vw;
  letter-spacing: 0.15em;
  color: #00e5ff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.85);
  z-index: 2;
  pointer-events: none;
}

/* POWER BUTTON */
#waterBathPower {
  position: absolute;
  bottom: 17%;
  left: 58%;
  width: 13%;
  height: 9%;
  background-color: rgb(46, 174, 197);
  color: white;
  font-size: 1vw;
  border-radius: 10%;
  cursor: pointer;
  z-index: 101;
}

/* TEMP UP */
#tempUp {
  position: absolute;
  bottom: 26%;
  right: 15%;
  width: 10%;
  aspect-ratio: 1 / 1;
  background-color: #007bff;
  color: white;
  font-size: 1.5vw;
  border-radius: 50%;
  cursor: pointer;
  z-index: 101;
}

/* TEMP DOWN */
#tempDown {
  position: absolute;
  bottom: 14%;
  right: 15%;
  width: 10%;
  aspect-ratio: 1 / 1;
  background-color: #007bff;
  color: white;
  font-size: 1.5vw;
  border-radius: 50%;
  cursor: pointer;
  z-index: 101;
}

/* START BUTTON */
#waterBathStart {
  position: absolute;
  bottom: 28%;
  left: 59%;
  width: 12%;
  height: 8%;
  background-color: orange;
  color: white;
  font-size: 1vw;
  border-radius: 20%;
  cursor: pointer;
  z-index: 101;
}

/* Weighting Machine */
#weightingMachineWrapper {
  position: absolute;
  top: 63%;
  left: 3%;
  width: 25%;
  z-index: 10;
  display: block;
  /* Visible at start */
}

#weightingMachine {
  position: relative;
  width: 100%;
  height: auto;
}

#weightingMachineImage {
  width: 100%;
  height: auto;
  z-index: 1;
}

#screen {
  display: flex;
   justify-content: center;   /* horizontal center */
  align-items: center;       /* vertical center */
  text-align: center;
  position: absolute;
  top: 44%;
  left: 48.5%;
  width: 38%;
  /* % instead of vw */
  height: 30%;
  transform: translateX(-50%);
  background: black;
  color: lime;
  font-family: "Courier New", monospace;
  font-size: 1.2vw;
  padding: 0.3vw 0.6vw;
  border-radius: 5px;
  z-index: 2;
  text-align: center;
}

#power {
  position: absolute;
  bottom: 30%;
  left: 70%;
  background: rgb(1, 7, 14);
  color: white;
  font-size: 1vw;
  width: 21%;
  border-radius: 10%;
  z-index: 2;
  padding: 1%;
  text-align: center;
}

#tare {
  position: absolute;
  bottom: 30%;
  right: 74%;
  background: gray;
  color: white;
  font-size: 1vw;
  padding: 0.3vw 0.6vw;
  border-radius: 10%;
  z-index: 2;
  margin: 0;
  padding: 1%;
  text-align: center;
}

/* Reagent Bottles */
.reagent-bottle {
  display: none;
  /* Hidden at start */
  position: absolute;
  aspect-ratio: 5 / 9;
  width: 10%;
  /* % instead of vw */
  z-index: 10;

}

.reagent-bottle img {
  position: absolute;
  width: 100%;
  height: 100%;
}

.reagent-bottle :nth-child(1) {
  /* The bottle image */
  z-index: 2;
  /* FIX: Add top and left 0 to lock the bottle to its container */
  top: 25%;
  left: 0;
}

.reagent-bottle :nth-child(2) {
  /* The solution image */
  top: 60%;
  /* Adjusted for new 100% height */
  height: 65%;
  z-index: 1;
  display: block;
  /* Make solution visible *within* the hidden parent */
}

#EthylAlcohol {
  top: 20%;
  left: 90%;
}

#Ammonia {
  top: 40%;
  left: 70%;
}

#Diethyl-Ether {
  display: none;
  top: 40%;
  left: 75%;
  cursor: pointer;
  z-index: 500;
  transition: top 1s ease-in-out, left 1s ease-in-out, transform 1s ease-in-out;
}

#Petroleum-Ether {
  top: 40%;
  left: 80%;
}

/* Stand and Funnel */


/* Plate, Knife, Spatula */
#plate {
  position: absolute;
  top: 75%;
  left: 55%;
  width: 18%;
  z-index: 10;
  display: block;
  /* Visible at start */
}

#plate img {
  width: 100%;
  height: 100%;
}

#knife {

  cursor: pointer;
  position: absolute;
  top: 75%;
  left: 80%;
  width: 15%;
  z-index: 20;
  display: block;
  /* Visible at start */
  transition: top 1s ease-in-out, left 1s ease-in-out;
}

#knife img {
  width: 100%;
  height: 100%;
  z-index: 10;
}

#spatula {
  cursor: pointer;
  position: absolute;
  top: 90%;
  left: 5%;
  width: 20%;
  /* Consolidated width */
  z-index: 20;
  display: block;
  /* Visible at start */
  transition: top 1s ease-in-out, left 1s ease-in-out, transform 1s ease-in-out;
}

#spatula img {
  width: 100%;
  /* Image now fills the wrapper */
  height: auto;
}

#beaker {
  display: none;
  cursor: pointer;
  position: absolute;
  aspect-ratio: 4/6;

  top: 55%;
  /* 30% down from top of container */
  left: 25%;
  /* 55% from left edge */
  width: 10%;
  z-index: 70;
  transition: transform 1s ease-in-out;
}

#beakerImage {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 80;
  transition: transform 1s ease-in-out;
}


#butterMeltedBeaker {
  position: absolute;
  display: block;
  /* position: relative; */
  top: 88.7%;
  left: 5.6%;
  height: 10%;
  width: 87.5%;
  z-index: 1;
}

#butterMelted1 {
  position: absolute;
  display: block;
  /* position: relative; */
  top: 44%;
  left: 5.6%;
  height: 50%;
  width: 87.5%;
  z-index: 1;
}

#flaskButter {
  display: none;
  position: absolute;
  top: 5%;
  /* Adjust as needed to fit shape vertically */
  left: 1%;
  /* Adjust to align inside flask */
  width: 34%;
  /* Leave space from edges */
  height: auto;
  /* Maintain aspect ratio */
  z-index: 5;
  /* Below the flask image but above melted butter */
  pointer-events: none;
  /* Avoid accidental clicks */
  object-fit: contain;
  overflow: hidden;
}

/* Flask */
#flask {
  cursor: pointer;
  position: absolute;
  aspect-ratio: 5/9;
  top: 50%;
  left: 40%;
  width: 10%;
  z-index: 15;
  display: block;
  /* Visible at start */
  transition: top 1s ease-in-out, left 1s ease-in-out, transform 1s ease-in-out;
}

#flaskImage {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* solution in conical flask */
#butterMelted {
  position: absolute;
  display: none;
  /* Hidden at start */
  top: 89.9%;
  left: 1.2%;
  height: 10%;
  width: 97%;
  z-index: 1;
}

#flaskButter {
  display: none;
  /* Hidden at start */
  position: absolute;
  top: 5%;
  left: 1%;
  width: 34%;
  height: auto;
  z-index: 5;
  pointer-events: none;
  object-fit: contain;
  overflow: hidden;
}

#cylinder50ml {
  cursor: pointer;
  position: absolute;
  aspect-ratio: 4/9;
  /* height: 50%; */
  /* width: auto; */
  top: 60%;
  left: 60%;
  width: 6%;
  z-index: 15;
  display: none;
  /* Visible at start */
  transition: top 1s ease-in-out, left 1s ease-in-out, transform 1s ease-in-out;
}

#cylinderImage {
  position: absolute;
  width: 100%;
  /* CHANGED from 60% */
  height: 100%;
  /* CHANGED from 60% */
  z-index: 10;
}

/* 2. Position the solution and bring it to the front */
#cylinderSolution {
  position: absolute;
  display: none;
  /* Adjust 'top' to match the liquid level you want (e.g. 60% for half full) */
  top: 2.4%;
  left: 22%;
  height: 95%;
  /* Increase height slightly */
  width: 55%;
  z-index: 8;
  /* CHANGED to 11 to force it in front of the cylinder */
}

/* solution in conical flask */


/* Butter */
#butter-block {
  position: absolute;
  bottom: 16%;
  left: 58%;
  width: 12%;
  height: 12%;
  cursor: pointer;
  background: linear-gradient(135deg, #f9e076, #fcd85c);
  border-radius: 10px;
  box-shadow: -10px 10px 10px rgba(0, 0, 0, 0.2),
    10px 10px 15px rgba(0, 0, 0, 0.3), inset -5px -5px 10px #fff9c2,
    inset 6px 6px 12px #cfae48;
  z-index: 15;
  overflow: hidden;
  border: 1px solid #e8c74a;
  display: block;
  /* Visible at start */
}

#butter-block::before {
  content: "";
  position: absolute;
  top: 0;
  right: -0.52vw;
  width: 0.52vw;
  height: 100%;
  background: linear-gradient(to right, #fcd85c, #e8c74a);
  box-shadow: inset -5px -5px 10px #eac74f;
  transition: transform 1s ease-in-out;
}

#butter-block::after {
  content: "";
  position: absolute;
  left: 0;
  top: -0.93vh;
  width: 100%;
  height: 1.85vh;
  background: linear-gradient(to bottom, #fbe67a, #fcd85c);
  box-shadow: inset -5px -5px 10px #fff6b2;
  transition: transform 1s ease-in-out;
}

#butter-block .butter-shine {
  position: absolute;
  top: 1.1vh;
  left: 1.04vw;
  width: 60%;
  height: 1.67vh;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  filter: blur(4px);
  transition: transform 1s ease-in-out;
}

#butter-slice {
  display: none;
  /* Hidden at start */
  position: absolute;
  top: 78%;
  left: 68%;
  width: 3%;
  height: 6%;
  z-index: 11;
  cursor: pointer;
  background: linear-gradient(135deg, #f9e076, #fcd85c);
  border-radius: 10px;
  box-shadow: -10px 10px 10px rgba(0, 0, 0, 0.2),
    10px 10px 15px rgba(0, 0, 0, 0.3), inset -5px -5px 10px #fff9c2,
    inset 6px 6px 12px #cfae48;
  overflow: hidden;
  border: 1px solid #e8c74a;
  transition: top 1s ease-in-out, left 1s ease-in-out, transform 1s ease-in-out;
}

#butter-slice-1 {
  position: absolute;
  top: 78%;
  /* Initial top position */
  left: 68%;
  width: 3%;
  height: 5%;
  z-index: 10;
  cursor: pointer;
  background: linear-gradient(135deg, #f9e076, #fcd85c);
  border-radius: 10px;
  box-shadow: -10px 10px 10px rgba(0, 0, 0, 0.2),
    10px 10px 15px rgba(0, 0, 0, 0.3), inset -5px -5px 10px #fff9c2,
    inset 6px 6px 12px #cfae48;
  overflow: hidden;
  border: 1px solid #e8c74a;
  display: block;
  /* Visible at start */
  transition: top 1s ease-in-out, left 1s ease-in-out, transform 1s ease-in-out;
}

/* ... melted butter ... */
#melted-butter {
  position: absolute;
  left: 55%;
  /* Start position */
  top: 80%;
  /* Start position */
  width: 10%;
  /* % instead of vw */
  height: 3%;
  /* % instead of vh */
  background: radial-gradient(ellipse at center,
      #f9e076 0%,
      #fcd85c 60%,
      #e8c74a 100%);
  border-radius: 50% / 30%;
  opacity: 0;
  visibility: hidden;
  z-index: 99;
  transition: top 1s ease-in-out, left 1s ease-in-out, opacity 1s ease-in-out;
}

/* Porcelain Dish */
#porcelainDish {
  display: none;
  /* Hidden at start */
  position: absolute;
  aspect-ratio: 20 / 9;
  width: 11%;
  /* % instead of vw */
  top: 72%;
  left: 25%;
  z-index: 10;
  transition: top 1s ease-in-out, left 1s ease-in-out;
}

#porcelainDishImage {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 2;
}

#porcelainDishSolutionImage {
  display: none;
  /* Hidden at start */
  position: absolute;
  top: 35%;
  /* Adjusted */
  left: 1%;
  z-index: 1;
  height: 65%;
  width: 96%;
}

/* Pouring Streams */
#pouring {
  display: none;
  /* Keep pouring hidden until needed */
  position: absolute;
  width: 0.38%;
  height: auto;
  left: 45%;
  top: 51%;
  z-index: 13;
}

#pouringButter {
  display: none;
  /* Keep pouring hidden until needed */
  position: absolute;
  width: 0.2%;
  left: 17.5%;
  top: 50%;
  z-index: 13;
}

#pouringCylinder {
  display: none;
  /* Keep pouring hidden until needed */
  position: absolute;
  width: 0.3%;
  height: auto;
  left: 62.8%;
  top: 58%;
  z-index: 1;
}

/* Oven */
#ovenWrapper {
  position: absolute;
  width: 32%;
  /* % instead of vw */
  top: 30%;
  /* Example position */
  left: 30%;
  /* Example position */
  aspect-ratio: 1 / 1.2;
  z-index: 100;
  display: none;
  /* Hidden at start */
}

/* ... Other oven styles ... */
#oven {
  position: relative;
  width: 100%;
  height: 100%;
}

#ovenImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#ovenDoor {
  position: absolute;
  top: 27%;
  left: 5%;
  width: 70%;
  height: auto;
  z-index: 101;
}

#ovenDoorImage {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

#ovenScreen {
  position: absolute;
  top: 68%;
  left: 2%;
  width: 30%;
  height: 10%;
  color: rgb(22, 5, 35);
  font-family: "Courier New", monospace;
  font-size: 1.2vw;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  z-index: 999;
}

/* ... rest of oven styles ... */
#ovenTimer {
  display: none;
  position: absolute;
  top: 68%;
  left: 24%;
  width: 30%;
  height: 10%;
  background-color: black;
  color: cyan;
  font-family: "Courier New", monospace;
  font-size: 1.2vw;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  z-index: 102;
}

#oven button {
  position: absolute;
  font-size: 1vw;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 0.5vw;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 102;
  box-shadow: 0 0 2px #007bff;
}

#ovenPower {
  bottom: 5%;
  left: 35%;
  width: 30%;
  height: 10%;
  background-color: teal;
}

#oventempUp,
#oventempDown {
  width: 15%;
  height: 15%;
  border-radius: 50%;
  font-size: 1.2vw;
}

#oventempUp {
  bottom: 35%;
  right: 5%;
}

#oventempDown {
  bottom: 20%;
  right: 5%;
}

#ovenStart {
  bottom: 10%;
  left: 5%;
  width: 20%;
  height: 10%;
  background-color: orange;
  border-radius: 20%;
}

#ovenMM,
#ovenSS,
#ovenTempBtn {
  bottom: 5%;
  width: 20%;
  height: 8%;
  background-color: orange;
  border-radius: 10%;
}

#ovenMM {
  left: 5%;
}

#ovenSS {
  left: 30%;
}

#ovenTempBtn {
  left: 55%;
}

/* --- KEYFRAME ANIMATIONS --- */
/* (Unchanged, these are fine) */

.filling {
  animation: filling 2s linear backwards;
}

@keyframes filling {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }

  100% {
    clip-path: inset(0% 0% 0% 0%);
  }
}


.reducing1 {
  animation: reducing1 3s linear forwards;
}

@keyframes reducing1 {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(100% 0% 0% 0%);
  }
}

/* .reducing2 {
  animation: reducing2 1.2s linear forwards;
}
@keyframes reducing2 {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }
  50% {
    clip-path: inset(0% 0% 0% 0%);
  }
  100% {
    clip-path: inset(0% 0% 0% 0%);
  }
} */
.filling1 {
  animation: filling1 1.2s linear forwards;
}

.filling2 {
  animation: filling2 1.2s linear forwards;
}

.filling3 {
  animation: filling3 1.2s linear forwards;
}

.filling4 {
  animation: filling4 1.2s linear forwards;
}

@keyframes filling1 {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }

  100% {
    clip-path: inset(73% 0% 0% 0%);
  }
}

@keyframes filling2 {
  0% {
    clip-path: inset(73% 0% 0% 0%);
  }

  100% {
    clip-path: inset(45% 0% 0% 0%);
  }
}

@keyframes filling3 {
  0% {
    clip-path: inset(45% 0% 0% 0%);
  }

  100% {
    clip-path: inset(20% 0% 0% 0%);
  }
}

@keyframes filling4 {
  0% {
    clip-path: inset(20% 0% 0% 0%);
  }

  100% {
    clip-path: inset(0% 0% 0% 0%);
  }
}

.funnelButterReducing {
  animation: funnelButterReducing 2s linear forwards;
}

@keyframes funnelButterReducing {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(31% 0% 0% 0%);
  }
}

.butterFlaskFilling {
  animation: filling 2s linear backwards;
}

@keyframes butterFlaskFilling {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }

  50% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(100% 0% 0% 0%);
  }
}

.reducingButter {
  animation: reducingButter 2s linear forwards;
}

@keyframes reducingButter {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(0% 0% 100% 0%);
  }
}

.next,
.next2,
.next3,
.next4 {
  display: none;
  position: absolute;
  bottom: 2%;
  right: 1.5%;
  z-index: 200;
}

.next button,
.next2 button,
.next3 button,
.next4 button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.65em 1.7em;
  font-size: clamp(13px, 1.8vmin, 19px);
  font-weight: 800;
  font-family: 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.45), 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
  white-space: nowrap;
}

.next button:hover,
.next2 button:hover,
.next3 button:hover,
.next4 button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 22px rgba(21, 101, 192, 0.60);
}

.next button:active,
.next2 button:active,
.next3 button:active,
.next4 button:active {
  transform: scale(0.97);
}

.btnNext {
  /* display: none; */
  background-color: #28a745;
  z-index: 200;
  width: 120px;
  height: 120px;

  color: white;
  border: none;
  padding: 0.5vmin 1vmin;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2vmin;
  transition: background-color 0.3s;
}

.btnNext2 {
  background-color: #28a745;
  z-index: 200;
  width: 120px;
  height: 120px;

  color: white;
  border: none;
  padding: 0.5vmin 1vmin;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2vmin;
  transition: background-color 0.3s;
}

.btnNext3 {
  background-color: #28a745;
  z-index: 200;
  width: 120px;
  height: 120px;

  color: white;
  border: none;
  padding: 0.5vmin 1vmin;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2vmin;
  transition: background-color 0.3s;
}

.btnNext4 {
  background-color: #28a745;
  z-index: 200;
  width: 120px;
  height: 120px;

  color: white;
  border: none;
  padding: 0.5vmin 1vmin;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2vmin;
  transition: background-color 0.3s;
}

#stand {
  display: none;
  position: absolute;
  top: 32.5%;
  left: 4.5%;
  width: 35%;
  height: 75.81%;
  /* z-index: 1;   */
}

#standImage {
  display: block;
  position: absolute;
  width: 45%;
  height: 70%;
  z-index: 20;
  top: 2%;
  left: 2%;
  pointer-events: none;
  /* So it doesn't block clicks */
}

#burette {
  display: none;
  position: absolute;
  /* Adjust top if -15% pushes it off-screen. 
     If the container #stand has overflow:hidden, you won't see this. */
  top: 6%;

  /* Center it horizontally relative to the stand to start */
  left: 15.2%;

  /* Make it wide enough to actually see */
  width: 4.5%;

  height: 49.5%;

  /* CRITICAL: Must be higher than #standImage (50) */
  z-index: 5;

  pointer-events: none;
}

/* real buretteNozzel */
#buretteNozzel {
  display: none;
  position: absolute;
  width: 0.8%;
  height: 7.2%;
  top: 44.6%;
  left: 18.5%;
  z-index: 999;
  cursor: pointer;
  transition: transform ease-in-out;
  /* background-color: rgba(0, 255, 0, 0.4); Debug: translucent green */
}


#drop {
  display: none;
  position: absolute;
  /* Adjust top if -15% pushes it off-screen. 
     If the container #stand has overflow:hidden, you won't see this. */
  top: 55%;

  /* Center it horizontally relative to the stand to start */
  left: 16.65%;

  /* Make it wide enough to actually see */
  width: 0.7%;

  height: 3%;

  /* CRITICAL: Must be higher than #standImage (50) */
  z-index: 10;

  pointer-events: none;
}

#drop1 {
  display: none;
  position: absolute;
  /* Adjust top if -15% pushes it off-screen. 
     If the container #stand has overflow:hidden, you won't see this. */
  top: 98%;

  /* Center it horizontally relative to the stand to start */
  left: 22%;

  /* Make it wide enough to actually see */
  width: 6%;

  height: 5%;

  /* CRITICAL: Must be higher than #standImage (50) */
  z-index: 4;

  pointer-events: none;
}

#buretteSolution {
  display: none;
  position: absolute;
  top: 9.8%;
  /* 30% down from top of container */
  left: 16.24%;
  /* 55% from left edge */
  width: 1.6%;
  height: 45%;
  z-index: 1;
  transition: clip-path 0.8s ease-in-out;
}

/* #buretteNozzel{
  position: absolute;
  width: 5.3%;
  /* height: 14.5%; */
/* top: 19%; */
/* left: 11.47%; */
/* z-index: 999; */
/* cursor: pointer; */
/* background-color: rgba(0, 255, 0, 0.4); Debug: translucent green */
/* } */
*/
/* @keyframes dropForm {
  0% {
    clip-path: ellipse(0% 0% at 50% 50%);
  }
  100% {
    clip-path: ellipse(100% 100% at 50% 50%);
  }
} */

/* @keyframes dropFall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  90% {
    transform: translateY(100px); /* adjust fall distance */
/* opacity: 1;
  }
  100% {
    transform: translateY(100px);
    opacity: 0;
  }
} */
*/ .filling {
  animation: filling 2s linear backwards;
}

@keyframes filling {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }

  100% {
    clip-path: inset(0% 0% 0% 0%);

  }
}

.reducing {
  animation: reducing 2s linear forwards;
}

@keyframes reducing {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(10% 0% 0% 0%);

  }
}

/* .reducing1{
  animation: reducing1 2s linear forwards;
}
@keyframes reducing1{
  0% {
    clip-path: inset(0% 0% 0% 0%);
   }
   100%{
    clip-path: inset(80% 0% 0% 0%);

   }
} */


.reducing2 {
  animation: reducing2 3s linear forwards;
}

@keyframes reducing2 {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }

  50% {
    clip-path: inset(0% 0% 0% 0%);

  }

  100% {
    clip-path: inset(0% 0% 0% 0%);

  }
}

.reverseReducing {
  animation: reverseReducing 3s linear forwards;
}

@keyframes reverseReducing {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  50% {
    clip-path: inset(0% 0% 0% 0%);

  }

  100% {
    clip-path: inset(100% 0% 0% 0%);

  }
}

.filling1 {
  animation: filling1 1.2s linear forwards;
}

.filling2 {
  animation: filling2 1.2s linear forwards;
}

.filling3 {
  animation: filling3 1.2s linear forwards;
}

.filling4 {
  animation: filling4 1.2s linear forwards;
}

@keyframes filling1 {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }

  100% {
    clip-path: inset(73% 0% 0% 0%);

  }

}

@keyframes filling2 {
  0% {
    clip-path: inset(73% 0% 0% 0%);
  }

  100% {
    clip-path: inset(45% 0% 0% 0%);

  }
}

@keyframes filling3 {
  0% {
    clip-path: inset(45% 0% 0% 0%);
  }

  100% {
    clip-path: inset(20% 0% 0% 0%);

  }

}

@keyframes filling4 {
  0% {
    clip-path: inset(20% 0% 0% 0%);
  }

  100% {
    clip-path: inset(0% 0% 0% 0%);

  }

}


/* #pouring{
  display:none;
  position: absolute;
  width: 0.2vw;
  left: 41.4vw;
  height: 16vh;
  top: 54.8vh;
}
#pouringButter{
  display:none;
  position: absolute;
  width: 0.5vw;
  left: 11.15vw;
  top: 42.8vh;
} */


#beakerPouring {
  /* display:none; */
  position: absolute;
  width: 0vw;
  left: 8.2vw;
  top: 20vh;
}

#pouringBeaker {
  display: none;
  position: absolute;
  width: 0.5vw;
  height: 27.5vh;
  left: 11.15vw;
  top: 21vh;
}


@keyframes bounceTilt {
  0% {
    transform: translateY(0vh) rotate(0deg);
  }

  10% {
    transform: translateY(-4vh) rotate(-7deg);
  }

  20% {
    transform: translateY(4vh) rotate(-7deg);
  }

  30% {
    transform: translateY(-4vh) rotate(7deg);
  }

  40% {
    transform: translateY(4vh) rotate(7deg);
  }

  50% {
    transform: translateY(-4vh) rotate(-7deg);
  }

  60% {
    transform: translateY(4vh) rotate(-7deg);
  }

  70% {
    transform: translateY(-4vh) rotate(7deg);
  }

  80% {
    transform: translateY(4vh) rotate(7deg);
  }

  90% {
    transform: translateY(4vh) rotate(0deg);
  }

  100% {
    transform: translateY(0vh) rotate(0deg);
  }
}

.bounce-tilt {
  animation: bounceTilt 3s ease-in-out;
}

/* /*  */

.funnelButterReducing {
  animation: funnelButterReducing 2s linear forwards;
}

@keyframes funnelButterReducing {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(31% 0% 0% 0%);

  }
}

#porcelainDish {
  display: none;
  position: absolute;
  /* height: ; */
  aspect-ratio: 20 / 9;
  width: 7vw;
  top: 72%;
  left: 25%;
  transition: transform 1s ease-in-out;


}

#porcelainDishImage {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  /* aspect-ratio: 16/9; */
  left: 0;
  height: 100%;
  width: 100%;
}

#porcelainDishSolutionImage {
  display: none;
  position: absolute;
  top: 85%;
  left: 1%;
  z-index: 1;
  height: 65%;
  width: 96%;
}


.butterFlaskFilling {
  animation: filling 2s linear backwards;
}

@keyframes butterFlaskFilling {
  0% {
    clip-path: inset(100% 0% 0% 0%);
  }

  50% {
    clip-path: inset(0% 0% 0% 0%);

  }

  100% {
    clip-path: inset(100% 0% 0% 0%);
  }
}


.reducingButter {
  animation: reducingButter 2s linear forwards;
}

@keyframes reducingButter {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(0% 0% 100% 0%);
  }
}


@keyframes dropForm {
  0% {
    clip-path: ellipse(0% 0% at 50% 50%);
  }

  100% {
    clip-path: ellipse(100% 100% at 50% 50%);
  }
}

@keyframes dropFall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  90% {
    transform: translateY(100px);
    /* adjust fall distance */
    opacity: 1;
  }

  100% {
    transform: translateY(100px);
    opacity: 0;
  }
}

.drop-form {
  animation: dropForm 0.4s ease-in-out forwards;
}

.drop-fall {
  animation: dropFall 0.6s ease-in forwards;
}



.reducingBurette1 {
  animation: reducingBurette1 1s linear forwards;
}

@keyframes reducingBurette1 {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  100% {
    clip-path: inset(1% 0% 0% 0%);

  }
}

.reducingBurette2 {
  animation: reducingBurette2 1s linear forwards;
}

@keyframes reducingBurette2 {
  0% {
    clip-path: inset(1% 0% 0% 0%);
  }

  100% {
    clip-path: inset(2% 0% 0% 0%);

  }
}

.reducingBurette3 {
  animation: reducingBurette3 1s linear forwards;
}

@keyframes reducingBurette3 {
  0% {
    clip-path: inset(2% 0% 0% 0%);
  }

  100% {
    clip-path: inset(3% 0% 0% 0%);

  }
}

.reducingBurette4 {
  animation: reducingBurette4 1s linear forwards;
}

@keyframes reducingBurette4 {
  0% {
    clip-path: inset(3% 0% 0% 0%);
  }

  100% {
    clip-path: inset(4% 0% 0% 0%);

  }
}

.reducingBurette5 {
  animation: reducingBurette5 1s linear forwards;
}

@keyframes reducingBurette5 {
  0% {
    clip-path: inset(4% 0% 0% 0%);
  }

  100% {
    clip-path: inset(5% 0% 0% 0%);

  }
}

.reducingBeaker {
  animation: reducingBeaker 3s linear forwards;
}

@keyframes reducingBeaker {
  0% {
    clip-path: inset(0% 0% 0% 0%);
  }

  50% {
    clip-path: inset(0% 0% 0% 0%);

  }

  100% {
    clip-path: inset(100% 0% 0% 0%);

  }
}

.reducingBeaker1 {
  animation: reducingBeaker 3s linear forwards;
}

@keyframes reducingBeaker1 {
  0% {
    clip-path: inset(0% 0% 100% 0%);
  }

  50% {
    clip-path: inset(0% 0% 100% 0%);

  }

  100% {
    clip-path: inset(0% 0% 0% 0%);

  }
}

.pouring-animation {
  /* display: block; */
  animation: pourFlow 2s linear forwards;
}

@keyframes pourFlow {

  /* Phase 1: Stream grows DOWN (Gravity) */
  0% {
    clip-path: inset(0 0 100% 0);
    /* Hidden at top */
  }

  50% {
    clip-path: inset(0 0 0 0);
    /* Fully visible stream */
  }

  /* Phase 2: Stay connected for a moment (Optional pause) */
  70% {
    clip-path: inset(0 0 0 0);
  }

  /* Phase 3: Stream cuts off from TOP (Empty) */
  100% {
    clip-path: inset(100% 0 0 0);
    /* Hidden at bottom */
  }
}

/* --- INTRO OVERLAY & ANIMATIONS --- */
#introOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  /* High opacity to hide lab */
  backdrop-filter: blur(5px);
  z-index: 2000;
  /* Highest priority */
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease-in-out;
}

#introOverlay .content {
  text-align: center;
}

.main-title {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 5vmin;
  color: #2c3e50;
  margin-bottom: 1vmin;
  opacity: 0;
  animation: slideDownFade 1s ease-out forwards;
}

.sub-title {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.5vmin;
  color: #7f8c8d;
  margin-bottom: 4vmin;
  opacity: 0;
  animation: slideUpFade 1s ease-out 0.5s forwards;
}

#btnStartExperiment {
  padding: 1.5vmin 4vmin;
  font-size: 2vmin;
  background: linear-gradient(135deg, #28a745, #218838);
  color: white;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
  opacity: 0;
  animation: scaleIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.2s forwards;
  transition: transform 0.2s, box-shadow 0.2s;
}

#btnStartExperiment:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes slideDownFade {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUpFade {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- ELEMENT INTRODUCTION STYLES --- */

/* The dynamic label pointing to elements */
#elementLabel {
  position: absolute;
  padding: 1vmin 2vmin;
  background-color: #333;
  color: #fff;
  border-radius: 4px;
  font-size: 1.5vmin;
  font-family: sans-serif;
  pointer-events: none;
  z-index: 1500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s, top 0.5s, left 0.5s;
}

#elementLabel::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.label-hidden {
  opacity: 0;
  visibility: hidden;
}

.label-visible {
  opacity: 1;
  visibility: visible;
}

/* Highlight Effect for the element being introduced */
.intro-highlight {
  position: relative;
  z-index: 1000 !important;
  /* Bring to front */
  filter: drop-shadow(0 0 1.5vmin gold);
  /* Glow effect */
  transform: scale(1.05);
  transition: all 0.5s ease-in-out;
}

/* --- GREEN BOARD MODAL --- */
.modal-hidden {
  display: none !important;
  /* display: none; */
}

#calcModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

#calcModal .chalkboard {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background-color: #0f3d3d;
  border: 1.5vmin solid #8b5a2b;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  padding: 2vmin;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Observation button shown after titration stop */
.observation {
  display: none;
  position: absolute;
  bottom: 2%;
  right: 1.5%;
  z-index: 200;
}

.observation button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.65em 1.7em;
  font-size: clamp(13px, 1.8vmin, 19px);
  font-weight: 800;
  font-family: 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #d35400 0%, #a84300 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(212, 84, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}

.observation button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 22px rgba(212, 84, 0, 0.60);
}

.observation button:active {
  transform: scale(0.97);
}

.chalkboard {
  width: 100%;
  height: 100%;
  background-color: #0f3d3d;
  /* Dark Green */
  border: 1.5vmin solid #8b5a2b;
  /* Wood Frame */
  border-radius: 0;
  box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0);
  color: #fff;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  padding: 2vmin;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-sizing: border-box;
}

.chalkboard h2 {
  text-align: center;
  border-bottom: 2px solid white;
  padding-bottom: 1vmin;
  font-size: 3vmin;
}

.chalk-content {
  font-size: 1.8vmin;
}

.obs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2vmin 0;
  border: 2px solid white;
}

.obs-table th,
.obs-table td {
  border: 1px solid white;
  padding: 1vmin;
  text-align: center;
}

.no-bullets {
  list-style: none;
  padding: 0;
}

.chalk-line {
  border-top: 1px dashed white;
  margin: 1.5vmin 0;
}

.final-result {
  /* display: flex;
  flex-direction: row;
  /* justify-content: center; */
  /* gap: 100; */
  display: none;
  align-items: space-between;
  font-size: 2.5vmin;
  color: #ffff00;
  /* Yellow Chalk */
  font-weight: bold;
  text-align: center;
  border: 2px solid #ffff00;
  padding: 1vmin;
  margin-top: 1vmin;
}

#btnRestart {
  margin-top: 2vmin;
  align-self: center;
  padding: 1vmin 3vmin;
  font-size: 2vmin;
  cursor: pointer;
  background: white;
  color: black;
  border: none;
  border-radius: 5px;
  font-weight: bold;
}

/* Result button */
#btnResult {
  margin-top: 2vmin;
  align-self: center;
  padding: 1vmin 3vmin;
  font-size: 2vmin;
  cursor: pointer;
  background: #ffff00;
  color: #0f3d3d;
  border: none;
  border-radius: 5px;
  font-weight: bold;
}

#btnResult:hover {
  background: #fff176;
}

/* Result Display */
#resultDisplay {
  margin-top: 1.5vmin;
  padding: 1.5vmin 2vmin;
  border: 2px solid #ffff00;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
}

#resultDisplay p {
  font-size: 2.5vmin;
  font-weight: bold;
  color: #ffff00;
  margin: 0;
}

.chalk-text {
  background: rgba(255, 255, 255, 0.1);
  padding: 1vmin;
  border-left: 4px solid #ffff00;
}

/* .formula-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5vmin;
  border: 1px dashed white;
  color: #eaffea;
  font-family: monospace;
} */

.chalk-btn {
  margin: 1vmin 0;
  padding: 1vmin 2.5vmin;
  font-size: 1.8vmin;
  cursor: pointer;
  background: #f5f5f5;
  color: black;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  transition: 0.2s;
}

.chalk-btn:hover {
  background: #ffff00;
}

.result-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;        /* Prevent wrapping */
}
.answer-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.answer-box input {
  width: 80px;
}
.answer-option {
  padding: 2px 6px;
  transition: all 0.3s ease;
}

#answerStatus {
  white-space: nowrap;      /* Prevent line break in text */
}
.highlight {
  background-color: yellow;
  border-radius: 4px;
}

#userAnswer {
  padding: 1vmin;
  font-size: 1.8vmin;
  border-radius: 5px;
  border: none;
  text-align: center;
}

/* Colors for correct / wrong */
.correct {
  border: 2px solid #00ff00 !important;
  background: #eaffea !important;
}

.wrong {
  border: 2px solid #ff0000 !important;
  background: #ffeaea !important;
}

/* --- START BUTTON (bottom right, pill) --- */
#startBtnWrapper {
  position: absolute;
  bottom: 2%;
  right: 1.5%;
  z-index: 9999;
}

#startExperimentBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.65em 1.8em;
  font-size: clamp(13px, 1.8vmin, 19px);
  font-weight: 800;
  font-family: 'Segoe UI', Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #2ecc71 0%, #1a7a42 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(39, 174, 96, 0.45), 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
  animation: startPulse 2.2s ease-in-out infinite;
  white-space: nowrap;
}

#startExperimentBtn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 22px rgba(39, 174, 96, 0.60);
}

#startExperimentBtn:active {
  transform: scale(0.96);
}

@keyframes startPulse {

  0%,
  100% {
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.45), 0 0 0 0 rgba(39, 174, 96, 0);
  }

  50% {
    box-shadow: 0 5px 18px rgba(39, 174, 96, 0.60), 0 0 0 7px rgba(39, 174, 96, 0.13);
  }
}

/* ─── HOVER TOOLTIPS ─────────────────────────────────────────────────── */

/* Hide ALL tooltips once the experiment starts */
body.tooltips-off [data-tooltip]::before {
  display: none !important;
}
body.tooltips-off #global-tooltip {
  display: none !important;
}

/* No isolation:isolate — it creates a stacking context that breaks butter rendering */
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  white-space: nowrap;
  padding: 0.6em 1.4em;
  background: linear-gradient(135deg, rgba(8, 28, 16, 0.97) 0%, rgba(18, 55, 30, 0.97) 100%);
  color: #a8ffb0;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: clamp(12px, 1.6vmin, 17px);
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 20px;
  /* pill shape, no pointy feel */
  border: 1.5px solid rgba(46, 204, 113, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(46, 204, 113, 0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 10000;
}

/* No ::after arrow — keeps tooltip clean and modern */
[data-tooltip]::after {
  content: none;
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Butter — tooltip placed well above so no glitch on hover ── */
#butter-block[data-tooltip]::before,
#butter-slice-1[data-tooltip]::before {
  bottom: calc(100% + 70px);
}


/* ── Plate ── */
#plate[data-tooltip]::before {
  bottom: calc(100% + 44px);
}


/* --- EXPERIMENT INFO ON GREENBOARD --- */
/* --- EXPERIMENT INFO TEXT --- */
#experimentInfo {
  position: absolute;
  top: 30%;
  left: 47%;
  transform: translateX(-50%);
  z-index: 1;
  color: white;
  pointer-events: none;
  text-align: center;

  display: flex;
  flex-direction: column;
  gap: 1.5vmin;
}

#labName {
  font-size: 5vmin;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

#experimentNumber {
  font-size: 3.5vmin;
  font-weight: 600;
  font-family: Georgia, serif;
}

#experimentAim {
  font-size: 2.4vmin;
  font-family: "Segoe UI", sans-serif;
  max-width: 70vmin;
  margin: 0 auto;
}

#debugPanel {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 9999;
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px;
  border-radius: 6px;
  display: none;
}

#debugPanel button {
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}

/* Hide by default */
.hidden {
  display: none;
}

/* TOGGLE BUTTON */
#stepToggleBtn {
  position: absolute;
  top: 0.7%;
  right: 0;
  height: 5.5%;
  width: 3%;
  z-index: 4000;
  padding: 2px 14px;
  border-radius: 8px 0 0 8px;
  background: #064a18;
  color: rgb(255, 255, 255);
  border: none;
  cursor: pointer;
  font-size: 60%;
}

/* SIDEBAR */
#stepSidebar {
  position: fixed;
  top: 0;
  right: -260px;
  /* hidden */
  width: 260px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 15px;
  transition: right 0.35s ease;
  z-index: 3999;
  overflow-y: auto;
}

/* OPEN STATE */
#stepSidebar.open {
  right: 0;
}

/* CONTENT */
#stepSidebar h3 {
  text-align: center;
  border-bottom: 1px solid #555;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

#stepList {
  list-style: none;
  padding: 0;
}

#stepList li {
  padding: 6px 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: #444;
  opacity: 0.5;
  font-size: 0.85rem;
  display: none; /* hide until completed */
}

/* STATES */
#stepList li.completed {
  display: block;
  background: #2ecc71;
  color: black;
  opacity: 1;
}

#stepList li.current {
  /* current step stays hidden until completed */
}

.sidebar-table-wrapper {
  margin-top: 1.5rem;
}

.sidebar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: #fff;
}

.sidebar-table th,
.sidebar-table td {
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 8px;
  text-align: center;
}

.sidebar-table th {
  background-color: rgba(0, 0, 0, 0.4);
  font-weight: 600;
}

.sidebar-table td {
  background-color: rgba(255, 255, 255, 0.1);
}

/* #formula{
  display:none;
} */
/* ---- FORMULA STYLING (TEXTBOOK STYLE) ---- */

.formula-box {
  display: none;
  margin: 2vmin 0;
  text-align: center;
  font-size: 2vmin;
}

.formula-title {
  font-size: 2.2vmin;
  font-weight: bold;
  margin-bottom: 1vmin;
}

/* Fraction container */
.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 1vmin 0;
}

/* Numerator (TOP) */
.numerator {
  font-size: 2.2vmin;
  padding-bottom: 0.5vmin;
}

/* The horizontal fraction line */
.fraction-line {
  width: 100%;
  height: 0.2vmin;
  background: white;
}

/* Denominator (BOTTOM) */
.denominator {
  font-size: 2.2vmin;
  padding-top: 0.5vmin;
}

/* Where section */
.formula-where {
  margin-top: 2vmin;
  font-size: 1.8vmin;
  text-align: left;
}
/*  GLOBAL BODY-LEVEL TOOLTIP (for elements inside overflow:hidden)  */
#global-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  padding: 0.6em 1.4em;
  background: linear-gradient(135deg, rgba(8,28,16,0.97) 0%, rgba(18,55,30,0.97) 100%);
  color: #a8ffb0;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: clamp(12px, 1.6vmin, 17px);
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 20px;
  border: 1.5px solid rgba(46,204,113,0.65);
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), 0 0 0 2px rgba(46,204,113,0.15);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#global-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.answer-option {
  padding: 2px 6px;
  transition: all 0.3s ease;
}

.highlight {
  background-color: yellow;
  border-radius: 4px;
}