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

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

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

/* --- The three, up front -------------------------------------------------- */

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

.preview-card {
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--hue-tint);
  border-top: 4px solid var(--hue);
  color: var(--c-ink);
}

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

.preview-title {
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

/* --- The stepper ---------------------------------------------------------- */

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

.rtb-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-ink-muted);
}

.step-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--hue);
  background: transparent;
}

.rtb-step.is-done .step-dot,
.rtb-step.is-current .step-dot {
  background: var(--hue);
}

.rtb-step.is-current {
  color: var(--c-ink);
  font-weight: 700;
}

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

.rtb-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: clamp(var(--space-6), 4vw, var(--space-12)) var(--space-6);
  border-radius: var(--radius);
  background: var(--hue-tint);
  border-top: 6px solid var(--hue);
  animation: rtb-in 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.rtb-meta {
  margin: 0;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--hue);
}

.rtb-title {
  margin: 0;
  text-align: center;
  text-wrap: balance;
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

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

.rtb-clock {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

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

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

.rtb-bar {
  width: 100%;
  max-width: 32rem;
  height: 6px;
  border-radius: 999px;
  background: var(--c-paper);
  overflow: hidden;
}

.rtb-bar-fill {
  height: 100%;
  background: var(--hue);
  transform-origin: left center;
  transition: transform 250ms linear;
}

/* --- Finished ------------------------------------------------------------- */

.rtb-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
  text-align: center;
}

.done-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-confirm);
}

.done-body {
  margin: 0;
  color: var(--c-ink-muted);
  text-wrap: balance;
}

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

.rtb-setup {
  border-top: 1px solid var(--c-line);
  padding-top: var(--space-6);
  width: 100%;
  max-width: 14rem;
  align-items: center;
}

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

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

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

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

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

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