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

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

.mud-summary {
  margin: 0;
  text-align: center;
  text-wrap: balance;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-ink-muted);
}

/* A storm in the room outranks a board full of sunshine. */
.mud-summary.is-stormy {
  color: var(--c-abort);
}

.mud-summary.is-fair {
  color: var(--c-confirm);
}

/* --- The board ------------------------------------------------------------ */

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

.mud-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-3) var(--space-3);
  border-radius: var(--radius);

  background: var(--mood-tint, transparent);
  border: 1px solid var(--c-line);
  border-top: 4px solid var(--mood, var(--c-line));
  color: var(--c-ink);
  transition: background-color 200ms ease, border-color 200ms ease;
}

/* Nobody has spoken for this person yet: an empty seat, not a neutral verdict. */
.mud-card.is-empty {
  border-style: dashed;
  border-top-style: dashed;
}

.mud-card.is-empty .mud-name {
  color: var(--c-ink-muted);
}

/* Storm and rain get an outline, so a facilitator cannot skim past them. */
.mud-card.is-stormy {
  outline: 2px solid var(--mood);
  outline-offset: 2px;
}

.mud-name {
  margin: 0;
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

.mud-weather {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mood, var(--c-ink-muted));
  min-height: 1.2em;
}

/* --- The picker ----------------------------------------------------------- */

.mud-picker {
  display: flex;
  gap: var(--space-1);
  justify-content: center;
}

.mud-dot {
  width: 2rem;
  height: 2rem;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;

  background: transparent;
  border: 2px solid var(--dot);
  transition: background-color 120ms ease, transform 120ms ease;
}

.mud-dot:hover {
  background: var(--dot);
  transform: scale(1.1);
}

.mud-dot.is-on {
  background: var(--dot);
  box-shadow: 0 0 0 3px var(--c-paper), 0 0 0 5px var(--dot);
}

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

.mud-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);
}

.mud-names {
  flex: 1 1 14rem;
  max-width: 20rem;
}

.mud-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: 7rem;
}

.mud-prompt {
  flex: 1 1 16rem;
  max-width: 24rem;
}

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

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

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

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

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

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

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

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