#rank-panel[data-rank-hub] :is(#rank-tab-bar, #rank-panel-subtitle) { display: none !important; }
#rank-panel[data-rank-hub] #rank-panel-body { padding: 12px 12px 20px; }
#rank-panel[data-rank-hub] .rank-card-toolbar { padding-bottom: 1px; }
.rank-hub { --rank-accent: var(--night-accent); --rank-columns: var(--rank-index-width, 48px) 38px minmax(0, 1fr) max-content; }
#rank-panel[data-rank-detail="activity"] { --rank-index-width: 42px; --rank-column-gap: 4px; }
#rank-panel:is([data-rank-detail="followers"], [data-rank-detail="works"], [data-rank-detail="albums"]) { --rank-index-width: 29px; --rank-column-gap: 5px; }
.rank-hub :is(h2, p, ol) { margin: 0; }
.rank-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 10px; }
.rank-hub-see {
  display: block;
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--night-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rank-hub-see:focus-visible { outline: 2px solid var(--rank-accent); outline-offset: 2px; }
.rank-hub-see:is(:hover, :focus-visible) .rank-hub-cover { box-shadow: 0 0 0 1px #ffffff66; }
.rank-hub-card-title {
  position: absolute;
  z-index: 1;
  inset: auto 11px 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.rank-hub-cover {
  display: grid;
  position: relative;
  isolation: isolate;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  aspect-ratio: 1;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #ffffff20;
  transition: box-shadow .16s ease;
}
.rank-hub-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #08070c59, #08070c74 48%, #08070cde);
  pointer-events: none;
}
.rank-hub-cover-slice { display: grid; position: relative; place-items: center; overflow: hidden; background: #302a34; color: #d4bfc7; font-size: 17px; }
.rank-hub-cover-slice:nth-child(2) { background: #3b3138; }
.rank-hub-cover-slice:nth-child(3) { background: #282630; }
.rank-hub-back svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rank-hub-back:not([hidden]) { display: inline-flex; align-items: center; gap: 3px; min-width: 0; min-height: 36px; padding: 0 6px 0 0; border: 0; border-radius: 8px; background: transparent; color: var(--night-ink); font-size: 18px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.rank-hub-back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rank-hub-back:is(:hover, :focus-visible) { color: var(--night-accent); }
.rank-hub-back svg { width: 24px; height: 24px; flex: 0 0 24px; }
#rank-panel[data-rank-hub] .rank-card-toolbar h2 { display: none; }
#mobile-control-dialog:not([data-panel="rank"]) .rank-hub-heading-line { display: none; }
.rank-hub-heading-line { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.rank-card-toolbar:has(.rank-hub-rule:not([hidden])), .mobile-panel-header:has(.rank-hub-rule:not([hidden])) { position: relative; z-index: 2; }
.rank-hub-rule { position: relative; flex: none; }
.rank-hub-rule-toggle {
  display: grid; place-items: center; width: 26px; height: 30px; padding: 0; border: 0;
  background: transparent; color: var(--night-muted); cursor: pointer;
}
.rank-hub-rule-toggle:is(:hover, :focus-visible, [aria-expanded="true"]) { color: var(--night-accent); }
.rank-hub-rule-icon {
  display: grid; place-items: center; box-sizing: border-box; width: 16px; height: 16px;
  border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1;
}
.rank-hub-rule-popover {
  position: absolute; top: 50%; left: calc(100% + 4px); transform: translateY(-16px);
  box-sizing: border-box; width: 136px; padding: 9px 10px; border: 1px solid var(--night-border);
  border-radius: 10px; background: var(--night-surface); color: var(--night-ink); box-shadow: var(--night-shadow);
  font-size: 12px; line-height: 1.5; font-weight: 400;
}
.rank-hub-rule-popover::before { content: ''; position: absolute; top: 0; bottom: 0; right: 100%; width: 5px; }
.rank-hub-art {
  display: grid;
  position: relative;
  flex: 0 0 57px;
  width: 57px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  color: #e2c6ce;
  background: linear-gradient(150deg, #573240, #332631);
  border: 1px solid #ffffff2b;
  border-radius: 12px;
  font-size: 19px;
}
:is(.rank-hub-art, .rank-hub-cover-slice) img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
:is(.rank-hub-art, .rank-hub-cover-slice) img[hidden] { display: none; }
.rank-hub-ellipsis { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-hub-empty { color: var(--night-muted); font-size: 12px; line-height: 1.6; }

.rank-hub .rank-hub-source { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 5px 12px; color: var(--night-muted); font-size: 11px; }
.rank-hub-results, .rank-hub-podium { padding: 0; list-style: none; }
.rank-hub-results .rank-hub-result:not(:last-child) { border-bottom: 1px solid #ffffff14; }
.rank-hub-column-heading {
  display: grid; grid-template-columns: var(--rank-columns); gap: var(--rank-column-gap, 8px); padding: 7px 5px 8px;
  color: var(--night-muted); font-size: 11px; font-weight: 400;
}
.rank-hub-column-heading > :nth-child(2) { grid-column: span 2; }
.rank-hub-column-heading > :last-child { text-align: right; }
.rank-hub-result-link {
  display: grid;
  grid-template-columns: var(--rank-columns);
  align-items: center;
  gap: var(--rank-column-gap, 8px);
  width: 100%;
  min-height: 52px;
  padding: 6px 5px;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--night-ink);
  font-family: inherit;
  text-align: left;
  text-decoration: none;
}
.rank-hub-result-link:is(a, button) { cursor: pointer; }
.rank-hub-source-results .rank-hub-result-link { grid-template-columns: 28px 38px minmax(0, 1fr); }
.rank-hub-result-link:is(a, button):is(:hover, :focus-visible) { background: #ffffff0f; color: #fff; outline-offset: -2px; }
.rank-hub-result-link.is-rank-target { background: #ff45451a; }
.rank-hub-result-place { display: inline-flex; align-items: center; gap: 4px; color: var(--night-muted); font-size: 17px; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.rank-hub-movement { display: inline-flex; align-items: center; gap: 2px; font-size: 9px; line-height: 1; }
.rank-hub-movement.is-up { color: #ff6568; }
.rank-hub-movement.is-down { color: #8cc4f8; }
.rank-hub-movement.is-new { color: #75dcb7; font-size: 8px; }
.rank-hub-movement:is(.is-up, .is-down)::before { content: ''; border-inline: 3px solid transparent; }
.rank-hub-movement.is-up::before { border-bottom: 5px solid currentColor; }
.rank-hub-movement.is-down::before { border-top: 5px solid currentColor; }
.rank-hub-result .rank-hub-art { width: 38px; min-width: 0; border-radius: 6px; font-size: 13px; }
.rank-hub .rank-hub-person-art { border-radius: 50%; }
.rank-hub-result-copy { display: grid; min-width: 0; gap: 3px; }
.rank-hub-result-copy strong { font-size: 13px; line-height: 1.25; }
.rank-hub-result-copy small { color: var(--night-muted); font-size: 10px; line-height: 1.3; }
.rank-hub-album-copy { display: flex; align-items: baseline; gap: 4px; line-height: 1.25; }
.rank-hub-album-copy :is(.rank-hub-album-title, .rank-hub-album-author) {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank-hub-result-copy .rank-hub-album-author { font-size: 11px; font-weight: 400; }
.rank-hub-result-value { color: var(--rank-accent); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.rank-hub-podium {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.19fr) minmax(0, 1fr);
  gap: 6px; align-items: start; padding-top: 36px;
}
.rank-hub .rank-hub-podium { margin-bottom: 12px; }
.rank-hub-podium .rank-hub-result { grid-row: 1; min-width: 0; }
.rank-hub-podium [data-podium-rank="1"] { grid-column: 2; }
.rank-hub-podium [data-podium-rank="2"] { grid-column: 1; }
.rank-hub-podium [data-podium-rank="3"] { grid-column: 3; }
.rank-hub-podium .rank-hub-result-link {
  display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; min-height: 108px; margin-top: 10px;
  padding: 0 5px 12px; text-align: center; border: 1px solid #ffffff23; border-radius: 13px; background: #211e23;
}
.rank-hub-podium [data-podium-rank="1"] .rank-hub-result-link { min-height: 125px; margin-top: 0; }
.rank-hub-podium .rank-hub-result-link:is(a, button):is(:hover, :focus-visible), .rank-hub-podium .is-rank-target { border-color: #ffffff47; background: #2b232a; }
.rank-hub-podium .rank-hub-art {
  flex: 0 0 auto; width: min(72%, 57px); margin-top: -24px; border: 0;
}
.rank-hub-podium [data-podium-rank="1"] .rank-hub-art { width: min(77%, 70px); margin-top: -31px; }
.rank-hub-podium .rank-hub-result-place { color: var(--night-ink); font-size: 20px; font-weight: 850; }
.rank-hub-podium [data-podium-rank="1"] { --medal-light: #ffe496; --medal-dark: #d6a53b; --medal-size: 28px; }
.rank-hub-podium [data-podium-rank="2"] { --medal-light: #f0f3f7; --medal-dark: #aab6c5; }
.rank-hub-podium [data-podium-rank="3"] { --medal-light: #efbc96; --medal-dark: #c4835d; }
.rank-hub-podium .rank-hub-rank-number {
  display: grid; place-items: center; width: var(--medal-size, 24px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--medal-dark); background: linear-gradient(145deg, var(--medal-light), var(--medal-dark));
  box-shadow: inset 0 0 0 2px #fff5; color: #4a4650; font-size: 13px; line-height: 1;
}
.rank-hub-podium [data-podium-rank="1"] .rank-hub-rank-number { font-size: 15px; }
.rank-hub-podium .rank-hub-result-copy { width: 100%; }
.rank-hub-podium .rank-hub-album-copy { justify-content: center; }
.rank-hub-podium .rank-hub-result-value { font-size: 16px; }
.rank-hub-podium [data-podium-rank="1"] .rank-hub-result-value { font-size: 19px; }
.rank-hub-empty { padding: 16px 13px; background: #ffffff09; border: 1px solid #ffffff18; border-radius: 12px; }
@media (max-width: 480px) {
  .rank-hub-rule-popover { width: 132px; }
  #mobile-control-dialog #rank-panel[data-rank-hub] #rank-panel-body { padding: 0 15px 18px; }
  #mobile-control-dialog[data-panel="rank"]:has(#rank-panel[data-rank-hub]) :is(.mobile-panel-brand, #mobile-panel-title) { display: none; }
  body[data-map-theme="night"]:has(#mobile-control-dialog[open].is-open[data-panel="rank"]) #mobile-map-tools button[data-mobile-panel="recommend"] {
    color: var(--night-accent); background: var(--night-active);
  }
}
@media (max-width: 389px) {
  .rank-hub-heading-line { position: relative; }
  .rank-hub-rule { position: static; }
  .rank-hub-rule-popover { top: calc(100% + 2px); left: auto; right: 0; width: min(184px, 100%); transform: none; }
  .rank-hub-rule-popover::before { inset: auto 0 100%; width: auto; height: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .rank-hub-cover { transition: none; }
}
