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

:root {
  color-scheme: light;
  --bg: #fef3c7;
  --panel: #ffffff;
  --border: #fcd34d;
  --accent: #10b981;
  --accent-tint: #34d399;
  --text: #0f172a;
  --muted: #475569;
  --shade: #fde68a;
  --hero: linear-gradient(135deg, #7dd3fc, #c084fc 45%, #f472b6);
  --child-bg: #fefce8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: radial-gradient(circle at 20% 20%, #fff8c6, #fefce8 45%, #fef3c7 90%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero {
  text-align: center;
  background: var(--hero);
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
  color: #111827;
  box-shadow: 0 30px 60px -20px rgba(79, 70, 229, 0.5);
}

.hero-spark {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.4;
  mix-blend-mode: screen;
  animation: shimmer 6s ease-in-out infinite;
}

.hero-spark.spark-1 {
  top: -20px;
  left: -10px;
  background: radial-gradient(circle, #c084fc, transparent 70%);
}

.hero-spark.spark-2 {
  bottom: -30px;
  right: 10px;
  background: radial-gradient(circle, #fde68a, transparent 70%);
  animation-delay: 2s;
}

.hero-illustration {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0.25rem 0;
  font-size: clamp(2.5rem, 4vw, 3.8rem);
  font-family: 'Fredoka', 'Space Grotesk', sans-serif;
}

.tagline {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.8);
}

.status-row {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.points {
  font-weight: 700;
  color: #0f172a;
}

.mood-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.8);
  color: white;
  font-size: 0.9rem;
}

.hero-illustration svg {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.25));
}

.mascot {
  position: relative;
  animation: bounce 3s ease-in-out infinite;
}

.speech-bubble {
  background: #ffffffcc;
  border-radius: 1.4rem;
  padding: 0.9rem 1.2rem;
  color: #111827;
  font-weight: 600;
  max-width: 320px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.2);
  font-size: 0.95rem;
  animation: floaty 6s ease-in-out infinite;
}

.floating-coins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-coin {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef08a 0%, #facc15 60%, #f97316 100%);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
  animation: coin-drift 9s linear infinite;
}

.coin-1 {
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.coin-2 {
  top: 30%;
  right: 8%;
  animation-delay: -3s;
}

.coin-3 {
  bottom: 20%;
  left: 20%;
  animation-delay: -5s;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(248, 113, 113, 0.2), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.18), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(252, 211, 77, 0.15), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

main {
  display: grid;
  gap: 1.25rem;
}

.hero-badges {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.badge {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fef3c7;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.2);
}

.badge-sun { background: linear-gradient(135deg, #f97316, #facc15); }
.badge-stars { background: linear-gradient(135deg, #a855f7, #6366f1); }
.badge-cloud { background: linear-gradient(135deg, #34d399, #10b981); }

.site-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: rgba(15, 23, 42, 0.8);
  font-size: 0.9rem;
}

.site-footer .footer-note {
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.6);
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(249, 115, 22, 0.5);
  border-radius: 1.2rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 25px 35px -25px rgba(15, 23, 42, 0.6);
  background: var(--child-bg);
}

.panel-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.panel-header p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.farm-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.crop-card {
  border: none;
  border-radius: 1.4rem;
  padding: 1.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(219, 234, 254, 0.7) 70%, rgba(236, 253, 245, 0.85) 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.15);
}

.crop-card::after {
  background: radial-gradient(circle at 120% -10%, rgba(59, 130, 246, 0.25), transparent 55%);
}

.crop-card:hover {
  transform: translateY(-6px);
  transition: transform 0.2s ease;
}

.crop-name {
  font-weight: 600;
  font-size: 1.15rem;
}

.crop-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.75);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #facc15, #fb923c);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.crop-status {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.65);
  min-height: 1.2rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.card-actions button {
  flex: 1;
  border: none;
  border-radius: 0.9rem;
  padding: 0.6rem 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-actions button:hover:enabled {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.25);
}

.card-actions button:active:enabled {
  transform: translateY(0);
}

.plant-btn {
  background: #0ea5e9;
  color: white;
}

.harvest-btn {
  background: #f97316;
  color: white;
}

.harvest-btn:disabled {
  background: rgba(15, 23, 42, 0.2);
  cursor: default;
}

.upgrade-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.upgrade-card {
  border: 1px dashed rgba(59, 130, 246, 0.6);
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.upgrade-card::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  border: 1px solid rgba(16, 185, 129, 0.2);
  pointer-events: none;
}

.upgrade-card h3 {
  margin: 0;
  font-size: 1rem;
}

.upgrade-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.upgrade-card button {
  margin-top: 0.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0.7rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: blue;
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
}

.upgrade-card button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(107, 114, 128, 0.3);
}

.tips-panel .tip-text {
  margin: 0;
  font-size: 1.05rem;
  min-height: 3rem;
}

.tip-button {
  margin-top: 0.6rem;
  border: none;
  border-radius: 0.8rem;
  padding: 0.55rem 0.9rem;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.audio-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.audio-toggle {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.audio-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .app-shell {
    padding: 1.5rem 1rem 2rem;
  }

  .hero {
    padding: 1.6rem 1rem;
  }

  .status-row {
    flex-direction: column;
  }

  .hero-illustration {
    flex-direction: column;
  }

  .crop-card {
    padding: 0.9rem;
  }

  .card-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.4rem;
  }

  .speech-bubble {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .card-actions {
    flex-direction: column;
  }

  .speech-bubble {
    margin: 0 auto;
  }
}

@keyframes floaty {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

@keyframes coin-drift {
  0% { transform: translateY(0) translateX(0); opacity: 0.8; }
  50% { transform: translateY(-30px) translateX(10px); opacity: 1; }
  100% { transform: translateY(-60px) translateX(-5px); opacity: 0; }
}

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

@keyframes coin-pop {
  0% { transform: scale(0.95); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
