/* Yipshanks Leaderboard styles
   Extends the main site theme */

/* NAV ACTIVE STATE */
.nav-active {
  color: var(--c-gold) !important;
  font-weight: 700 !important;
}

/* STEPS GRID */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}

.step-card {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.step-card:hover {
  transform: translateY(-2px);
  border-color: var(--c-border-strong);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--c-gold);
  color: var(--c-bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 17px;
  color: var(--c-cream);
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--c-cream-muted);
  line-height: 1.6;
}

/* PERKS GRID */
.perks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.perk-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s;
}

.perk-card:hover {
  transform: translateY(-2px);
  border-color: var(--c-border-strong);
}

.perk-icon {
  display: inline-block;
  font-size: 28px;
  margin-bottom: 12px;
}

.perk-card h3 {
  font-size: 16px;
  color: var(--c-cream);
  margin-bottom: 6px;
}

.perk-card p {
  font-size: 14px;
  color: var(--c-cream-muted);
  line-height: 1.6;
}

/* BOARD PAGE STYLES */

/* Controls bar */
.board-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.board-controls select,
.board-controls input {
  background: var(--c-bg-alt);
  color: var(--c-cream);
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-sans);
  min-height: 44px;
}

.board-controls select:focus,
.board-controls input:focus {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.board-controls input {
  flex: 1;
  min-width: 200px;
}

.board-controls select {
  min-width: 160px;
}

/* Stats ribbon */
.stats-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--c-cream);
}

.stat-chip .stat-value {
  color: var(--c-gold);
  font-weight: 700;
}

/* Leaderboard table */
.board-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.board-table th {
  background: var(--c-bg-alt);
  color: var(--c-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--c-border-strong);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  min-height: 44px;
}

.board-table th:hover {
  color: var(--c-gold-bright);
}

.board-table th .sort-arrow {
  margin-left: 4px;
  opacity: 0.4;
}

.board-table th.sorted .sort-arrow {
  opacity: 1;
}

.board-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-cream);
  white-space: nowrap;
}

.board-table tbody tr {
  transition: background 0.15s;
}

.board-table tbody tr:hover {
  background: rgba(191, 162, 78, 0.06);
}

/* Rank column */
.board-table .rank {
  width: 48px;
  text-align: center;
  font-weight: 700;
  color: var(--c-gold);
}

.rank-1 { color: #FFD700 !important; }
.rank-2 { color: #C0C0C0 !important; }
.rank-3 { color: #CD7F32 !important; }

/* Score styling */
.score-under { color: #4CAF50; font-weight: 700; }
.score-even { color: var(--c-cream); font-weight: 600; }
.score-over { color: var(--c-cream-muted); }

/* Badge pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-fire {
  background: rgba(255, 87, 34, 0.15);
  color: #FF7043;
  border: 1px solid rgba(255, 87, 34, 0.3);
}

.badge-record {
  background: rgba(255, 215, 0, 0.12);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.badge-eagle {
  background: rgba(76, 175, 80, 0.12);
  color: #66BB6A;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-milestone {
  background: rgba(191, 162, 78, 0.12);
  color: var(--c-gold);
  border: 1px solid rgba(191, 162, 78, 0.3);
}

/* Watch button */
.watch-btn {
  background: none;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  color: var(--c-cream-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  padding: 0;
  min-height: 44px;
  min-width: 44px;
}

.watch-btn:hover {
  color: var(--c-gold);
  border-color: var(--c-gold-muted);
}

.watch-btn.watching {
  color: var(--c-gold);
  border-color: var(--c-gold);
}

/* Empty state */
.board-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--c-cream-muted);
}

.board-empty h3 {
  color: var(--c-cream);
  font-size: 20px;
  margin-bottom: 8px;
}

.board-empty p {
  font-size: 15px;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Achievements sidebar / section */
.achievements-section {
  margin-top: 40px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 10px;
}

.achievement-card .ach-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.achievement-card .ach-text h4 {
  font-size: 13px;
  color: var(--c-cream);
  margin-bottom: 2px;
}

.achievement-card .ach-text p {
  font-size: 11px;
  color: var(--c-cream-muted);
}

.achievement-card.earned {
  border-color: var(--c-gold-muted);
  background: rgba(191, 162, 78, 0.06);
}

/* Responsive */
@media (max-width: 640px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .perks-grid {
    grid-template-columns: 1fr;
  }
  .board-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .board-controls select,
  .board-controls input {
    width: 100%;
  }
  .board-table {
    font-size: 13px;
  }
  .board-table th,
  .board-table td {
    padding: 10px 12px;
  }
  .achievements-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-card,
  .perk-card,
  .board-table tbody tr {
    transition: none !important;
  }
}
