.roll {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.roll__header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}

/* An inset grouped list, as in iOS Settings. */
.roll__list {
  padding: 0;
  margin: 0;
  overflow: hidden;
  list-style: none;
  background: var(--color-launcher-surface);
  border: var(--border-width-hairline) solid var(--color-launcher-separator);
  border-radius: var(--radius-tile);
}

.roll__row {
  position: relative;
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-5);
  animation: row-rise var(--duration-rise) var(--easing-spring) backwards;
  animation-delay: calc(var(--order, 0) * var(--duration-stagger) / 2);
}

.roll__row + .roll__row::before {
  position: absolute;
  inset-block-start: 0;
  inset-inline: var(--space-5) 0;
  content: '';
  border-block-start: var(--border-width-hairline) solid var(--color-launcher-separator);
}

.roll__rank {
  flex: none;
  min-inline-size: 2ch;
  font-size: var(--font-size-apple-subheadline);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--color-label-muted);
  text-align: end;
}

.roll__row[data-medal='gold'] .roll__rank {
  color: var(--color-medal-gold-bottom);
}

.roll__row[data-medal='silver'] .roll__rank {
  color: var(--color-medal-silver-bottom);
}

.roll__row[data-medal='bronze'] .roll__rank {
  color: var(--color-medal-bronze-bottom);
}

/* By day, a place number would read as a position in time, so it steps aside. */
.roll[data-order='recent'] .roll__rank {
  display: none;
}

.roll__text,
.roll__end {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.roll__text {
  flex: 1;
  min-inline-size: 0;
}

.roll__end {
  flex: none;
  align-items: flex-end;
}

/* The name gives way to its tier: a long one ends in an ellipsis, the tier stays whole. */
.roll__title {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  min-inline-size: 0;
}

.roll__name {
  overflow: hidden;
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roll__message {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--font-size-apple-subheadline);
  line-height: var(--leading-apple-subheadline);
  color: var(--color-label-muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.roll__amount {
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.roll__date {
  font-size: var(--font-size-apple-footnote);
  line-height: var(--leading-apple-footnote);
  color: var(--color-label-muted);
  white-space: nowrap;
}

@keyframes row-rise {
  from {
    opacity: 0;
    translate: 0 var(--offset-rise);
  }
}

@media (prefers-reduced-motion: reduce) {
  .roll__row {
    animation: none;
  }
}
