:root {
  --bg: #f4f6fa;
  --bg-elev: #eef1f7;
  --bg-card: #ffffff;
  --line: #e2e7f0;
  --text: #16203a;
  --muted: #5b6b82;
  --gold: #b8860b;
  --gold-soft: #a9790a;
  --blue: #1e5aa8;
  --blue-bright: #2563eb;
  --radius: 16px;
  --maxw: 1080px;
  --shadow: 0 6px 22px rgba(20, 30, 60, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-soft); }
main { min-height: 60vh; }

/* ---------- Навигация ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; gap: 6px; align-items: center; overflow-x: auto;
}
.nav-brand { font-weight: 800; letter-spacing: .5px; margin-right: 12px; white-space: nowrap; color: var(--text); text-decoration: none; }
.nav-brand span { color: var(--gold); }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; transition: .2s;
}
.nav a:hover { color: var(--text); background: var(--bg-elev); }
.nav a.active { color: var(--gold-soft); background: rgba(184,134,11,.1); font-weight: 700; }

/* ---------- Секции ---------- */
section { max-width: var(--maxw); margin: 0 auto; padding: 56px 20px; }
.sec-title { font-size: 30px; font-weight: 800; margin: 0 0 6px; }
.sec-sub { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.sec-title .accent { color: var(--gold); }

/* ---------- Hero (главная) ---------- */
.hero {
  text-align: center; padding: 76px 20px 44px;
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(30,90,168,.14), transparent 60%),
    radial-gradient(800px 300px at 50% 0%, rgba(184,134,11,.12), transparent 60%);
}
.hero-portrait {
  width: 168px; height: 168px; margin: 0 auto 22px;
  border-radius: 50%; overflow: hidden; border: 4px solid var(--gold);
  background: var(--bg-card); box-shadow: 0 10px 26px rgba(20,30,60,.16);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.hero-kicker { color: var(--gold); letter-spacing: 4px; text-transform: uppercase; font-size: 13px; font-weight: 700; }
.hero h1 { font-size: clamp(40px, 8vw, 74px); margin: 10px 0 4px; font-weight: 900; letter-spacing: -1px; }
.hero .fr { color: var(--muted); font-size: 18px; font-style: italic; }
.hero .meta { color: var(--muted); margin-top: 14px; font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 32px; }
.fact {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 22px; min-width: 120px; box-shadow: var(--shadow);
}
.fact .v { font-size: 26px; font-weight: 800; color: var(--gold-soft); }
.fact .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Главная: карточки разделов ---------- */
.home-grid { max-width: var(--maxw); margin: 8px auto 0; padding: 0 20px 60px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.home-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: .2s; box-shadow: var(--shadow);
}
.home-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.home-card .ic { font-size: 26px; }
.home-card h3 { margin: 10px 0 4px; font-size: 17px; }
.home-card p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Карточки/сетки ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Таймлайн ---------- */
.timeline { position: relative; margin-left: 8px; padding-left: 26px; border-left: 2px solid var(--line); }
.tl-item { position: relative; padding: 4px 0 26px; }
.tl-item::before {
  content: ''; position: absolute; left: -34px; top: 8px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(184,134,11,.15);
}
.tl-item.coach::before { background: var(--blue-bright); box-shadow: 0 0 0 4px rgba(37,99,235,.16); }
.tl-period { color: var(--gold-soft); font-weight: 700; font-size: 14px; }
.tl-club { font-size: 19px; font-weight: 800; margin: 2px 0; }
.tl-note { color: var(--muted); font-size: 14px; }
.tl-badge {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 20px; margin-left: 8px; vertical-align: middle;
  border: 1px solid var(--line); color: var(--muted);
}
.tl-badge.coach { color: var(--blue-bright); border-color: rgba(37,99,235,.4); }

/* ---------- Графики ---------- */
.chart-wrap { width: 100%; height: 360px; margin-top: 8px; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 10px; font-style: italic; }
.chart-toggle { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-toggle button {
  background: var(--bg-card); color: var(--muted); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: .2s;
}
.chart-toggle button.active { background: var(--gold); color: #fff; border-color: var(--gold); font-weight: 700; }

/* ---------- Таблица ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; cursor: pointer; user-select: none; }
th:hover { color: var(--text); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--bg-elev); }
tfoot td { font-weight: 800; color: var(--gold-soft); border-top: 2px solid var(--line); }
.trophy-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--gold-soft); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 5px;
}
.trophy-toggle .chev { font-size: 10px; transition: transform .2s; }
.trophy-toggle.open .chev { transform: rotate(180deg); }
.trophy-row td { background: var(--bg-elev); }
.trophy-list { display: flex; flex-wrap: wrap; gap: 8px; }
.trophy-list .chip { background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; font-size: 13px; }
.trophy-list .chip .m { margin-right: 6px; }

/* ---------- Трофеи ---------- */
.honour {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
}
.honour .medal { font-size: 22px; }
.honour .t { font-weight: 700; font-size: 15px; }
.honour .y { color: var(--muted); font-size: 13px; }

/* ---------- Сборная — турниры ---------- */
.tourn { border-left: 4px solid var(--line); }
.tourn.gold { border-left-color: var(--gold); }
.tourn.silver { border-left-color: #94a3b8; }
.tourn.gray { border-left-color: #cbd5e1; }
.tourn .name { font-weight: 800; font-size: 17px; }
.tourn .res { color: var(--gold-soft); font-size: 14px; font-weight: 600; }
.tourn .hl { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- Игрок vs Тренер ---------- */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: start; }
.vs-col h3 { margin: 0 0 14px; font-size: 18px; }
.vs-col.player h3 { color: var(--gold); }
.vs-col.coach h3 { color: var(--blue-bright); }
.vs-list { list-style: none; padding: 0; margin: 0; }
.vs-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.vs-divider { align-self: center; color: var(--muted); font-weight: 900; font-size: 22px; }
.coach-record-label, .player-record-label { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.coach-record-label { color: var(--blue-bright); }
.player-record-label { color: var(--gold-soft); }
.coach-record, .player-record { display: flex; gap: 14px 20px; flex-wrap: wrap; margin-top: 14px; }
.player-record .rec { text-align: center; }
.player-record .rec .v { font-size: 24px; font-weight: 800; color: var(--gold-soft); }
.player-record .rec .l { font-size: 12px; color: var(--muted); }
.coach-record .rec { text-align: center; }
.coach-record .rec .v { font-size: 24px; font-weight: 800; color: var(--blue-bright); }
.coach-record .rec .l { font-size: 12px; color: var(--muted); }

/* ---------- Карта ---------- */
.map-box { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--bg-elev); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.map-pin { position: absolute; transform: translate(-50%, -100%); text-align: center; }
.map-pin .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--gold); margin: 0 auto; box-shadow: 0 0 0 5px rgba(184,134,11,.18); }
.map-pin .lbl { font-size: 12px; margin-top: 4px; background: rgba(255,255,255,.9); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; white-space: nowrap; }

/* ---------- Знаковые матчи ---------- */
.match .m-title { font-weight: 800; font-size: 17px; }
.match .m-score { color: var(--gold-soft); font-weight: 700; margin: 4px 0; }
.match .m-date { color: var(--muted); font-size: 12px; }
.match .m-desc { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* ---------- ТОП-10 матчей (рейтинг) ---------- */
.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-item {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.rank-item.top { border-color: rgba(184,134,11,.35); }
.rank-num { flex: 0 0 auto; min-width: 48px; text-align: center; line-height: 1; }
.rank-num .rank-n { display: block; font-size: 34px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.rank-num .rank-medal { font-size: 18px; }
.rank-body { flex: 1; min-width: 0; }
.rank-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rank-head .m-title { font-weight: 800; font-size: 17px; }
.rank-comp { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; }
.rank-body .m-score { color: var(--gold-soft); font-weight: 700; margin: 5px 0 2px; }
.rank-body .m-date { color: var(--muted); font-size: 12px; }
.rank-body .m-desc { color: var(--muted); font-size: 14px; margin-top: 8px; }
.video-link {
  margin-top: 12px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 20px;
  padding: 7px 14px; font-size: 13px; color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px; transition: .2s;
}
.video-link:hover { border-color: var(--gold); color: var(--text); }
.video-link .vt-ic { color: #e11d2a; font-size: 11px; }

/* ---------- Футер ---------- */
footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--bg-card); }
footer .f-inner { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px; color: var(--muted); font-size: 13px; }
footer a { margin-right: 14px; }

/* ---------- Навигация «назад/вперёд» между разделами ---------- */
.pager { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 20px; display: flex; justify-content: space-between; gap: 12px; }
.pager a { color: var(--gold-soft); text-decoration: none; font-size: 14px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card); }
.pager a:hover { border-color: var(--gold); }
.pager .spacer { flex: 1; }

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {
  .grid-2, .grid-3, .home-grid { grid-template-columns: 1fr; }
  .vs { grid-template-columns: 1fr; }
  .vs-divider { display: none; }
  .chart-wrap { height: 300px; }
}

.recharts-default-tooltip {
  background: #fff !important; border: 1px solid var(--line) !important; border-radius: 10px !important; box-shadow: var(--shadow) !important;
}

/* ---------- Текстовый блок внизу страницы ---------- */
.page-text { max-width: 760px; margin: 36px 0 0; }
.page-text p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.75; color: var(--text); }
.page-text p:last-child { margin-bottom: 0; }
.page-text .src { color: var(--muted); font-size: 13.5px; }
.page-text.home { max-width: var(--maxw); margin: 0 auto 60px; padding: 0 20px; }
.page-text.home p { max-width: 760px; }
