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

body {
  font-family: 'Nunito', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  transition: background 2s ease;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  height: 40px;
  animation: drift linear infinite;
  box-shadow: 
    30px 10px 0 10px rgba(255, 255, 255, 0.7),
    -20px 5px 0 15px rgba(255, 255, 255, 0.7),
    15px -5px 0 20px rgba(255, 255, 255, 0.7);
}

@keyframes drift {
  from { transform: translateX(-150%); }
  to { transform: translateX(calc(100vw + 150%)); }
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.particle.pollen {
  background: rgba(255, 235, 59, 0.6);
}

.particle.firefly {
  background: #ffeb3b;
  box-shadow: 0 0 10px 3px rgba(255, 235, 59, 0.8);
  animation: firefly 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  25% { transform: translate(20px, -30px); opacity: 1; }
  50% { transform: translate(-10px, -50px); opacity: 0.7; }
  75% { transform: translate(30px, -20px); opacity: 1; }
}

@keyframes firefly {
  0%, 100% { opacity: 0.2; transform: translate(0, 0); }
  50% { opacity: 1; transform: translate(15px, -25px); }
}

.rain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    transparent,
    transparent 10px,
    rgba(174, 194, 224, 0.3) 10px,
    rgba(174, 194, 224, 0.3) 12px
  );
  animation: rain 0.3s linear infinite;
  pointer-events: none;
}

@keyframes rain {
  from { transform: translateY(-20px); }
  to { transform: translateY(20px); }
}

.header {
  position: relative;
  z-index: 10;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  gap: 10px;
}

.title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaf-left, .leaf-right {
  animation: sway 3s ease-in-out infinite;
}

.leaf-right {
  animation-delay: 0.5s;
}

.stats {
  display: flex;
  gap: 16px;
  color: #fff;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.controls {
  position: relative;
  z-index: 10;
  padding: 10px 20px;
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.control-select {
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.control-select:hover {
  background: rgba(255, 255, 255, 0.3);
}

.control-select option {
  color: #333;
  background: #fff;
}

.garden-area {
  flex: 1;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 50vh;
  padding-bottom: 80px;
}

.ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, #4a7c4e 0%, #3d6b41 20%, #5d4037 100%);
  border-top: 4px solid #6b8f6e;
}

.plants-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px;
  position: relative;
  z-index: 6;
  min-height: 150px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.empty-garden {
  text-align: center;
  color: #fff;
  font-size: 1.2rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
  padding: 40px;
}

.plant-container {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
  animation: sway 3s ease-in-out infinite;
  transform-origin: bottom center;
}

.plant-container:hover {
  transform: scale(1.1) !important;
  z-index: 10;
}

.plant-container.wilted {
  animation: droop 2s ease-in-out infinite;
  filter: brightness(0.8);
}

.plant-container.sparkle::after {
  content: '✨';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  animation: sparkle 0.5s ease-out forwards;
  font-size: 20px;
}

@keyframes sparkle {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(1.5); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes droop {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(-5deg); }
}

.plant-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.plant-image {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  transition: filter 0.3s;
}

.plant-face {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  opacity: 0.9;
}

.plant-preview {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 250, 240, 0.95);
  border: 2px solid #8d6e63;
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 120px;
  max-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.plant-container:hover .plant-preview {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px);
}

.preview-content {
  font-family: 'Caveat', cursive;
  font-size: 14px;
  color: #5d4037;
  line-height: 1.4;
}

.water-drops {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: dropFall 1s ease-out forwards;
}

@keyframes dropFall {
  0% { opacity: 1; transform: translateX(-50%) translateY(-20px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(60px); }
}

.plant-note-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 14px 28px;
  background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  animation: bounce 2s ease-in-out infinite;
}

.plant-note-btn:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
}

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

.btn-icon {
  font-size: 1.2rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.note-editor {
  background: linear-gradient(180deg, #fff9e6 0%, #fff 100%);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 3px solid #8d6e63;
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.editor-header {
  padding: 16px 20px;
  background: linear-gradient(90deg, #a5d6a7 0%, #81c784 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 17px 17px 0 0;
}

.editor-header h2 {
  font-size: 1.3rem;
  color: #2e7d32;
  font-weight: 700;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  cursor: pointer;
  color: #2e7d32;
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

.editor-body {
  padding: 20px;
}

.note-textarea {
  width: 100%;
  min-height: 150px;
  padding: 16px;
  border: 2px solid #c8e6c9;
  border-radius: 12px;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  resize: vertical;
  background: #fff;
  color: #5d4037;
  transition: border-color 0.2s;
}

.note-textarea:focus {
  outline: none;
  border-color: #66bb6a;
}

.note-textarea::placeholder {
  color: #a5d6a7;
}

.plant-type-selector {
  margin-top: 20px;
}

.plant-type-selector label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #5d4037;
}

.plant-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.plant-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}

.plant-option:hover {
  background: rgba(200, 230, 201, 0.5);
}

.plant-option.selected {
  background: rgba(200, 230, 201, 0.8);
}

.plant-emoji {
  font-size: 24px;
}

.plant-name {
  font-size: 10px;
  margin-top: 4px;
  color: #5d4037;
  font-weight: 600;
}

.growth-indicator {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.growth-bar {
  display: flex;
  gap: 4px;
}

.growth-segment {
  width: 24px;
  height: 8px;
  border-radius: 4px;
  background: #ddd;
  transition: background 0.3s;
}

.growth-stage {
  font-size: 12px;
  color: #888;
  text-transform: capitalize;
}

.editor-footer {
  padding: 16px 20px;
  background: #f5f5f5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-radius: 0 0 17px 17px;
  flex-wrap: wrap;
}

.delete-btn, .water-btn, .save-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-btn {
  background: #ffcdd2;
  color: #c62828;
}

.delete-btn:hover {
  background: #ef9a9a;
}

.water-btn {
  background: #b3e5fc;
  color: #0277bd;
}

.water-btn:hover {
  background: #81d4fa;
}

.save-btn {
  background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
  color: #fff;
}

.save-btn:hover {
  transform: scale(1.02);
}

.save-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.footer {
  position: relative;
  z-index: 10;
  padding: 12px 20px;
  background: rgba(93, 64, 55, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.garden-health {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
}

.health-bar {
  width: 100px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #f44336 0%, #ff9800 30%, #4caf50 100%);
  transition: width 0.5s;
  border-radius: 4px;
}

.remix-link {
  color: #a5d6a7;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  transition: all 0.2s;
}

.remix-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@media (max-width: 600px) {
  .title {
    font-size: 1.2rem;
  }
  
  .header {
    justify-content: center;
    text-align: center;
  }
  
  .plants-row {
    justify-content: flex-start;
    padding: 0 10px;
  }
  
  .plant-image {
    width: 48px;
    height: 48px;
  }
  
  .plant-options {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .control-select {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
}