
/* ===== Step 7: Real Leaderboard ===== */

.leaderboard-hero{
  padding:40px 0;
}

.leaderboard-browser{
  padding-top:28px;
}

.leaderboard-tabs{
  display:flex;
  gap:9px;
  overflow-x:auto;
  padding-bottom:10px;
  margin-bottom:18px;
}

.leaderboard-tab{
  flex:0 0 auto;
  padding:10px 14px;
  border-radius:11px;
  border:1px solid var(--line);
  background:#fff;
  color:inherit;
  font-weight:800;
}

.leaderboard-tab.active{
  background:var(--blue);
  color:#fff;
  border-color:var(--blue);
}

.leaderboard-section-title{
  margin-bottom:14px;
}

.leaderboard-section-title h2{
  margin:0;
}

.leaderboard-section-title p{
  margin:4px 0 0;
  color:var(--muted);
}

.leaderboard-policy-note{
  padding:12px 14px;
  margin-bottom:18px;
  border:1px solid #d7e3f8;
  border-radius:12px;
  background:#f2f7ff;
  color:#405d85;
}

.leaderboard-podium{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-bottom:20px;
}

.podium-card{
  text-align:center;
  padding:20px 14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
}

.podium-card.rank-1{
  transform:translateY(-5px);
}

.podium-rank{
  font-size:29px;
  margin-bottom:10px;
}

.leaderboard-avatar{
  width:46px;
  height:46px;
  border-radius:50%;
  overflow:hidden;
  background:#eef3ff;
  display:grid;
  place-items:center;
  flex:0 0 46px;
}

.leaderboard-avatar.large{
  width:74px;
  height:74px;
  margin:0 auto 10px;
}

.leaderboard-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.podium-card strong,
.podium-card span{
  display:block;
}

.podium-card span{
  margin-top:5px;
  color:var(--muted);
}

.leaderboard-list{
  overflow:hidden;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
}

.leaderboard-row{
  display:grid;
  grid-template-columns:58px 52px minmax(0,1fr) 110px;
  align-items:center;
  gap:10px;
  padding:13px 16px;
  border-bottom:1px solid var(--line);
}

.leaderboard-row:last-child{
  border-bottom:0;
}

.leaderboard-rank{
  font-weight:900;
  font-size:17px;
}

.leaderboard-user strong,
.leaderboard-user small,
.leaderboard-score strong,
.leaderboard-score small{
  display:block;
}

.leaderboard-user small,
.leaderboard-score small{
  color:var(--muted);
  margin-top:2px;
}

.leaderboard-score{
  text-align:right;
}

.leaderboard-app-cta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:20px;
  padding:18px;
  border-radius:17px;
  background:#0d4fbd;
  color:#fff;
}

.leaderboard-app-cta h3{
  margin:0 0 4px;
}

.leaderboard-app-cta p{
  margin:0;
  opacity:.88;
}

.contest-selector-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:17px;
  margin-bottom:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
}

.contest-selector-card h2{
  margin:0;
}

.contest-selector-card p{
  margin:4px 0 0;
  color:var(--muted);
}

.contest-selector-form select{
  min-width:260px;
  max-width:100%;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  font:inherit;
}

.selected-contest-summary{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f9fbff;
}

.selected-contest-summary img{
  width:60px;
  height:60px;
  object-fit:cover;
  border-radius:11px;
}

.selected-contest-summary strong,
.selected-contest-summary span{
  display:block;
}

.selected-contest-summary span{
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
}

/* Homepage parent cards */
.home-leaderboard-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:15px;
}

.home-leaderboard-card{
  display:flex;
  flex-direction:column;
  min-height:195px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  color:inherit;
  box-shadow:var(--shadow);
  transition:.18s ease;
}

.home-leaderboard-card:hover{
  transform:translateY(-3px);
  border-color:#aec7f3;
}

.home-leaderboard-icon{
  width:49px;
  height:49px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:linear-gradient(135deg,#edf3ff,#fff4c9);
  font-size:25px;
  margin-bottom:14px;
}

.home-leaderboard-card strong{
  font-size:17px;
}

.home-leaderboard-card small{
  margin-top:6px;
  color:var(--muted);
}

.home-leaderboard-action{
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top:auto;
  padding:11px 12px;
  border-radius:11px;
  background:linear-gradient(90deg,#1769ed,#064fca);
  color:#fff;
  font-weight:800;
  font-size:13px;
}

@media(max-width:1000px){
  .home-leaderboard-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:750px){
  .leaderboard-podium{
    grid-template-columns:1fr;
  }

  .podium-card.rank-1{
    transform:none;
  }

  .contest-selector-card,
  .leaderboard-app-cta{
    align-items:flex-start;
    flex-direction:column;
  }

  .contest-selector-form,
  .contest-selector-form select,
  .leaderboard-app-cta .btn{
    width:100%;
  }
}

@media(max-width:580px){
  .home-leaderboard-grid{
    grid-template-columns:1fr;
  }

  .leaderboard-row{
    grid-template-columns:42px 46px minmax(0,1fr);
  }

  .leaderboard-score{
    grid-column:3;
    text-align:left;
  }
}
