/* ============================================================
   LIVE SCORE ARENA - Cerdas Cermat BRI
   Realtime Dynamic Leaderboard with FLIP Animations & Rank Delta UX
   ============================================================ */

:root {
  --ls-bg-dark: #071326;
  --ls-bg-gradient: radial-gradient(circle at 50% 0%, #0d2b5c 0%, #06152b 50%, #030a16 100%);
  --ls-card-bg: rgba(13, 27, 49, 0.75);
  --ls-card-border: rgba(0, 114, 206, 0.25);
  --ls-card-hover: rgba(0, 114, 206, 0.15);
  --ls-gold: #FFC107;
  --ls-silver: #E2E8F0;
  --ls-bronze: #CD7F32;
  --ls-up: #10B981;
  --ls-down: #EF4444;
  --ls-neutral: #64748B;
  --ls-blue: #0072CE;
  --ls-accent: #00D4FF;
}

/* Page Wrapper */
.live-score-arena {
  min-height: 100vh;
  background: var(--ls-bg-gradient);
  color: #FFFFFF;
  position: relative;
  overflow-x: hidden;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  padding-bottom: 60px;
}

/* Background Atmosphere Glows */
.live-score-arena::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(0, 114, 206, 0.35) 0%, rgba(0, 61, 122, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Top Live Header */
.ls-broadcast-bar {
  background: rgba(6, 17, 34, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.ls-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FF5C5C;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}

.ls-live-dot {
  width: 9px;
  height: 9px;
  background: #EF4444;
  border-radius: 50%;
  box-shadow: 0 0 10px #EF4444;
  animation: lsPulseLive 1.4s infinite;
}

@keyframes lsPulseLive {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.ls-sync-status {
  font-size: 0.82rem;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ls-sync-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
  transition: all 0.3s ease;
}

.ls-sync-indicator.syncing {
  background: #F59E0B;
  box-shadow: 0 0 10px #F59E0B;
  animation: lsRotateSync 0.8s infinite linear;
}

@keyframes lsRotateSync {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.ls-control-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.ls-control-btn:hover {
  background: rgba(0, 114, 206, 0.25);
  border-color: rgba(0, 180, 255, 0.5);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.ls-control-btn.active {
  background: rgba(0, 114, 206, 0.35);
  border-color: #00A9E0;
  color: #00D4FF;
}

/* Event Title Banner */
.ls-hero {
  padding: 30px 15px 20px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.ls-event-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 114, 206, 0.18);
  border: 1px solid rgba(0, 170, 255, 0.35);
  color: #60A5FA;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.ls-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 30%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.ls-hero-sub {
  color: #94A3B8;
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Mode Switcher (Tim vs Peserta) */
.ls-tabs-wrap {
  display: flex;
  justify-content: center;
  margin: 22px 0 35px;
}

.ls-tabs {
  background: rgba(10, 25, 48, 0.9);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  gap: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.ls-tab-item {
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #94A3B8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ls-tab-item:hover {
  color: #FFFFFF;
}

.ls-tab-item.active {
  background: linear-gradient(135deg, #0072CE 0%, #00509E 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 114, 206, 0.45);
}

/* ============================================================
   PODIUM SECTION (TOP 3 CHAMPIONS)
   ============================================================ */
.ls-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto 40px;
  padding: 0 16px;
  position: relative;
  z-index: 2;
}

.ls-podium-card {
  flex: 1;
  max-width: 260px;
  background: rgba(13, 29, 56, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 16px 20px;
  text-align: center;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
  overflow: visible;
}

.ls-podium-card:hover {
  transform: translateY(-6px);
}

/* Rank 1 (Champion) */
.ls-podium-card.first {
  order: 2;
  border: 1px solid rgba(255, 193, 7, 0.55);
  background: linear-gradient(180deg, rgba(30, 48, 80, 0.85) 0%, rgba(13, 29, 56, 0.95) 100%);
  box-shadow: 0 0 35px rgba(255, 193, 7, 0.2), 0 15px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(-16px);
}

.ls-podium-card.first:hover {
  transform: translateY(-22px);
  box-shadow: 0 0 45px rgba(255, 193, 7, 0.35), 0 20px 35px rgba(0, 0, 0, 0.5);
}

/* Rank 2 (Silver) */
.ls-podium-card.second {
  order: 1;
  border: 1px solid rgba(226, 232, 240, 0.35);
  box-shadow: 0 0 20px rgba(226, 232, 240, 0.12), 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Rank 3 (Bronze) */
.ls-podium-card.third {
  order: 3;
  border: 1px solid rgba(205, 127, 50, 0.4);
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.12), 0 10px 25px rgba(0, 0, 0, 0.3);
}

.ls-crown-icon {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: #FFC107;
  filter: drop-shadow(0 0 12px rgba(255, 193, 7, 0.8));
  animation: lsCrownFloat 2.6s ease-in-out infinite alternate;
}

@keyframes lsCrownFloat {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-6px); }
}

.ls-podium-avatar-wrap {
  width: 76px;
  height: 76px;
  margin: 0 auto 12px;
  border-radius: 50%;
  padding: 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ls-podium-card.first .ls-podium-avatar-wrap {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #FFE259 0%, #FFA751 100%);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

.ls-podium-card.second .ls-podium-avatar-wrap {
  background: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%);
  box-shadow: 0 0 15px rgba(226, 232, 240, 0.35);
}

.ls-podium-card.third .ls-podium-avatar-wrap {
  background: linear-gradient(135deg, #E6A15C 0%, #8D5B29 100%);
  box-shadow: 0 0 15px rgba(205, 127, 50, 0.35);
}

.ls-podium-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #0B192E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFFFFF;
}

.ls-podium-rank-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0F172A;
  border: 2px solid #0B192E;
}

.ls-podium-card.first .ls-podium-rank-badge { background: #FFC107; }
.ls-podium-card.second .ls-podium-rank-badge { background: #E2E8F0; }
.ls-podium-card.third .ls-podium-rank-badge { background: #CD7F32; color: #FFFFFF; }

.ls-podium-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #FFFFFF;
}

.ls-podium-sub {
  font-size: 0.78rem;
  color: #94A3B8;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-podium-score {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #00D4FF;
  line-height: 1.1;
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.ls-podium-card.first .ls-podium-score {
  color: #FFD54F;
  text-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
  font-size: 2.15rem;
}

.ls-podium-score-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  font-weight: 700;
  margin-top: 2px;
}

/* ============================================================
   LEADERBOARD LIST SECTION (FLIP REORDERING & RANK DELTA)
   ============================================================ */
.ls-board-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 2;
}

.ls-board-card {
  background: rgba(10, 23, 44, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  border: 1px solid rgba(0, 114, 206, 0.25);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.ls-board-header {
  padding: 16px 24px;
  background: rgba(6, 16, 32, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ls-board-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #FFFFFF;
}

.ls-board-count {
  font-size: 0.8rem;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Row List */
.ls-list {
  list-style: none;
  padding: 10px;
  margin: 0;
  position: relative;
}

/* Single Item Row */
.ls-item {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(16, 34, 62, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.4s ease,
              border-color 0.4s ease,
              box-shadow 0.4s ease;
  position: relative;
  will-change: transform;
}

.ls-item:hover {
  background: rgba(22, 48, 88, 0.8);
  border-color: rgba(0, 114, 206, 0.4);
}

/* Rank Glow Animations */
.ls-item.rank-up-glow {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
}

.ls-item.rank-down-glow {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.ls-item.score-glow {
  animation: lsScoreBump 0.8s ease;
}

@keyframes lsScoreBump {
  0% { transform: scale(1); }
  30% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Rank Column */
.ls-rank-col {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 90px;
  flex-shrink: 0;
}

.ls-rank-num {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

/* Top 3 rank pill designs */
.ls-item.top-1 .ls-rank-num {
  background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
  color: #0F172A;
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.5);
  border: none;
}

.ls-item.top-2 .ls-rank-num {
  background: linear-gradient(135deg, #F1F5F9 0%, #94A3B8 100%);
  color: #0F172A;
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.4);
  border: none;
}

.ls-item.top-3 .ls-rank-num {
  background: linear-gradient(135deg, #E6A15C 0%, #A05A1C 100%);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.4);
  border: none;
}

/* Delta Indicators (Naik / Turun) */
.ls-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.ls-delta.up {
  color: #10B981;
  background: rgba(16, 185, 129, 0.14);
  animation: lsDeltaJump 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ls-delta.down {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.14);
  animation: lsDeltaDrop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ls-delta.same {
  color: #64748B;
  background: rgba(255, 255, 255, 0.04);
}

@keyframes lsDeltaJump {
  0% { transform: translateY(4px); opacity: 0; }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes lsDeltaDrop {
  0% { transform: translateY(-4px); opacity: 0; }
  50% { transform: translateY(3px); }
  100% { transform: translateY(0); opacity: 1; }
}

/* Entity Identity (Logo & Name) */
.ls-entity-col {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  padding: 0 12px;
}

.ls-entity-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: #0B192E;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #FFFFFF;
}

.ls-entity-info {
  min-width: 0;
}

.ls-entity-name {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ls-entity-sub {
  font-size: 0.8rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score Column */
.ls-score-col {
  text-align: right;
  flex-shrink: 0;
  padding-left: 16px;
  position: relative;
}

.ls-score-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #00D4FF;
  letter-spacing: -0.01em;
  line-height: 1.1;
  transition: all 0.3s ease;
}

.ls-score-progress-wrap {
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-top: 5px;
  overflow: hidden;
  margin-left: auto;
}

.ls-score-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0072CE, #00D4FF);
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* Floating Score Pop (+10 etc) */
.ls-floating-score {
  position: absolute;
  top: -12px;
  right: 0;
  background: #10B981;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.5);
  pointer-events: none;
  animation: lsFloatUp 1.2s forwards cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes lsFloatUp {
  0% { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-24px) scale(1.1); opacity: 0; }
}

/* Empty State */
.ls-empty {
  padding: 60px 20px;
  text-align: center;
  color: #64748B;
}

.ls-empty i {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

/* Fullscreen Mode Additions */
:fullscreen .live-score-arena,
:-webkit-full-screen .live-score-arena {
  padding-top: 10px;
  overflow-y: auto;
}

:fullscreen .ls-board-container,
:-webkit-full-screen .ls-board-container {
  max-width: 1200px;
}

:fullscreen .ls-item,
:-webkit-full-screen .ls-item {
  padding: 18px 24px;
}

:fullscreen .ls-score-val,
:-webkit-full-screen .ls-score-val {
  font-size: 1.75rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .ls-hero-title {
    font-size: 1.6rem;
  }
  .ls-podium {
    gap: 8px;
    padding: 0 8px;
  }
  .ls-podium-card {
    padding: 16px 8px 14px;
  }
  .ls-podium-avatar-wrap {
    width: 58px;
    height: 58px;
  }
  .ls-podium-card.first .ls-podium-avatar-wrap {
    width: 68px;
    height: 68px;
  }
  .ls-podium-score {
    font-size: 1.35rem;
  }
  .ls-podium-card.first .ls-podium-score {
    font-size: 1.6rem;
  }
  .ls-rank-col {
    width: 68px;
    gap: 6px;
  }
  .ls-rank-num {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  .ls-score-val {
    font-size: 1.2rem;
  }
  .ls-score-progress-wrap {
    width: 65px;
  }
  .ls-broadcast-bar {
    padding: 10px 14px;
  }
}
