/* ============================================
   LEADERBOARD-SPECIFIC CEEFAX STYLES
   ============================================ */

/* Leaderboard Row Colors by Rank */
.broadcast-table tbody tr:nth-child(1) {
  background: #ffff00;
  color: #000;
}

.broadcast-table tbody tr:nth-child(2) {
  background: #00ffff;
  color: #000;
}

.broadcast-table tbody tr:nth-child(3) {
  background: #ff00ff;
  color: #000;
}

.broadcast-table tbody tr:nth-child(n+4):nth-child(-n+6) {
  background: #00ff00;
  color: #000;
}

.broadcast-table tbody tr:nth-child(n+7):nth-child(-n+10) {
  background: #0066cc;
  color: #fff;
}

.broadcast-table tbody tr:nth-child(n+11) {
  background: #cc0000;
  color: #fff;
}

.broadcast-table tbody tr td:first-child {
  font-size: 1.3rem;
  font-weight: 900;
}

/* Movement Column */
.move-up {
  background: #000 !important;
  color: #00ff00 !important;
  padding: 4px 8px;
  border: 2px solid #00ff00;
  font-weight: 900;
  display: inline-block;
  min-width: 40px;
}

.move-down {
  background: #000 !important;
  color: #ff0000 !important;
  padding: 4px 8px;
  border: 2px solid #ff0000;
  font-weight: 900;
  display: inline-block;
  min-width: 40px;
}

.move-none {
  background: #000 !important;
  color: #666 !important;
  padding: 4px 8px;
  border: 2px solid #333;
  font-weight: 900;
  display: inline-block;
  min-width: 40px;
}

/* Player Cell */
.player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
}

.player-cell img,
.blank-head {
  width: 30px;
  height: 30px;
  border-radius: 0;
  border: 2px solid #000;
  image-rendering: pixelated;
}

.blank-head {
  background: #666;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='black' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='8' y='6' width='8' height='8'/%3E%3Crect x='6' y='16' width='12' height='6'/%3E%3C/svg%3E");
  background-size: 80%;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
}

.player-cell a {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  display: inline-block;
}

.broadcast-table tbody tr:nth-child(1) .player-cell a,
.broadcast-table tbody tr:nth-child(2) .player-cell a,
.broadcast-table tbody tr:nth-child(3) .player-cell a,
.broadcast-table tbody tr:nth-child(n+4):nth-child(-n+6) .player-cell a {
  color: #000 !important;
}

.broadcast-table tbody tr:nth-child(n+7) .player-cell a {
  color: #fff !important;
}

.player-cell a:hover {
  text-decoration: underline;
}

/* Form Column */
.form-column {
  white-space: nowrap;
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.form-column span {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0 2px;
  border: 2px solid #000;
  font-size: 0;
  overflow: hidden;
}

.form-column span[title="Win"] {
  background: #00ff00;
}

.form-column span[title="Loss"] {
  background: #ff0000;
}

.form-column span[title="Draw"] {
  background: #ffff00;
}

.form-column span[title="DNP"] {
  background: #666;
}

/* Responsive overrides */
@media (max-width: 768px) {
  .player-cell {
    padding-left: 5px;
    gap: 5px;
  }

  .player-cell img,
  .blank-head {
    width: 24px;
    height: 24px;
  }

  /* Make player names shorter on mobile */
  .player-cell a {
    font-size: 0.9rem;
    max-width: 120px;
  }

  /* Smaller rank numbers */
  .broadcast-table tbody tr td:first-child {
    font-size: 1rem;
    padding: 8px 4px;
  }

  /* Compact form column */
  .form-column span {
    width: 16px;
    height: 16px;
    margin: 0 1px;
  }

  /* Stack controls vertically */
  .sort-controls .row {
    gap: 15px;
  }

  .sort-controls .col-md-6 {
    width: 100%;
  }
}
