/* ==========================================================================
   Continent Public Stats - Leaderboard Period Styles
   Path: wp-content/plugins/wp-continent-public-stats/assets/css/cps-leaderboard-periods.css
   ========================================================================== */

.cps-leaderboard{
  --cpsLbBg: #0f172a;
  --cpsLbPanel: #111827;
  --cpsLbPanelAlt: #1f2937;
  --cpsLbLine: rgba(255,255,255,0.08);
  --cpsLbText: #e5e7eb;
  --cpsLbMuted: #94a3b8;
  --cpsLbAccent: #22c55e;
  --cpsLbAccentAlt: #38bdf8;
  --cpsLbGold: #f59e0b;
  --cpsLbSilver: #cbd5e1;
  --cpsLbBronze: #b45309;
  --cpsLbDanger: #ef4444;
  --cpsLbRadiusLg: 18px;
  --cpsLbRadiusMd: 12px;
  --cpsLbRadiusSm: 10px;
  --cpsLbGap: 14px;
  --cpsLbShadow: 0 12px 30px rgba(0,0,0,0.28);
  color: var(--cpsLbText);
}

.cps-leaderboard *,
.cps-leaderboard *::before,
.cps-leaderboard *::after{
  box-sizing: border-box;
}

.cps-leaderboard-empty{
  padding: 18px;
  border: 1px solid var(--cpsLbLine);
  border-radius: var(--cpsLbRadiusMd);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  color: var(--cpsLbMuted);
  text-align: center;
}

/* ==========================================================================
   Daily
   ========================================================================== */

.cps-leaderboard-daily-shell{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cps-daily-top3-wrap,
.cps-daily-rest-wrap{
  width: 100%;
}

.cps-daily-top3-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cps-daily-top3-card{
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 170px;
  border: 1px solid var(--cpsLbLine);
  border-radius: var(--cpsLbRadiusLg);
  background:
    radial-gradient(circle at top right, rgba(34,197,94,0.14), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  box-shadow: var(--cpsLbShadow);
}

.cps-daily-top3-card::after{
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cpsLbAccent), transparent);
  opacity: 0.85;
}

.cps-daily-top3-rank{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cps-daily-top3-player{
  margin-top: 16px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: #fff;
  word-break: break-word;
}

.cps-daily-top3-metric{
  margin-top: 12px;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: var(--cpsLbAccent);
}

.cps-daily-top3-stats{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.cps-daily-top3-kills,
.cps-daily-top3-deaths{
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--cpsLbText);
  font-size: 12px;
  font-weight: 700;
}

.cps-daily-rest-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cps-daily-rest-row{
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--cpsLbLine);
  border-radius: var(--cpsLbRadiusMd);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.cps-daily-rest-rank{
  font-size: 14px;
  font-weight: 800;
  color: var(--cpsLbMuted);
}

.cps-daily-rest-player{
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cps-daily-rest-metric{
  font-size: 15px;
  font-weight: 800;
  color: var(--cpsLbAccent);
  text-align: right;
}

/* ==========================================================================
   Weekly
   ========================================================================== */

.cps-leaderboard-weekly-shell{
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.cps-weekly-top3-wrap,
.cps-weekly-rest-wrap{
  min-width: 0;
}

.cps-weekly-top3-stack{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cps-weekly-top3-entry{
  border: 1px solid var(--cpsLbLine);
  border-radius: var(--cpsLbRadiusLg);
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.12), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  overflow: hidden;
  box-shadow: var(--cpsLbShadow);
}

.cps-weekly-top3-head{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cpsLbLine);
  background: rgba(255,255,255,0.03);
}

.cps-weekly-top3-rank{
  flex: 0 0 auto;
  color: var(--cpsLbAccentAlt);
  font-size: 14px;
  font-weight: 900;
}

.cps-weekly-top3-player{
  min-width: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
}

.cps-weekly-top3-body{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.cps-weekly-top3-metric{
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.cps-weekly-top3-meta{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cps-weekly-top3-kills,
.cps-weekly-top3-deaths{
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--cpsLbLine);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--cpsLbMuted);
  font-size: 12px;
  font-weight: 700;
}

.cps-weekly-rest-items{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cps-weekly-rest-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-left: 4px solid var(--cpsLbAccentAlt);
  border-radius: 0 var(--cpsLbRadiusMd) var(--cpsLbRadiusMd) 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
  border-top: 1px solid var(--cpsLbLine);
  border-right: 1px solid var(--cpsLbLine);
  border-bottom: 1px solid var(--cpsLbLine);
}

.cps-weekly-rest-left,
.cps-weekly-rest-right{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cps-weekly-rest-rank{
  flex: 0 0 auto;
  color: var(--cpsLbMuted);
  font-size: 13px;
  font-weight: 800;
}

.cps-weekly-rest-player{
  min-width: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cps-weekly-rest-metric{
  color: var(--cpsLbAccentAlt);
  font-size: 15px;
  font-weight: 800;
}

.cps-weekly-rest-kills{
  color: var(--cpsLbMuted);
  font-size: 13px;
  font-weight: 700;
}

/* ==========================================================================
   Monthly
   ========================================================================== */

.cps-leaderboard-monthly-shell{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cps-monthly-top3-row{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cps-monthly-top3-box{
  padding: 20px 18px;
  border: 1px solid var(--cpsLbLine);
  border-radius: 22px;
  background:
    radial-gradient(circle at center top, rgba(245,158,11,0.14), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  text-align: center;
  box-shadow: var(--cpsLbShadow);
}

.cps-monthly-top3-box-rank{
  color: var(--cpsLbGold);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cps-monthly-top3-box-player{
  margin-top: 12px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
}

.cps-monthly-top3-box-metric{
  margin-top: 12px;
  color: var(--cpsLbGold);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.cps-monthly-rest-table{
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cpsLbLine);
  border-radius: var(--cpsLbRadiusLg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
}

.cps-monthly-rest-line{
  display: grid;
  grid-template-columns: 70px minmax(0, 1.4fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--cpsLbLine);
}

.cps-monthly-rest-line:first-child{
  border-top: 0;
}

.cps-monthly-rest-rank{
  color: var(--cpsLbMuted);
  font-size: 13px;
  font-weight: 800;
}

.cps-monthly-rest-player{
  min-width: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cps-monthly-rest-metric{
  color: var(--cpsLbGold);
  font-size: 15px;
  font-weight: 800;
}

.cps-monthly-rest-kills,
.cps-monthly-rest-deaths{
  color: var(--cpsLbMuted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

/* ==========================================================================
   Metric Variants
   ========================================================================== */

.cps-daily-top3-card-metric-kills .cps-daily-top3-metric,
.cps-weekly-top3-entry-metric-kills .cps-weekly-top3-metric,
.cps-monthly-top3-box-metric-kills .cps-monthly-top3-box-metric,
.cps-daily-rest-row-metric-kills .cps-daily-rest-metric,
.cps-weekly-rest-item-metric-kills .cps-weekly-rest-metric,
.cps-monthly-rest-line-metric-kills .cps-monthly-rest-metric{
  color: var(--cpsLbAccent);
}

.cps-daily-top3-card-metric-kd .cps-daily-top3-metric,
.cps-weekly-top3-entry-metric-kd .cps-weekly-top3-metric,
.cps-monthly-top3-box-metric-kd .cps-monthly-top3-box-metric,
.cps-daily-rest-row-metric-kd .cps-daily-rest-metric,
.cps-weekly-rest-item-metric-kd .cps-weekly-rest-metric,
.cps-monthly-rest-line-metric-kd .cps-monthly-rest-metric{
  color: #a78bfa;
}

.cps-daily-top3-card-metric-distance .cps-daily-top3-metric,
.cps-weekly-top3-entry-metric-distance .cps-weekly-top3-metric,
.cps-monthly-top3-box-metric-distance .cps-monthly-top3-box-metric,
.cps-daily-rest-row-metric-distance .cps-daily-rest-metric,
.cps-weekly-rest-item-metric-distance .cps-weekly-rest-metric,
.cps-monthly-rest-line-metric-distance .cps-monthly-rest-metric{
  color: var(--cpsLbAccentAlt);
}

/* ==========================================================================
   Podium rank accents
   ========================================================================== */

.cps-daily-top3-card:nth-child(1) .cps-daily-top3-rank,
.cps-monthly-top3-box:nth-child(1) .cps-monthly-top3-box-rank,
.cps-weekly-top3-entry:nth-child(1) .cps-weekly-top3-rank{
  color: var(--cpsLbGold);
}

.cps-daily-top3-card:nth-child(2) .cps-daily-top3-rank,
.cps-monthly-top3-box:nth-child(2) .cps-monthly-top3-box-rank,
.cps-weekly-top3-entry:nth-child(2) .cps-weekly-top3-rank{
  color: var(--cpsLbSilver);
}

.cps-daily-top3-card:nth-child(3) .cps-daily-top3-rank,
.cps-monthly-top3-box:nth-child(3) .cps-monthly-top3-box-rank,
.cps-weekly-top3-entry:nth-child(3) .cps-weekly-top3-rank{
  color: var(--cpsLbBronze);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px){
  .cps-daily-top3-grid,
  .cps-monthly-top3-row{
    grid-template-columns: 1fr;
  }

  .cps-leaderboard-weekly-shell{
    grid-template-columns: 1fr;
  }

  .cps-monthly-rest-line{
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
  }

  .cps-monthly-rest-deaths{
    grid-column: 2 / -1;
    text-align: left;
  }
}

@media (max-width: 640px){
  .cps-daily-top3-card,
  .cps-weekly-top3-entry,
  .cps-monthly-top3-box{
    min-height: auto;
  }

  .cps-daily-rest-row{
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cps-weekly-top3-body{
    flex-direction: column;
    align-items: flex-start;
  }

  .cps-weekly-top3-meta{
    justify-content: flex-start;
  }

  .cps-weekly-rest-item{
    flex-direction: column;
    align-items: flex-start;
  }

  .cps-weekly-rest-left,
  .cps-weekly-rest-right{
    width: 100%;
    justify-content: space-between;
  }

  .cps-monthly-rest-line{
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cps-monthly-rest-kills,
  .cps-monthly-rest-deaths{
    text-align: left;
  }

  .cps-daily-top3-player,
  .cps-monthly-top3-box-player{
    font-size: 17px;
  }

  .cps-daily-top3-metric,
  .cps-weekly-top3-metric,
  .cps-monthly-top3-box-metric{
    font-size: 24px;
  }
}