.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  background: var(--c-midnight);
  color: var(--c-silk);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.sidebar .brand .accent { color: var(--c-almond); }

.sidebar .nav-item {
  background: transparent;
  border: none;
  color: var(--c-silk);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}
.sidebar .nav-item:hover { background: var(--c-crimson); }
.sidebar .nav-item.active {
  background: var(--c-almond);
  color: var(--c-midnight);
}

.sidebar .nav-item .badge {
  background: rgba(255,255,255,0.15);
  color: var(--c-silk);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 700;
}
.sidebar .nav-item.active .badge {
  background: var(--c-midnight);
  color: var(--c-almond);
}

.sidebar .footer {
  margin-top: auto;
  font-size: 0.78rem;
  color: rgba(245, 208, 197, 0.65);
}
.sidebar .footer button {
  margin-top: 8px;
  width: 100%;
  background: rgba(245, 208, 197, 0.08);
  color: var(--c-silk);
  border: 1px solid rgba(245, 208, 197, 0.25);
}
.sidebar .footer button:hover {
  background: var(--c-almond);
  color: var(--c-midnight);
  border-color: var(--c-almond);
}

.main {
  padding: 32px 36px 80px;
  background: var(--c-bg);
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.phase-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--c-muted);
}
.phase-indicator strong {
  color: var(--c-midnight);
  font-size: 1rem;
}

.phase-progress {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.phase-progress .step {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--c-border);
}
.phase-progress .step.done { background: var(--c-almond); }
.phase-progress .step.current { background: var(--c-reddish); }

.page-section { display: none; }
.page-section.active { display: block; }

.grid {
  display: grid;
  gap: 16px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 8px; position: static; height: auto; overflow: visible; }
  .sidebar .brand { width: 100%; margin-bottom: 8px; }
  .sidebar .nav-item { flex: 1 1 auto; }
  .sidebar .footer { width: 100%; margin-top: 8px; }
  .main { padding: 20px 16px 60px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Dashboard layout */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dashboard-messages {
  margin-top: 8px;
}
.hero-card {
  padding: 24px;
}
.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-head h2 {
  font-size: 1.6rem;
  color: var(--c-midnight);
}
.hero-sub {
  margin: 6px 0 0;
  color: var(--c-muted);
  font-size: 0.92rem;
}
.hero-list {
  margin-top: 8px;
}
.hero-list-title {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
}
.hero-list-row:last-child {
  border-bottom: none;
}
.hero-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
}
.hero-section:first-of-type {
  margin-top: 8px;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.hero-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.hero-teams-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.hero-tile {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.hero-tile.clickable {
  cursor: pointer;
  transition: border-color 0.12s, transform 0.08s;
}
.hero-tile.clickable:hover {
  border-color: var(--c-almond);
  transform: translateY(-1px);
}
.hero-tile-label {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 4px;
}
.hero-tile-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-midnight);
}
.hero-progress-bar {
  height: 10px;
  background: var(--c-surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-almond), var(--c-reddish));
  transition: width 0.3s ease;
}
.hero-progress-label {
  text-align: right;
  color: var(--c-reddish);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 4px;
}
.hero-live-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}
.hero-live-item:last-child {
  border-bottom: none;
}
.hero-live-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}
.hero-live-team {
  font-weight: 700;
  color: var(--c-midnight);
  font-size: 1.05rem;
  text-align: right;
}
.hero-live-team.right {
  text-align: left;
}
.hero-live-score {
  background: var(--c-midnight);
  color: var(--c-silk);
  padding: 6px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-align: center;
  min-width: 90px;
  justify-self: center;
}
.hero-live-meta {
  text-align: center;
  color: var(--c-muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* Next-per-court tournament dashboard */
.hero-courts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.hero-court-card {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.hero-court-head {
  display: inline-block;
  background: var(--c-midnight);
  color: var(--c-silk);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.hero-court-teams {
  font-weight: 700;
  color: var(--c-midnight);
  font-size: 1.02rem;
  line-height: 1.3;
}
.hero-court-meta {
  color: var(--c-muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* Standings inside tournament hero */
.hero-standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.hero-standings-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 12px 14px 6px;
}
.hero-standings-title {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--c-midnight);
}
.hero-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.hero-standings-table th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 600;
  padding: 4px 6px;
  border-bottom: 1px solid var(--c-border);
}
.hero-standings-table td {
  padding: 6px;
  border-bottom: 1px solid var(--c-border);
  font-variant-numeric: tabular-nums;
}
.hero-standings-table tbody tr:last-child td {
  border-bottom: none;
}
.hero-standings-table td.team {
  font-weight: 600;
  color: var(--c-midnight);
}
.hero-standings-table tr.advances {
  background: rgba(203, 145, 115, 0.12);
}
.hero-standings-table tr.advances td:first-child::after {
  content: ' ▲';
  color: var(--c-almond);
}

/* Dashboard Widget System */
.widget-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.widget-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px;
}
.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(140px, auto);
  gap: 14px;
}
.widget-grid.edit-mode {
  outline: 2px dashed var(--c-almond);
  outline-offset: 6px;
  border-radius: 14px;
  padding: 6px;
  background: rgba(203, 145, 115, 0.04);
}
.widget-card.size-small { grid-column: span 1; }
.widget-card.size-medium { grid-column: span 2; }
.widget-card.size-large { grid-column: span 2; grid-row: span 2; }
@media (max-width: 1200px) {
  .widget-grid { grid-template-columns: repeat(3, 1fr); }
  .widget-card.size-large { grid-column: span 3; grid-row: span 1; }
}
@media (max-width: 900px) {
  .widget-grid { grid-template-columns: repeat(2, 1fr); }
  .widget-card.size-medium { grid-column: span 2; }
  .widget-card.size-large { grid-column: span 2; }
}
@media (max-width: 600px) {
  .widget-grid { grid-template-columns: 1fr; }
  .widget-card.size-small,
  .widget-card.size-medium,
  .widget-card.size-large { grid-column: span 1; }
}

.widget-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.08s, border-color 0.12s, box-shadow 0.12s;
}
.widget-card:hover {
  border-color: var(--c-almond);
}
.widget-dragging {
  opacity: 0.45;
}

.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  margin: -4px -4px 0;
  padding: 4px 6px;
}
.widget-head.clickable {
  cursor: pointer;
}
.widget-head.clickable:hover {
  background: var(--c-surface-2);
}
.widget-title {
  font-weight: 700;
  color: var(--c-midnight);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.widget-arrow {
  color: var(--c-almond);
  font-weight: 700;
}
.widget-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.widget-muted {
  color: var(--c-muted);
  font-size: 0.88rem;
  margin: 0;
}
.widget-big-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-reddish);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.widget-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.widget-row {
  color: var(--c-midnight);
  font-size: 0.9rem;
}
.widget-row-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.widget-progress {
  height: 8px;
  background: var(--c-surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.widget-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-almond), var(--c-reddish));
  transition: width 0.3s ease;
}
.widget-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.widget-stat {
  text-align: center;
  padding: 8px 4px;
  background: var(--c-surface-2);
  border-radius: 8px;
}
.widget-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-reddish);
  font-variant-numeric: tabular-nums;
}
.widget-stat-label {
  font-size: 0.72rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.widget-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.widget-mini-tile {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 8px 10px;
}
.widget-mini-tile.clickable {
  cursor: pointer;
  transition: border-color 0.12s, transform 0.08s;
}
.widget-mini-tile.clickable:hover {
  border-color: var(--c-almond);
  transform: translateY(-1px);
}
.widget-mini-tile-label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.widget-mini-tile-value {
  font-weight: 700;
  color: var(--c-midnight);
  font-size: 0.95rem;
  margin-top: 2px;
}
.widget-match-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.88rem;
}
.widget-match-row:last-child { border-bottom: none; }
.widget-match-time {
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}
.widget-match-teams {
  font-weight: 600;
  color: var(--c-midnight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.widget-match-court {
  background: var(--c-midnight);
  color: var(--c-silk);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.78rem;
}
.widget-match-score {
  background: var(--c-almond);
  color: var(--c-midnight);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Edit mode controls */
.widget-edit-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 3px 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  z-index: 2;
}
.widget-drag-handle {
  cursor: grab;
  color: var(--c-muted);
  font-weight: 700;
  padding: 2px 6px;
  user-select: none;
}
.widget-drag-handle:active { cursor: grabbing; }
.widget-size-picker {
  display: flex;
  gap: 2px;
  background: var(--c-surface-2);
  border-radius: 6px;
  padding: 2px;
}
.widget-size-btn {
  background: transparent;
  border: none;
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-muted);
  cursor: pointer;
  border-radius: 4px;
  min-width: 24px;
}
.widget-size-btn:hover { color: var(--c-midnight); }
.widget-size-btn.active {
  background: var(--c-reddish);
  color: var(--c-silk);
}
.widget-remove-btn {
  background: transparent;
  border: none;
  color: var(--c-muted);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.widget-remove-btn:hover { color: var(--c-reddish); }

/* Picker modal items */
.widget-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.12s, transform 0.08s;
}
.widget-picker-item:hover {
  border-color: var(--c-almond);
  background: var(--c-surface-2);
  transform: translateY(-1px);
}

.rating-card {
  max-width: 540px;
  margin: 24px auto;
  text-align: center;
  padding: 32px 24px;
}
.rating-card .progress-text {
  font-size: 0.85rem;
  color: var(--c-muted);
  margin-bottom: 8px;
}
.rating-card .player-name-section {
  margin-bottom: 24px;
}
.rating-card .player-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-midnight);
  margin: 0;
}
.rating-card .player-current-rating {
  display: inline-block;
  background: var(--c-almond);
  color: var(--c-midnight);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 14px;
  border-radius: 999px;
  margin-top: 8px;
  letter-spacing: 0.02em;
}
.rating-scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.rating-scale button {
  padding: 14px 0;
  font-size: 1.1rem;
  background: var(--c-silk);
  color: var(--c-crimson);
  border-radius: 8px;
  text-align: center;
  justify-content: center;
  display: flex;
  align-items: center;
}
.rating-scale button:hover {
  background: var(--c-almond);
  color: var(--c-midnight);
}
.rating-scale button.selected {
  background: var(--c-reddish);
  color: var(--c-silk);
}
.rating-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--c-muted);
  margin-bottom: 24px;
}
.rating-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.team-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.team-column {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--c-border);
}
.team-column .team-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.team-column .team-name {
  font-weight: 700;
  color: var(--c-midnight);
  font-size: 0.98rem;
}
.team-column .team-name input {
  font-size: 0.95rem;
  padding: 4px 8px;
  border: 1px dashed transparent;
  background: transparent;
}
.team-column .team-name input:hover, .team-column .team-name input:focus {
  border-color: var(--c-border);
  background: var(--c-surface-2);
}
.team-name-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--c-midnight);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  width: 100%;
}
.team-name-btn:hover {
  background: var(--c-surface-2);
  border-color: var(--c-almond);
  color: var(--c-reddish);
}
.team-column .group-tag {
  font-size: 0.7rem;
  background: var(--c-silk);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--c-crimson);
  font-weight: 700;
}
.team-column .player-list {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.player-chip {
  background: var(--c-silk);
  color: var(--c-crimson);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  border: 1px solid transparent;
}
.player-chip:hover {
  border-color: var(--c-almond);
}
.player-chip.unassigned {
  background: rgba(142, 68, 61, 0.08);
  color: var(--c-crimson);
}
.team-strength {
  font-size: 0.75rem;
  color: var(--c-muted);
  margin-top: 8px;
}

.unassigned-column {
  background: var(--c-surface-2);
  border-style: dashed;
  border-color: var(--c-almond);
  grid-column-end: -1;
}
.unassigned-column .team-head .team-name {
  color: var(--c-reddish);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.92rem;
}
.unassigned-column .player-list {
  min-height: 60px;
}
.ablage-hint {
  margin-top: 8px;
  padding: 14px 10px;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--c-muted);
  font-size: 0.82rem;
  font-style: italic;
}

.match-row {
  display: grid;
  grid-template-columns: 150px 1fr 90px 110px 130px 1fr 120px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.9rem;
}
.match-row.schedule-row {
  grid-template-columns: 130px 1fr 200px 1fr 80px 100px 130px 110px;
}
.match-row.schedule-row.single-day {
  grid-template-columns: 130px 1fr 200px 1fr 80px 100px 110px;
}
.score-cell-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* Multi-Set: Layout mit kleinen Set-Inputs außen und großen Punkten
   innen um den Doppelpunkt. Darunter steht der aktuelle Satz-Hint. */
.score-cell-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.score-cell-multiset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.score-cell-sets-hint {
  font-size: 0.72rem;
  color: var(--c-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.2;
}
/* Multi-Set Score-Anzeige in der Spielplan-Tabelle (klickbar, öffnet
   das Sätze-Modal). */
.score-cell-multiset-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.score-cell-multiset-display:hover {
  background: var(--c-surface-2);
}
.score-cell-multiset-display:focus-visible {
  outline: 2px solid var(--c-almond);
  outline-offset: 2px;
}
.score-cell-multiset-sets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
/* Live-Anzeige: Sätze außen, Punkte um den Doppelpunkt. */
.score-cell-multiset-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.score-cell-multiset-live .set-num-input {
  width: 28px !important;
  padding: 2px !important;
  font-size: 0.78rem;
  text-align: center;
  color: var(--c-muted);
  background: transparent;
  border: 1px solid transparent;
}

/* Sätze-Eingabe-Modal: pro Satz eine Zeile mit Label, A-Input, ':',
   B-Input und Ziel-Anzeige. */
.set-result-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.set-result-row {
  display: grid;
  grid-template-columns: 70px 1fr auto 1fr 1fr;
  align-items: center;
  gap: 8px;
}
.set-result-label {
  font-weight: 700;
  color: var(--c-midnight);
  font-size: 0.95rem;
}
.set-result-input {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.set-result-input::-webkit-outer-spin-button,
.set-result-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.set-result-colon {
  font-weight: 800;
  color: var(--c-muted);
  text-align: center;
}
.set-result-target {
  font-size: 0.78rem;
  color: var(--c-muted);
}
.score-num-input {
  width: 54px !important;
  padding: 6px 4px !important;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
/* Spinner-Buttons der Number-Inputs ausblenden, damit der Platz für
   die Ziffern bleibt. */
.score-num-input::-webkit-outer-spin-button,
.score-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.score-colon {
  font-weight: 800;
  color: var(--c-muted);
  margin: 0 2px;
}
.match-row.schedule-row .team-cell {
  text-align: right;
}
.match-row.schedule-row .team-cell.right {
  text-align: left;
}
.match-row.results-row {
  grid-template-columns: 120px 1fr 90px 40px 90px 1fr 120px;
}
.match-row.results-row .team-cell {
  text-align: right;
  padding-right: 4px;
}
.match-row.results-row .team-cell.right {
  text-align: left;
  padding-right: 0;
  padding-left: 4px;
}
.match-row.results-row input[type="number"] {
  justify-self: center;
}
.match-row.results-row > div:nth-child(3),
.match-row.results-row > div:nth-child(5) {
  text-align: center;
}
.match-row .tag {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.match-row .score-box {
  background: var(--c-silk);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--c-midnight);
  letter-spacing: 0.04em;
}
.match-row .score-box.placeholder {
  background: transparent;
  color: var(--c-muted);
  font-weight: 500;
  border-style: dashed;
  font-size: 0.85rem;
  letter-spacing: 0;
}
.match-row.finished .score-box {
  background: var(--c-almond);
  color: var(--c-midnight);
  border-color: var(--c-almond);
}
.match-row.header {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
  border-bottom: 2px solid var(--c-border);
}
/* Sammel-Speichern-Button in der Header-Zeile: rechtsbündig, damit er
   genau über den per-Zeilen-„Speichern"-Buttons sitzt. */
.bulk-save-header-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.bulk-save-header-cell .bulk-save-btn {
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.match-row .team-cell { font-weight: 600; color: var(--c-midnight); }
.match-row .team-cell.right { text-align: right; }
.match-row input[type="number"] {
  width: 70px;
  padding: 6px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}
.match-row input[type="time"] {
  padding: 6px 8px;
  font-size: 0.88rem;
}
.match-row.finished {
  background: rgba(203, 145, 115, 0.07);
}
/* K.O.-Platzhalter-Zeilen (Paarungen, deren Teams noch nicht feststehen):
   leicht gedimmt + gestrichelter unterer Rand. */
.match-row.placeholder {
  background: var(--c-surface-2);
  color: var(--c-muted);
  border-bottom: 1px dashed var(--c-border);
}
.match-row.placeholder .placeholder-team-text {
  font-style: italic;
  color: var(--c-muted);
  font-weight: 600;
}
/* Laufende Spiele: dunkle, kräftige Umrandung, damit sie sofort
   ins Auge fallen. Aufeinanderfolgende Live-Zeilen werden zu einer
   gemeinsamen Umrandung „verschmolzen". */
.match-row.live {
  border: 2px solid var(--c-midnight);
  border-radius: 10px;
  background: rgba(50, 10, 40, 0.03);
  position: relative;
}
.match-row.live::before {
  content: '';
  position: absolute;
  left: -2px; top: -2px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-almond);
  box-shadow: 0 0 0 0 rgba(203, 145, 115, 0.7);
  animation: pulse 1.6s infinite;
}
/* Eine Live-Zeile direkt nach einer anderen Live-Zeile → oberen Rand
   weglassen, Ecken oben gerade, leichter negativer margin zum
   nahtlosen Übergang. */
.match-row.live + .match-row.live {
  border-top: 1px solid var(--c-border);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: -2px;
}
.match-row.live + .match-row.live::before { display: none; }
/* Wenn diese Live-Zeile selbst noch eine Live-Zeile nach sich hat,
   unteren Rand weglassen + Ecken unten gerade. (Modern: :has) */
.match-row.live:has(+ .match-row.live) {
  border-bottom: 1px solid var(--c-border);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.schedule-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}

/* Match filter bar (Spielplan + Ergebnisse) */
.match-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.match-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 170px;
  flex: 1;
}
.match-filter-group label {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 600;
}
/* Eigene Pfeil-Optik statt der Browser-Default-Spinne, damit der
   Select sich ins Almond/Midnight-Schema einfügt. */
.match-filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 10px 38px 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background-color: var(--c-surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238e443d'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  color: var(--c-midnight);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  width: 100%;
}
.match-filter-select:hover {
  border-color: var(--c-almond);
  background-color: var(--c-surface-2);
}
.match-filter-select:focus {
  outline: none;
  border-color: var(--c-almond);
  box-shadow: 0 0 0 3px rgba(203, 145, 115, 0.25);
}
.match-filter-select option {
  background: var(--c-surface);
  color: var(--c-midnight);
  font-weight: 600;
  padding: 8px 12px;
}

/* ───── Themed Custom Dropdown ───── */
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-midnight);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.custom-select-trigger:hover {
  border-color: var(--c-almond);
  background: var(--c-surface-2);
}
.custom-select.open .custom-select-trigger {
  border-color: var(--c-almond);
  box-shadow: 0 0 0 3px rgba(203, 145, 115, 0.25);
  background: var(--c-surface);
}
.custom-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-arrow {
  color: var(--c-reddish);
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.15s ease;
  flex: 0 0 auto;
}
.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}
.custom-select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(50, 10, 40, 0.15);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  display: none;
}
.custom-select.open .custom-select-panel,
.custom-select-panel.open {
  display: block;
  animation: customSelectIn 0.12s ease-out;
}
@keyframes customSelectIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.custom-select-option {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--c-midnight);
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.custom-select-option:hover {
  background: var(--c-surface-2);
}
.custom-select-option.selected {
  background: var(--c-reddish);
  color: var(--c-silk);
}
.custom-select-option.selected:hover {
  background: var(--c-crimson);
}
.custom-select.disabled .custom-select-trigger,
.custom-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.75;
  background: var(--c-surface-2);
  color: var(--c-muted);
}
.custom-select.disabled .custom-select-trigger:hover,
.custom-select-trigger:disabled:hover {
  border-color: var(--c-border);
  background: var(--c-surface-2);
}
.custom-select.disabled .custom-select-arrow {
  opacity: 0.4;
}
.match-row .save-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.modal .rating-scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 8px 0 12px;
}
.modal .rating-scale button {
  padding: 12px 0;
  background: var(--c-silk);
  color: var(--c-crimson);
  border-radius: 8px;
  text-align: center;
  justify-content: center;
}
.modal .rating-scale button:hover {
  background: var(--c-almond);
  color: var(--c-midnight);
}
.modal .rating-scale button.selected {
  background: var(--c-reddish);
  color: var(--c-silk);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* Abstandshalter zwischen mehreren gestapelten Feldern in derselben
   Card — keine sichtbare Linie, nur ein kleiner Whitespace, damit die
   Karte kompakter wirkt. */
.settings-field-divider {
  height: 10px;
}

/* Inline-Karte pro Sondereinstellung im Spielmodus-Block — hellbeiger
   Klotz mit Akzent-Badge und Klick zum Öffnen des Editors. */
.card.override-summary-card {
  background: var(--c-silk);
  border-color: rgba(142, 68, 61, 0.15);
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card.override-summary-card:hover {
  border-color: var(--c-almond);
  box-shadow: 0 6px 18px rgba(50, 10, 40, 0.08);
}
.card.override-summary-card:active {
  transform: translateY(1px);
}
.override-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.override-summary-title {
  font-weight: 700;
  color: var(--c-midnight);
  font-size: 0.95rem;
}
.override-summary-badge {
  font-size: 0.7rem !important;
  padding: 2px 8px;
  letter-spacing: 0;
}
.override-summary-desc {
  font-size: 0.82rem;
  color: var(--c-crimson);
  line-height: 1.35;
}

/* Sondereinstellungen-Modal */
.modal.modal-wide { max-width: 560px; }
.override-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 0;
}
.override-empty {
  color: var(--c-muted);
  text-align: center;
  font-size: 0.9rem;
  padding: 14px 8px;
  background: var(--c-surface-2);
  border-radius: var(--radius-sm);
  margin: 0;
}
.override-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}
.override-row-text {
  flex: 1;
  min-width: 0;
}
.override-row-title {
  font-weight: 700;
  color: var(--c-midnight);
  margin-bottom: 2px;
}
.override-row-sub {
  font-size: 0.82rem;
  color: var(--c-muted);
}
.override-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Lupensymbol + ausklappbares Suchfeld auf der Spielerliste.
   Beide Zustände rendern dasselbe DOM — geschlossen / offen wird per
   CSS-Transitions zwischen den States animiert. */
:root {
  --player-search-open-width: 200px;
  --player-search-anim-duration: 480ms;
  --player-search-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.player-search {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: none;
  overflow: hidden;
  transition:
    background-color var(--player-search-anim-duration) var(--player-search-ease),
    border-color    var(--player-search-anim-duration) var(--player-search-ease),
    box-shadow      0.18s ease,
    padding         var(--player-search-anim-duration) var(--player-search-ease);
}
.player-search.is-open {
  background: var(--c-surface);
  border-color: var(--c-border);
  padding: 0 4px 0 10px;
  gap: 6px;
}
.player-search.is-open:focus-within {
  border-color: var(--c-almond);
  box-shadow: 0 0 0 3px rgba(203, 145, 115, 0.18);
}

/* Lupe — Anfangs Action-Button in Almond, im offenen Zustand
   dekorativer Anker im Muted-Ton. */
.player-search-toggle {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--c-almond);
  padding: 6px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
  transition: color var(--player-search-anim-duration) var(--player-search-ease),
              transform 0.05s ease;
}
.player-search-toggle:hover { color: var(--c-reddish); }
.player-search-toggle:active { transform: translateY(1px); }
.player-search-toggle:focus-visible {
  outline: 2px solid var(--c-almond);
  outline-offset: 2px;
  border-radius: 6px;
}
.player-search.is-open .player-search-toggle {
  color: var(--c-muted);
  cursor: default;
  pointer-events: none;
  padding: 0 2px 0 0;
}

/* Eingabefeld — geschlossen: max-width 0 und opacity 0, also visuell weg
   und klickdurchlässig. Beim Öffnen wächst es animiert auf die Zielbreite. */
.player-search-input {
  flex: 0 0 auto;
  max-width: 0;
  width: var(--player-search-open-width);
  opacity: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--c-text);
  height: 100%;
  outline: none;
  box-shadow: none;
  pointer-events: none;
  transition:
    max-width var(--player-search-anim-duration) var(--player-search-ease),
    opacity   calc(var(--player-search-anim-duration) - 140ms) var(--player-search-ease) 140ms;
}
.player-search.is-open .player-search-input {
  max-width: var(--player-search-open-width);
  opacity: 1;
  pointer-events: auto;
}
.player-search-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
}
.player-search-input::placeholder { color: var(--c-muted); }
.player-search-input::-webkit-search-cancel-button { display: none; }
.player-search-input::-ms-clear { display: none; }

/* × Button — geschlossen unsichtbar und nicht klickbar. */
.player-search-close {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--c-muted);
  flex: 0 0 auto;
  width: 0;
  height: 28px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    width   var(--player-search-anim-duration) var(--player-search-ease),
    opacity calc(var(--player-search-anim-duration) - 140ms) var(--player-search-ease) 140ms,
    background-color 0.15s ease,
    color 0.15s ease;
}
.player-search.is-open .player-search-close {
  width: 28px;
  opacity: 1;
  pointer-events: auto;
}
.player-search-close:hover {
  background: var(--c-silk);
  color: var(--c-crimson);
}

@media (max-width: 640px) {
  :root { --player-search-open-width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .player-search,
  .player-search-toggle,
  .player-search-input,
  .player-search-close {
    transition: none !important;
  }
}

/* Segmented Tabs (Pill-Stil) — wird unter dem Einstellungs-Titel verwendet,
   um zwischen Turnier- und System-Einstellungen umzuschalten. */
.segmented-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--c-silk);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 5px;
  box-shadow: inset 0 1px 2px rgba(50, 10, 40, 0.04);
  margin: 0 0 22px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented-tabs::-webkit-scrollbar { display: none; }

.segmented-tab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--c-crimson);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.segmented-tab:hover {
  color: var(--c-midnight);
  background: rgba(255, 255, 255, 0.45);
}
.segmented-tab:active { transform: translateY(1px); }
.segmented-tab.active {
  background: var(--c-surface);
  color: var(--c-midnight);
  box-shadow: 0 1px 3px rgba(50, 10, 40, 0.10), 0 4px 12px rgba(50, 10, 40, 0.06);
  cursor: default;
}
.segmented-tab.active:hover {
  background: var(--c-surface);
}
.segmented-tab:focus-visible {
  outline: 2px solid var(--c-almond);
  outline-offset: 2px;
}

.settings-bool-group .settings-bool-group-title {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.settings-bool-group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Checkbox-row — überschreibt das globale label { display: block } */
/* Reine Checkbox-Karten (eine Option im Card) zentrieren ihren Inhalt
   vertikal und horizontal, damit das Element nicht oben links klebt
   und die Karte „leer" wirkt. */
.card.settings-checkbox-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

label.settings-checkbox-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--c-midnight);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.12s;
  user-select: none;
}
label.settings-checkbox-row:hover {
  background: var(--c-surface-2);
}
label.settings-checkbox-row span {
  color: var(--c-midnight);
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
  line-height: 1.3;
}

/* Custom-Checkbox im Theme-Look statt Browser-Default.
   !important nötig, weil das globale 'input, select, textarea'
   im theme.css width: 100% und padding: 10px 14px setzt. */
label.settings-checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  max-width: 22px;
  padding: 0 !important;
  margin: 0 !important;
  border: 2px solid var(--c-almond) !important;
  border-radius: 6px !important;
  background: var(--c-surface) !important;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  flex-grow: 0;
  box-shadow: none !important;
}
label.settings-checkbox-row input[type="checkbox"]:hover {
  border-color: var(--c-reddish);
  box-shadow: 0 0 0 3px rgba(142, 68, 61, 0.08);
}
label.settings-checkbox-row input[type="checkbox"]:checked {
  background: var(--c-reddish) !important;
  border-color: var(--c-reddish) !important;
}
label.settings-checkbox-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 11px;
  border: solid var(--c-silk);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
label.settings-checkbox-row input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(142, 68, 61, 0.25);
}

.warning-banner {
  background: rgba(142, 68, 61, 0.10);
  border: 1px solid rgba(142, 68, 61, 0.25);
  color: var(--c-crimson);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* Vertical timeline (numbered steps with connecting lines) — admin-kompakt */
.timeline {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.timeline-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 14px;
}
.timeline-step:last-child {
  padding-bottom: 0;
}
.timeline-bullet {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-reddish);
  color: var(--c-silk);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}
/* Connector berührt weder den Kreis darüber noch den Kreis darunter:
   top = 24 (bullet height) + 5 (gap unten) = 29
   bottom = 5 (gap zur nächsten bullet, die direkt nach padding-bottom kommt) */
.timeline-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 29px;
  bottom: 5px;
  width: 2px;
  background: var(--c-almond);
  z-index: 0;
  border-radius: 2px;
}
.timeline-content {
  padding-top: 2px;
}
.timeline-title {
  font-weight: 700;
  color: var(--c-midnight);
  margin-bottom: 2px;
  font-size: 0.9rem;
}
.timeline-desc {
  color: var(--c-text);
  font-size: 0.85rem;
  line-height: 1.4;
}
.timeline-desc strong {
  color: var(--c-midnight);
}
.timeline-link {
  color: var(--c-reddish);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed var(--c-almond);
  transition: color 0.12s, border-color 0.12s;
}
.timeline-link:hover {
  color: var(--c-midnight);
  border-bottom-color: var(--c-reddish);
  border-bottom-style: solid;
}

.teams-page-with-bench {
  padding-bottom: 80px;
}
/* Wenn die Ablage offen ist, Seite mit genug Bottom-Padding versehen,
   damit man bis ganz unten scrollen kann ohne dass die Ablage die
   Teams überdeckt. */
body.bench-open .teams-page-with-bench {
  padding-bottom: calc(50vh + 32px);
}

.bench-drawer {
  position: fixed;
  bottom: 0;
  left: 240px;
  right: 0;
  background: var(--c-surface);
  border-top: 2px solid var(--c-almond);
  box-shadow: 0 -8px 24px rgba(50, 10, 40, 0.15);
  z-index: 100;
  display: flex;
  flex-direction: column;
  max-height: 50vh;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.bench-drawer:not(.open) { max-height: 64px; }

.bench-peek {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  flex-shrink: 0;
  text-align: left;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bench-peek::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 4px;
  background: var(--c-border);
  border-radius: 99px;
  transition: background 0.15s ease;
}
.bench-peek:hover::before { background: var(--c-almond); }
.bench-peek .bench-label {
  font-weight: 800;
  color: var(--c-midnight);
  font-size: 1rem;
}
.bench-peek .bench-count {
  background: var(--c-almond);
  color: var(--c-midnight);
  padding: 2px 12px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.85rem;
}
.bench-peek .bench-chevron {
  margin-left: auto;
  color: var(--c-muted);
  font-size: 0.95rem;
  transition: transform 0.25s ease;
}
.bench-drawer.open .bench-peek .bench-chevron { transform: rotate(180deg); }

.bench-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 24px 24px;
  border-top: 1px solid var(--c-border);
}
.bench-drawer:not(.open) .bench-content { visibility: hidden; }

.bench-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 60px;
  padding: 4px;
}
.bench-list .player-chip {
  background: var(--c-silk);
  color: var(--c-crimson);
}
.bench-hint {
  width: 100%;
  text-align: center;
  color: var(--c-muted);
  font-size: 0.88rem;
  padding: 18px 8px;
  font-style: italic;
}

@media (max-width: 900px) {
  .bench-drawer { left: 0; }
}

tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--c-surface-2); }
tr.clickable td { transition: background 0.12s ease; }

.player-detail-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 20px;
}
.player-detail-actions .left { display: flex; gap: 8px; flex-wrap: wrap; }
.player-detail-actions .right { display: flex; gap: 8px; flex-wrap: wrap; }

.wizard-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
}
.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: var(--c-midnight);
  color: var(--c-silk);
  border-bottom: 1px solid rgba(0,0,0,0.15);
}
.wizard-header .brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.wizard-header .brand .accent { color: var(--c-almond); }
.wizard-header .header-actions {
  display: flex;
  gap: 8px;
}
.wizard-header .header-actions button {
  background: rgba(245, 208, 197, 0.08);
  color: var(--c-silk);
  border: 1px solid rgba(245, 208, 197, 0.25);
}
.wizard-header .header-actions button:hover {
  background: var(--c-almond);
  color: var(--c-midnight);
  border-color: var(--c-almond);
}

.wizard-progress {
  display: flex;
  gap: 0;
  background: var(--c-surface);
  padding: 16px 24px;
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
}
.wizard-step {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: default;
  color: var(--c-muted);
  text-align: left;
  position: relative;
  font-family: inherit;
}
.wizard-step + .wizard-step::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 2px;
  background: var(--c-border);
}
.wizard-step.done {
  color: var(--c-crimson);
  cursor: pointer;
}
.wizard-step.done:hover { background: var(--c-surface-2); }
.wizard-step.active {
  color: var(--c-midnight);
}
.wizard-step .step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c-silk);
  color: var(--c-crimson);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.wizard-step.done .step-num {
  background: var(--c-almond);
  color: var(--c-midnight);
}
.wizard-step.active .step-num {
  background: var(--c-midnight);
  color: var(--c-silk);
  box-shadow: 0 0 0 4px rgba(50, 10, 40, 0.12);
}
.wizard-step .step-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
  min-width: 0;
}
.wizard-step .step-label {
  font-size: 0.95rem;
  font-weight: 700;
}
.wizard-step .step-sub {
  font-size: 0.74rem;
  opacity: 0.75;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.wizard-main {
  flex: 1;
  padding: 28px 32px 120px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.wizard-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  padding: 14px 32px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--c-bg) 60%, rgba(250, 234, 227, 0));
  pointer-events: none;
  z-index: 50;
}
.btn-wizard-next {
  pointer-events: auto;
  background: var(--c-almond);
  color: var(--c-midnight);
  border: none;
  padding: 16px 28px;
  border-radius: 14px;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(50, 10, 40, 0.18);
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn-wizard-next:hover {
  background: var(--c-reddish);
  color: var(--c-silk);
}
.btn-wizard-next:active { transform: translateY(1px); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.summary-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--c-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}
.summary-label {
  color: var(--c-muted);
  font-size: 0.85rem;
}
.summary-value {
  color: var(--c-midnight);
  font-weight: 700;
}

.group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--c-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}

@media (max-width: 900px) {
  .wizard-header { padding: 12px 16px; }
  .wizard-progress { padding: 10px 12px; gap: 4px; }
  .wizard-step { min-width: 90px; padding: 8px 6px; gap: 6px; }
  .wizard-step .step-num { width: 28px; height: 28px; font-size: 0.85rem; }
  .wizard-step .step-label { font-size: 0.82rem; }
  .wizard-step .step-sub { display: none; }
  .wizard-main { padding: 18px 14px 110px; }
  .wizard-actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .btn-wizard-next { padding: 14px 22px; font-size: 0.95rem; }
}
