/* ── Output table ────────────────────────────────────────────────────────── */
#output { margin-top: 36px; transition: opacity 0.25s ease; }
#output.fading { opacity: 0; }

#output h3 {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  text-align: center;
  color: var(--yellow);
  margin-bottom: 0;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

#output table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 14px;
  table-layout: fixed;
}

#output thead th {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg3);
  padding: 8px 14px;
}

/* ── Sortable headers ────────────────────────────────────────────────────── */
.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.th-sortable:hover { color: var(--fg1); }
.th-active { color: var(--yellow) !important; }
.th-center { text-align: center; }
.th-right  { text-align: right; }

.sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.8;
}

/* # column is narrow; champion/level/points each get an equal third of the rest */
#output thead th:nth-child(1),
#output tbody td:nth-child(1) { width: 44px; text-align: left; }

#output thead th:nth-child(2),
#output tbody td:nth-child(2) { width: calc((100% - 44px) / 3); text-align: left; }

#output thead th:nth-child(3),
#output tbody td:nth-child(3) { width: calc((100% - 44px) / 3); text-align: center; }

#output thead th:nth-child(4),
#output tbody td:nth-child(4) { width: calc((100% - 44px) / 3); text-align: right; }

#output tbody tr {
  background: var(--bg1);
  border-radius: 10px;
  transition: background 0.1s, box-shadow 0.1s;
}
#output tbody tr:hover { background: var(--bg2); box-shadow: 0 2px 8px #0004; }

#output tbody td {
  padding: 10px 14px;
  color: var(--fg);
  vertical-align: middle;
}
#output tbody td:first-child {
  color: var(--fg3);
  font-style: italic;
  font-size: 12px;
  border-radius: 10px 0 0 10px;
}
#output tbody td:last-child {
  color: var(--yellow);
  border-radius: 0 10px 10px 0;
}

/* ── Champion cell ───────────────────────────────────────────────────────── */
.champion-cell { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.champion-cell img {
  flex-shrink: 0;
  height: 30px; width: 30px;
  border-radius: 50%;
  border: 2px solid var(--bg3);
}

/* ── Podium ───────────────────────────────────────────────────────────────── */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  margin: 8px 0 40px;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 110px;
}

.podium-1 { padding-top: 0;    }
.podium-2 { padding-top: 24px; }
.podium-3 { padding-top: 24px; }

.podium-rank {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fg3);
}

.podium-icon {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg3);
  display: block;
  transition: transform 0.15s ease;
}
.podium-icon:hover { transform: scale(1.06); }

.podium-1 .podium-icon { width: 86px; height: 86px; border: 2px solid var(--yellow-s); }
.podium-2 .podium-icon { width: 72px; height: 72px; }
.podium-3 .podium-icon { width: 72px; height: 72px; }

.podium-icon-fallback {
  border-radius: 50%;
  background: var(--bg2);
  border: 2px solid var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--fg3);
  font-size: 22px;
}
.podium-1 .podium-icon-fallback { width: 86px; height: 86px; border-color: var(--yellow-s); }
.podium-2 .podium-icon-fallback { width: 72px; height: 72px; }
.podium-3 .podium-icon-fallback { width: 72px; height: 72px; }

.podium-name {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg3);
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
}

.podium-pts {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--fg3);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .podium { gap: 16px; }
  .podium-slot { width: 88px; }
  .podium-1 .podium-icon,
  .podium-1 .podium-icon-fallback { width: 64px; height: 64px; }
  .podium-2 .podium-icon,
  .podium-3 .podium-icon,
  .podium-2 .podium-icon-fallback,
  .podium-3 .podium-icon-fallback { width: 52px; height: 52px; }
  .podium-name { font-size: 11px; }
  .podium-pts  { font-size: 11px; }
  .podium-rank { font-size: 11px; }
}


.mastery-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.mastery-level-7  { color: var(--yellow); background: #3c360e; border: 1px solid var(--yellow-s); }
.mastery-level-5  { color: var(--green);  background: #323520; border: 1px solid var(--green-d);  }
.mastery-level-lo { color: var(--aqua);   background: #1f2e2e; border: 1px solid #427b58;         }