:root {
  --coffee-dark: #1a0f0a;
  --coffee-light: #4a2e1d;
  --stream-color: #24140e;
  --ice-color: rgba(255, 255, 255, 0.4);
}

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

body {
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  background: #000;
  color: #fff;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
  /* Dark backdrop before coffee */
  background: #0d0d0d;
}

.header {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  text-align: center;
  pointer-events: none;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0.8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.5rem;
  background: linear-gradient(to bottom, #fff, #aaa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header p {
  font-size: 1rem;
  letter-spacing: 0.2em;
  opacity: 0.6;
}

/* Liquid Realism - Enhanced */
.liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, var(--coffee-dark) 0%, var(--coffee-light) 100%);
  z-index: 10;
  transition: height 3s ease-in-out;
  overflow: visible;
  /* Allow surface/splash to protrude */
  box-shadow: inset 0 20px 50px rgba(0, 0, 0, 0.5);
  /* Inner depth */
}

/* Animated Surface Wave - More pronounced */
.liquid-surface {
  position: absolute;
  top: -25px;
  /* Taller wave */
  left: 0;
  width: 200%;
  /* Wider for movement */
  height: 50px;
  /* More distinct wave SVG */
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 1000 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M0 50 Q 250 10 500 50 Q 750 90 1000 50 L 1000 100 L 0 100 Z" fill="rgba(255,255,255,0.15)"/%3E');
  background-size: 50% 100%;
  animation: wave 2s linear infinite;
  /* Faster wave */
  opacity: 1;
  z-index: 20;
}

.liquid-surface::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  height: 100%;
  /* Second offset wave */
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 1000 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M0 50 Q 250 90 500 50 Q 750 10 1000 50 L 1000 100 L 0 100 Z" fill="rgba(255,255,255,0.08)"/%3E');
  background-size: 50% 100%;
  animation: wave 3s linear infinite reverse;
}

/* Splash where stream hits (centered) */
.splash {
  position: absolute;
  top: -10px;
  /* At surface */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  z-index: 25;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Only splash when pouring/filling (controlled by JS adding 'splashing' class?) 
   Or just CSS animation loop if simpler. 
   Let's use a pseudo element on liquid-surface for splash, or separate div.
*/

@keyframes wave {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }

  /* Move half width */
}

@keyframes splash-pulse {
  0% {
    width: 40px;
    height: 10px;
    opacity: 0.8;
    top: -5px;
  }

  100% {
    width: 80px;
    height: 20px;
    opacity: 0;
    top: -10px;
  }
}

.liquid.splashing .liquid-surface::before {
  content: '';
  position: absolute;
  top: 20px;
  /* Align with bottom of wave approx */
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 15px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  border-radius: 50%;
  animation: splash-pulse 0.5s ease-out infinite;
  z-index: 30;
}


/* Bubbles - Subtle carbonation/foam effect */
.bubbles {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}

.bubble {
  position: absolute;
  bottom: -20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: rise 4s infinite ease-in;
}

/* Random bubbles */
.bubble:nth-child(1) {
  width: 10px;
  height: 10px;
  left: 10%;
  animation-duration: 3s;
  animation-delay: 0s;
}

.bubble:nth-child(2) {
  width: 20px;
  height: 20px;
  left: 20%;
  animation-duration: 5s;
  animation-delay: 1s;
}

.bubble:nth-child(3) {
  width: 15px;
  height: 15px;
  left: 35%;
  animation-duration: 4s;
  animation-delay: 2s;
}

.bubble:nth-child(4) {
  width: 25px;
  height: 25px;
  left: 50%;
  animation-duration: 6s;
  animation-delay: 0.5s;
}

.bubble:nth-child(5) {
  width: 12px;
  height: 12px;
  left: 65%;
  animation-duration: 3.5s;
  animation-delay: 1.5s;
}

.bubble:nth-child(6) {
  width: 18px;
  height: 18px;
  left: 80%;
  animation-duration: 4.5s;
  animation-delay: 2.5s;
}

.bubble:nth-child(7) {
  width: 8px;
  height: 8px;
  left: 90%;
  animation-duration: 2.5s;
  animation-delay: 3s;
}

@keyframes rise {
  0% {
    bottom: -20px;
    transform: translateX(0);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    bottom: 100%;
    transform: translateX(20px);
    opacity: 0;
  }
}


/* Sponsor Text - Huge */
.liquid .inner-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Centered in liquid (which is centered on screen)? No */
  /* If liquid height changes, text positon relative to liquid bottom will move? */
  /* We want text to stay centered on screen, but only be visible where liquid exists. */
  /* Wait, if liquid is container with overflow:hidden... */
  /* Text must be inside liquid. */
  /* If liquid grows from bottom, text inside liquid (if positioned absolute top/left) will move with liquid if not careful? */
  /* No, absolute inside relative/absolute moves with parent. */
  /* But we want text fixed to screen center. */
  /* So text inside liquid needs: bottom: calculate? NO. */
  /* Trick: Text is fixed size/position relative to SCREEN, but inside liquid div. */
  /* So inside liquid div: position: fixed? or absolute relative to screen? */
  /* If we use fixed inside liquid, overflow:hidden might not clip it in all browsers. */
  /* Better: Text is absolute, bottom: 0, height: 100vh, width: 100vw. */
  /* This way, as liquid grows, it reveals more of the text which is "fixed" relative to bottom. */

  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.inner-text h2 {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 4rem;
  /* Huge */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
  /* Ensure it's static */
}

/* Stream */
.pour-stream {
  position: absolute;
  top: -100px;
  right: 15%;
  /* Pour from side perhaps? Or center? Let's keep center for impact. */
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  /* Thicker stream */
  height: 0;
  background: var(--stream-color);
  opacity: 0.95;
  z-index: 20;
  transition: height 0.3s ease;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.pour-stream.pouring {
  height: 120vh;
  /* All the way down */
}

/* Controls */
.controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 15px 40px;
  font-size: 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
}

button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

button:disabled {
  opacity: 0.3;
  transform: none;
}