/* =========================================================================
   Стили сайта прогнозов. Тёмная тема, зелёный акцент, адаптив.
   ========================================================================= */
:root {
  --bg: #0d1117;
  --bg-2: #131a24;
  --card: #161d29;
  --card-2: #1b2430;
  --line: #232d3b;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #2ecc71;
  --accent-2: #27ae60;
  --accent-dim: rgba(46, 204, 113, .14);
  --tg: #229ed9;
  --warn: #f1c40f;
  --danger: #e74c3c;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card-2);
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #08130c; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-2); }
.btn--tg { color: #fff; background: var(--tg); border-color: var(--tg); }

/* ---------- Лидерборд-баннер ---------- */
.leaderboard-wrap { display: flex; justify-content: center; padding: 10px 16px 0; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(13, 17, 23, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo__mark { font-size: 26px; }
.logo__text { display: flex; flex-direction: column; line-height: 1.1; }
.logo__text b { font-size: 17px; }
.logo__text small { color: var(--muted); font-size: 11px; }
.header__nav { display: flex; align-items: center; gap: 18px; }
.header__nav a:not(.btn) { color: var(--muted); font-weight: 500; }
.header__nav a:not(.btn):hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding: 46px 0 30px; background:
  radial-gradient(900px 300px at 20% -10%, rgba(46,204,113,.12), transparent 70%); }
.hero__badge {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(46,204,113,.3);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(24px, 4vw, 40px); max-width: 780px; }
.hero p { color: var(--muted); max-width: 640px; font-size: 16px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero__cta .btn--tg b { font-weight: 700; }

/* ---------- Макет: сайдбары + контент ---------- */
.layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 320px;
  gap: 24px; align-items: start;
  padding-top: 26px; padding-bottom: 40px;
}
.rail { position: sticky; top: 78px; }
.content { min-width: 0; }

/* Полноширинный layout (аналитический режим — без боковых баннеров). */
.layout--full { grid-template-columns: minmax(0, 1fr) !important; }

/* SEO-текст и FAQ */
.prose { margin-top: 34px; }
.prose p { color: var(--text); max-width: 760px; }
.prose ul { max-width: 760px; padding-left: 18px; }
.prose li { margin: 6px 0; color: var(--muted); }
.prose li b { color: var(--text); }
.prose h3 { margin-top: 18px; font-size: 16px; }
.faq details {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin: 8px 0; max-width: 760px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { color: var(--accent); }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* ---------- Заголовки секций ---------- */
.section-title { font-size: 20px; }
.section-title::before {
  content: ''; display: inline-block; width: 8px; height: 18px;
  background: var(--accent); border-radius: 3px; margin-right: 10px;
  vertical-align: -3px;
}
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Статистика ---------- */
.stats { margin-bottom: 36px; }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.section-lead { color: var(--muted); max-width: 720px; margin: 2px 0 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.stat__val { font-size: 22px; font-weight: 800; }
.stat__label { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat--hero { background: linear-gradient(160deg, var(--accent-dim), var(--card)); border-color: rgba(46,204,113,.35); }
.stat--hero .stat__val { color: var(--accent); font-size: 30px; }

.by-league { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.by-league h3 { font-size: 14px; color: var(--muted); font-weight: 600; }
.lstat { display: grid; grid-template-columns: 150px 1fr 92px; align-items: center; gap: 12px; padding: 6px 0; }
.lstat__name { font-size: 13px; }
.lstat__track { height: 8px; background: var(--card-2); border-radius: 6px; overflow: hidden; }
.lstat__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.lstat__val { font-size: 13px; text-align: right; font-weight: 600; }
.lstat__val i { color: var(--muted); font-style: normal; font-weight: 400; font-size: 12px; }

/* ---------- Фильтр ---------- */
.filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.filter select {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit;
}

/* ---------- Плашка модели ---------- */
.model-badge {
  margin-top: 12px; font-size: 12px; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(46,204,113,.3);
  border-radius: 8px; padding: 8px 12px; display: inline-block;
}

/* ---------- Карточки прогнозов ---------- */
.predictions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card__top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.card__top .league { color: var(--accent); font-weight: 600; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.team { font-weight: 700; font-size: 15px; }
.team--home { text-align: right; }
.team--away { text-align: left; }
.vs { color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 26px 1fr 42px; align-items: center; gap: 8px; }
.bar__key { font-size: 12px; color: var(--muted); font-weight: 600; }
.bar__track { height: 8px; background: var(--card-2); border-radius: 6px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.bar__pct { font-size: 12px; text-align: right; font-weight: 600; }

.markets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chip { background: var(--card-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; }
.chip__t { color: var(--muted); font-size: 12px; }
.chip__v { font-weight: 700; font-size: 13px; }

.pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 11px; padding: 12px 14px; border: 1px solid; }
.pick--high { background: var(--accent-dim); border-color: rgba(46,204,113,.4); }
.pick--mid { background: rgba(241,196,15,.1); border-color: rgba(241,196,15,.35); }
.pick--low { background: rgba(231,76,60,.08); border-color: rgba(231,76,60,.3); }
.pick__tag { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pick__market { font-size: 18px; font-weight: 800; margin-right: 8px; }
.pick__label { font-size: 13px; color: var(--muted); }
.pick__conf { text-align: center; }
.pick__conf b { display: block; font-size: 22px; }
.pick--high .pick__conf b { color: var(--accent); }
.pick--mid .pick__conf b { color: var(--warn); }
.pick--low .pick__conf b { color: var(--danger); }
.pick__conf span { font-size: 11px; color: var(--muted); }

.card__tg { color: var(--tg); font-weight: 600; font-size: 13px; }
.card__tg:hover { text-decoration: underline; }

/* ---------- Telegram CTA ---------- */
.tg-cta { margin-top: 30px; }
.tg-cta__inner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(34,158,217,.18), var(--card));
  border: 1px solid rgba(34,158,217,.35); border-radius: var(--radius); padding: 18px 20px;
}
.tg-cta__icon { font-size: 30px; }
.tg-cta__text { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.tg-cta__text b { font-size: 16px; }
.tg-cta__text span { color: var(--muted); font-size: 13px; }

/* ---------- Баннеры ---------- */
.banner-slot { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.banner { display: block; overflow: hidden; border-radius: 10px; width: 100%; }
.banner img { display: block; width: 100%; height: auto; }
.banner--empty {
  border: 1px dashed var(--line); background: var(--card);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); min-height: 90px;
}
.banner--rail.banner--empty { min-height: 480px; }
.banner__ph { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.banner__ph b { font-size: 13px; color: var(--text); }
.banner__ph i { font-size: 12px; font-style: normal; }
.banner--leaderboard.banner--empty { max-width: 728px; min-height: 90px; }

/* ---------- Футер ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 26px 0 90px; margin-top: 20px; }
.footer__cols { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.footer__cols b { font-size: 16px; }
.footer p { margin: 6px 0; max-width: 520px; }
.age { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--danger); color: var(--danger); font-weight: 800; }

/* ---------- Липкий мобильный баннер ---------- */
.banner-sticky {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 6px; background: rgba(13,17,23,.95); border-top: 1px solid var(--line);
}
.banner-sticky .banner--empty { min-height: 50px; }

/* ---------- Cookie ---------- */
.cookie {
  position: fixed; left: 12px; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted);
  box-shadow: var(--shadow); max-width: calc(100vw - 24px);
}
.cookie__ok { background: var(--accent); color: #08130c; border: none; border-radius: 7px; padding: 5px 12px; font-weight: 700; cursor: pointer; }

/* =========================================================================
   Адаптив
   ========================================================================= */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .rail--left { display: none; }        /* левый сайд-баннер скрываем */
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .rail--right { display: none; }       /* правый сайд-баннер скрываем */
  .predictions { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat--hero { grid-column: span 2; }
  .banner-sticky { display: block; }    /* показываем липкий баннер снизу */
  .lstat { grid-template-columns: 110px 1fr 78px; }
  .footer { padding-bottom: 120px; }    /* место под липкий баннер */
}
@media (max-width: 460px) {
  .header__nav a[href="#predictions"], .header__nav a[href="#stats"] { display: none; }
  .pick__market { font-size: 16px; }
  .hero { padding-top: 30px; }
}

/* ============ Архив прогнозов (открытая история результатов) ============ */
.archive { margin-top: 30px; }
.archive__wrap { margin-top: 14px; }
.archive__empty {
  padding: 20px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); background: var(--card); font-size: 14px; line-height: 1.5;
}
.archive__scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card);
}
.archive__table {
  width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px;
}
.archive__table thead th {
  text-align: left; padding: 11px 14px; color: var(--muted); font-weight: 600;
  white-space: nowrap; border-bottom: 1px solid var(--line);
  background: var(--card-2); position: sticky; top: 0;
}
.archive__table tbody td {
  padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle; color: var(--text);
}
.archive__table tbody tr:last-child td { border-bottom: none; }
.archive__table tbody tr:hover td { background: rgba(255,255,255,.02); }
.arch-match { font-weight: 600; white-space: nowrap; }
.arch-league, .arch-date { color: var(--muted); white-space: nowrap; }
.arch-conf { color: var(--muted); font-style: normal; font-size: 12px; }
.arch-score { font-variant-numeric: tabular-nums; white-space: nowrap; }
.arch-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.arch-win  { color: #2ecc71; background: rgba(46,204,113,.14); border: 1px solid rgba(46,204,113,.30); }
.arch-loss { color: #e74c3c; background: rgba(231,76,60,.12); border: 1px solid rgba(231,76,60,.30); }
