/* Playoff Bracket Styles - Mobile-First Vertical Layout */

.bracket-container {
  background: linear-gradient(135deg,
    rgba(0, 76, 151, 0.03) 0%,
    rgba(198, 12, 48, 0.03) 50%,
    rgba(247, 73, 2, 0.03) 100%
  );
  padding: 1.5rem 1rem;
  border-radius: 12px;
  margin-top: 2rem;
}

.bracket-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* Round Section */
.bracket-round {
  margin-bottom: 3rem;
  position: relative;
}

.round-label {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid;
  border-image: linear-gradient(to right, var(--eagles-blue), var(--phillies-red)) 1;
  background: linear-gradient(135deg, var(--eagles-blue), var(--phillies-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Match Cards Grid */
.matches-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

/* Match Card - World Cup Style */
.match-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.match-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--eagles-blue), var(--phillies-red));
}

.match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.match-card.completed::before {
  width: 8px;
  background: linear-gradient(135deg, var(--eagles-blue), var(--phillies-red), var(--flyers-orange));
}

.match-card.pending {
  opacity: 0.8;
}

/* Match Header */
.match-header {
  background: linear-gradient(135deg,
    rgba(0, 76, 151, 0.08),
    rgba(198, 12, 48, 0.08)
  );
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Match Players */
.match-players {
  padding: 1rem;
}

.match-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  background: var(--accent-white);
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.match-player:first-child {
  margin-top: 0;
}

.match-player:last-child {
  margin-bottom: 0;
}

.match-player.winner {
  background: linear-gradient(135deg,
    rgba(0, 76, 151, 0.15),
    rgba(198, 12, 48, 0.15)
  );
  border-color: var(--eagles-blue);
  font-weight: 600;
  transform: scale(1.02);
}

.match-player.winner .player-name {
  color: var(--eagles-blue);
  font-weight: 700;
}

.match-player.winner::after {
  content: '✓';
  margin-left: 0.5rem;
  color: var(--eagles-blue);
  font-size: 1.2rem;
  font-weight: bold;
}

.match-player.tbd {
  opacity: 0.5;
  font-style: italic;
  background: transparent;
  border: 2px dashed var(--border-light);
}

.player-name {
  flex: 1;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

.player-seed {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.75rem;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

/* Match Info/Result */
.match-info {
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--accent-white);
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.match-result {
  font-weight: 600;
  color: var(--eagles-blue);
}

.match-info.completed {
  background: linear-gradient(135deg,
    rgba(0, 76, 151, 0.05),
    rgba(198, 12, 48, 0.05)
  );
}

/* Connector Between Rounds */
.round-connector {
  text-align: center;
  padding: 1.5rem 0;
  position: relative;
}

.round-connector::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--eagles-blue), var(--phillies-red));
  transform: translateX(-50%);
}

.round-connector::after {
  content: '▼';
  position: relative;
  z-index: 1;
  background: white;
  padding: 0.5rem;
  color: var(--phillies-red);
  font-size: 1.5rem;
  display: inline-block;
}

/* Finals Section - Special Styling */
.finals-section {
  margin-top: 3rem;
  padding: 2rem 1rem;
  background: linear-gradient(135deg,
    rgba(0, 76, 151, 0.08) 0%,
    rgba(198, 12, 48, 0.08) 100%
  );
  border-radius: 12px;
  border: 3px solid;
  border-image: linear-gradient(135deg, var(--eagles-blue), var(--phillies-red)) 1;
}

.finals-section .round-label {
  font-size: 2rem;
  margin-bottom: 2rem;
  border-bottom: 4px solid;
}

.finals-section .match-card {
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.finals-section .match-card::before {
  width: 10px;
}

/* Champion Display */
.champion-display {
  margin-top: 2rem;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, var(--eagles-blue), var(--phillies-red));
  color: white;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.champion-display::before {
  content: '🏆';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 3rem;
  opacity: 0.3;
}

.champion-display h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.9;
}

.champion-name {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 1rem 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.champion-display p {
  margin-top: 1rem;
  font-size: 1.1rem;
  opacity: 0.95;
}

/* Bracket Status */
.bracket-status {
  background-color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border-left: 5px solid var(--eagles-blue);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.bracket-status.waiting {
  border-left-color: var(--flyers-orange);
  background-color: #FFF3CD;
  color: #856404;
}

.bracket-status.active {
  border-left-color: var(--eagles-blue);
}

/* Desktop Enhancements */
@media (min-width: 768px) {
  .bracket-container {
    padding: 2rem;
  }

  .matches-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .bracket-round.semifinals .matches-grid {
    max-width: 600px;
    margin: 0 auto;
  }

  .match-player {
    padding: 1.25rem;
  }

  .player-name {
    font-size: 1.05rem;
  }

  .champion-display {
    padding: 3rem 2rem;
  }

  .champion-name {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .matches-grid {
    gap: 2rem;
  }

  .round-label {
    font-size: 1.8rem;
  }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
  .bracket-container {
    padding: 1rem 0.5rem;
  }

  .round-label {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .match-player {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .player-name {
    font-size: 0.9rem;
  }

  .player-seed {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin-right: 0.5rem;
  }

  .match-header {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }

  .champion-display h2 {
    font-size: 1.2rem;
  }

  .champion-name {
    font-size: 2rem;
  }

  .champion-display p {
    font-size: 0.95rem;
  }

  .finals-section {
    padding: 1.5rem 0.75rem;
  }

  .finals-section .round-label {
    font-size: 1.6rem;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Print Styles */
@media print {
  .bracket-container {
    background: white;
    box-shadow: none;
  }

  .match-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--border-light);
  }

  header, footer, nav {
    display: none;
  }

  .round-connector::before,
  .round-connector::after {
    display: none;
  }
}
