*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; font-family: system-ui, -apple-system, sans-serif;
  /* Updated Background to Cool Teals/Blues */
  background: radial-gradient(circle at top, #e0f7fa 0%, #b2ebf2 60%, #80deea 100%);
  color: #FF0000; overflow: hidden;
}

.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.detectionMessage {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 0; font-family: "Helvetica", sans-serif; font-size: 15vw;
  font-weight: bold; color: rgba(0, 96, 100, 0.03); pointer-events: none; white-space: nowrap;
}

.orb {
  position: absolute; border-radius: 9999px; filter: blur(90px); opacity: 0.6;
  transition: transform 0.1s linear; animation: orbPulse 10s ease-in-out infinite alternate;
}
/* Updated Orb Colors to Teal/Cyan */
.orb-teal { width: 30rem; height: 30rem; background: #4dd0e1; top: 10%; left: 10%; }
.orb-cyan { width: 30rem; height: 30rem; background: #00bcd4; bottom: 10%; right: 10%; animation-delay: 2s; }
.orb-blue { width: 20rem; height: 20rem; background: #0097a7; top: 40%; right: 25%; animation-delay: 4s; }

@keyframes orbPulse {
  0% { transform: scale(1); } 100% { transform: scale(1.1) translate(20px, -20px); }
}

.app {
  position: relative; z-index: 5; min-height: 100vh; padding: 2rem 1rem;
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
}
.header { text-align: center; margin-bottom: 2rem; position: relative; z-index: 10; pointer-events: auto; }
.title { font-size: 3rem; font-weight: 300; letter-spacing: 0.2em; text-transform: uppercase; margin: 0; color: #006064; }
.subtitle { margin: 0.5rem 0 0; color: #00838f; font-size: 0.9rem; }
.main { display: flex; flex-direction: column; align-items: center; gap: 2rem; pointer-events: auto; }

.lotus-wrapper {
  position: relative; width: 26rem; height: 26rem; max-width: 90vw;
  display: flex; justify-content: center; align-items: center; z-index: 5;
}
.droplet-layer {
  position: absolute; border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  transition: border-radius 1s ease; overflow: hidden;
}
.glass-back {
  width: 110%; height: 110%; background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px); z-index: 1; opacity: 0.6; box-shadow: 0 0 40px rgba(0, 188, 212, 0.2);
}
.video-core {
  width: 100%; height: 100%; z-index: 2; background: #003333; /* Dark Teal Base */
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}
.glass-front {
  width: 100%; height: 100%; z-index: 3;
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%);
  mix-blend-mode: overlay; pointer-events: none;
  box-shadow: inset 10px 10px 20px rgba(255, 255, 255, 0.8), inset -10px -10px 20px rgba(0, 0, 0, 0.1);
}
.fluid-anim-slow { animation: morph 12s ease-in-out infinite; }
.fluid-anim-main { animation: morph 8s ease-in-out infinite reverse; }
.fluid-anim-fast { animation: morph 6s ease-in-out infinite; }
@keyframes morph {
  0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(0deg); }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; transform: rotate(2deg); }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(0deg); }
}
.webcam-canvas { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.webcam-hidden { display: none; }
.shine-inner {
  position: absolute; top: 10%; right: 10%; width: 20%; height: 20%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
  filter: blur(5px); pointer-events: none;
}
.lotus-container {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 50; pointer-events: none;
}
.lotus-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; z-index: 60; text-align: center;
}
.instruction { font-size: 1.8rem; font-weight: 300; margin: 0; color: #006064; text-shadow: 0 0 20px rgba(255,255,255,0.8); }
.cycle-text { font-size: 1rem; color: #00838f; margin: 0.2rem 0; }
.face-status { margin-top: 1rem; font-size: 0.8rem; color: #0097a7; }

/* CONTROLS */
.controls { 
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 1rem; 
  background: rgba(255, 255, 255, 0.35); backdrop-filter: blur(20px); padding: 1rem 1.5rem;
  border-radius: 2rem; border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 40px rgba(0, 96, 100, 0.1); width: auto; max-width: 90vw; pointer-events: auto;
}
.button-row { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.btn {
  font: inherit; font-weight: 500; border-radius: 9999px; border: 1px solid rgba(0, 96, 100, 0.1);
  background: rgba(255, 255, 255, 0.7); color: #006064; padding: 0.8rem 1.6rem;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #fff; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.btn.primary { background: #006064; color: #fff; border: 1px solid #006064; }
.btn.primary:hover { background: #00838f; border-color: #00838f; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.mode-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.mode-btn { 
  padding: 0.5rem 1rem; font-size: 0.85rem; background: rgba(255,255,255,0.4); 
  border: 1px solid rgba(255,255,255,0.6); color: #00838f; cursor: pointer; border-radius: 9999px;
}
.mode-btn.active { background: #006064; border-color: #006064; color: #fff; }
.hidden { display: none; }
