/* Wordle Garden - Botanical Illustration Style */

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

:root {
  --bg-color: #f8f6f1;
  --text-color: #2c3e2d;
  --text-muted: #5d6b5e;
  --green: #6aaa64;
  --green-dark: #3d6b3d;
  --yellow: #c9b458;
  --yellow-dark: #8b7d3a;
  --gray: #787c7e;
  --gray-light: #d3d6da;
  --flower-center: #f5e6b3;
  --flower-center-accent: #c9a83a;
  --border-color: #c5d4c0;
}

body {
  font-family: 'Playfair Display', Georgia, serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px 20px;
  border-bottom: 1px solid var(--border-color);
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.header p {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Garden Grid */
.garden {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 24px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.flower-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  animation: bloom 0.5s ease-out backwards;
}

/* Stagger bloom for each container */
.flower-container:nth-child(1) { animation-delay: 0.02s; }
.flower-container:nth-child(2) { animation-delay: 0.04s; }
.flower-container:nth-child(3) { animation-delay: 0.06s; }
.flower-container:nth-child(4) { animation-delay: 0.08s; }
.flower-container:nth-child(5) { animation-delay: 0.1s; }
.flower-container:nth-child(6) { animation-delay: 0.12s; }
.flower-container:nth-child(7) { animation-delay: 0.14s; }
.flower-container:nth-child(8) { animation-delay: 0.16s; }
.flower-container:nth-child(9) { animation-delay: 0.18s; }
.flower-container:nth-child(10) { animation-delay: 0.2s; }
.flower-container:nth-child(n+11) { animation-delay: 0.22s; }

@keyframes bloom {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.flower-container:hover {
  transform: translateY(-4px);
}

.flower-container:hover .flower-date {
  opacity: 1;
}

/* Only flower cluster sways on hover */
.flower-container:hover .flower-cluster {
  animation: sway 0.8s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

.flower-cluster {
  width: 120px;
  height: 120px;
}

.flower-date {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-style: italic;
}

/* Submit Section */
.submit-section {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

.submit-section p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}

.submit-link {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid var(--text-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}

.submit-link:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* Poem Page */
.poem-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 30px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-color);
}

.poem-header {
  text-align: center;
  margin-bottom: 40px;
}

.poem-date {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.wordle-number {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Wordle Grid */
.wordle-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 50px;
}

.wordle-row {
  display: flex;
  gap: 6px;
}

.wordle-cell {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
  border-radius: 2px;
}

.wordle-cell.correct {
  background-color: var(--green);
}

.wordle-cell.present {
  background-color: var(--yellow);
}

.wordle-cell.absent {
  background-color: var(--gray);
}

/* Poem Content */
.poem-content {
  text-align: center;
  margin-bottom: 50px;
}

.poem-text {
  font-size: 1.25rem;
  line-height: 2;
  white-space: pre-line;
}

.stanza {
  margin-bottom: 1.5em;
}

.stanza:last-child {
  margin-bottom: 0;
}

/* Flower Display on Poem Page */
.poem-flower {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.poem-flower svg {
  width: 150px;
  height: 150px;
}

/* Share Section */
.share-section {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.share-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .garden {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    padding: 20px;
  }

  .flower-cluster {
    width: 90px;
    height: 90px;
  }

  .wordle-cell {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .poem-text {
    font-size: 1.1rem;
  }
}
