/* ===== Enpulse Christmas Leaderboard Theme (FULL) ===== */

.ecl-wrap{
  --evergreen:#176B3A;
  --holly:#C1121F;
  --gold:#F2C14E;
  --cream:#FFF9EF;
  --ink:#15201A;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* =========================================================
   Hero / Header
   ========================================================= */

.ecl-hero{
  background:
    radial-gradient(900px circle at 0% 0%, rgba(193,18,31,.18), transparent 55%),
    radial-gradient(900px circle at 100% 0%, rgba(23,107,58,.20), transparent 55%),
    linear-gradient(180deg, #1C7A44 0%, #0F4D2A 100%);
  color: var(--cream);
  padding:18px 20px;
  border-radius:18px;
  box-shadow: 0 10px 30px rgba(10,30,18,.18);
  margin-bottom:14px;
}

.ecl-hero h2{
  margin:0 0 6px;
  font-size: clamp(20px,2.7vw,28px);
}

.ecl-hero p{
  margin:0;
  opacity:.95;
}

/* =========================================================
   Progress Meter in Hero
   ========================================================= */

.ecl-progress{
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255,249,239,.08);
  border:1px solid rgba(255,249,239,.18);
  border-radius: 14px;
  display:grid;
  gap:8px;
}

.ecl-progress-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.ecl-progress-title{
  font-weight:900;
  letter-spacing:.3px;
  font-size:14px;
}
.ecl-progress-count{
  font-weight:900;
  font-size:14px;
  opacity:.95;
}

.ecl-progress-bar{
  height:10px;
  background: rgba(0,0,0,.18);
  border-radius: 999px;
  overflow:hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}

.ecl-progress-fill{
  height:100%;
  background:
    linear-gradient(90deg, rgba(242,193,78,.9), rgba(193,18,31,.9));
  border-radius:999px;
  transition: width .35s ease;
}

.ecl-progress-sub{
  font-size:13px;
  font-weight:800;
  opacity:.95;
}
.ecl-progress-sub strong{
  color: #FFE29A;
}

/* =========================================================
   Table / Rows
   ========================================================= */

.ecl-table{
  background: rgba(255,255,255,.9);
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.06);
}

.ecl-row{
  display:grid;
  grid-template-columns: 56px 1fr 110px 90px;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-bottom:1px dashed rgba(0,0,0,.07);
  background: #fff;
}

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

.ecl-head{
  background: #fff;
  font-weight:900;
  color:var(--ink);
}

/* Rank cell */
.ecl-rank{
  font-weight:900;
  display:flex;
  gap:6px;
  align-items:center;
}

/* User cell */
.ecl-user{
  display:flex;
  align-items:center;
  gap:10px;
}

.ecl-avatar{
  width:34px;height:34px;
  border-radius:999px;
  display:grid;place-items:center;
  background: linear-gradient(180deg, var(--holly) 0%, #8E0E18 100%);
  color:#fff;
  font-weight:900;
  font-size:12px;
  flex: 0 0 auto;
}

.ecl-name{
  font-weight:800;
  color:var(--ink);
}

.ecl-points{
  font-weight:900;
  color:var(--evergreen);
}

.ecl-streak{
  font-weight:800;
  color:#B45A00;
}

/* =========================================================
   FUN HIGHLIGHTS: top 3 podium
   ========================================================= */

.ecl-row.podium{
  position: relative;
  font-weight: 900;
  border-bottom: 0;
  margin: 6px 8px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
}

.ecl-row.podium-1{
  background:
    radial-gradient(600px circle at 0% 0%, rgba(242,193,78,.45), transparent 55%),
    linear-gradient(180deg, #fff7d1 0%, #ffe7a1 100%);
  border: 1px solid rgba(242,193,78,.9);
  transform: translateY(-1px);
}

.ecl-row.podium-2{
  background:
    radial-gradient(600px circle at 0% 0%, rgba(200,200,200,.5), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
  border: 1px solid rgba(0,0,0,.08);
}

.ecl-row.podium-3{
  background:
    radial-gradient(600px circle at 0% 0%, rgba(179,113,65,.45), transparent 55%),
    linear-gradient(180deg, #fff0e6 0%, #ffd7bf 100%);
  border: 1px solid rgba(179,113,65,.6);
}

.ecl-medal{
  font-size: 20px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.15));
}

/* little sparkle on #1 */
.ecl-row.podium-1::after{
  content: "✨";
  position:absolute;
  right:10px;
  top:8px;
  font-size:16px;
  opacity:.9;
}

/* subtle podium animation */
@keyframes ecl-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.10); }
  50%      { box-shadow: 0 10px 30px rgba(242,193,78,.22); }
}
@keyframes ecl-sparkle-float {
  0%   { transform: translateY(0) rotate(0deg);   opacity: .6; }
  50%  { transform: translateY(-6px) rotate(8deg); opacity: .9; }
  100% { transform: translateY(0) rotate(0deg);   opacity: .6; }
}

.ecl-row.podium{
  animation: ecl-glow 2.8s ease-in-out infinite;
}

.ecl-row.podium::before{
  content: "✨";
  position: absolute;
  left: -6px;
  top: 10px;
  font-size: 14px;
  opacity: .7;
  animation: ecl-sparkle-float 2.4s ease-in-out infinite;
  pointer-events: none;
}

.ecl-row.podium-1{ animation-duration: 2.6s; }
.ecl-row.podium-1::before{ animation-duration: 2.1s; font-size: 15px; }

.ecl-row.podium-2{ animation-duration: 3.1s; }
.ecl-row.podium-2::before{ animation-duration: 2.7s; font-size: 13px; }

.ecl-row.podium-3{ animation-duration: 3.4s; }
.ecl-row.podium-3::before{ animation-duration: 3.0s; font-size: 12px; }

@media (prefers-reduced-motion: reduce){
  .ecl-row.podium,
  .ecl-row.podium::before{
    animation: none !important;
  }
}

/* =========================================================
   Highlight the viewer ("is-me")
   ========================================================= */

.ecl-row.is-me{
  background:
    linear-gradient(90deg, rgba(23,107,58,.12), transparent 60%),
    rgba(242,193,78,.18);
  border-left: 4px solid var(--evergreen);
  font-weight: 900;
}

.ecl-row.is-me .ecl-avatar{
  box-shadow: 0 0 0 3px rgba(23,107,58,.18);
  transform: scale(1.04);
}

.ecl-row.is-me .ecl-name::after{
  content: " (du)";
  font-weight: 800;
  opacity: .75;
}

.ecl-row.podium.is-me{
  outline: 3px solid rgba(23,107,58,.45);
  outline-offset: 2px;
}

/* =========================================================
   Advent doors
   ========================================================= */

.ecl-door{
  width:100%;
  border:0;
  background:
    linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
  border-radius:14px;
  padding:14px 16px;
  cursor:pointer;
  display:grid;
  gap:2px;
  text-align:left;
  box-shadow:0 6px 16px rgba(0,0,0,.08);
  border:1px solid rgba(0,0,0,.05);
  transition: transform .12s ease, box-shadow .12s ease;
}

.ecl-door:hover{
  transform: translateY(-1px);
  box-shadow:0 10px 22px rgba(0,0,0,.12);
}

.ecl-door.is-claimed{
  opacity:.6;
  cursor:default;
  background: repeating-linear-gradient(45deg,#f2f2f2 0 8px,#fafafa 8px 16px);
}

.ecl-door-number{
  font-weight:900;
  color:var(--ink);
  font-size:16px;
}

.ecl-door-sub{
  font-size:13px;
  opacity:.9;
  color:#223226;
}

.ecl-door-error{
  padding:10px 12px;
  border-radius:10px;
  background:#fff3f3;
  border:1px solid rgba(193,18,31,.25);
  color:#7a151d;
  font-weight:800;
}

/* =========================================================
   Optional award button
   ========================================================= */

.ecl-award-btn{
  appearance:none;
  border:0;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.5px;
  padding:10px 14px;
  border-radius:999px;
  background: linear-gradient(180deg, #FFE29A 0%, var(--gold) 100%);
  color:var(--ink);
  box-shadow:0 8px 22px rgba(0,0,0,.14);
  transition: transform .12s ease, box-shadow .12s ease;
}

.ecl-award-btn:hover{
  transform: translateY(-1px);
  box-shadow:0 12px 26px rgba(0,0,0,.18);
}

.ecl-award-btn:active{
  transform: translateY(1px) scale(.98);
}

/* =========================================================
   Micro-dopamine Christmas Toast
   ========================================================= */

.ecl-toast-wrap{
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 99999;
  pointer-events: none;
}

.ecl-toast{
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;

  background:
    radial-gradient(420px circle at 0% 0%, rgba(242,193,78,.35), transparent 60%),
    radial-gradient(420px circle at 100% 0%, rgba(193,18,31,.20), transparent 60%),
    linear-gradient(180deg, #1C7A44 0%, #0F4D2A 100%);
  color: #FFF9EF;

  border: 1px solid rgba(255,249,239,.25);
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(0,0,0,.30);

  padding: 12px 14px 12px 14px;
  display: grid;
  gap: 6px;

  transform: translateY(12px) scale(.96);
  opacity: 0;
  animation: ecl-toast-in .28s cubic-bezier(.12,.8,.12,1) forwards;
  position: relative;
  overflow: hidden;
}

.ecl-toast.is-leave{
  animation: ecl-toast-out .28s ease forwards;
}

@keyframes ecl-toast-in{
  to{ opacity:1; transform: translateY(0) scale(1); }
}
@keyframes ecl-toast-out{
  to{ opacity:0; transform: translateY(10px) scale(.98); }
}

/* subtle shimmer */
.ecl-toast::after{
  content:"";
  position:absolute;
  inset:-40% -60%;
  background:
    linear-gradient(115deg, transparent 35%, rgba(255,255,255,.12) 50%, transparent 65%);
  transform: translateX(-60%);
  animation: ecl-shimmer 1.6s ease-in-out infinite;
  pointer-events:none;
}

@keyframes ecl-shimmer{
  0%   { transform: translateX(-60%); opacity:.0; }
  30%  { opacity:.8; }
  100% { transform: translateX(60%); opacity:0; }
}

.ecl-toast-title{
  font-weight: 900;
  letter-spacing: .3px;
  font-size: 15px;
  display:flex;
  align-items:center;
  gap:8px;
}

.ecl-toast-points{
  font-weight: 950;
  font-size: 22px;
  letter-spacing:.2px;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
  animation: ecl-pop .45s ease;
}

@keyframes ecl-pop{
  0% { transform: scale(.92); }
  60%{ transform: scale(1.06); }
  100%{ transform: scale(1); }
}

.ecl-toast-sub{
  font-size: 13px;
  opacity: .95;
  line-height: 1.4;
}

.ecl-toast-streak{
  font-size: 13px;
  font-weight: 800;
  opacity: .98;
  display:flex;
  align-items:center;
  gap:6px;
}

.ecl-toast-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(242,193,78,.16);
  border:1px solid rgba(255,249,239,.22);
  width:max-content;
}

.ecl-toast-close{
  position:absolute;
  top:8px;
  right:10px;
  border:0;
  background:transparent;
  color:#FFF9EF;
  font-size:16px;
  cursor:pointer;
  opacity:.8;
}
.ecl-toast-close:hover{ opacity:1; }

.ecl-toast.milestone{
  box-shadow: 0 18px 60px rgba(242,193,78,.35);
  border-color: rgba(242,193,78,.9);
}

@media (prefers-reduced-motion: reduce){
  .ecl-toast,
  .ecl-toast.is-leave,
  .ecl-toast::after,
  .ecl-toast-points{
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

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

@media (max-width: 640px){
  .ecl-row{
    grid-template-columns: 48px 1fr 86px 70px;
    padding: 9px 12px;
  }
  .ecl-medal{ font-size:18px; }
}
