/* Charity: water Brand Colors

Primary Colors:
- Yellow:     #FFC907
- Blue:       #2E9DF7

Secondary Colors:
- Light Blue: #8BD1CB
- Green:      #4FCB53
- Orange:     #FF902A
- Red:        #F5402C
- Dark Green: #159A48
- Pink:       #F16061

*/

body {
  background: #FFC907;
  margin: 0;
  font-family: 'Lato', Arial, sans-serif;
  min-height: 100vh;
}

#cw-logo {
  display: block;
  margin: 24px auto 12px auto;
  width: 100px;
}

#game-title {
  text-align: center;
  color: #2E9DF7;
  font-size: 2.2rem;
  margin-bottom: 18px;
}

#score-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

#score-display, #timer-display {
  background: #2E9DF7;
  color: #fff;
  font-size: 1.2rem;
  padding: 8px 18px;
  border-radius: 20px;
  min-width: 90px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(46,157,247,0.08);
}

#start-btn, #play-again-btn {
  font-size: 1.2rem;
  padding: 14px 36px;
  border-radius: 30px;
  border: none;
  background: #2E9DF7;
  color: #fff;
  cursor: pointer;
  margin: 12px auto;
  width: 90vw;
  max-width: 350px;
  display: block;
  transition: background 0.2s;
}
#start-btn:hover, #play-again-btn:hover {
  background: #159A48;
}

#game-area {
  width: 100vw;
  max-width: 100%;
  min-width: 220px;
  height: 320px;
  margin: 0 auto 16px auto;
  background: #8BD1CB;
  border: 2px solid #2E9DF7;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(46,157,247,0.10);
}

#game-over {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  color: #fff;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 10;
}
#game-over > div {
  background: #2E9DF7;
  padding: 30px 20px;
  border-radius: 12px;
  text-align: center;
  width: 90vw;
  max-width: 340px;
}
#game-over a {
  color: #FFC907;
  text-decoration: underline;
  font-size: 1rem;
}

/* Water drop styles */
.water-drop {
  position: absolute;
  width: 30px;
  height: 40px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: fall linear forwards;
}

.clean-drop {
  background: #2E9DF7;
  box-shadow: 0 0 10px rgba(46, 157, 247, 0.5);
}

.polluted-drop {
  background: #888;
  box-shadow: 0 0 10px rgba(100, 100, 100, 0.5);
}

@keyframes fall {
  0% {
    transform: translateY(-40px);
  }
  100% {
    transform: translateY(calc(100% + 40px));
  }
}

/* Oops message for polluted drops */
.oops-message {
  position: absolute;
  color: #F5402C;
  font-size: 1.4rem;
  font-weight: bold;
  animation: fadeOut 1s forwards;
  pointer-events: none; /* Prevent message from blocking clicks */
  z-index: 5;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Milestone banner */
#milestone-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #159A48;
  color: white;
  text-align: center;
  padding: 12px 0;
  font-size: 1.4rem;
  font-weight: bold;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.3s ease-out;
}

#milestone-banner.show {
  transform: translateY(0);
}

/* Confetti container */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: #FFC907;
  animation: confetti-fall 4s linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.cw-text {
  text-align: center;
  font-size: 1rem;
  color: #222;
  margin-bottom: 8px;
  letter-spacing: 2px;
  font-family: 'Lato', 'Georgia', 'Times New Roman', serif;
  font-variant: small-caps;
  font-weight: 600;
  text-transform: uppercase;
}

/* Rules panel and button */
.rules-btn {
  background: #fff;
  color: #2E9DF7;
  border: 2px solid #2E9DF7;
  padding: 8px 18px;
  border-radius: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 360ms cubic-bezier(.2,.9,.2,1), color 240ms ease, transform 180ms ease;
}
.rules-btn:hover, .rules-btn:focus {
  background: rgba(46,157,247,0.08);
  color: #159A48;
  transform: translateY(-2px);
}

.rules-panel {
  max-width: 900px;
  margin: 8px auto 18px auto;
  background: rgba(255,255,255,0.98);
  border: 2px solid #2E9DF7;
  color: #222;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(46,157,247,0.08);
  transition: max-height 320ms ease, opacity 220ms ease, transform 260ms ease;
  max-height: 0;
  opacity: 0;
}
.rules-panel.open {
  max-height: 420px; /* will be set dynamically by JS for smoother animation */
  opacity: 1;
}
.rules-content {
  padding: 14px 18px;
}
.rules-content h3 {
  color: #2E9DF7;
  margin: 0 0 8px 0;
}
.rules-content ul {
  margin: 0;
  padding-left: 18px;
}
.rules-content li {
  margin: 6px 0;
  line-height: 1.45;
}

#difficulty-select {
  font-size: 1.1rem;
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid #2E9DF7;
  margin-left: 8px;
  background: #fff;
  color: #2E9DF7;
  outline: none;
  transition: border 0.2s;
}
#difficulty-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#cw-footer {
  width: 100vw;
  background: #2E9DF7;
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
  padding: 14px 0 10px 0;
  margin-top: 24px;
  letter-spacing: 1px;
}
#cw-footer a {
  color: #FFC907;
  text-decoration: underline;
  margin: 0 8px;
  font-weight: bold;
  transition: color 0.2s;
}
#cw-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

@media (min-width: 600px) {
  #cw-logo {
    width: 120px;
  }
  #game-title {
    font-size: 2.8rem;
  }
  #game-area {
    height: 400px;
    max-width: 400px;
    width: 95vw;
  }
  #score-timer-container {
    flex-direction: row;
    gap: 32px;
    justify-content: center;
    align-items: flex-end;
  }
  #start-btn, #play-again-btn {
    width: auto;
    max-width: none;
    display: inline-block;
    margin: 8px;
  }
}
