/* =========================================================================
   Japan Football Data — Design System
   ダーク基調 + ピッチグリーン。静的HTMLだけでも成立し、React が乗ると
   アニメーションが加わる（プログレッシブ・エンハンスメント）前提の設計。
   ========================================================================= */

:root {
  --bg: #0f1a15;
  --bg-deep: #09100d;
  --surface: #16221c;
  --surface-card: #1d2c24;
  --surface-hi: #223428;
  --pitch: #1f6b4a;
  --pitch-light: #2a8c62;
  --pitch-glow: #3fd68f;
  --accent: #c8102e;
  --accent-light: #e62242;
  --amber: #f5b301;
  --muted: #7fae95;
  --text: #eef3ef;
  --text-dim: #b6c9bf;
  --line: #273c31;
  --line-soft: rgba(39, 60, 49, 0.55);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  --shadow-hi: 0 28px 60px -28px rgba(0, 0, 0, 0.95);

  --font-sans: "Zen Kaku Gothic New", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Zen Kaku Gothic New", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --max-w: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% -10%, rgba(42, 140, 98, 0.22) 0%, transparent 60%),
    radial-gradient(circle at 90% 10%, rgba(200, 16, 46, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--pitch-glow); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

.font-display { font-family: var(--font-display); letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }
.shell { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.stack { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(9, 16, 13, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.4s var(--ease-out), background 0.4s var(--ease-out);
}
.site-header.is-scrolled { box-shadow: 0 10px 30px -18px #000; background: rgba(9, 16, 13, 0.95); }

.header-inner {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--pitch-light), var(--pitch));
  border: 1px solid rgba(63, 214, 143, 0.35);
  font-family: var(--font-display);
  font-weight: 700; font-size: 14px; color: #fff;
  box-shadow: 0 0 0 0 rgba(63, 214, 143, 0.4);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); box-shadow: 0 0 24px -4px rgba(63, 214, 143, 0.55); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; }
.brand-sub { font-size: 10.5px; color: var(--muted); margin-top: -3px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 12.5px; font-weight: 500;
  color: var(--muted);
  transition: color 0.25s, background 0.25s;
}
.nav a:hover { color: #fff; background: rgba(42, 140, 98, 0.12); }
.nav a.is-active { color: #fff; background: var(--surface-card); border: 1px solid rgba(42, 140, 98, 0.4); }
.nav a::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--pitch-glow);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.nav a:hover::after { transform: scaleX(1); }

.nav-toggle { display: none; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }

/* ------------------------------------------------------------ Dummy note */
.dummy-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1px dashed rgba(245, 179, 1, 0.45);
  background: rgba(245, 179, 1, 0.07);
  color: var(--amber);
  font-size: 12px;
}
.dummy-banner strong { color: #ffd257; }
.dummy-banner span { color: var(--text-dim); }

/* ------------------------------------------------------------------ Main */
main { flex: 1; padding: 26px 0 60px; }
.page { display: flex; flex-direction: column; gap: 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-size: 20px; color: #fff; }
.section-head p { font-size: 12px; color: var(--muted); }
.link-more { font-family: var(--font-mono); font-size: 12px; color: var(--pitch-glow); }
.link-more:hover { text-decoration: underline; }

.crumbs { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: #fff; }
.crumbs .current { color: var(--pitch-glow); }

/* ------------------------------------------------------------------ Hero */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-card) 100%);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute; inset: -60% -20% auto -20%; height: 220%;
  background: conic-gradient(from 210deg at 50% 50%, transparent 0deg, rgba(42, 140, 98, 0.22) 90deg, transparent 200deg);
  animation: sweep 14s linear infinite;
  pointer-events: none;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.hero-inner { position: relative; z-index: 1; max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(26px, 4.4vw, 42px); color: #fff; }
.hero h1 em { font-style: normal; color: var(--pitch-glow); }
.hero p { font-size: 13.5px; color: var(--text-dim); max-width: 34em; }
.hero-badge {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid rgba(42, 140, 98, 0.45); background: rgba(31, 107, 74, 0.2);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--pitch-glow); text-transform: uppercase;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pitch-glow); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.72); } }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px;
  font-size: 13px; font-weight: 700;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pitch-light), var(--pitch));
  color: #fff; border: 1px solid rgba(63, 214, 143, 0.4);
  box-shadow: 0 12px 30px -16px rgba(42, 140, 98, 0.9);
}
.btn-primary:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 18px 38px -16px rgba(42, 140, 98, 1); }
.btn-ghost { background: var(--surface-card); border: 1px solid var(--line); color: var(--text-dim); }
.btn-ghost:hover { transform: translateY(-2px); color: #fff; border-color: var(--pitch); }

/* ピッチ装飾 (SVG) */
.hero-pitch { position: absolute; right: -40px; top: 50%; transform: translateY(-50%); width: 340px; opacity: 0.32; pointer-events: none; }
.hero-pitch .ball { animation: roam 9s ease-in-out infinite; }
@keyframes roam {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(38px, -26px); }
  50% { transform: translate(-30px, 22px); }
  75% { transform: translate(24px, 30px); }
}

/* ------------------------------------------------------------------ Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.35s var(--ease-out), border-color 0.35s, box-shadow 0.35s var(--ease-out);
}
.card.is-link:hover { transform: translateY(-4px); border-color: var(--pitch); box-shadow: var(--shadow-hi); }

/* 数値タイル */
.tile { display: flex; flex-direction: column; gap: 2px; }
.tile .val { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--pitch-glow); line-height: 1.15; }
.tile .val.is-amber { color: var(--amber); }
.tile .val.is-white { color: #fff; }
.tile .lbl { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------- Player cards */
.player-card { display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.player-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(42, 140, 98, 0.16), transparent 55%);
  opacity: 0; transition: opacity 0.4s;
  pointer-events: none;
}
.player-card.is-link:hover::after { opacity: 1; }
.pc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pc-name { font-size: 19px; font-weight: 700; color: #fff; transition: color 0.3s; }
.player-card.is-link:hover .pc-name { color: var(--pitch-glow); }
.pc-en { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.pc-club { font-size: 12px; color: var(--text-dim); text-align: right; }
.pc-league { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.romaji-note {
  display: inline-block; margin-left: 6px;
  padding: 0 6px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 9.5px; line-height: 1.7;
  background: rgba(245, 179, 1, 0.12); color: var(--amber);
  border: 1px solid rgba(245, 179, 1, 0.3);
  cursor: help;
}

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 7px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  background: rgba(31, 107, 74, 0.22); color: var(--pitch-glow);
  border: 1px solid rgba(42, 140, 98, 0.35);
}
.tag.is-amber { background: rgba(245, 179, 1, 0.14); color: var(--amber); border-color: rgba(245, 179, 1, 0.3); }
.tag.is-neutral { background: rgba(127, 174, 149, 0.1); color: var(--text-dim); border-color: var(--line); }

.statline {
  /* 列数はセル幅から決める。固定列数をインラインで指定すると、
     メディアクエリで上書きできず狭い画面で数字が重なる。 */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 6px; text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-family: var(--font-mono);
}
.statline .k { font-size: 10px; color: var(--muted); display: block; }
.statline .v { font-size: 13.5px; font-weight: 700; color: #fff; }
/* 注目選手カードの大きい数値。狭い画面では縮める */
.statline .v.v-lg { font-size: 22px; }
.statline .k { overflow-wrap: anywhere; }

/* 注目選手カード。狭い画面では1カラムに落とす */
.pickup-card {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 22px; align-items: center; padding: 24px;
}
@media (max-width: 720px) {
  .pickup-card { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
}
@media (max-width: 420px) {
  .statline { grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); }
  .statline .v.v-lg { font-size: 18px; }
}
.statline .v.green { color: var(--pitch-glow); }
.statline .v.amber { color: var(--amber); }

.pc-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 11px; border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--pitch-glow);
}

/* ----------------------------------------------------------- Player page */
.player-hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.player-hero::before {
  content: ""; position: absolute; right: -10%; top: -60%;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 140, 98, 0.2), transparent 65%);
  pointer-events: none;
}
.ph-main { position: relative; display: flex; flex-direction: column; gap: 10px; }
.ph-main h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 40px); color: #fff; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.ph-rating {
  position: relative;
  min-width: 168px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: right;
}
.ph-rating .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.ph-rating .val { font-family: var(--font-display); font-size: 40px; font-weight: 700; color: var(--amber); line-height: 1.1; }
.ph-rating .sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  overflow-x: auto;
  /* 横スクロールできることが分かるよう、右端に影を出す。
     スクロールしきると消える（background-attachment: local を併用） */
  background:
    linear-gradient(to right, var(--bg) 30%, rgba(0,0,0,0)) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, rgba(0,0,0,0)) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.45), rgba(0,0,0,0)) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.45), rgba(0,0,0,0)) right / 14px 100% no-repeat scroll;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 16px;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s;
}
.tab:hover { color: var(--text); }
/* 狭い画面ではタブを詰めて、横スクロールの量を減らす */
@media (max-width: 420px) {
  .tabs .tab { padding: 10px 11px; font-size: 11.5px; }
}
.tab.is-active { color: var(--pitch-glow); border-bottom-color: var(--pitch); }

/* 比較マップの内側タブ（軸の組み合わせ）。
   外側のポジションタブと同じ見た目だと、どちらが上位の選択なのか
   分からなくなるため、一段弱いピル型にして区別する。 */
.tabs-sub {
  /* ピル型なので、横スクロールを示す端の影は要らない */
  background: none;
  border-bottom: 0; gap: 6px; margin-top: 10px; padding-bottom: 2px;
}
.tabs-sub .tab {
  padding: 6px 13px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line-soft); border-radius: 999px;
}
.tabs-sub .tab.is-active {
  color: #06130d; background: var(--pitch-glow); border-color: var(--pitch-glow);
}
@media (max-width: 420px) {
  .tabs-sub .tab { padding: 6px 10px; font-size: 11px; }
}

/* 画面が狭いときは、ポジション名を FW / MF / DF に縮める。
   3つとも画面に収まらないと、横スクロールに気づかない限り
   最後のポジションが選べないため。 */
.tab-short { display: none; }
@media (max-width: 460px) {
  .tab-long { display: none; }
  .tab-short { display: inline; }
}
/* 区分が5つあるので、320px 幅でも略号5つが収まるよう詰める */
@media (max-width: 360px) {
  .tabs .tab { padding: 10px 8px; }
}

/* メトリクスバー */
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; }
@media (max-width: 680px) { .metric-grid { grid-template-columns: 1fr; } }
.metric { display: flex; flex-direction: column; gap: 6px; }
.metric-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; }
.metric-row span { color: var(--text-dim); }
.metric-row b { color: var(--pitch-glow); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-card); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--pitch), var(--pitch-glow));
  width: 0;
  transition: width 1.1s var(--ease-out);
}
.bar > i.is-amber { background: linear-gradient(90deg, #b57f00, var(--amber)); }
.bar > i.is-accent { background: linear-gradient(90deg, #7d0a1d, var(--accent-light)); }

/* 試合ログ */
.matchlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.matchlist-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; background: var(--surface-card); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: #fff;
}
.matchlist-head span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.match-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.25s, padding-left 0.3s var(--ease-out);
}
.match-row:last-child { border-bottom: none; }
.match-row:hover { background: rgba(29, 44, 36, 0.7); padding-left: 24px; }
.mr-date { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.mr-title { font-size: 14.5px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mr-stats { display: flex; align-items: center; gap: 18px; font-family: var(--font-mono); font-size: 12px; }
.mr-stats .k { display: block; font-size: 10px; color: var(--muted); }
.result-chip {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
}
.result-chip.W { background: rgba(42, 140, 98, 0.25); color: var(--pitch-glow); border: 1px solid rgba(42, 140, 98, 0.5); }
.result-chip.D { background: rgba(127, 174, 149, 0.14); color: var(--text-dim); border: 1px solid var(--line); }
.result-chip.L { background: rgba(200, 16, 46, 0.18); color: var(--accent-light); border: 1px solid rgba(200, 16, 46, 0.4); }

.rating-val { font-family: var(--font-display); font-weight: 700; color: var(--amber); font-size: 15px; }

/* 試合ページのスコアボード */
.scoreboard {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface), var(--surface-card));
  padding: 30px 24px; text-align: center;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow);
}
.sb-teams { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; }
.sb-team { font-family: var(--font-display); font-size: clamp(16px, 3vw, 24px); font-weight: 700; color: #fff; flex: 1; min-width: 140px; }
.sb-score {
  font-family: var(--font-display); font-size: clamp(24px, 5vw, 34px); font-weight: 700; color: #fff;
  padding: 6px 20px; border-radius: 14px;
  background: linear-gradient(135deg, var(--pitch), var(--pitch-light));
  border: 1px solid rgba(63, 214, 143, 0.4);
}
.sb-comp { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pitch-glow); }

/* ---------------------------------------------------------- Filter / UI */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.toolbar-controls { display: flex; gap: 10px; align-items: center; flex: 1 1 320px; justify-content: flex-end; }
.toolbar-controls .field-wrap { max-width: 260px; flex: 1 1 180px; }
.chip {
  padding: 6px 13px; border-radius: 10px;
  font-size: 12px; font-weight: 500;
  background: var(--surface-card); color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-out);
}
.chip:hover { color: #fff; transform: translateY(-1px); }
.chip.is-active { background: linear-gradient(135deg, var(--pitch-light), var(--pitch)); color: #fff; border-color: rgba(63, 214, 143, 0.4); }

.field {
  width: 100%;
  background: var(--surface-card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px;
  color: var(--text); font-size: 12.5px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field::placeholder { color: #5f7f6e; }
.field:focus { outline: none; border-color: var(--pitch); box-shadow: 0 0 0 3px rgba(42, 140, 98, 0.15); }
.field-wrap { position: relative; width: 100%; max-width: 280px; }

select.field { appearance: none; cursor: pointer; padding-right: 30px; }
.select-wrap { position: relative; }
.select-wrap::after { content: "▾"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; pointer-events: none; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* -------------------------------------------------------------- Prose */
.prose { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--text-dim); }
.prose h3 { font-family: var(--font-display); font-size: 16px; color: var(--pitch-glow); }
.prose ul { display: flex; flex-direction: column; gap: 7px; }
.prose li { position: relative; padding-left: 18px; }
.prose li::before { content: "▸"; position: absolute; left: 0; color: var(--pitch); }
.prose code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-card); padding: 1px 6px; border-radius: 5px; color: var(--pitch-glow); }
/* 本文中のリンクは、地の文と区別できるように下線と色を付ける */
.prose a {
  color: var(--pitch-glow);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(63, 214, 143, 0.45);
  transition: text-decoration-color 0.25s, color 0.25s;
}
.prose a:hover { color: #fff; text-decoration-color: #fff; }
.prose a[target="_blank"]::after { content: " ↗"; font-size: 0.85em; opacity: 0.7; }

/* -------------------------------------------------------------- Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 34px 0;
  font-size: 12px; color: var(--muted);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.footer-col { display: flex; flex-direction: column; gap: 7px; max-width: 420px; }
.footer-col h4 { font-family: var(--font-display); font-size: 13px; color: #fff; }
.footer-links { font-family: var(--font-mono); font-size: 11.5px; display: flex; flex-direction: column; gap: 5px; }
.footer-links a:hover { color: var(--pitch-glow); }

/* ------------------------------------------------------- Motion helpers */
/* JS が動く環境でだけ隠す。JS 無効時・クローラには最初から見えている状態を保つ。 */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }

.fade-in { animation: fadeIn 0.5s var(--ease-out) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.stagger > * { animation: fadeIn 0.55s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.16s; }
.stagger > *:nth-child(4) { animation-delay: 0.22s; }
.stagger > *:nth-child(5) { animation-delay: 0.28s; }
.stagger > *:nth-child(6) { animation-delay: 0.34s; }
.stagger > *:nth-child(7) { animation-delay: 0.40s; }
.stagger > *:nth-child(8) { animation-delay: 0.46s; }

/* レーダーチャート / スパークライン */
.chart-wrap { display: flex; justify-content: center; align-items: center; padding: 8px 0; }
.radar-grid { stroke: var(--line); stroke-width: 1; fill: none; }
.radar-axis { stroke: var(--line-soft); stroke-width: 1; }
.radar-area { fill: rgba(42, 140, 98, 0.32); stroke: var(--pitch-glow); stroke-width: 2; stroke-linejoin: round; transition: all 0.9s var(--ease-out); }
.radar-point { fill: var(--pitch-glow); transition: all 0.9s var(--ease-out); }
.radar-label { fill: var(--muted); font-family: var(--font-mono); font-size: 9.5px; }
.radar-value { fill: #fff; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; }

.spark-line { fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.spark-fill { fill: url(#sparkGrad); }
.spark-dot { fill: var(--amber); stroke: var(--bg); stroke-width: 2; cursor: pointer; transition: r 0.2s; }
.spark-dot:hover { r: 6; }
.spark-axis { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.spark-tip { font-family: var(--font-mono); font-size: 10px; fill: var(--text-dim); }

/* 比較バー（試合ページ） */
.vs-row { display: grid; grid-template-columns: 46px 1fr 46px; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 12px; }
.vs-bar { display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: var(--surface-card); }
.vs-bar i { display: block; height: 100%; transition: width 0.9s var(--ease-out); }
.vs-bar i.a { background: var(--pitch-glow); }
.vs-bar i.b { background: rgba(127, 174, 149, 0.3); }
.vs-label { text-align: center; font-size: 10.5px; color: var(--muted); }

/* スケルトン（JS 起動前の見た目崩れ防止） */
[data-island] { min-height: 40px; }

/* --------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-pitch { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .nav { display: none; }
  .nav.is-open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 66px; left: 0; right: 0;
    background: rgba(9, 16, 13, 0.98); border-bottom: 1px solid var(--line);
    padding: 10px 20px 16px; gap: 2px;
    animation: fadeIn 0.3s var(--ease-out) both;
  }
  .nav-toggle { display: block; }
  .header-inner { position: relative; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .val { font-size: 22px; }
  .hero { padding: 28px 20px; }
  .player-hero { padding: 20px; }
  .ph-rating { min-width: 100%; text-align: left; }
  .match-row { gap: 10px; }
  .mr-stats { gap: 14px; }
  .statline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ------------------------------------------------------- Europe map */
.europe-map { padding: 20px; }
.map-head { margin-bottom: 14px; }
.map-head h2 { margin: 0 0 4px; }
.map-head p { margin: 0; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 18px; }
@media (max-width: 760px) { .map-layout { grid-template-columns: 1fr; } }

.map-figure { min-width: 0; }
.map-figure svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); background: #0a1310; }

.map-bg { fill: #16211c; stroke: #22302a; stroke-width: 1; }

/* 国ごとの色。凡例の見本と地図で同じ色を使う */
.map-country path,
.map-swatch { transition: fill 0.2s, opacity 0.2s; }
.map-country { cursor: pointer; }
.map-country path { stroke: #0a1310; stroke-width: 1.5; }
.map-country[data-country="united-kingdom"] path, .map-swatch[data-country="united-kingdom"] { fill: #2f9c6d; background: #2f9c6d; }
.map-country[data-country="spain"] path,       .map-swatch[data-country="spain"]       { fill: #cfa528; background: #cfa528; }
.map-country[data-country="germany"] path,     .map-swatch[data-country="germany"]     { fill: #bf4a44; background: #bf4a44; }
.map-country[data-country="france"] path,      .map-swatch[data-country="france"]      { fill: #4478c0; background: #4478c0; }
.map-country[data-country="portugal"] path,    .map-swatch[data-country="portugal"]    { fill: #8a59c4; background: #8a59c4; }
.map-country[data-country="netherlands"] path, .map-swatch[data-country="netherlands"] { fill: #d97b2b; background: #d97b2b; }
.map-country[data-country="belgium"] path,     .map-swatch[data-country="belgium"]     { fill: #3fa9a0; background: #3fa9a0; }
.map-country[data-country="denmark"] path,     .map-swatch[data-country="denmark"]     { fill: #c05a8a; background: #c05a8a; }
.map-country[data-country="austria"] path,     .map-swatch[data-country="austria"]     { fill: #b8783f; background: #b8783f; }
.map-country[data-country="switzerland"] path, .map-swatch[data-country="switzerland"] { fill: #6f8fbf; background: #6f8fbf; }
.map-country[data-country="italy"] path,       .map-swatch[data-country="italy"]       { fill: #4f9e57; background: #4f9e57; }

.map-country:hover path, .map-country:focus-visible path, .map-country.is-active path {
  stroke: #fff; stroke-width: 2.5;
}
/* タップでも focus は起きる。既定の枠が出ると不具合に見えるため、
   キーボード操作のときだけ枠を出す。 */
.map-country:focus { outline: none; }
.map-country:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.map-legend-item:focus { outline: none; }
.map-legend-item:focus-visible { outline: 2px solid var(--pitch-glow); outline-offset: 2px; }
/* いずれかを選んでいるあいだ、他の国を沈める */
.europe-map.has-active .map-country:not(.is-active) path { opacity: 0.45; }

.map-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.map-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-dim); font-size: 11.5px; cursor: pointer;
}
.map-legend-item:hover, .map-legend-item.is-active { color: #fff; border-color: var(--pitch-glow); }
.map-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.map-panel {
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--surface-card); padding: 14px; min-height: 180px;
}
.map-panel-hint { font-size: 12px; color: var(--muted); margin: 0; }
.map-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.map-panel-flag { font-size: 20px; }
.map-panel-count { display: block; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.map-player-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.map-player {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 7px 9px; border-radius: 8px; font-size: 13px; color: var(--text);
}
.map-player:hover { background: rgba(42, 140, 98, 0.14); color: #fff; }
.map-player-club { font-size: 11px; color: var(--muted); text-align: right; }
.map-empty { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

/* 1つの国に複数リーグがあるため、パネル内をリーグごとに区切る */
.map-league { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.map-league:first-of-type { border-top: none; margin-top: 4px; padding-top: 0; }
.map-league-head {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 13px; color: #fff; margin-bottom: 4px;
}
.map-league-head:hover { color: var(--pitch-glow); }
.map-league-head .map-panel-count { margin-left: auto; display: inline; }
.map-legend-count {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 6px; margin-left: 2px;
}

/* 2部以下であることを示す印 */
.tier-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: rgba(127, 174, 149, 0.14); color: var(--text-dim);
  border: 1px solid var(--line); white-space: nowrap;
}

/* ------------------------------------------------- 比較マップ（散布図） */
.cmp-count {
  margin-left: 6px; font-size: 10px; font-family: var(--font-mono);
  color: var(--muted);
}
/* 軸の説明。狭い画面では2行に分かれるよう、定義リストで組む */
.cmp-axis-note {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px; font-size: 12px; color: var(--text-dim); margin: 12px 0 4px;
}
.cmp-axis-note dt { color: var(--pitch-glow); font-weight: 700; white-space: nowrap; }
.cmp-axis-note dd { margin: 0; }
@media (max-width: 480px) {
  .cmp-axis-note { grid-template-columns: 1fr; gap: 0 0; }
  .cmp-axis-note dd { margin-bottom: 5px; }
}

/* 図には上限があるので、余った幅は一覧に回す。
   クラブ名が途中で切れるのを減らせる。 */
.scatter-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 300px); gap: 18px; }
@media (max-width: 860px) { .scatter-layout { grid-template-columns: 1fr; } }

/* 図を広げすぎない。viewBox が 420 なので、横に伸びるほど
   SVG 内の文字も一緒に拡大され、本文より大きくなってしまう。 */
.scatter-figure { min-width: 0; max-width: 720px; }
.scatter { width: 100%; height: auto; display: block; background: #0a1310; border-radius: var(--radius-sm); }
.scatter-grid { stroke: var(--line-soft); stroke-width: 1; }
.scatter-axis { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 4; }

.scatter-dot circle { fill: var(--pitch-glow); fill-opacity: 0.75; stroke: #0a1310; stroke-width: 1.5; }
.scatter-dot text {
  /* SVG 内の px は viewBox の単位。図の実寸に比例して拡大縮小されるため、
     狭い画面では単位を大きくしないと読めない大きさになる。
     場所取りは大きい方（16）で済ませてあるので、どちらでも重ならない。 */
  font-size: 11px; fill: var(--text-dim); font-family: var(--font-sans);
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
  /* 罫線や他の点の上に来ても読めるよう、文字の周りを背景色で縁取る。
     paint-order で縁取りを先に塗るため、文字そのものは細らない。 */
  paint-order: stroke fill; stroke: #0a1310; stroke-width: 0.25em;
  stroke-linejoin: round;
}
/* 重ならない置き場所が見つかった選手。常に姓が出ている。 */
.scatter-dot text.is-fixed { opacity: 1; }
@media (max-width: 560px) {
  .scatter-dot text { font-size: 21px; }
  .scatter-tick { font-size: 18px; }
}
.scatter-dot:hover circle, .scatter-dot:focus-visible circle,
.scatter-dot.is-active circle { fill: #fff; fill-opacity: 1; }
.scatter-dot:hover text, .scatter-dot:focus-visible text,
.scatter-dot.is-active text { opacity: 1; fill: #fff; }
.scatter-dot:focus { outline: none; }
.scatter-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.scatter-ylabel, .scatter-xlabel {
  font-size: 11px; color: var(--muted); font-family: var(--font-mono);
}
.scatter-ylabel { margin-bottom: 5px; }
.scatter-xlabel { margin-top: 5px; text-align: right; }
.scatter-note { font-size: 11.5px; color: var(--muted); margin: 9px 0 0; line-height: 1.7; }

.scatter-list { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.scatter-head, .scatter-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 42px 42px;
  gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px;
}
.scatter-head {
  font-size: 10.5px; color: var(--muted); border-bottom: 1px solid var(--line-soft);
  border-radius: 0; padding-bottom: 8px; margin-bottom: 3px;
}
.scatter-head span:last-child, .scatter-head span:nth-child(3) { text-align: right; }
.scatter-row { font-size: 13px; color: var(--text); }
.scatter-row:hover, .scatter-row.is-active { background: rgba(42, 140, 98, 0.14); color: #fff; }
.scatter-rank { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.scatter-row-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.scatter-row-club {
  font-size: 10.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scatter-row-v {
  font-family: var(--font-mono); font-size: 12.5px; text-align: right; color: #fff;
}
.scatter-tick {
  font-size: 10px; fill: var(--muted); font-family: var(--font-mono);
  opacity: 0.75; pointer-events: none;
}

/* 問い合わせフォームの埋め込み。Google フォームは高さを自分で伝えてこないため、
   こちら側で高さを決め打ちし、スクロールはフレーム内に任せる。 */
.form-embed {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.form-embed iframe {
  display: block;
  width: 100%;
  height: 1100px;
  border: 0;
}
@media (max-width: 560px) {
  .form-embed iframe { height: 1400px; }
}

/* 比較マップの色分け。役割の違いは図を分けず、点の色で見分ける。
   区分の無いポジションは全員同じ色（既定の .scatter-dot circle）。 */
.scatter-dot.sub-am circle { fill: #f2b544; }
.scatter-dot.sub-dm circle { fill: #4ea8de; }

.scatter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.scatter-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.scatter-swatch {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--pitch-glow);
  border: 1px solid #0a1310;
}
.scatter-legend-item.sub-am .scatter-swatch { background: #f2b544; }
.scatter-legend-item.sub-dm .scatter-swatch { background: #4ea8de; }
