/* 記録ランキングページ（taikai.css の上に重ねる） */
:root { --navy-line: #3d5a99; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --navy-line: #8fa6d1; } }
:root[data-theme="dark"] { --navy-line: #8fa6d1; }

.how ol { margin: 10px 0 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; color: var(--on-navy-muted); }
.how ol b { color: var(--on-navy); }

.rank-filters { gap: 10px; }
.frow { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: start; }
.flabel { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 6px; }
@media (max-width: 560px) { .frow { grid-template-columns: 1fr; gap: 4px; } .flabel { padding-top: 0; } }

.rank-head { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 10px; flex-wrap: wrap; }
.rank-head h3 { font-size: 20px; font-weight: 900; }
.rank-head .count { font-size: 13px; color: var(--muted); }

.rank-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.rank td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rank tr:last-child td { border-bottom: 0; }
.rank tr.mine td { background: color-mix(in srgb, var(--red) 6%, var(--surface)); }
.rank td.num, .rank .num { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 600; }
.rank td.pos { width: 52px; font-size: 16px; color: var(--muted); }
.rank td small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; font-family: var(--f-display); }
.rank td.best { font-size: 20px; color: var(--ink); white-space: nowrap; }
.rank td.best small { display: inline; margin-left: 6px; font-family: var(--f-num); font-size: 12px; }
.rank a.who { font-weight: 700; text-decoration: none; }
.rank a.who:hover { color: var(--red); text-decoration: underline; }
.rank td.when a { font-family: var(--f-num); font-weight: 600; color: var(--ink); }
.rank .empty { text-align: center; color: var(--muted); padding: 28px; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #1b1608; font-size: 15px; }
.medal.m1 { background: #f3d23a; } .medal.m2 { background: #cfd4dc; } .medal.m3 { background: #d9a273; }
.spark { color: var(--navy-line); display: block; }
@media (max-width: 760px) { .hide-sm { display: none; } }
@media (max-width: 420px) { .hide-xs { display: none; } .rank td, .rank th { padding: 9px 8px; } }

.athlete { background: var(--surface); }
.a-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.a-head .lbl { font-family: var(--f-num); font-weight: 600; letter-spacing: .2em; font-size: 12px; color: var(--red); text-transform: uppercase; }
.a-head h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 900; }
.a-meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.athlete h3 { font-size: 17px; font-weight: 700; margin: 30px 0 12px; }
.close { font: inherit; font-size: 14px; font-weight: 700; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.pbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pb { background: var(--bg); border-radius: 8px; padding: 12px 14px; display: grid; gap: 2px; border-left: 4px solid var(--red); }
.pb .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.pb b { font-size: 30px; line-height: 1.1; }
.pb small { font-size: 12px; color: var(--muted); font-family: var(--f-num); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-bottom: 8px; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-wrap { overflow-x: auto; background: var(--bg); border-radius: 8px; padding: 8px; }
svg.chart { width: 100%; min-width: 420px; height: auto; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--f-num); }
.alist td small { font-size: 11px; }

.about-data { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--muted); font-size: 14px; max-width: 52em; }
.about-data a { color: var(--red); }

.hero .source { margin-top: 10px; font-size: 13px; color: var(--gold); font-weight: 700; }
.junior-lock { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 8px; }
.jl-title { font-weight: 700; font-size: 16px; }
.jl-note { font-size: 13px; color: var(--muted); }
.jl-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.jl-form input { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-width: 0; flex: 1 1 200px; max-width: 320px; }
.jl-err { color: var(--red); font-weight: 700; font-size: 14px; }
.junior-on { margin-top: 14px; font-size: 13px; color: var(--ok-ink); background: var(--ok-bg); display: inline-block; padding: 4px 12px; border-radius: 99px; }
.linkish { font: inherit; font-weight: 700; color: var(--red); background: none; border: 0; padding: 0 0 0 8px; cursor: pointer; text-decoration: underline; }

/* 行全体を押せるように */
.rank tbody tr[data-a] { cursor: pointer; transition: background .12s; }
.rank tbody tr[data-a]:hover td, .rank tbody tr[data-a]:focus-visible td { background: color-mix(in srgb, var(--navy-line) 9%, var(--surface)); }
.rank tbody tr[data-a]:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
/* 直近12か月に記録がない選手 */
.rank tr.stale td { color: var(--muted); }
.rank tr.stale td.best, .rank tr.stale a.who { color: var(--muted); }
.rank tr.stale .spark { opacity: .45; }
.rank tr.stale .medal { filter: grayscale(.7); opacity: .7; }
.stale-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px dashed var(--muted); border-radius: 4px; padding: 0 6px; vertical-align: 1px; white-space: nowrap; }
.legend-stale { display: flex; align-items: center; gap: 8px; }
.stale-sample { display: inline-block; width: 28px; height: 14px; border-radius: 3px; border: 1px dashed var(--muted); background: var(--bg); flex-shrink: 0; }
