/* ---------- Event cards ---------- */

.event-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
  min-width: 0;
}
.event-card-header {
  align-items: center;
  flex-wrap: wrap;
}
.event-card-heading,
.event-card-meta-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  overflow-wrap: anywhere;
}
.event-card-heading .food-order-card-title {
  font-weight: var(--font-weight-bold);
  white-space: normal;
}
.event-card-meta {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
}
.event-card-header-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  min-width: 0;
}
.event-card-header-badges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}
.event-card-detail-label {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.03em;
}
.event-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}
.event-card-info-details {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-3);
}
.event-card-info > .food-order-details-head:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.event-card-detail {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
  color: var(--text);
  font-size: var(--font-size-sm);
}
.event-card-detail-icon {
  display: inline-flex;
  flex: 0 0 var(--font-size-lg);
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.event-card-detail-icon .ui-icon {
  width: 1em;
  height: 1em;
}
.event-card-detail-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  overflow-wrap: anywhere;
}
.event-card-detail-label {
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}
.event-card-description .event-card-detail-content > span:last-child {
  white-space: pre-wrap;
}
.event-location-link {
  color: var(--accent);
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: var(--space-1);
}
.event-location-text {
  overflow-wrap: anywhere;
}
.event-card-payment {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-3);
}
.event-card-info-details + .event-card-payment {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.excuse-result {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.excuse-text {
  margin: 0;
  overflow-wrap: anywhere;
}
.excuse-meta {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.excuse-empty {
  margin: 0;
}
/* Secondary actions share one row exactly as wide as the primary action
   below them; hidden entries leave no gap. */
.excuse-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  align-self: flex-end;
}
.excuse-dialog-actions [hidden] {
  display: none;
}
.excuse-dialog-actions .btn {
  justify-content: center;
}
.excuse-dialog-submit {
  grid-column: 1 / -1;
}
.excuse-mode {
  display: flex;
  gap: var(--space-2);
}
.excuse-mode .btn {
  border: 1px solid var(--border);
  background: none;
}
.excuse-mode .btn[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
}
.excuse-meta-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.event-payment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.event-payment-amount {
  font-size: var(--font-size-lg);
  font-variant-numeric: tabular-nums;
}
.event-payment-due,
.event-payment-proof,
.event-payment-overview {
  font-size: var(--font-size-xs);
}
.event-payment-proof {
  color: var(--text-muted);
}
.event-settlement {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.event-settlement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.event-settlement-metric {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
}
.event-settlement-metric small,
.event-settlement-metric > span {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}
.event-settlement-metric strong {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.event-settlement-balance {
  align-items: center;
}
.payment-paypal-button {
  width: var(--space-7);
  height: var(--space-7);
  padding: var(--space-1);
}
.event-card-empty-copy {
  margin: 0;
  font-size: var(--font-size-xs);
}
/* Open card: flat sections (Infos, Abrechnung or Dein Beitrag, Teilnehmende)
   that start at the title's left edge, not under the disclosure chevron. */
.event-card .food-order-card-chevron .ui-icon {
  width: var(--space-4);
  height: var(--space-4);
}
.event-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}
.event-card.is-collapsible .event-card-body {
  padding-left: calc(var(--space-4) + var(--space-2));
}
.event-card-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.event-card-section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.event-card-section-title .muted {
  font-weight: var(--font-weight-regular);
  letter-spacing: 0;
  text-transform: none;
}
.event-card-section > .event-card-payment {
  padding-top: var(--space-3);
}
.event-info-rows {
  display: flex;
  flex-direction: column;
}
.event-info-row {
  display: grid;
  grid-template-columns: var(--event-info-label-width) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-target-size);
  padding: var(--space-1) 0;
  border-top: 1px solid var(--border);
}
.event-info-rows > .event-info-row:first-child {
  border-top: 0;
}
.event-info-label {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.event-info-value {
  min-width: 0;
  overflow-wrap: anywhere;
}
.event-info-strong {
  font-weight: var(--font-weight-medium);
}
.event-info-note {
  white-space: pre-wrap;
}
.event-info-value .muted {
  font-size: var(--font-size-xs);
}
.event-info-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}
.event-info-actions .icon-btn {
  min-width: var(--control-height);
  color: var(--text-muted);
}
.payment-paid-marker.event-calendar-marker {
  width: auto;
  min-width: var(--payment-marker-width);
  padding-inline: var(--space-3);
}
.event-participant-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--space-7);
  margin: 0;
  padding: 0;
  list-style: none;
}
.event-participant-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  min-height: var(--tap-target-size);
  padding: var(--space-1) 0;
  border-top: 1px solid var(--border);
}
.event-participant-row:first-child {
  border-top: 0;
}
.event-participant-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-participant-name .muted {
  font-size: var(--font-size-xs);
}
.player-name.is-me {
  font-weight: var(--font-weight-bold);
}
.event-participant-excuse {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-style: italic;
}
/* The shortened excuse itself opens the full text; the name stays plain.
   Hover and focus mark it as clickable. */
/* A row with an excuse lays name, state and excuse out in a line, so the
   excuse button ends where its visible text ends and can ellipsize itself. */
.event-participant-name:has(> .event-participant-excuse-toggle) {
  display: flex;
  align-items: baseline;
}
.event-participant-name:has(> .event-participant-excuse-toggle) > span {
  flex: none;
  white-space: pre;
}
.event-participant-excuse-toggle {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-style: italic;
  cursor: pointer;
}
@media (hover: hover) {
  .event-participant-excuse-toggle:hover {
    color: var(--text);
    text-decoration: underline;
  }
}
.event-participant-excuse-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.excuse-quote {
  font-style: italic;
  white-space: pre-wrap;
}
.event-roster-slot {
  display: inline-flex;
  flex: 0 0 var(--payment-marker-width);
  justify-content: flex-end;
}
.event-roster-slot > .btn {
  width: 100%;
  justify-content: center;
  border: 1px solid var(--border);
  background: none;
}
.event-roster-remove {
  min-width: var(--control-height);
  color: var(--text-muted);
}
.event-roster-remove:disabled {
  opacity: 0.35;
}
.event-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}
.event-card-actions > .btn:not(.btn-primary) {
  border: 1px solid var(--border);
  background: none;
}
@media (min-width: 860px) { /* --bp-lg */
  .event-participant-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--event-roster-rows, 1), auto);
    grid-auto-flow: column;
  }
  .event-participant-row.is-column-start {
    border-top: 0;
  }
}
@media (max-width: 639px) { /* --bp-md */
  /* Phones stack label, value and actions so a long period never squeezes
     the value into a sliver beside the calendar controls. */
  .event-info-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    padding: var(--space-2) 0;
  }
  .event-info-actions {
    justify-content: flex-start;
  }
  .event-card-header > .food-order-card-header-toggle {
    flex-basis: 100%;
  }
  .event-card-header-side {
    width: 100%;
  }
}

/* ---------- Live board ---------- */

.player-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
}
/* Home's live board doubles as the roster since the separate "Spieler" area
   was removed: every card opens that participant's read-only profile. The
   kiosk keeps rendering the same card as a static div, so the interactive
   resets stay scoped to the button form. */
button.player-card {
  width: 100%;
  text-align: left;
  font-size: var(--font-size-md);
  cursor: pointer;
}
.player-card-main {
  flex: 1;
  min-width: 0;
}
.player-card-games {
  margin-top: var(--space-2);
}
.player-card-games .chip {
  color: var(--text-muted);
}
/* Which of several simultaneously-running games actually has focus right
   now (only rendered when that's known and there's more than one to tell
   apart — see gameChipsHtml in format.js). */
.player-card-games .chip.chip-foreground {
  color: var(--state-playing);
  background: var(--state-playing-bg);
  border-color: var(--state-playing);
  font-weight: var(--font-weight-medium);
}
.player-card-games .chip.chip-background {
  opacity: 0.6;
}

/* ---------- Bock/Skill ratings ---------- */

/* Label and Ø note on the first line, the shared 0-5 number scale
   (ratingScale.js) on its own full-width line below. */
.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

/* ---------- Team results ---------- */

.team-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  min-width: 0;
}
.team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-3);
}
.tournament-team-skill-header input {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  font-weight: var(--font-weight-bold);
}
.team-skill-total {
  flex: 0 0 auto;
}
.team-player {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  min-width: 0;
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* A player without an own rating still enters the draw with the server's
   neutral fallback, so the value stays visible: the parentheses plus this
   dimming mark it as derived rather than self-reported. Same role on a team
   total, where the parenthesized number counts the unrated players. */
.rating-unrated {
  opacity: 0.7;
}
.team-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.team-player .rating {
  margin-left: auto;
}
.team-player-move-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}
.team-player-move-row > .team-player {
  flex: 1;
}
/* Phones cannot use native drag and drop, so only touch/phone layouts get the
   native team picker; desktop keeps pure drag and drop. */
.team-move-control {
  display: none;
  position: relative;
  flex: 0 0 var(--control-height);
  width: var(--control-height);
  height: var(--control-height);
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  color: var(--text-muted);
}
.team-move-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* The shared select padding (chevron gap) would widen the invisible picker
     past its icon slot and the team card. */
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
@media (pointer: coarse), (max-width: 639px) { /* --bp-md */
  .team-move-control {
    display: grid;
  }
}

/* ---------- Tournament bracket ----------
   Rendered as a recursively nested tree (see buildBracketNode in
   tournament.js), mirroring the actual bracket structure in the DOM instead
   of flat per-round columns: every match's box is exactly --bracket-match-h
   tall no matter its content (bye/TBD/decided/live score entry all fit the
   same 2-row shape), and each round-N+1 match sits flexbox-centered against
   its own two round-N feeders — which, combined with the fixed height,
   makes the connector lines land exactly on both matches' centers with no
   manual pixel-chasing. This replaces the old flat-column
   justify-content:space-around layout, which visibly misaligned as soon as
   a bye or a score line made one box taller than its neighbor. */

.bracket-tree-wrap {
  /* Bracket-local layout constants, not app-wide design tokens — scoped here
     so they inherit to every bracket descendant without polluting :root. */
  --bracket-match-w: 240px;
  --bracket-match-h: 76px;
  --bracket-pair-gap: 20px;
  --bracket-round-gap: 40px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--space-1) var(--space-4) var(--space-5);
  margin: 0 calc(-1 * var(--space-4));
}
.bracket-tree-content {
  width: max-content;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bracket-round-titles {
  display: flex;
  gap: var(--bracket-round-gap);
  margin-bottom: var(--space-4);
  width: max-content;
}
.bracket-round-titles > div {
  width: var(--bracket-match-w);
  flex-shrink: 0;
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bracket-node {
  display: flex;
  align-items: center;
  gap: var(--bracket-round-gap);
  position: relative;
}
.bracket-children {
  display: flex;
  flex-direction: column;
  gap: var(--bracket-pair-gap);
  position: relative;
}
/* Outgoing stub: from this child's own vertical center (which, thanks to
   align-items:center above, is always its box's true center whether it's a
   leaf match or a whole nested subtree) halfway into the gap toward the
   shared vertical bar. */
.bracket-children > .bracket-node::after,
.bracket-children > .bracket-match::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: calc(var(--bracket-pair-gap) - 2px);
  height: 2px;
  background: var(--border);
  transform: translateY(-1px);
}
/* The vertical bar: spans exactly between the two children's connection
   points. --conn-half is set inline per pair (buildBracketNode computes it
   from the fixed match height, so it's exact math, not a measured guess). */
.bracket-children::before {
  content: '';
  position: absolute;
  left: calc(100% + var(--bracket-pair-gap) - 2px);
  top: var(--conn-half);
  bottom: var(--conn-half);
  width: 2px;
  background: var(--border);
}
/* Final stub: from the vertical bar's midpoint on to the parent match. */
.bracket-children::after {
  content: '';
  position: absolute;
  left: calc(100% + var(--bracket-pair-gap));
  top: 50%;
  width: calc(var(--bracket-round-gap) - var(--bracket-pair-gap));
  height: 2px;
  background: var(--border);
  transform: translateY(-1px);
}

.bracket-match {
  width: var(--bracket-match-w);
  height: var(--bracket-match-h);
  flex-shrink: 0;
  display: flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  position: relative;
}
.bracket-match.is-open {
  border-style: dashed;
}
.bracket-rows {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bracket-team-row {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  color: var(--text);
  font-size: var(--font-size-sm);
}
.bracket-team-row + .bracket-team-row {
  border-top: 1px solid var(--border);
}
.bracket-team-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bracket-team-row.is-winner {
  font-weight: var(--font-weight-medium);
}
.bracket-team-row.is-loser {
  color: var(--text-muted);
}
.bracket-team-row.is-tbd {
  color: var(--text-muted);
  font-style: italic;
}
.bracket-score {
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}
.bracket-team-row.is-winner .bracket-score,
.bracket-win-mark {
  color: var(--state-playing);
}
.bracket-win-mark {
  display: inline-flex;
  flex-shrink: 0;
}
/* The result action lives in a fixed trailing column inside the box, so it
   never floats over the connector lines and every box keeps one width. */
.bracket-side {
  flex: 0 0 var(--control-height);
  display: grid;
  place-items: center;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: none;
  color: var(--text-muted);
  padding: 0;
}
button.bracket-side {
  cursor: pointer;
}
.bracket-side.is-open {
  color: var(--accent);
}
@media (hover: hover) {
  button.bracket-side:hover {
    background: var(--bg-elevated);
    color: var(--text);
  }
}
.bracket-final-row {
  display: flex;
  align-items: center;
  gap: var(--bracket-round-gap);
}
/* The tree and the third-place row share one grid cell, so the cell grows
   to whichever reaches further down and nothing gets clipped. */
.bracket-tree-body {
  display: grid;
  justify-items: center;
}
.bracket-tree-body > * {
  grid-area: 1 / 1;
  align-self: start;
}
/* The third-place match sits in the final's column directly below the final
   (--final-bottom is set inline); the empty cells mirror the round-title
   columns so the box lines up. They overlap earlier rounds and must not catch
   clicks meant for their result actions. */
.bracket-third-place-row {
  display: flex;
  gap: var(--bracket-round-gap);
  margin-top: calc(var(--final-bottom) + var(--space-5));
  pointer-events: none;
}
.bracket-third-place {
  pointer-events: auto;
}
.bracket-third-place-row > div {
  width: var(--bracket-match-w);
  flex-shrink: 0;
}
.bracket-third-place-title {
  margin-bottom: var(--space-2);
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bracket-champion {
  width: var(--bracket-match-w);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: var(--accent-text);
  font-weight: var(--font-weight-bold);
  position: relative;
}
.bracket-champion::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  width: var(--bracket-round-gap);
  height: 2px;
  background: var(--border);
  transform: translateY(-1px);
}

/* ---------- Tournament league: fixtures, standings, result dialog ---------- */

.tournament-board {
  margin-top: var(--space-5);
}
.tournament-board > .tournament-group-stage {
  margin-top: 0;
}
.tournament-round + .tournament-round {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.tournament-round-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tournament-fixture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) var(--control-height);
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-target-size);
}
.tournament-fixture + .tournament-fixture {
  border-top: 1px solid var(--border);
}
.tournament-fixture-team {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tournament-fixture-team.is-home {
  text-align: right;
}
.tournament-fixture-team.is-winner {
  font-weight: var(--font-weight-medium);
}
.tournament-fixture-team.is-loser {
  color: var(--text-muted);
}
.tournament-fixture-score {
  min-height: var(--control-height);
  min-width: calc(var(--space-8) + var(--space-3));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}
.tournament-fixture-score .is-win {
  color: var(--state-playing);
}
.tournament-fixture-score.is-open {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-weight: var(--font-weight-regular);
}
.tournament-fixture-score.is-pick {
  background: var(--state-playing-bg);
  color: var(--state-playing);
  font-size: var(--font-size-xs);
}
.tournament-fixture-action {
  width: var(--control-height);
  height: var(--control-height);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  color: var(--text-muted);
  cursor: pointer;
}
span.tournament-fixture-action {
  border-color: transparent;
  background: none;
}
.tournament-fixture-action.is-open {
  border-color: var(--accent);
  color: var(--accent);
}
.tournament-fixture-action.is-primary {
  border-color: transparent;
  background: var(--accent-gradient);
  color: var(--accent-text);
}
@media (hover: hover) {
  button.tournament-fixture-action:hover {
    color: var(--text);
  }
  button.tournament-fixture-action.is-primary:hover {
    color: var(--accent-text);
  }
}
@media (max-width: 479px) { /* --bp-sm */
  .tournament-fixture {
    gap: var(--space-2);
    font-size: var(--font-size-sm);
  }
}
.tournament-group-fixtures {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.tournament-group-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}
.tournament-group-fixtures .tournament-group-subtitle {
  margin-bottom: var(--space-3);
}
.tournament-standings {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-sm);
}
.tournament-standings th {
  white-space: nowrap;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-align: right;
}
.tournament-standings td {
  padding: var(--space-2);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: right;
}
.tournament-standings th:first-child,
.tournament-standings td:first-child {
  text-align: center;
  width: var(--space-6);
}
.tournament-standings th:nth-child(2),
.tournament-standings td:nth-child(2) {
  width: 100%;
  text-align: left;
}
.tournament-standings-team {
  color: var(--text);
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tournament-standings-identity {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}
.tournament-standings-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tournament-standings tr.is-leader .tournament-standings-rank {
  color: var(--rank-1-gold);
  font-weight: var(--font-weight-bold);
}
.tournament-standings-advance {
  margin-left: var(--space-2);
  font-size: var(--font-size-2xs);
  color: var(--accent);
}
.tournament-standings td.tournament-standings-points {
  color: var(--text);
  font-weight: var(--font-weight-bold);
}
.tournament-result-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}
.tournament-result-teams label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--font-weight-medium);
}
input[type='number'].tournament-result-score {
  height: var(--tap-target-size);
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}
.result-dialog-subtitle {
  margin-bottom: var(--space-4);
}
/* The settled-bet correction reason sits between subtitle and result form;
   it keeps the same distance to the form as the subtitle does. */
.result-correction {
  margin-bottom: var(--space-4);
}
.result-mode-switch,
.result-save-row {
  display: flex;
  gap: var(--space-2);
}
.result-mode-switch {
  flex-wrap: wrap;
}
.result-mode-panels {
  display: grid;
}
.result-mode-panels > * {
  grid-area: 1 / 1;
  min-width: 0;
}
.result-mode-panels > [data-inactive] {
  visibility: hidden;
  pointer-events: none;
}
.result-winner-list {
  display: grid;
  grid-auto-rows: 1fr;
}
.result-save-row {
  justify-content: flex-end;
}
.result-score-row {
  display: grid;
  grid-template-columns: var(--space-6) minmax(0, 1fr) calc(var(--space-8) + var(--space-8));
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
}
.result-team-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  font-weight: var(--font-weight-medium);
}
.result-team-label > span {
  overflow-wrap: anywhere;
}
.result-rank.is-first {
  color: var(--rank-1-gold);
}
.tournament-result-pick:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tournament-result-pick {
  min-height: var(--tap-target-size);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  color: var(--text);
  font-weight: var(--font-weight-medium);
  text-align: left;
  cursor: pointer;
}
.tournament-result-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px; /* design-token-ok: tight title/subtitle pairing inside one pick button, below the 4px spacing step */
}
.tournament-result-pick-players {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--text-muted);
  text-align: left;
}
.draw-result-value-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--space-8) + var(--space-8));
  align-items: center;
  gap: var(--space-3);
}
.draw-result-value-row label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-weight: var(--font-weight-medium);
}
.tournament-result-pick.is-draw {
  color: var(--text-muted);
}
.tournament-result-pick.is-selected {
  border-color: var(--accent);
}
.tournament-result-pick.is-draw.is-selected {
  color: var(--text);
}
@media (hover: hover) {
  .tournament-result-pick:hover {
    border-color: var(--accent);
  }
}

/* ---------- Checkbox list (present players) ---------- */

.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-1);
  border-bottom: 1px solid var(--border);
}
.check-row:last-child {
  border-bottom: none;
}
.player-selection-grid .check-row:last-child {
  border-bottom: 1px solid var(--border);
}
.check-row input[type='checkbox'] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* ---------- Vote ---------- */

/* The running round and every closed result reuse the Umfrage card, option
   row, 0-5 number scale, result bar and vote-table styles; only the plain
   (non-collapsible) running-round heading is Vote's own. */
.vote-game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}
.vote-game-grid .check-row {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.vote-page-section {
  margin-top: var(--space-4);
}
.view-container > .view-title + .vote-page-section {
  margin-top: 0;
}
.vote-ranking-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.vote-ranking-column {
  min-width: 0;
}
.vote-ranking-column:only-child {
  grid-column: 1 / -1;
}
.vote-win-chip {
  /* A passive label follows the text height, including in card headers. */
  min-height: 0;
  min-width: 0;
  flex-shrink: 0;
  padding-block: 0;
  line-height: var(--control-line-height);
}
/* The running round has no collapse toggle, so its heading takes the
   toggle's inset and height instead. */
.vote-round-heading {
  flex: 1 1 auto;
  min-height: var(--control-height);
  padding: var(--space-2);
}
.vote-round-heading h2 {
  margin: 0;
  font-size: var(--font-size-lg);
}
/* The viewer's own Skill beside each game, in the Skill blue. */
.vote-own-skill {
  color: var(--accent);
}
.vote-own-skill.is-missing {
  color: var(--text-muted);
}
/* „Bock übernehmen“ stays beside „Speichern“ and wraps below the progress
   text on narrow cards instead of squeezing it. */
.event-poll-save-row.event-poll-footer:has(.vote-save-actions) {
  flex-wrap: wrap;
}
.vote-save-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-left: auto;
}
.vote-adopt-bock[hidden] {
  display: none;
}
/* Sits in the voter column, which stays empty while the round runs. */
.vote-decline-tag {
  white-space: nowrap;
}
.vote-result-meta {
  font-size: var(--font-size-xs);
  overflow-wrap: anywhere;
}
.vote-empty-state {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(var(--row-min-h) * 2);
}
/* The start dialog's game list: search on its own row, then the bulk toggle,
   sorting and the filter menu of the Spielekatalog. */
.game-catalog-toolbar.vote-game-toolbar {
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
}
.vote-game-toolbar > input[type='search'] {
  grid-column: 1 / -1;
}
.vote-game-option {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}
.vote-game-option-meta {
  font-size: var(--font-size-xs);
}
.vote-game-search-empty {
  font-size: var(--font-size-xs);
}
@media (min-width: 640px) { /* --bp-md */
  .vote-game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vote-ranking-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-6);
  }
}
/* Inside the dialog the catalog's phone menus open below their trigger
   instead of above the (covered) bottom navigation. */
@media (max-width: 639px) { /* --bp-md */
  .vote-game-toolbar .game-catalog-sort-menu .game-catalog-sort-panel,
  .vote-game-toolbar .game-catalog-filter-menu .game-catalog-filter-panel {
    position: absolute;
    max-height: none;
    overflow-y: visible;
  }
  .vote-game-toolbar .game-catalog-sort-menu .game-catalog-sort-panel {
    inset: calc(100% + var(--space-1)) auto auto 0;
    width: 100%;
  }
  .vote-game-toolbar .game-catalog-filter-menu .game-catalog-filter-panel {
    inset: calc(100% + var(--space-1)) 0 auto auto;
    width: min(16rem, calc(100vw - var(--space-8)));
  }
}

/* ---------- Leaderboard ---------- */

.grouped-page-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.grouped-page-section {
  min-width: 0;
}
.grouped-page-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.grouped-page-section .empty-state {
  display: flex;
  /* Was 2x row height: fine for a single empty section, but several pages
     (Hall of Fame, Checkliste) stack two or three of these in one view on a
     fresh install, and the doubled height compounds into a wall of blank
     space for a couple of short German sentences. */
  min-height: var(--row-min-h);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.primary-collection-section > .empty-state {
  min-height: calc(var(--row-min-h) * 2);
}
/* A titled card with nothing but its empty state collapses to one row, as
   high as a closed collapsible card: the empty text is centered over the
   card and sits on the title's line, and header actions stay clickable.
   The same applies to an opened collapsible whose content is only its empty
   state. Phones keep the text on its own compact line, because a centered
   line would collide with the title there. */
.card:has(> .grouped-page-section-title:first-child + .empty-state:last-child),
.card:has(> .grouped-page-section-title:first-child + :last-child > .empty-state:only-child),
.collapsible-section[open]:has(> .collapsible-section-content > .empty-state:only-child) {
  position: relative;
}
.card:has(> .grouped-page-section-title:first-child + .empty-state:last-child) > .grouped-page-section-title,
.card:has(> .grouped-page-section-title:first-child + :last-child > .empty-state:only-child) > .grouped-page-section-title {
  align-items: center;
  min-height: var(--tap-target-size);
}
.collapsible-section[open]:has(> .collapsible-section-content > .empty-state:only-child) > .collapsible-section-header {
  margin-bottom: 0;
}
@media (min-width: 640px) { /* --bp-md */
  /* A wrapper around the empty state leaves the flow with it, so its own gap
     or padding cannot add height to the card. */
  .card > .grouped-page-section-title:first-child + :last-child:has(> .empty-state:only-child) {
    position: absolute;
    inset: 0;
    padding: 0;
    pointer-events: none;
  }
  .card > .grouped-page-section-title:first-child + :last-child > .empty-state:only-child {
    height: 100%;
  }
  .card > .grouped-page-section-title:first-child + .empty-state:last-child,
  .card > .grouped-page-section-title:first-child + :last-child > .empty-state:only-child,
  .collapsible-section[open] > .collapsible-section-content > .empty-state:only-child {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0;
    pointer-events: none;
  }
  .card > .grouped-page-section-title:first-child + :last-child > .empty-state:only-child {
    position: static;
  }
}
@media (max-width: 639px) { /* --bp-md */
  .card > .grouped-page-section-title:first-child + .empty-state:last-child,
  .card > .grouped-page-section-title:first-child + :last-child > .empty-state:only-child,
  .collapsible-section[open] > .collapsible-section-content > .empty-state:only-child {
    min-height: 0;
    padding: var(--space-2) 0 0;
  }
}
.grouped-page-section-title h2 {
  margin: 0;
  font-size: var(--font-size-lg);
}
/* The 32px info target must remain easy to hit without making only the titles
   carrying help sit lower than every other card heading. Its negative outer
   margin keeps the hit area while removing that extra height from flex
   layout. */
.grouped-page-section-title .info-tooltip-trigger,
.card h2.title-with-info .info-tooltip-trigger,
.draw-tournament-form .title-with-info .info-tooltip-trigger {
  margin-block: calc(-1 * var(--space-3));
}
/* Bare h2 headings still appear in game/result cards. Keep their type scale
   consistent with the structured grouped-page headers across every area. */
.card h2 {
  font-size: var(--font-size-lg);
}
.card > h2,
.card > .row-between > h2,
.card > .title-with-info > h2 {
  margin: 0;
}
/* Card surfaces alternate by actual nesting, whether or not a card can
   collapse. Event participants use the same surface without a .card class.
   Flat person/item rows and menus are controls, not another card level. */
.card .card {
  background: var(--bg-elevated-2);
  box-shadow: none;
}
.card .card .card {
  background: var(--bg-elevated);
}
.card .card .card .card {
  background: var(--bg-elevated-2);
}
.card .card .card .card .card {
  background: var(--bg-elevated);
}
.two-column-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}
/* LAN-Bereitschaft: each check and its header align their status to the
   trailing edge; the disclosure chevron belongs to the leading title. */
.readiness-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}
.readiness-status .ui-icon {
  width: var(--font-size-md);
  height: var(--font-size-md);
}
.readiness-status[data-readiness-state='ready'] .ui-icon {
  color: var(--state-playing);
}
.readiness-status[data-readiness-state='warning'] .ui-icon {
  color: var(--state-paused);
}
.readiness-status[data-readiness-state='error'] .ui-icon {
  color: var(--danger);
}
/* Konten: the group title names the role, so most rows carry no meta line;
   every row keeps the height of a row with one, so both columns stay even. */
.admin-account-group .profile-row-text {
  justify-content: center;
  min-height: calc(var(--control-height) + var(--space-2));
}
.admin-account-group .profile-row-meta {
  margin-top: 0;
}
/* Accounts are a long list of short rows, so they sit closer together. */
.admin-account-group .profile-row {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.admin-account-group .profile-row:first-child {
  padding-top: 0;
}
.admin-account-group .profile-row:last-child {
  padding-bottom: 0;
}
@media (min-width: 860px) { /* --bp-lg */
  .admin-account-group .profile-row.is-column-top {
    padding-top: 0;
  }
  .admin-account-group .profile-row.is-column-bottom {
    padding-bottom: 0;
  }
  .admin-account-group .profile-rows-columns > .profile-row:last-child:not(.is-column-bottom) {
    padding-bottom: var(--space-2);
  }
}
/* Admin dialogs: a lone submit sits right-aligned at the end. */
.admin-dialog-footer {
  display: flex;
  justify-content: flex-end;
}
@media (min-width: 640px) { /* --bp-md */
  .two-column-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-column-card-grid > :only-child,
  .two-column-card-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .two-column-card-grid.food-order-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.lb-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.lb-row:last-child {
  border-bottom: none;
}
.leaderboard-list-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}
.leaderboard-list-grid > .lb-row {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
}
.leaderboard-list-grid > .lb-row:only-child,
.leaderboard-list-grid > .empty-state {
  grid-column: 1 / -1;
}
.food-order-card,
.event-card {
  position: relative;
  align-content: start;
  overflow: hidden;
}
/* The card clips its own content by design, but that same clip cut off the add-item
   description field's suggestion dropdown (.search-select-list) whenever it
   had less room below the input than the open list needed, hiding or
   truncating later suggestions instead of letting them float over the next
   card the way the shared .search-select component does everywhere else. */
.food-order-card:has(.search-select.is-open),
.food-order-card:has(.action-menu[open]),
.event-card:has(.action-menu[open]) {
  overflow: visible;
}
.food-order-meta,
.food-order-overview {
  font-size: var(--font-size-xs);
}
.food-order-details {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.food-order-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.food-order-send-at {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.food-order-detail-icon {
  display: inline-flex;
  flex: 0 0 auto;
}
.food-order-details-note {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
/* The menu link closes the meta line as a plain accent link. */
.food-order-meta-link {
  color: var(--accent);
  text-decoration: none;
}
@media (hover: hover) {
  .food-order-meta-link:hover {
    text-decoration: underline;
  }
}
/* Neutral card actions match the bordered "Aktion" menu trigger. */
.food-order-card-header-end > .btn,
.food-order-add-button {
  border: 1px solid var(--border);
}
.food-order-card-header {
  align-items: center;
  min-height: var(--tap-target-size);
}
.food-order-card > .food-order-card-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}
/* A long order title wraps; the header actions keep one line. */
.food-order-card > .food-order-card-header .food-order-card-title {
  overflow-wrap: anywhere;
  white-space: normal;
}
.food-order-card > .food-order-card-header > .food-order-card-header-end {
  flex-shrink: 0;
  white-space: nowrap;
}
.food-order-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.food-order-card-header-toggle {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.food-order-card-header-end {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
/* The section title wraps on phones; its primary action keeps one line. */
.food-order-open-section > .grouped-page-section-title > .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
/* Title, meta, info and links read as one block below the header. */
.food-order-card-lead {
  display: grid;
  gap: var(--space-2);
  margin-top: calc(-1 * var(--space-2));
}
.food-order-card-lead > .food-order-meta {
  font-size: var(--font-size-sm);
}
/* Read like an invoice: every amount of an order card sits in the last,
   right-aligned column together with its copy action. Every group row
   carries the same controls (Bezahlt, plus PayPal when the order has a link),
   so the auto-sized controls column has one width per card and never gaps. */
.food-order-card {
  --food-order-amount-width: 5.5rem; /* design-token-ok: widest euro amount of an order line */
  --food-order-amount-column: calc(var(--control-height) + var(--space-1) + var(--food-order-amount-width));
}
.food-order-items .food-order-group-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--food-order-amount-column);
  align-items: center;
  gap: var(--space-3);
}
.food-order-items .food-order-item,
.food-order-card .food-order-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--food-order-amount-column);
  align-items: center;
  gap: var(--space-3);
}
.food-order-items .food-order-group-actions {
  display: inline-flex;
  gap: var(--space-2);
  margin-left: 0;
}
.food-order-items .food-order-group-amount-wrap,
.food-order-card .food-order-total-value {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}
.food-order-group-amount-wrap > .food-order-group-copy,
.food-order-total-value > .food-order-item-copy {
  width: var(--control-height);
  min-width: var(--control-height);
}
.food-order-items .food-order-group-amount,
.food-order-card .food-order-total-value > strong {
  min-width: var(--food-order-amount-width);
  text-align: right;
  white-space: nowrap;
}
.food-order-items .food-order-group-amount.muted {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}
.food-order-items .food-order-item-amount {
  justify-self: end;
  white-space: nowrap;
}
/* The inline remove action is exactly one text line high and sits on the
   description's first line, also when a long description wraps. */
.food-order-item-main {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: var(--space-1);
}
.food-order-item-main > .food-order-item-description {
  flex: 0 1 auto;
}
.food-order-item-main > .food-order-item-remove {
  flex: none;
  width: var(--space-6);
  min-width: var(--space-6);
  height: 1lh;
  min-height: 0;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
}
.food-order-item-main > .food-order-item-remove .ui-icon {
  width: calc(var(--space-3) + var(--space-1) / 2);
  height: calc(var(--space-3) + var(--space-1) / 2);
}
.food-order-item-unit {
  font-size: var(--font-size-xs);
  white-space: nowrap;
}
/* Checkbox-like paid marker: an empty box while open, a checked box once
   paid. The label stays "Bezahlt" so the marker never changes width. */
.payment-paid-box {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--space-4);
  height: var(--space-4);
  border: 1px solid currentColor;
  border-radius: var(--space-1);
}
.payment-paid-box svg {
  width: var(--space-3);
  height: var(--space-3);
}
.payment-paid-marker.is-paid .payment-paid-box {
  background: var(--state-playing);
  border-color: var(--state-playing);
  color: var(--bg);
}
.food-order-card-chevron {
  display: inline-flex;
  color: var(--text-muted);
  transition: transform var(--motion-fast);
}
.food-order-card-header-toggle[aria-expanded='true'] .food-order-card-chevron {
  transform: rotate(90deg);
}
.food-order-card-body[hidden] {
  display: none;
}
/* Orderer groups are flat rows divided by hairlines inside the order card. */
.food-order-items {
  display: grid;
}
.food-order-items > .food-order-group {
  padding: var(--space-2) 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
}
.food-order-items > .food-order-group.is-all-paid {
  background: none;
}
.food-order-items > .empty-state-food-items {
  border-bottom: 1px solid var(--border);
}
.food-order-group {
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.food-order-group.is-all-paid {
  background: transparent;
  opacity: 0.78;
}
.food-order-group-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2);
}
/* The group toggle is one sibling of the payment and delete controls. */
.food-order-group-toggle {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.food-order-group-static {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
}
.food-order-group-chevron {
  flex-shrink: 0;
  transition: transform var(--motion-fast);
}
.food-order-group-toggle[aria-expanded='true'] .food-order-group-chevron {
  transform: rotate(90deg);
}
.food-order-group-headtext {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
}
.food-order-group-headtext strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.food-order-group-self-label {
  font-weight: var(--font-weight-regular);
}
.food-order-group-meta {
  font-size: var(--font-size-xs);
}
.food-order-group-amount-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.food-order-group-amount {
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}
.food-order-group-amount.is-paid {
  color: var(--text-muted);
  text-decoration: line-through;
}
.food-order-group-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}
.food-order-group-actions .payment-paid-marker {
  min-height: var(--control-height);
}
.food-order-group-items {
  padding-left: calc(var(--space-5) + var(--space-2));
}
.food-order-items .food-order-group-items {
  padding-left: calc(var(--space-4) + var(--space-2) + var(--avatar-size-sm) + var(--space-2));
}
.food-order-items .food-order-group.is-static .food-order-group-items {
  padding-left: calc(var(--avatar-size-sm) + var(--space-2));
}
/* One line per position: quantity × description / amount / remove. */
.food-order-item {
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: var(--font-size-sm);
}
/* The person's two-state payment marker stays stable as its label changes. */
.payment-paid-marker {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: var(--payment-marker-width);
  min-height: var(--space-7);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}
.payment-paid-marker.is-paid {
  border-color: var(--state-playing);
  background: var(--state-playing-bg);
  color: var(--state-playing);
}
.payment-paid-marker:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.food-order-item-description {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
/* Betrag ist Anzeige, kein Knopf - a plain display block. */
.food-order-item-amount {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}
.food-order-item-amount .muted {
  font-size: var(--font-size-xs);
}
.food-order-item-action {
  width: var(--tap-target-size);
  min-height: var(--control-height);
  flex-shrink: 0;
  padding: var(--space-1);
  font-size: var(--font-size-xs);
}
.food-order-item-action:disabled,
.food-order-item-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.food-order-item-remove {
  color: var(--text-muted);
}
/* Deliberately heavier than the surrounding muted meta/info text (send time,
   notes, per-item rows) so the order-wide total reads as a real total at a
   glance instead of blending in as another info line. */
.food-order-total {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.food-order-total-label {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}
.food-order-total-note {
  margin-left: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
}
.food-order-card .food-order-total {
  padding-top: 0;
  border-top: 0;
}
.food-order-total-value {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.food-order-total-value strong {
  font-size: var(--font-size-lg);
  font-variant-numeric: tabular-nums;
}
/* Used by confirmWithList to show the affected positions alongside the
   confirmation message. */
.food-order-confirm-list {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}
.food-order-confirm-list li {
  overflow-wrap: anywhere;
}
/* AP4: consolidated order list dialog as a small table: dish, unit price
   and line sum, with the totals as its footer. */
.food-order-consolidated-rows {
  max-height: 50vh;
  overflow-y: auto;
}
.food-order-consolidated-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}
.food-order-consolidated-table th,
.food-order-consolidated-table td {
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  font-weight: var(--font-weight-regular);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}
.food-order-consolidated-table th:first-child,
.food-order-consolidated-table td:first-child {
  padding-left: 0;
  text-align: left;
  white-space: normal;
}
.food-order-consolidated-table thead th {
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}
.food-order-consolidated-table tbody tr:first-child td {
  padding-top: var(--space-2);
}
.food-order-consolidated-table tfoot tr:first-child > * {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.food-order-consolidated-table .food-order-consolidated-total > * {
  font-weight: var(--font-weight-bold);
}
.food-order-consolidated-row-desc {
  overflow-wrap: anywhere;
}
.food-order-form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-3);
}
.food-order-item-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: var(--space-2);
}
.food-order-item-form > .food-order-desc-field {
  grid-column: 1 / -1;
}
.food-order-add-button {
  grid-column: -2 / -1;
  align-self: center;
}
.food-order-item.is-paid .food-order-item-description,
.food-order-item.is-paid .food-order-item-amount {
  text-decoration: line-through;
}
@media (max-width: 639px) { /* --bp-md */
  /* Two rows per orderer group instead of three: who, then how much together
     with what you can do about it. Giving the amount a full-width row of its
     own left the action cluster alone on a third row with nothing beside it,
     which reads as a layout fault rather than as a footer. Wrapping decides
     the fallback: amount and cluster share the second row wherever they fit
     and the cluster drops onto a right-aligned row of its own only where they
     genuinely cannot, so no supported width strands a single control. */
  .food-order-group-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  /* The name keeps a row to itself: player names, the `(du)` marker and the
     position count need the full width far more often than they leave the
     240px the four controls occupy. */
  .food-order-group-toggle,
  .food-order-group-static {
    flex: 1 1 100%;
  }
  /* The sum belongs to the person named directly above it, so it starts at
     the same edge instead of floating alone against the opposite one, and
     keeps its tip note on the same line. */
  .food-order-group-amount-wrap {
    flex: 0 1 auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
  }
  /* A group holding a single position repeats itself: lineTotalCents() already
     folds the tip into that position's own amount, so the group sum prints the
     identical number one row further down. Drop it on phones, where that
     duplicate costs a whole row. A collapsed group keeps its sum, because its
     position rows are hidden and the sum is then the only amount on screen —
     renderItems() decides that and re-renders on every toggle.
     Deliberately a render-time class rather than `:has()` on an ancestor: the
     `.food-order-group:has(… :only-child) .food-order-group-amount-wrap` form
     made every DOM mutation in the app pay for :has() invalidation and stalled
     unrelated views, which showed up as a 30s timeout in the Home checklist
     E2E. The existing :has() rules in this repository all qualify their own
     subject and stay cheap. */
  .food-order-group.is-single-position .food-order-group-amount-wrap {
    display: none;
  }
  /* The cluster fills whatever the row leaves it rather than shrinking to its
     own contents. That keeps its width a property of the layout instead of the
     marker's label, so the `Bezahlt?`/`Bezahlt` flip cannot resize the cluster
     and drag the marker sideways. Wrapping is still decided before shrinking,
     so a row too narrow for amount plus cluster moves the cluster down whole
     instead of squeezing both. */
  .food-order-group-actions {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: 0;
  }
  /* The marker keeps its token width wherever it fits and only gives up the
     few pixels a 360px group box is short, so the whole cluster stays on one
     line. It never grows past the token, so the `Bezahlt?`/`Bezahlt` flip
     still cannot move it or its neighbours. */
  .food-order-group-actions .payment-paid-marker {
    flex: 0 1 var(--payment-marker-width);
    width: auto;
    min-width: 0;
    padding-inline: var(--space-1);
  }
  .food-order-group-items {
    padding-left: 0;
  }
  /* Two rows per position: the description, then amount and actions sharing
     one line so the icons keep the same right edge as the group's action row
     instead of trailing under the amount. */
  .food-order-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }
  .food-order-item-description {
    grid-column: 1 / -1;
  }
  .food-order-total {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  /* Description on its own row, quantity and price share the next one and
     the add button sits compact at the bottom right. */
  .food-order-item-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .food-order-item-form > .food-order-desc-field {
    grid-column: 1 / -1;
  }
  .food-order-add-button {
    grid-column: 2;
    justify-self: end;
  }
  /* Too narrow for title and actions side by side: the actions move below
     the title as one unbroken right-aligned group. */
  .food-order-card > .food-order-card-header {
    flex-wrap: wrap;
  }
  .food-order-card > .food-order-card-header > :first-child {
    flex: 1 1 10rem;
  }
  .food-order-card > .food-order-card-header > .food-order-card-header-end {
    margin-left: auto;
  }
  /* In an order card the person's sum stays on the name row above the
     position amounts; Bezahlt and PayPal take the second row, right-aligned. */
  .food-order-card {
    --food-order-amount-width: 4.5rem; /* design-token-ok: widest euro amount of an order line at phone size */
  }
  .food-order-items .food-order-group-header {
    grid-template-columns: minmax(0, 1fr) var(--food-order-amount-column);
  }
  .food-order-items .food-order-group-toggle,
  .food-order-items .food-order-group-static {
    flex: none;
  }
  .food-order-items .food-order-group-amount-wrap {
    grid-row: 1;
    grid-column: 2;
  }
  .food-order-items .food-order-group-actions {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .food-order-items .food-order-group.is-single-position .food-order-group-amount-wrap {
    display: flex;
  }
  .food-order-items .food-order-item-description {
    grid-column: auto;
  }
  .food-order-card .food-order-total {
    flex-direction: row;
  }
  .food-order-items .food-order-group-items,
  .food-order-items .food-order-group.is-static .food-order-group-items {
    padding-left: 0;
  }
}
@media (max-width: 359px) { /* design-token-ok: compact payment marker below the smallest supported phone width */
  /* Below the smallest supported phone width the three icon targets plus a
     readable marker label no longer share one line. Wrapping keeps every
     label complete instead of clipping the marker's text. */
  .food-order-group-actions {
    --payment-marker-width: 88px;
    flex-wrap: wrap;
    row-gap: var(--space-1);
  }
}
.food-order-quantity-field {
  display: block;
  min-width: 0;
}
.food-order-price-field {
  position: relative;
  display: block;
  min-width: 0;
}
/* The element prefix keeps this ahead of the base input[type=...] rule,
   which otherwise resets padding-right and lets text run under the €
   suffix on narrow fields. Quantity has no such suffix: it is a
   type="number" field, so numberStepper.js already reserves its own
   right-hand padding for the +/- overlay — a decorative × there used to sit
   underneath those buttons and looked like a broken, non-functional third
   control. */
input.food-order-price-input {
  width: 100%;
  padding-right: var(--space-7);
}
.food-order-quantity-input {
  width: 100%;
  text-align: left;
}
.food-order-price-field > span {
  position: absolute;
  top: 50%;
  right: var(--space-3);
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.checklist-progress-count {
  margin-left: var(--space-2);
  color: var(--text-muted);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
}
.checklist-progress {
  display: block;
  height: var(--space-2);
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--border);
}
.checklist-progress-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}
.checklist-item-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--row-icon-size);
  min-width: 0;
  padding: var(--space-1) 0;
  border-top: 1px solid var(--border);
}
.checklist-item-row:first-child {
  border-top: 0;
}
.checklist-item-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--space-6);
}
@media (min-width: 640px) { /* --bp-md */
  .checklist-item-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .checklist-item-row:nth-child(2) {
    border-top: 0;
  }
}
.checklist-item-remove {
  color: var(--text-muted);
}
.checklist-item-list:not(.is-editing) .checklist-item-remove {
  display: none;
}
.checklist-item-label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.checklist-item-row.is-checked .checklist-item-label span {
  color: var(--text-muted);
  text-decoration: line-through;
}
/* To-Dos: one table without column headers, one column of rows; the cells
   explain themselves ("Fällig morgen"). Phones show "Wer" and "Fällig"
   below the title. */
.checklist-task-toolbar {
  grid-template-columns: minmax(10rem, 1fr) repeat(2, 9.5rem) auto;
}
.checklist-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 16rem) 10rem 7rem;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}
/* The card's own padding follows the last row. */
.checklist-table-row:last-child {
  padding-bottom: 0;
}
.checklist-table-row[hidden] {
  display: none;
}
/* Every cell keeps the button height, so rows with and without
   "Eintragen" are equally high and all texts share one center line. */
.checklist-table-row > [role='cell'] {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: var(--control-height);
}
.checklist-table-task > *,
.checklist-table-who > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.checklist-table-who,
.checklist-table-due {
  font-size: var(--font-size-sm);
}
.checklist-table-who {
  gap: var(--space-2);
}
.checklist-table-who-me {
  font-weight: var(--font-weight-bold);
}
.checklist-table-who-more {
  flex: none;
  color: var(--text-muted);
}
.checklist-table-action {
  justify-content: flex-end;
}
/* Done To-Dos stay in the list until archived: struck through and muted,
   like a ticked Packliste entry. */
.checklist-table-row.is-done .checklist-task-title {
  color: var(--text-muted);
  text-decoration: line-through;
}
.checklist-table-row.is-done .checklist-table-who,
.checklist-table-row.is-done .checklist-table-due {
  color: var(--text-muted);
}
/* "Eintragen" and "Austragen" fill the fixed action column, so both share
   one width and their edges line up from row to row. */
.checklist-table-action > .btn {
  position: relative;
  width: 100%;
}
/* The title opens the To-Do's details; it reads as text, not as a button,
   and its hit area covers the whole row. */
.checklist-task-title::after {
  content: '';
  position: absolute;
  inset: 0;
}
.checklist-task-title {
  max-width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: var(--font-weight-medium);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
@media (hover: hover) {
  .checklist-table-row:hover .checklist-task-title {
    color: var(--accent);
  }
}
/* Detail dialog: the description reads as the body, the facts follow as
   hairline rows with a muted label column. */
.checklist-detail-description {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.checklist-detail-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0;
  font-size: var(--font-size-sm);
}
.checklist-detail-facts dt,
.checklist-detail-facts dd {
  margin: 0;
  padding: var(--space-1) 0;
  border-top: 1px solid var(--border);
}
.checklist-detail-facts dt {
  padding-right: var(--space-5);
  color: var(--text-muted);
}
.checklist-detail-facts dd {
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
/* The detail dialog only holds a few short facts. */
.modal.checklist-detail-modal {
  max-width: 400px;
}
.checklist-filter-options {
  display: grid;
  gap: var(--space-1);
}
.checklist-filter-options > .btn {
  justify-content: flex-start;
}
.checklist-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
/* The chosen option gets the blue outline; the gradient stays reserved for
   the one submit at the end of the form. */
.checklist-choice-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.checklist-choice-toolbar .btn.is-selected {
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
}
@media (max-width: 639px) { /* --bp-md */
  /* Phones: search beside the create button, sort beside filter. */
  .checklist-task-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .checklist-task-toolbar > input[type='search'] {
    grid-column: auto;
  }
  .checklist-task-toolbar > .btn-primary {
    grid-row: 1;
    grid-column: 2;
  }
  /* Title and the (possibly empty) action column fill the first line;
     "Wer" and the due date follow as one compact line. */
  .checklist-table-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: var(--space-3);
    padding: var(--space-2) 0;
  }
  .checklist-table-task {
    flex: 1 1 calc(100% - 7rem - var(--space-3));
  }
  .checklist-table-action {
    flex: 0 0 7rem;
  }
  .checklist-table-who,
  .checklist-table-due {
    order: 2;
    min-height: 0;
    color: var(--text-muted);
  }
  .checklist-table-due:not(:empty)::before {
    content: '·';
    margin-right: var(--space-3);
  }
}
.hall-of-fame-event-range {
  font-size: var(--font-size-sm);
}
.hall-of-fame-event-section {
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.grouped-page-section .hall-of-fame-event-section > .empty-state {
  min-height: 0;
  padding: var(--space-2) 0;
}
.hall-of-fame-subtitle {
  margin: 0;
}
.hall-of-fame-champion {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 640px) { /* --bp-md */
  .food-order-item-form {
    grid-template-columns: minmax(0, 1fr) repeat(2, var(--assignment-select-width)) auto;
  }
  .food-order-item-form > .food-order-desc-field {
    grid-column: auto;
  }
}
.lb-rank {
  font-weight: var(--font-weight-black);
  color: var(--text-muted);
  width: 1.6em;
  text-align: center;
}
.lb-row.rank-1 .lb-rank,
.event-poll-options.is-ranked .lb-rank.is-first {
  color: var(--rank-1-gold);
}
.leaderboard-row-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
}
.leaderboard-row-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.check-row > .leaderboard-row-name {
  flex: 1;
}
.leaderboard-row-stat {
  font-size: var(--font-size-xs);
}
.lb-points {
  margin-left: auto;
  font-weight: var(--font-weight-bold);
}
/* Ergebnis eintragen: game and team count share one line; the sections below
   are flat with a hairline instead of nested accent panels. */
.match-form-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--space-8) * 2);
  align-items: end;
  gap: var(--space-3);
}
.match-form-head.is-ffa {
  grid-template-columns: minmax(0, 1fr);
}
.match-form-section {
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.match-form-subtitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0;
}
.match-form-subtitle .muted {
  font-weight: var(--font-weight-regular);
  letter-spacing: 0;
  text-transform: none;
}
/* The shared search grows along a toolbar row; stacked in this column it
   keeps its natural height instead of that flex basis. */
.match-form-section > .selection-search {
  flex: none;
}
.match-player-empty {
  padding: var(--space-2) 0;
  text-align: center;
}
/* Flat hairline rows; one column below --bp-lg, where the dialog is too
   narrow for two columns of names plus team selects. */
.match-player-row {
  min-width: 0;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border);
}
.match-player-row:last-child {
  border-bottom: none;
}
.match-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 860px) { /* --bp-lg */
  /* Two columns of players, filled left column first like every list; the
     wider panel keeps full names next to the team selects. */
  .match-form-modal .modal {
    max-width: var(--wide-dialog-width);
  }
  .match-player-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--match-player-rows, 1), auto);
    grid-auto-flow: column;
    column-gap: var(--space-6);
  }
  .match-player-grid > .match-player-row:last-child,
  .match-player-grid > .check-row:last-child {
    border-bottom: 1px solid var(--border);
  }
}
.match-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, calc(var(--space-8) * 2));
  align-items: center;
  gap: var(--space-2);
}
.match-result-row + .match-result-row {
  margin-top: var(--space-2);
}
@media (min-width: 640px) { /* --bp-md */
  .leaderboard-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.home-page-subsection > h3 {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-md);
}
.home-my-status {
  flex-wrap: wrap;
}
.home-group-member {
  min-height: var(--row-min-h);
}
.home-group-overview-members {
  align-items: center;
}
.home-group-overview-open {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  text-align: right;
  cursor: pointer;
}
.home-group-overview-open .ui-icon {
  color: var(--text-muted);
}

@media (min-width: 1280px) { /* --bp-xl */
  :root[data-layout-mode='desktop'] .home-live-grid,
  :root[data-layout-mode='desktop'] #view-container[data-view='matchmaking'] .tournament-player-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  :root[data-layout-mode='desktop'] .home-live-grid > :last-child:nth-child(odd) {
    grid-column: auto;
  }
  :root[data-layout-mode='desktop'] .home-live-grid {
    grid-template-rows: repeat(var(--home-live-rows-3, 1), minmax(var(--home-player-row-height), auto));
  }
}

.empty-state-food-items {
  font-size: var(--font-size-sm);
  padding: var(--space-2) 0;
}

/* Match's draw/draft area is the only visible mode at a time, so it sits
   flat in the card: no nested panel, no accent rail (rule 3). */
.match-mode-panel > .check-row {
  border-bottom: none;
}
.match-mode-panel .card-footer-actions > .row {
  justify-content: flex-end;
}

/* "Turnier erstellen" from a draw: options share a wrapping row and the
   submit sits compact at the bottom right. */
.draw-tournament-options {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-6);
}
.draw-tournament-options > .check-row {
  padding-block: 0;
  border-bottom: none;
}
.draw-tournament-footer {
  display: flex;
  justify-content: flex-end;
}

.draw-tournament-team-names {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

/* Keep the copy action beside its field on narrow dialogs. */
.matchmaking-draw-server-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-columns: auto;
  grid-auto-flow: column;
}

/* Active lobbies: flat hairline rows inside one card. The credentials sit
   as code chips with their copy action and never wrap mid-name. */
.tournament-lobby-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) 0;
}
.tournament-lobby-row + .tournament-lobby-row {
  border-top: 1px solid var(--border);
}
.tournament-lobby-row:first-child {
  padding-top: 0;
}
.tournament-lobby-row:last-child {
  padding-bottom: 0;
}

/* ---------- Tournament: the signed-in player's own team ---------- */
/* One quiet marker for every place the own team appears among equal siblings:
   a thin accent edge plus a faint tint. Borders, winner/loser text and result
   chips keep their own meaning; a visually hidden „(dein Team)“ in the markup
   carries the same information for screen readers. Declared after the lobby
   row's first/last-child rules so the marked row keeps its inner padding. */
.bracket-team-row.is-mine,
.tournament-fixture.is-mine,
.tournament-lobby-row.is-mine,
.tournament-standings tr.is-mine td {
  background: var(--accent-bg-subtle);
}
.bracket-team-row.is-mine,
.tournament-fixture.is-mine,
.tournament-lobby-row.is-mine,
.tournament-team-card.is-mine {
  box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); /* design-token-ok: symmetric hairline-weight marker edges, not a spacing step */
}
.tournament-standings tr.is-mine td:first-child {
  box-shadow: inset 2px 0 0 var(--accent); /* design-token-ok: left marker on the table row's first cell */
}
.tournament-standings tr.is-mine td:last-child {
  box-shadow: inset -2px 0 0 var(--accent); /* design-token-ok: right marker on the table row's last cell */
}
.bracket-team-row.is-mine:first-child {
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}
.bracket-team-row.is-mine:last-child {
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}
/* Fixtures and lobby rows run edge to edge inside their card; the marked row
   steps out by its own inset so its text stays aligned with the unmarked rows. */
.tournament-fixture.is-mine,
.tournament-lobby-row.is-mine {
  margin-inline: calc(-1 * var(--space-2));
  padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
}
/* The tinted, rounded row is its own separator: the hairline above it would
   frame only its top edge (and bend into the rounded corners), and the one
   below would stop short of its stepped-out edges, so the marker looked cut
   off at the bottom. Dropping its own line also keeps the content centered. */
.tournament-fixture.is-mine,
.tournament-lobby-row.is-mine {
  border-top: 0;
}
.tournament-fixture.is-mine + .tournament-fixture,
.tournament-lobby-row.is-mine + .tournament-lobby-row {
  border-top-color: transparent;
}
.tournament-lobby-row.is-mine {
  padding-block: var(--space-2);
}
.tournament-lobby-row .tournament-lobby-matchup {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tournament-lobby-row .tournament-lobby-matchup .muted {
  font-size: var(--font-size-sm);
}
.tournament-lobby-row .tournament-lobby-access {
  flex: 0 1 auto;
  align-items: center;
  column-gap: var(--space-4);
}
.tournament-lobby-row .tournament-lobby-credential {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
}
.tournament-lobby-credential-label {
  min-width: calc(var(--space-8) + var(--space-3));
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.tournament-lobby-credential-value {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
}


/* Stimmen dialog: numbered legend plus one person x option table. */
.event-poll-vote-legend {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.event-poll-vote-legend-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  min-width: 0;
}
.event-poll-vote-legend-label {
  flex: 1;
  min-width: 0;
  font-weight: var(--font-weight-medium);
  overflow-wrap: anywhere;
}
.event-poll-vote-legend-summary {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}
.event-poll-vote-number {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size-sm);
  height: var(--avatar-size-sm);
  border-radius: var(--radius-full);
  background: var(--bg-elevated-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}
.event-poll-vote-number.is-win {
  background: var(--state-playing-bg);
  color: var(--state-playing);
}
.event-poll-vote-key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  font-size: var(--font-size-xs);
}
.event-poll-vote-key > span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.event-poll-vote-table-wrap {
  overflow-x: auto;
}
/* Many options must not squeeze the person column to nothing: the table keeps
   room for a name plus every answer column (--vote-columns is set by
   voteBreakdown.js) and scrolls sideways instead, with the names pinned. */
.event-poll-vote-table {
  width: 100%;
  min-width: calc(var(--space-8) * 3 + var(--vote-columns, 0) * (var(--space-7) + var(--space-3)));
  table-layout: fixed;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.event-poll-vote-col {
  width: calc(var(--space-7) + var(--space-3));
}
.event-poll-vote-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  padding-right: var(--space-2);
  background: var(--bg-elevated);
}
.event-poll-vote-table th,
.event-poll-vote-table td {
  padding: var(--space-1) 0;
  text-align: center;
}
.event-poll-vote-table thead th {
  padding-bottom: var(--space-2);
}
.event-poll-vote-table tbody tr {
  border-top: 1px solid var(--border);
}
.event-poll-vote-table tbody th {
  font-weight: var(--font-weight-medium);
  text-align: left;
}
.event-poll-vote-table tbody th .player-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.event-poll-vote-table .event-poll-voter-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-poll-vote-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
}
.event-poll-vote-cell .ui-icon {
  width: 16px; /* design-token-ok: matches the compact legend glyph */
  height: 16px; /* design-token-ok: matches the compact legend glyph */
}
/* Neutral on purpose: brightness, not color, separates the answers. */
.event-poll-vote-cell.is-can {
  color: var(--text);
}
.event-poll-vote-cell.is-if-needed,
.event-poll-vote-cell.is-empty {
  color: var(--text-muted);
}
.event-poll-vote-cell.is-cannot {
  color: var(--text-muted);
  opacity: 0.55;
}

/* Spieler-Details: one Bock/Skill row per game with sortable headers. */
.player-detail-ratings {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.player-detail-rating-col {
  width: calc(var(--space-8) + var(--space-4));
}
.player-detail-ratings th,
.player-detail-ratings td {
  padding: var(--space-1) 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.player-detail-ratings thead th {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}
.player-detail-ratings th:first-child {
  text-align: left;
}
.player-detail-ratings tbody tr {
  border-top: 1px solid var(--border);
}
.player-detail-ratings tbody th {
  overflow: hidden;
  font-weight: var(--font-weight-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-detail-ratings tbody td {
  font-weight: var(--font-weight-bold);
}

/* Spiele: "Spiel vorschlagen" closes the tab row on the right. */
.game-catalog-tab-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.game-catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
}
.game-catalog-tab-row > .btn {
  flex: none;
}
.game-catalog-suggest-icon {
  display: none;
}
@media (max-width: 479px) { /* --bp-sm */
  .game-catalog-suggest {
    width: var(--control-height);
    padding: 0;
  }
  .game-catalog-suggest-label {
    display: none;
  }
  .game-catalog-suggest-icon {
    display: inline-flex;
  }
}

/* Durchsage: form with message and end time in one row, and the running
   and past broadcasts as one calm table without column headers. */
.broadcast-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}
@media (min-width: 640px) { /* --bp-md */
  .broadcast-form-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  }
}
/* Starts as one line like every other field and grows with line breaks. */
#broadcast-message,
#feedback-message,
#event-description {
  display: block;
  field-sizing: content;
  min-height: var(--control-height);
  max-height: calc(var(--control-height) * 5);
  resize: none;
}
/* The four feedback kinds share the field width in equal columns, so the
   choice ends flush with the message field below it. */
#feedback-sentiment-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.broadcast-form-footer {
  display: flex;
  justify-content: flex-end;
}
/* As wide as the time field above it (.dt-time-input), so the button ends
   the form flush with the field. */
.broadcast-form-footer > .btn {
  width: 88px;
}
.broadcast-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 10rem) 13rem 7rem;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}
.broadcast-table-row:last-child {
  padding-bottom: 0;
}
/* Every cell keeps the button height, so rows with and without "Beenden"
   are equally high and all texts share one center line. */
.broadcast-table-row > [role='cell'] {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: var(--control-height);
}
.broadcast-table-sender > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.broadcast-table-sender,
.broadcast-table-when {
  font-size: var(--font-size-sm);
}
.broadcast-table-when {
  color: var(--text-muted);
}
.broadcast-table-me {
  font-weight: var(--font-weight-bold);
}
.broadcast-table-action {
  justify-content: flex-end;
}
.broadcast-table-action > .btn {
  position: relative;
  width: 100%;
}
/* The message opens the details; it reads as text, not as a button, and its
   hit area covers the whole row. */
.broadcast-table-open {
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: var(--font-weight-medium);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}
.broadcast-table-open::after {
  content: '';
  position: absolute;
  inset: 0;
}
.broadcast-table-row.is-past .broadcast-table-open {
  color: var(--text-muted);
  font-weight: var(--font-weight-regular);
}
@media (hover: hover) {
  .broadcast-table-row:hover .broadcast-table-open {
    color: var(--accent);
  }
}
@media (max-width: 639px) { /* --bp-md */
  /* Message and action fill the first line; sender and time follow as one
     compact line. */
  .broadcast-table-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    padding: var(--space-2) 0;
  }
  .broadcast-table-message {
    flex: 1 1 calc(100% - 7rem - var(--space-2));
  }
  .broadcast-table-action {
    flex: 0 0 7rem;
    order: 1;
  }
  .broadcast-table-sender,
  .broadcast-table-when {
    order: 2;
  }
  .broadcast-table-action:empty {
    display: none !important;
  }
  .broadcast-table-row:has(> .broadcast-table-action:empty) > .broadcast-table-message {
    flex-basis: 100%;
  }
  .broadcast-table-row > .broadcast-table-sender,
  .broadcast-table-row > .broadcast-table-when {
    min-height: 0;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
  }
  .broadcast-table-when::before {
    content: '·';
    margin-right: var(--space-2);
  }
}
/* Detail dialog: the full message keeps its line breaks, the facts follow as
   hairline rows with a muted label column. */
.broadcast-detail-message {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.broadcast-detail-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0;
  font-size: var(--font-size-sm);
}
.broadcast-detail-facts dt,
.broadcast-detail-facts dd {
  margin: 0;
  padding: var(--space-1) 0;
  border-top: 1px solid var(--border);
}
.broadcast-detail-facts dt {
  padding-right: var(--space-5);
  color: var(--text-muted);
}
.modal.broadcast-detail-modal {
  max-width: 400px;
}
.broadcast-detail-footer {
  display: flex;
  justify-content: flex-end;
}
/* LAN points: journal and pooled bets retain the shared card/control layout. */
.points-actions { flex-wrap: wrap; gap: var(--space-2); }
.points-tip { min-width: 0; overflow-wrap: anywhere; }
.points-report { min-width: 0; }
.points-report p, .points-report strong { min-width: 0; overflow-wrap: anywhere; }
.points-report .badge { flex-shrink: 0; white-space: nowrap; }
.points-betting-controls { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); min-width: 0; }
.points-betting-controls { justify-content: space-between; font-size: var(--font-size-sm); }
.points-betting-controls > span { min-width: 0; overflow-wrap: anywhere; }
#view-container[data-view='points'] .collapsible-section-header { flex-wrap: wrap; }
#view-container[data-view='points'] .collapsible-section-header > :nth-child(2) { flex-basis: auto; overflow-wrap: anywhere; }
#view-container[data-view='points'] .collapsible-section-header > .muted { font-size: var(--font-size-sm); }
.points-journal { margin: 0; padding: 0; list-style: none; }
.points-journal li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
.points-journal li[hidden] { display: none; }
.points-journal li > div { min-width: 0; overflow-wrap: anywhere; }
.points-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.points-chart { margin: 0; min-width: 0; }
.points-chart svg { display: block; width: 100%; height: auto; }
.points-chart text { fill: var(--text-muted); font-family: var(--font); font-size: var(--font-size-sm); }
.points-chart-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.points-chart-baseline { fill: none; stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.points-chart figcaption { flex-wrap: wrap; gap: var(--space-2); font-size: var(--font-size-xs); }
.points-chart figcaption > .row-between { flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 479px) { /* --bp-sm */
  #view-container[data-view='points'] [data-points-section^='tips-'] .profile-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  #view-container[data-view='points'] [data-points-section^='tips-'] .profile-row-action { justify-self: end; }
  .points-filters { grid-template-columns: minmax(0, 1fr); }
  .points-journal li { grid-template-columns: minmax(0, 1fr) auto; }
  .points-journal li > .btn { grid-column: 2; }
}
