/* ==========================================================================
   COSMIC DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --bg-color: #05020a;
  --bg-card: rgba(18, 11, 35, 0.45);
  --border-color: rgba(255, 255, 255, 0.07);
  
  /* Cosmic Colors */
  --cyan-glow: #00e5ff;
  --accent-primary: #d500f9;
  --accent-secondary: #ff4081;
  --text-main: #f3effa;
  --text-muted: #a69bb8;
  
  /* Fonts */
  --font-body: 'Outfit', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-script: 'Playfair Display', serif;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-color);
  font-family: var(--font-body);
  color: var(--text-main);
  scroll-behavior: smooth;
}

/* Background & Particle Canvases */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #110926 0%, #05020a 100%);
}

#celebration-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
}

/* Page Wrapper */
.page-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* Glassmorphism Panel Foundation */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5), 
              inset 0 1px 1px rgba(255, 255, 255, 0.1);
  padding: 2rem;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px 0 rgba(0, 0, 0, 0.6), 
              0 0 20px rgba(213, 0, 249, 0.08);
}

/* ==========================================================================
   FLOATING TOP BAR
   ========================================================================== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cyan-glow);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.blinking {
  animation: blink 1.5s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Audio Control Button */
.sound-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  outline: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sound-toggle:hover {
  border-color: var(--cyan-glow);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}

.sound-toggle.active {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 12px rgba(255, 64, 129, 0.15);
}

/* ==========================================================================
   HERO / GREETING SECTION
   ========================================================================== */
.hero-section {
  text-align: center;
  margin-top: 0.5rem;
}

.cosmic-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(213, 0, 249, 0.08);
  border: 1px solid rgba(213, 0, 249, 0.2);
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff9cfc;
  text-shadow: 0 0 10px rgba(213, 0, 249, 0.3);
  margin-bottom: 1.25rem;
}

.main-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.script-text {
  font-family: var(--font-script);
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 600;
  color: var(--text-muted);
}

.recipient-name {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-top: 5px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--cyan-glow) 50%, var(--accent-primary) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerFlow 6s linear infinite;
  text-shadow: 0 0 30px rgba(213, 0, 249, 0.2);
}

@keyframes shimmerFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.intro-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 520px;
  margin: 1.25rem auto 0;
  font-weight: 300;
}

/* ==========================================================================
   COUNTDOWN TIMER DISPLAY
   ========================================================================== */
.countdown-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  animation: floatMovement 6s ease-in-out infinite;
}

@keyframes floatMovement {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.countdown-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.countdown-unit {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.num-wrapper {
  background: rgba(10, 5, 23, 0.5);
  border-radius: 16px;
  padding: 0.75rem 0.25rem;
  width: 100%;
  max-width: 90px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.num-digit {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.unit-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.separator {
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: -1.75rem;
  animation: pulseOpacity 1s infinite alternate;
}

@keyframes pulseOpacity {
  0% { opacity: 0.25; }
  100% { opacity: 0.85; }
}

.countdown-footer {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--cyan-glow);
  text-transform: uppercase;
}

/* ==========================================================================
   THE POWER REACTOR WIDGET
   ========================================================================== */
.reactor-card {
  text-align: center;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 440px;
  margin: 0 auto 1.5rem;
}

.reactor-display {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 2rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  stroke: rgba(255, 255, 255, 0.04);
}

.progress-ring-bar {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.05s linear;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

.reactor-btn {
  width: 154px;
  height: 154px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 35%, #2a1652 0%, #0d061c 100%);
  padding: 4px;
  cursor: pointer;
  position: relative;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5),
              inset 0 2px 4px rgba(255, 255, 255, 0.15),
              inset 0 -4px 8px rgba(0, 0, 0, 0.4);
  outline: none;
  touch-action: manipulation;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reactor-btn-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(10, 5, 23, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.3s;
}

.reactor-btn:hover {
  transform: scale(1.04);
}

.reactor-btn:active, .reactor-btn.charging {
  transform: scale(0.96);
  box-shadow: 0 0 35px rgba(213, 0, 249, 0.35);
}

.reactor-btn:active .reactor-btn-inner, .reactor-btn.charging .reactor-btn-inner {
  background: rgba(20, 11, 46, 0.95);
  border-color: var(--accent-primary);
}

.btn-icon {
  font-size: 2.2rem;
  color: var(--cyan-glow);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  transition: transform 0.15s, color 0.15s;
}

.reactor-btn.charging .btn-icon {
  color: var(--accent-secondary);
  animation: shake 0.2s infinite linear alternate;
}

@keyframes shake {
  0% { transform: translateY(0px) scale(1.1); }
  100% { transform: translateY(-4px) scale(1.1); }
}

.charge-percent {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  transition: color 0.2s;
}

.reactor-btn.charging .charge-percent {
  color: var(--cyan-glow);
}

.reactor-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 0.5rem;
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-val {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}


/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 300;
}

/* ==========================================================================
   NOTIFICATION SYSTEM (TOAST)
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translate(-50%, 40px);
  background: rgba(20, 10, 40, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--accent-secondary);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(255, 64, 129, 0.2);
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              opacity 0.3s;
  z-index: 10000;
  text-align: center;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVENESS)
   ========================================================================== */
@media (max-width: 480px) {
  .page-wrapper {
    padding: 1rem 1rem 2.5rem;
    gap: 1.75rem;
  }
  
  .recipient-name {
    font-size: 2.8rem;
  }
  
  .num-wrapper {
    padding: 0.6rem 0.15rem;
    max-width: 68px;
  }
  
  .num-digit {
    font-size: 2.4rem;
  }
  
  .separator {
    font-size: 1.8rem;
    margin-top: -1.4rem;
  }
  
  .unit-label {
    font-size: 0.55rem;
    letter-spacing: 1.5px;
  }
  
  .reactor-display {
    width: 180px;
    height: 180px;
    margin: 1.5rem auto;
  }
  
  .progress-ring {
    width: 180px;
    height: 180px;
  }
  
  .reactor-btn {
    width: 124px;
    height: 124px;
  }
  
  .btn-icon {
    font-size: 1.8rem;
  }
  
  .charge-percent {
    font-size: 0.8rem;
  }
}
