:root {
  --ink: #eaf2e6;
  --muted: #8fa89a;
  --accent: #ffd66b;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #05070c; color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
canvas#meadow { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* ---- heads-up display ---- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: clamp(14px, 3vw, 30px); gap: 20px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4,7,14,.7), rgba(4,7,14,0));
}
.title h1 {
  margin: 0; font-size: clamp(26px, 4vw, 40px); font-weight: 800;
  letter-spacing: .04em;
  background: linear-gradient(90deg, #ffe9a6, #a6ff7a 55%, #6be3ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(166,255,122,.25);
}
.title p { margin: 4px 0 0; color: var(--muted); font-size: clamp(12px, 1.6vw, 15px); }

.meters { display: flex; gap: clamp(12px, 2.4vw, 28px); text-align: right; }
.meter { display: flex; flex-direction: column; align-items: flex-end; }
.meter .n {
  font-size: clamp(18px, 2.4vw, 26px); font-weight: 700; font-variant-numeric: tabular-nums;
  color: #eafff0; text-shadow: 0 0 16px rgba(150,255,180,.35);
}
.meter .l { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.sound {
  pointer-events: auto; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(10,18,20,.5); border: 1px solid rgba(150,220,170,.16);
  border-radius: 12px; padding: 6px 12px 5px; color: var(--ink);
  font: inherit; font-size: 17px; line-height: 1.2;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sound .l { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sound:hover { border-color: rgba(150,220,170,.4); }
.sound[aria-pressed="true"] {
  border-color: rgba(182,255,106,.55);
  box-shadow: 0 0 18px -4px rgba(150,255,150,.5);
}

/* ---- compose ---- */
.compose {
  position: fixed; left: 50%; bottom: clamp(18px, 4vh, 40px); transform: translateX(-50%);
  z-index: 6; display: flex; align-items: center; gap: 8px;
  width: min(560px, 92vw);
  background: rgba(10, 18, 20, .72); backdrop-filter: blur(10px);
  border: 1px solid rgba(150, 220, 170, .18); border-radius: 999px;
  padding: 7px 8px 7px 20px;
  box-shadow: 0 20px 60px -24px #000, 0 0 40px -10px rgba(120,220,150,.15);
}
.compose input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--ink); font-size: 15px; min-width: 0;
}
.compose input::placeholder { color: #6d8377; }
.count { color: #5f7669; font-size: 12px; font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }
.compose button {
  flex: none; cursor: pointer; border: 0; border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 700; color: #06210f;
  background: linear-gradient(180deg, #b8ff9a, #6fe08a);
  box-shadow: 0 6px 18px -6px rgba(120,240,150,.7);
  transition: transform .12s ease, filter .12s ease;
}
.compose button:hover { transform: translateY(-1px); filter: brightness(1.06); }
.compose button:disabled { opacity: .5; cursor: default; transform: none; filter: grayscale(.4); }
.compose .note {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  margin: 0; white-space: nowrap; font-size: 12.5px; color: var(--accent);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.compose .note.show { opacity: 1; }

/* ---- firefly tooltip ---- */
.tip {
  position: fixed; z-index: 7; pointer-events: none;
  transform: translate(-50%, -140%);
  max-width: 260px; padding: 9px 13px; border-radius: 12px;
  background: rgba(8, 14, 12, .94); border: 1px solid rgba(150,220,170,.22);
  box-shadow: 0 16px 40px -18px #000;
  font-size: 13.5px; line-height: 1.35;
}
.tip .who { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.tip.silent { color: var(--muted); font-style: italic; }

/* ---- intro overlay ---- */
.intro {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(3, 6, 10, .55); backdrop-filter: blur(3px);
  transition: opacity .5s ease;
}
.intro.gone { opacity: 0; pointer-events: none; }
.intro .card {
  width: min(460px, 90vw); padding: 28px 30px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(16,26,22,.96), rgba(9,15,13,.96));
  border: 1px solid rgba(150,220,170,.2);
  box-shadow: 0 40px 90px -40px #000;
}
.intro h2 { margin: 0 0 10px; font-size: 22px; }
.intro p { margin: 0 0 14px; color: #c8d8cd; font-size: 14.5px; line-height: 1.5; }
.intro ul { margin: 0 0 20px; padding: 0; list-style: none; color: #c8d8cd; font-size: 14px; }
.intro li { padding: 5px 0; }
.intro button {
  cursor: pointer; border: 0; border-radius: 999px; padding: 11px 24px;
  font-size: 15px; font-weight: 700; color: #06210f;
  background: linear-gradient(180deg, #ffe9a6, #ffce5a);
  box-shadow: 0 8px 22px -8px rgba(255,206,90,.7);
}

@media (max-width: 560px) {
  .hud { flex-direction: column; gap: 10px; }
  .meters { align-self: flex-start; text-align: left; }
  .meter { align-items: flex-start; }
}
