/*
 * Cloud Chorus — shared look.
 * After-dusk indigo. The colour comes from the music: every note blooms in the
 * hue of its pitch class, so the page itself is the only decoration.
 */
:root {
  --hue: 247;
  --bg: hsl(30 5% 14%);        /* very slightly warm grey; notes glow on top of it */
  --bg-raised: hsl(30 5% 19%);
  --ink: #e9e6f2;
  --mute: #9a96b8;
  --line: rgba(233, 230, 242, 0.16);
  --accent: hsl(262 70% 70%);
  --font: "Montserrat", "Avenir Next", "Avenir", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  transition: background-color 2.5s ease;
  color: var(--ink);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

button { font: inherit; color: inherit; }

/* ---- join and play pages ------------------------------------------------ */

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 34rem;
  padding: max(1.75rem, env(safe-area-inset-top)) 1.75rem max(1.75rem, env(safe-area-inset-bottom));
  pointer-events: none; /* let the picture show through; controls opt back in */
}
.panel > * { pointer-events: auto; }

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 13vw, 5.2rem);
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.perf {
  margin: 0.7rem 0 0;
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--mute);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.perf:empty { display: none; }

.lede {
  margin: 1.25rem 0 0;
  max-width: 24rem;
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--ink);
}

.status-block { min-height: 3.2rem; color: var(--mute); font-size: 0.95rem; }
.status-block p { margin: 0; }
#status { color: var(--ink); }
.status-block { text-shadow: 0 0 10px rgba(0, 0, 0, 0.55); }

.controls { display: flex; flex-direction: column; gap: 0.9rem; }

.go, .leave {
  appearance: none;
  min-height: 3.4rem;
  padding: 0 1.75rem;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
}
.go { border: 0; background: var(--ink); color: var(--bg); }
.go:disabled { opacity: 0.55; cursor: default; }
.leave { border: 1px solid var(--line); background: transparent; color: var(--ink); }

.fineprint { margin: 0; font-size: 0.875rem; color: var(--mute); max-width: 26rem; }
.error { margin: 0; min-height: 1.3em; font-size: 0.95rem; color: hsl(8 85% 72%); }

/* Before joining: intro and button. After joining: status and leave. */
.live-only { display: none; }
body.live .live-only { display: block; }
body.live .pre-only { display: none; }
body.live .controls .go { display: none; }
body.live .controls .leave { display: inline-flex; }
.controls .leave { display: none; align-items: center; justify-content: center; }

/* Play page: once running, almost everything steps back. */
body.live[data-mode="play"] h1 { font-size: 1.1rem; font-weight: 400; letter-spacing: 0; }
body.live[data-mode="play"] .status-block { opacity: 0.55; }

@media (min-width: 52rem) {
  .panel { padding-left: 4rem; }
}

/* Doors: when no session is on, the join button is replaced by a waiting note. */
.intro { max-width: 24rem; margin-top: 1rem; font-size: 0.95rem; line-height: 1.5; color: var(--mute); }
.intro p { margin: 0 0 0.6rem; }
.intro ol { margin: 0; padding-left: 1.2rem; }
.intro li { margin-bottom: 0.2rem; }
.intro b { color: var(--ink); font-weight: 600; }
.closed-note { display: none; margin: 0 0 1rem; opacity: 0.85; line-height: 1.5; }
body[data-doors="closed"]:not(.live) .closed-note { display: block; }
body[data-doors="closed"]:not(.live) #go,
body[data-doors="closed"]:not(.live) .pre-only.fineprint { display: none; }



/* The thank-you page: shown on devices when the performance has ended and the doors are closed. */
.thanks { display: none; max-width: 24rem; margin: 0 0 1.2rem; }
.thanks h2 { margin: 0 0 0.5rem; font-size: 1.6rem; font-weight: 500; }
.thanks p { margin: 0; line-height: 1.55; color: var(--ink); }
body[data-ended="true"] .thanks { display: block; }
body[data-ended="true"] .status-block,
body[data-ended="true"] .intro,
body[data-ended="true"] .closed-note,
body[data-ended="true"] .lede,
body[data-ended="true"] #go,
body[data-ended="true"] .pre-only.fineprint { display: none; }
body[data-ended="true"][data-doors="open"] .thanks { display: none; }
