/* Shared by the landing page, the phones and the synth station. Same dark
   stage as Theremax; each player's instrument color tints their screen. */
:root {
  --bg: #0d0b10;
  --panel: #17141c;
  --line: #2c2734;
  --text: #ece6dc;
  --muted: #8d8496;
  --warm: #ff8a3d;
  --cool: #5fd4c4;
  --accent: var(--cool);
  --danger: #f25f7a;
  --display: "Futura", "Avenir Next", "Century Gothic", "Trebuchet MS", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

body {
  background: radial-gradient(ellipse at 50% -10%, #241c2e 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--display);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}

h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 7vw, 3.4rem);
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  background: linear-gradient(90deg, var(--warm), var(--cool));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}

.sub { margin: 4px 0 0; color: var(--muted); letter-spacing: 0.14em; text-transform: lowercase; text-align: center; }

a { color: var(--accent); }

button, select, input {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0b10;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 14px 22px;
  font-size: 1.05rem;
}

.fine { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.status { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.status.error { color: var(--danger); }

/* ---------- landing ---------- */

.landing { max-width: 560px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.landing ol { text-align: left; line-height: 1.6; padding-left: 1.2em; }

/* ---------- phone ---------- */

.phone { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.badge {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}
.badge .inst { font-size: 1.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.badge .meta { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); text-align: right; }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 58dvh;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.stage video, .stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: scaleX(-1); /* mirror, so your left is on the left */
}
.stage video { object-fit: cover; filter: saturate(0.6) brightness(0.75); }

.now {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: end;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-family: var(--mono);
}
.now .note { font-size: 2.4rem; color: var(--accent); transition: opacity 0.1s; }
.now .note.off { opacity: 0.25; }
.now .chord { color: var(--muted); font-size: 0.9rem; }

.splash {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 20px; text-align: center;
  background: rgba(13, 11, 16, 0.92);
}
.splash p { margin: 0; line-height: 1.5; }

.gestures { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 0.9rem; }
.gestures dt { color: var(--accent); }
.gestures dd { margin: 0; color: var(--muted); }

.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; height: 64px; }
.bar { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); opacity: 0.8; }
.bar span { position: absolute; left: 0; right: 0; top: 2px; text-align: center; font-family: var(--mono); font-size: 0.6rem; color: var(--text); mix-blend-mode: difference; }

.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- synth station ---------- */

.station { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.station header { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.station h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); text-align: left; }

.join { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.join img { width: 112px; height: 112px; background: #fff; border-radius: 8px; padding: 4px; }
.join .url { font-family: var(--mono); font-size: 1rem; word-break: break-all; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.settings { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.settings input[type="number"] { width: 6em; }
.settings input[type="text"] { width: 11em; }
.settings .check { flex-direction: row; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--text); }

.chordbar { display: flex; gap: 6px; align-items: center; font-family: var(--mono); }
.chordbar .chord { font-size: 1.6rem; min-width: 3.5em; }
.chordbar .step { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.chordbar .step.on { background: var(--accent); }

.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.group {
  --c: var(--accent);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  background: var(--panel);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.group.sounding { border-color: var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 40%, transparent); }
.group .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.group .name { color: var(--c); text-transform: uppercase; letter-spacing: 0.1em; font-size: 1.1rem; }
.group .ch { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.group .controls { display: flex; gap: 6px; }
.group .controls select { padding: 4px 8px; font-size: 0.85rem; }
.group .link { display: flex; gap: 10px; align-items: center; }
.group .link img { width: 72px; height: 72px; background: #fff; border-radius: 6px; padding: 3px; }
.group .link a { font-family: var(--mono); font-size: 0.8rem; word-break: break-all; }
.group .notes { font-family: var(--mono); font-size: 1.3rem; min-height: 1.4em; }
.group .members { display: flex; flex-direction: column; gap: 4px; }
.group .members:empty::before { content: "no players yet"; color: var(--muted); font-size: 0.85rem; }
.member { display: grid; grid-template-columns: 3.2em 1fr 3.5em 3.5em auto; gap: 8px; align-items: center; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.member.gone { opacity: 0.4; }
.member.sounding .num { color: var(--c); }
.member canvas { width: 100%; height: 22px; display: block; }
.member button { padding: 2px 8px; font-size: 0.75rem; }

.log { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); height: 4.5em; overflow: hidden; white-space: pre; }
