﻿/* ============================================================
   MM-Play Kahoot — leaderboard.css
   Dedicated leaderboard page styles
   ============================================================ */

/* ---------- background orbs ---------- */
.lb-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: -1;
  overflow: hidden;
}
.lb-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: .55;
  animation: floatOrb 9s ease-in-out infinite;
}
.lb-orb-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #c4b5fd 0%, #a78bfa 60%, transparent 100%);
  top: -160px; left: -120px;
  animation-duration: 10s;
}
.lb-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #fbc2eb 0%, #f7a8c4 60%, transparent 100%);
  top: -100px; right: -100px;
  animation-duration: 12s; animation-delay: -3s;
}
.lb-orb-3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #a7f3d0 0%, #7dd3c0 60%, transparent 100%);
  bottom: -80px; left: 50%;
  transform: translateX(-50%);
  animation-duration: 14s; animation-delay: -6s;
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-28px) scale(1.04); }
}
.lb-orb-3 {
  animation-name: floatOrb3;
}
@keyframes floatOrb3 {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50%       { transform: translateX(-50%) translateY(-22px) scale(1.03); }
}

/* ---------- topbar ---------- */
.lb-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  background: rgba(244, 241, 251, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.lb-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  font-weight: 700; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-soft); box-shadow: var(--shadow-sm);
  transition: color .18s, border-color .18s;
}
.lb-back:hover { color: var(--lavender-deep); border-color: var(--lavender); }
.lb-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 17px;
  flex: 1;
}
.lb-live {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--text-soft);
  margin-left: auto;
}
.lb-live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #4cb782;
  animation: pulseDot 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
.lb-live.offline .lb-live-dot {
  background: var(--muted);
  animation: none;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.75); }
}

/* ---------- main wrap ---------- */
.lb-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* ---------- empty state ---------- */
.lb-empty {
  text-align: center;
  padding: 80px 20px;
  animation: fadeIn .4s ease;
}
.lb-empty-icon {
  display: block;
  font-size: 80px;
  margin-bottom: 20px;
  animation: floatEmoji 3s ease-in-out infinite;
}
.lb-empty h2 {
  font-size: 22px; font-weight: 800;
  color: var(--text); margin-bottom: 10px;
}
.lb-empty p {
  color: var(--text-soft); font-size: 15px;
  max-width: 360px; margin: 0 auto; line-height: 1.6;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes floatEmoji {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ---------- game info bar ---------- */
.lb-game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.lb-quiz-badge {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px;
  color: var(--text);
}
.lb-status-badge {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 30px;
  font-size: 12.5px; font-weight: 700;
  letter-spacing: .3px;
}
.lb-status-badge.status-lobby {
  background: rgba(167, 139, 250, .15);
  color: var(--lavender-deep);
  border: 1px solid rgba(167, 139, 250, .3);
}
.lb-status-badge.status-playing {
  background: rgba(76, 183, 130, .15);
  color: #2d9e6b;
  border: 1px solid rgba(76, 183, 130, .3);
}
.lb-status-badge.status-reveal {
  background: rgba(240, 180, 41, .15);
  color: #c08900;
  border: 1px solid rgba(240, 180, 41, .3);
}
.lb-status-badge.status-finished {
  background: rgba(139, 92, 246, .12);
  color: #6d28d9;
  border: 1px solid rgba(139, 92, 246, .3);
}

/* ---------- podium ---------- */
.lb-podium-wrap {
  margin: 0 0 32px;
}
.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  min-height: 280px;
}
.lb-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: slideUpPodium .55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.lb-step-1 { animation-delay: 0s; }
.lb-step-2 { animation-delay: .1s; }
.lb-step-3 { animation-delay: .2s; }
@keyframes slideUpPodium {
  from { opacity: 0; transform: translateY(40px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
.lb-step-crown {
  font-size: 28px;
  margin-bottom: 6px;
  animation: bounceCrown 2s ease-in-out infinite;
}
@keyframes bounceCrown {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.lb-step-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 3px var(--lavender), var(--shadow);
  overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: #fff;
  margin-bottom: 8px;
}
.lb-step-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.lb-step-name {
  font-weight: 800; font-size: 14px;
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  margin-bottom: 4px;
}
.lb-step-score {
  font-weight: 900; font-size: 18px;
  background: linear-gradient(135deg, var(--lavender) 0%, var(--lavender-deep) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.lb-step-block {
  border-radius: 16px 16px 0 0;
  display: flex; align-items: center; justify-content: center;
}
.lb-block-1 {
  width: 130px; height: 160px;
  background: linear-gradient(160deg, #ffe566 0%, #ffd700 40%, #f59e0b 100%);
  color: #fff;
  box-shadow: 0 8px 28px rgba(245, 158, 11, .45);
}
.lb-block-2 {
  width: 110px; height: 120px;
  background: linear-gradient(160deg, #f3f4f6 0%, #e5e7eb 40%, #9ca3af 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(156, 163, 175, .4);
}
.lb-block-3 {
  width: 100px; height: 90px;
  background: linear-gradient(160deg, #fde68a 0%, #fbbf24 40%, #d97706 100%);
  color: #fff;
  box-shadow: 0 5px 16px rgba(217, 119, 6, .4);
}
.lb-step-block span {
  font-size: 40px;
  font-weight: 900;
  opacity: .85;
}

/* ---------- full list ---------- */
.lb-list-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lb-list-header {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  font-weight: 800; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.lb-list {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow-y: auto;
}
.lb-list::-webkit-scrollbar { width: 5px; }
.lb-list::-webkit-scrollbar-track { background: transparent; }
.lb-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ---------- list rows ---------- */
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .15s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--surface-2); }
.lb-row.lb-me {
  background: linear-gradient(90deg, rgba(167,139,250,.1) 0%, rgba(167,139,250,.04) 100%);
  border-left: 3px solid var(--lavender-deep);
}
.lb-row .rk {
  width: 32px;
  font-weight: 800;
  text-align: center;
  font-size: 15px;
  color: var(--text-soft);
  flex-shrink: 0;
}
.lb-row .rk-top {
  font-size: 20px;
  line-height: 1;
}
.lb-row .av {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.lb-row .av img {
  width: 100%; height: 100%; object-fit: cover;
}
.lb-row .nm {
  flex: 1;
  font-weight: 700; font-size: 15px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-row .sc {
  font-weight: 900; font-size: 16px;
  background: linear-gradient(135deg, var(--lavender) 0%, var(--lavender-deep) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}
.lb-row .delta {
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.lb-row .delta.up   { color: #4cb782; }
.lb-row .delta.down { color: #e8685a; }


/* ---------- tabs ---------- */
.lb-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.lb-tab {
  flex: 1;
  padding: 10px 20px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .2s;
}
.lb-tab:hover {
  border-color: var(--lavender);
  color: var(--lavender-deep);
}
.lb-tab.active {
  border-color: var(--lavender-deep);
  background: linear-gradient(135deg, var(--lavender) 0%, var(--lavender-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(167, 139, 250, .3);
}

/* ---------- season section ---------- */
.lb-season-wrap {
  animation: fadeIn .4s ease;
}
.lb-season-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.lb-season-select {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s;
}
.lb-season-select:hover {
  border-color: var(--lavender);
}
.lb-season-select:focus {
  outline: none;
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, .1);
}

@media (max-width: 600px) {
  .lb-tabs { gap: 6px; padding: 12px 16px 0; }
  .lb-tab { padding: 8px 12px; font-size: 13px; }
  .lb-season-header { flex-direction: column; align-items: flex-start; }
}
/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .lb-wrap { padding: 20px 14px 60px; }

  .lb-topbar { padding: 12px 16px; gap: 10px; }
  .lb-brand { font-size: 15px; }

  .lb-podium { gap: 6px; min-height: 220px; }

  .lb-step-avatar { width: 50px; height: 50px; font-size: 17px; }
  .lb-step-name { font-size: 12px; max-width: 80px; }
  .lb-step-score { font-size: 14px; }
  .lb-step-crown { font-size: 20px; }

  .lb-block-1 { width: 100px; height: 130px; }
  .lb-block-2 { width: 86px; height: 98px; }
  .lb-block-3 { width: 78px; height: 74px; }
  .lb-step-block span { font-size: 30px; }

  .lb-quiz-badge { font-size: 15px; }
  .lb-game-info { flex-direction: column; align-items: flex-start; }
}