:root {
  color-scheme: light;
  --ink: #166534;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(#bae6fd, #dcfce7, #bbf7d0);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

main {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.back {
  color: #166534;
  font-weight: 800;
  text-decoration: none;
}

.back:hover { color: #14532d; }

.title-block { text-align: center; }

h1 {
  margin: 0 0 10px;
  color: #166534;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.1;
}

h2 { margin: 0 0 14px; font-size: clamp(1.4rem, 4vw, 1.8rem); }

.coin-pill {
  display: inline-block;
  margin: 0;
  padding: 8px 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(22, 101, 52, 0.15);
  color: #ca8a04;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 800;
}

.card, .stand {
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(22, 101, 52, 0.14);
}

.card {
  padding: 18px;
  background: #fff;
}

.seed-grid, .bucket-grid {
  display: grid;
  gap: 12px;
}

.seed-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.seed, .flower-card {
  border: 4px solid #d1d5db;
  border-radius: 18px;
  background: #fff;
  padding: 10px 8px;
  text-align: center;
  font: inherit;
  cursor: pointer;
}

.seed .emoji, .flower-card .emoji, .stand-flower .emoji {
  font-size: 2.4rem;
  line-height: 1;
}

.seed strong, .flower-card strong { display: block; margin: 4px 0; font-size: 0.85rem; }
.seed .cost, .flower-card .worth { color: #ca8a04; font-weight: 800; }
.seed .value { color: #4b5563; font-size: 0.75rem; }

.seed.is-on {
  border-color: #22c55e;
  background: #dcfce7;
  box-shadow: 0 0 0 4px #86efac;
}

.seed:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.selected {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 14px;
  background: #dcfce7;
  text-align: center;
  font-weight: 800;
}

.stand {
  overflow: hidden;
  background: linear-gradient(#b45309, #78350f);
  border: 4px solid #92400e;
}

.stand-sign {
  margin: 0;
  padding: 16px;
  background: #dc2626;
  color: #fff;
  text-align: center;
}

.stand-sign h2 { margin: 0; color: #fff; }
.stand-sign p { margin: 6px 0 0; font-size: 1.15rem; }

.stand-tray {
  min-height: 140px;
  margin: 16px;
  padding: 18px;
  border: 4px dashed #ca8a04;
  border-radius: 18px;
  background: linear-gradient(#fef9c3, #fde68a);
}

.stand.is-hot .stand-tray { background: #fef08a; }

.stand-empty { text-align: center; color: #92400e; }
.stand-empty div { font-size: 3rem; }
.stand-empty p { margin: 0; font-size: 1.3rem; font-weight: 800; }

.stand-flowers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.stand-flower { text-align: center; animation: bounce 1s ease-in-out infinite; }
.stand-flower .paid { color: #15803d; font-weight: 800; font-size: 1.1rem; }

.bucket-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.bucket-head h2 { margin: 0; }

.bucket-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pill.pink { background: #ec4899; }
.pill.gold { background: #eab308; }
.pill.pink:hover { background: #db2777; }
.pill.gold:hover { background: #ca8a04; }

.bucket-empty { padding: 18px 0; text-align: center; color: #6b7280; }
.bucket-empty div { font-size: 3rem; }

.bucket-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.flower-card {
  background: linear-gradient(#dcfce7, #bbf7d0);
  border-color: #4ade80;
  cursor: grab;
  touch-action: none;
}

.flower-card:active { cursor: grabbing; }

.sell-one {
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: #ca8a04;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.plots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plot {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 4px solid #78716c;
  border-radius: 18px;
  background: linear-gradient(#d6d3d1, #a8a29e);
  padding: 8px;
  text-align: center;
}

.plot.empty { cursor: pointer; }
.plot.empty:hover { border-color: #4ade80; }

.plot.filled {
  background: linear-gradient(#fef3c7, #fde68a);
  border-color: #fbbf24;
}

.plant { font-size: clamp(2.2rem, 8vw, 3.6rem); line-height: 1; }
.empty-label { color: #57534e; font-weight: 800; font-size: 0.85rem; }

.care, .harvest {
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.care { width: 42px; height: 42px; font-size: 1.2rem; }
.care.sun { background: #eab308; }
.care.water { background: #3b82f6; }
.harvest {
  background: #22c55e;
  padding: 8px 12px;
  font-size: 0.95rem;
}

.badges {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  gap: 2px;
  font-size: 1.2rem;
}

.stage {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.how-to ul { margin: 0; padding-left: 1.1rem; }
.how-to li { margin: 0 0 8px; font-size: 1.05rem; }

:focus-visible {
  outline: 3px solid #15803d;
  outline-offset: 3px;
}

[hidden] { display: none !important; }

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

@media (max-width: 900px) {
  .seed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bucket-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .seed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .care { width: 36px; height: 36px; }
}
