/* Experience: the band under the site header (learn/_xp_tracker.html) and
   the Hall of Adepts leaderboard (learn/leaderboard.html). Colours come
   from the site palette in catalog/css/style.css. */

/* ---------- shared bar ---------- */
.xp-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}
.xp-bar__fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--accent-hover));
  box-shadow: 0 0 10px rgba(227, 180, 102, 0.45);
}
[data-theme="light"] .xp-bar__fill { box-shadow: none; }

/* ---------- the band under the header ---------- */
.xp-band {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.xp-band__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.xp-sigil {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent);
  text-decoration: none;
}
.xp-sigil__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.xp-sigil__track { fill: var(--surface); stroke: var(--border); stroke-width: 3; }
.xp-sigil__fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.xp-sigil__level {
  position: relative;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.xp-band__who { display: flex; flex-direction: column; min-width: 0; flex: none; }
.xp-band__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.xp-band__title { font-family: var(--font-serif); font-size: 17px; color: var(--text); white-space: nowrap; }
.xp-band__meter { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.xp-band__numbers {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.xp-band__numbers strong { color: var(--text); font-weight: 600; }
.xp-band__hall {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-decoration: none;
  line-height: 1.3;
}
.xp-band__rank { font-family: var(--font-serif); font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.xp-band__hall-name { font-size: 12px; color: var(--accent); }
.xp-band__hall:hover .xp-band__hall-name { color: var(--accent-hover); text-decoration: underline; }
.xp-band__invite { margin: 0; font-size: 14px; color: var(--text-muted); flex: 1; }

@media (max-width: 720px) {
  .xp-band__inner { flex-wrap: wrap; padding: 10px 16px; gap: 10px 12px; }
  .xp-band__meter { order: 3; flex-basis: 100%; }
  .xp-band__hall { margin-left: auto; }
}

/* ---------- the Hall ---------- */
.hall-crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.hall-crumbs a { color: var(--accent); }
.hall-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.hall-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}
.hall-head__emblem { border-radius: 50%; border: 1px solid var(--border); }
.hall-head__title { font-family: var(--font-serif); font-size: 2.1rem; margin: 4px 0 8px; }
.hall-head__lede { margin: 0; color: var(--text-muted); max-width: 62ch; line-height: 1.6; }

.hall-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.hall-boards { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.hall-board {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
}
.hall-board:hover { color: var(--text); border-color: var(--accent); }
.hall-board.is-active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* podium: second, first, third */
.hall-podium {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.hall-podium__place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px 16px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.hall-podium__place--1 {
  order: 2;
  padding-top: 26px;
  padding-bottom: 24px;
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-soft), var(--surface));
  box-shadow: var(--shadow);
}
.hall-podium__place--2 { order: 1; }
.hall-podium__place--3 { order: 3; }
.hall-podium__place.is-me { outline: 2px solid var(--accent); outline-offset: 2px; }
.hall-podium__rank {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.hall-podium__place--1 .hall-podium__rank { font-size: 16px; color: var(--accent); }
.hall-podium__name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hall-podium__title { font-size: 12px; color: var(--text-muted); }
.hall-podium__value { font-family: var(--font-serif); font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }

.hall-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 700;
  border: 1px solid var(--border);
}
.hall-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hall-avatar--large { width: 56px; height: 56px; font-size: 22px; margin: 6px 0 4px; }
.hall-podium__place--1 .hall-avatar--large { width: 68px; height: 68px; border-color: var(--gold); }

.hall-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
}
.hall-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.hall-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hall-table tr:last-child td { border-bottom: 0; }
.hall-table__rank { width: 64px; font-family: var(--font-serif); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hall-table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hall-table th.hall-table__num { text-align: right; }
.hall-table tr.is-me td { background: var(--accent-soft); }
.hall-table tr.is-me .hall-table__rank { color: var(--accent); }
.hall-table__gap td { text-align: center; color: var(--text-muted); padding: 2px; }
.hall-adept { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hall-adept__text { display: flex; flex-direction: column; min-width: 0; }
.hall-adept__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hall-adept__title { font-size: 12px; color: var(--text-muted); }
.hall-you {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 6px;
  margin-left: 4px;
  vertical-align: 2px;
}
.hall-empty {
  padding: 36px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.hall-side { display: flex; flex-direction: column; gap: 16px; }
.hall-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.hall-card__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.hall-me__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hall-me__level {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
}
.hall-me__title { display: block; font-family: var(--font-serif); font-size: 19px; }
.hall-me__xp { display: block; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hall-me__note { font-size: 13px; color: var(--text-muted); margin: 10px 0 0; line-height: 1.5; }
.hall-me__note a { color: var(--accent); }
.hall-me__privacy { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hall-me__privacy .btn-link { font-size: 13px; }

.hall-grades { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.hall-grades li { display: flex; gap: 10px; padding: 4px 6px; border-radius: 6px; color: var(--text-muted); }
.hall-grades li.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.hall-grades__floor { width: 28px; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-serif); }

@media (max-width: 900px) {
  .hall-layout { grid-template-columns: minmax(0, 1fr); }
  .hall-side { order: -1; }
}
@media (max-width: 600px) {
  .hall-head { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
  .hall-head__emblem { width: 48px; height: 48px; }
  .hall-head__title { font-size: 1.6rem; }
  .hall-podium { gap: 6px; }
  .hall-podium__place { padding: 12px 6px; }
  .hall-podium__place--1 { padding-top: 18px; padding-bottom: 16px; }
  .hall-avatar--large { width: 40px; height: 40px; font-size: 17px; }
  .hall-podium__place--1 .hall-avatar--large { width: 48px; height: 48px; }
  .hall-podium__value { font-size: 15px; }
  .hall-podium__title { display: none; }
  .hall-table { font-size: 14px; }
  .hall-table th, .hall-table td { padding: 8px 10px; }
  .hall-table__rank { width: 40px; }
}
a.hall-coven { color: inherit; text-decoration: none; } a.hall-coven:hover .hall-adept__name { color: var(--accent); }
