:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665e;
  --line: #e4dfd5;
  --accent: #8a2c1d;
  --accent-soft: #f6e9e6;
  --head: #f1ede4;
  --gold: #b8901c;
  --silver: #7d848c;
  --bronze: #9a5b2e;
  --up: #2c7a3f;
  --down: #a23a2a;
  --men: #1f5f8b;
  --women: #8a2c1d;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
header { background: var(--surface); border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.logo { font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap; }
.logo-mark { color: var(--accent); margin-right: 6px; }
nav { display: flex; gap: 16px; }
nav a { color: var(--text); padding: 2px 0; border-bottom: 2px solid transparent; }
nav a.active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.search { margin-left: auto; }
.search input {
  font-size: 15px; padding: 6px 10px; width: 200px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 20px; background: var(--bg);
}

main { padding-top: 20px; padding-bottom: 48px; }
h1 { font-size: 26px; margin: 4px 0 6px; line-height: 1.3; }
h2 { font-size: 18px; margin: 36px 0 10px; border-left: 4px solid var(--accent); padding-left: 10px; }
h3 { font-size: 15px; margin: 20px 0 6px; color: var(--muted); }
.note { color: var(--muted); font-size: 13px; margin: 6px 0; }
.lead { color: var(--muted); margin: 0 0 8px; }

/* 操作部品 */
.controls { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
select {
  font-size: 15px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--text); max-width: 100%;
}
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented button {
  font: inherit; font-size: 14px; padding: 6px 16px; border: 0; background: transparent; cursor: pointer; color: var(--text);
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.on { background: var(--accent); color: #fff; }

/* 表 */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: center; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { background: var(--head); font-weight: 600; font-size: 13px; }
tbody tr:hover { background: #fbfaf7; }
td.name, td.left { text-align: left; }
td.num { font-variant-numeric: tabular-nums; }
.rank-badge {
  display: inline-block; min-width: 26px; height: 26px; line-height: 26px; border-radius: 13px;
  font-weight: 700; font-size: 13px;
}
.rank-1 .rank-badge { background: var(--gold); color: #fff; }
.rank-2 .rank-badge { background: var(--silver); color: #fff; }
.rank-3 .rank-badge { background: var(--bronze); color: #fff; }
.bar { display: inline-block; height: 8px; background: var(--accent); border-radius: 4px; vertical-align: middle; margin-left: 8px; opacity: .65; }
.delta { font-size: 12px; margin-left: 4px; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.wins { font-size: 13px; color: var(--muted); white-space: normal; min-width: 160px; }

/* カード */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.card .num { font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1.3; }
.card .label { font-size: 13px; color: var(--muted); }
.card .num.small { font-size: 20px; }

/* トップページの最新大会 */
.latest { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.latest a.card { color: var(--text); display: block; }
.latest a.card:hover { border-color: var(--accent); text-decoration: none; }
.latest .t-name { font-weight: 700; }
.latest .t-date { font-size: 12px; color: var(--muted); }
.latest .winner { margin-top: 6px; font-size: 14px; }
.latest .winner b { color: var(--accent); }

.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 8px; }
.hero h1 { margin-top: 0; }

.chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; height: 280px; }
table.overview { width: auto; min-width: 320px; }
table.overview td { text-align: left; white-space: normal; }
table.overview td:first-child { background: var(--head); font-weight: 600; white-space: nowrap; }

footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 0 32px; border-top: 1px solid var(--line); line-height: 1.8; }

/* スマホ */
@media (max-width: 640px) {
  header { position: static; }
  .header-inner { gap: 6px 16px; padding-top: 8px; padding-bottom: 8px; }
  .logo { font-size: 15px; }
  nav { gap: 12px; font-size: 14px; }
  h1 { font-size: 21px; }
  h2 { margin-top: 28px; }
  .hero { padding: 14px 16px; }
  .hero .lead { font-size: 14px; }
  .latest { grid-template-columns: 1fr 1fr; gap: 8px; }
  .latest .card { padding: 10px 12px; }
  .latest .t-name { font-size: 14px; }
  .latest .winner { font-size: 13px; margin-top: 2px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card .num { font-size: 22px; }
  .card .num.small { font-size: 18px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; font-size: 16px; padding: 5px 10px; }
  .sub { display: none; }
  th, td { padding: 7px 6px; font-size: 13px; }
  .bar { display: none; }
  .chart-box { height: 230px; }
}

/* このサイトについて・プライバシーポリシーなど、文章のページ */
.prose { max-width: 760px; line-height: 1.85; }
.prose p, .prose li { font-size: 15px; }
.prose ul { padding-left: 1.4em; margin: 8px 0; }
.prose li { margin: 4px 0; }
.prose a, footer a { color: var(--accent); }
footer a { margin: 0 6px; white-space: nowrap; }
