:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef0eb;
  --border: #dfe2db;
  --grid: #e7e8e3;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #74746e;
  --accent: #1c7f00;          /* 文字に使う緑（明るい背景でも読める段） */
  --brand: #53fc18;           /* Kick の緑。面にだけ使う */
  --series-1: #2a78d6;
  --live: #d93a3a;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0e0f;
    --surface: #16181a;
    --surface-2: #1e2123;
    --border: #2a2e31;
    --grid: #262a2d;
    --text: #f3f3f1;
    --text-2: #c3c2b7;
    --muted: #8d8d86;
    --accent: #53fc18;
    --series-1: #3987e5;
    --live: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0e0f; --surface: #16181a; --surface-2: #1e2123; --border: #2a2e31; --grid: #262a2d;
  --text: #f3f3f1; --text-2: #c3c2b7; --muted: #8d8d86; --accent: #53fc18; --series-1: #3987e5; --live: #e66767;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

header.site { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 12px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -.02em; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: #000; font-size: 17px; font-weight: 900; }
.tag { color: var(--text-2); font-size: 13px; }
.updated { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) { .tag { display: none; } }

main { padding-top: 20px; padding-bottom: 24px; }
.loading, .empty { color: var(--muted); padding: 40px 0; text-align: center; }
.error { color: var(--live); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .tiles, .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.tile .label { color: var(--text-2); font-size: 12px; }
.tile .value { font-size: 26px; font-weight: 650; line-height: 1.25; }
.tile .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 2px; }
.card .note { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: .1; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 4px 16px rgb(0 0 0 / .18); white-space: nowrap; }
.tip b { font-size: 14px; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px var(--border); margin: 8px 0 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { appearance: none; border: 0; background: none; color: var(--text-2); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.tabs button:focus-visible, th button:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -16px -14px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
th button { appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
th[aria-sort] button::after { content: " ▼"; font-size: 9px; }
th[aria-sort="ascending"] button::after { content: " ▲"; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.rank { color: var(--muted); width: 1%; text-align: right; }
tbody tr:hover { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--series-1); }

.who { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 460px; text-decoration: none; }
.who img, .who .ph { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--surface-2); object-fit: cover; }
.who .names { min-width: 0; }
.who .name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.who .name:hover { text-decoration: underline; }
.who .title { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
@media (max-width: 560px) { .who .title { max-width: 180px; } }
.live-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: var(--live); letter-spacing: .04em; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }
.cat { color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 700px) { .hide-sm { display: none; } }

.ch-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.ch-head img { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); }
.ch-head h1 { font-size: 22px; margin: 0; line-height: 1.3; }
.ch-head .links { font-size: 13px; color: var(--text-2); }
.ch-head .links a { color: var(--accent); }
.back { display: inline-block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; text-decoration: none; }
.back:hover { text-decoration: underline; }

.site-foot { color: var(--muted); font-size: 12px; padding-bottom: 32px; }
.site-foot p { margin: 4px 0; }

.chips { display: flex; align-items: center; gap: 6px; padding: 10px 0 8px; flex-wrap: wrap; }
.chips > span { color: var(--muted); font-size: 12px; margin-right: 2px; }
.chips button { appearance: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.chips button[aria-pressed="true"] { color: var(--text); border-color: var(--text-2); background: var(--surface-2); }
.chips button:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.chips + div > .table-wrap { border-top: 1px solid var(--border); border-radius: var(--radius); }
.sub-h { font-size: 13px; margin: 14px 0 4px; color: var(--text-2); }
