/* ══════════════════════════════════════════════════════════════════════
   LuvMe — Leaderboard Screen
   ══════════════════════════════════════════════════════════════════════ */

#screenHiscore.active {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */

.hs-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 0 14px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hs-sidebar > .screen-topbar {
  margin: 0 -14px;
  width: calc(100% + 28px);
}

.hs-sb-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin: 12px 0 6px;
}

.hs-sb-header:first-child,
.hs-sidebar > .screen-topbar + .hs-sb-header { margin-top: 8px; }

/* User row */
.hs-user-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
}

.hs-user-row > .profile-banner {
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0.6), transparent 85%);
  mask-image: linear-gradient(to right, rgba(0,0,0,0.6), transparent 85%);
}

.hs-user-avatar {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.hs-user-info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.hs-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
}

.hs-user-alias {
  font-size: 11px;
  color: var(--muted);
}

.hs-user-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: 0.02em;
}
.hs-user-title svg { flex-shrink: 0 }

/* Participate toggle row */
.hs-participate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.hs-participate-label {
  font-size: 12px;
  color: var(--dim);
}

.hs-participate-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--cream);
  margin-left: auto;
}

.hs-info-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  margin-left: 6px;
  flex-shrink: 0;
}

.hs-info-btn:hover {
  color: var(--rose-l);
  background: var(--rose-bg);
}

/* Sidebar dividers */
.hs-sb-divider {
  height: 1px;
  background: var(--border2);
  margin: 14px 0;
}

/* View public profile */
.hs-view-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 0;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--ff-body);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.hs-view-profile-btn:hover {
  color: var(--rose);
  border-color: var(--rose-20);
  background: var(--rose-08, rgba(244, 63, 94, 0.06));
}
.hs-view-profile-btn svg { flex-shrink: 0 }

/* Earned titles */
.hs-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.hs-title-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--rose-bg);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--cream);
}

.hs-title-icon { font-size: 12px; }
.hs-title-text { flex: 1; }
.hs-title-rank-num { font-size: 11px; font-weight: 600; }

.hs-rank-1 { color: var(--gold); }
.hs-rank-2 { color: var(--silver); }
.hs-rank-3 { color: var(--bronze); }

/* Sidebar ranks list */
.hs-sb-ranks {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hs-sb-rank-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 2px;
  font-size: 12px;
  border-bottom: 1px solid var(--border2);
}

.hs-sb-rank-row.hs-sb-has-title {
  color: var(--cream);
  font-weight: 500;
}

.hs-sb-rank-pos {
  min-width: 30px;
  color: var(--rose-l);
  font-weight: 500;
}

.hs-sb-rank-label {
  flex: 1;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-sb-has-title .hs-sb-rank-label { color: var(--cream); }

.hs-sb-rank-score {
  color: var(--muted);
  font-size: 11px;
  min-width: 28px;
  text-align: right;
}

.hs-sb-trophy {
  font-size: 13px;
  margin-left: 2px;
}

/* ── Main Area ──────────────────────────────────────────────────────── */

.hs-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg2);
}

/* Topbar */
.hs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hs-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hs-title {
  font-family: var(--ff-display);
  font-size: 22px;
  color: var(--cream);
}

/* Season pill (used in screen-topbar right) */
.hs-season-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green-bg);
  color: var(--green);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  border: 1px solid var(--green-border);
}

.hs-season-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.hs-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hs-days-left {
  font-size: 12px;
  color: var(--muted);
}

/* Group tabs — text underline style */
.hs-group-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.hs-tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.hs-tab:hover { color: var(--dim); }

.hs-tab.active {
  color: var(--cream);
  border-bottom-color: var(--rose);
}

/* ── Cards Grid ─────────────────────────────────────────────────────── */

.hs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.hs-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.hs-card-featured {
  grid-column: 1 / -1;
}

.hs-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hs-card-title {
  font-family: var(--ff-display);
  font-size: 16px;
  color: var(--cream);
  font-weight: 500;
}

.hs-card-group {
  font-size: 11px;
  color: var(--muted);
}

.hs-card-empty {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
}

.hs-card-footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.hs-card-footer:hover { color: var(--rose-l); }

/* ── Podium (featured card) ─────────────────────────────────────────── */

.hs-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  padding: 8px 0 0;
}

.hs-pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hs-pod-1 { order: 2; }
.hs-pod-2 { order: 1; }
.hs-pod-3 { order: 3; }

.hs-pod-crown {
  font-size: 12px;
  font-weight: 600;
}

.hs-crown { letter-spacing: 1px; }
.hs-gold { color: var(--gold); }
.hs-silver { color: var(--silver); }
.hs-bronze { color: var(--bronze); }

.hs-pod-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-pod-name {
  font-size: 12px;
  color: var(--cream);
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.hs-pod.hs-me .hs-pod-name { color: var(--rose-l); }

.hs-pod-score {
  font-size: 11px;
  color: var(--muted);
}

/* Podium bars */
.hs-podium-bars {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.hs-bar {
  border-radius: 4px 4px 0 0;
}

.hs-bar-1 {
  width: 56px;
  height: 36px;
  background: linear-gradient(180deg, #ffd70030 0%, #ffd70010 100%);
  order: 2;
}

.hs-bar-2 {
  width: 48px;
  height: 24px;
  background: linear-gradient(180deg, #c0c0c020 0%, #c0c0c008 100%);
  order: 1;
  align-self: flex-end;
}

.hs-bar-3 {
  width: 48px;
  height: 16px;
  background: linear-gradient(180deg, #cd7f3220 0%, #cd7f3208 100%);
  order: 3;
  align-self: flex-end;
}

/* ── Entry rows ─────────────────────────────────────────────────────── */

.hs-entries {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hs-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.hs-entry.hs-me {
  background: var(--rose-bg);
  border: 1px solid var(--rose-15);
}

.hs-entry-rank {
  min-width: 20px;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}

.hs-entry-rank.hs-rank-1 { color: var(--gold); }
.hs-entry-rank.hs-rank-2 { color: var(--silver); }
.hs-entry-rank.hs-rank-3 { color: var(--bronze); }

.hs-entry-name {
  flex: 1;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hs-entry-frame {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.hs-entry-score {
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
}

.hs-entry.hs-me .hs-entry-name { color: var(--rose-l); font-weight: 500 }
.hs-entry.hs-me .hs-entry-score { color: var(--rose-l) }

/* Loading / error */
.hs-loading,
.hs-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: var(--muted);
  font-size: 14px;
}

.hs-error { color: var(--rose); }
.hs-grid-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }

/* Clickable alias names */
.hs-entry-alias { cursor: pointer; transition: color 0.15s; display: inline-flex; align-items: center; gap: 8px; }
.hs-entry-alias:hover { color: var(--rose-l); text-decoration: underline; }
