/* ═══════════════════════════════════════════════════════════════════════════
   The height and playstyle rules (js/shared/rules-card.js) as one
   ticket-blue card, so it also stands alone as a picture for Discord. It
   fills a reading column and stops at 40rem in a wider one. Inside it,
   hairlines part the groups; no box sits inside another. Its layout follows
   its own width, not the screen's, so it fits the match chat too.
   ═══════════════════════════════════════════════════════════════════════════ */

.rules-card {
  max-width: 40rem;
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px solid rgb(var(--led-pale-rgb) / 0.18);
  border-radius: 12px;
  background: var(--ticket-blue);
  color: var(--text-primary);
  container: rules-card / inline-size;
}

.rules-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgb(var(--led-pale-rgb) / 0.18);
}

.rules-card__head img {
  border-radius: 8px;
}

.rules-card .rules-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.2;
  color: var(--text-primary);
}

.rules-card__heading {
  margin: var(--space-8) 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
}

/* The three limits side by side like a scoreboard: an icon, the position as
   a small tracked word, the figure. Subgrid keeps the figures on one line
   when a position wraps. */
.rules-card__heights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  margin: 0;
}

.rules-card__heights div {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: var(--space-2);
  padding: 0 var(--space-4);
  border-left: 1px solid rgb(var(--led-pale-rgb) / 0.18);
}

.rules-card__heights div:first-child {
  padding-left: 0;
  border-left: 0;
}

.rules-card__icon {
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: var(--led-bright);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rules-card__heights dt {
  align-self: start;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--led-pale-72);
}

.rules-card__heights dd {
  margin: 0;
  color: var(--led-pale-72);
}

.rules-card__heights dd .t-figure {
  font-size: 2.75rem;
  line-height: 1;
  color: var(--text-primary);
}

.rules-card .rules-card__note {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--led-pale-72);
}

/* Each banned playstyle on its own ruled line: the game's silver and gold
   badges, then the name. */
.rules-card__banned {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgb(var(--led-pale-rgb) / 0.18);
}

.rules-card__banned li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgb(var(--led-pale-rgb) / 0.18);
  font-weight: var(--weight-semibold);
}

.rules-card__badges {
  display: flex;
  flex: none;
  gap: 2px;
}

.rules-card .rules-card__foot {
  margin: var(--space-8) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid rgb(var(--led-pale-rgb) / 0.18);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

@media (max-width: 479.98px) {
  .rules-card {
    padding: var(--space-5) var(--space-4);
  }
}

@container rules-card (max-width: 399.98px) {
  /* Too narrow for three columns: each limit becomes a ruled row, the
     position on the left and its figure on the right. */
  .rules-card__heights {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    border-top: 1px solid rgb(var(--led-pale-rgb) / 0.18);
  }

  .rules-card__heights div,
  .rules-card__heights div:first-child {
    grid-row: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: none;
    align-items: center;
    column-gap: var(--space-3);
    padding: var(--space-3) 0;
    border-left: 0;
    border-bottom: 1px solid rgb(var(--led-pale-rgb) / 0.18);
  }

  .rules-card__heights dt {
    align-self: center;
  }

  .rules-card__heights dd .t-figure {
    font-size: 2.25rem;
  }

  .rules-card__banned {
    grid-template-columns: minmax(0, 1fr);
  }
}
