/* Pavithra: Team-based tactical leaderboard. No color-mix() for browser compat. */

@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=JetBrains+Mono:wght@400;500;700;800&family=VT323&family=Orbitron:wght@500;700;900&display=swap');

/* ─── MODAL ─── */
body #dataAlertBox {
  display: none;
  width: 94%; max-width: 1320px;
  background:
    radial-gradient(circle at 20% 0%, rgba(0,255,122,0.04), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(0,212,255,0.03), transparent 50%),
    #050608;
  padding: 0; border-radius: 0;
  border: 1px solid rgba(0,255,122,0.35);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 30px 80px -20px rgba(0,255,122,0.25), inset 0 0 80px rgba(0,0,0,0.6);
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  max-height: 90vh; overflow: hidden; z-index: 9999;
  font-family: 'JetBrains Mono', 'Consolas', monospace; color: #a8c9b4;
}
body #dataAlertBox::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,255,122,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(0,255,122,0.02) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none; z-index: 0;
}

body #dataAlertBox .dataAlertCloseBtn {
  position: relative; display: block; text-align: right; cursor: pointer;
  font-family: 'Black Ops One', sans-serif; font-size: 14px; letter-spacing: 0.18em;
  color: #ff3a4a; background: rgba(11,12,16,0.95); border: 0;
  border-bottom: 1px solid rgba(255,58,74,0.4); padding: 14px 24px; z-index: 50;
  text-shadow: 0 0 8px rgba(255,58,74,0.5); transition: background 0.2s, color 0.2s;
}
body #dataAlertBox .dataAlertCloseBtn:hover { background: #ff3a4a; color: #050608; text-shadow: none; }

#dataAlertContent {
  position: relative; z-index: 10; padding: 20px 26px 30px;
  max-height: calc(90vh - 52px); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #00ff7a #0B0C10;
}
#dataAlertContent::-webkit-scrollbar { width: 8px; }
#dataAlertContent::-webkit-scrollbar-track { background: #0B0C10; }
#dataAlertContent::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #00ff7a, #1f6b3a); }

/* ═══ HEADER ═══ */
.ls-main-header { margin-bottom: 24px; }
.ls-hdr-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 22px;
  background: repeating-linear-gradient(135deg, rgba(255,170,0,0.05) 0px, rgba(255,170,0,0.05) 12px, transparent 12px, transparent 24px), #0F1418;
  border: 1px solid rgba(255,170,0,0.45);
  font-family: 'Black Ops One', sans-serif; letter-spacing: 0.15em; color: #ffaa00;
  text-shadow: 0 0 8px rgba(255,170,0,0.4);
}
.ls-hdr-crest { font-size: 20px; white-space: nowrap; }
.ls-hdr-title { font-size: 14px; text-align: center; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-hdr-stamp {
  white-space: nowrap; font-family: 'VT323', monospace; font-size: 17px;
  color: #ff3a4a; border: 1.5px solid #ff3a4a; padding: 4px 12px;
  transform: rotate(-2deg); text-shadow: 0 0 6px rgba(255,58,74,0.5);
}

.ls-hdr-stats {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px; font-family: 'VT323', monospace; color: #5b766a;
  letter-spacing: 0.15em; font-size: 15px;
  border-bottom: 1px dashed rgba(0,255,122,0.18);
}
.ls-hdr-stat { display: flex; align-items: center; gap: 8px; }
.ls-hdr-num { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 26px; color: #00ff7a; text-shadow: 0 0 12px rgba(0,255,122,0.5); }
.ls-hdr-lbl { font-size: 13px; letter-spacing: 0.2em; }
.ls-hdr-live { color: #00ff7a; }
.ls-live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #00ff7a; box-shadow: 0 0 10px #00ff7a; animation: lsBlink 1.4s steps(1) infinite; margin-right: 6px; }
@keyframes lsBlink { 0%,49%{opacity:1} 50%,100%{opacity:0.2} }

/* ═══ TEAM SECTION ═══ */
.ls-team {
  --tc: #00ff7a; --tg: rgba(0,255,122,0.45); --ts: rgba(0,255,122,0.12); --tb: rgba(0,255,122,0.35);
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0a0c10, #0f1218);
  border: 2px solid var(--tb);
  margin-bottom: 24px;
  opacity: 0; transform: translateY(24px);
  animation: lsTeamRise 0.6s cubic-bezier(0.16,1,0.3,1) forwards;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ls-team:nth-child(2) { animation-delay: 0.12s; }
.ls-team:nth-child(3) { animation-delay: 0.24s; }
.ls-team:nth-child(4) { animation-delay: 0.36s; }
.ls-team:nth-child(5) { animation-delay: 0.48s; }
.ls-team:nth-child(6) { animation-delay: 0.60s; }
@keyframes lsTeamRise { to { opacity: 1; transform: translateY(0); } }

.ls-team:hover { border-color: var(--tc); box-shadow: 0 0 45px -10px var(--tg), inset 0 0 30px rgba(0,0,0,0.3); }

/* Team corners */
.ls-team-corners > i { position: absolute; width: 16px; height: 16px; border: 2px solid var(--tc); opacity: 0.8; }
.ls-team-corners > i:nth-child(1) { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ls-team-corners > i:nth-child(2) { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.ls-team-corners > i:nth-child(3) { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.ls-team-corners > i:nth-child(4) { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* Podium teams */
.ls-tp-1 { border-color: rgba(255,215,0,0.55) !important; background: linear-gradient(135deg, #161208, #1a1a0f, #0f1218) !important; box-shadow: 0 0 40px -8px rgba(255,215,0,0.25), inset 0 0 50px rgba(255,215,0,0.03) !important; }
.ls-tp-2 { border-color: rgba(192,192,192,0.5) !important; background: linear-gradient(135deg, #101214, #181a1e, #0f1218) !important; box-shadow: 0 0 30px -8px rgba(192,192,192,0.2) !important; }
.ls-tp-3 { border-color: rgba(205,127,50,0.5) !important; background: linear-gradient(135deg, #14100c, #1a160f, #0f1218) !important; box-shadow: 0 0 30px -8px rgba(205,127,50,0.2) !important; }

/* ─── Team BG commando image - uses background-image on a div */
.ls-team-bg {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 45%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right bottom;
  opacity: 0.35;
  pointer-events: none; z-index: 1;
  transition: all 0.5s cubic-bezier(0.16,1,0.3,1);
  filter: brightness(1.3);
}
.ls-team:hover .ls-team-bg { opacity: 0.6; transform: scale(1.05) translateX(-8px); }

/* ─── Team Header ─── */
.ls-team-hdr {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  border-bottom: 2px solid var(--ts);
  position: relative; z-index: 5;
  background: linear-gradient(90deg, rgba(0,0,0,0.3), transparent 60%);
}
.ls-team-rank-box {
  min-width: 70px; text-align: center;
  padding: 6px 10px;
  border: 1px solid var(--tb);
  background: rgba(0,0,0,0.4);
}
.ls-team-rank-num {
  font-family: 'Black Ops One', sans-serif; font-size: 18px;
  color: var(--tc); text-shadow: 0 0 14px var(--tg);
  letter-spacing: 0.05em;
}
.ls-tp-1 .ls-team-rank-num { color: #ffd700; text-shadow: 0 0 18px rgba(255,215,0,0.6); font-size: 20px; }
.ls-tp-2 .ls-team-rank-num { color: #c0c0c0; text-shadow: 0 0 14px rgba(192,192,192,0.5); }
.ls-tp-3 .ls-team-rank-num { color: #cd7f32; text-shadow: 0 0 14px rgba(205,127,50,0.5); }

.ls-team-icon {
  font-size: 32px; line-height: 1;
  filter: drop-shadow(0 0 10px var(--tg));
}

.ls-team-info { flex: 1; min-width: 0; }
.ls-team-name {
  font-family: 'Black Ops One', sans-serif; font-size: 24px;
  letter-spacing: 0.1em; color: var(--tc);
  text-shadow: 0 0 16px var(--tg);
  text-transform: uppercase;
}
.ls-team-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  letter-spacing: 0.08em; color: #6b8a7e; margin-top: 4px;
}

.ls-team-score-box {
  text-align: center; padding: 10px 22px;
  background: rgba(0,0,0,0.5); border: 2px solid var(--tb);
  min-width: 130px;
}
.ls-tsb-value {
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 32px;
  color: var(--tc); text-shadow: 0 0 20px var(--tg); line-height: 1.1;
}
.ls-tsb-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; color: #5b766a; }

/* ═══ MEMBER CARDS ═══ */
.ls-team-members { padding: 14px 18px 18px; position: relative; z-index: 5; }

.ls-member {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px;
  background: rgba(5,8,12,0.6);
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 10px;
  transition: all 0.3s ease; position: relative; overflow: hidden; cursor: pointer;
}
.ls-member:last-child { margin-bottom: 0; }
.ls-member:hover {
  background: rgba(8,14,20,0.9); border-color: var(--tc);
  box-shadow: 0 0 25px -6px var(--tg); transform: translateX(6px);
}
.ls-member::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--tc); opacity: 0; transition: opacity 0.3s;
}
.ls-member:hover::before { opacity: 1; }

.ls-mem-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.ls-mem-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }

.ls-mem-rank {
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 22px;
  color: var(--tc); min-width: 32px; text-align: center;
  text-shadow: 0 0 10px var(--tg);
}

.ls-mem-avatar {
  width: 48px; height: 48px; flex-shrink: 0; position: relative;
  border: 2px solid var(--tc);
  clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
  box-shadow: 0 0 14px var(--tg);
}
.ls-mem-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ls-mem-info { min-width: 0; flex: 1; }
.ls-mem-name {
  font-family: 'Black Ops One', sans-serif; font-size: 17px;
  color: #e8f4ee; text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ls-mem-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; flex-wrap: wrap; }
.ls-mem-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.12em;
  border: 1px solid; padding: 2px 10px; text-transform: uppercase;
}
.ls-mem-tier {
  font-family: 'VT323', monospace; font-size: 14px; color: #6b8a7e; letter-spacing: 0.08em;
}

/* Badges */
.ls-badge {
  font-family: 'Black Ops One', sans-serif; font-size: 9px;
  letter-spacing: 0.12em; padding: 2px 10px; text-transform: uppercase;
}
.ls-badge.ls-mvp {
  background: linear-gradient(135deg, #ffd700, #ff8c00); color: #050608;
  box-shadow: 0 0 12px rgba(255,215,0,0.5); animation: lsMvpPulse 2s ease infinite;
}
@keyframes lsMvpPulse { 0%,100%{box-shadow:0 0 12px rgba(255,215,0,0.4)} 50%{box-shadow:0 0 24px rgba(255,215,0,0.7)} }
.ls-badge.ls-top { background: rgba(0,212,255,0.15); color: #00d4ff; border: 1px solid rgba(0,212,255,0.4); }
.ls-badge.ls-active { background: rgba(0,255,122,0.1); color: #00ff7a; border: 1px solid rgba(0,255,122,0.3); }

/* ─── Stats Bars ─── */
.ls-mem-stats { display: flex; flex-direction: column; gap: 5px; min-width: 220px; }
.ls-stat-row { display: grid; grid-template-columns: 20px 36px 1fr 50px 32px; align-items: center; gap: 5px; }
.ls-stat-icon { font-size: 12px; text-align: center; opacity: 0.7; }
.ls-stat-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.08em; font-weight: 700; color: #5b766a; }
.ls-bar-track { height: 8px; background: #1a2228; border: 1px solid #2a3540; overflow: hidden; }
.ls-bar-fill { height: 100%; transition: width 1s cubic-bezier(0.16,1,0.3,1); }
.ls-bar-fill.bar-read { background: repeating-linear-gradient(90deg, #00ff7a 0, #00ff7a 5px, rgba(5,6,8,0.5) 5px, rgba(5,6,8,0.5) 7px); box-shadow: 0 0 8px rgba(0,255,122,0.5); }
.ls-bar-fill.bar-code { background: repeating-linear-gradient(90deg, #ffaa00 0, #ffaa00 5px, rgba(5,6,8,0.5) 5px, rgba(5,6,8,0.5) 7px); box-shadow: 0 0 8px rgba(255,170,0,0.5); }
.ls-bar-fill.bar-quiz { background: repeating-linear-gradient(90deg, #00d4ff 0, #00d4ff 5px, rgba(5,6,8,0.5) 5px, rgba(5,6,8,0.5) 7px); box-shadow: 0 0 8px rgba(0,212,255,0.5); }
.ls-stat-val { font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 700; color: #d8ffe7; text-align: right; }
.ls-stat-pct { font-family: 'VT323', monospace; font-size: 12px; color: #5b766a; text-align: right; }

/* ─── XP Column ─── */
.ls-mem-score-col {
  text-align: center; padding: 8px 16px;
  background: rgba(0,0,0,0.4); border: 2px solid var(--ts);
  min-width: 80px;
}
.ls-mem-xp { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 24px; color: var(--tc); text-shadow: 0 0 14px var(--tg); line-height: 1; }
.ls-mem-xp-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; color: #5b766a; }
.ls-mem-contrib { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 14px; color: var(--tc); margin-top: 4px; opacity: 0.8; }
.ls-mem-contrib-label { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.15em; color: #5b766a; }

/* ─── Empty ─── */
.ls-empty { text-align: center; padding: 60px 20px; font-family: 'VT323', monospace; font-size: 24px; color: #5b766a; letter-spacing: 0.15em; }

/* ═══ LOADER ═══ */
#liveScoreLoader {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 100001;
  background: radial-gradient(circle at 50% 0%, rgba(0,255,122,0.12), transparent 60%), rgba(5,8,6,0.96);
  padding: 40px 56px 34px; text-align: center; color: #00ff7a;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(0,255,122,0.5);
  box-shadow: 0 0 50px rgba(0,255,122,0.3), inset 0 0 20px rgba(0,255,122,0.06);
  min-width: 300px;
}
#liveScoreLoader::before, #liveScoreLoader::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid #00ff7a; filter: drop-shadow(0 0 4px rgba(0,255,122,0.5));
}
#liveScoreLoader::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
#liveScoreLoader::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.ls-bars { display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: 52px; margin-bottom: 20px; }
.ls-bars .ls-bar { width: 9px; animation: ls-barPulse 1.2s ease-in-out infinite; }
.ls-bars .ls-bar:nth-child(1) { background: #ff3a4a; animation-delay: 0s; box-shadow: 0 0 8px rgba(255,58,74,0.6); }
.ls-bars .ls-bar:nth-child(2) { background: #00d4ff; animation-delay: 0.15s; box-shadow: 0 0 8px rgba(0,212,255,0.6); }
.ls-bars .ls-bar:nth-child(3) { background: #00ff7a; animation-delay: 0.3s; box-shadow: 0 0 8px rgba(0,255,122,0.6); }
.ls-bars .ls-bar:nth-child(4) { background: #ffaa00; animation-delay: 0.45s; box-shadow: 0 0 8px rgba(255,170,0,0.6); }
.ls-bars .ls-bar:nth-child(5) { background: #c97dff; animation-delay: 0.6s; box-shadow: 0 0 8px rgba(201,125,255,0.6); }
@keyframes ls-barPulse { 0%,100%{height:12px;opacity:0.4} 50%{height:48px;opacity:1} }
.ls-text { font-family: 'Black Ops One', sans-serif; font-size: 14px; letter-spacing: 0.3em; text-transform: uppercase; color: #00ff7a; text-shadow: 0 0 10px rgba(0,255,122,0.55); }
.ls-text::after { content: ''; animation: ls-dots 1.5s steps(3) infinite; }
@keyframes ls-dots { 0%{content:''} 33%{content:'.'} 66%{content:'..'} 100%{content:'...'} }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .ls-member { flex-direction: column; align-items: flex-start; }
  .ls-mem-right { width: 100%; }
  .ls-mem-stats { min-width: 0; flex: 1; width: 100%; }
  .ls-team-hdr { flex-wrap: wrap; }
  .ls-team-score-box { width: 100%; margin-top: 10px; }
  .ls-hdr-top { flex-direction: column; gap: 8px; text-align: center; }
  .ls-hdr-stats { flex-direction: column; gap: 8px; align-items: center; }
  .ls-team-name { font-size: 20px; }
}
@media (max-width: 600px) {
  #dataAlertContent { padding: 12px 14px 20px; }
  .ls-stat-row { grid-template-columns: 36px 1fr 50px; }
  .ls-stat-icon { display: none; }
  .ls-stat-pct { display: none; }
  .ls-team-hdr { gap: 10px; padding: 14px; }
  .ls-team-rank-box { min-width: 50px; }
  .ls-team-name { font-size: 16px; }
}
