/* ---------- Lat's Plants ---------- */

:root {
  --green-1: #1f7a4d;
  --green-2: #2fa66a;
  --green-3: #d7f2e0;
  --brown-1: #8a5a3b;
  --brown-2: #b98356;
  --cream: #fff8e9;
  --yellow: #ffcb3d;
  --pink: #ff8fab;
  --ink: #2c2416;
  --shadow: rgba(44, 36, 22, 0.18);
  --radius: 18px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(#bfe6ff 0%, #dff3ff 45%, var(--cream) 45%, var(--cream) 100%);
  font-family: 'Patrick Hand', cursive;
  color: var(--ink);
  overflow-x: hidden;
}

h1, h2, .basket-btn, .sign, .checkout-btn {
  font-family: 'Baloo 2', sans-serif;
}

/* ---- sky decorations ---- */
.sky {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 260px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.sun {
  position: absolute;
  top: 20px; right: 8%;
  font-size: 3.5rem;
  animation: spin 18s linear infinite;
  cursor: pointer;
  pointer-events: auto;
}
.sun:hover { animation-duration: 2s; }
@keyframes spin { to { transform: rotate(360deg); } }

.cloud {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.9;
  animation: drift 40s linear infinite;
}
.cloud-a { top: 30px; left: -10%; animation-duration: 55s; }
.cloud-b { top: 90px; left: -20%; font-size: 2rem; animation-duration: 70s; animation-delay: -20s; }
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(130vw); }
}

/* ---- header ---- */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 5%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.logo-emoji {
  font-size: 2.8rem;
  display: inline-block;
  transform-origin: 60% 90%;
  transition: transform 0.15s ease;
}
.logo:hover .logo-emoji { transform: rotate(-15deg) scale(1.1); }
.logo.rainbow .logo-emoji { animation: wiggle 0.5s ease infinite; }
@keyframes wiggle {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--green-1);
  text-shadow: 2px 2px 0 var(--cream);
}
.logo.rainbow h1 {
  animation: rainbow-text 2s linear infinite;
}
@keyframes rainbow-text {
  0% { color: #ff595e; }
  20% { color: #ffca3a; }
  40% { color: #8ac926; }
  60% { color: #1982c4; }
  80% { color: #6a4c93; }
  100% { color: #ff595e; }
}

.tagline {
  margin: 2px 0 0;
  font-size: 0.95rem;
  color: var(--brown-1);
}

.sign-flip {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}
.sign {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  background: var(--green-2);
  color: white;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 4px 0 var(--green-1);
  transform: rotate(-3deg);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sign-flip[aria-pressed="true"] .sign {
  background: var(--pink);
  box-shadow: 0 4px 0 #c46079;
  transform: rotate(3deg);
}
.sign-flip:active .sign { transform: translateY(3px) rotate(0deg); box-shadow: 0 1px 0 var(--green-1); }

.basket-btn {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  border: 3px solid var(--brown-1);
  background: var(--yellow);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--brown-1);
  transition: transform 0.1s ease;
}
.basket-btn:hover { transform: translateY(-2px); }
.basket-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--brown-1); }
.basket-count {
  display: inline-block;
  background: var(--pink);
  color: white;
  border-radius: 999px;
  min-width: 22px;
  padding: 0 6px;
  font-size: 0.85rem;
  margin-left: 4px;
}

.score-badge {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  background: white;
  border: 3px solid var(--yellow);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--brown-1);
  box-shadow: 0 3px 0 var(--yellow);
  transition: transform 0.2s ease;
}
.score-badge.bump { animation: scoreBump 0.4s ease; }
@keyframes scoreBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---- hero / stand ---- */
main { position: relative; z-index: 1; }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 5% 30px;
}

.hero-scene {
  max-width: 720px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 24px var(--shadow);
}
.stand-svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-caption {
  max-width: 560px;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--brown-1);
  background: white;
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-top: -18px;
  box-shadow: 0 6px 14px var(--shadow);
  border: 3px solid var(--green-3);
}

/* ---- shop grid ---- */
.shop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  padding: 10px 5% 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.plant-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: 0 6px 14px var(--shadow);
  border: 3px solid var(--green-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.plant-card.maxed {
  border-color: var(--yellow);
  box-shadow: 0 6px 14px var(--shadow), 0 0 0 4px rgba(255, 203, 61, 0.35);
}

.plant-emoji {
  font-size: 3.6rem;
  transition: transform 0.25s ease;
  position: relative;
  display: inline-block;
}
.plant-card.happy .plant-emoji {
  animation: bounce 0.6s ease;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-10px) scale(1.08); }
}
.plant-card.maxed .plant-emoji::after {
  content: "✨";
  position: absolute;
  top: -10px;
  right: -14px;
  font-size: 1.4rem;
  animation: sparkleSpin 1.6s ease infinite;
}
@keyframes sparkleSpin {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; }
  50% { transform: rotate(20deg) scale(1.2); opacity: 0.7; }
}

.speech-bubble {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) scale(0.6);
  background: var(--ink);
  color: white;
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
}
.speech-bubble.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.plant-name {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--green-1);
  margin: 0;
}

.plant-desc {
  font-size: 1rem;
  color: var(--brown-1);
  min-height: 44px;
  margin: 0;
}

.mood-bar-track {
  background: var(--green-3);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.mood-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-2), var(--yellow));
  width: 30%;
  transition: width 0.4s ease;
}
.mood-label {
  font-size: 0.85rem;
  color: var(--brown-1);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.water-btn, .add-btn {
  flex: 1;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  border-radius: 12px;
  padding: 8px 6px;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: transform 0.1s ease;
}
.water-btn {
  background: #bfe6ff;
  color: #14507a;
}
.add-btn {
  background: var(--green-2);
  color: white;
}
.water-btn:hover, .add-btn:hover { transform: translateY(-2px); }
.water-btn:active, .add-btn:active { transform: translateY(1px); }

.price-tag {
  position: absolute;
  top: -6px;
  right: 14px;
  background: var(--yellow);
  padding: 6px 10px;
  border-radius: 0 0 8px 8px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--brown-2);
}

.droplet {
  position: absolute;
  font-size: 1.4rem;
  pointer-events: none;
  animation: drop 0.9s ease-out forwards;
}
@keyframes drop {
  0% { transform: translateY(-10px); opacity: 1; }
  100% { transform: translateY(60px); opacity: 0; }
}

/* ---- fun fact ---- */
.fun-fact {
  text-align: center;
  padding: 30px 5% 60px;
}
#factText {
  font-size: 1.2rem;
  background: var(--green-3);
  display: inline-block;
  padding: 14px 22px;
  border-radius: var(--radius);
  max-width: 560px;
}
#newFact {
  display: block;
  margin: 12px auto 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  background: var(--pink);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}
#newFact:hover { transform: translateY(-1px); }

footer {
  text-align: center;
  padding: 18px;
  color: var(--brown-1);
  font-size: 0.95rem;
}

/* ---- basket drawer ---- */
.drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 340px;
  max-width: 88vw;
  height: 100%;
  background: var(--cream);
  box-shadow: -6px 0 20px var(--shadow);
  z-index: 20;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { right: 0; }
.drawer-inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-header h2 { margin: 0; color: var(--green-1); }
.close-btn {
  border: none;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
}
.basket-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.basket-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--green-3);
}
.basket-list .item-emoji { font-size: 1.6rem; }
.basket-list .item-info { flex: 1; }
.basket-list .item-name { font-weight: 700; font-family: 'Baloo 2', sans-serif; font-size: 0.95rem; }
.basket-list .item-qty-controls { display: flex; align-items: center; gap: 6px; }
.basket-list button.qty-btn {
  border: 2px solid var(--green-2);
  background: white;
  border-radius: 6px;
  width: 24px; height: 24px;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
}
.empty-msg {
  text-align: center;
  color: var(--brown-1);
  margin-top: 30px;
}
.drawer-footer {
  border-top: 3px solid var(--green-3);
  padding-top: 14px;
}
.total {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.checkout-btn {
  width: 100%;
  border: none;
  background: var(--green-2);
  color: white;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}
.checkout-btn:hover { filter: brightness(1.05); }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 15;
  display: none;
}
.scrim.show { display: block; }

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 30;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- bee (disabled for now, see note) ---- */
.bee {
  display: none; /* set back to a positioned value to re-enable */
  position: fixed;
  top: 120px;
  left: -60px;
  font-size: 2.2rem;
  cursor: pointer;
  z-index: 12;
  filter: drop-shadow(0 3px 4px var(--shadow));
  animation: beeFly 16s linear infinite;
  animation-delay: 3s;
}
.bee:hover { transform: scale(1.15); }
.bee.caught {
  animation: none !important;
  pointer-events: none;
}
@keyframes beeFly {
  0%   { left: -60px; top: 120px; transform: scaleX(1); }
  15%  { left: 20vw;  top: 200px; transform: scaleX(1); }
  30%  { left: 45vw;  top: 110px; transform: scaleX(1); }
  49%  { left: 68vw;  top: 255px; transform: scaleX(1); }
  50%  { left: 70vw;  top: 260px; transform: scaleX(-1); }
  65%  { left: 40vw;  top: 180px; transform: scaleX(-1); }
  82%  { left: 15vw;  top: 240px; transform: scaleX(-1); }
  100% { left: -60px; top: 150px; transform: scaleX(-1); }
}

/* ---- rain button + row ---- */
.rain-row {
  display: flex;
  justify-content: center;
  padding: 0 5% 10px;
}
.rain-btn {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  background: #bfe6ff;
  color: #14507a;
  border: 3px solid #7fc4ec;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 3px 0 #7fc4ec;
  transition: transform 0.1s ease;
}
.rain-btn:hover { transform: translateY(-2px); }
.rain-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #7fc4ec; }

.raindrop {
  position: fixed;
  top: -20px;
  font-size: 1.3rem;
  pointer-events: none;
  z-index: 5;
  animation: rainFall 1.1s linear forwards;
}
@keyframes rainFall {
  to { transform: translateY(110vh); opacity: 0.3; }
}

/* ---- celebration overlay ---- */
.celebration {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 22, 0.5);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.celebration.show { display: flex; }
.celebration-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 34px 30px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  animation: popIn 0.4s ease;
}
@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.celebration-trophy {
  font-size: 4rem;
  animation: bounce 1s ease infinite;
}
.celebration-card h2 {
  color: var(--green-1);
  margin: 8px 0;
}
.celebration-card p {
  color: var(--brown-1);
  font-size: 1.1rem;
}
.celebration-card button {
  margin-top: 12px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  background: var(--green-2);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
}

/* ---- customer rush game ---- */
.game-section {
  max-width: 700px;
  margin: 10px auto 30px;
  padding: 0 5%;
  text-align: center;
}
.game-title {
  color: var(--green-1);
  margin-bottom: 4px;
  font-size: 1.8rem;
}
.game-subtitle {
  color: var(--brown-1);
  margin-top: 0;
  font-size: 1.05rem;
}
.game-panel {
  background: white;
  border: 3px solid var(--green-3);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px var(--shadow);
  padding: 22px;
}

.game-idle p, .game-over p { font-size: 1.15rem; }

.game-start-btn {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: var(--pink);
  color: white;
  border: none;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #c46079;
  transition: transform 0.1s ease;
}
.game-start-btn:hover { transform: translateY(-2px); }
.game-start-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #c46079; }

.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  margin-bottom: 8px;
}
.game-lives { font-size: 1.1rem; letter-spacing: 2px; }
.game-score { color: var(--brown-1); font-size: 1.2rem; }

.game-timer-track {
  height: 12px;
  background: var(--green-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}
.game-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--green-2), var(--yellow));
  transition: width 0.1s linear;
}
.game-timer-fill.low { background: linear-gradient(90deg, #ff6b6b, var(--pink)); }

.customer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}
.customer-avatar {
  font-size: 3.2rem;
  animation: customerBob 1.4s ease-in-out infinite;
}
@keyframes customerBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
.customer-bubble {
  background: var(--green-3);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 1.1rem;
}

.game-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.game-option-btn {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  background: var(--cream);
  border: 3px solid var(--green-3);
  border-radius: 14px;
  padding: 12px 8px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease;
}
.game-option-btn:hover { transform: translateY(-2px); }
.game-option-btn .opt-emoji { font-size: 1.8rem; display: block; }
.game-option-btn.correct { background: #d7f2e0; border-color: var(--green-2); animation: bounce 0.4s ease; }
.game-option-btn.wrong { background: #ffd9d9; border-color: #ff6b6b; animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.game-over h3 { color: var(--green-1); margin-bottom: 6px; }
.game-new-best {
  color: var(--brown-1);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
}

@media (max-width: 640px) {
  .site-header {
    justify-content: center;
    text-align: center;
    padding: 18px 4%;
  }
  .logo { justify-content: center; }
  .score-badge { font-size: 0.9rem; padding: 6px 12px; }
  .hero-caption { font-size: 1.05rem; padding: 14px 18px; margin-top: -10px; }
  .game-panel { padding: 16px; }
  .game-title { font-size: 1.4rem; }
  .game-subtitle { font-size: 0.95rem; }
  .customer-avatar { font-size: 2.6rem; }
  .customer-bubble { font-size: 0.95rem; padding: 8px 14px; }
  .game-options { grid-template-columns: repeat(2, 1fr); }
  .rain-btn { font-size: 0.9rem; padding: 9px 16px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .tagline { font-size: 0.8rem; }
  .hero-caption { font-size: 1rem; }
  .bee { font-size: 1.7rem; }
  .game-options { grid-template-columns: 1fr 1fr; }
  .celebration-card { padding: 24px 20px; }
}
