/* みんなのランキング（ranking.html）だけの見た目。共通の部品は style.css */
.nav-links { display: flex; gap: 18px; font-size: 13px; white-space: nowrap; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--navy); }
.nav-links a[aria-current] { color: var(--navy); font-weight: 600; }

.rk-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; margin: 8px 0 16px; }
.rk-title { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-feature-settings: "palt"; }
.rk-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.period { width: min(420px, 100%); }
.period-detail { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; font-size: 14px; font-weight: 600; }
.period-detail button { border: 0; background: var(--sky-50); color: var(--blue-deep); width: 30px; height: 30px; border-radius: 50%; font-weight: 700; }
.period-detail button:disabled { opacity: 0.35; cursor: default; }
.period-note { margin: 4px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.period-detail select { max-width: 100%; border: 0; border-radius: 10px; padding: 6px 10px; background: var(--sky-50); font: inherit; color: var(--navy); }

.rk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.rk-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 16px; }
.rk-filters .scroller { flex: 1 1 320px; min-width: 0; }

.podium .top-card .rating { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--blue-deep); font-variant-numeric: tabular-nums; }

.rk-list { margin: 16px 0 0; padding: 6px 0; list-style: none; background: var(--white); border-radius: 20px; box-shadow: var(--panel-shadow); }
.rk-row { border-bottom: 1px solid var(--line); }
.rk-row:last-child { border-bottom: 0; }
.rk-row > button { width: 100%; display: grid; grid-template-columns: 2.4em 3.6em 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; padding: 8px 18px; background: none; color: inherit; font: inherit; text-align: left; }
.rk-row > button:hover { background: var(--sky-50); }
.rk-list.no-change .rk-row > button { grid-template-columns: 2.4em 40px minmax(0, 1fr) auto; }
.rk-list.no-change .rk-detail { padding-left: calc(18px + 2.4em + 10px); }
.rk-rank { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-row .portrait.icon { width: 40px; height: 40px; }
.rk-name { min-width: 0; display: flex; flex-direction: column; }
.rk-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-name small { color: var(--muted); font-size: 12px; }
.rk-score { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.rk-score strong { display: block; font-size: 16px; }
.rk-score small { color: var(--muted); font-size: 11px; }
.rk-row.low > button, .top-card.low { opacity: 0.6; }
.tentative { margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 600; background: #edf1f5; color: var(--muted); vertical-align: middle; }
.bar-track { display: block; height: 4px; margin-top: 4px; border-radius: 999px; background: var(--sky-50); overflow: hidden; }
.bar-track > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sky-400), var(--blue)); }
.rk-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; padding: 4px 18px 16px calc(18px + 2.4em + 3.6em + 20px); font-size: 13px; }
.rk-detail h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.rk-detail ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.rk-detail li { display: flex; align-items: center; gap: 8px; }
.rk-detail .portrait.icon { flex: none; width: 24px; height: 24px; }
.rk-detail .vs-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-detail .pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.rk-detail .none { margin: 0; color: var(--muted); }
.more { display: block; margin: 12px auto 0; }
.rk-updated { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

.side { position: sticky; top: 76px; display: grid; gap: 14px; }
.side .panel h3 { margin: 0 0 10px; font-size: 15px; }
.side p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.side p + p { margin-top: 8px; }
.vs ul { margin: 0; padding: 0; list-style: none; }
.vs li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; }
.vs .portrait.icon { width: 32px; height: 32px; }
.vs small { display: block; color: var(--muted); font-size: 12px; }
.vs .theirs { font-weight: 700; color: var(--blue-deep); white-space: nowrap; }
.vs .vs-note { margin-top: 6px; font-size: 11px; }

.rk-empty { max-width: 560px; margin: 24px auto; text-align: center; }
.rk-empty p { margin: 0 0 8px; }
.rk-empty .btn { display: inline-block; margin-top: 8px; text-decoration: none; }

@media (max-width: 860px) {
  .rk-layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 640px) {
  .rk-title { font-size: 26px; }
  .nav-links { gap: 12px; font-size: 12px; }
  .nav-links a:first-child { display: none; } /* 狭い画面ではタイトルがキャラソートへのリンク */
  .rk-row > button { grid-template-columns: 2em 3.2em 34px minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
  .rk-row .portrait.icon { width: 34px; height: 34px; }
  .rk-list.no-change .rk-row > button { grid-template-columns: 2em 34px minmax(0, 1fr) auto; }
  .rk-list.no-change .rk-detail { padding-left: 14px; }
  .rk-score { min-width: 52px; }
  .rk-detail { grid-template-columns: 1fr; padding: 4px 14px 14px; }
}
