/* ════════════════════════════════════════════════════════
   USER PROFILE BAR
════════════════════════════════════════════════════════ */
.home-profile-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(14, 30, 24, 0.85);
  border: 1px solid rgba(78, 205, 196, 0.25);
  border-radius: 50px;
  padding: 8px 18px 8px 10px;
  margin-top: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, transform 0.2s;
}
.home-profile-bar:hover {
  border-color: rgba(78, 205, 196, 0.5);
  transform: translateY(-1px);
}
.home-profile-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
}
.home-profile-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--teal);
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}
.home-profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.home-profile-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
}
.home-profile-sub {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.home-profile-lvl {
  color: var(--gold);
  font-weight: 700;
}
.home-profile-xp {
  color: var(--teal);
  font-weight: 700;
}
.home-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.btn-profile-edit {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #d0e8dc;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-profile-edit:hover {
  background: rgba(78, 205, 196, 0.2);
  border-color: var(--teal);
  color: #fff;
  transform: scale(1.04);
}
/* ════════════════════════════════════════════════════════
   PROFILE MODAL
════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 9, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}
.modal-card {
  background: linear-gradient(145deg, #10241c 0%, #0a1813 100%);
  border: 1px solid rgba(78, 205, 196, 0.35);
  border-radius: 24px;
  padding: 26px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(78, 205, 196, 0.15);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideUp 0.25s ease-out;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--gold);
}
.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: color 0.2s;
}
.btn-modal-close:hover {
  color: #fff;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #b0c8be;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(6, 16, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 12px rgba(78, 205, 196, 0.3);
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 4px 6px 2px;
}
.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 10px 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.avatar-option img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.avatar-option span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.avatar-role {
  font-size: 0.62rem;
  color: var(--teal);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  margin-top: -3px;
}
.avatar-option:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}
.avatar-option.active {
  border-color: var(--gold);
  background: rgba(247, 147, 30, 0.12);
}
.avatar-option.active img {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(247, 147, 30, 0.5);
}
.avatar-option.active span {
  color: var(--gold);
}
.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 6px;
}
.modal-footer button {
  min-width: 110px;
}

/* ════════════════════════════════════════════════════════
   HIMALAYAN LEADERBOARD
════════════════════════════════════════════════════════ */
.home-leaderboard-section {
  width: 100%;
  max-width: 760px;
  margin: 28px auto 20px;
  background: linear-gradient(180deg, rgba(14, 30, 24, 0.95) 0%, rgba(8, 18, 14, 0.98) 100%);
  border: 1px solid rgba(247, 147, 30, 0.3);
  border-radius: 24px;
  padding: 22px 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(247, 147, 30, 0.1);
  box-sizing: border-box;
  transition: border-color 0.4s, box-shadow 0.4s;
}
.leaderboard-highlight {
  animation: leaderboardGlow 2.5s ease-out;
}
@keyframes leaderboardGlow {
  0% {
    box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(247, 201, 72, 0.7);
    border-color: var(--gold);
  }
  60% {
    box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(247, 201, 72, 0.4);
    border-color: var(--gold);
  }
  100% {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(247, 147, 30, 0.1);
    border-color: rgba(247, 147, 30, 0.3);
  }
}
.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}
.leaderboard-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.leaderboard-badge-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 8px rgba(247, 147, 30, 0.5));
}
.leaderboard-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--gold);
  letter-spacing: 0.5px;
  margin: 0;
}
.leaderboard-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.btn-icon-small {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.btn-icon-small:hover {
  background: rgba(78, 205, 196, 0.2);
  border-color: var(--teal);
  transform: rotate(45deg);
}

/* Podium — narrowed & flexible to fit all screens */
.leaderboard-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 22px;
  padding: 8px 0;
  width: 100%;
  box-sizing: border-box;
}
.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 110px;
}
.podium-crown {
  font-size: 1.3rem;
  position: absolute;
  top: -22px;
  animation: floatBounce 2s ease-in-out infinite;
}
.podium-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  margin-bottom: 5px;
  flex-shrink: 0;
}
.podium-first .podium-avatar-wrap {
  width: 66px;
  height: 66px;
}
.podium-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid rgba(255, 255, 255, 0.3);
}
.podium-first img {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}
.podium-second img {
  border-color: #c0c0c0;
  box-shadow: 0 0 12px rgba(192, 192, 192, 0.5);
}
.podium-third img {
  border-color: #cd7f32;
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.5);
}
.podium-rank-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.1rem;
}
.podium-name {
  font-weight: 800;
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 2px;
  text-align: center;
  width: 100%;
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-xp {
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--teal);
  margin-bottom: 5px;
  white-space: nowrap;
}
.podium-pillar {
  width: 100%;
  max-width: 102px;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
  padding: 0 4px;
  box-sizing: border-box;
}
.pillar-1 {
  height: 84px;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.35) 0%, rgba(184, 134, 11, 0.25) 100%);
  border-top: 3px solid #ffd700;
}
.pillar-2 {
  height: 64px;
  background: linear-gradient(180deg, rgba(192, 192, 192, 0.3) 0%, rgba(128, 128, 128, 0.2) 100%);
  border-top: 3px solid #c0c0c0;
}
.pillar-3 {
  height: 48px;
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.3) 0%, rgba(139, 69, 19, 0.2) 100%);
  border-top: 3px solid #cd7f32;
}
.podium-current .podium-name {
  color: var(--gold);
}
.you-tag {
  font-size: 0.65rem;
  background: var(--teal);
  color: #04120c;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 900;
  margin-left: 4px;
}

/* Table */
.leaderboard-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.leaderboard-table th {
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.leaderboard-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.leaderboard-row {
  transition: background 0.15s;
}
.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.lb-rank {
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  width: 45px;
}
.lb-user-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.lb-name-info {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lb-name {
  font-weight: 700;
  color: #fff;
}
.lb-level {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
}
.lb-xp strong {
  color: var(--teal);
  font-size: 1rem;
}
.lb-accuracy {
  color: #b0c8be;
}
.lb-streak {
  color: #ff9f43;
  font-weight: 700;
}

/* HIGHLIGHTED CURRENT USER ROW */
.leaderboard-row-current {
  background: linear-gradient(90deg, rgba(78, 205, 196, 0.18) 0%, rgba(247, 147, 30, 0.15) 100%) !important;
  border-left: 4px solid var(--gold) !important;
  border-right: 4px solid var(--teal) !important;
  box-shadow: 0 0 16px rgba(78, 205, 196, 0.25);
  position: relative;
}
.leaderboard-row-current td {
  color: #fff !important;
}
.leaderboard-row-current .lb-name {
  color: #fff;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.leaderboard-row-current .lb-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(247, 147, 30, 0.6);
}
.lb-badge-you {
  font-size: 0.65rem;
  background: linear-gradient(135deg, var(--gold) 0%, #ff6b6b 100%);
  color: #000;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(247, 147, 30, 0.6);
  letter-spacing: 0.5px;
}

/* Sticky card for current user outside top 10 */
.leaderboard-current-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, rgba(78, 205, 196, 0.2) 0%, rgba(247, 147, 30, 0.2) 100%);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.lb-sticky-rank {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold);
  min-width: 40px;
}
.lb-sticky-info {
  flex: 1;
  text-align: left;
}
.lb-sticky-name {
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lb-sticky-details {
  font-size: 0.78rem;
  color: #b0c8be;
}
.lb-sticky-xp {
  font-size: 0.95rem;
  color: var(--teal);
}


