:root {
  --primary-color: #6f42c1;
  --secondary-color: #fd7e14;
  --success-color: #20c997;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;

  /* Playful color palette */
  --purple-soft: #e8d5ff;
  --orange-soft: #ffe5cc;
  --green-soft: #c7f7e6;
  --blue-soft: #c7f2ff;
  --pink-soft: #ffeef5;
  --yellow-soft: #fff8cc;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6f42c1 0%, #fd7e14 100%);
  --gradient-success: linear-gradient(135deg, #20c997 0%, #28a745 100%);
  --gradient-info: linear-gradient(135deg, #0dcaf0 0%, #007bff 100%);
}

/* Global Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  color: var(--dark-color);
}

/* Offset for header and footer height */
:root {
  --main-content-offset: 220px; /* Adjust if header/footer height changes */
}

.main-content {
  min-height: calc(100vh - var(--main-content-offset));
}

/* Custom Components */
.card-hover {
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-gradient {
  background: var(--gradient-primary);
  border: none;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, #5a359a 0%, #e06b00 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-success-gradient {
  background: var(--gradient-success);
  border: none;
  color: white;
  font-weight: 600;
}

.btn-success-gradient:hover {
  background: linear-gradient(135deg, #1ba37b 0%, #218838 100%);
  color: white;
}

/* Stats Cards */
.stat-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}

.stat-card-purple {
  background: linear-gradient(135deg, var(--purple-soft) 0%, #f8f9ff 100%);
  border-left: 4px solid var(--primary-color);
}

.stat-card-orange {
  background: linear-gradient(135deg, var(--orange-soft) 0%, #fff8f5 100%);
  border-left: 4px solid var(--secondary-color);
}

.stat-card-green {
  background: linear-gradient(135deg, var(--green-soft) 0%, #f8fff8 100%);
  border-left: 4px solid var(--success-color);
}
.stat-card-blue {
  background: linear-gradient(
    135deg,
    rgba(13, 110, 253, 0.18) 0%,
    rgba(13, 110, 253, 0.06) 100%
  );
  border-left: 4px solid var(--info-color);
}

.stat-card-info {
  background: linear-gradient(135deg, var(--blue-soft) 0%, #f8feff 100%);
  border-left: 4px solid var(--info-color);
}

/* Chore Items */
.chore-item {
  border: none;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.chore-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.chore-completed {
  background: var(--green-soft) !important;
  border-left: 4px solid var(--success-color);
}

.chore-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  background: var(--gradient-primary);
}

.chore-icon.completed {
  background: var(--gradient-success);
}

/* Progress Bars */
.progress-custom {
  height: 8px;
  border-radius: 10px;
  background-color: #e9ecef;
  overflow: hidden;
}

.progress-bar-custom {
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 0.6s ease;
}

.progress-bar-success {
  background: var(--gradient-success);
}

/* Points & Badges */
.points-badge {
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* Points badge styling */
.points-badge {
  background: var(--gradient-success);
  color: white !important;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.achievement-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.badge-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
}

.badge-silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #708090 100%);
}

.badge-gold {
  background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
}

.badge-blue {
  background: linear-gradient(135deg, #0dcaf0 0%, #007bff 100%);
}

.badge-purple {
  background: linear-gradient(135deg, #6f42c1 0%, #495057 100%);
}

.badge-orange {
  background: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%);
}

.badge-rainbow {
  background: linear-gradient(
    135deg,
    #ff0080 0%,
    #ff8c00 25%,
    #40e0d0 50%,
    #9370db 75%,
    #ff1493 100%
  );
}

/* Achievements Grid */
.achievement-card {
  border: none;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

.achievement-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.achievement-earned {
  outline: 3px solid rgba(32, 201, 151, 0.35);
}

.achievement-locked {
  filter: grayscale(0.2) saturate(0.8);
}

/* Reward Cards */
.reward-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.reward-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.reward-available {
  border: 2px solid var(--success-color);
}

.reward-unavailable {
  opacity: 0.6;
  border: 2px solid #dee2e6;
}

.reward-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  background: var(--gradient-primary);
  margin: 0 auto 15px;
}

/* Child Avatar */
.child-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  object-fit: contain; /* keep full image visible without distortion */
  object-position: center; /* center image inside circle */
  background-color: #fff; /* friendly backdrop for transparent PNGs */
  padding: 2px; /* inset image so edges are not clipped by the circle */
  box-sizing: border-box; /* keep overall size stable with padding */
}

/* Profile hero overlay (avatar + stars at top-right) */
.profile-hero {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
}
.hero-overlay-right {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
}

/* New: left gradient to improve text readability */
.hero-overlay-left {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 56% !important;
  pointer-events: none !important;
  z-index: 1 !important;
  background: linear-gradient(
    90deg,
    rgba(10, 10, 10, 0.6) 0%,
    rgba(10, 10, 10, 0.38) 40%,
    rgba(10, 10, 10, 0.15) 62%,
    rgba(10, 10, 10, 0) 80%
  ) !important;
}

/* Ensure greeting stays pinned to bottom-left with flex positioning */
.hero-greeting {
  position: relative !important;
  z-index: 2 !important;
  margin-top: auto !important; /* push to bottom when in a flex column */
  margin-bottom: 16px !important;
  margin-left: 16px !important;
}

@media (max-width: 768px) {
  .hero-overlay-left {
    width: 72%;
  }
}

/* Subtle text glow for contrast on image backgrounds */
.hero-text-contrast h1,
.hero-text-contrast p {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Falling star animations for profile hero */
.profile-hero {
  position: relative !important;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
}

.profile-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      2px 2px at 20px 30px,
      #ffffff,
      rgba(255, 255, 255, 0)
    ),
    radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(255, 255, 255, 0)),
    radial-gradient(3px 3px at 120px 40px, #ffffff, rgba(255, 255, 255, 0)),
    radial-gradient(2px 2px at 180px 90px, #ffffff, rgba(255, 255, 255, 0));
  background-repeat: repeat;
  background-size: 350px 350px;
  animation: twinkle 5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

.profile-hero .falling-star-left,
.profile-hero .falling-star-right {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  box-shadow: 0 0 4px 1px #ffffff, 0 0 10px 4px rgba(255, 223, 159, 0.7),
    0 0 15px 6px rgba(255, 210, 120, 0.5);
  background: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

.profile-hero .falling-star-left {
  animation: fallingStarLeft 12s ease-in forwards;
}

.profile-hero .falling-star-right {
  animation: fallingStarRight 15s ease-in forwards;
}

.profile-hero .falling-star-left:nth-child(odd) {
  animation-duration: 15s;
}

.profile-hero .falling-star-right:nth-child(even) {
  animation-duration: 20s;
}

/* Ensure stars stay within the hero container */
.profile-hero {
  position: relative;
  overflow: hidden;
}

@keyframes fallingStarLeft {
  0% {
    transform: translate(100%, -50px) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  70% {
    opacity: 0.6;
  }
  100% {
    transform: translate(-100px, 150%) rotate(-30deg) scale(0.2);
    opacity: 0;
  }
}

@keyframes fallingStarRight {
  0% {
    transform: translate(0%, -50px) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  70% {
    opacity: 0.6;
  }
  100% {
    transform: translate(120%, 150%) rotate(30deg) scale(0.2);
    opacity: 0;
  }
}
.hero-overlay-right {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
@media (max-width: 576px) {
  .hero-overlay-right {
    top: 8px;
    right: 8px;
  }
}

.child-avatar-small {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

  /* Achievement icon wrapper */
  .achievement-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(111, 66, 193, 0.08);
  }
}

/* Forms */
.form-floating-custom {
  position: relative;
}

.form-floating-custom .form-control {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem 0.75rem 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-floating-custom .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
}

.form-floating-custom label {
  color: #6c757d;
  font-weight: 500;
}

/* Login/Auth Pages */
.auth-container {
  background: var(--gradient-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: none;
  max-width: 1400px;
  width: 100%;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Confetti animation for celebrations */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1100;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  background: var(--primary-color);
  top: -20px;
  opacity: 0.9;
  border-radius: 2px;
  animation: confettiFall 2.4s ease-in forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    transform: translateY(120vh) rotate(720deg);
    opacity: 0;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .child-avatar {
    width: 60px;
    height: 60px;
  }

  .stat-card {
    margin-bottom: 1rem;
  }

  .reward-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  .achievement-badge {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* PWA Install Prompt */
.pwa-install {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--gradient-primary);
  color: white;
  padding: 15px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  z-index: 1000;
}

.pwa-install:hover {
  transform: scale(1.05);
}

/* Floating action button: My Chores */
.fab-chores {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.fab-chores i {
  font-size: 1.25rem;
}

.fab-chores .fab-label {
  font-weight: 700;
}

.fab-chores:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  filter: brightness(1.05);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-color: #2d3748;
    --dark-color: #e2e8f0;
  }

  body {
    background-color: #1a202c;
    color: var(--dark-color);
  }

  .card,
  .auth-card {
    background-color: #2d3748;
    color: var(--dark-color);
  }

  .navbar-light {
    background-color: #2d3748 !important;
  }

  .navbar-light .navbar-brand,
  .navbar-light .nav-link {
    color: var(--dark-color) !important;
  }
}

/* Children Management Styles */
.child-card {
  border: none;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.child-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-item {
  padding: 8px;
  border-radius: 8px;
  background: rgba(111, 66, 193, 0.1);
  margin-bottom: 5px;
}

.stat-item h6 {
  color: var(--primary-color);
  font-weight: 600;
}

/* Avatar Preview in Forms */
#avatar-preview {
  transition: all 0.3s ease;
}

/* Avatar selection grid */
.avatar-option {
  border-radius: 12px;
  border: 2px solid transparent;
  background: #fff;
  cursor: pointer;
}

.avatar-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.avatar-option.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(111, 66, 193, 0.15);
}

/* Progress bars for children stats */
.progress-custom {
  height: 8px;
  border-radius: 10px;
  background-color: #e9ecef;
}

.progress-bar-custom {
  background: var(--gradient-success);
  border-radius: 10px;
}

/* Chore Management Styles */
.chore-card {
  border: none;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.chore-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.chore-card .stat-item {
  padding: 8px;
  border-radius: 8px;
  background: rgba(111, 66, 193, 0.1);
  margin-bottom: 5px;
}

.chore-card .stat-item h6 {
  color: var(--primary-color);
  font-weight: 600;
}

/* Form preview styling */
#icon-preview {
  transition: all 0.3s ease;
}

/* Badge styling for chores */
.badge {
  font-size: 0.75rem;
}

/* Reward Management Styles */
.reward-card {
  border: none;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.reward-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.reward-card .stat-item {
  padding: 8px;
  border-radius: 8px;
  background: rgba(111, 66, 193, 0.1);
  margin-bottom: 5px;
}

.reward-card .stat-item h6 {
  color: var(--primary-color);
  font-weight: 600;
}

/* Points required badge */
.points-required-badge {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1rem;
}

/* Reports Page Styles */
.stat-card {
  border: none;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.stat-card-blue {
  border-left: 4px solid var(--info-color);
}

.stat-card-green {
  border-left: 4px solid var(--success-color);
}

.stat-card-orange {
  border-left: 4px solid var(--warning-color);
}

.stat-card-purple {
  border-left: 4px solid var(--primary-color);
}

.progress-custom {
  height: 8px;
  background-color: #e9ecef;
  border-radius: 10px;
}

.progress-bar-custom {
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 0.6s ease;
}

.insight-item {
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.stat-item h6 {
  font-weight: 600;
  color: var(--primary-color);
}

.achievement-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(111, 66, 193, 0.1);
  border-radius: 50%;
}

.child-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain; /* match main avatar behavior */
  object-position: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
}

/* Child picker dropdown (login) */
.child-picker {
  cursor: pointer;
}

.child-picker:disabled {
  background-color: #f8f9fa;
}

.child-picker-menu img.child-picker-avatar,
#child_picker_avatar.child-picker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
} /* Digital store */
.store-page .main-content {
  padding-bottom: 4rem;
}

.store-hero {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.store-points-card {
  background: linear-gradient(
    135deg,
    rgba(111, 66, 193, 0.12),
    rgba(253, 126, 20, 0.18)
  );
  border-radius: 20px;
  padding: 1.75rem;
  display: inline-block;
  text-align: left;
  box-shadow: 0 15px 35px rgba(111, 66, 193, 0.12);
}

.store-points-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.18rem;
  font-weight: 700;
  color: #6f42c1;
}

.store-points-balance {
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #2a166f;
}

.store-grid {
  margin-bottom: 4rem;
}

.store-pack-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(43, 28, 88, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.store-pack-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px rgba(43, 28, 88, 0.16);
}

.store-pack-card--unlocked {
  border: 2px solid rgba(32, 201, 151, 0.35);
}

.store-pack-gallery {
  background: linear-gradient(
    135deg,
    rgba(111, 66, 193, 0.08),
    rgba(253, 126, 20, 0.12)
  );
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
  padding: 1.5rem;
}

.store-pack-gallery img {
  width: 100%;
  border-radius: 16px;
  object-fit: cover;
  height: 90px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 12px rgba(43, 28, 88, 0.12);
}

.store-pack-gallery.placeholder {
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #6c757d;
}

.store-pack-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
}

.store-pack-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(111, 66, 193, 0.1);
  color: #6f42c1;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  letter-spacing: 0.08rem;
}

.store-pack-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.store-pack-footer {
  margin-top: auto;
}

.store-pack-downloads {
  margin-top: 1rem;
}

.store-pack-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.75rem;
}

.store-pack-download-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: rgba(111, 66, 193, 0.06);
  padding: 0.75rem;
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #3b2a6d;
  font-size: 0.75rem;
  text-align: center;
}

.store-pack-download-link img {
  width: 100%;
  max-height: 80px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.store-pack-download-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(111, 66, 193, 0.2);
}

@media (max-width: 768px) {
  .store-points-card {
    width: 100%;
  }
}

/* Reward store refresh */
body.store-page {
  background: #f4f7ff;
}

.store-hero {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.store-hero-content {
  background: #fff;
  border-radius: 24px;
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 18px 45px rgba(111, 66, 193, 0.08);
}

.store-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(253, 126, 20, 0.12);
  color: #fd7e14;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  font-size: 0.75rem;
}

.store-title {
  font-weight: 700;
  color: #2a166f;
  margin-bottom: 0.5rem;
}

.child-name {
  color: #6f42c1;
  font-weight: 900;
}

.store-balance {
  text-align: right;
}

.store-balance span {
  display: block;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.15rem;
  font-weight: 600;
  color: #6f42c1;
}

.store-balance-value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: #2a166f;
  background: rgba(111, 66, 193, 0.1);
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
}

.store-balance-value i {
  color: #ffc107;
  font-size: 1.4rem;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5e4f91;
}

.store-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.store-filter-chip {
  border: none;
  background: rgba(111, 66, 193, 0.08);
  color: #3b2a6d;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.store-filter-chip:hover {
  background: rgba(111, 66, 193, 0.15);
}

.store-filter-chip.active {
  background: #6f42c1;
  color: #fff;
  box-shadow: 0 10px 25px rgba(111, 66, 193, 0.25);
}

.store-card {
  background: #fff;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 18px 35px rgba(43, 28, 88, 0.08);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.store-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 45px rgba(43, 28, 88, 0.12);
}

.store-card--unlocked {
  border: 2px solid rgba(32, 201, 151, 0.35);
}

.store-card-cover {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  cursor: pointer;
}

.store-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.store-card:hover .store-card-cover img {
  transform: scale(1.05);
}

.store-card-cover--placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #f3f3f9;
  font-weight: 600;
}

.store-card-body {
  padding: 1.5rem 1.5rem 0.5rem;
  flex-grow: 1;
}

.store-card-labels {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.store-card-collection {
  background: rgba(253, 126, 20, 0.15);
  color: #fd7e14;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.store-card-category {
  background: rgba(111, 66, 193, 0.12);
  color: #6f42c1;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.store-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2a166f;
  margin-bottom: 0.5rem;
}

.store-card-description {
  color: #5e4f91;
  margin-bottom: 0.5rem;
}

.store-card-hint {
  font-size: 0.85rem;
}

.store-card-points {
  font-weight: 700;
  color: #3b2a6d;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.store-card-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.45rem;
  color: #4d3d86;
  font-size: 0.9rem;
}

.store-card-feature-list i,
.store-preview-features i {
  color: #20c997;
  margin-right: 0.35rem;
}

.store-card-actions {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.store-card-actions .btn {
  flex: 1 1 45%;
}

.store-card-actions .badge {
  font-size: 0.85rem;
}

.store-card-downloads {
  padding: 0 1.5rem 1.5rem;
}

.store-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 0.65rem;
}

.store-download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: #f5f2ff;
  border-radius: 14px;
  padding: 0.75rem;
  color: #3b2a6d;
  font-size: 0.75rem;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(111, 66, 193, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-download-card img {
  width: 100%;
  max-height: 70px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.45rem;
}

.store-download-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(111, 66, 193, 0.2);
}

/* Preview modal */
#storePreviewModal .store-preview-collection {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(253, 126, 20, 0.12);
  color: #fd7e14;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}

#storePreviewModal .modal-title {
  margin: 0.4rem 0 0;
  color: #2a166f;
  font-weight: 700;
}

.store-preview-description {
  color: #5846a3;
  margin-bottom: 0.75rem;
}

.store-preview-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.45rem;
  color: #3b2a6d;
}

.store-preview-gallery {
  max-height: 360px;
  overflow-y: auto;
}

.store-preview-gallery .store-download-card {
  background: rgba(99, 82, 190, 0.07);
}

@media (max-width: 768px) {
  .store-hero-content {
    flex-direction: column;
    text-align: center;
  }
  .store-balance {
    text-align: center;
  }
  .store-card-cover {
    height: 180px;
  }
  .store-card-actions {
    flex-direction: column;
  }
  .store-card-actions .btn {
    width: 100%;
  }
}

/* Featured carousel and picks */
.store-featured .carousel-item {
  position: relative;
  height: clamp(200px, 30vw, 340px); /* Slightly smaller to avoid upscaling */
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #5846a3;
  box-shadow: 0 10px 30px rgba(43, 28, 88, 0.1);
  background: url("/assets/images/bg-stars.svg") repeat;
  background-size: 120px 120px;
  background-blend-mode: soft-light;
  position: relative;
  padding: 40px 0;
}

/* Star animations */
@keyframes floatStars {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 120px 120px;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes fallingStarRight {
  0% {
    transform: translate(-100px, -100px) rotate(0deg) scale(0.6);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(100vw + 200px), calc(100vh + 200px)) rotate(25deg)
      scale(0.1);
    opacity: 0;
  }
}

@keyframes fallingStarLeft {
  0% {
    transform: translate(calc(100vw + 100px), -100px) rotate(0deg) scale(0.6);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(-200px, calc(100vh + 200px)) rotate(-25deg) scale(0.1);
    opacity: 0;
  }
}

.store-featured .carousel-item {
  animation: floatStars 30s linear infinite;
  position: relative;
}

/* Add twinkling stars */
.store-featured .carousel-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      2px 2px at 20px 30px,
      #ffffff,
      rgba(255, 255, 255, 0)
    ),
    radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(255, 255, 255, 0)),
    radial-gradient(3px 3px at 120px 40px, #ffffff, rgba(255, 255, 255, 0)),
    radial-gradient(2px 2px at 180px 90px, #ffffff, rgba(255, 255, 255, 0)),
    radial-gradient(2px 2px at 210px 110px, #ffffff, rgba(255, 255, 255, 0)),
    radial-gradient(3px 3px at 270px 50px, #ffffff, rgba(255, 255, 255, 0));
  background-repeat: repeat;
  background-size: 350px 350px;
  animation: twinkle 5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* Add multiple falling stars with separate elements for better performance */
.store-featured .carousel-item .falling-star {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 5px 1px #ffffff, 0 0 12px 4px rgba(255, 223, 159, 0.8),
    0 0 20px 6px rgba(255, 210, 120, 0.6);
  background: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 1;
  opacity: 0.8;
}

.store-featured .carousel-item .falling-star:nth-child(1) {
  top: -10px;
  left: 10%;
  animation: fallingStarRight 15s ease-in infinite;
}

.store-featured .carousel-item .falling-star:nth-child(2) {
  top: -20px;
  left: 45%;
  animation: fallingStarLeft 18s ease-in infinite 6s;
}

.store-featured .carousel-item .falling-star:nth-child(3) {
  top: -15px;
  left: 75%;
  animation: fallingStarRight 20s ease-in infinite 12s;
}

/* Add more variety with additional falling stars */
.store-featured .carousel-item .falling-star:nth-child(4) {
  top: -15px;
  left: 25%;
  animation: fallingStarLeft 17s ease-in infinite 3s;
}

.store-featured .carousel-item .falling-star:nth-child(5) {
  top: -25px;
  left: 60%;
  animation: fallingStarLeft 22s ease-in infinite 9s;
}

.store-featured .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Avoids blowing up/cropping low-res images */
  object-position: right center; /* Keep artwork to the right so text can live on the left */
  display: block;
  image-rendering: auto;
}
/* Left-align caption and reserve left column for text */
.store-featured .carousel-caption {
  left: 2rem;
  right: auto;
  width: min(520px, 48%);
  text-align: left;
  color: #2a166f;
  text-shadow: none;
}
.store-featured .carousel-caption h5 {
  display: -webkit-box;
  -webkit-line-clamp: 3; /* show up to three lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.2;
}
@media (max-width: 768px) {
  .store-featured .carousel-item {
    height: clamp(160px, 45vw, 240px);
  }
  .store-featured .carousel-caption {
    width: 80%;
    left: 1rem;
  }
  .store-featured .carousel-item img {
    object-position: center; /* center on small screens */
  }
}

.fp {
  font-weight: 900 !important;
  color: #2a166f !important;
  margin-bottom: 1rem !important;
}

.featured-picks-row {
  display: flex;
  gap: 0;
  overflow-x: hidden;
  padding-bottom: 6px;
  width: max-content;
  position: relative;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  animation: slideRightToLeft 30s linear infinite;
}
.featured-picks-row::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}
/* Pause animation on hover for better UX */
.featured-picks-row:hover {
  animation-play-state: paused;
}

.featured-picks-container {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: inset -20px 0 20px -20px rgba(43, 28, 88, 0.1),
    inset 20px 0 20px -20px rgba(43, 28, 88, 0.1);
  border-radius: 16px;
  padding: 8px 0;
}

@keyframes slideRightToLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-50%));
  }
}

@media (max-width: 768px) {
  .featured-picks-row {
    animation-duration: 20s; /* Faster animation on mobile */
  }
}

.featured-pick {
  min-width: 200px;
  width: 200px;
  max-width: 200px;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
  margin-right: 12px;
  box-shadow: 0 6px 16px rgba(43, 28, 88, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-pick:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(43, 28, 88, 0.15);
}
.featured-pick img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.featured-pick .body {
  padding: 8px;
}
.store-card-featured {
  margin-left: 6px;
}

/* Decoration packs scrollable area */
.decoration-card {
  height: 100%;
  min-height: 100%; /* Ensure it's at least as tall as parent */
}

@media (max-width: 992px) {
  .decoration-card {
    min-height: auto; /* Reset on mobile/tablet */
  }
}

.overflow-auto {
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 66, 193, 0.3) rgba(241, 241, 241, 0.5);
}

.overflow-auto::-webkit-scrollbar {
  width: 8px;
}

.overflow-auto::-webkit-scrollbar-track {
  background: rgba(241, 241, 241, 0.5);
  border-radius: 8px;
}

.overflow-auto::-webkit-scrollbar-thumb {
  background-color: rgba(111, 66, 193, 0.3);
  border-radius: 8px;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
  background-color: rgba(111, 66, 193, 0.5);
}
