@font-face { font-family: 'Hum Serif'; src: url(serif.woff2) format('woff2'); font-style: italic; font-display: swap; }
@font-face { font-family: 'Hum Sans'; src: url(sans.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #eef0ff; --dim: #a7acd6; --faint: #6e7299;
  --night: #0b0d1f; --glass: rgba(20, 22, 48, .72); --line: rgba(190, 196, 255, .16);
  --gold: #ffd98a; --accent: #ffcf70;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ink); overflow: hidden;
  font: 16px/1.5 'Hum Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
canvas#sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; cursor: default; }
body.planting canvas#sky { cursor: crosshair; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* top */
.top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(14px + var(--safe-t)) 18px 0; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand h1 { margin: 0; font: italic 400 44px/1 'Hum Serif', Georgia, serif; letter-spacing: .5px; }
.brand p { margin: 4px 0 0; color: var(--dim); font-size: 13.5px; letter-spacing: .2px; }
.tools { display: flex; gap: 8px; }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; cursor: pointer; font-size: 19px; padding: 0; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon svg path:first-child { fill: currentColor; stroke: none; }
#sound .wave { display: none; } #sound[aria-pressed="true"] .wave { display: inline; } #sound[aria-pressed="true"] .x { display: none; }

.pill { position: fixed; left: 50%; top: calc(86px + var(--safe-t)); transform: translateX(-50%); border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 99px; padding: 8px 16px; font-size: 14px; cursor: pointer;
  animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }

/* bottom */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 16px calc(18px + var(--safe-b)); pointer-events: none; }
.bottom > * { pointer-events: auto; }
.main { border: 0; border-radius: 99px; padding: 14px 26px; min-height: 52px; background: var(--accent); color: #241a05; font-weight: 650;
  font-size: 16.5px; cursor: pointer; box-shadow: 0 6px 30px rgba(255, 207, 112, .28); transition: transform .15s, opacity .2s; }
.main:hover:not(:disabled) { transform: translateY(-1px); }
.main:disabled { background: var(--glass); color: var(--dim); box-shadow: none; border: 1px solid var(--line); cursor: default; font-weight: 500; }
.ghost { border: 1px solid var(--line); border-radius: 99px; padding: 12px 20px; min-height: 48px; background: rgba(255,255,255,.04); cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,.09); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.plantbar { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line);
  border-radius: 20px; padding: 12px 14px; text-align: center; max-width: 440px; }
.plantbar p { margin: 0 0 10px; }
body.planting #plantBtn { display: none; }

/* the card that shows when you tap a plant */
.card { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); width: min(360px, calc(100% - 32px));
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 12px; }
.card h3 { margin: 0; font: italic 400 26px/1.1 'Hum Serif', Georgia, serif; display: flex; align-items: center; gap: 10px; }
.card .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.card p { margin: 6px 0 0; color: var(--dim); font-size: 14px; }
.card .yours { color: var(--gold); }
.card .x { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; background: none; color: var(--dim); font-size: 22px; cursor: pointer; }

.toast { position: fixed; left: 50%; top: calc(86px + var(--safe-t)); transform: translateX(-50%); max-width: calc(100% - 32px);
  background: #1d2050; border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; font-size: 14.5px; text-align: center; z-index: 5; }

/* dialogs */
.veil { position: fixed; inset: 0; background: rgba(5, 6, 18, .55); display: grid; place-items: center; padding: 16px; z-index: 10;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: #12143a; border: 1px solid var(--line);
  border-radius: 24px; padding: 24px 22px 20px; box-shadow: 0 20px 80px rgba(0,0,0,.5); }
.sheet h2 { margin: 0 0 6px; font: italic 400 40px/1 'Hum Serif', Georgia, serif; }
.sheet h3 { margin: 22px 0 6px; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.sheet p, .sheet li { color: #cfd2f2; }
.sheet .lede { font: italic 400 23px/1.3 'Hum Serif', Georgia, serif; color: var(--ink); margin: 0 0 14px; }
.sheet ul { padding-left: 20px; margin: 0; } .sheet li { margin: 0 0 8px; }
.sheet .row { margin-top: 18px; }
.fine { font-size: 13px; color: var(--faint) !important; margin: 14px 0 0; text-align: center; }
.info .fine { text-align: left; }
.close { position: absolute; top: 14px; right: 14px; background: transparent; }
.intro { text-align: center; } .intro h2 { font-size: 64px; }

.seedlist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.seed { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); padding: 6px 6px 10px; cursor: pointer; text-align: center; }
.seed canvas { width: 100%; aspect-ratio: 1; display: block; }
.seed b { display: block; font: italic 400 19px/1.1 'Hum Serif', Georgia, serif; }
.seed span { font-size: 12.5px; color: var(--dim); }
.seed[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 217, 138, .1); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stats div { background: rgba(255,255,255,.04); border-radius: 12px; padding: 8px 10px; }
.stats b { display: block; font-size: 20px; } .stats span { font-size: 12px; color: var(--dim); }
.log { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; }
.log li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.log time { display: block; font-size: 12px; color: var(--faint); }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }

@media (max-width: 420px) {
  .brand h1 { font-size: 38px; }
  .seedlist { gap: 6px; } .seed b { font-size: 16px; }
  .stats b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .pill { animation: none; } }
