.tournament-header {
  margin-bottom: var(--space-6);
}

/* Match Display */
.match-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.match-card {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--color-bg);
  height: 3.125rem;
}

.match-number {
  flex-shrink: 0;
  width: 3.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface);
  font-weight: bold;
  font-size: 0.875rem;
  border-right: 1px solid var(--color-border);
}

.match-players {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.match-player {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.625rem;
  font-size: 1rem;
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.player-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.match-player:last-child {
  border-bottom: none;
}

/* Large screen: side-by-side players */
@media (min-width: 750px) {
  .match-players {
    flex-direction: row;
  }
  
  .match-player {
    border-bottom: none;
    border-right: 1px solid var(--color-border);
  }
  
  .match-player:last-child {
    border-right: none;
  }
}

.match-player--winner {
  font-weight: bold;
  background-color: var(--color-bg);
}

.match-player--winner:after {
  content: "✓";
  color: var(--color-success);
  font-weight: bold;
  margin-left: 0.3125rem;
  flex-shrink: 0;
}

.match-player--loser {
  color: var(--color-text-muted);
}

.match-player--bye {
  font-style: italic;
  color: var(--color-text-muted);
}

.match-player--pending {
  background-color: var(--color-bg);
}

/* Match Score Display */
.match-score {
  margin-left: 0 0.1875rem;
  font-weight: normal;
  color: var(--color-text-muted);
}

.match-score--winner {
  color: var(--color-text);
}

.match-score--loser {
  color: var(--color-text-muted);
}

.match-score--tie {
  color: var(--color-text);
}

.match-player {
  position: relative;
}

.match-player:has(.match-score) {
  padding-right: 1.875rem;
}

.match-score {
  position: absolute;
  right: 0.625rem;
}

/* Desktop: Position scores toward center */
@media (min-width: 750px) {
  .match-score {
    position: absolute;
    right: 0.625rem;
  }

  .match-player + .match-player:has(.match-score) {
    padding-right: 0.625rem;
    padding-left: 1.875rem;
  }

  .match-player + .match-player .match-score {
    right: auto;
    left: 0.625rem;
  }
}

.match-actions {
  flex-shrink: 0;
  width: 3.125rem;
  border-left: 1px solid var(--color-border);
}

.match-edit-btn {
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: var(--color-surface);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
}

.match-edit-btn:hover {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

.match-edit-btn:before {
  content: "✎";
  font-size: 0.875rem;
}

/* Player Management Cards */
/* Players List */
.players-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.player-item {
  margin: 0;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-default);
}

.player-item:last-child {
  border-bottom: none;
}

.player-item:hover {
  background-color: var(--color-surface);
}

.player-line-1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.player-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}

.player-username {
  margin-left: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

.player-guest-badge {
  font-size: 1rem;
  font-weight: normal;
  color: var(--color-primary);
  margin-left: 0.3125rem;
}

.player-guest-badge:before {
  content: "(G)";
}

.player-registered {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

@media (min-width: 550px) {
  .player-line-1 {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
  }
}

.player-line-2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.player-actions {
  flex-shrink: 1;
}

/* Unmatched Players Section */
.unmatched-players-section {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.unmatched-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.625rem;
}

.unmatched-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem;
}

.unmatched-player-card .player-name {
  font-weight: bold;
  font-size: 0.875rem;
  flex-grow: 1;
}

.unmatched-player-card .player-seed {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: 0.3125rem;
}

.unmatched-player-card .player-guest-badge {
  font-size: 0.6875rem;
  margin-left: 0.3125rem;
}

.seeding-confirmation {
  max-width: 600px;
}

.seed-number {
  flex: none;
  min-width: 2rem;
  font-weight: var(--weight-semibold);
  text-align: center;
}

.seeding-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-table__actions {
  width: 1%;
  text-align: right;
}

.tournament-table__created {
  display: none;
}

@media (min-width: 550px) {
  .tournament-table__created {
    display: table-cell;
  }
}

/* Subheading Actions */
.subheading-separator {
  margin: 0 0.3125rem;
  color: var(--color-text-muted);
}

/* Tournament Admin Page */
.tournament-logs {
  font-family: monospace;
  font-size: 0.5625rem;
  line-height: 1.4;
}

.log-entry {
  padding: 0.15625rem 0;
}

/* Standings */
.standings-table th, .standings-table td {
  white-space: nowrap;
}

/* Admin Management Section */
.admin-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.46875rem 0;
  border-bottom: 1px solid var(--color-border);
}

.admin-item:last-child {
  border-bottom: none;
}

.admin-username {
  flex: 1;
}

.admin-role {
  color: var(--color-text-muted);
}

/* Pods */
.pod-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 0.9375rem 0;
}

.pod-switcher__label {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.pod-switcher__select {
  width: auto;
  max-width: 16rem;
  margin: 0;
}

.pod-group-heading {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.seeding-confirmation--pods {
  max-width: none;
}

.pod-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1rem;
}

.pod-assignment-title {
  margin: 0;
  font-size: var(--text-lg);
}

.pod-assignment-list {
  align-content: start;
  min-height: 4rem;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
}

.pod-assignment-list .sortable__item {
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
}

.pod-assignment-list .pod-select {
  flex: none;
  width: 6.5rem;
}

.player-pod-form {
  display: inline-block;
}

.player-pod-form select {
  max-width: 8rem;
}

.ranking-criteria-item.is-disabled {
  opacity: 0.6;
}

.ranking-criteria-item__name {
  font-weight: var(--weight-semibold);
}

@media (min-width: 550px) {
  .tourney-control__item {
    align-items: flex-start;
  }
}
