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

.bracket-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  min-height: clamp(10rem, 26vw, 16rem);
  justify-content: center;
}

.bracket-meta {
  margin: 0;
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--c-ink-muted);
}

.bracket-meta .round {
  color: var(--c-ink);
}

.bracket-meta .progress {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* --- The head-to-head ---------------------------------------------------
   Two options, side by side on a wide screen and stacked on a phone, with the
   "or" sitting between them either way. */

.matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: var(--space-4);
  width: 100%;
}

@media (max-width: 44rem) {
  .matchup {
    grid-template-columns: 1fr;
  }
}

.versus {
  align-self: center;
  justify-self: center;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-ink-muted);
}

.option {
  position: relative;
  font: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
  min-height: clamp(7rem, 16vw, 11rem);
  padding: var(--space-6);
  cursor: pointer;
  text-align: left;

  background: var(--hue-tint);
  color: var(--c-ink);
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.option:hover {
  border-color: var(--hue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

.option:active {
  transform: translateY(0);
}

.option-name {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

/* The keyboard shortcut, shown on the option it triggers. */
.option-key {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--hue);
  color: var(--c-ink-inverse);
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- The result ---------------------------------------------------------- */

.bracket-winner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  animation: winner-rise 480ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

@keyframes winner-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.winner-name {
  margin: 0;
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--hue);
}

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

.bracket-options {
  width: 100%;
  max-width: 28rem;
}

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

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

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

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

/* --- Fullscreen: the room sees the matchup ------------------------------- */

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

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

.toy.is-fullscreen .bracket-options {
  opacity: 0;
  transition: opacity 200ms ease;
}

.toy.is-fullscreen .bracket-options:focus-within,
.toy.is-fullscreen:hover .bracket-options {
  opacity: 1;
}
