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

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

/* --- The stepper ---------------------------------------------------------
   The structure is the point, so the four phases are always on screen: the
   room can see where it is and what is coming. */

.ltf-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  align-items: center;
}

.ltf-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border-radius: 999px;
  border: 1px solid var(--c-line);
  color: var(--c-ink-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.step-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--c-line);
  color: var(--c-ink-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ltf-step.is-done {
  border-color: var(--c-confirm);
  color: var(--c-confirm);
}

.ltf-step.is-done .step-mark {
  background: var(--c-confirm);
  color: var(--c-ink-inverse);
}

.ltf-step.is-current {
  border-color: var(--c-ink);
  color: var(--c-ink);
  background: var(--c-paper);
}

.ltf-step.is-current .step-mark {
  background: var(--c-ink);
  color: var(--c-ink-inverse);
}

/* --- The question -------------------------------------------------------- */

.ltf-question {
  margin: 0;
  max-width: 40ch;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--c-ink);
}

.ltf-lead {
  margin: 0;
  max-width: 40ch;
  text-align: center;
  font-size: var(--text-lg);
  color: var(--c-ink-muted);
  text-wrap: balance;
}

/* --- The clock ----------------------------------------------------------- */

.ltf-clock {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.clock-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--c-ink-muted);
  letter-spacing: -0.01em;
}

.clock-time.is-running {
  color: var(--c-ink);
}

.clock-time.is-up {
  color: var(--c-abort);
}

.clock-suggested {
  font-size: var(--text-sm);
  color: var(--c-ink-muted);
}

/* --- Phase panels -------------------------------------------------------- */

.ltf-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  animation: phase-in 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.ltf-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-ink);
  text-align: center;
}

.ltf-body {
  margin: 0 0 var(--space-2);
  color: var(--c-ink-muted);
  text-align: center;
  max-width: 46ch;
  text-wrap: balance;
}

/* --- Groups -------------------------------------------------------------- */

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

.group-grid.is-fours {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}

.group-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--hue-tint);
  border-top: 4px solid var(--hue);
  color: var(--c-ink);
}

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

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

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

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

/* A foursome is drawn as the two pairs it is made of, each keeping its colour
   from phase 2 — you can see your pair inside the four. */
.four-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  background: var(--c-paper);
}

.four-card .group-label {
  color: var(--c-ink-muted);
}

.four-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.four-pair {
  list-style: none;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--hue-tint);
  border-left: 4px solid var(--hue);
  flex: 1 1 8rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.four-pair li {
  font-weight: 700;
  line-height: 1.3;
}

/* --- Names --------------------------------------------------------------- */

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

.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, var(--c-line));
  color: var(--c-ink);
  font-weight: 600;
}

/* In phase 1 nobody is grouped yet, so nobody wears a colour. */
.name-chip.is-quiet {
  background: transparent;
  border: 1px solid var(--c-line);
  color: var(--c-ink-muted);
  font-weight: 400;
}

.ltf-everyone {
  width: 100%;
  padding: var(--space-6);
  border-radius: var(--radius);
  border: 2px dashed var(--c-line);
}

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

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

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

.ltf-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;
}

.ltf-prompt {
  flex: 1 1 16rem;
  max-width: 26rem;
}

.ltf-prompt input {
  width: 100%;
}

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

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

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

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

.toy.is-fullscreen .ltf-question {
  font-size: var(--text-2xl);
}

.toy.is-fullscreen .group-people li,
.toy.is-fullscreen .four-pair li {
  font-size: var(--text-xl);
}

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

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