/* bracket.css */

/* Master Wrapper - acts as the "body" for your widget */
#hockey-bracket-widget {
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  background-color: #f4f7f6;
  color: #333;
  padding: 20px;
  box-sizing: border-box;
}

#hockey-bracket-widget *, 
#hockey-bracket-widget *::before, 
#hockey-bracket-widget *::after {
  box-sizing: inherit;
}

#hockey-bracket-widget .bracket-wrapper {
  width: 100%;
  overflow-x: auto;
  padding-top: 50px;
  padding-bottom: 20px;
}

#hockey-bracket-widget .bracket-container {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  height: 900px;
  min-width: 1100px;
  padding: 0 20px;
}

#hockey-bracket-widget .bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 240px;
  margin-right: 40px;
  position: relative;
}

#hockey-bracket-widget .bracket-round:last-child {
  margin-right: 0;
}

#hockey-bracket-widget .round-title {
  position: absolute;
  top: -40px;
  width: 100%;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 1px;
  font-size: 14px;
}

#hockey-bracket-widget .matchup-connector {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  position: relative;
}

#hockey-bracket-widget .bracket-round:not(:last-child) .matchup-connector::after {
  content: '';
  position: absolute;
  right: -20px;
  top: calc(25% - 1px);
  bottom: calc(25% - 1px);
  width: 2px;
  background-color: #b0b5ba;
}

#hockey-bracket-widget .matchup {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

#hockey-bracket-widget .bracket-round:not(:last-child) .matchup::after {
  content: '';
  position: absolute;
  right: -20px;
  top: calc(50% - 1px);
  width: 20px;
  height: 2px;
  background-color: #b0b5ba;
}

#hockey-bracket-widget .bracket-round:not(:first-child) .matchup::before {
  content: '';
  position: absolute;
  left: -20px;
  top: calc(50% - 1px);
  width: 20px;
  height: 2px;
  background-color: #b0b5ba;
}

/* --- MEDAL GAMES STYLING --- */

#hockey-bracket-widget .championship-matchup {
  border: 2px solid #FFD700; 
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); 
}

#hockey-bracket-widget .bronze-matchup {
  border: 2px solid #cd7f32; 
  box-shadow: 0 0 15px rgba(205, 127, 50, 0.4); 
}

/* Remove incoming connector line for the Bronze game */
#hockey-bracket-widget .bracket-round:not(:first-child) .bronze-matchup::before {
  display: none !important;
}

/* Structural containers for the final round */
#hockey-bracket-widget .finals-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  height: 100%;
  width: 100%;
}

#hockey-bracket-widget .bronze-wrapper {
  position: absolute;
  bottom: 0;
  width: 100%;
}

/* --- META & TEAM STYLING --- */

#hockey-bracket-widget .matchup-meta {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  background-color: #f8f9fa;
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

#hockey-bracket-widget .championship-matchup .matchup-meta {
  background-color: #fffdf0; 
  border-bottom: 1px solid #fbe78a;
}

#hockey-bracket-widget .bronze-matchup .matchup-meta {
  background-color: #fffaf4; 
  border-bottom: 1px solid #f0d0b5;
}

#hockey-bracket-widget .team {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  font-size: 14px;
}

#hockey-bracket-widget .team.top { 
  border-bottom: 1px solid #eee; 
}

#hockey-bracket-widget .team .seed {
  font-size: 11px;
  color: #999;
  margin-right: 8px;
  width: 14px;
  text-align: right;
}

#hockey-bracket-widget .team .logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #e0e0e0;
  margin-right: 8px;
  border: 1px solid #ccc;
  object-fit: cover;
}

#hockey-bracket-widget .team .team-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hockey-bracket-widget .team .score {
  font-weight: bold;
  color: #1a73e8;
  margin-left: 10px;
}

#hockey-bracket-widget .winner {
  font-weight: bold;
  background-color: #f0f7ff;
}

/* --- META & TEAM STYLING --- */

/* --- META & TEAM STYLING --- */

#hockey-bracket-widget .matchup-meta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  background-color: #f8f9fa;
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
}

#hockey-bracket-widget .game-num {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: #e0e4e8; /* Subtle, professional grey tab */
  color: #444;
  font-weight: 700;
  font-size: 9px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #dcdcdc;
}

#hockey-bracket-widget .meta-details {
  flex: 1;
  text-align: center;
  padding-left: 18px; /* Buffer so text doesn't hit the game number tab */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Adds '...' if the rink name is too long */
}