:root {
  --green: #1f7a3a;
  --green-dark: #0f3d1f;
  --green-light: #e6f3ea;
  --accent: #f2c230;
  --bg: #f6f7f4;
  --card: #ffffff;
  --text: #1a1f1b;
  --muted: #66706a;
  --border: #e1e5e0;
  --win: #1f7a3a;
  --draw: #b08a00;
  --loss: #c0392b;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1411; --card: #18201b; --text: #e8ece9; --muted: #9aa59e;
    --border: #2a332d; --green-light: #1d3324;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- header ---------- */
.header { background: var(--green-dark); color: #fff; position: sticky; top: 0; z-index: 10; }
.header__in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.1); opacity: 1; }
.nav a.active { background: var(--accent); color: var(--green-dark); opacity: 1; }
.burger { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }
@media (max-width: 760px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--green-dark); flex-direction: column; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
}

/* ---------- layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 30px; margin: 0 0 6px; }
h2 { font-size: 22px; margin: 32px 0 14px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(min(160px, 45%), 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.muted { color: var(--muted); }
.note { background: var(--green-light); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--muted); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff; border-radius: var(--radius); padding: 28px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
}
.hero img { width: 110px; height: 110px; border-radius: 50%; background: #fff; padding: 6px; }
.hero h1 { font-size: 36px; }
.hero p { margin: 0; opacity: .85; }
.hero__stats { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.hero__stat b { display: block; font-size: 30px; color: var(--accent); line-height: 1.1; }
.hero__stat span { font-size: 13px; opacity: .8; }

/* ---------- match ---------- */
.match__meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.match__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.match__team { font-weight: 700; font-size: 17px; }
.match__team:last-child { text-align: right; }
.match__team.us { color: var(--green); }
.match__score { font-size: 28px; font-weight: 800; padding: 4px 14px; border-radius: 10px; background: var(--green-light); white-space: nowrap; }
.match__vs { font-size: 15px; font-weight: 700; color: var(--muted); }
.match__foot { margin-top: 12px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; }
.badge.W { background: var(--win); } .badge.D { background: var(--draw); } .badge.L { background: var(--loss); }
.badge.soon { background: var(--accent); color: var(--green-dark); }
.countdown { font-weight: 700; color: var(--green); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
td.l, th.l { text-align: left; }
tr:last-child td { border-bottom: 0; }
tr.us td { background: var(--green-light); font-weight: 700; }
td.pts { font-weight: 800; }

/* ---------- people ---------- */
.person { text-align: center; padding: 0; overflow: hidden; }
.person__photo { aspect-ratio: 3 / 4; background: var(--green-light); display: grid; place-items: center; font-size: 56px; font-weight: 800; color: var(--green); position: relative; }
.person__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.person__num { position: absolute; top: 10px; left: 12px; font-size: 22px; font-weight: 800; color: var(--green); }
.person__body { padding: 12px; }
.person__name { font-weight: 700; }
.person__role { font-size: 13px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid var(--border); background: var(--card); color: var(--text); padding: 6px 14px; border-radius: 99px; cursor: pointer; font: inherit; font-size: 14px; }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- leaders ---------- */
.leader { display: flex; align-items: center; gap: 14px; }
.leader__val { font-size: 34px; font-weight: 800; color: var(--green); min-width: 50px; }
.leader__label { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }

/* ---------- content ---------- */
.post__img { aspect-ratio: 16/9; background: var(--green-light); border-radius: 10px; margin-bottom: 12px; overflow: hidden; display: grid; place-items: center; font-size: 40px; }
.post__img img { width: 100%; height: 100%; object-fit: cover; }
.post__date { font-size: 12px; color: var(--muted); }
.post h3 { margin: 4px 0 8px; font-size: 18px; }
.post p { margin: 0; font-size: 15px; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 48px 20px; }
.empty__icon { font-size: 56px; }
.btn { display: inline-block; background: var(--green); color: #fff; text-decoration: none; padding: 10px 18px; border-radius: 10px; font-weight: 700; margin-top: 12px; }

.footer { text-align: center; padding: 24px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }

/* ---------- tournaments ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--green-light); color: var(--green); }
.tag-fbl { background: #e8eefb; color: #2a55b8; }
@media (prefers-color-scheme: dark) { .tag-fbl { background: #1c2740; color: #8fb0ff; } .tag { color: #7fd69a; } }
.tsum__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.tsum__name { font-weight: 700; margin: 8px 0 12px; }
.tsum__nums { display: flex; gap: 24px; margin-bottom: 10px; }
.tsum__nums b { display: block; font-size: 26px; color: var(--green); line-height: 1.1; }
.tsum__nums span { font-size: 12px; color: var(--muted); }
.match__goals { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.tag-cup { background: #fbf1d6; color: #8a6400; }
@media (prefers-color-scheme: dark) { .tag-cup { background: #3a3014; color: #f2c230; } }

/* ---------- media ---------- */
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.post__img { position: relative; text-decoration: none; }
.post__img--clip { aspect-ratio: 9/12; }
.post__play { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 22px; padding-left: 4px; }
.post__count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.album { padding: 0; overflow: hidden; text-decoration: none; }
.album__cover { aspect-ratio: 4/3; background: var(--green-light); display: grid; place-items: center; font-size: 40px; }
.album__cover img { width: 100%; height: 100%; object-fit: cover; }
.album__body { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; font-size: 32px; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; }
.lb-x { top: 16px; right: 16px; font-size: 22px !important; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-n { position: absolute; bottom: 16px; color: #ccc; font-size: 14px; }
.person__cap { position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--green-dark); font-weight: 800; display: grid; place-items: center; font-size: 15px; }

/* ---------- mobile ---------- */
.grid > *, .container > * { min-width: 0; }
html, body { overflow-x: hidden; }
@media (max-width: 600px) {
  .container { padding: 16px 16px 40px; }
  h1 { font-size: 26px; }
  .hero { padding: 20px; gap: 14px; }
  .hero img { width: 72px; height: 72px; }
  .hero h1 { font-size: 26px; }
  .hero__stats { margin-left: 0; gap: 18px; }
  .hero__stat b { font-size: 24px; }
  .match__team { font-size: 15px; }
  .match__score { font-size: 22px; padding: 4px 10px; }
  th, td { padding: 8px 6px; font-size: 14px; }
  .brand { font-size: 17px; }
  .tsum__head { flex-wrap: wrap; }
}
.vkwidget { padding: 8px; overflow: hidden; }
.vkwidget iframe { max-width: 100%; }

/* карточки людей: одинаковый размер фото и ровные подписи */
.grid-cards { align-items: stretch; }
.person { display: flex; flex-direction: column; }
.person__photo { overflow: hidden; height: auto; }
.person__photo img { position: absolute; inset: 0; }
.person__body { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; }
.person__name { min-height: 2.6em; line-height: 1.3; display: flex; align-items: center; justify-content: center; }

/* ---------- карточка игрока ---------- */
.person--link { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.person--link:hover, .person--link:focus-visible { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); outline: none; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--green-light); }
.pmodal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.pm { position: relative; background: var(--card); color: var(--text); border-radius: 18px; width: 100%; max-width: 560px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.pm h3 { margin: 20px 0 10px; font-size: 16px; }
.pm__x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); font-size: 16px; cursor: pointer; }
.pm__head { display: flex; gap: 16px; align-items: center; padding-right: 36px; }
.pm__photo { width: 96px; height: 128px; flex: none; border-radius: 12px; overflow: hidden; background: var(--green-light); display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--green); }
.pm__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.pm__name { font-size: 22px; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
.pm__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-top: 18px; }
.pm__tile { background: var(--green-light); border-radius: 12px; padding: 10px 12px; text-align: center; }
.pm__tile b { display: block; font-size: 26px; color: var(--green); line-height: 1.1; }
.pm__tile span { font-size: 12px; color: var(--muted); }
.pm__games { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pm__game { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.pm__gmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pm__gline { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.pm__gcontrib { font-size: 14px; margin-top: 4px; }
@media (max-width: 600px) { .pmodal { padding: 12px 8px; } .pm { padding: 18px 14px; } .pm__photo { width: 76px; height: 100px; } .pm__name { font-size: 19px; } }

/* переход «Пятница 13-е»: пока грузится новая страница — тёмный экран вместо белого */
html.f13-pre, html.f13-pre body { background: #000 !important; }
html.f13-pre body > :not(.f13-veil) { visibility: hidden; }

/* вкладки «Сезон / За всё время» */
.seg { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--border); margin: 4px 0 16px; }
.seg__btn { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 14px;
  font: inherit; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg__btn:hover { color: var(--text); }
.seg__btn.active { color: var(--text); border-bottom-color: var(--green); }
.pm__seg { margin-top: 18px; margin-bottom: 0; }
[hidden] { display: none !important; }

/* ---------- окно матча ---------- */
.match--link { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.match--link:hover, .match--link:focus-visible { box-shadow: 0 6px 20px rgba(0,0,0,.12); transform: translateY(-1px); }
.match__more { margin-top: 10px; font-size: 13px; color: var(--green); font-weight: 600; }
.live-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: var(--loss); animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .live-badge { animation: none; } }
.mm { max-width: 640px; }
.mm .match__meta { padding-right: 40px; }
.mm__row { margin-top: 4px; }
.mm__row .match__score { font-size: 34px; }
.mm__status { margin-top: 12px; text-align: center; font-size: 13px; }
.mm__video { position: relative; aspect-ratio: 16 / 9; margin: 34px 0 16px; border-radius: 12px; overflow: hidden; background: #000; }
.mm__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mm__video video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.mm__wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; color: #fff; font-size: 14px; pointer-events: none; }
.mm__wait[hidden] { display: none; }
.mm__video--in { margin: 6px 0 14px; }
.mm__vt { margin: 10px 0 0; font-size: 13px; }
.livetop { margin-top: 16px; }
.livetop__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.livetop__video { margin: 0; }
.mm__watch { display: inline-block; margin: 36px 0 12px; }
.mm__goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.mm__goal { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--green-light); font-size: 14px; }
.mm__goal--opp { background: transparent; border: 1px solid var(--border); }
.mm__gs { font-weight: 800; font-variant-numeric: tabular-nums; }
.mm__gt { font-size: 12px; white-space: nowrap; }
.mm__p { color: var(--green); font-weight: 600; cursor: pointer; }
.mm__p:hover { text-decoration: underline; }
.mm__squad { display: flex; flex-wrap: wrap; gap: 6px; }
.mm__squad .chip { font-size: 13px; padding: 4px 12px; }
@media (prefers-color-scheme: dark) { .mm__p, .match__more { color: #7fd69a; } }
