* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 1.5rem 1rem 0.75rem;
}

header h1 {
  font-size: 1.6rem;
  color: #f5a623;
  text-transform: uppercase;
  letter-spacing: 2px;
}

header .season {
  color: #888;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

/* Rules button */
.rules-btn {
  background: none;
  border: none;
  color: #555;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  font-family: inherit;
  margin-top: 0.4rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rules-btn:hover {
  color: #f5a623;
}

/* Rules modal overlay */
.rules-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.rules-overlay.active {
  display: flex;
}

.rules-modal {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  position: relative;
}

.rules-modal h2 {
  color: #f5a623;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rules-modal p {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.rules-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.rules-close:hover {
  color: #fff;
}

.leaderboard {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Player Card — single row */
.player-card {
  background: #16213e;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  border: 1px solid #0f3460;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
  flex-shrink: 0;
}

.player-rank {
  font-size: 0.9rem;
  color: #888;
  font-weight: 600;
  min-width: 1.5rem;
}

.player-name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.player-score-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 3.5rem;
}

.player-score {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f5a623;
  text-align: center;
}

.player-score-label {
  font-size: 0.5rem;
  color: #888;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Picks — all 6 in a row */
.picks-row {
  display: flex;
  align-items: flex-start;
  flex: 1;
  justify-content: space-evenly;
}

.picks-divider {
  width: 1px;
  height: 50px;
  background: #0f3460;
  margin: 0 0.25rem;
  flex-shrink: 0;
  align-self: center;
}

/* Individual Pick */
.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.25rem;
  border-radius: 6px;
  position: relative;
  width: 72px;
  flex-shrink: 0;
}

.pick.eliminated {
  opacity: 0.45;
}

.pick-image-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  margin-bottom: 0.2rem;
}

.pick-image-wrapper img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.pick-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  pointer-events: none;
}

.pick.winner.eliminated .pick-overlay {
  background: rgba(244, 67, 54, 0.6);
  color: #fff;
}

.pick.loser.eliminated .pick-overlay {
  background: rgba(76, 175, 80, 0.6);
  color: #fff;
}

.pick-name {
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.1;
  width: 64px;
  word-wrap: break-word;
  height: 2.2em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* W / L labels next to pick groups */
.picks-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
  align-self: center;
}

.winners-label {
  color: #4caf50;
}

.losers-label {
  color: #f44336;
}

/* Per-pick points */
.pick-pts {
  font-size: 0.6rem;
  font-weight: 700;
  margin-top: 0.2rem;
  padding-top: 0.2rem;
  border-top: 1px solid #0f3460;
  width: 100%;
  text-align: center;
}

.pts-pos {
  color: #4caf50;
}

.pts-neg {
  color: #f44336;
}

.pts-zero {
  color: #666;
}

.waiting {
  color: #666;
  font-style: italic;
  font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 700px) {
  .player-card {
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .player-info {
    min-width: unset;
    width: 100%;
    gap: 0.4rem;
  }

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

  .picks-row {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .picks-divider {
    display: none;
  }

  .picks-label {
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    margin-top: 0.25rem;
  }

  .winners-label::after {
    content: "inners";
  }

  .losers-label::after {
    content: "osers";
  }

  .pick {
    width: 80px;
  }

  .pick-image-wrapper,
  .pick-image-wrapper img,
  .pick-overlay {
    width: 52px;
    height: 52px;
  }

  .pick-overlay {
    font-size: 1.4rem;
  }

  .pick-name {
    font-size: 0.65rem;
    width: 72px;
  }

  .player-score-wrapper {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 0.4rem;
    padding-top: 0.25rem;
    border-top: 1px solid #0f3460;
  }

  .player-score {
    font-size: 1.3rem;
  }

  .player-score-label {
    font-size: 0.6rem;
    align-self: center;
  }
}
