/* Custom CSS for Nutrilab Stars */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --sky-dark: #0a0b1e;
  --sky-indigo: #131438;
  --sky-purple: #1e1342;
  --glow-yellow: #fde047;
  --glow-yellow-shadow: rgba(250, 204, 21, 0.75);
  --glow-red: #f87171;
  --glow-red-shadow: rgba(239, 68, 68, 0.85);
}

* {
  font-family: 'Nunito', sans-serif;
  box-sizing: border-box;
}

h1, h2, h3, h4, .font-bubbly {
  font-family: 'Fredoka', cursive, sans-serif;
}

body {
  background: radial-gradient(ellipse at 50% 20%, #171b4a 0%, #0c0d28 50%, #060714 100%);
  color: #f1f5f9;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Canvas */
#sky-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Glow Effects - Crisp, High-Contrast & Razor Sharp */
.glow-yellow-text {
  color: #fde047;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(250, 204, 21, 0.45);
}

.glow-red-text {
  color: #f87171;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(239, 68, 68, 0.5);
}

.glow-zero-text {
  color: #cbd5e1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Badge container glow (Glow is on outer box-shadow so the inner number is ultra-crisp & readable!) */
.badge-glow-yellow {
  background: #0a0d24 !important;
  border-color: #facc15 !important;
  color: #fef08a !important;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55), 0 3px 8px rgba(0, 0, 0, 0.8), inset 0 0 4px rgba(250, 204, 21, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.badge-glow-red {
  background: #15060a !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.65), 0 3px 8px rgba(0, 0, 0, 0.8), inset 0 0 4px rgba(239, 68, 68, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.badge-glow-zero {
  background: #0f172a !important;
  border-color: #64748b !important;
  color: #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Star SVG Glow - Clean and bright without overwhelming blur */
.glow-yellow-star {
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.75)) drop-shadow(0 0 14px rgba(234, 179, 8, 0.45));
  animation: pulse-glow-yellow 3.5s ease-in-out infinite alternate;
}

.glow-red-star {
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.85)) drop-shadow(0 0 14px rgba(220, 38, 38, 0.5));
  animation: pulse-glow-red 3s ease-in-out infinite alternate;
}

.star-dark-body {
  fill: #181926 !important;
  stroke: #ef4444 !important;
  stroke-width: 1.5;
}

.star-zero-body {
  fill: #334155 !important;
  stroke: #94a3b8 !important;
  stroke-width: 1.5;
}

/* Keyframe animations - Balanced gentle pulsing */
@keyframes pulse-glow-yellow {
  0% {
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.65)) drop-shadow(0 0 10px rgba(234, 179, 8, 0.4));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.85)) drop-shadow(0 0 16px rgba(234, 179, 8, 0.6));
    transform: scale(1.02);
  }
}

@keyframes pulse-glow-red {
  0% {
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.75)) drop-shadow(0 0 10px rgba(220, 38, 38, 0.4));
    transform: scale(1);
  }
  100% {
    filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.9)) drop-shadow(0 0 16px rgba(239, 68, 68, 0.65));
    transform: scale(1.02);
  }
}

@keyframes float-gentle {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
}

@keyframes float-reverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(7px) rotate(-1.5deg);
  }
}

.animate-float {
  animation: float-gentle 4s ease-in-out infinite;
}

.animate-float-reverse {
  animation: float-reverse 4.5s ease-in-out infinite;
}

/* Form elements styling */
select option {
  background-color: #0f172a;
  color: #f8fafc;
}

input:focus, select:focus {
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.25);
}

/* Glassmorphism Cards */
.glass-card {
  background: rgba(22, 26, 61, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.glass-card-top {
  background: linear-gradient(135deg, rgba(46, 35, 10, 0.6), rgba(24, 28, 70, 0.75));
  border: 1px solid rgba(250, 204, 21, 0.35);
  box-shadow: 0 12px 35px rgba(234, 179, 8, 0.2);
}

.glass-card-bottom {
  background: linear-gradient(135deg, rgba(50, 16, 25, 0.65), rgba(24, 28, 70, 0.75));
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 12px 35px rgba(239, 68, 68, 0.18);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 204, 21, 0.5);
}

/* Confetti container */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
}

/* Modal backdrop animation */
.modal-enter {
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh;
  overflow-y: auto;
}

@keyframes modal-pop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ========================================== */
/* MOBILE & TOUCH DEVICE OPTIMIZATIONS        */
/* ========================================== */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent accidental scrolling while dragging or tapping in mini-game */
#game-canvas {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Smooth touch momentum scrolling on iOS */
.overflow-y-auto, .overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  /* Prevent auto-zooming on focus in iOS Mobile Safari */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  select {
    font-size: 16px !important;
  }

  /* Slightly more compact padding on very small screens */
  .glass-card {
    border-radius: 1.25rem;
  }

  /* Minimum touch target accessibility */
  button, input, select {
    min-height: 38px;
  }
}
