/* =================================================================
   TOURNAMENTS CSS - Centrální styly pro tournament templates
   ================================================================= */

/* =================================================================
   CARD KOMPONENTY - Základní card styly
   ================================================================= */

/* Cards s blue theme (placement, stats, players) */
.placement-card,
.stats-card,
.players-card,
.roster-card,
.match-history-card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

[data-bs-theme="dark"] .placement-card,
[data-bs-theme="dark"] .stats-card,
[data-bs-theme="dark"] .players-card,
[data-bs-theme="dark"] .roster-card,
[data-bs-theme="dark"] .match-history-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
              0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.placement-card:hover,
.stats-card:hover,
.players-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .placement-card:hover,
[data-bs-theme="dark"] .stats-card:hover,
[data-bs-theme="dark"] .players-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
              0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Spirit card */
.spirit-card,
.legend-card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

[data-bs-theme="dark"] .spirit-card,
[data-bs-theme="dark"] .legend-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
              0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.spirit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .spirit-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
              0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* =================================================================
   CARD HEADERS - Barevné hlavičky karet
   ================================================================= */

/* Blue header (placement, stats) */
.placement-header-blue,
.stats-header {
  background: linear-gradient(135deg, #285fa5 0%, #1a4475 100%);
  color: white;
  padding: 1.25rem;
  border: none;
}

/* Red header (spirit) */
.placement-header-red,
.spirit-header {
  background: linear-gradient(135deg, #e63c32 0%, #c42d25 100%);
  color: white;
  padding: 1.25rem;
  border: none;
}

/* Gray header (legend) */
.legend-header {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  padding: 0.875rem 1.25rem;
  border: none;
  font-weight: 600;
}

/* Roster header - menší padding */
.roster-header {
  background: linear-gradient(135deg, #285fa5 0%, #1a4475 100%);
  color: white;
  padding: 1rem;
  border: none;
}

/* =================================================================
   HEADER ROWS - Řádky s nadpisy v tabulkách
   ================================================================= */

.roster-header-row,
.players-header-row,
.stats-header-row {
  background-color: rgba(40, 95, 165, 0.08);
}

[data-bs-theme="dark"] .roster-header-row,
[data-bs-theme="dark"] .players-header-row,
[data-bs-theme="dark"] .stats-header-row {
  background-color: rgba(95, 163, 230, 0.15);
}

.stats-header-row-ppg {
  background-color: rgba(230, 60, 50, 0.08);
}

[data-bs-theme="dark"] .stats-header-row-ppg {
  background-color: rgba(230, 60, 50, 0.15);
}

.spirit-stats-header {
  background-color: rgba(230, 60, 50, 0.08);
  padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .spirit-stats-header {
  background-color: rgba(230, 60, 50, 0.15);
}

.accordion-body .spirit-stats-header {
  background-color: rgba(230, 60, 50, 0.08);
}

[data-bs-theme="dark"] .accordion-body .spirit-stats-header {
  background-color: rgba(230, 60, 50, 0.15);
}

/* =================================================================
   ITEM ROWS - Řádky s daty
   ================================================================= */

/* Placement items */
.placement-item {
  padding: 0.75rem 1rem;
  transition: background-color 0.15s, transform 0.15s;
}

.placement-item:not(:last-child) {
  border-bottom: 1px solid rgba(40, 95, 165, 0.12) !important;
}

[data-bs-theme="dark"] .placement-item:not(:last-child) {
  border-bottom-color: rgba(95, 163, 230, 0.15) !important;
}

.placement-item:hover {
  background-color: rgba(40, 95, 165, 0.08);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .placement-item:hover {
  background-color: rgba(95, 163, 230, 0.12);
}

/* Spirit items */
.spirit-item {
  padding: 0.75rem 1rem;
  transition: background-color 0.15s, transform 0.15s;
}

.spirit-item:not(:last-child) {
  border-bottom: 1px solid rgba(230, 60, 50, 0.12) !important;
}

[data-bs-theme="dark"] .spirit-item:not(:last-child) {
  border-bottom-color: rgba(230, 60, 50, 0.15) !important;
}

.spirit-item:hover {
  background-color: rgba(230, 60, 50, 0.08);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .spirit-item:hover {
  background-color: rgba(230, 60, 50, 0.12);
}

/* Player rows */
.player-row,
.roster-row {
  padding: 0.75rem 1.25rem;
  transition: background-color 0.15s, transform 0.15s;
}

.player-row:hover,
.roster-row:hover {
  background-color: rgba(40, 95, 165, 0.08);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .player-row:hover,
[data-bs-theme="dark"] .roster-row:hover {
  background-color: rgba(95, 163, 230, 0.12);
}

.player-row:not(:last-child),
.roster-row:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .player-row:not(:last-child),
[data-bs-theme="dark"] .roster-row:not(:last-child) {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Player row PPG (red theme) */
.player-row-ppg {
  padding: 0.75rem 1.25rem;
  transition: background-color 0.15s, transform 0.15s;
}

.player-row-ppg:not(:last-child) {
  border-bottom: 1px solid rgba(230, 60, 50, 0.1);
}

[data-bs-theme="dark"] .player-row-ppg:not(:last-child) {
  border-bottom-color: rgba(230, 60, 50, 0.12);
}

.player-row-ppg:hover {
  background-color: rgba(230, 60, 50, 0.08);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .player-row-ppg:hover {
  background-color: rgba(230, 60, 50, 0.12);
}

/* Spirit rows */
.spirit-row {
  padding: 0.75rem 1rem;
  transition: background-color 0.15s, transform 0.15s;
}

.spirit-row:hover {
  background-color: rgba(230, 60, 50, 0.05);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .spirit-row:hover {
  background-color: rgba(230, 60, 50, 0.1);
}

.spirit-row:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .spirit-row:not(:last-child) {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Spirit total row */
.spirit-total-row {
  background-color: rgba(40, 95, 165, 0.08);
  padding: 0.875rem 1rem;
  border-top: 2px solid rgba(40, 95, 165, 0.2);
}

[data-bs-theme="dark"] .spirit-total-row {
  background-color: rgba(40, 95, 165, 0.15);
  border-top-color: rgba(40, 95, 165, 0.3);
}

.accordion-body .spirit-total-row {
  background-color: rgba(40, 95, 165, 0.08);
  border-top-color: rgba(40, 95, 165, 0.2);
}

[data-bs-theme="dark"] .accordion-body .spirit-total-row {
  background-color: rgba(40, 95, 165, 0.15);
  border-top-color: rgba(40, 95, 165, 0.3);
}

/* Team rows (statistics page) */
.team-row {
  padding: 1rem 1.25rem;
  transition: background-color 0.15s, transform 0.15s;
  cursor: pointer;
}

.team-row:hover {
  background-color: rgba(102, 126, 234, 0.05);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .team-row:hover {
  background-color: rgba(95, 163, 230, 0.1);
}

/* Rank-specific backgrounds */
.team-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.02) 100%);
  border-left: 4px solid #FFD700;
}

[data-bs-theme="dark"] .team-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.03) 100%);
}

.team-row.rank-2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.15) 0%, rgba(192, 192, 192, 0.02) 100%);
  border-left: 4px solid #C0C0C0;
}

[data-bs-theme="dark"] .team-row.rank-2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.2) 0%, rgba(192, 192, 192, 0.03) 100%);
}

.team-row.rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.15) 0%, rgba(205, 127, 50, 0.02) 100%);
  border-left: 4px solid #CD7F32;
}

[data-bs-theme="dark"] .team-row.rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.2) 0%, rgba(205, 127, 50, 0.03) 100%);
}

/* Match items */
.match-item {
  padding: 1rem;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background-color: rgba(0, 0, 0, 0.01);
}

.match-item:last-child {
  border-bottom: none;
}

.match-item:hover {
  background-color: rgba(40, 95, 165, 0.04);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .match-item {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background-color: rgba(255, 255, 255, 0.02);
}

[data-bs-theme="dark"] .match-item:hover {
  background-color: rgba(95, 163, 230, 0.08);
}

/* =================================================================
   BADGES - Odznaky a labely
   ================================================================= */

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.875rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  border: none !important;
  padding: 0 !important;
  background-clip: padding-box;
  isolation: isolate;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #FFD700, #FFA500) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-badge.silver {
  background: linear-gradient(135deg, #E8E8E8, #C0C0C0) !important;
  color: #333 !important;
  box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #CD7F32, #B87333) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.rank-badge.regular {
  background: #e9ecef;
  color: #6c757d;
}

[data-bs-theme="dark"] .rank-badge.regular {
  background: rgba(255, 255, 255, 0.1);
  color: #adb5bd;
}

/* Seed badge */
.seed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  background: rgba(40, 95, 165, 0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #285fa5;
  margin-right: 0.5rem;
}

[data-bs-theme="dark"] .seed-badge {
  background: rgba(95, 163, 230, 0.2);
  color: #5fa3e6;
}

/* Spirit badge */
.spirit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  background: rgba(230, 60, 50, 0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #e63c32;
}

[data-bs-theme="dark"] .spirit-badge {
  background: rgba(230, 60, 50, 0.2);
  color: #ff6b63;
}

/* League badge */
.league-badge {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Status badges */
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-ongoing {
  background-color: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.status-finished {
  background-color: rgba(108, 117, 125, 0.1);
  color: #495057;
}

.status-upcoming {
  background-color: rgba(255, 193, 7, 0.15);
  color: #997404;
}

[data-bs-theme="dark"] .status-ongoing {
  background-color: rgba(25, 135, 84, 0.2);
  color: #75b798;
}

[data-bs-theme="dark"] .status-finished {
  background-color: rgba(108, 117, 125, 0.2);
  color: #adb5bd;
}

[data-bs-theme="dark"] .status-upcoming {
  background-color: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

/* =================================================================
   TYPOGRAPHY - Texty, čísla, labely
   ================================================================= */

/* Page titles */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 1rem;
}

[data-bs-theme="dark"] .section-title {
  color: #f8f9fa;
}

/* Team names */
.team-name {
  font-weight: 600;
  color: #212529;
  font-size: 1.1rem;
}

[data-bs-theme="dark"] .team-name {
  color: #f8f9fa;
}

.team-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.team-name a:hover {
  color: #285fa5;
}

[data-bs-theme="dark"] .team-name a:hover {
  color: #5fa3e6;
}

/* Player names */
.player-name {
  font-weight: 600;
  color: #212529;
  font-size: 1rem;
}

[data-bs-theme="dark"] .player-name {
  color: #f8f9fa;
}

/* Player numbers */
.player-number {
  display: inline-block;
  text-align: end;
  min-width: 2.5rem;
  font-weight: 600;
  color: #6c757d;
  margin-right: 0.75rem;
}

[data-bs-theme="dark"] .player-number {
  color: #adb5bd;
}

/* Placement/spirit numbers */
.placement-number {
  font-weight: 700;
  color: #285fa5;
  margin-right: 0.5rem;
}

[data-bs-theme="dark"] .placement-number {
  color: #5fa3e6;
}

.spirit-number {
  font-weight: 700;
  color: #e63c32;
  margin-right: 0.5rem;
}

[data-bs-theme="dark"] .spirit-number {
  color: #ff6b63;
}

/* Team links */
.team-link {
  color: #212529;
  font-weight: 600;
  transition: color 0.15s;
  text-decoration: none;
}

[data-bs-theme="dark"] .team-link {
  color: #f8f9fa;
}

.team-link:hover {
  color: #285fa5;
}

[data-bs-theme="dark"] .team-link:hover {
  color: #5fa3e6;
}

/* Match score links */
.match-link {
  color: #212529;
  font-weight: 600;
  transition: color 0.15s;
  text-decoration: none;
}

[data-bs-theme="dark"] .match-link {
  color: #f8f9fa;
}

.match-link:hover {
  color: #285fa5;
}

[data-bs-theme="dark"] .match-link:hover {
  color: #5fa3e6;
}

/* Score links - for individual match scores */
.score-link {
  color: #212529;
  transition: color 0.15s;
  text-decoration: none;
}

[data-bs-theme="dark"] .score-link {
  color: #f8f9fa;
}

.score-link:hover {
  color: #285fa5;
}

[data-bs-theme="dark"] .score-link:hover {
  color: #5fa3e6;
}

/* Match labels and info */
.match-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
}

[data-bs-theme="dark"] .match-label {
  color: #adb5bd;
}

.match-team-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.match-datetime {
  font-size: 0.875rem;
  color: #6c757d;
}

[data-bs-theme="dark"] .match-datetime {
  color: #adb5bd;
}

.match-location-info {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .match-location-info {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Spirit category */
.spirit-category {
  font-size: 0.875rem;
  color: #212529;
  font-weight: 600;
  transition: color 0.15s;
}

[data-bs-theme="dark"] .spirit-category {
  color: #f8f9fa;
}

/* =================================================================
   SCORES & STATS - Číselné hodnoty
   ================================================================= */

/* Match scores */
.match-score {
  font-family: monospace;
  font-weight: 700;
  font-size: 1.125rem;
  min-width: 2.5rem;
  text-align: center;
}

/* Spirit scores */
.spirit-score {
  font-family: monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: #e63c32;
}

[data-bs-theme="dark"] .spirit-score {
  color: #ff6b63;
}

/* Spirit values */
.spirit-value-received {
  font-family: monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #285fa5;
}

[data-bs-theme="dark"] .spirit-value-received {
  color: #5fa3e6;
}

.spirit-value-given {
  font-family: monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #e63c32;
}

[data-bs-theme="dark"] .spirit-value-given {
  color: #ff6b63;
}

/* Stat labels */
.stats-label,
.spirit-label,
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
}

[data-bs-theme="dark"] .stats-label,
[data-bs-theme="dark"] .spirit-label,
[data-bs-theme="dark"] .stat-label {
  color: #adb5bd;
}

/* Stat-label specifics (when used in stat groups) */
.stat-label {
  display: block;
  margin-bottom: 0.25rem;
}

/* Stat values */
.stat-value {
  font-family: monospace;
  font-weight: 600;
  color: #495057;
  font-size: 1rem;
}

[data-bs-theme="dark"] .stat-value {
  color: #adb5bd;
}

.stat-highlight {
  font-family: monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: #285fa5;
}

[data-bs-theme="dark"] .stat-highlight {
  color: #5fa3e6;
}

.stat-value-highlight {
  font-family: monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: #285fa5;
}

[data-bs-theme="dark"] .stat-value-highlight {
  color: #5fa3e6;
}

/* =================================================================
   STAT GROUPS & ITEMS
   ================================================================= */

.stat-group {
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

[data-bs-theme="dark"] .stat-group {
  background: rgba(255, 255, 255, 0.05);
}

.stat-item {
  text-align: center;
  min-width: 0;
  flex: 1 1 auto;
}

/* Desktop stat layout */
.desktop-stats-layout {
  width: 100%;
}

.desktop-team-info {
  min-width: 0;
  flex: 1 1 auto;
  margin-right: auto;
}

.desktop-stats-right {
  flex: 0 0 auto;
  margin-left: auto;
}

.desktop-stat-box {
  flex: 0 0 auto;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.desktop-stat-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6c757d;
  margin-bottom: 0.35rem;
  text-align: center;
}

[data-bs-theme="dark"] .desktop-stat-title {
  color: #adb5bd;
}

/* Mobile stats layout */
.d-lg-none {
  width: 100%;
  max-width: 100%;
}

.mobile-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mobile-stats-half {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* =================================================================
   ACCORDION STYLES
   ================================================================= */

.accordion-item {
  border: none !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .accordion-item {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.accordion-button {
  font-size: 1rem;
}

/* Default blue accordion (for games, stages, etc.) */
.accordion-button:not(.collapsed) {
  background-color: rgba(40, 95, 165, 0.08);
  color: inherit;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: rgba(40, 95, 165, 0.15);
}

/* Spirit accordion (red) - only for spirit block */
.accordion-spirit .accordion-button:not(.collapsed) {
  background-color: rgba(230, 60, 50, 0.08);
  color: inherit;
}

[data-bs-theme="dark"] .accordion-spirit .accordion-button:not(.collapsed) {
  background-color: rgba(230, 60, 50, 0.15);
}

/* =================================================================
   SPIRIT TABLE - Speciální tabulka pro spirit výsledky
   ================================================================= */

.spirit-table {
  margin-bottom: 0;
}

.spirit-table thead th {
  background-color: rgba(230, 60, 50, 0.08);
  border-color: rgba(230, 60, 50, 0.14);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.75rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #6c757d;
}

[data-bs-theme="dark"] .spirit-table thead th {
  background-color: rgba(230, 60, 50, 0.15);
  border-color: rgba(255, 255, 255, 0.1);
  color: #adb5bd;
}

.spirit-table tbody tr {
  transition: transform 0.15s;
}

.spirit-table tbody tr:nth-child(odd) > * {
  --bs-table-bg: rgba(230, 60, 50, 0.035);
  background-color: rgba(230, 60, 50, 0.035) !important;
}

.spirit-table tbody tr:nth-child(even) > * {
  --bs-table-bg: rgba(230, 60, 50, 0.075);
  background-color: rgba(230, 60, 50, 0.075) !important;
}

.spirit-table tbody tr:hover > * {
  --bs-table-bg: rgba(230, 60, 50, 0.14);
  background-color: rgba(230, 60, 50, 0.14) !important;
}

.spirit-table tbody tr:hover {
  transform: translateX(4px);
}

[data-bs-theme="dark"] .spirit-table tbody tr:nth-child(odd) > * {
  --bs-table-bg: rgba(230, 60, 50, 0.06);
  background-color: rgba(230, 60, 50, 0.06) !important;
}

[data-bs-theme="dark"] .spirit-table tbody tr:nth-child(even) > * {
  --bs-table-bg: rgba(230, 60, 50, 0.11);
  background-color: rgba(230, 60, 50, 0.11) !important;
}

[data-bs-theme="dark"] .spirit-table tbody tr:hover > * {
  --bs-table-bg: rgba(230, 60, 50, 0.18);
  background-color: rgba(230, 60, 50, 0.18) !important;
}

.spirit-table tbody td {
  padding: 0.875rem 0.5rem;
  vertical-align: middle;
  border-color: rgba(230, 60, 50, 0.1);
}

.spirit-table tbody td:not(:first-child) {
  font-family: monospace;
}

[data-bs-theme="dark"] .spirit-table tbody td {
  border-color: rgba(255, 255, 255, 0.08);
}

.spirit-table tfoot tr > * {
  --bs-table-bg: rgba(230, 60, 50, 0.20);
  background-color: rgba(230, 60, 50, 0.20) !important;
  font-weight: 700;
  border-top: 3px solid rgba(230, 60, 50, 0.65);
  border-bottom: none;
}

.spirit-table tfoot td:not(:first-child) {
  font-family: monospace;
}

.spirit-table tfoot .total-score {
  color: #c42d25;
}

[data-bs-theme="dark"] .spirit-table tfoot tr > * {
  --bs-table-bg: rgba(230, 60, 50, 0.28);
  background-color: rgba(230, 60, 50, 0.28) !important;
  border-top-color: rgba(230, 60, 50, 0.70);
}

[data-bs-theme="dark"] .spirit-table tfoot .total-score {
  color: #ff6b63;
}

.spirit-table tfoot td {
  padding: 0.875rem 0.5rem;
  border-color: rgba(230, 60, 50, 0.25);
}

[data-bs-theme="dark"] .spirit-table tfoot td {
  border-color: rgba(230, 60, 50, 0.32);
}

.team-name-cell a {
  color: #212529;
  font-weight: 600;
  transition: color 0.15s;
}

[data-bs-theme="dark"] .team-name-cell a {
  color: #f8f9fa;
}

.team-name-cell a:hover {
  color: #285fa5;
}

[data-bs-theme="dark"] .team-name-cell a:hover {
  color: #5fa3e6;
}

.total-score {
  font-family: monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: #e63c32;
}

[data-bs-theme="dark"] .total-score {
  color: #ff6b63;
}

/* =================================================================
   LEGEND
   ================================================================= */

.legend-list {
  padding: 1rem 1.25rem;
  margin-bottom: 0;
}

.legend-list li {
  padding: 0.375rem 0;
  font-size: 0.9rem;
}

/* =================================================================
   TOURNAMENT DETAIL PAGE - Group & Playoff cards
   ================================================================= */

/* Group cards */
.group-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .group-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
              0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* Playoff cards */
.playoff-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

[data-bs-theme="dark"] .playoff-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
              0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.playoff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
              0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .playoff-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
              0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Stage headings */
.stage-heading {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

/* Match table */
.match-table {
  font-size: 0.8rem;
}

/* Stats table */
.stats-table {
  font-size: 0.8rem;
}

/* Match table score cells */
.match-table-cell-score {
  font-family: monospace;
  font-weight: 700;
}

/* =================================================================
   BRACKET TOURNAMENT - Minimal styling for bracket view
   ================================================================= */

/* Bracket viewport */
#bracket-viewport {
  border-radius: 12px;
}

/* Stage cards - only add border-radius and shadow, preserve inline colors */
#bracket-strip .card {
  border-radius: 16px;
  overflow: hidden;
}

#bracket-strip .card-header {
  border-radius: 0;
}

/* Page title */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

/* Score cells and match scores - monospace */
.score-cell,
.match-score {
  font-family: monospace;
}

/* =================================================================
   RESPONSIVE - Media queries
   ================================================================= */

/* Large screens (lg) */
@media (max-width: 1199px) {
  .desktop-stat-box {
    width: 250px;
    flex-basis: 250px;
  }

  .desktop-stat-title {
    font-size: 0.6rem;
    margin-bottom: 0.3rem;
  }

  .desktop-stats-right {
    gap: 0.75rem !important;
  }

  .desktop-stat-box .d-flex {
    gap: 0.75rem !important;
  }
}

/* Medium screens (md) */
@media (max-width: 992px) {
  .team-name {
    font-size: 1rem;
  }
  
  .rank-badge {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
    margin-right: 0.5rem;
  }
  
  .team-row {
    padding: 0.875rem 1rem;
  }
  
  .team-row .team-top {
    margin-bottom: 0.75rem !important;
  }
  
  .team-row .d-lg-none {
    width: 100%;
  }
  
  .stat-group {
    padding: 0.4rem 0.6rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .mobile-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }
  
  .stat-value {
    font-size: 0.875rem;
  }
  
  .stat-label {
    font-size: 0.65rem;
  }
  
  .stat-group .stat-label.mb-2 {
    margin-bottom: 0.5rem !important;
  }
  
  .stat-item {
    min-width: 0;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
}

/* Tablet/mobile - common adjustments */
@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }
  
  .player-number {
    min-width: 2rem;
    margin-right: 0.5rem;
    font-size: 0.875rem;
  }
  
  .player-name {
    font-size: 0.9rem;
  }
  
  .placement-item,
  .spirit-item,
  .player-row,
  .player-row-ppg {
    padding: 0.625rem 0.875rem;
  }

  .spirit-table {
    font-size: 0.85rem;
  }
  
  .spirit-table thead th,
  .spirit-table tbody td,
  .spirit-table tfoot td {
    padding: 0.5rem 0.25rem;
  }

  .spirit-table tbody tr:hover {
    transform: none;
  }
}

/* Small screens (sm) */
@media (max-width: 576px) {
  .team-row {
    padding: 0.9rem;
  }

  .team-row:hover {
    transform: none;
  }

  .team-row .team-top {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem !important;
  }
  
  .team-row .d-lg-none {
    width: 100%;
  }

  .rank-badge {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 0.8rem;
    margin-right: 0.65rem;
  }

  .team-name {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
  }

  .seed-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    display: inline-block;
    margin-left: 0;
    margin-top: 0.25rem;
  }

  .mobile-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-left: 0;
    margin-right: 0;
  }

  .mobile-stats-half {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stat-group {
    min-height: 105px;
    padding: 0.55rem 0.45rem;
    border-radius: 10px;
  }

  .stat-group > .stat-label {
    text-align: center;
    font-size: 0.62rem;
    margin-bottom: 0.45rem !important;
  }

  .stat-group .d-flex {
    gap: 0.25rem !important;
  }

  .stat-item {
    min-width: 0;
    flex: 1 1 0;
    text-align: center;
  }

  .stat-label {
    font-size: 0.56rem;
    line-height: 1.1;
    margin-bottom: 0.15rem;
  }

  .stat-value {
    font-size: 0.78rem;
    line-height: 1.1;
  }

  .stat-value-highlight {
    font-size: 0.82rem;
    line-height: 1.1;
  }

  .page-title {
    font-size: 1.4rem;
  }
}
