/* Soft, rounded, magical font */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@500;700;900&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
}

body { 
  margin: 0; 
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(-45deg, #ffc3a0, #ffafbd, #e0c3fc, #8ec5fc);
  background-size: 400% 400%;
  animation: skyGradient 15s ease infinite;
  color: #555; 
  min-height: 100vh; 
  overflow-x: hidden;
  position: relative;
  /* ✨ MAGIC WAND CURSOR ✨ */
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'><text y='20' font-size='20'>🪄</text></svg>"), auto;
}

button {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'><text y='20' font-size='20'>🪄</text></svg>"), pointer;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

button:focus, button:active {
  outline: none !important;
}

@keyframes skyGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.bg-star {
  position: absolute;
  color: rgba(255, 255, 255, 0.6);
  animation: twinkle var(--duration) ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

.main { 
  max-width: 900px; 
  margin: 0 auto; 
  padding: 3rem 1.5rem 2rem; 
  position: relative;
  z-index: 10;
}

.header { 
  text-align: center; 
  margin-bottom: 3rem;
}

.app-title { 
  font-size: clamp(2.5rem, 6vw, 4rem); 
  font-weight: 900; 
  color: #ffffff;
  margin: 0; 
  text-shadow: 0 4px 15px rgba(255, 175, 189, 0.6);
}

.app-subtitle { 
  font-size: 1.4rem; 
  color: #ffffff; 
  font-weight: 700;
  margin-top: 0.5rem; 
  opacity: 0.9;
  letter-spacing: 1px;
}

.sound-grid { 
  display: flex; 
  flex-wrap: wrap; 
  justify-content: center; 
  gap: 3rem 2.5rem; 
  padding-top: 30px;
}

/* ☁️ Cloud Shaped Buttons ☁️ */
.sound-btn { 
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f4faff 100%);
  padding: 1rem 2rem; 
  border-radius: 50px; 
  border: none;
  box-shadow: 0 10px 25px rgba(142, 197, 252, 0.3), inset 0 -4px 10px rgba(200, 220, 255, 0.3);
  color: #7b8ab8; 
  font-size: 1.25rem; 
  font-weight: 800; 
  font-family: inherit;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: floatCloud 4s ease-in-out infinite;
  z-index: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none !important;
}

.sound-btn::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 15%;
  width: 50px;
  height: 50px;
  background: #ffffff;
  border-radius: 50%;
  z-index: -1;
  transition: background 0.3s;
}

.sound-btn::after {
  content: '';
  position: absolute;
  top: -30px;
  right: 15%;
  width: 70px;
  height: 70px;
  background: #ffffff;
  border-radius: 50%;
  z-index: -1;
  transition: background 0.3s;
}

@keyframes floatCloud {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

.sound-btn:hover { 
  transform: translateY(-5px) scale(1.05) !important;
  box-shadow: 0 15px 35px rgba(142, 197, 252, 0.5);
  color: #5c6b99;
}

.sound-btn:active {
  transform: scale(0.95) !important;
}

.sound-btn.playing { 
  background: linear-gradient(180deg, #ffffff 0%, #fff0f5 100%);
  color: #ff8fab;
  box-shadow: 0 0 calc(20px + 30px * var(--audio-intensity, 0)) rgba(255, 175, 189, calc(0.5 + 0.4 * var(--audio-intensity, 0)));
}

.sound-btn.playing::before,
.sound-btn.playing::after {
  background: #fffdfd;
}

.click-sparkle {
  position: absolute;
  pointer-events: none;
  font-size: 1.5rem;
  animation: sparkleFly 0.8s ease-out forwards;
  z-index: 100;
}

@keyframes sparkleFly {
  0% { opacity: 1; transform: translate(0, 0) scale(0.5) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1.5) rotate(180deg); }
}

.status {
  margin-top: 2rem;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.error { color: #ff6b6b; }
.success { color: #8ec5fc; }

/* Surprise Me Button */
.surprise-container {
  position: fixed;
  /* Lifted higher from the bottom of the screen */
  bottom: 70px; 
  left: 0; 
  width: 100%;
  display: flex; 
  justify-content: center;
  /* Set z-index high so it floats OVER the footer text */
  z-index: 100; 
  pointer-events: none; 
}

.surprise-btn {
  pointer-events: auto;
  background: linear-gradient(135deg, #ffe066, #ff7e67);
  color: white; border: 3px solid white;
  padding: 1rem 2rem; border-radius: 50px;
  font-size: 1.3rem; font-weight: 900; font-family: inherit;
  box-shadow: 0 10px 20px rgba(255, 126, 103, 0.4);
  animation: starPulse 2s infinite alternate;
  display: flex; align-items: center; gap: 10px;
  transition: 0.2s;
  outline: none !important;
}

@keyframes starPulse {
  0% { transform: scale(1); box-shadow: 0 10px 20px rgba(255, 126, 103, 0.4); }
  100% { transform: scale(1.05); box-shadow: 0 15px 30px rgba(255, 126, 103, 0.6); }
}

.surprise-btn:hover { transform: translateY(-5px) scale(1.1) !important; background: linear-gradient(135deg, #ffd13b, #ff6347); }
.surprise-btn:active { transform: scale(0.95) !important; }

/* Admin Form */
.cloud-panel { 
  background: rgba(255, 255, 255, 0.85); 
  backdrop-filter: blur(10px);
  padding: 2.5rem; border-radius: 30px; 
  box-shadow: 0 15px 35px rgba(0,0,0,0.05);
  border: 2px solid white; max-width: 500px; margin: 0 auto; 
}
.form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; font-weight: 700; color: #7b8ab8; }
.input { 
  background: rgba(255, 255, 255, 0.9); border: 2px solid #e0c3fc; 
  padding: 1rem; border-radius: 15px; color: #555; font-family: inherit; font-size: 1rem; font-weight: bold;
}
.input:focus { outline: none; border-color: #ffafbd; }
.primary-btn { 
  background: linear-gradient(90deg, #ffafbd, #ffc3a0); color: white; 
  padding: 1rem; border-radius: 50px; border: none; font-weight: 800; font-size: 1.2rem; cursor: pointer; transition: 0.2s;
  box-shadow: 0 5px 15px rgba(255, 175, 189, 0.4);
}
.primary-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(255, 175, 189, 0.6); }

/* 💌 Sweet Little Footer 💌 */
.site-footer {
  text-align: center;
  /* Massive bottom padding so you can scroll past the button to read it */
  padding: 2rem 1rem 160px 1rem; 
  color: rgba(255, 255, 255, 0.7); 
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: relative;
  
  /* THE FIX: Lower than the <main> block's z-index (10) */
  z-index: 1; 
  
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); 
}

.site-footer p {
  margin: 0;
  cursor: default;
}