:root {
  --navy: #182a57;
  --navy-2: #24366f;
  --cream: #f3f4f6;   /* ページ背景：薄いグレー */
  --paper: #ffffff;   /* カード：白 */
  --ink: #1d2433;
  --muted: #6b7385;
  --line: #e3e6eb;
  --gold: #c9971c;
  --izumo: #2a78d6;
  --zennihon: #eb6834;
  --hakone: #1baf7a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  line-height: 1.7; font-size: 16px;
}
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* header / footer */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: .02em; }
.brand img { border-radius: 50%; background: var(--navy-2); object-fit: cover; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #dfe5f5; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.site-footer { background: var(--navy); color: #dfe5f5; margin-top: 48px; padding: 24px 0; font-size: 14px; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer .muted { color: #aab4cf; }
.footer-inner { display: flex; gap: 16px; align-items: center; }
.footer-chara { width: 52px; height: auto; }
.footer-inner p { margin: 2px 0; }

/* blocks */
main.wrap { padding-top: 32px; }
h1 { font-size: 28px; margin: 8px 0 16px; line-height: 1.35; }
h1 .sub, h2 .sub { font-size: .6em; color: var(--muted); font-weight: 500; margin-left: 6px; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; color: var(--navy-2); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 20px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.pager { display: flex; gap: 16px; margin: -8px 0 16px; }

/* hero */
.hero { display: flex; align-items: center; gap: 28px; background: var(--navy); color: #fff; border-radius: 22px; padding: 28px 32px; margin-bottom: 24px; }
.hero-img { width: 190px; height: auto; flex: none; margin: -8px 0 -18px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.25)); }
.hero h1 { font-size: 32px; margin: 0 0 10px; }
.hero p { margin: 0; color: #dfe5f5; }

/* search */
#q { width: 100%; font-size: 17px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
#q:focus { outline: none; border-color: var(--navy-2); }
.results { list-style: none; padding: 0; margin: 10px 0 0; max-height: 420px; overflow: auto; }
.results li a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink); }
.results li a:hover { background: var(--cream); text-decoration: none; }
.results .meta { color: var(--muted); font-size: 13px; text-align: right; }

/* tiles */
.race-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; padding: 16px 18px; border-radius: 12px; color: #fff; }
.tile:hover { text-decoration: none; filter: brightness(1.06); }
.tile-izumo { background: var(--izumo); } .tile-zennihon { background: var(--zennihon); } .tile-hakone { background: var(--hakone); }
.tile-label { font-weight: 700; font-size: 18px; }
.tile-year { opacity: .9; }

/* profile */
.profile { margin-bottom: 20px; }
.profile h1 { margin-bottom: 4px; }
.profile-meta { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { background: var(--navy); color: #fff; border-radius: 999px; font-size: 13px; padding: 2px 10px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; }
.stats div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 26px; font-weight: 700; }
.stats small { font-size: 13px; font-weight: 500; margin-left: 2px; }

/* episode */
.episode { border-left: 6px solid var(--gold); }
.episode-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.episode-head img { border-radius: 50%; background: var(--navy); }
.episode-head h2 { margin: 0; }
.episode p { margin: 6px 0; }

/* tables */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.data thead th { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); }
table.data tbody tr:hover { background: #f6f7f9; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.win { color: var(--gold); font-weight: 700; }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: #eceef2; color: var(--muted); }
.tag-rec { background: #fbe9c4; color: #8a5a00; }

/* lists */
.name-grid, .year-grid, .link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px 14px; }
.name-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.year-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.race-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.race-head { padding-left: 10px; border-left: 6px solid; }
.race-izumo { border-color: var(--izumo); } .race-zennihon { border-color: var(--zennihon); } .race-hakone { border-color: var(--hakone); }

.about-img { float: right; width: 120px; height: auto; margin: 0 0 12px 16px; }

@media (max-width: 640px) {
  h1 { font-size: 23px; }
  .hero { flex-direction: column; text-align: center; padding: 22px 16px; gap: 10px; }
  .hero h1 { font-size: 24px; }
  .hero-img { width: 150px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; }
  .brand span { font-size: 15px; }
  .about-img { width: 80px; }
  .card-chara-img { display: none; }
  .page-head img { width: 64px; }
}

/* 実業団 */
.corp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.corp-list li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-weight: 600; }
.star { margin-right: 4px; }

/* グラフ */
.lead { margin: -6px 0 16px; color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.chart-card img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* 注意書き */
.disclaimer { background: #fff6dc; border: 1px solid #f0d58a; border-radius: 10px; padding: 12px 16px; margin: 14px 0 6px; }
.disclaimer p { margin: 4px 0; }

/* キャラクターの差し込み */
.card { position: relative; }
.card-chara { padding-right: 150px; }
.card-chara-img { position: absolute; right: 18px; bottom: 10px; width: 110px; height: auto; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.page-head img { width: 88px; height: auto; flex: none; }
.page-head h1 { margin: 0; }
.page-head .lead { margin: 4px 0 0; }
@media (max-width: 640px) { .card-chara { padding-right: 16px; } }

/* 同期・他大学 */
h2.mt { margin-top: 22px; }
.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.people a { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); height: 100%; }
.people a:hover { border-color: var(--navy-2); text-decoration: none; background: #f8f9fb; }
.p-name { font-weight: 700; }
.p-team { font-size: 13px; color: var(--navy-2); }
.p-meta { font-size: 12px; color: var(--muted); }

/* 選手一覧 */
.list-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
#filter { flex: 1 1 240px; font-size: 15px; padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; }
#filter:focus { outline: none; border-color: var(--navy-2); }
.sorter { display: flex; flex-wrap: wrap; gap: 6px; }
.sorter button { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; }
.sorter button:hover { border-color: var(--navy-2); }
.sorter button.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* 駅伝ポイントの説明モーダル */
.list-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 6px; min-height: 22px; }
.linkish { font: inherit; font-size: 13px; color: var(--navy-2); background: none; border: 0; padding: 2px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; margin-left: auto; }
.linkish:hover { color: var(--navy); }
.modal { border: 0; border-radius: 16px; padding: 22px 24px 18px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; color: var(--ink); box-shadow: 0 20px 50px rgba(15, 25, 55, .25); }
.modal::backdrop { background: rgba(15, 25, 55, .45); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.modal-head img { width: 44px; height: auto; }
.modal-head h2 { margin: 0; }
.modal p { margin: 8px 0 12px; }
.pt-table { white-space: normal; margin-bottom: 10px; }
.pt-notes { margin: 0 0 14px; padding-left: 1.2em; font-size: 14px; }
.pt-notes li { margin: 3px 0; }
.modal-close { font: inherit; font-size: 14px; display: block; margin: 0 0 0 auto; padding: 8px 18px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; cursor: pointer; }

.above-card { display: flex; justify-content: flex-end; margin: -6px 2px 6px; }
.sorter .dir { font-size: 10px; }
.corp-role { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--cream); border-radius: 4px; padding: 1px 6px; vertical-align: 1px; }
