:root {
  --sky-1: #b8e6f0;
  --sky-2: #ffd9ec;
  --plot: #cce8b5;
  --plot-dark: #8fc06a;
  --soil: #b58a5a;
  --card: #ffffff;
  --ink: #2e3b2e;
  --accent: #ff7eb6;
  --accent-deep: #d04694;
  --gold: #f5c84a;
  --shame: #c84444;
}
body.garden {
  margin: 0; padding: 0; min-height: 100vh;
  font-family: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 100%);
  background-attachment: fixed;
}
body.garden::before { display: none; }  /* hide duck wallpaper */
body.garden * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body.garden header.gh {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem; background: rgba(255,255,255,.6);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky; top: 0; z-index: 10;
}
body.garden header.gh h1 { margin: 0; font-size: 1.6rem; flex: 1; text-align: center; letter-spacing: .04em; font-family: inherit; }
body.garden header.gh .score { font-weight: 800; color: var(--accent-deep); font-size: 1.4rem; }
body.garden header.gh .back { text-decoration: none; color: var(--ink); font-size: 1.8rem; }

body.garden main { max-width: 720px; margin: 0 auto; padding: 0.75rem; }

.garden-banner {
  background: var(--card); border-radius: 14px;
  padding: 0.75rem 1rem; margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.garden-banner .row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; font-size: 1.15rem; }
.garden-banner .row + .row { margin-top: .4rem; }
.garden-banner .pill {
  display: inline-flex; align-items: center; gap: .25rem;
  background: #f7f3e8; border-radius: 999px;
  padding: .35rem .8rem; font-weight: 700; font-size: 1.05rem;
}
.garden-banner .pill.ap { background: #fff8d2; }
.garden-banner .pill.seeds { background: #e2f0c8; }
.garden-banner .pill.shame { background: #ffe0e0; color: var(--shame); }
.hand { display: flex; gap: 4px; flex-wrap: wrap; }
.hand-slot {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: #f0e8d4;
  border: 2px dashed rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.hand-slot.filled {
  background: #fff8d2;
  border: 2px solid var(--gold);
}
.actions-bar {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-top: .5rem;
}
button.gbtn {
  border: none; border-radius: 999px;
  padding: .65rem 1.2rem; font-weight: 700; font-size: 1.1rem;
  background: var(--accent); color: white; cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
  font-family: inherit;
}
button.gbtn:disabled { background: #ccc; cursor: not-allowed; box-shadow: none; }
button.gbtn.alt { background: #6bb6e6; }
button.gbtn.warn { background: #ff8c52; }
button.gbtn.danger { background: var(--shame); }
button.gbtn.go { background: #5cc26b; }

body.garden h2 { font-size: 1.25rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent-deep); margin: 1rem 0 .5rem; text-align: center; font-family: inherit; }

.clickmeter {
  background: var(--card);
  border-radius: 14px;
  padding: .75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  margin-bottom: .75rem;
  text-align: center;
}
.clickmeter .gbtn { width: 100%; padding: .85rem 1rem; font-size: 1.2rem; }
.clickmeter .gbtn:active { transform: scale(.97); }
.clickmeter-bar {
  position: relative;
  height: 14px;
  background: #f0e8d4;
  border-radius: 999px;
  overflow: hidden;
  margin: .6rem 0 .35rem;
}
.clickmeter-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #ff7eb6, #f5c84a, #5cc26b);
  width: 0%;
  transition: width .15s ease-out;
}
.clickmeter-label {
  font-size: .9rem; color: #555;
  display: flex; justify-content: center; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.clickmeter-label .clickmeter-hint { color: #888; font-style: italic; }
.event-banner {
  background: linear-gradient(135deg, #fff5e0, #ffe0c0);
  border-radius: 14px;
  padding: .75rem 1rem;
  margin-bottom: .75rem;
  border: 2px solid #f5c84a;
  box-shadow: 0 4px 12px rgba(245, 200, 74, .25);
}
.eb-row { display: flex; align-items: flex-start; gap: .5rem; }
.eb-text { flex: 1; }
.eb-title { font-weight: 800; color: #b07b1c; font-size: 1.05rem; }
.eb-body { font-size: .9rem; color: var(--ink); margin-top: .25rem; }
.eb-count { font-family: monospace; font-weight: 800; color: var(--accent-deep); font-size: 1.1rem; margin-top: .35rem; }
.eb-x {
  border: none; background: transparent; font-size: 1.4rem; cursor: pointer;
  color: #888; padding: 0 .25rem; line-height: 1;
}
.eb-x:hover { color: var(--shame); }

.frozen-banner {
  background: linear-gradient(135deg, #fff5fb, #ffd9ec);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: .75rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(208, 70, 148, .25);
  border: 2px solid var(--accent);
}
.fb-title { font-size: .85rem; letter-spacing: .15em; color: var(--accent-deep); font-weight: 800; margin-bottom: .5rem; }
.fb-podium { display: flex; justify-content: center; align-items: end; gap: .5rem; }
.fb-place {
  background: white; border-radius: 12px; padding: .5rem .75rem;
  min-width: 80px; box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.fb-place-1 { transform: translateY(-8px); border: 3px solid #f5c84a; }
.fb-place-2 { border: 3px solid #c0c0c0; }
.fb-place-3 { border: 3px solid #cd7f32; }
.fb-medal { font-size: 1.8rem; }
.fb-name { font-weight: 800; font-size: .95rem; margin-top: .15rem; }
.fb-score { color: var(--accent-deep); font-weight: 800; font-size: .85rem; }
.fb-foot { font-size: .85rem; color: #666; font-style: italic; margin-top: .6rem; }

.shutdown-screen {
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2));
  border-radius: 20px; padding: 2rem 1.25rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
.shutdown-title {
  font-size: clamp(2rem, 7vw, 3rem); margin: 0 0 .5rem;
  color: var(--accent-deep); letter-spacing: .03em;
}
.shutdown-thanks { font-size: 1.2rem; line-height: 1.6; margin: 0 0 1.5rem; color: var(--ink); }
.shutdown-podium {
  display: flex; justify-content: center; align-items: end;
  gap: .75rem; margin: 1.5rem 0;
}
.shutdown-place {
  background: white; border-radius: 16px; padding: .75rem;
  min-width: 100px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.shutdown-place.place-1 { transform: translateY(-12px); border: 3px solid #f5c84a; }
.shutdown-place.place-2 { border: 3px solid #c0c0c0; }
.shutdown-place.place-3 { border: 3px solid #cd7f32; }
.shutdown-medal { font-size: 2.5rem; line-height: 1; }
.shutdown-name { font-weight: 800; font-size: 1.05rem; margin: .3rem 0 .1rem; }
.shutdown-score { color: var(--accent-deep); font-weight: 800; }
.shutdown-rest-h { font-size: .95rem; letter-spacing: .15em; text-transform: uppercase; color: var(--accent-deep); margin: 1.5rem 0 .5rem; }
.shutdown-rest { list-style: none; padding: 0; max-width: 400px; margin: 0 auto; }
.shutdown-rest li {
  display: flex; padding: .4rem .8rem; background: white;
  border-radius: 10px; margin-bottom: 4px; font-size: .95rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.shutdown-rest .r-name { flex: 1; font-weight: 700; }
.shutdown-rest .r-score { color: var(--accent-deep); font-weight: 800; }
.shutdown-foot { margin-top: 1.5rem; font-size: 1.1rem; color: var(--accent-deep); font-style: italic; }
.clickmeter.flash {
  animation: clickFlash .9s ease-out;
}
@keyframes clickFlash {
  0% { background: #fff8d2; box-shadow: 0 0 0 0 rgba(245,200,74,0); }
  50% { background: #fff8d2; box-shadow: 0 0 24px 8px rgba(245,200,74,.5); }
  100% { background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
}

.garden-card {
  background: var(--card); border-radius: 16px;
  padding: 1rem; box-shadow: 0 4px 12px rgba(0,0,0,.1);
  margin-bottom: .75rem;
}
.garden-card.you { border: 3px solid var(--accent); }
.garden-card.fenced { box-shadow: 0 0 0 4px #c084fc, 0 4px 12px rgba(0,0,0,.1); position: relative; }
.garden-card.fenced::before {
  content: "🛡";
  position: absolute; top: -10px; right: -10px;
  background: white; border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; box-shadow: 0 2px 6px rgba(0,0,0,.25);
  z-index: 3;
}
.other-card.fenced { box-shadow: 0 0 0 3px #c084fc, 0 2px 6px rgba(0,0,0,.06); position: relative; }
.other-card.fenced::before {
  content: "🛡";
  position: absolute; top: -8px; right: -8px;
  background: white; border-radius: 50%; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,.25);
  z-index: 3;
}

.garden-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; aspect-ratio: 4/2;
  background: var(--plot-dark); padding: 6px;
  border-radius: 12px;
}
.gcell {
  background: var(--plot);
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform .1s;
}
.gcell:hover { transform: scale(1.04); }
.gcell.empty { background: var(--soil); background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 4px, transparent 4px 8px); }
.gcell.growing { background: #e8e0a8; }
.gcell.bloomed { background: var(--plot); box-shadow: inset 0 0 0 3px var(--gold); }
.gcell.stomped::after {
  content: "👢";
  position: absolute; top: 2px; right: 2px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  z-index: 2;
}
.gcell.mini.stomped::after { font-size: .7rem; width: 14px; height: 14px; }
.gcell .variety-badge {
  position: absolute; top: 2px; left: 2px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  z-index: 2;
}
.gcell.mini .variety-badge { font-size: .7rem; width: 14px; height: 14px; }
.gcell .variety-badge.hidden { display: none; }
.gcell.mine { background: #2e2b3b !important; box-shadow: inset 0 0 0 3px #c84444; }
.gcell.mine .flower { filter: drop-shadow(0 0 6px #c84444); }
.gcell.mine .pct { background: rgba(255,255,255,.2); color: #ffe0e0; }
.gcell .flower { font-size: 3.2rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.gcell.mini .flower { font-size: 1.7rem; }
.gcell .pct { font-size: .85rem; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.75); padding: 2px 6px; border-radius: 6px; margin-top: 4px; }
.gcell.mini .pct { display: none; }
.gcell .bloom-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #ff7eb6, #f5c84a, #5cc26b);
  transform-origin: left;
}

.others {
  display: grid; gap: .5rem;
}
.other-card {
  background: var(--card); border-radius: 12px;
  padding: .6rem .75rem; box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.other-card .name-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: 1.1rem; }
.other-card .name { font-weight: 800; flex: 1; font-size: 1.15rem; }
.rap-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #f7f3e8; border: 1px solid rgba(0,0,0,.1);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  color: #555;
  cursor: pointer;
  transition: background .15s;
}
.rap-btn:hover { background: #ffe8d0; }
.rap-btn .shame { color: var(--shame); }
.other-card .garden-grid { aspect-ratio: 4/2; gap: 3px; padding: 3px; border-radius: 8px; }
.other-card .gcell { border-radius: 5px; }

.glog {
  background: rgba(255,255,255,.7); border-radius: 12px;
  padding: .65rem .9rem; max-height: 220px; overflow-y: auto;
  font-size: 1.05rem; line-height: 1.5;
}
.glog .entry { padding: .15rem 0; border-bottom: 1px dashed rgba(0,0,0,.06); }
.glog .entry:last-child { border-bottom: none; }
.glog .actor { font-weight: 700; color: var(--accent-deep); }
.glog .delta-pos { color: #4a9d4a; font-weight: 700; }
.glog .delta-shame { color: var(--shame); font-weight: 700; }

.gmodal-back {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.gmodal-back.hidden { display: none; }
.gmodal {
  background: var(--card); border-radius: 16px;
  padding: 1.25rem; max-width: 380px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  text-align: center;
}
.gmodal h3 { margin: 0 0 .5rem; font-size: 1.4rem; font-family: inherit; }
.gmodal .info { color: #666; font-size: 1.05rem; margin-bottom: 1rem; }
.gmodal .btn-group { display: flex; flex-direction: column; gap: .5rem; }
.gmodal .btn-group .gbtn { width: 100%; padding: .75rem; }
.gmodal .seed-pick { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin: .5rem 0 1rem; }
.gmodal .seed-btn {
  font-size: 2.4rem; background: #f7f3e8; border: 2px solid transparent;
  border-radius: 14px; padding: .6rem .9rem; cursor: pointer;
}
.gmodal .seed-btn:hover { border-color: var(--accent); }
.gmodal .seed-btn:disabled { opacity: .3; cursor: not-allowed; }
.gmodal .close { background: #ddd; color: #333; margin-top: 1rem; }
.rap-list { text-align: left; max-height: 280px; overflow-y: auto; margin: .5rem 0 1rem; }
.rap-entry {
  padding: .4rem .6rem; border-radius: 8px; margin-bottom: .3rem;
  font-size: .95rem; display: flex; align-items: center; gap: .4rem;
}
.rap-entry.pinch { background: #fff0d8; }
.rap-entry.stomp { background: #ffe0e0; }
.rap-time { margin-left: auto; font-size: .8rem; color: #888; font-weight: 700; }

.bouquet-line { font-size: .85rem; flex-direction: column; align-items: stretch !important; gap: .4rem !important; }
.score-breakdown { font-size: 1.1rem; }
.score-breakdown strong { font-size: 1.4rem; color: var(--accent-deep); }
.score-breakdown .bonus { color: #4a9d4a; font-weight: 800; }
.score-breakdown .pinch-pts { color: var(--shame); font-weight: 800; }
.harvest-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Toast notifications — pop up from bottom on new log entries */
.gtoasts {
  position: fixed;
  left: 50%; bottom: 1rem;
  transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: .35rem;
  z-index: 50; pointer-events: none;
  width: min(94vw, 480px);
}
.gtoast {
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(208,70,148,.25);
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  border-radius: 12px;
  padding: .55rem .8rem;
  font-size: .95rem; line-height: 1.25;
  opacity: 0; transform: translateY(20px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: auto;
  word-wrap: break-word;
}
.gtoast.show { opacity: 1; transform: translateY(0); }
.gtoast.hide { opacity: 0; transform: translateY(10px); }
.gtoast .actor { font-weight: 700; color: var(--accent-deep); }
.gtoast .delta-pos { color: #2e8a2e; font-weight: 700; }
.gtoast .delta-shame { color: var(--shame); font-weight: 700; }
