@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&display=swap');

:root {
  /* Premium Palette */
  --color-primary: #4361EE;
  /* Royal Blue */
  --color-secondary: #F72585;
  /* Neon Pink */
  --color-accent: #7209B7;
  /* Deep Purple */
  --color-success: #4CC9F0;
  /* Cyan */
  --color-yellow: #FFD60A;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 15px;

  /* Spacing */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;

  /* Borders */
  --radius-sm: 15px;
  --radius-md: 25px;
  --radius-lg: 40px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Fredoka', sans-serif;
  /* Default Base */
  background-color: #fbc2eb;
  background-image: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  background-attachment: fixed;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 1s ease;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text x="0" y="24" font-size="24">🚀</text></svg>'), auto;
}

body.spin-effect {
  animation: spinPage 3s ease-in-out;
}

@keyframes spinPage {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* --- Virtual Pet HUD --- */
.pet-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 4px solid var(--color-primary);
  border-radius: 20px;
  padding: 10px;
  width: 140px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 900;
  transition: transform 0.2s;
  font-family: 'Fredoka', sans-serif;
}

.pet-container:hover {
  transform: scale(1.05);
}

.pet-sprite {
  font-size: 4rem;
  cursor: pointer;
  transition: transform 0.1s;
  user-select: none;
}

.pet-sprite:active {
  transform: scale(0.9);
}

.pet-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
}

.pet-btn {
  margin-top: 5px;
  font-size: 0.8rem;
  padding: 3px 8px;
  background: var(--color-secondary);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.pet-mood {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #fff;
  border-radius: 50%;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-size: 1.2rem;
}

/* === RICH THEME PATTERNS === */

/* SPACE: Nebula Clouds */
body.bg-space {
  background-color: #10002B;
  background-image:
    radial-gradient(circle at 20% 50%, #240046 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, #3C096C 0%, transparent 50%),
    radial-gradient(1px 1px at 10% 10%, white 100%, transparent),
    radial-gradient(1px 1px at 20% 20%, white 100%, transparent),
    radial-gradient(2px 2px at 30% 70%, white 100%, transparent),
    linear-gradient(135deg, #10002B 0%, #000 100%);
  background-size: 100% 100%, 100% 100%, 200px 200px, 150px 150px, 300px 300px, 100% 100%;
}

/* OCEAN: Water Ripples */
body.bg-ocean {
  background-color: #0077B6;
  background-image:
    repeating-radial-gradient(circle at 50% 100%,
      transparent 0,
      transparent 10px,
      rgba(144, 224, 239, 0.2) 10px,
      rgba(144, 224, 239, 0.2) 20px),
    linear-gradient(180deg, #0077B6 0%, #023E8A 100%);
}

/* JUNGLE: Vines and Leaves */
body.bg-jungle {
  background-color: #0d4a0d;
  background-image:
    radial-gradient(circle at 0% 0%, #38B000 15%, transparent 20%),
    radial-gradient(circle at 100% 0%, #38B000 15%, transparent 20%),
    radial-gradient(circle at 100% 100%, #38B000 15%, transparent 20%),
    radial-gradient(circle at 0% 100%, #38B000 15%, transparent 20%),
    radial-gradient(circle at 50% 50%, #70e000 0%, transparent 60%),
    linear-gradient(135deg, #0d4a0d 0%, #004b23 100%);
  background-size: 100px 100px, 100px 100px, 100px 100px, 100px 100px, 100% 100%, 100% 100%;
}

/* CANDY: Stripes */
body.bg-candy {
  background-color: #FF99C8;
  background-image:
    repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.3),
      rgba(255, 255, 255, 0.3) 20px,
      transparent 20px,
      transparent 40px),
    linear-gradient(135deg, #FF99C8 0%, #D0D1FF 100%);
}

/* AUTO/DEFAULT: Controlled by JS seasonal logic usually, but here's a fallback base */
body.bg-auto {
  /* JS sets the specific gradient */
}


a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

header {
  background: rgba(255, 255, 255, 0.85);
  padding: var(--spacing-md) 0;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 1px;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.logo span {
  color: var(--color-secondary);
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-links a {
  font-weight: 600;
  font-size: 1.2rem;
  color: #555;
  transition: all 0.3s;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.nav-links a:hover {
  color: var(--color-primary);
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* --- Dropdown Nav --- */
.nav-links li {
  position: relative;
  /* allow dropdown positioning */
}

/* Dropdown Container */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  /* directly below link */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  padding: 0.5rem;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 2px solid white;
}

/* Show on Hover */
.dropdown:hover .dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeInSlide 0.3s ease;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Dropdown Links */
.dropdown-content a {
  color: #333;
  padding: 0.8rem 1rem;
  text-decoration: none;
  display: block;
  border-radius: 10px;
  transition: background 0.2s;
  font-size: 1.1rem;
}

.dropdown-content a:hover {
  background: var(--color-primary);
  color: white;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border: none;
  background: linear-gradient(to right, var(--color-primary), #4895ef);
  color: white;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(67, 97, 238, 0.6);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: linear-gradient(to right, var(--color-secondary), #f72585);
  box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
}

.btn-secondary:hover {
  box-shadow: 0 8px 20px rgba(247, 37, 133, 0.6);
}

.btn-large {
  font-size: 1.5rem;
  padding: 1rem 3rem;
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: var(--spacing-xl) 0;
  position: relative;
  z-index: 10;
}

.hero h1 {
  font-size: 4rem;
  color: var(--color-white);
  margin-bottom: var(--spacing-md);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  -webkit-text-stroke: 2px white;
  /* Outline effect */
  color: var(--color-primary);
}

.hero p {
  font-size: 1.5rem;
  max-width: 600px;
  margin: 0 auto var(--spacing-lg);
  color: #444;
  font-weight: 500;
}

/* --- Cards (Glassmorphism) --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  padding: var(--spacing-lg) 0;
  position: relative;
  z-index: 10;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* Bouncy */
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.card:hover {
  transform: translateY(-10px) rotate(1deg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  border-color: white;
}

.card h3 {
  font-size: 1.8rem;
  margin-bottom: var(--spacing-sm);
  color: var(--color-accent);
}

.card p {
  margin-bottom: var(--spacing-md);
  color: #666;
}

/* --- Animations --- */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

.planet-card {
  /* Apply float to planets */
  animation: float 4s ease-in-out infinite;
}

/* --- SEASONAL PARTICLES --- */
.seasonal-particle {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  /* Behind header/content if header is 100 */
  opacity: 0.7;
}

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

  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

@keyframes floatUp {
  0% {
    transform: translateY(110vh) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(-10vh) rotate(20deg);
    opacity: 0;
  }
}

/* --- Footer --- */
footer {
  background: rgba(255, 255, 255, 0.5);
  color: var(--color-accent);
  padding: var(--spacing-lg) 0;
  text-align: center;
  margin-top: var(--spacing-xl);
  font-weight: 600;
  position: relative;
  z-index: 10;
}

/* --- THEME FAB --- */
.theme-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--color-yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 200;
  transition: transform 0.3s;
  border: 3px solid white;
}

.theme-fab:hover {
  transform: scale(1.1) rotate(10deg);
}

.theme-menu {
  position: fixed;
  bottom: 90px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: none;
  /* hidden by default */
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
  width: 200px;
}

.theme-menu.active {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-btn {
  border: none;
  background: #f0f0f0;
  padding: 0.8rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-btn:hover {
  background: var(--color-success);
  color: white;
}