/* Lane Grade — 明るい背景のスポーツ統計サイト。
   スコアボード風の数字（細身の欧文）＋読みやすい和文。評価点は全員同じ色、強調は良い出来事だけ。 */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #111a27;
  --ink-2: #445063;
  --ink-3: #5f6b7d;
  --line: #dde3ea;
  --accent: #1d4ed8;
  --accent-soft: #e3ebff;
  --accent-ink: #ffffff;
  --side-blue: #2563eb;
  --side-red: #c2413a;
  --team-1: #2a78d6;
  --team-2: #eb6834;
  --team-3: #1baf7a;
  --team-4: #eda100;
  --ref-bg: #eef1f5;
  --ref-ink: #445063;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-num: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141c; --surface: #171e29; --surface-2: #1c2431; --ink: #eef2f7; --ink-2: #b9c3d1; --ink-3: #9aa6b6;
    --line: #2b3545; --accent: #6b93ff; --accent-soft: #1e2b4a; --accent-ink: #0f141c;
    --side-blue: #6b93ff; --side-red: #ec7a72;
    --team-1: #3987e5; --team-2: #d95926; --team-3: #199e70; --team-4: #c98500;
    --ref-bg: #222b39; --ref-ink: #b9c3d1; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141c; --surface: #171e29; --surface-2: #1c2431; --ink: #eef2f7; --ink-2: #b9c3d1; --ink-3: #9aa6b6;
  --line: #2b3545; --accent: #6b93ff; --accent-soft: #1e2b4a; --accent-ink: #0f141c;
  --side-blue: #6b93ff; --side-red: #ec7a72;
  --team-1: #3987e5; --team-2: #d95926; --team-3: #199e70; --team-4: #c98500;
  --ref-bg: #222b39; --ref-ink: #b9c3d1; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.7; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.3; text-wrap: balance; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ヘッダー */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-block: 8px; }
.logo { font-family: var(--font-num); font-weight: 700; font-size: 26px; letter-spacing: 0.06em; color: var(--ink); text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.logo small { font-family: var(--font-body); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 auto; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 10px 12px; border-radius: 6px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.toggles { display: flex; gap: 6px; }
.tbtn { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 20px; font: inherit; font-size: 13px; cursor: pointer; }
.tbtn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.notice { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.notice .wrap { padding-block: 6px; }

main.wrap { padding-block: 28px 64px; display: flex; flex-direction: column; gap: 36px; }
section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.eyebrow { font-size: 13px; color: var(--ink-3); letter-spacing: 0.04em; }
.lead { font-size: 16px; color: var(--ink-2); max-width: 46em; margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* チーム色の印 */
.tdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0.05em; flex: none; }
.t-DD { background: var(--team-1); } .t-CC { background: var(--team-2); } .t-IT { background: var(--team-3); } .t-LR { background: var(--team-4); }

/* バッジ */
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.badge.mvp { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge.ace { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.badge.best { border-color: var(--accent); color: var(--accent); }
.badge.ref { background: var(--ref-bg); border-color: var(--ref-bg); color: var(--ref-ink); font-weight: 500; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }

/* 表 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); background: var(--surface-2); padding: 10px 12px; white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
td.wrap-ok { white-space: normal; min-width: 14em; }
td.r, th.r { text-align: right; }
td.num, th.num { font-variant-numeric: tabular-nums; }
tr.win td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.big-num { font-family: var(--font-num); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }

/* 評価点 */
.rating-hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 32px; }
.rating-hero .score { font-family: var(--font-num); font-weight: 700; font-size: 84px; line-height: 0.9; font-variant-numeric: tabular-nums; }
.rating-hero .meta { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; font-size: 14px; color: var(--ink-2); }
.score-sm { font-family: var(--font-num); font-weight: 700; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }

/* 内訳バー */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 200px) 1fr 44px; align-items: center; gap: 6px 14px; }
.bar-label { display: flex; flex-direction: column; line-height: 1.35; }
.bar-label b { font-size: 14px; }
.bar-label span { font-size: 12px; color: var(--ink-3); }
.bar-track { position: relative; height: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.bar-fill { position: absolute; left: 0; top: -1px; bottom: -1px; background: var(--accent); border-radius: 6px; }
.bar-mid { position: absolute; left: 50%; top: -5px; bottom: -5px; border-left: 2px solid var(--ink-2); }
.bar-val { text-align: right; font-family: var(--font-num); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.bar-na { grid-column: 2 / 4; font-size: 13px; color: var(--ink-3); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr 44px; } .bar-label { grid-column: 1 / 3; } .bar-na { grid-column: 1 / 3; } }

/* 直近の試合カード（横スクロール） */
.scroller { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.gcard { flex: 0 0 210px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.gcard:hover { border-color: var(--accent); }
.gcard .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink-2); }

/* 試合カード */
.mcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.mcard:hover { border-color: var(--accent); }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.vs .team { display: flex; align-items: center; font-weight: 700; min-width: 0; }
.vs .team.right { justify-content: flex-end; text-align: right; }
.vs .mid { font-size: 13px; color: var(--ink-3); text-align: center; }
.result-pill { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); margin-left: 6px; }

/* 試合ページの左右比較 */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 16px; align-items: center; }
.duel .l { text-align: right; } .duel .c { text-align: center; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.duel .v { font-family: var(--font-num); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.side-blue { color: var(--side-blue); } .side-red { color: var(--side-red); }
.draft { display: flex; flex-wrap: wrap; gap: 6px; }
.draft .chip.ban { text-decoration: line-through; color: var(--ink-3); }
.draft .chip.prot { border-style: dashed; }

/* 詳しく見る */
details.more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.more > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; min-height: 44px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "＋"; color: var(--accent); }
details.more[open] > summary::before { content: "－"; }
details.more > .inner { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
details.more .tbl-wrap { border-radius: 6px; }

/* 用語のツールチップ */
.term { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; color: var(--ink-3); cursor: help; margin-left: 4px; background: var(--surface); }
.term .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; padding: 8px 10px; background: var(--ink); color: var(--surface); font-size: 12px; line-height: 1.5; border-radius: 6px; z-index: 20; white-space: normal; text-align: left; font-weight: 400; }
.term:hover .tip, .term:focus .tip { display: block; }

/* 切り替えボタン（階級・ロール） */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 20px; font: inherit; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 700; }

/* ネタバレ防止 */
:root[data-spoil="on"] .sp:not(.shown) { filter: blur(7px); cursor: pointer; user-select: none; }
:root[data-spoil="on"] .sp-hide:not(.shown) { visibility: hidden; }

/* グラフ */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font-family: var(--font-body); font-size: 12px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .ref-line { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }

/* フッター */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-3); }
.site-footer .wrap { padding-block: 24px 32px; display: flex; flex-direction: column; gap: 8px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer a { color: var(--ink-2); }

.empty { padding: 28px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 14px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-size: 12px; color: var(--ink-3); }
.kv .v { font-family: var(--font-num); font-weight: 700; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kv .s { font-size: 12px; color: var(--ink-3); }
.prose { max-width: 46em; display: flex; flex-direction: column; gap: 12px; }
.prose p { margin: 0; }
.prose ul { margin: 0; padding-left: 1.3em; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
