/* ================= BODY & LAYOUT ================= */
body {
  font-family: Times New Roman, sans-serif;
  display: flex;
  justify-content: center;   /* center horizontally */
  align-items: flex-start;   /* align from top */
  min-height: 100vh;
  background-color: #f4f2ef;
  padding: 20px;
  background: #f3f4f6;
}
  .main-wrapper {
  display: flex;
  justify-content: flex-start;  /* top-align content */
  flex-direction: column;      /* stack content vertically */
  align-items: center;          /* center horizontally */
  gap: 20px;
  padding: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  transition: margin-left 0.3s ease; /* smooth shift */
}


/* ============ LEADERBOARD ================= */
.leaderboard-container {
  position: static; /* removed absolute positioning */
  max-height: 80vh;
  overflow-y: auto;
  background-color: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  width: 250px;            /* fixed width so names don’t get cut off */

}

.leaderboard-container h3 {
  text-align: center;
  margin-bottom: 12px;
  font-size: 18px;
}


.leaderboard-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: #f5f5f5;
  font-weight: normal;
  overflow: hidden; /* prevent overflow */
}

.leaderboard-row:nth-child(odd) {
  background-color: #e9ecef;
}

.leaderboard-row.current-user {
  background-color: #d0e7ff;
  font-weight: bold;
  color: #007bff;
  animation: highlightRow 0.5s ease-in-out;
}

@keyframes highlightRow {
  0% { background-color: #d0e7ff; }
  50% { background-color: #a0d4ff; }
  100% { background-color: #d0e7ff; }
}

.rank {
  width: 30px;
  text-align: right;
  flex-shrink: 0; /* keep rank small and fixed */
}

.username {
  flex-grow: 1;         /* take remaining space */
  padding-left: 10px;
  overflow: hidden;     /* hide overflow */
  text-overflow: ellipsis; /* show ... if too long */
  white-space: nowrap;  /* keep on one line */
}

.points {
  width: 70px;          /* fixed width for points */
  text-align: right;
  flex-shrink: 0;       /* don’t shrink */
}

.leaderboard-full-container {
  width: 90%;             /* lets it shrink on small screens */
  max-width: 500px;       /* keeps it reasonable on large screens */
  margin: 0 auto;         /* center horizontally */
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);

  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* top-align content */
  box-sizing: border-box;       /* include padding in width */
}
.leaderboard-full-container h2 {
 text-align: center;
}

.back-btn {
  display: block;
  margin: 20px auto 0;
  text-align: center;
  padding: 10px 16px;
  background-color: #2b6ea3;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  width: 200px;
}

.rank-icon {
  font-size: 20px;
}

.you-badge {
  background: #3b82f6;
  color: white;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.7em;
  margin-left: 6px;
}
