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

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

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

/* --- The rows ------------------------------------------------------------
   The whole row is the button: in front of a room, the facilitator should not
   have to aim. */

.dot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

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

.dot-rank {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--hue);
  color: var(--c-ink-inverse);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dot-main {
  font: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: var(--tap-target);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  cursor: pointer;

  background: var(--c-paper);
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--hue);
  border-radius: var(--radius);
  transition: background-color 120ms ease, transform 80ms ease;
}

.dot-main:hover {
  background: var(--hue-tint);
}

/* A dot lands with a nudge — enough to confirm the click registered from across
   the room, not enough to be a performance. */
.dot-main:active {
  transform: scale(0.995);
}

.dot-name {
  font-weight: 600;
  text-wrap: balance;
}

.dot-bar {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--c-line);
  overflow: hidden;
}

.dot-fill {
  display: block;
  height: 100%;
  background: var(--hue);
  border-radius: 999px;
  transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dot-count {
  flex: none;
  min-width: 2.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--c-ink);
}

.dot-minus {
  font: inherit;
  flex: none;
  width: var(--tap-target);
  height: var(--tap-target);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: var(--text-lg);
  font-weight: 700;

  background: transparent;
  color: var(--c-ink-muted);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
}

.dot-minus:hover:not(:disabled) {
  background: var(--c-abort);
  border-color: var(--c-abort);
  color: var(--c-ink-inverse);
}

.dot-minus:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* --- Revealed ranking ---------------------------------------------------- */

.dot-list.is-revealed .dot-row {
  animation: rank-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dot-list.is-revealed .dot-row:nth-child(2) {
  animation-delay: 50ms;
}
.dot-list.is-revealed .dot-row:nth-child(3) {
  animation-delay: 100ms;
}
.dot-list.is-revealed .dot-row:nth-child(n + 4) {
  animation-delay: 150ms;
}

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

.dot-row.is-leader .dot-main {
  background: var(--hue-tint);
  border-color: var(--hue);
  box-shadow: var(--shadow-paper);
}

.dot-row.is-leader .dot-name {
  font-weight: 700;
  font-size: var(--text-lg);
}

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

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

.dot-options {
  flex: 1 1 16rem;
  max-width: 24rem;
}

.dot-options 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;
}

.dot-budget {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dot-budget input {
  max-width: 7rem;
}

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

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

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

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

.toy.is-fullscreen .dot-name {
  font-size: var(--text-lg);
}

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

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