/* Survivor Leaderboard (playnewhope.com/leaderboard): category tabs, podium and rows; the Survivor File card with hex badges.
   Everything is scoped under .lb so it never touches the rest of the site. Uses the site's colours from site.css. */
.lb { --gold: #ffc24a; --silver: #c9d1d9; --bronze: #d08a4e; padding-block: 1.75rem 4rem; }
.lb .wrap { display: flex; flex-direction: column; gap: 1rem; }
.lb .cut { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }

/* Server totals: info only, not clickable */
.lb-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.lb-totals > div { position: relative; min-width: 0; padding: 1rem 1.25rem 0.95rem; border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 75%), var(--surface); }
.lb-totals > div::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); box-shadow: 0 0 0.75rem var(--c); }
.lb-totals b { display: block; font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1.1; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-totals small { display: block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }

/* Sort tabs: re-sort the board by the stat clicked */
.lb-tabs { display: flex; gap: 0.35rem; padding: 0.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; overflow-x: auto; scrollbar-width: none; }
.lb-tabs a { flex: 1 0 auto; text-align: center; padding: 0.6rem 1rem; border-radius: 0.4rem; font-family: var(--display); font-weight: 600; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); text-decoration: none; }
.lb-tabs a:hover { color: var(--fg); background: var(--raised); }
.lb-tabs a.on { color: #1a0a0d; background: var(--glow); box-shadow: 0 0.25rem 1rem rgba(255, 46, 138, 0.25); }

/* Season pills and search */
.lb-filters { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.lb-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lb-pill { font-size: 0.82rem; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.875rem; white-space: nowrap; }
.lb-pill:hover { border-color: var(--orange); color: var(--fg); }
.lb-pill.on { color: #1a0a0d; background: var(--glow); border-color: transparent; font-weight: 600; }
.lb-search { flex: 1 1 11rem; min-width: 0; font: inherit; font-size: 0.95rem; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 1rem; }
.lb-search:focus { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Podium: gold in the middle and highest, silver left, bronze right */
.lb-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 0.9rem; align-items: end; margin-top: 0.75rem; }
.lb .pod { --m: var(--line); position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; text-decoration: none; color: var(--fg); background: linear-gradient(180deg, color-mix(in srgb, var(--m) 22%, transparent), var(--surface) 75%); border: 1px solid color-mix(in srgb, var(--m) 70%, transparent); padding: 1.2rem 1rem 1.1rem; text-align: center; min-width: 0; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.lb .pod:hover { transform: translateY(-3px); box-shadow: 0 0.75rem 2rem color-mix(in srgb, var(--m) 30%, transparent); }
.lb .pod .place { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; font-family: var(--display); font-weight: 700; font-size: 1.5rem; line-height: 1; color: #1a0a0d; background: var(--m); box-shadow: 0 0 1rem color-mix(in srgb, var(--m) 55%, transparent); margin-bottom: 0.35rem; }
.lb .pod .nm { font-family: var(--display); font-weight: 600; font-size: 1.25rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .pod .rk { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lb .pod .val { font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: 0.4rem; font-variant-numeric: tabular-nums; color: var(--m); }
.lb .pod .what { font-size: 0.75rem; color: var(--muted); }
.lb .pod.p1 { --m: var(--gold); padding-block: 1.8rem 1.6rem; }
.lb .pod.p1 .place { width: 3.6rem; height: 3.6rem; font-size: 1.9rem; }
.lb .pod.p1 .val { font-size: 2.5rem; }
.lb .pod.p2 { --m: var(--silver); }
.lb .pod.p3 { --m: var(--bronze); }
@media (prefers-reduced-motion: reduce) { .lb .pod { transition: none; } .lb .pod:hover { transform: none; } }

/* Ranking table: everyone, sorted by the tab picked (the podium highlights the top 3) */
.lb-table { background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; }
.lb-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb-table th, .lb-table td { padding: 0.8rem 1rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table tbody tr:hover { background: var(--raised); }
.lb-table th { font-family: var(--mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: rgba(0, 0, 0, 0.2); }
.lb-table th.on { color: var(--fg); }
.lb-table td { color: var(--muted); }
.lb-table .n { width: 3.5rem; text-align: left; font-family: var(--display); font-weight: 700; }
.lb-table .pl { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.lb-table tr.p1 .pl { color: #1a0a0d; background: var(--gold); border-color: transparent; box-shadow: 0 0 0.75rem rgba(255, 194, 74, 0.45); }
.lb-table tr.p2 .pl { color: #1a0a0d; background: var(--silver); border-color: transparent; }
.lb-table tr.p3 .pl { color: #1a0a0d; background: var(--bronze); border-color: transparent; }
.lb-table .who { text-align: left; width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lb-table .who a { color: var(--fg); font-weight: 600; text-decoration: none; display: inline-block; max-width: calc(100% - 1rem); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.lb-table .who a:hover { text-decoration: underline; }
.lb-table .rk { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: #ffb8d6; border: 1px solid #5a2a40; background: rgba(255, 46, 138, 0.08); border-radius: 999px; padding: 0.05rem 0.45rem; margin-left: 0.55rem; vertical-align: 0.1em; }
.lb-table td.on, .lb-table th.on { background: rgba(255, 46, 138, 0.06); }
.lb-table td.on { color: var(--fg); font-weight: 700; }
.lb-table th i { font-style: normal; color: #ff4d5e; }
.lb .on-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #5fd68a; margin-left: 0.4rem; vertical-align: 0.1em; }
.lb-fine { color: var(--muted); font-size: 0.85rem; margin: 0; }
.lb .empty-state { margin-top: 0.5rem; }

/* Survivor File */
.lb .back-link { align-self: flex-start; }
.lb .file { display: grid; grid-template-columns: 16rem minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); }
.lb .file .side { background: linear-gradient(160deg, #2a1219, #1c1415 60%); border-right: 1px solid var(--line); padding: 1.4rem 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; position: relative; overflow: hidden; }
.lb .file .side::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 18px, rgba(255, 46, 138, 0.05) 18px 20px); pointer-events: none; }
.lb .file .side > * { position: relative; }
.lb .file .tag { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; }
.lb .file .big { font-size: 2.4rem; line-height: 1.05; overflow-wrap: anywhere; }
.lb .file .big.m { font-size: 1.85rem; }
.lb .file .big.s { font-size: 1.45rem; }
.lb .file .big.xs { font-size: 1.15rem; }
.page-head + .lb { padding-top: 0; }
.lb .hexrank { display: flex; align-items: center; gap: 0.75rem; }
.lb .hexrank > div { flex: 1; min-width: 0; }
.lb .hexrank b { font-family: var(--display); font-size: 1.2rem; display: block; text-transform: uppercase; }
.lb .hexrank small { font-size: 0.75rem; color: var(--muted); display: block; }
.lb .hexrank svg, .lb .hx svg { flex: none; }
.lb .meter { height: 5px; background: var(--raised); overflow: hidden; margin: 0.375rem 0 0.25rem; }
.lb .meter i { display: block; height: 100%; background: var(--glow); }
.lb .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0; }
.lb .facts .wide { grid-column: 1 / -1; }
.lb .facts > div { display: flex; flex-direction: column; justify-content: flex-end; }
.lb .facts dt { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lb .facts dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.lb .file .main { padding: 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.lb h2.h3 { font-size: 0.75rem; letter-spacing: 0.18em; color: var(--muted); font-weight: 600; margin-bottom: 0.625rem; }
.lb h2.h3 span { font-family: var(--mono); letter-spacing: 0.04em; color: var(--orange); margin-left: 0.4rem; }
.lb .lines { display: flex; flex-direction: column; gap: 1rem; }
.lb .line { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 5.75rem; column-gap: 0.75rem; row-gap: 2px; align-items: center; }
.lb .line > span { font-size: 0.82rem; color: var(--muted); }
.lb .line .track { height: 10px; background: var(--raised); overflow: hidden; }
.lb .line .track i { display: block; height: 100%; background: var(--glow); }
.lb .line b { font-family: var(--display); font-size: 1.35rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.lb .line em { grid-column: 2 / 4; font-style: normal; font-size: 0.75rem; color: var(--muted); }
.lb .hexes { display: flex; flex-wrap: wrap; gap: 0.875rem; }
.lb .hx { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; width: 6.5rem; text-align: center; }
.lb .hx b { font-size: 0.75rem; font-weight: 600; line-height: 1.2; color: var(--fg); }
.lb .hx small { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; }
.lb .allbadges { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.75rem; }
.lb .allbadges summary { cursor: pointer; font-weight: 600; color: var(--orange); }
.lb .allbadges h3 { font-size: 0.75rem; letter-spacing: 0.16em; color: var(--muted); margin: 1rem 0 0.5rem; }
.lb .allbadges ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.625rem 1rem; }
.lb .allbadges li { display: flex; gap: 0.625rem; align-items: flex-start; min-width: 0; }
.lb .allbadges li > div { min-width: 0; flex: 1; }
.lb .allbadges li b { font-size: 0.88rem; }
.lb .allbadges .t { font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; margin-left: 0.25rem; }
.lb .allbadges small { display: block; font-size: 0.72rem; color: var(--muted); line-height: 1.35; }
.lb .next { display: flex; flex-direction: column; gap: 0.625rem; }
.lb .next div { display: flex; justify-content: space-between; gap: 0.625rem; font-size: 0.82rem; border-left: 3px solid var(--orange); padding-left: 0.625rem; }
.lb .next em { font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 0.75rem; white-space: nowrap; }
.lb .tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lb .rib { font-size: 0.78rem; border: 1px solid var(--line); padding: 0.3rem 0.625rem 0.3rem 0.5rem; display: flex; align-items: center; gap: 0.5rem; background: var(--raised); }
.lb .rib i { width: 4px; height: 16px; display: block; }
.lb .ribs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.625rem 1rem; }
.lb .ribs li { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; min-width: 0; }
.lb .ribs small { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }
.lb .acts { display: flex; gap: 0.625rem; flex-wrap: wrap; align-items: center; }
.lb .acts .btn { border-radius: 0; padding: 0.6rem 1.1rem; font-size: 0.92rem; }
.lb-toast { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 1100px) { .lb-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .lb-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .lb-totals > div:first-child { grid-column: 1 / -1; }
  .lb-totals > div { padding: 0.75rem 1rem; }
  .lb-totals b { font-size: 1.6rem; }
  .lb-tabs { flex-wrap: wrap; justify-content: center; gap: 0.25rem; }
  .lb-tabs a { flex: 1 1 auto; padding: 0.55rem 0.6rem; font-size: 0.85rem; }
  .lb-podium { grid-template-columns: 1fr; }
  .lb .pod.p1 { order: -1; padding-block: 1rem; }
  .lb .pod { padding: 0.75rem; }
  .lb .pod .place, .lb .pod.p1 .place { width: 2.6rem; height: 2.6rem; font-size: 1.3rem; }
  .lb .pod .val, .lb .pod.p1 .val { font-size: 1.6rem; }
  .lb-table .st:not(.on) { display: none; }
  .lb-table th, .lb-table td { padding: 0.7rem 0.75rem; }
  .lb-table .n { width: 2.25rem; }
  .lb-table .rk { display: none; }
  .lb .file { grid-template-columns: 1fr; }
  .lb .file .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .lb .file .main { padding: 1.25rem 1rem; }
  .lb .line { grid-template-columns: 5.75rem minmax(0, 1fr) 4.75rem; }
  .lb .line b { font-size: 1.15rem; }
}
