:root {
  --bg0: #061210;
  --bg1: #0a1f1c;
  --emerald: #34d399;
  --emerald-deep: #059669;
  --pink: #f472b6;
  --violet: #c084fc;
  --moon: #a5f3fc;
  --text: #f5fff8;
  --muted: #9db8ae;
  --line: rgba(52, 211, 153, 0.35);
  --glass: rgba(8, 32, 28, 0.78);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: "Quicksand", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body {
  background:
    radial-gradient(100% 70% at 15% -5%, rgba(244, 114, 182, 0.28), transparent 50%),
    radial-gradient(90% 60% at 95% 10%, rgba(192, 132, 252, 0.22), transparent 48%),
    radial-gradient(80% 50% at 50% 100%, rgba(52, 211, 153, 0.18), transparent 55%),
    linear-gradient(165deg, #061210, #0c221e 45%, #071814);
  background-attachment: fixed;
}

#grove {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(10px + var(--safe-t)) 14px calc(128px + var(--safe-b));
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.55));
}
.brand em {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-style: normal;
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(90deg, #34d399, #a5f3fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand strong {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.nectar-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.2);
}
.nectar-pill img { width: 28px; height: 28px; object-fit: contain; }
.nectar-pill b { font-family: "Cormorant Garamond", serif; font-size: 1.2rem; }

.pane { animation: rise 0.28s ease; }
.pane.off { display: none; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--moon);
  font-weight: 700;
}
h1 {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 1.85rem;
  line-height: 1.1;
}
.lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.bloom-rail {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.bloom-rail img { width: 36px; height: 36px; object-fit: contain; }
.bloom-track {
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--line);
}
.bloom-track > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--emerald-deep), var(--violet), var(--pink));
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.5);
  transition: width 0.35s ease;
}
#bloomLabel { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.machine {
  position: relative;
  padding: 12px 8px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.16), rgba(192, 132, 252, 0.12), rgba(244, 114, 182, 0.1));
  border: 1px solid rgba(165, 243, 252, 0.35);
  box-shadow: 0 0 28px rgba(52, 211, 153, 0.18), inset 0 0 24px rgba(6, 18, 16, 0.45);
  margin-bottom: 10px;
}
.reels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  height: 168px;
  overflow: hidden;
}
.track {
  position: relative;
  border-radius: 14px;
  background: rgba(4, 14, 12, 0.85);
  border: 1px solid rgba(52, 211, 153, 0.25);
  overflow: hidden;
}
.track.landed { box-shadow: 0 0 14px rgba(244, 114, 182, 0.45); }
.reel-window { height: 100%; overflow: hidden; }
.reel-strip { will-change: transform; }
.cell {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.cell img { width: 44px; height: 44px; object-fit: contain; }
.cell.mid { background: rgba(52, 211, 153, 0.08); }
.cell.hit {
  background: rgba(244, 114, 182, 0.22);
  box-shadow: inset 0 0 12px rgba(192, 132, 252, 0.45);
}
.payline {
  pointer-events: none;
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(244, 114, 182, 0.65), transparent);
}

.win-line {
  min-height: 1.4em;
  margin: 0 0 12px;
  text-align: center;
  color: var(--pink);
  font-weight: 600;
  font-size: 0.9rem;
}

.controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px 1.2fr 0.9fr;
  gap: 8px;
  align-items: center;
}
.chip, .spin-btn, .auto-btn, .dew-btn, .ghost, .capsule {
  font: inherit;
  cursor: pointer;
  border-radius: 14px;
}
.chip {
  height: 44px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
}
.bet-box {
  text-align: center;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass);
}
.bet-box small { display: block; color: var(--muted); font-size: 0.68rem; }
.bet-box b { font-family: "Cormorant Garamond", serif; font-size: 1.25rem; }
.spin-btn {
  border: 0;
  height: 48px;
  color: #042f2e;
  font-weight: 700;
  background: linear-gradient(120deg, #34d399, #a5f3fc, #f472b6);
  background-size: 180% 180%;
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.45);
  animation: sheen 5s ease infinite;
}
.spin-btn:disabled, .auto-btn:disabled { opacity: 0.5; cursor: default; }
.auto-btn {
  height: 48px;
  border: 1px solid rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.12);
  color: var(--text);
  font-weight: 700;
}
.auto-btn.on {
  background: linear-gradient(120deg, rgba(192, 132, 252, 0.45), rgba(244, 114, 182, 0.4));
  box-shadow: 0 0 16px rgba(244, 114, 182, 0.4);
}
@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.capsules {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.capsule {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: inherit;
  text-align: left;
}
.capsule img {
  grid-row: span 2;
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.capsule span { font-weight: 700; font-size: 1.05rem; }
.capsule small { color: var(--muted); }
.capsule.moon { border-color: rgba(165, 243, 252, 0.45); }
.capsule.verdant { border-color: rgba(52, 211, 153, 0.5); }
.capsule.aurora { border-color: rgba(244, 114, 182, 0.5); }
.capsule:disabled { opacity: 0.45; }
.hint { color: var(--muted); font-size: 0.85rem; }

.hero-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.hero-card img { width: 64px; height: 64px; object-fit: contain; }
.hero-card small { color: var(--muted); font-size: 0.75rem; }
.hero-card b {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  margin: 2px 0;
}
.hero-card span { color: var(--muted); font-size: 0.85rem; }

.seed-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.seed-chip {
  text-align: center;
  padding: 12px 8px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.seed-chip img { width: 40px; height: 40px; object-fit: contain; }
.seed-chip b { display: block; margin-top: 4px; }
.seed-chip small { color: var(--muted); font-size: 0.72rem; }

.rules {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.dew-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 0;
  margin-bottom: 16px;
  color: #042f2e;
  font-weight: 700;
  background: linear-gradient(120deg, #a5f3fc, #34d399, #c084fc);
  box-shadow: 0 0 20px rgba(165, 243, 252, 0.35);
}
.dew-btn img { width: 36px; height: 36px; object-fit: contain; }
.dew-btn:disabled { opacity: 0.5; }

.list { display: flex; flex-direction: column; gap: 8px; }
.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.card .meta { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; }
.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  padding: 14px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.stat small { color: var(--muted); font-size: 0.72rem; }
.stat b {
  display: block;
  margin-top: 4px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.25rem;
}

.info-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.info-card img { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.info-card p { margin: 0 0 6px; font-size: 0.88rem; color: var(--muted); }
.info-card strong { color: var(--text); }
.warn {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(244, 114, 182, 0.4);
  background: rgba(244, 114, 182, 0.08);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}
.warn p { margin: 0 0 8px; }
.warn p:last-child { margin: 0; }

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.ghost {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.ghost.danger {
  border-color: rgba(244, 114, 182, 0.5);
  color: var(--pink);
}

/* Unique Petal Compass nav */
.petal-compass {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(10px + var(--safe-b));
  transform: translateX(-50%);
  width: 210px;
  height: 210px;
  pointer-events: none;
}
.petal, .petal-core {
  pointer-events: auto;
  position: absolute;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: radial-gradient(circle at 35% 30%, rgba(52, 211, 153, 0.35), rgba(8, 24, 22, 0.92));
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.25);
  padding: 8px;
  cursor: pointer;
}
.petal {
  width: 52px;
  height: 52px;
  border-radius: 18px 22px 16px 20px / 22px 18px 20px 16px;
}
.petal img, .petal-core img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.petal.active, .petal-core.active {
  border-color: rgba(244, 114, 182, 0.7);
  box-shadow: 0 0 18px rgba(244, 114, 182, 0.55);
  background: radial-gradient(circle at 35% 30%, rgba(244, 114, 182, 0.4), rgba(12, 28, 24, 0.95));
}
.petal-core {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-color: rgba(165, 243, 252, 0.5);
}
.petal.p1 { left: 50%; top: 4px; transform: translateX(-50%); }
.petal.p2 { right: 8px; top: 28%; }
.petal.p3 { right: 18px; bottom: 18%; }
.petal.p4 { left: 50%; bottom: 4px; transform: translateX(-50%); }
.petal.p5 { left: 8px; bottom: 18%; }
.petal.p6 { left: 8px; top: 28%; }

@media (max-width: 380px) {
  .reels { height: 150px; }
  .cell { height: 50px; }
  .cell img { width: 38px; height: 38px; }
  .petal-compass { width: 190px; height: 190px; }
  .petal { width: 46px; height: 46px; }
}
