/* Round View — focused round-by-round navigation */

/* ───── toolbar ───── */
.round-view-toolbar {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  margin-bottom: .75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.round-view-toolbar-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.rv-label {
  font-size: .78rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.rv-separator {
  color: #d1d5db;
  margin: 0 .25rem;
}

.rv-round-label {
  font-size: .85rem;
  font-weight: 700;
  color: #374151;
  min-width: 10ch;
  text-align: center;
}

.rv-match-count {
  font-weight: 400;
  font-size: .72rem;
  color: #9ca3af;
}

/* ───── player path breadcrumb ───── */
.player-path {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .75rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: .5rem;
  margin-bottom: .75rem;
  overflow-x: auto;
  white-space: nowrap;
  font-size: .78rem;
}

.player-path-name {
  font-weight: 700;
  color: #92400e;
  flex-shrink: 0;
}

.player-path-arrow {
  color: #d1d5db;
  flex-shrink: 0;
}

.player-path-step {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .5rem;
  border: 1px solid #e5e7eb;
  border-radius: .3rem;
  background: #fff;
  font-size: .72rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all .15s ease;
  flex-shrink: 0;
}

.player-path-step:hover {
  background: #f0f9ff;
  border-color: #93c5fd;
}

.player-path-step.current {
  background: #dbeafe;
  border-color: #2563eb;
  font-weight: 700;
  color: #1e40af;
}

.player-path-icon {
  font-size: .7rem;
}

/* ───── card grid ───── */
.round-view-cards {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .5rem;
}

.rv-empty {
  width: 100%;
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
  font-size: .85rem;
}

/* ═══════════════════════════════════════
   ROUND CARD
   ═══════════════════════════════════════ */
.round-card {
  width: 220px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  padding: .45rem .65rem;
  border-radius: .6rem;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: .78rem;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  transition: box-shadow .15s ease, transform .15s ease;
  box-sizing: border-box;
}

.round-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

/* ── Bracket color themes ── */
.round-card.bracket-winner {
  background: #eff6ff;
  border: 2px solid #93c5fd;
}
.round-card.bracket-loser {
  background: #fef2f2;
  border: 2px solid #fca5a5;
}
.round-card.bracket-final {
  background: #fffbeb;
  border: 2px solid #fcd34d;
}

/* ── State modifiers ── */
.round-card.state-finished {
  opacity: .75;
}
.round-card.state-finished:hover {
  opacity: 1;
}
.round-card.state-bye {
  opacity: .55;
  border-style: dashed;
}
.round-card.state-ready {
  box-shadow: 0 0 0 2px rgba(37,99,235,.25), 0 1px 3px rgba(0,0,0,.08);
}

/* ── Tracked player highlight ── */
.round-card.tracked {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,.3), 0 1px 3px rgba(0,0,0,.08) !important;
}

/* ═══════════════════════════════════════
   CARD INTERNALS
   ═══════════════════════════════════════ */

/* ── Header ── */
.rc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  margin-bottom: .25rem;
  flex-shrink: 0;
}

.rc-clickable {
  cursor: pointer;
  border-radius: .25rem;
  padding: .15rem .25rem;
  margin: -.15rem -.25rem .25rem;
  transition: background .15s;
}
.rc-clickable:hover {
  background: rgba(0,0,0,.06);
}

.rc-label {
  font-weight: 700;
  font-size: .72rem;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-badge {
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .1rem .35rem;
  border-radius: .25rem;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1.3;
}
.rc-badge.bracket-winner { background: #2563eb; color: #fff; }
.rc-badge.bracket-loser  { background: #dc2626; color: #fff; }
.rc-badge.bracket-final  { background: #d97706; color: #fff; }

/* ── Source labels ── */
.rc-sources {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .6rem;
  color: #9ca3af;
  margin-bottom: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.rc-source-sep { color: #d1d5db; }

/* ── Players ── */
.rc-players {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  flex: 1;
  justify-content: center;
  min-height: 0;
}

.rc-player-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 500;
  padding: .2rem .5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .3rem;
  line-height: 1.3;
}

.rc-player-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-score {
  font-weight: 700;
  font-size: .72rem;
  color: #374151;
  flex-shrink: 0;
}

.rc-win-btn {
  font-size: .6rem;
  font-weight: 700;
  padding: .1rem .4rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: .25rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .03em;
  flex-shrink: 0;
}
.rc-win-btn:hover {
  background: #1d4ed8;
}

.rc-player-row.slot-winner {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  font-weight: 700;
}
.rc-player-row.slot-loser {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
  opacity: .65;
  text-decoration: line-through;
}

/* ── Tracked player name highlight ── */
.rc-player-row.tracked-player {
  border-left: 3px solid #f59e0b;
}

.rc-vs {
  font-size: .55rem;
  color: #9ca3af;
  font-weight: 600;
  text-align: center;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Bye ── */
.rc-bye {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  flex: 1;
}
.rc-bye-player { font-size: .72rem; font-weight: 600; color: #374151; }
.rc-bye-label { font-size: .6rem; font-weight: 700; color: #9ca3af; letter-spacing: .08em; text-transform: uppercase; }

/* ── Trophy ── */
.rc-trophy { font-size: .65rem; margin-right: .2rem; }

/* ── Destinations ── */
.rc-destinations {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  font-size: .55rem;
  margin-top: auto;
  padding-top: .15rem;
  border-top: 1px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}

.rc-dest-winner {
  color: #2563eb;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-dest-loser {
  color: #dc2626;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ───── track player search-select ───── */
.track-select {
  position: relative;
  width: 220px;
}

.track-select-input {
  width: 100%;
  padding: .35rem .55rem;
  padding-right: 1.6rem;
  font-size: .8rem;
  border: 1px solid #d1d5db;
  border-radius: .35rem;
  outline: none;
  background: #fff;
  color: #374151;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.track-select-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

.track-select-input::placeholder {
  color: #9ca3af;
}

.track-select-clear {
  position: absolute;
  right: .3rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 1rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: .1rem .25rem;
}

.track-select-clear:hover {
  color: #374151;
}

.track-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 .35rem .35rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 100;
}

.track-select-option {
  padding: .35rem .55rem;
  font-size: .78rem;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-select-option:hover {
  background: #eff6ff;
  color: #1e40af;
}

.track-select-option.selected {
  background: #dbeafe;
  font-weight: 600;
}

.track-select-more {
  padding: .3rem .55rem;
  font-size: .68rem;
  color: #9ca3af;
  font-style: italic;
  border-top: 1px solid #f3f4f6;
}

/* ───── state pill ───── */
.rc-state-pill {
  font-size: .55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .1rem .35rem;
  border-radius: .75rem;
  line-height: 1;
  white-space: nowrap;
}
.rc-state-pending  { background: #f3f4f6; color: #6b7280; }
.rc-state-ready    { background: #dbeafe; color: #1d4ed8; }
.rc-state-inprogress,
.rc-state-in\ progress { background: #fef3c7; color: #92400e; }
.rc-state-finished { background: #d1fae5; color: #065f46; }

/* ───── review badge ───── */
.rc-review-badge {
  font-size: .7rem;
  color: #d97706;
  cursor: help;
  flex-shrink: 0;
}

/* ───── slot label ───── */
.rc-slot-label {
  font-size: .55rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  margin-right: .25rem;
}

/* ───── score summary ───── */
.rc-score-summary {
  font-size: .65rem;
  color: #6b7280;
  text-align: center;
  padding-top: .2rem;
  border-top: 1px dashed #e5e7eb;
  margin-top: .15rem;
}

/* ═══════════════════════════════════════
   TOURNAMENT INFO PANEL
   ═══════════════════════════════════════ */
.tournament-info-panel {
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  background: #fff;
  margin-bottom: .75rem;
}

.tip-summary {
  padding: .5rem .75rem;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.tip-summary:hover {
  background: #f9fafb;
}

.tip-body {
  padding: .35rem .75rem .5rem;
  border-top: 1px solid #f3f4f6;
}

.tip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.tip-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .5rem;
  background: #f3f4f6;
  border-radius: .3rem;
  font-size: .78rem;
  color: #111827;
  white-space: nowrap;
}

.tip-chip-phase {
  background: #eff6ff;
}

.tip-label {
  color: #6b7280;
  font-weight: 500;
  font-size: .72rem;
}

/* ───── responsive ───── */
@media (max-width: 600px) {
  .round-card { width: 100%; }
  .round-view-toolbar-row { flex-direction: column; align-items: stretch; }
  .rv-separator { display: none; }
}
