.picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  align-items: center;
  width: 100%;
}

/* --- The stage ---------------------------------------------------------- */

.picker-stage {
  display: grid;
  place-items: center;
  min-height: clamp(7rem, 20vw, 12rem);
  width: 100%;
}

.picker-name {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  /* Sized for the back of the room. */
  font-size: clamp(2.5rem, 11vw, 7rem);
  color: var(--hue, var(--c-ink));
}

/* While the spotlight runs, the name is a blur of candidates: dimmed and
   slightly shrunk, so the landing reads as an arrival rather than a change. */
.is-spinning .picker-name {
  opacity: 0.55;
  transform: scale(0.94);
}

.picker-name.is-winner {
  animation: winner-land 520ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

@keyframes winner-land {
  0% {
    opacity: 0.6;
    transform: scale(0.9);
  }
  55% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.picker-hint {
  margin: 0;
  color: var(--c-ink-muted);
  text-align: center;
}

.picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

/* --- The list, as text --------------------------------------------------
   The textarea IS the list: one name per line, editable like any other text.
   Paste a roster in from wherever it already lives and it just works. */

.picker-names {
  width: 100%;
  max-width: 26rem;
}

.picker-names textarea {
  font: inherit;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  width: 100%;
  resize: vertical;
  min-height: 8rem;
}

.picker-names textarea:disabled {
  background: #f3f3f3;
  color: var(--c-ink-muted);
}

/* --- The list ----------------------------------------------------------- */

.picker-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
  border-top: 1px solid var(--c-line);
  padding-top: var(--space-4);
}

.picker-list-title {
  margin: 0;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-muted);
}

.picker-list-title .count {
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Each person carries one hue of the palette. The tint is a background, so the
   name on top is ink — the colour identifies, it never has to be read.
   The chips are a read-only legend now; the textarea above is the editor. */
.person-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  min-height: 36px;
  border-radius: 999px;
  background: var(--hue-tint);
  color: var(--c-ink);
  border: 2px solid transparent;
  font-weight: 600;
  transition: transform 120ms ease, border-color 120ms ease;
}

/* The spotlight, as it passes over a name. */
.person-chip.is-lit {
  border-color: var(--hue);
  transform: scale(1.08);
}

/* The winner flips to the solid hue with a white label — the palette guarantees
   that pairing clears AA, so the highlight is readable, not just coloured. */
.person-chip.is-winner {
  background: var(--hue);
  color: var(--c-ink-inverse);
  border-color: var(--hue);
  box-shadow: 0 0 0 3px var(--hue-tint);
  transform: scale(1.06);
  animation: chip-won 420ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

@keyframes chip-won {
  from {
    transform: scale(1);
  }
  60% {
    transform: scale(1.16);
  }
  to {
    transform: scale(1.06);
  }
}

.chips.is-struck .person-chip {
  background: transparent;
  border-color: var(--c-line);
  color: var(--c-ink-muted);
  text-decoration: line-through;
  font-weight: 400;
}

/* --- Fullscreen: the room sees the name, nothing else -------------------- */

.toy.is-fullscreen .picker {
  justify-content: center;
  height: 100%;
}

.toy.is-fullscreen .picker-names,
.toy.is-fullscreen .picker-list {
  opacity: 0;
  transition: opacity 200ms ease;
}

.toy.is-fullscreen .picker-names:focus-within,
.toy.is-fullscreen .picker-list:focus-within,
.toy.is-fullscreen:hover .picker-names,
.toy.is-fullscreen:hover .picker-list {
  opacity: 1;
}
