@import url('theme.css');

.podium-card--1 .podium-card__trophy { color: var(--gold); }
.podium-card--2 .podium-card__trophy { color: var(--silver); }
.podium-card--3 .podium-card__trophy { color: var(--bronze); }
.rank-row[hidden],
.panel__empty[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

p {
  font-weight: 400;
}

h1, h2, h3 {
  font-family: var(--font-bold);
  font-weight: 700;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black, transparent);
}

.bg-glow {
  position: fixed;
  width: min(520px, 55vw);
  height: min(520px, 55vw);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.35;
}

.bg-glow--left {
  top: -120px;
  left: -80px;
  background: var(--brand-glow);
}

.bg-glow--right {
  top: 40%;
  right: -120px;
  background: rgba(232, 197, 71, 0.08);
}

/* Top bar */
.topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto;
  gap: 1rem 2rem;
  align-items: center;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 12, 16, 0.92);
  backdrop-filter: blur(8px);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-link img {
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--brand), 0 4px 20px rgba(0, 0, 0, 0.35);
}

.topbar__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.topbar__title {
  margin: 0.15rem 0 0;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.4vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.topbar__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
}

.board-nav {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
}

.board-nav__link {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.board-nav__link:hover {
  color: var(--text);
}

.board-nav__link--active {
  background: var(--brand-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(175, 39, 47, 0.35);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  animation: live-pill-pulse 2.2s ease-in-out infinite;
}

.live-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  animation: live-dot-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pill-pulse {
  0%, 100% {
    border-color: var(--line);
    box-shadow: none;
  }
  50% {
    border-color: rgba(175, 39, 47, 0.4);
    box-shadow: 0 0 0 4px rgba(175, 39, 47, 0.1);
  }
}

@keyframes live-dot-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(175, 39, 47, 0.45);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.8);
    box-shadow: 0 0 0 5px rgba(175, 39, 47, 0);
  }
}

.sync-time {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
}

.leaderboard-year {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.period-filter {
  margin: 0;
}

.period-filter__select {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1px solid rgba(232, 197, 71, 0.35);
  border-radius: 999px;
  background-color: var(--bg-panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23e8c547' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 8px;
  color: var(--gold);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.period-filter__select:hover,
.period-filter__select:focus {
  border-color: rgba(232, 197, 71, 0.65);
  background-color: var(--bg-card-hover);
  outline: none;
}

.period-filter__select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.period-filter__select option {
  background-color: var(--bg-panel);
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.scope-section {
  position: relative;
  z-index: 2;
  padding: 3.5rem clamp(1.25rem, 3vw, 2.75rem) 3rem;
}

.scope-section + .scope-section {
  margin-top: 2rem;
  padding-top: 6rem;
  border-top: 1px solid var(--line);
}

.scope-section--community {
  background: linear-gradient(180deg, rgba(175, 39, 47, 0.04) 0%, transparent 120px);
}

.scope-section__head {
  margin-bottom: 3.5rem;
}

.scope-section__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: -0.01em;
}

.scope-section__sub {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.stat-strip--single {
  display: block;
  width: 100%;
  max-width: none;
  margin-bottom: 3rem;
}

.stat-strip--single .stat {
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  padding: 1.75rem clamp(1.25rem, 3vw, 2.5rem);
  text-align: center;
}

.stat-strip--single .stat__icon {
  margin-bottom: 0;
}

.stat-strip--single .stat__val {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
}

.stat-strip--single .stat__lbl {
  margin-top: 0;
  text-transform: none;
  letter-spacing: 0.03em;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
  max-width: none;
}

.panel-search {
  padding: 0 1.15rem 0.75rem;
}

.panel-search__field {
  position: relative;
}

.panel-search__icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1;
  pointer-events: none;
}

.panel-search__input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.35rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.3;
}

.panel-search__input::placeholder {
  color: var(--muted);
}

.panel-search__input:focus {
  outline: none;
  border-color: rgba(175, 39, 47, 0.55);
  box-shadow: 0 0 0 2px rgba(175, 39, 47, 0.15);
}

.panel-search__status {
  margin: 0.45rem 0 0;
  padding: 0 0.1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.rank-row--match {
  border-color: rgba(175, 39, 47, 0.28);
}

.rank-row--jump {
  border-color: rgba(175, 39, 47, 0.55);
  box-shadow: 0 0 0 1px rgba(175, 39, 47, 0.22);
  background: var(--brand-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dashboard--learners {
  grid-template-columns: repeat(2, 1fr);
}

.rank-list--simple {
  max-height: 560px;
}

.rank-row--simple {
  grid-template-columns: 4.25rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
}

.rank-row--simple .rank-row__pos {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.rank-row--simple .rank-row__score {
  font-size: 1.05rem;
}

.rank-row--simple .rank-row__meta {
  white-space: normal;
  text-overflow: unset;
  overflow: visible;
}

.rank-row__name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.rank-row__name-line .rank-row__name {
  font-size: 0.95rem;
  white-space: normal;
}

.rank-row__name-link {
  color: inherit;
  text-decoration: none;
}

.rank-row__name-link:hover,
.rank-row__name-link:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.rank-row--simple:hover .rank-row__name-link {
  color: var(--brand);
}

.podium-card__name-link {
  color: inherit;
  text-decoration: none;
}

.podium-card__name-link:hover,
.podium-card__name-link:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.rank-row__badges {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.rank-row__badge {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.rank-row__badge-more {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.1rem 0.3rem;
}

.podium-card__name .rank-row__badges {
  display: flex;
  justify-content: center;
  margin-top: 0.35rem;
}

.podium-card__name .rank-row__badge {
  width: 20px;
  height: 20px;
}

.page-learners .podium-card__sub {
  font-size: 0.72rem;
}

.page-learners .podium-block__label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--text);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 1.5rem;
  row-gap: 3rem;
  margin-bottom: 5.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem 3.2rem;
  border-radius: 3px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  animation: fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stat:nth-child(1) { animation-delay: 0.05s; }
.stat:nth-child(2) { animation-delay: 0.15s; }
.stat:nth-child(3) { animation-delay: 0.25s; }

.stat__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.3rem;
  color: var(--brand);
  font-size: 1.35rem;
  line-height: 1;
}

.stat__val {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__lbl {
  margin-top: 0.9rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

/* Podium hero — aligned twin blocks */
.podium-hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 4rem);
  padding: 0 0 5.5rem;
  align-items: stretch;
}

.podium-hero--single {
  grid-template-columns: 1fr;
}

.podium-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 360px;
  padding: 4rem 2rem 3.5rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.podium-block:nth-child(1) { animation-delay: 0.15s; }
.podium-block:nth-child(2) { animation-delay: 0.28s; }

.podium-block__label {
  margin: 0 0 4rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 1rem;
}

.podium {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.podium__loading {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
  font-size: 0.9rem;
}

.podium__stage {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  align-items: end;
  gap: 3.5rem 2rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.podium-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(2.5em, auto) minmax(2.6em, auto) auto auto;
  align-items: start;
  justify-items: center;
  text-align: center;
  padding: 2.7rem 1.1rem 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(14px);
  animation: fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.podium-card__rank {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  grid-row: 1;
}

.podium-card--1 .podium-card__rank { color: var(--gold); }
.podium-card--2 .podium-card__rank { color: var(--silver); }
.podium-card--3 .podium-card__rank { color: var(--bronze); }

.podium-card__avatar {
  width: clamp(56px, 7.5vw, 72px);
  height: clamp(56px, 7.5vw, 72px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 0.65rem;
  border: 2px solid transparent;
  background: var(--bg-card);
  overflow: visible;
  grid-row: 2;
  padding: 6px;
}

.podium-card__trophy {
  width: 80%;
  height: 80%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15));
}

.podium-card--1 .podium-card__avatar {
  width: clamp(64px, 8.5vw, 84px);
  height: clamp(64px, 8.5vw, 84px);
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(184, 134, 11, 0.18);
  padding: 7px;
}

.podium-card--1 .podium-card__trophy {
  filter: drop-shadow(0 5px 14px rgba(184, 134, 11, 0.28));
}

.podium-card--2 .podium-card__avatar {
  border-color: var(--silver);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.podium-card--3 .podium-card__avatar {
  border-color: var(--bronze);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.podium-card__name {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: clamp(0.78rem, 1.6vw, 0.92rem);
  margin-bottom: 0.15rem;
  width: 100%;
  max-width: 100%;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  grid-row: 3;
}

.podium-card__sub {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.35;
  width: 100%;
  max-width: 100%;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  grid-row: 4;
}

.podium-card__score {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--text);
  grid-row: 5;
  margin-bottom: 0.75rem;
}

.podium-card__bar {
  width: 100%;
  align-self: end;
  grid-row: 6;
  margin-top: auto;
  border-radius: 2px 2px 0 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-bottom: none;
  transform-origin: bottom center;
  transform: scaleY(0);
  animation: bar-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.podium-card--1 .podium-card__bar {
  height: 88px;
  background: linear-gradient(180deg, rgba(232, 197, 71, 0.18) 0%, rgba(232, 197, 71, 0.06) 100%);
  border-top: 3px solid var(--gold);
}

.podium-card--2 .podium-card__bar {
  height: 64px;
  background: linear-gradient(180deg, rgba(184, 192, 200, 0.16) 0%, rgba(184, 192, 200, 0.05) 100%);
  border-top: 3px solid var(--silver);
}

.podium-card--3 .podium-card__bar {
  height: 48px;
  background: linear-gradient(180deg, rgba(201, 136, 98, 0.16) 0%, rgba(201, 136, 98, 0.05) 100%);
  border-top: 3px solid var(--bronze);
}

/* Dashboard grid */
.dashboard {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 5.5rem;
  column-gap: 2.75rem;
  padding: 0 0 7rem;
}

.dashboard--single-row {
  grid-template-columns: repeat(2, 1fr);
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  animation: fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel:nth-child(1) { animation-delay: 0.2s; }
.panel:nth-child(2) { animation-delay: 0.28s; }
.panel:nth-child(3) { animation-delay: 0.36s; }
.panel:nth-child(4) { animation-delay: 0.44s; }
.panel:nth-child(5) { animation-delay: 0.52s; }

.panel--wide {
  grid-column: 1 / -1;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 2.5rem 1.35rem 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
}

.panel__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--brand);
  flex-shrink: 0;
}

.panel__title {
  margin: 0;
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.panel__sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 1rem 1.15rem 1.15rem;
  flex: 1;
  overflow: auto;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rank-list--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 0.85rem;
  row-gap: 0.75rem;
  padding: 1rem 1.15rem 1.15rem;
  overflow: hidden;
  max-height: none;
}

.rank-list--grid .rank-row {
  min-width: 0;
  align-content: start;
}

.rank-list--grid .rank-row__name,
.rank-list--grid .rank-row__meta {
  white-space: normal;
  text-overflow: unset;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rank-list--grid .rank-row__score {
  font-size: 0.8rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rank-row:hover {
  background: var(--bg-card-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.rank-row--top {
  background: var(--brand-soft);
  border-color: rgba(175, 39, 47, 0.22);
}

.rank-row__pos {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.rank-row--top .rank-row__pos { color: var(--brand); }

.rank-row__name {
  font-family: var(--font-bold);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row__meta {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row__score {
  font-family: var(--font-bold);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.rank-row__score small {
  display: block;
  font-family: var(--font);
  font-weight: 300;
  font-size: 0.62rem;
  color: var(--muted);
}

.rank-row__bar-wrap {
  grid-column: 1 / -1;
  height: 2px;
  border-radius: 2px;
  background: var(--bg-card);
  margin-top: 0.2rem;
  overflow: hidden;
}

.rank-row__bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-row--top .rank-row__bar {
  background: var(--brand);
}

.panel__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  background: rgba(13, 12, 16, 0.92);
}

.foot a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 400;
}

.foot a:hover { text-decoration: underline; }

.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: 1.5rem;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 2.85rem;
  height: 2.85rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(22, 21, 25, 0.94);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--bg-card-hover);
  border-color: rgba(175, 39, 47, 0.45);
  color: var(--brand);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .back-to-top {
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }

  .stat,
  .podium-block,
  .podium-card,
  .panel,
  .rank-row,
  .podium-card__bar,
  .live-pill,
  .live-pill__dot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .rank-row__bar {
    transition: none !important;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bar-rise {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@media (max-width: 1100px) {
  .podium-hero { grid-template-columns: 1fr; }
  .podium-block { min-height: 0; }
  .dashboard { grid-template-columns: 1fr; }
  .dashboard--learners { grid-template-columns: 1fr; }
  .rank-list--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .rank-list--grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .board-nav {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: 1fr;
  }
  .topbar__meta {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .podium__stage {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 0 auto;
    gap: 4rem;
  }
  .podium-card--2 { order: 0; }
  .podium-card__bar { display: none; }
  .stat-strip { grid-template-columns: 1fr; row-gap: 2.5rem; }
}
