/* Оформление сайта лиги. Цвета бренда (--primary, --accent) задаёт config/site.php (theme),
   остальное - нейтральная палитра с тёмной темой по prefers-color-scheme */
:root {
    --primary: #0b2545; --accent: #d6001c; --ice: #3b82f6;
    --bg: #eef2f7; --surface: #ffffff; --surface-2: #f6f8fb; --fg: #0f1b2d; --muted: #64748b; --border: #dde4ee;
    --win: #15803d; --loss: #b91c1c; --po: #f2b705;
    --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 10px 30px rgba(15, 27, 45, .07);
    --radius: 16px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a1220; --surface: #111c2e; --surface-2: #162338; --fg: #e8eef8; --muted: #8da0ba; --border: #1f2e46;
        --win: #4ade80; --loss: #f87171; --ice: #60a5fa;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--fg);
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 16px 0; }

/* ---------- шапка ---------- */
header.site { position: sticky; top: 0; z-index: 20; color: #fff; border-bottom: 3px solid var(--accent);
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 82%, #000)); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-mark { width: 14px; height: 22px; background: var(--accent); transform: skewX(-14deg); border-radius: 2px;
    box-shadow: 6px 0 0 rgba(255, 255, 255, .85); margin-right: 6px; }
nav.main { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a { padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; color: rgba(255, 255, 255, .82); }
nav.main a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
nav.main a.active { background: rgba(255, 255, 255, .16); color: #fff; }
@media (max-width: 720px) { header.site .wrap { flex-direction: column; align-items: flex-start; gap: 6px; } nav.main { width: 100%; } }

main { padding-block: 22px 48px; flex: 1; width: 100%; }
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 18px; letter-spacing: -.02em; font-weight: 800; }
h2.sec { display: flex; align-items: center; gap: 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; color: var(--muted); margin: 32px 0 12px; }
h2.sec::before { content: ''; width: 5px; height: 18px; border-radius: 3px; background: var(--accent); }
h2.sec a { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; color: var(--ice); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 18px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- лента результатов ---------- */
.ticker { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.tk { flex: 0 0 168px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.tk:hover { text-decoration: none; border-color: var(--accent); }
.tk .d { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; display: flex; justify-content: space-between; }
.tk .r { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 26px; }
.tk .r .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk .r b { font-variant-numeric: tabular-nums; }
.tk .r.win .n, .tk .r.win b { font-weight: 800; }
.tk.next { border-style: dashed; }

/* ---------- карточка ближайшего матча ---------- */
.hero-match { position: relative; overflow: hidden; border-radius: 20px; color: #fff; padding: 22px 20px 20px;
    background: radial-gradient(900px 300px at 85% -20%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
                linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); box-shadow: var(--shadow); }
.hero-match::after { content: ''; position: absolute; inset: auto -40px -60px auto; width: 240px; height: 240px; border-radius: 50%;
    border: 28px solid rgba(255, 255, 255, .05); pointer-events: none; }
.hero-match .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; opacity: .75; text-align: center; font-weight: 700; }
.hero-match .row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin-top: 14px; }
.hero-match .tm { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-weight: 700; font-size: 18px; line-height: 1.25; }
.hero-match .tm:hover { text-decoration: none; }
.hero-match .mid { text-align: center; }
.hero-match .time { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.hero-match .date { font-size: 13px; opacity: .8; margin-top: 6px; }
.hero-match .cd { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 12px; font-variant-numeric: tabular-nums; }
.hero-match .score { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .16); }
@media (max-width: 560px) {
    .hero-match { padding: 18px 10px 16px; }
    .hero-match .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 8px; }
    .hero-match .mid { grid-column: 1 / -1; grid-row: 2; }
    .hero-match .tm { font-size: 14px; gap: 8px; }
    .hero-match .tm .logo, .hero-match .tm .ini { width: 52px; height: 52px; font-size: 16px; }
    .hero-match .time { font-size: 28px; } .hero-match .score { font-size: 36px; }
    .hero-match .date { font-size: 12px; }
    .hero-match .cd { font-size: 11px; padding: 3px 8px; white-space: normal; }
}

/* ---------- строки матчей ---------- */
.fx { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.fx:last-child { border-bottom: 0; }
.fx:hover { text-decoration: none; background: linear-gradient(90deg, transparent, var(--surface-2), transparent); }
.fx .when { color: var(--muted); font-size: 12px; line-height: 1.3; }
.fx .tms { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fx .t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx .t .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx .t.win .n { font-weight: 800; }
.fx .scs { display: flex; flex-direction: column; gap: 6px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.fx .scs span { height: 26px; line-height: 26px; }
.fx .scs.pending { color: var(--muted); font-weight: 500; font-size: 13px; }

.logo { width: 26px; height: 26px; object-fit: contain; flex: none; }
.logo.lg { width: 84px; height: 84px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
.ini { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ini.lg { width: 84px; height: 84px; font-size: 26px; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 7px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tbl td.team, .tbl th.team { text-align: left; }
.tbl td.team a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.tbl td.pts { font-weight: 800; font-size: 15px; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.po td:first-child { box-shadow: inset 4px 0 0 var(--po); }
.po-legend { margin: 8px 0 12px; }
.po-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--po); vertical-align: -1px; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.tabs a:hover { text-decoration: none; border-color: var(--accent); }
.tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- команды ---------- */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.team-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 10px 18px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 700; font-size: 14px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.team-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.team-card .logo.lg, .team-card .ini.lg { width: 72px; height: 72px; filter: none; }
.team-card .ini.lg { background: var(--surface-2); border-color: var(--border); color: var(--muted); }

.team-hero { display: flex; align-items: center; gap: 20px; padding: 22px 20px; border-radius: 20px; color: #fff; box-shadow: var(--shadow);
    background: radial-gradient(700px 260px at 90% -30%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 60%), linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); }
.team-hero h1 { margin: 0; color: #fff; }
.team-hero .stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stat { padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, .12); font-size: 12px; line-height: 1.3; }
.stat b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .team-hero { flex-direction: column; align-items: flex-start; } }

.verdict { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-top: 12px; }
article.text h2 { font-size: 19px; margin: 22px 0 8px; }
article.text p, article.text li { line-height: 1.65; }
.pagination { margin-top: 20px; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pg { min-width: 38px; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; color: var(--fg); }
a.pg:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.pg.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg.off { opacity: .45; box-shadow: none; }
.pg.gap { background: none; border: 0; box-shadow: none; min-width: 20px; padding: 0; }
@media (max-width: 560px) { .pg.num, .pg.gap { display: none; } }
footer.site { margin-top: 20px; background: var(--primary); color: rgba(255, 255, 255, .7); font-size: 13px; padding: 22px 0 30px; border-top: 3px solid var(--accent); }

@media (min-width: 561px) { .show-sm { display: none; } }
@media (max-width: 560px) { .hide-sm { display: none; } .show-sm { display: block; font-size: 12px; font-weight: 400; } }
.tbl tr.grp td { text-align: left; background: var(--surface-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 12px; }

/* ---------- стадионы ---------- */
.stadium-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.stadium-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; color: var(--fg); }
.stadium-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.stadium-card .photo { height: 130px; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--accent))) center / cover no-repeat; }
.stadium-card .body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; font-size: 13px; }
.stadium-card .body b { font-size: 16px; }
.stadium-hero { background: linear-gradient(rgba(5, 15, 30, .6), rgba(5, 15, 30, .85)), var(--photo, none) center / cover, linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000)); min-height: 150px; }
.lineup h3 { margin: 12px 0 4px; font-size: 16px; }
.lineup .muted { margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
ul.plain { list-style: none; margin: 0 0 8px; padding: 0; }
ul.plain li { padding: 3px 0; border-bottom: 1px solid var(--border); }
ul.plain li .muted { display: inline-block; min-width: 24px; margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.flag { width: 20px; height: 15px; margin-right: 6px; vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); object-fit: cover; }
.chip.live { background: #d6001c; color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.chip.live .dot, .live-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: livepulse 1.4s infinite; }
.live-tag { color: #d6001c; font-size: 11px; letter-spacing: .06em; }
.live-tag::before { display: inline-block; margin-right: 4px; background: #d6001c; }
.scs.live { color: #d6001c; font-weight: 800; }
@keyframes livepulse { 50% { opacity: .25; } }

.tbl .form-col { text-align: left; }
.fm { display: inline-block; width: 11px; height: 11px; margin-right: 5px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.fm.w { background: var(--win); }
.fm.l { background: var(--loss); }
a.fm:hover { transform: scale(1.35); }
