/*
 * Templ molecules (templates/molecules/), copied from the Figma Molecules/<Name> sets and composed from the atoms.
 * Styled only with tokens.css variables. Literals are values Figma has no variable for: the fixed Figma widths (used
 * here as max widths, so each molecule fills its container on a phone), the Roster Row's 64 px minimum height, the
 * Filter Bar search's 200 px minimum before the desktop row wraps, the Platform Link Row's 160 px and the Settings
 * Row's 200 px text minimums before the control wraps, the Library Row's 64 px minimum height, the Settings Row's
 * 240 px Select, the Game Tile, marker and icon sizes each molecule places (16, 20, 24, 32, 40, 48, 64 px and
 * full-width × 132 px), the 1.5 px Upcoming step marker stroke, and the 2 px focus stroke. Only the Toast has an
 * elevation: the Float token (--elevation-float), since it is a floating layer.
 *
 * Shared rules (Figma Molecules page):
 * - Hover lays state-hover over the fill, drawn as a background image over the background color, as the atoms do.
 * - Focus is a 2 px focus-ring stroke inside the card. The card's one link stretches over it with ::after, so the
 *   card shows the ring when that link has keyboard focus; the link draws no ring of its own.
 * - Molecules never restyle an atom's look. They only size and place it: Game Tiles take the size Figma gives the
 *   instance (48, 40 or full-width × 132 px), and the action sits above the stretched link.
 * - Every :hover and :focus rule also matches [data-force-state='hover' | 'focus'], which the dev gallery sets to
 *   show a state without inline style.
 */

.lfg-card ul,
.player-card ul,
.match-score ul {
  padding: 0;
  list-style: none;
}

/* ---------- LFG Card (Figma Molecules/LFG Card), also the Proposal Card and the Crew Card ---------- */

/* 400 px in Figma: lg padding, md gap, radius-xl, surface-1. */
.lfg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 400px;
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-1);
}

.lfg-card:hover,
.lfg-card[data-force-state='hover'] {
  background-image: linear-gradient(var(--color-state-hover), var(--color-state-hover));
}

.lfg-card:has(.lfg-card__link:focus-visible),
.lfg-card[data-force-state='focus'] {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: -2px;
}

.lfg-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 0;
}

/* The header's Game Tile is 48 px in Figma. */
.lfg-card__tile {
  display: flex;
  flex: none;
}

.lfg-card__tile .game-tile {
  width: 48px;
  height: 48px;
}

.lfg-card__titles {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}

.lfg-card__title,
.lfg-card__game {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lfg-card__title {
  color: var(--color-text);
  font: var(--text-heading-h3);
  letter-spacing: var(--text-heading-h3-tracking);
}

.lfg-card__game {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.lfg-card__link {
  color: inherit;
  text-decoration: none;
}

/* The title link covers the card, so a click anywhere opens it. */
.lfg-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* The card draws the ring through :has(), so the link drops its own only where :has() works. */
@supports selector(:has(a)) {
  .lfg-card__link:focus-visible,
  .lfg-card__link[data-force-state='focus'] {
    outline: none;
  }
}

.lfg-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.lfg-card__time {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.lfg-card__time .icon {
  width: 16px;
  height: 16px;
}

/* Figma spaces the crew and the action apart; on a narrow card the action wraps under the crew. */
.lfg-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

/* The action sits above the stretched title link, so it stays its own control. */
.lfg-card__action {
  position: relative;
  z-index: 1;
  display: flex;
}

/* ---------- Player Card (Figma Molecules/Player Card) ---------- */

/* Card: 280 px in Figma, lg padding, md gap, radius-xl. Row: 560 px, sm × md padding, radius-lg. Both surface-1. */
.player-card {
  position: relative;
  display: flex;
  gap: var(--space-md);
  width: 100%;
  background-color: var(--color-surface-1);
}

.player-card--card {
  flex-direction: column;
  align-items: flex-start;
  max-width: 280px;
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
}

.player-card--row {
  align-items: center;
  max-width: 560px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
}

.player-card:has(.player-card__link:focus-visible),
.player-card[data-force-state='focus'] {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: -2px;
}

.player-card__identity {
  display: flex;
  flex: 1 0 0;
  align-items: center;
  gap: var(--space-sm);
  align-self: stretch;
  min-width: 0;
}

.player-card--row .player-card__identity {
  gap: var(--space-md);
}

.player-card__names {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}

.player-card__handle,
.player-card__subline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card__handle {
  color: var(--color-text);
  font: var(--text-mono-mono);
  letter-spacing: var(--text-mono-mono-tracking);
}

.player-card__subline,
.player-card__vouch-count {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.player-card__link {
  color: inherit;
  text-decoration: none;
}

/* The handle link covers the card, so a click anywhere opens the profile. */
.player-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* The card draws the ring through :has(), so the link drops its own only where :has() works. */
@supports selector(:has(a)) {
  .player-card__link:focus-visible,
  .player-card__link[data-force-state='focus'] {
    outline: none;
  }
}

/* Shared games: 40 px Game Tiles, xs apart. */
.player-card__games {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.player-card__games .game-tile {
  width: 40px;
  height: 40px;
}

.player-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

/* The vouch summary takes Figma's reputation row: a 16 px muted icon, the count, and the platforms at the end. */
.player-card__vouches {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  align-self: stretch;
  color: var(--color-text-muted);
}

.player-card__vouches .icon {
  width: 16px;
  height: 16px;
}

.player-card__vouches .player-card__vouch-count {
  flex: 1 0 0;
  min-width: 0;
}

.player-card__platforms {
  display: flex;
  flex: none;
  gap: var(--space-2xs);
}

.player-card--row .player-card__vouch-count {
  flex: none;
  white-space: nowrap;
}

/* ---------- Match Score (Figma Molecules/Match Score, Lg as "Why you match") ---------- */

/* 320 px in Figma: lg padding, sm gap, radius-lg, secondary-subtle. */
.match-score {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  max-width: 320px;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background-color: var(--color-secondary-subtle);
}

.match-score__header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-secondary);
  font: var(--text-body-body-s-semibold);
  letter-spacing: var(--text-body-body-s-semibold-tracking);
}

.match-score__header .icon {
  width: 20px;
  height: 20px;
}

.match-score__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* ---------- Crew Slots (Figma Molecules/Crew Slots) ---------- */

.crew-slots {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2xs);
}

.crew-slots__count {
  color: var(--color-text);
  font: var(--text-mono-mono-s-medium);
  letter-spacing: var(--text-mono-mono-s-medium-tracking);
  white-space: nowrap;
}

/* ---------- Roster Row (Figma Molecules/Roster Row) ---------- */

/* At least 64 px tall (no Figma variable) and 400 px wide in Figma: md side padding and gap, radius-lg, surface-2. */
.roster-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 400px;
  min-height: 64px;
  padding-inline: var(--space-md);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-2);
}

.roster-row__names {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}

.roster-row__name,
.roster-row__detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-row__name {
  color: var(--color-text);
  font: var(--text-mono-mono);
  letter-spacing: var(--text-mono-mono-tracking);
}

.roster-row__detail {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.roster-row--open .roster-row__name {
  color: var(--color-text-muted);
  font: var(--text-body-body-medium);
  letter-spacing: var(--text-body-body-medium-tracking);
}

/* ---------- Game Card (Figma Molecules/Game Card) ---------- */

/* 240 px in Figma: xs padding, sm gap, radius-xl, surface-1. */
.game-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  max-width: 240px;
  padding: var(--space-xs);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-1);
}

/* The art is a full-width Game Tile, 132 px tall in Figma. */
.game-card__art {
  display: flex;
}

.game-card__art .game-tile {
  width: 100%;
  height: 132px;
}

.game-card__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: 0 var(--space-xs) var(--space-xs);
}

.game-card__name {
  overflow: hidden;
  color: var(--color-text);
  font: var(--text-body-body-semibold);
  letter-spacing: var(--text-body-body-semibold-tracking);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card__meta {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

/* ---------- Filter Bar (Figma Molecules/Filter Bar) ---------- */

.filter-bar ul {
  padding: 0;
  list-style: none;
}

/* Desktop: 880 px in Figma, one centred row with sm gaps. It wraps on a narrow screen, so the chips and the sort move
 * under the search instead of overflowing. */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  width: 100%;
  max-width: 880px;
}

.filter-bar--desktop {
  flex-wrap: wrap;
  align-items: center;
}

/* Mobile: 358 px in Figma, a column with sm gaps: the search row, then the chips. */
.filter-bar--mobile {
  flex-direction: column;
  max-width: 358px;
}

/* The search fills the row. It keeps at least 200 px before the desktop row wraps (no Figma variable: the Figma frame
 * is fixed at 880 px and never wraps). */
.filter-bar__search {
  flex: 1 1 0;
  min-width: min(100%, 200px);
}

.filter-bar--mobile .filter-bar__search {
  min-width: 0;
}

.filter-bar__search-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Desktop chips sit sm apart, Mobile chips xs apart; both wrap rather than clip. */
.filter-bar__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.filter-bar--mobile .filter-bar__chips {
  gap: var(--space-xs);
}

/* ---------- Message Bubble (Figma Molecules/Message Bubble) ---------- */

/* Row: 420 px in Figma, bottom-aligned with sm gaps. */
.message-bubble {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  width: 100%;
  max-width: 420px;
}

.message-bubble--me {
  justify-content: flex-end;
}

.message-bubble--system {
  justify-content: center;
}

/* Bubble: hugs its text up to 320 px, with sm × md padding, a 2xs gap and radius-lg. */
.message-bubble__bubble {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
  max-width: 320px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-2);
  overflow-wrap: anywhere;
}

.message-bubble--me .message-bubble__bubble {
  background-color: var(--color-secondary-subtle);
}

.message-bubble__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.message-bubble__name {
  color: var(--color-text);
  font: var(--text-mono-mono-s-medium);
  letter-spacing: var(--text-mono-mono-s-medium-tracking);
}

.message-bubble__time {
  color: var(--color-text-muted);
  font: var(--text-body-caption);
  letter-spacing: var(--text-body-caption-tracking);
}

.message-bubble__text {
  color: var(--color-text);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

/* System: a 16 px icon, the event and the time, xs apart, centred. */
.message-bubble__event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-width: 0;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
  font: var(--text-body-caption);
  letter-spacing: var(--text-body-caption-tracking);
  text-align: center;
}

.message-bubble__event .icon {
  flex: none;
  width: 16px;
  height: 16px;
}

/* The actions menu (spec-ui story 11): More actions opens it below the button, right-aligned to it, so it never starts
 * above the chat's scroll content or runs past the right edge; opening it extends the scroll area, and menu.js scrolls
 * it into view. A surface-1 card with the Float elevation (radius-lg, 2xs padding) holding 44 px items. menu.js shows it. */
.message-bubble__actions {
  position: relative;
  flex: none;
}

.message-bubble__menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 200px;
  max-width: calc(100vw - 2 * var(--space-md));
  padding: var(--space-2xs);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-1);
  box-shadow: var(--elevation-float);
}

.message-bubble__menu[hidden] {
  display: none;
}

.message-bubble__menu-form {
  display: block;
  margin: 0;
}

.message-bubble__menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: 44px;
  padding: var(--space-xs) var(--space-sm);
  border: 0;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: var(--color-text);
  font: var(--text-body-body-s-medium);
  letter-spacing: var(--text-body-body-s-medium-tracking);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.message-bubble__menu-item--danger {
  color: var(--color-danger);
}

.message-bubble__menu-item .icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.message-bubble__menu-item:hover,
.message-bubble__menu-item[data-force-state='hover'],
.message-bubble__menu-item:focus-visible,
.message-bubble__menu-item[data-force-state='focus'] {
  background-color: var(--color-surface-2);
}

.message-bubble__menu-item:focus-visible,
.message-bubble__menu-item[data-force-state='focus'] {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: -2px;
}

/* ---------- Notification Item (Figma Molecules/Notification Item) ---------- */

/* 420 px in Figma: md padding and gap, radius-lg, no fill, top-aligned. */
.notification-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  width: 100%;
  max-width: 420px;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
}

.notification-item:has(.notification-item__link:focus-visible),
.notification-item[data-force-state='focus'] {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: -2px;
}

/* The leading visual: Md Avatar, a 40 px Game Tile or the 32 px Logo mark. */
.notification-item__visual {
  display: flex;
  flex: none;
}

.notification-item__visual .game-tile {
  width: 40px;
  height: 40px;
}

.notification-item__content {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2xs);
  min-width: 0;
  overflow-wrap: anywhere;
}

.notification-item__top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  align-self: stretch;
}

.notification-item__title {
  flex: 1 0 0;
  min-width: 0;
  color: var(--color-text);
  font: var(--text-body-body-s-medium);
  letter-spacing: var(--text-body-body-s-medium-tracking);
}

.notification-item--unread .notification-item__title {
  font: var(--text-body-body-s-semibold);
  letter-spacing: var(--text-body-body-s-semibold-tracking);
}

.notification-item__time {
  flex: none;
  color: var(--color-text-muted);
  font: var(--text-body-caption);
  letter-spacing: var(--text-body-caption-tracking);
  white-space: nowrap;
}

.notification-item__detail {
  align-self: stretch;
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.notification-item__link {
  color: inherit;
  text-decoration: none;
}

/* The title link covers the item, so a click anywhere opens its target. */
.notification-item__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* The item draws the ring through :has(), so the link drops its own only where :has() works. */
@supports selector(:has(a)) {
  .notification-item__link:focus-visible,
  .notification-item__link[data-force-state='focus'] {
    outline: none;
  }
}

/* Proposal: Accept and Decline, xs apart, above the stretched link so they stay their own controls. */
.notification-item__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* ---------- Empty State (Figma Molecules/Empty State) ---------- */

/* 480 px in Figma: centred, 2xl padding, md gap. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 480px;
  padding: var(--space-2xl);
  text-align: center;
}

/* The 64 px duotone icon: secondary for Empty, danger for Error. */
.empty-state__icon {
  display: flex;
  color: var(--color-secondary);
}

.empty-state--error .empty-state__icon {
  color: var(--color-danger);
}

.empty-state__icon .icon {
  width: 64px;
  height: 64px;
}

.empty-state__title {
  overflow-wrap: anywhere;
  color: var(--color-text);
  font: var(--text-heading-h3);
  letter-spacing: var(--text-heading-h3-tracking);
}

.empty-state__body {
  overflow-wrap: anywhere;
  color: var(--color-text-muted);
  font: var(--text-body-body);
  letter-spacing: var(--text-body-body-tracking);
}

/* The actions wrap: sm apart in a row, xs between rows. */
.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs) var(--space-sm);
}

/* ---------- Toast (Figma Molecules/Toast) ---------- */

/* 400 px in Figma: sm padding (md on the left), sm gap, radius-lg, surface-1 and the Float elevation. */
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  max-width: 400px;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-1);
  box-shadow: var(--elevation-float);
}

/* The tone's 20 px icon. */
.toast__icon {
  display: flex;
  flex: none;
  color: var(--color-success);
}

.toast--info .toast__icon {
  color: var(--color-secondary);
}

.toast--warning .toast__icon {
  color: var(--color-warning);
}

.toast--danger .toast__icon {
  color: var(--color-danger);
}

.toast__icon .icon {
  width: 20px;
  height: 20px;
}

.toast__text {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast__title {
  color: var(--color-text);
  font: var(--text-body-body-s-semibold);
  letter-spacing: var(--text-body-body-s-semibold-tracking);
}

.toast__detail {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

/* ---------- Modal Header (Figma Molecules/Modal Header) ---------- */

/* 560 px in Figma: lg padding (md at the bottom), md gap, top-aligned. */
.modal-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  width: 100%;
  max-width: 560px;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.modal-header__text {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-header__title {
  margin: 0;
  color: var(--color-text);
  font: var(--text-heading-h3);
  letter-spacing: var(--text-heading-h3-tracking);
}

.modal-header__subtitle {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

/* ---------- Platform Link Row (Figma Molecules/Platform Link Row) ---------- */

/* 560 px in Figma: md padding and gap, centred, radius-lg, surface-1. It wraps, as in Figma, so the status drops
 * under the names on a narrow screen. */
.platform-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 560px;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-1);
}

/* Fills, 160 px minimum before the status wraps. */
.platform-link-row__names {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 160px;
  overflow-wrap: anywhere;
}

.platform-link-row__name {
  color: var(--color-text);
  font: var(--text-body-body-semibold);
  letter-spacing: var(--text-body-body-semibold-tracking);
}

.platform-link-row__detail {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.platform-link-row__status {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-sm);
}

/* The Spinner instance is 20 px in Figma. */
.platform-link-row__spinner .icon {
  width: 20px;
  height: 20px;
}

/* ---------- Stat Tile (Figma Molecules/Stat Tile) ---------- */

/* 220 px in Figma: lg padding, xs gap, radius-lg, surface-2. */
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
  max-width: 220px;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-2);
  overflow-wrap: anywhere;
}

.stat-tile__label {
  color: var(--color-text-muted);
  font: var(--text-body-body-s-medium);
  letter-spacing: var(--text-body-body-s-medium-tracking);
}

.stat-tile__value {
  color: var(--color-text);
  font: var(--text-mono-mono-xl);
  letter-spacing: var(--text-mono-mono-xl-tracking);
}

.stat-tile__detail {
  color: var(--color-text-muted);
  font: var(--text-body-caption);
  letter-spacing: var(--text-body-caption-tracking);
}

/* Highlight: accent fill, every line on-accent. */
.stat-tile--highlight {
  background-color: var(--color-accent);
}

.stat-tile--highlight .stat-tile__label,
.stat-tile--highlight .stat-tile__value,
.stat-tile--highlight .stat-tile__detail {
  color: var(--color-on-accent);
}

/* ---------- Library Row (Figma Molecules/Library Row) ---------- */

/* 560 × 64 px in Figma: md horizontal padding and gap, radius-lg, surface-1. 64 px is a minimum height. */
.library-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 560px;
  min-height: 64px;
  padding-inline: var(--space-md);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-1);
}

/* The Game Tile instance is 40 px in Figma. */
.library-row .game-tile {
  width: 40px;
  height: 40px;
}

.library-row__names {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}

/* Figma truncates the name and detail with an ellipsis. */
.library-row__name,
.library-row__detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-row__name {
  color: var(--color-text);
  font: var(--text-body-body-medium);
  letter-spacing: var(--text-body-body-medium-tracking);
}

.library-row__detail {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.library-row__hours {
  flex: none;
  color: var(--color-text);
  font: var(--text-mono-mono);
  letter-spacing: var(--text-mono-mono-tracking);
  white-space: nowrap;
}

/* ---------- Settings Row (Figma Molecules/Settings Row) ---------- */

/* 640 px in Figma: md vertical padding, lg gap, no fill (rows sit in a surface-1 panel). It wraps, as in Figma. */
.settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  width: 100%;
  max-width: 640px;
  padding-block: var(--space-md);
}

/* Fills, 200 px minimum before the control wraps. */
.settings-row__text {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 200px;
  overflow-wrap: anywhere;
}

.settings-row__label {
  color: var(--color-text);
  font: var(--text-body-body-medium);
  letter-spacing: var(--text-body-body-medium-tracking);
}

.settings-row__description {
  color: var(--color-text-muted);
  font: var(--text-body-body-s);
  letter-spacing: var(--text-body-body-s-tracking);
}

.settings-row__control {
  flex: none;
  max-width: 100%;
}

/* The Select is 240 px in Figma. */
.settings-row--select .settings-row__control {
  width: 240px;
}

/* ---------- Tab Bar (Figma Molecules/Tab Bar) ---------- */

/* Hugs its tabs: 2xs padding and gap, radius-full, surface-2. On a narrow screen it scrolls sideways. */
.tab-bar {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  max-width: 100%;
  padding: var(--space-2xs);
  overflow-x: auto;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-2);
}

/* ---------- Stepper Step (Figma Molecules/Stepper Step) ---------- */

/* sm gap, centred, no connector. */
.stepper-step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* The 24 px marker: Upcoming by default, the number in a 1.5 px border-strong ring. */
.stepper-step__marker {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font: var(--text-body-caption-medium);
  letter-spacing: var(--text-body-caption-medium-tracking);
}

/* Current: the number on surface-inverse. */
.stepper-step--current .stepper-step__marker {
  border: 0;
  background-color: var(--color-surface-inverse);
  color: var(--color-text-inverse);
}

/* Done: a 16 px check on control-on, in Figma's rounded box. */
.stepper-step--done .stepper-step__marker {
  border: 0;
  border-radius: var(--radius-sm);
  background-color: var(--color-control-on);
  color: var(--color-on-control);
}

.stepper-step__marker .icon {
  width: 16px;
  height: 16px;
}

.stepper-step__label {
  color: var(--color-text);
  font: var(--text-body-body-s-medium);
  letter-spacing: var(--text-body-body-s-medium-tracking);
  overflow-wrap: anywhere;
}

.stepper-step--current .stepper-step__label {
  font: var(--text-body-body-s-semibold);
  letter-spacing: var(--text-body-body-s-semibold-tracking);
}

.stepper-step--upcoming .stepper-step__label {
  color: var(--color-text-muted);
}

/* ---------- Step Card (Figma Molecules/Step Card) ---------- */

/* 360 px in Figma: xl padding, md gap, radius-xl, surface-1. */
.step-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 360px;
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-1);
  overflow-wrap: anywhere;
}

.step-card__number {
  color: var(--color-text-muted);
  font: var(--text-mono-mono-s-medium);
  letter-spacing: var(--text-mono-mono-s-medium-tracking);
}

/* The 32 px icon. */
.step-card__icon {
  display: flex;
  color: var(--color-text);
}

.step-card__icon .icon {
  width: 32px;
  height: 32px;
}

.step-card__title {
  color: var(--color-text);
  font: var(--text-heading-h3);
  letter-spacing: var(--text-heading-h3-tracking);
}

.step-card__body {
  color: var(--color-text-muted);
  font: var(--text-body-body);
  letter-spacing: var(--text-body-body-tracking);
}

/* ---------- Quote Card (Figma Molecules/Quote Card) ---------- */

/* 400 px in Figma: xl padding, lg gap, radius-xl, surface-1. */
.quote-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-1);
  overflow-wrap: anywhere;
}

.quote-card__quote {
  margin: 0;
  color: var(--color-text);
  font: var(--text-body-body-l);
  letter-spacing: var(--text-body-body-l-tracking);
}

.quote-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.quote-card__names {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  min-width: 0;
}

.quote-card__name {
  color: var(--color-text);
  font: var(--text-mono-mono-s-medium);
  letter-spacing: var(--text-mono-mono-s-medium-tracking);
}

.quote-card__context {
  color: var(--color-text-muted);
  font: var(--text-body-caption);
  letter-spacing: var(--text-body-caption-tracking);
}
