:root { color-scheme: dark; --background: #10151c; --panel: #19212b; --line: #34404e; --text: #eef2f6; --muted: #b0bdca; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 16px/1.5 system-ui, sans-serif; }
main { max-width: 1600px; margin: auto; padding: 32px clamp(12px, 3vw, 48px); }
h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 12px; line-height: 1.2; }
.eyebrow { color: #8ddbc3; font-size: 12px; letter-spacing: .16em; font-weight: 700; }
.summary { color: var(--muted); }
.summary strong { color: var(--text); font-size: 22px; padding-inline: 5px; }
.summary > span { padding: 0 12px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 28px 0; }
.filters label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
input, select, button { font: inherit; border: 1px solid #65778b; border-radius: 6px; padding: 9px 12px; background: #101923; color: var(--text); min-height: 44px; max-width: 100%; }
button { background: #8ddbc3; color: #10241f; border-color: #8ddbc3; cursor: pointer; font-weight: 650; }
a { color: #a7d9ff; }
.filters a { padding-bottom: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.legend > span { margin-left: 12px; font-size: 22px; font-weight: 700; }
.legend > span:first-child { margin-left: 0; }
.note { color: var(--muted); font-size: 14px; max-width: 1000px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 24px; }
.table-shell { position: relative; --player-column-width: 180px; }
/* Keep the vertical sticky layer outside the horizontal scroll container. */
.sticky-heading { position: sticky; top: 0; height: 0; z-index: 4; }
.sticky-heading-clip { overflow: hidden; border-inline: 1px solid var(--line); box-shadow: 0 3px 8px #0006; }
.sticky-heading table { will-change: transform; }
.sticky-heading .nickname { position: relative; left: auto; z-index: 5; }
.back-to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 6; box-shadow: 0 4px 16px #0007; }
table { border-collapse: separate; border-spacing: 0; width: max-content; background: var(--panel); }
caption { text-align: left; padding: 12px 16px; font-size: 14px; color: var(--muted); background: var(--background); }
th, td { height: 40px; padding: 4px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:not(.nickname), td { min-width: 52px; }
.table-scroll th:not(.nickname), .table-scroll tbody td:not([colspan]), .table-scroll tfoot td { width: 52px; min-width: 52px; max-width: 52px; padding-inline: 4px; }
.event-day, .event-year { display: block; text-align: center; line-height: 15px; }
.event-day { font-size: 13px; }
.event-year { font-size: 10px; font-weight: 400; color: var(--muted); }
thead th, tfoot th, tfoot td { background: #25303d; font-size: 14px; }
.nickname { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--panel); border-right: 1px solid var(--line); width: var(--player-column-width); min-width: var(--player-column-width); max-width: var(--player-column-width); }
thead .nickname, tfoot .nickname { z-index: 2; background: #25303d; }
.player { display: flex; gap: 12px; align-items: center; width: calc(var(--player-column-width) - 21px); }
.identity { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1; }
.player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 14px; }
.player img { object-fit: contain; flex-shrink: 0; }
tbody td.present, tbody td.absent, tbody td.outside { font-size: 20px; font-weight: 700; line-height: 1; }
.present { color: #8de0b1; }
.absent { color: #ffa5a5; }
.outside { color: var(--muted); }
.percentage { flex: 0 0 62px; text-align: right; font-size: 13px; line-height: 15px; font-variant-numeric: tabular-nums; font-weight: 650; }
.percentage small { display: block; color: var(--muted); font-size: 11px; line-height: 13px; font-weight: 400; }
.empty { padding: 16px; background: var(--panel); border-radius: 8px; }
.errorlist { color: #ffa5a5; padding-left: 20px; max-width: 260px; }
:focus-visible { outline: 3px solid #a7d9ff; outline-offset: 3px; }
@media (max-width: 600px) {
    main { padding-top: 20px; }
    .filters { padding: 14px; gap: 12px; }
    .filters > div { width: 100%; }
    .filters input, .filters select { width: 100%; }
    .player { gap: 8px; }
    .identity { gap: 6px; }
    thead th { font-size: 12px; }
}
