/* Rankings (site theme 4.0.0) and the shared hero pieces (podium, rank rows, finder, star rows) that /player/ reuses.
   Chrome, tokens, panels, buttons, portraits and medals come from /site.css. */

[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.is-board [data-overview] { display: none; }
.page > * + * { margin-top: 26px; }

/* ------------------------------------------------------------------ title panel and the hero finder */
.rank-head { z-index: 5; text-align: center; padding-block: clamp(30px, 4vw, 48px); }
.rank-head .crumbs { margin: 0 0 8px; font: 700 14px/1.3 var(--body); color: var(--muted); }
.rank-head .crumbs a { color: var(--gold); }
.rank-head .crumbs .sep { margin: 0 8px; opacity: .7; }
.rank-head h1 { margin: 0 0 12px; color: var(--text); }
.rank-head h1 .dread-tag, .crumbs .dread-tag { color: var(--dread); }
.rank-head .lede { margin: 0 auto; max-width: 62ch; color: var(--text); }
.rank-head .updated { margin: 16px 0 0; font-variant-numeric: tabular-nums; }

.finder { max-width: 560px; margin: 26px auto 0; text-align: left; }
.finder-box { position: relative; display: flex; align-items: stretch; gap: 10px; }
.finder-box > .ico { position: absolute; left: 16px; top: 26px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.finder-box input { flex: 1; min-width: 0; min-height: 52px; padding-left: 46px; }
.btn-find { min-height: 52px; padding: 11px 24px 8px; font-size: 19px; }
.finder-list {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 50;
  list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto;
  background: var(--well-2); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 20px 28px -12px rgba(0, 0, 0, .7);
}
.finder-list [role="option"] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.finder-list [role="option"]:hover, .finder-list [role="option"][aria-selected="true"] { background: rgba(255, 138, 61, .08); }
.finder-list .cls { margin-left: 0; }
.finder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.finder-lv { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.finder-note { padding: 12px 12px; color: var(--muted); font-size: 15px; }

.page .status { text-align: center; color: var(--text); padding: 6px 0; }
.page .status:empty { display: none; }
.status.error { color: var(--bad); }
.status .btn { margin-left: 8px; }
.status a.btn { margin-left: 0; }

/* ------------------------------------------------------------------ panels */
.stone { margin: 0 0 26px; padding: clamp(22px, 3vw, 34px); }
.stone-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.stone-head h2 { display: flex; align-items: center; gap: 14px; color: var(--text); font-size: clamp(22px, 2.5vw, 29px); }
.stone-head h2::before { content: none; }
.zone h3 { color: var(--text); font-size: 24px; }
.page > .stone:last-child, .page > div > .stone:last-child { margin-bottom: 0; }
.empty-note { margin: 0; padding: 22px 12px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ the podium: 2 - 1 - 3, the winner crowned */
.podium { list-style: none; margin: 0; padding: 22px 0 0; display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 2.4vw, 28px); }
.pod { flex: 1 1 0; min-width: 0; max-width: 300px; display: flex; flex-direction: column; }
.pod.r1 { order: 2; }
.pod.r2 { order: 1; }
.pod.r3 { order: 3; }
.pod-hero {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 10px 10px 16px; text-align: center; color: var(--text); text-decoration: none; min-width: 0;
}
.pod-hero:hover { color: var(--text); }
.pod-hero .portrait { position: relative; z-index: 1; --size: 104px; transition: transform .25s var(--ease-out); }
.pod-hero .portrait::after { box-shadow: inset 0 0 0 2px var(--ring), inset 0 -8px 10px -5px rgba(0, 0, 0, .55); }
.pod.r1 .portrait { --size: 132px; box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px var(--well-2), 0 0 0 6px rgba(255, 138, 61, .5), 0 16px 24px rgba(0, 0, 0, .6); }
.pod.r2 .portrait { box-shadow: 0 0 0 1px var(--silver), 0 0 0 5px var(--well-2), 0 0 0 6px rgba(214, 217, 223, .4), 0 14px 22px rgba(0, 0, 0, .6); }
.pod.r3 .portrait { box-shadow: 0 0 0 1px var(--bronze), 0 0 0 5px var(--well-2), 0 0 0 6px rgba(224, 161, 112, .4), 0 14px 22px rgba(0, 0, 0, .6); }
.pod-hero:hover .portrait { transform: translateY(-4px); }
.crown { position: relative; z-index: 2; width: 62px; height: auto; margin-bottom: -20px; transform: rotate(-6deg); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); }
.pod-name { display: block; max-width: 100%; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 clamp(17px, 2vw, 22px)/1.15 var(--display); color: var(--text); transition: color .15s ease; }
.pod.r1 .pod-name { font-size: clamp(21px, 2.6vw, 28px); color: var(--gold-hi); }
.pod-hero:hover .pod-name { color: var(--gold-hi); }
.pod-hero .cls { margin: 0; }
.pod-score { color: var(--muted); font: 500 15px/1 var(--body); }
.pod-score b { margin-right: 3px; color: var(--text); font: 800 clamp(18px, 2.2vw, 24px)/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.pod-sub { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.pod-sub .stars { margin-left: 2px; }

.plinth {
  --metal: 242, 180, 80;
  display: grid; place-items: center; height: 104px;
  background: var(--panel-hi);
  border: 1px solid var(--line); border-radius: 8px 8px 2px 2px;
  box-shadow: 0 14px 24px rgba(0, 0, 0, .5);
}
.pod.r1 .plinth { border-color: var(--line-warm); box-shadow: inset 0 1px 0 rgba(255, 138, 61, .35), 0 14px 24px rgba(0, 0, 0, .5); }
.pod.r2 .plinth { --metal: 214, 217, 223; height: 76px; }
.pod.r3 .plinth { --metal: 224, 161, 112; height: 56px; }
.medal.big { width: 52px; height: 52px; font-size: 25px; }
.pod.r3 .medal.big { width: 42px; height: 42px; font-size: 20px; }

@media (prefers-reduced-motion: no-preference) {
  .pod { animation: pod-in .75s var(--ease-out) both; }
  .pod.r3 { animation-delay: .05s; }
  .pod.r2 { animation-delay: .17s; }
  .pod.r1 { animation-delay: .3s; }
  .plinth { animation: plinth-rise .9s var(--ease-out) both; animation-delay: inherit; }
  .crown { animation: crown-in .9s .62s var(--ease-out) both; }
}
@keyframes pod-in { from { transform: translateY(28px); } }
@keyframes plinth-rise { from { clip-path: inset(100% -14px -26px -14px); } to { clip-path: inset(-10px -14px -26px -14px); } }
@keyframes crown-in { from { transform: translateY(-28px) rotate(-20deg); } }

.skeleton-podium { display: flex; align-items: flex-end; justify-content: center; gap: clamp(10px, 2.4vw, 28px); padding-top: 22px; }
.skeleton-podium span { flex: 1 1 0; max-width: 300px; height: 210px; border: 1px solid var(--line-soft); border-radius: 8px; background: linear-gradient(100deg, var(--well) 30%, #2a1a10 50%, var(--well) 70%) 0 0 / 220% 100%; }
.skeleton-podium span:nth-child(1) { order: 2; height: 262px; }
.skeleton-podium span:nth-child(2) { order: 1; }
.skeleton-podium span:nth-child(3) { order: 3; height: 180px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton-podium span { animation: shimmer 1.6s linear infinite; }
}
@keyframes shimmer { to { background-position: -120% 0; } }

/* ------------------------------------------------------------------ ranks 4 and on: a tight list */
.rank-list { list-style: none; margin: 24px 0 0; padding: 0; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.rank-list li + li { border-top: 1px solid var(--line-soft); }
.rank-row { display: grid; grid-template-columns: 40px 40px minmax(0, 1.5fr) minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 9px 16px 9px 12px; color: var(--text); text-decoration: none; transition: background-color .15s ease; }
.rank-row:hover { background: rgba(255, 138, 61, .07); color: var(--text); }
.rank-row .medal { justify-self: center; }
.rr-who { min-width: 0; display: flex; align-items: center; gap: 9px; }
.rr-who b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; transition: color .15s ease; }
.rr-who .cls { margin: 0; flex: none; }
.rank-row:hover .rr-who b { color: var(--gold); }
.rr-meta .cls { display: none; margin: 0 8px 0 0; }
.rr-meta { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rr-score { text-align: right; color: var(--gold); font: 800 18px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.go { color: var(--muted); opacity: .55; transition: transform .2s var(--ease-out), color .15s ease, opacity .15s ease; }
.rank-row:hover .go, .dg-row:hover .go { color: var(--gold); opacity: 1; transform: translateX(3px); }

/* ------------------------------------------------------------------ difficulty tabs and the dungeon filter */
.zones-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 18px; margin: 0 0 22px; }
.mode-tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.mode-tabs button, .pill {
  appearance: none;
  cursor: pointer;
  padding: 13px 22px;
  font: 700 15px/1.1 var(--display);
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--gold-hi);
  background: rgba(255, 138, 61, .05);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s var(--ease-out);
}
.mode-tabs button:hover, .pill:hover { background: rgba(255, 138, 61, .11); color: var(--gold-hi); box-shadow: 0 0 0 1px var(--gold) inset; }
.mode-tabs button[aria-selected="true"] { color: var(--on-gold); background: var(--ember); box-shadow: 0 0 0 1px rgba(255, 207, 138, .6) inset, 0 8px 18px rgba(0, 0, 0, .45); }
.mode-tabs button[data-mode="dread"][aria-selected="true"] { color: var(--on-gold); background: linear-gradient(180deg, #ffb39e, var(--dread) 55%, #d4583a); box-shadow: 0 0 0 1px rgba(255, 200, 180, .6) inset, 0 8px 18px rgba(0, 0, 0, .45); }
.pill.dread { color: var(--dread); box-shadow: 0 0 0 1px rgba(255, 143, 115, .5) inset; }
.pill.dread:hover { color: var(--dread); box-shadow: 0 0 0 1px var(--dread) inset; }
.mode-tabs button:active, .pill:active { transform: translateY(1px); }
.mode-tabs .count { margin-left: 9px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); color: var(--text); font: 700 13px/1 var(--body); font-variant-numeric: lining-nums tabular-nums; }
.mode-tabs button[aria-selected="true"] .count { background: rgba(28, 13, 3, .16); color: var(--on-gold); }
.pill { padding: 10px 16px; font-size: 14px; }

.dg-filter { position: relative; width: min(300px, 100%); }
.dg-filter .ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.dg-filter input { min-height: 46px; padding-left: 44px; }

/* ------------------------------------------------------------------ zones: one list of dungeons per zone */
.dg-cols, .dg-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) 110px 100px 18px; align-items: center; gap: 14px; }
.dg-cols { padding: 0 16px 8px 14px; color: var(--muted); font: 700 13px/1.2 var(--display); letter-spacing: .05em; }
.dg-cols .r { text-align: right; }
.dg-cols span:nth-child(4) { grid-column: 4; }
.dg-list { list-style: none; margin: 0; padding: 0; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.dg-row { position: relative; padding: 10px 16px 10px 14px; transition: background-color .15s ease; }
.dg-row + .dg-row { border-top: 1px solid var(--line-soft); }
.dg-row:hover { background: rgba(255, 138, 61, .07); }
.dg-name { color: var(--text); font: 700 16px/1.25 var(--display); text-decoration: none; transition: color .15s ease; }
.dg-name::after { content: ""; position: absolute; inset: 0; }
.dg-row:hover .dg-name { color: var(--gold); }
.dg-leader { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-weight: 700; text-decoration: none; }
.dg-leader:hover { color: var(--gold); }
.dg-leader.none { font-weight: 600; font-style: italic; opacity: .85; }
.dg-leader-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-score { text-align: right; color: var(--gold); font: 800 16px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.dg-count { text-align: right; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ one dungeon's board */
.board-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-wrap { overflow: clip; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; }
.board-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: lining-nums tabular-nums; }
.board-table th {
  position: sticky; top: 68px; z-index: 4;
  text-align: left; padding: 13px 14px 10px; white-space: nowrap;
  font: 700 13px/1.2 var(--display); letter-spacing: .05em; color: var(--gold);
  background: var(--well-2); box-shadow: inset 0 -1px 0 var(--line);
}
.board-table td { padding: 10px 14px; border-top: 1px solid var(--line-soft); background: transparent; transition: background-color .15s ease; }
.board-table tbody tr:first-child td { border-top: 0; }
.board-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .025); }
.board-table tbody tr:hover td { background: rgba(255, 138, 61, .09); }
.board-table tr.top.r1 td { background: rgba(255, 138, 61, .1); }
.board-table tr.top.r2 td { background: rgba(214, 217, 223, .07); }
.board-table tr.top.r3 td { background: rgba(224, 161, 112, .08); }
.board-table tr.top:hover td { filter: brightness(1.12); }
.c-rank { width: 70px; text-align: center !important; }
.c-rank .medal { margin-inline: auto; }
.c-num { text-align: right !important; }
td.score { color: var(--gold); font-weight: 700; }
td.c-date, th.c-date { color: var(--muted); white-space: nowrap; }
.lv-label { display: none; }
.name { font-weight: 800; transition: color .15s ease; }
.hero-cell { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; }
.hero-cell:hover { color: var(--text); }
.hero-cell:hover .name { color: var(--gold); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.hero-id { min-width: 0; }
.hero-id .cls { margin-left: 8px; }
.foot { margin: 14px 4px 0; }

/* star rows: five drawn stars, halves from the sprite's gradient */
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.star { width: 18px; height: 18px; fill: #3a2a1e; stroke: #060505; stroke-width: 1.1; stroke-linejoin: round; }
.star.full { fill: var(--gold); }
.star.half { fill: url(#star-half); }

/* ------------------------------------------------------------------ phones: nothing scrolls sideways */
@media (max-width: 860px) { .board-table th { top: 0; } }
@media (max-width: 760px) {
  .rank-row { grid-template-columns: 36px 40px minmax(0, 1fr) auto; gap: 4px 11px; padding: 10px 14px 10px 12px; }
  .rank-row .go { display: none; }
  .rr-who { grid-column: 3; }
  .rr-meta { grid-column: 3; grid-row: 2; font-size: 13px; }
  .rr-meta .cls { display: inline-block; }
  .rr-dg { display: none; }
  .rr-who .cls { display: none; }
  .rr-score { grid-column: 4; grid-row: 1 / span 2; }
  .rank-row .portrait { grid-row: 1 / span 2; }
  .rank-row .medal { grid-row: 1 / span 2; }
  .dg-cols { display: none; }
  .dg-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; }
  .dg-row .go { display: none; }
  .dg-name { grid-column: 1; }
  .dg-leader { grid-column: 1; grid-row: 2; }
  .dg-score { grid-column: 2; grid-row: 1; }
  .dg-count { grid-column: 2; grid-row: 2; font-size: 13px; }
}
@media (max-width: 640px) {
  .podium { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 6px; }
  .pod { flex-direction: row; max-width: none; align-items: stretch; gap: 0; }
  .pod.r1, .pod.r2, .pod.r3 { order: 0; }
  .plinth { order: -1; flex: none; width: 54px; height: auto !important; border-radius: 8px 2px 2px 8px; }
  .pod.r2 .plinth, .pod.r3 .plinth { height: auto; }
  .plinth .medal.big, .pod.r3 .medal.big { width: 38px; height: 38px; font-size: 21px; }
  .pod-hero { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto auto; justify-items: start; align-content: center; column-gap: 14px; row-gap: 3px; padding: 12px 10px 12px 18px; text-align: left; }
  .pod-hero .portrait, .pod.r1 .portrait { --size: 76px; grid-row: 1 / span 4; align-self: center; }
  .pod.r1 .portrait { --size: 88px; }
  .pod-hero > :not(.portrait):not(.crown) { grid-column: 2; }
  .crown { position: absolute; z-index: 2; top: 0; left: 42px; width: 40px; margin: 0; }
  .pod-name, .pod.r1 .pod-name { margin: 0; font-size: 20px; }
  .pod-sub { justify-content: flex-start; }
  .pod-hero:hover .portrait { transform: none; }

  .board-table thead { display: none; }
  .board-table, .board-table tbody { display: block; }
  .board-table tr { display: grid; grid-template-columns: 44px max-content max-content 1fr; align-items: center; column-gap: 8px; row-gap: 2px; padding: 10px 12px 10px 10px; border-top: 1px solid var(--line-soft); background: transparent; }
  .board-table tbody tr:first-child { border-top: 0; }
  .board-table td, .board-table tbody tr:nth-child(even) td, .board-table tr.top td { padding: 0; border: 0; background: transparent !important; }
  .board-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .025); }
  .board-table tr.top.r1 { background: rgba(255, 138, 61, .1); }
  .board-table tr.top.r2 { background: rgba(214, 217, 223, .07); }
  .board-table tr.top.r3 { background: rgba(224, 161, 112, .08); }
  .board-table tbody tr:hover { background: rgba(255, 138, 61, .09); }
  .c-rank { grid-column: 1; grid-row: 1 / span 2; width: auto; }
  .c-hero { grid-column: 2 / 4; grid-row: 1; min-width: 0; }
  .board-table td.score { grid-column: 4; grid-row: 1; font-size: 18px; }
  .c-lv { grid-column: 2; grid-row: 2; text-align: left !important; color: var(--muted); font-size: 13px; }
  .lv-label { display: inline; }
  .c-stars { grid-column: 3; grid-row: 2; }
  .star { width: 15px; height: 15px; }
  td.c-date, th.c-date { display: none; }
  .hero-cell { gap: 10px; }
  .board-tools, .dg-filter { width: 100%; }
}
@media (max-width: 440px) {
  .finder-box { flex-wrap: wrap; }
  .finder-box input { flex: 1 1 100%; }
  .btn-find { flex: 1 1 100%; }
  .finder-box > .ico { top: 26px; }
  .mode-tabs { width: 100%; }
  .mode-tabs button { flex: 1 1 auto; padding-inline: 10px; font-size: 14px; }
  .mode-tabs .count { margin-left: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .mode-tabs button, .pill, .go, .pod-hero .portrait { transition: none; }
  .pod-hero:hover .portrait { transform: none; }
}
