/* ===== Learnixs XP CSS ===== */
:root {
  --accent: #8b5cf6;
  --accent-light: #c4b5fd;
  --bg1: #100030;
  --bg2: #2b1e75;
  --glass: rgba(255, 255, 255, 0.08);
  --text-bright: #fff;
  --text-muted: #b5aaff;
  --gold: #ffd700;
}

/* ===== Background Animation ===== */
.stars, .twinkling {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}

.stars {
  background: url("https://www.transparenttextures.com/patterns/stardust.png");
  animation: moveStars 200s linear infinite;
  opacity: 0.25;
}

.twinkling {
  background: url("https://www.transparenttextures.com/patterns/dark-mosaic.png");
  animation: twinkle 8s ease-in-out infinite alternate;
  opacity: 0.15;
}

@keyframes moveStars {
  from {background-position: 0 0;}
  to {background-position: -10000px 5000px;}
}
@keyframes twinkle {
  0% {opacity: 0.15;}
  100% {opacity: 0.3;}
}

/* ===== Body ===== */
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: radial-gradient(circle at center, var(--bg2), var(--bg1));
  color: var(--text-bright);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

/* ===== Top Bar ===== */
.top-bar {
  position: absolute;
  top: 20px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  z-index: 10;
}

.back-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.3s;
}
.back-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* ===== Rank Orb ===== */
.rank-orb {
  background: radial-gradient(circle at 30% 30%, #ffdf70, #c69700);
  color: #000;
  font-size: 38px;
  font-weight: 900;
  border-radius: 50%;
  width: 85px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.6);
  cursor: pointer;
  animation: float 3s ease-in-out infinite;
  transition: 0.3s;
}
.rank-orb:hover {
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.9);
  transform: scale(1.1);
}
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

/* ===== XP Card ===== */
.xp-card {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  padding: 50px 45px;
  text-align: center;
  backdrop-filter: blur(25px);
  box-shadow: 0 0 40px rgba(140, 92, 255, 0.4);
  z-index: 5;
  width: 90%;
  max-width: 420px;
  transition: 0.3s ease;
}
.xp-card:hover {
  transform: scale(1.03);
}

/* ===== XP Circle ===== */
.circle-container {
  position: relative;
  display: inline-block;
}
canvas {
  display: block;
  width: 260px;
  height: 260px;
}
.xp-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.xp-value h2 {
  font-size: 46px;
  margin: 0;
  color: var(--accent-light);
  text-shadow: 0 0 20px var(--accent-light);
}
.xp-value span {
  font-size: 18px;
  color: var(--text-muted);
}

/* ===== Info ===== */
.class-board {
  margin-top: 25px;
  color: var(--text-muted);
}
.timer {
  margin-top: 10px;
  color: #9de0ff;
  font-size: 15px;
}
.locked {
  margin-top: 15px;
  color: #ff6b6b;
  font-weight: bold;
  text-shadow: 0 0 10px #ff6b6b;
}

/* ===== Popup ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
  z-index: 1000;
}
.popup {
  background: #241c68;
  padding: 25px;
  border-radius: 18px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.12);
}
.popup h2 {
  color: var(--gold);
}
.popup ul {
  text-align: left;
  font-size: 15px;
  line-height: 1.8;
}
.popup button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 15px;
  transition: 0.3s;
}
.popup button:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .rank-orb {
    width: 70px;
    height: 70px;
    font-size: 30px;
  }
  canvas {
    width: 180px;
    height: 180px;
  }
  .xp-card {
    padding: 30px 25px;
  }
}


/* xp.css */

/* Reset & base */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background-color: #f8f9fa;
  color: #333;
}

.wrap {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Header */
header h1 {
  font-size: 2rem;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

header .meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 15px;
}

header .controls {
  margin-bottom: 20px;
}

header .btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #eee;
  margin-right: 10px;
  transition: background-color 0.2s;
}

header .btn:hover {
  background-color: #ddd;
}

header .btn.primary {
  background-color: #6c63ff;
  color: #fff;
}

header .btn.primary:hover {
  background-color: #5848c2;
}

/* Panel */
.panel {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  overflow: hidden;
}

/* Leaderboard items */
.list .item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f1f1;
  transition: background-color 0.2s;
}

.list .item:hover {
  background-color: #f9f9f9;
}

.item .place {
  font-weight: bold;
  font-size: 1.1rem;
  width: 50px;
}

.item .name {
  flex: 1;
  padding-left: 10px;
}

.item .name div:first-child {
  font-weight: 600;
}

.item .name div:last-child {
  font-size: 0.85rem;
  color: #777;
}

.item .xp-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 100px;
}

.item .xp {
  font-weight: 600;
}

.level-badge {
  background: linear-gradient(135deg, #f6d365, #fda085);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  margin-top: 4px;
}

/* Empty state */
.list .empty {
  padding: 20px;
  text-align: center;
  color: #999;
}

/* Pagination */
.pager {
  display: flex;
  justify-content: center;
  padding: 12px;
  gap: 5px;
}

.pager .btn {
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Optional: different colors for top 3 ranks */
.list .item:nth-child(1) .place {
  color: gold;
}
.list .item:nth-child(2) .place {
  color: silver;
}
.list .item:nth-child(3) .place {
  color: #cd7f32; /* Bronze */
}

/* Responsive */
@media (max-width: 600px) {
  .item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .xp-container {
    align-items: flex-start;
  }
  header h1 {
    font-size: 1.5rem;
  }
}
