/* Papan skor live. Dipakai bersama style.css. */

.lb {
  position: relative; overflow: hidden;
  background: #fffdf8;
  border: 1px solid var(--line); border-radius: 20px;
  padding: 24px 20px 20px;
  color: var(--ink);
}
/* Sinar lembut dari atas, seperti sorotan panggung. */
.lb::before {
  content: ""; position: absolute; left: 50%; top: -30%;
  width: 150%; height: 70%; transform: translateX(-50%);
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(239, 194, 107, 0.13) 0 7deg, transparent 7deg 16deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
  pointer-events: none;
}
.lb > * { position: relative; }

.lb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lb-eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-deep); }
.lb-title { margin: 4px 0 2px; font-size: 22px; color: var(--navy); line-height: 1.2; }
.lb-sub2 { margin: 0; font-size: 13px; color: var(--muted); }

.lb-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--ok);
  background: var(--ok-tint); padding: 6px 11px; border-radius: 999px;
}
.lb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: ping 1.6s infinite; }
.lb[data-status="offline"] .lb-live { color: var(--bad); background: var(--bad-tint); }
.lb[data-status="offline"] .lb-dot { background: var(--bad); animation: none; }
.lb[data-status="loading"] .lb-live { color: var(--muted); background: var(--sky-tint); }
.lb[data-status="loading"] .lb-dot { background: var(--muted); animation: none; }

.lb-empty { text-align: center; color: var(--muted); padding: 40px 12px; margin: 0; }

/* Podium */
.lb-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-top: 20px; }
.lb-slot { flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; }
.lb.intro .lb-slot { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.lb-who { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 12px; text-align: center; min-width: 0; max-width: 100%; }
.lb-avatar {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: var(--navy-deep);
  box-shadow: inset 0 0 0 3px #fff, 0 8px 18px rgba(21, 20, 58, 0.12);
  margin-bottom: 6px;
}
.lb-avatar.sm { width: 44px; height: 44px; border-radius: 14px; font-size: 15px; box-shadow: inset 0 0 0 2px #fff; margin-bottom: 0; }
.lb-name { font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pts { font-size: 14px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.lb-block {
  width: 100%; border-radius: 16px 16px 0 0;
  display: flex; justify-content: center; align-items: flex-start; padding-top: 16px;
  color: #fff; font-size: 56px; font-weight: 800; line-height: 1;
  text-shadow: 0 2px 0 rgba(21, 20, 58, 0.12);
}
.rank-1 .lb-block { height: 200px; background: linear-gradient(180deg, #f5c84e 0%, #efc26b 55%, #f7e0a0 100%); }
.rank-2 .lb-block { height: 150px; background: linear-gradient(180deg, #8fa9ea 0%, #b8caf2 55%, #e6edfd 100%); }
.rank-3 .lb-block { height: 115px; background: linear-gradient(180deg, #f08c6c 0%, #f4a58a 55%, #fbd9cb 100%); }
.rank-1 .lb-block { color: #fff; }

.lb-slot.bump .lb-block { animation: pulse 0.9s ease; }
@keyframes pulse { 0% { filter: brightness(1); } 40% { filter: brightness(1.12); } 100% { filter: brightness(1); } }

/* Daftar peringkat */
.lb-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; min-width: 0;
}
.lb-rank { width: 24px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.lb-meta { flex: 1; min-width: 0; }
.lb-row .lb-name { max-width: none; text-align: left; font-size: 15px; }
.lb-sub { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.lb-best { color: var(--gold-deep); font-weight: 600; }
.lb-score { font-weight: 800; font-size: 18px; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.lb-row.bump { animation: rowbump 0.9s ease; }
@keyframes rowbump { 0% { background: #fff1cf; transform: scale(1.015); } 100% { background: #fff; transform: none; } }

/* Api streak */
.flame {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  padding: 2px 9px 2px 3px; border-radius: 999px; background: #fff0e3;
}
.flame svg { width: 20px; height: 24px; transform-origin: 50% 100%; animation: flicker 1.3s ease-in-out infinite; }
.flame-body { fill: #ff8a1f; }
.flame-core { fill: #ffd35a; }
.flame-eye { fill: #3a1a05; }
.flame-mouth { stroke: #3a1a05; stroke-width: 1.6; stroke-linecap: round; }
.flame-count { font-weight: 800; font-size: 14px; color: #b4480f; font-variant-numeric: tabular-nums; }
.flame.lvl-2 { background: #ffe3d6; }
.flame.lvl-2 .flame-body { fill: #ff5a1f; }
.flame.lvl-3 { background: #ffd9d3; }
.flame.lvl-3 .flame-body { fill: #e8332a; }
.flame.lvl-3 svg { animation-duration: 0.7s; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(-3deg); }
  50% { transform: scale(1.06, 0.95) rotate(3deg); }
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(23, 121, 74, 0.45); }
  100% { box-shadow: 0 0 0 9px rgba(23, 121, 74, 0); }
}

/* Mode layar penuh untuk di-share */
.stage { background: var(--paper); }
.stage-wrap { max-width: 980px; margin: 0 auto; padding: 24px 20px 40px; }
.stage-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.stage-brand img { height: 40px; width: auto; }
.stage .lb { padding: 36px 32px 28px; }
.stage .lb-title { font-size: 40px; }
.stage .lb-sub2 { font-size: 16px; }
.stage .lb-avatar { width: 96px; height: 96px; font-size: 30px; border-radius: 24px; }
.stage .lb-name { font-size: 22px; max-width: 220px; }
.stage .lb-pts { font-size: 17px; }
.stage .lb-block { font-size: 84px; }
.stage .rank-1 .lb-block { height: 300px; }
.stage .rank-2 .lb-block { height: 220px; }
.stage .rank-3 .lb-block { height: 170px; }
.stage .lb-row { padding: 16px 20px; }
.stage .lb-row .lb-name { font-size: 19px; }
.stage .lb-avatar.sm { width: 56px; height: 56px; font-size: 19px; }
.stage .lb-score { font-size: 26px; }
.stage .lb-rank { font-size: 18px; width: 32px; }
.stage .flame-count { font-size: 18px; }
.stage .flame svg { width: 28px; height: 34px; }

/* Responsif */
@media (max-width: 520px) {
  .lb { padding: 20px 12px 14px; }
  .lb-block { font-size: 40px; }
  .rank-1 .lb-block { height: 150px; }
  .rank-2 .lb-block { height: 115px; }
  .rank-3 .lb-block { height: 90px; }
  .lb-avatar { width: 54px; height: 54px; font-size: 17px; }
  .lb-name { max-width: 100px; }
  .lb-row { padding: 10px; gap: 10px; }
  .lb-row .lb-name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
