:root {
  --ink: #f2eefb;
  --ink-dim: #b6aed0;
  --bg: #14102a;
  --bg-2: #1d1740;
  --accent: #f3c98b;
  --accent-ink: #241a10;
  --line: rgba(242, 238, 251, 0.14);
  --warn: #ffb4a2;
  --radius: 18px;
}

* { box-sizing: border-box; }

/* .primary sets a display value, which would otherwise beat [hidden]. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 80% at 50% 0%, #2a2060 0%, var(--bg) 60%);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem 3rem;
  position: relative;
}

/* Artwork sets the mood; the scrim above it keeps every word readable. */
#artwork {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
  z-index: -2;
}
#artwork.has-image { opacity: 0.5; }

#artwork.has-image::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(80% 55% at 50% 38%, rgba(20, 16, 42, 0.35) 0%, rgba(20, 16, 42, 0.82) 100%),
    linear-gradient(180deg, rgba(20, 16, 42, 0.78) 0%, rgba(20, 16, 42, 0.55) 35%, rgba(20, 16, 42, 0.9) 100%);
}

.head { text-align: center; margin: 2rem 0 1.5rem; }
.eyebrow {
  margin: 0 0 .4rem;
  font-size: .8rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-shadow: 0 2px 20px rgba(10, 8, 24, 0.7);
}
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .75rem; }

.card {
  background: rgba(29, 23, 64, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(14px);
}
.centred { text-align: center; margin-top: 20vh; }

label { display: block; font-size: .85rem; color: var(--ink-dim); margin-bottom: .35rem; }

input[type="text"] {
  width: 100%;
  padding: .8rem .9rem;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(0,0,0,.28);
  border: 1px solid var(--line);
  border-radius: 12px;
}
input[type="text"]:focus-visible,
button:focus-visible,
a:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button, .primary {
  font: inherit;
  border: 0;
  border-radius: 999px;
  padding: .85rem 1.6rem;
  cursor: pointer;
  min-height: 48px;
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}
.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
#join-form .primary { width: 100%; margin-top: 1rem; }

.stage {
  text-align: center;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.5rem 0 .5rem;
}
.counter-label { text-align: center; margin: 0; color: var(--ink-dim); font-size: .85rem; }
.counter {
  text-align: center;
  text-shadow: 0 2px 24px rgba(10, 8, 24, 0.75);
  margin: .2rem 0 2rem;
  font-size: 3rem;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  letter-spacing: -.02em;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: stretch;
}
.volume { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.volume span { font-size: .85rem; color: var(--ink-dim); }
.volume input {
  flex: 1;
  accent-color: var(--accent);
  height: 2rem;
}

.hint { color: var(--ink-dim); font-size: .85rem; }
.error, .warn { color: var(--warn); font-size: .9rem; }
.note { font-size: .9rem; color: var(--ink-dim); }

.presence { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.presence ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.presence li {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: .25rem .75rem .25rem .25rem;
  font-size: .9rem;
}
.initials {
  width: 1.65rem; height: 1.65rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(243,201,139,.22);
  font-size: .7rem; font-weight: 600;
}

.diag {
  margin-top: 2rem;
  text-align: center;
  font-size: .72rem;
  color: rgba(182,174,208,.5);
  font-variant-numeric: tabular-nums;
}

/* Status is never conveyed by colour alone — every state also has a label. */
body[data-stage="ended"] .counter,
body[data-stage="cancelled"] .counter { display: none; }

@media (prefers-reduced-motion: reduce) {
  #artwork { transition: none; }
}
