/* Player Theme Styles - FUN Christmas Game UI! */

/* =============================================
   THEME BACKGROUNDS - Using custom illustrations!
   ============================================= */

/* All themes now use background images set via inline style on body.
   These CSS rules add a subtle overlay for text readability */

/* Light overlay for themes with lighter backgrounds */
.theme-snow_wonderland::before,
.theme-cozy_village::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.5) 30%,
    rgba(255, 255, 255, 0.6) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Darker overlay for darker-themed backgrounds */
.theme-grinch_lair::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(20, 30, 20, 0.4) 0%,
    rgba(20, 30, 20, 0.6) 50%,
    rgba(20, 30, 20, 0.7) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.theme-northern_lights::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 20, 40, 0.3) 0%,
    rgba(10, 20, 40, 0.5) 50%,
    rgba(10, 20, 40, 0.6) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Text colors for dark themes */
.theme-grinch_lair,
.theme-northern_lights {
  color: #f0f0f0;
}

.theme-grinch_lair h1,
.theme-grinch_lair h2,
.theme-grinch_lair h3,
.theme-northern_lights h1,
.theme-northern_lights h2,
.theme-northern_lights h3 {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.theme-grinch_lair p,
.theme-northern_lights p {
  color: #e0e0e0;
}

/* Fallback gradient backgrounds (if images don't load) */
.theme-snow_wonderland {
  background-color: #E8F4FC;
}

.theme-cozy_village {
  background-color: #FDF5E6;
}

.theme-grinch_lair {
  background-color: #1a2f1a;
}

.theme-northern_lights {
  background-color: #0a0a2e;
}

/* =============================================
   CONTENT WRAPPER - Minimal, lets background show
   ============================================= */

.content-glass {
  /* No background - fully transparent */
  position: relative;
}

/* Text readability - white glow/outline effect */
.content-glass .game-title {
  color: #1f2937;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.9),
    0 0 40px rgba(255, 255, 255, 0.7),
    2px 2px 4px rgba(255, 255, 255, 0.8),
    -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.content-glass p,
.content-glass .font-game {
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.9),
    0 0 20px rgba(255, 255, 255, 0.7),
    1px 1px 2px rgba(255, 255, 255, 0.9),
    -1px -1px 2px rgba(255, 255, 255, 0.9);
}

/* Remove text shadow from buttons and links styled as buttons - makes text fuzzy/hard to read */
.game-card button,
.game-card button *,
.game-card a.btn,
.game-card a.btn *,
.content-glass .game-card button,
.content-glass .game-card button *,
button.font-game,
a.font-game,
.font-game.bg-gradient-to-r,
.font-game.bg-gradient-to-br,
[class*="bg-gradient"].font-game,
[class*="bg-gradient"] .font-game {
  text-shadow: none !important;
}

/* Dark themes need inverted text shadows */
.theme-grinch_lair .content-glass .game-title,
.theme-northern_lights .content-glass .game-title {
  color: #ffffff;
  text-shadow:
    0 0 20px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 0, 0, 0.6),
    2px 2px 4px rgba(0, 0, 0, 0.7);
}

.theme-grinch_lair .content-glass p,
.theme-grinch_lair .content-glass .font-game,
.theme-northern_lights .content-glass p,
.theme-northern_lights .content-glass .font-game {
  color: #f0f0f0;
  text-shadow:
    0 0 10px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(0, 0, 0, 0.6),
    1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* =============================================
   SAFE AREA UTILITIES - PWA/Notch support
   ============================================= */

.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-left {
  padding-left: env(safe-area-inset-left);
}

.safe-area-right {
  padding-right: env(safe-area-inset-right);
}

/* Combined safe areas for full page content */
.safe-area-insets {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* =============================================
   NAVIGATION - BOARD GAME STYLE
   ============================================= */

.board-game-nav {
  font-family: 'Fredoka', 'Comic Sans MS', cursive;
  /* Add safe area padding at bottom for notched devices */
  padding-bottom: env(safe-area-inset-bottom);
}

/* Hide scrollbar but allow scrolling */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari and Opera */
}

.nav-space {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 60px;
}

@keyframes bounce-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.animate-bounce-gentle {
  animation: bounce-gentle 2s ease-in-out infinite;
}

/* =============================================
   CARDS - PLAYFUL & GAME-LIKE
   ============================================= */

.game-card {
  position: relative;
  background: white;
  border-radius: 1.25rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 20px rgba(0, 0, 0, 0.05),
    inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  border: 3px solid rgba(0, 0, 0, 0.1);
}

.game-card:active {
  transform: scale(0.97) translateY(2px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Quest Card - tilted playing card feel */
.quest-card {
  transform: rotate(-1.5deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quest-card:nth-child(even) {
  transform: rotate(1.5deg);
}

.quest-card:nth-child(3n) {
  transform: rotate(-0.5deg);
}

.quest-card:active {
  transform: rotate(0deg) scale(0.98);
}

/* Dark theme card adjustments */
.theme-grinch_lair .game-card,
.theme-northern_lights .game-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
}

/* =============================================
   FUN TITLE STYLING
   ============================================= */

.game-title {
  font-family: 'Bangers', 'Impact', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 rgba(0,0,0,0.1),
    -1px -1px 0 rgba(255,255,255,0.3);
}

/* =============================================
   POINTS DISPLAY - BIG & JUICY
   ============================================= */

.points-display {
  font-family: 'Bangers', 'Impact', sans-serif;
  font-size: 4rem;
  line-height: 1;
  text-shadow:
    4px 4px 0 rgba(0,0,0,0.2),
    -2px -2px 0 rgba(255,255,255,0.5);
}

.points-label {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* =============================================
   ANIMATIONS - BOUNCY & FUN
   ============================================= */

@keyframes slide-in-bottom {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.slide-in-bottom {
  animation: slide-in-bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stagger animation for lists */
.stagger-item {
  opacity: 0;
  animation: slide-in-bottom 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(n+6) { animation-delay: 0.3s; }

/* Wiggle for attention */
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.wiggle {
  animation: wiggle 0.5s ease-in-out;
}

/* Pop in animation */
@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.pop-in {
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =============================================
   REACTION BUBBLES
   ============================================= */

.reaction-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  padding: 0.5rem;
  border-radius: 9999px;
  background: white;
  border: 3px solid #e5e7eb;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.reaction-bubble:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.reaction-bubble:active {
  transform: scale(0.95);
}

.reaction-bubble.active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

/* =============================================
   SHIMMER & GLOW EFFECTS
   ============================================= */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px currentColor, 0 0 10px currentColor; }
  50% { box-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* Challenge card glowing edge animations */
@keyframes challenge-glow-purple {
  0%, 100% {
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.1),
      0 10px 20px rgba(0, 0, 0, 0.05),
      inset 0 -3px 0 rgba(0, 0, 0, 0.1),
      0 0 10px rgba(168, 85, 247, 0.4),
      0 0 20px rgba(168, 85, 247, 0.2);
  }
  50% {
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.1),
      0 10px 20px rgba(0, 0, 0, 0.05),
      inset 0 -3px 0 rgba(0, 0, 0, 0.1),
      0 0 20px rgba(168, 85, 247, 0.6),
      0 0 35px rgba(168, 85, 247, 0.3);
  }
}

@keyframes challenge-glow-red {
  0%, 100% {
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.1),
      0 10px 20px rgba(0, 0, 0, 0.05),
      inset 0 -3px 0 rgba(0, 0, 0, 0.1),
      0 0 10px rgba(239, 68, 68, 0.4),
      0 0 20px rgba(239, 68, 68, 0.2);
  }
  50% {
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.1),
      0 10px 20px rgba(0, 0, 0, 0.05),
      inset 0 -3px 0 rgba(0, 0, 0, 0.1),
      0 0 20px rgba(239, 68, 68, 0.6),
      0 0 35px rgba(239, 68, 68, 0.3);
  }
}

.challenge-glow-active {
  animation: challenge-glow-purple 2.5s ease-in-out infinite;
  border-color: rgba(168, 85, 247, 0.5);
}

.challenge-glow-urgent {
  animation: challenge-glow-red 1.5s ease-in-out infinite;
  border-color: rgba(239, 68, 68, 0.5);
}

/* =============================================
   CONFETTI CELEBRATION
   ============================================= */

.celebration-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* =============================================
   EMPTY STATES - FUN ILLUSTRATIONS
   ============================================= */

.empty-state-icon {
  font-size: 5rem;
  animation: float 3s ease-in-out infinite;
}

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

/* =============================================
   MOBILE OPTIMIZATIONS
   ============================================= */

@media (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }

  button, a, .clickable {
    min-height: 44px;
    min-width: 44px;
  }
}

.min-h-screen-safe {
  min-height: 100vh;
  min-height: 100dvh;
}

/* =============================================
   PARTICLE CANVAS
   ============================================= */

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* =============================================
   ACCESSIBILITY
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .theme-snow_wonderland::before,
  .theme-northern_lights::before {
    animation: none;
  }
}

/* =============================================
   FUN EXTRAS
   ============================================= */

/* Christmas lights border */
.christmas-lights {
  background: linear-gradient(90deg,
    #ff0000 0%, #ff0000 20%,
    #00ff00 20%, #00ff00 40%,
    #ffff00 40%, #ffff00 60%,
    #0000ff 60%, #0000ff 80%,
    #ff00ff 80%, #ff00ff 100%
  );
  background-size: 50px 4px;
  animation: lights-move 2s linear infinite;
}

@keyframes lights-move {
  0% { background-position: 0 0; }
  100% { background-position: 50px 0; }
}

/* Candy cane stripes */
.candy-stripe {
  background: repeating-linear-gradient(
    45deg,
    #ff0000,
    #ff0000 10px,
    #ffffff 10px,
    #ffffff 20px
  );
}

/* Gift ribbon */
.gift-ribbon {
  position: relative;
}

.gift-ribbon::before,
.gift-ribbon::after {
  content: '';
  position: absolute;
  background: linear-gradient(135deg, #c41e3a, #8b0000);
}

.gift-ribbon::before {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 100%;
}

.gift-ribbon::after {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 20px;
}

/* =============================================
   ROUND SUMMARY ANIMATIONS
   ============================================= */

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.8);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease-out;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Staggered animations for list items */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
