.dice {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  align-items: center;
}

.dice-results {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  min-height: 5rem;
}

.die {
  display: grid;
  place-items: center;
  min-width: clamp(3.5rem, 12vw, 6rem);
  min-height: clamp(3.5rem, 12vw, 6rem);
  padding: var(--space-2);
  border-radius: var(--radius);
  background: var(--hue-tint, var(--c-blue-tint));
  color: var(--c-ink);
  border: 2px solid var(--hue, var(--c-blue));
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1;
}

.is-rolling .die {
  animation: die-land 320ms cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}

/* Stagger, so a handful of dice land one after another rather than as a block. */
.die:nth-child(2) {
  animation-delay: 40ms;
}
.die:nth-child(3) {
  animation-delay: 80ms;
}
.die:nth-child(4) {
  animation-delay: 120ms;
}
.die:nth-child(n + 5) {
  animation-delay: 160ms;
}

@keyframes die-land {
  from {
    opacity: 0;
    transform: translateY(-12px) rotate(-6deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dice-total {
  margin: 0;
  color: var(--c-ink-muted);
  font-size: var(--text-lg);
}

.dice-total strong {
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}

.dice-setup {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  justify-content: center;
  align-items: flex-end;
}

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

.toy.is-fullscreen .die {
  min-width: clamp(5rem, 18vw, 12rem);
  min-height: clamp(5rem, 18vw, 12rem);
  font-size: clamp(3rem, 10vw, 7rem);
}
