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

.grp-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  justify-content: center;
  min-height: clamp(8rem, 20vw, 12rem);
}

.grp-meta {
  margin: 0;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--c-ink-muted);
}

.group-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-4);
}

.grp-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--hue-tint);
  color: var(--c-ink);
  border-top: 4px solid var(--hue);
  animation: grp-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* The groups land one after another — with a room watching, the reveal is
   half the point. */
.grp-card:nth-child(1) {
  animation-delay: 0ms;
}
.grp-card:nth-child(2) {
  animation-delay: 60ms;
}
.grp-card:nth-child(3) {
  animation-delay: 120ms;
}
.grp-card:nth-child(4) {
  animation-delay: 180ms;
}
.grp-card:nth-child(5) {
  animation-delay: 240ms;
}
.grp-card:nth-child(n + 6) {
  animation-delay: 300ms;
}

@keyframes grp-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.grp-label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--hue);
}

.grp-label span {
  color: var(--c-ink-muted);
  letter-spacing: 0.04em;
}

.grp-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.grp-people li {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

/* --- Setup --------------------------------------------------------------- */

.grp-setup {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  border-top: 1px solid var(--c-line);
  padding-top: var(--space-6);
}

.grp-names {
  flex: 1 1 16rem;
  max-width: 22rem;
}

.grp-names textarea {
  font: inherit;
  font-size: var(--text-base);
  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;
}

.grp-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.grp-mode {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.grp-mode legend {
  padding: 0;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-ink-muted);
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  font-size: var(--text-sm);
  color: var(--c-ink);
  cursor: pointer;
}

.radio input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--c-confirm);
}

.name-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);
  font-weight: 600;
}

.grp-hint {
  margin: 0;
  color: var(--c-ink-muted);
  font-size: var(--text-sm);
  text-align: center;
  text-wrap: balance;
}

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

/* --- Fullscreen ---------------------------------------------------------- */

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

.toy.is-fullscreen .grp-people li {
  font-size: var(--text-xl);
}

.toy.is-fullscreen .grp-setup {
  opacity: 0;
  transition: opacity 200ms ease;
}

.toy.is-fullscreen .grp-setup:focus-within,
.toy.is-fullscreen:hover .grp-setup {
  opacity: 1;
}
