/* FootStat.kz — главная: лента матчей, новости с обложками */
:root {
    --fs-surface: #16181d;
    --fs-surface-2: #1d2027;
    --fs-border: #27272a;
    --fs-line: #212329;
    --fs-text: #e4e4e7;
    --fs-muted: #a1a1aa;
    --fs-faint: #8b8b94;
    --fs-accent: #27d17f;
    --fs-accent-ink: #06210f;
    --fs-live: #ff5a5a;
    --fs-display: 'Unbounded', 'Onest', sans-serif;
}

main.wrap--wide { padding-top: 28px; padding-bottom: 8px; }
/* панели, скрытые вкладками, не показываем, даже если у элемента свой display */
[data-panel][hidden], [data-league-panel][hidden] { display: none; }
.fs-section { margin-bottom: 44px; }
.fs-section:last-child { margin-bottom: 0; }
.fs-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; }
.fs-h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-family: var(--fs-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--fs-text); }
.fs-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--fs-accent); }
.fs-more { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: #d4d4d8; }
.fs-more:hover { background: #1c1f25; color: #fff; }

/* кнопка */
.fs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--fs-accent); color: var(--fs-accent-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.fs-btn:hover { background: #3ee08f; color: var(--fs-accent-ink); }

/* «N в эфире» в шапке */
.fs-livepill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(255, 90, 90, .12); border: 1px solid rgba(255, 90, 90, .35); color: #ff8a8a; font-size: 13px; font-weight: 600; white-space: nowrap; }
.fs-livepill:hover { color: #ffb3b3; }
.fs-livepill[hidden] { display: none; }
.fs-pulse { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--fs-live); animation: fsPulse 1.6s ease-out infinite; }
@keyframes fsPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 90, 90, .55); }
    70% { box-shadow: 0 0 0 7px rgba(255, 90, 90, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0); }
}

/* вкладки дней */
.fs-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fs-surface); border: 1px solid var(--fs-border); }
.fs-tab { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--fs-muted); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.fs-tab:hover { color: #fff; }
.fs-tab[aria-selected="true"] { background: var(--fs-text); color: #0f1115; }

/* лента матчей */
.fs-rail { position: relative; }
.fs-scroller { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 0 8px; scrollbar-width: none; }
.fs-scroller::-webkit-scrollbar { display: none; }
/* край ленты плавно гаснет там, куда ещё можно прокрутить */
.fs-rail.can-next .fs-scroller { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent); }
.fs-rail.can-prev .fs-scroller { -webkit-mask-image: linear-gradient(to right, transparent, #000 72px); mask-image: linear-gradient(to right, transparent, #000 72px); }
.fs-rail.can-prev.can-next .fs-scroller { -webkit-mask-image: linear-gradient(to right, transparent, #000 72px, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to right, transparent, #000 72px, #000 calc(100% - 72px), transparent); }
.fs-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: none; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid #2f3239; background: var(--fs-surface-2); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); cursor: pointer; }
.fs-arrow--prev { left: 0; }
.fs-arrow--next { right: 0; }
.fs-rail.can-prev .fs-arrow--prev, .fs-rail.can-next .fs-arrow--next { display: flex; }
.fs-arrow:hover { background: #262a32; }

.fs-card { position: relative; flex: 0 0 236px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border-radius: 14px; background: var(--fs-surface); border: 1px solid var(--fs-border); overflow: hidden; color: var(--fs-text); transition: background-color .15s ease, transform .15s ease; }
a.fs-card:hover { background: var(--fs-surface-2); transform: translateY(-2px); color: var(--fs-text); }
.fs-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 18px; font-size: 12px; }
.fs-card-league { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--fs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-card-league i { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; }
.fs-st { flex: 0 0 auto; color: var(--fs-faint); }
.fs-st--time { color: var(--fs-text); font-weight: 700; }
.fs-st--live { display: inline-flex; align-items: center; gap: 6px; color: var(--fs-live); font-weight: 700; }
.fs-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fs-team img, .fs-badge { flex: 0 0 auto; width: 24px; height: 24px; object-fit: contain; }
.fs-badge { border-radius: 50%; background: #2a2d35; }
.fs-team-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-weight: 500; }
.fs-score { flex: 0 0 auto; font-family: var(--fs-display); font-size: 16px; font-weight: 600; }
.fs-team.is-win .fs-team-name { font-weight: 700; }
.fs-team.is-lose .fs-team-name, .fs-team.is-lose .fs-score { color: var(--fs-faint); }
.fs-card--up .fs-score, .fs-card--wait .fs-score { color: var(--fs-faint); }
.fs-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--fs-live); }

/* пустой день */
.fs-empty { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; padding: 20px 24px; border-radius: 16px; background: var(--fs-surface); border: 1px dashed #33363e; }
.fs-empty-ico { flex: 0 0 auto; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #1f2229; color: var(--fs-accent); }
.fs-empty-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.fs-empty-text b { font-size: 17px; font-weight: 600; }
.fs-empty-text span { font-size: 14px; color: var(--fs-muted); }

/* новости */
.fs-news-top { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.fs-hero { flex: 7 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.fs-side { flex: 5 1 340px; min-width: 0; display: flex; flex-direction: column; }
.fs-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--fs-line); }
.fs-item:first-child { padding-top: 0; }
.fs-item-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fs-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.fs-meta b { font-weight: 600; }
.fs-meta time { color: var(--fs-faint); }
.fs-title { color: var(--fs-text); transition: color .15s ease; }
.fs-news:hover .fs-title { color: var(--fs-accent); }
.fs-hero-title { font-size: 28px; font-weight: 700; line-height: 1.22; letter-spacing: -.01em; }
.fs-lead { font-size: 16px; line-height: 1.5; color: #b4b4bb; }
.fs-item-title { font-size: 18px; font-weight: 600; line-height: 1.3; }
.fs-grid { display: flex; flex-wrap: wrap; gap: 24px; }
.fs-tile { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fs-tile-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.fs-all { display: flex; justify-content: center; margin-top: 32px; }
.fs-all .fs-btn { min-height: 48px; padding: 0 28px; border-radius: 12px; font-size: 15px; }

/* обложки: картинка из админки или цвет лиги + номер тура */
.fs-cover { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px; background: var(--c, #1e2a3a); color: #fff; container-type: inline-size; }
.fs-cover img, .fs-pitch { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .4s ease; }
.fs-cover img { object-fit: cover; }
.fs-news:hover .fs-cover img, .fs-news:hover .fs-pitch { transform: scale(1.04); }
.fs-cover-chip { position: absolute; left: 4cqw; top: 4cqw; padding: 7px 10px; border-radius: 6px; background: rgba(0, 0, 0, .28); font-family: var(--fs-display); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.fs-cover-num { position: absolute; left: 5cqw; bottom: 5cqw; display: flex; align-items: flex-end; gap: 3cqw; }
.fs-cover-num b { font-family: var(--fs-display); font-size: 96px; font-size: 26cqw; font-weight: 700; line-height: .78; letter-spacing: -.04em; }
.fs-cover-num > span { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5cqw; padding-bottom: 1.2cqw; }
.fs-cover-num i { font-family: var(--fs-display); font-size: 26px; font-size: 7cqw; font-style: normal; font-weight: 700; line-height: 1; }
.fs-cover-num em { padding: .9cqw 1.5cqw; border-radius: 5px; background: #fff; color: var(--c, #1e2a3a); font-family: var(--fs-display); font-size: 10px; font-size: max(9px, 2cqw); font-style: normal; font-weight: 700; letter-spacing: .12em; }
.fs-cover-word { position: absolute; left: 5cqw; bottom: 5cqw; font-family: var(--fs-display); font-size: 30px; font-size: 9cqw; font-weight: 700; line-height: 1; letter-spacing: .02em; }
.fs-cover--tile { border-radius: 12px; }
.fs-cover--thumb { flex: 0 0 168px; width: 168px; height: 105px; aspect-ratio: auto; border-radius: 10px; }
.fs-cover--thumb .fs-cover-num b { font-size: 34cqw; }
.fs-cover--thumb .fs-cover-num i { font-size: 10cqw; }
.fs-cover--thumb .fs-cover-word { font-size: 12cqw; }

/* блок статистики: таблица, матч дня, бомбардиры */
.fs-stats-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.fs-panel-card { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 16px; background: var(--fs-surface); border: 1px solid var(--fs-border); }
.fs-table-card { flex: 6 1 520px; }
.fs-motd { flex: 3 1 280px; gap: 18px; }
.fs-scorers-card { flex: 3 1 280px; }
.fs-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 36px; }
.fs-card-head .fs-more { min-height: 36px; padding: 0 10px; font-size: 13px; color: var(--fs-muted); white-space: nowrap; }
.fs-h3 { margin: 0; font-family: var(--fs-display); font-size: 18px; font-weight: 600; color: var(--fs-text); }
.fs-note { margin: 0; padding: 8px 0; font-size: 14px; color: var(--fs-muted); }

.fs-ltabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.fs-ltabs::-webkit-scrollbar { display: none; }
.fs-ltab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--fs-border); background: transparent; color: var(--fs-muted); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.fs-ltab i { width: 8px; height: 8px; border-radius: 50%; }
.fs-ltab:hover { color: #fff; }
.fs-ltab[aria-selected="true"] { background: #23262e; border-color: #3a3f4a; color: var(--fs-text); }

.fs-table { overflow-x: auto; }
.fs-trow { display: grid; grid-template-columns: 34px minmax(140px, 1fr) repeat(4, 30px) 40px 36px 104px; align-items: center; min-width: 500px; height: 44px; border-top: 1px solid var(--fs-line); font-size: 14px; color: var(--fs-text); }
.fs-trow > span:nth-child(n+3) { text-align: center; color: var(--fs-muted); }
.fs-trow > b { text-align: center; font-weight: 700; }
.fs-trow--head { height: 30px; border-top: 0; font-size: 12px; color: var(--fs-faint); }
.fs-trow.fs-trow--head > span { color: var(--fs-faint); }
a.fs-trow:hover { background: #1c1f25; color: var(--fs-text); }
.fs-tpos { display: flex; align-items: center; gap: 10px; color: #c9cfd8; }
.fs-tpos i { width: 3px; height: 18px; border-radius: 2px; background: transparent; }
.fs-tteam { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; }
.fs-tteam img, .fs-tteam .fs-badge { flex: 0 0 auto; width: 22px; height: 22px; object-fit: contain; }
.fs-tteam > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-trow > .fs-tform { display: flex; justify-content: flex-end; gap: 3px; }
.fs-form { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px; font-size: 10px; font-weight: 700; line-height: 1; }
.fs-form--w { background: #27d17f; color: #06210f; }
.fs-form--d { background: #5b6472; color: #fff; }
.fs-form--l { background: #c9353a; color: #fff; }
.fs-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--fs-muted); }
.fs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fs-legend i { width: 3px; height: 12px; border-radius: 2px; }
.fs-tpos i.is-ucl, .fs-legend i.is-ucl { background: #5b9bf8; }

.fs-motd-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fs-motd-label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--fs-display); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fs-accent); }
.fs-motd-league { font-size: 12px; color: var(--fs-muted); text-align: right; }
.fs-motd-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; text-align: center; }
.fs-motd-team { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.fs-motd-team img, .fs-motd-team .fs-badge { width: 56px; height: 56px; object-fit: contain; }
.fs-motd-team b { font-size: 15px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.fs-motd-team small, .fs-motd-when small, .fs-motd-form small { font-size: 12px; color: var(--fs-muted); }
.fs-motd-when { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 12px; }
.fs-motd-when b { font-family: var(--fs-display); font-size: 22px; font-weight: 700; }
.fs-countdown { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px; border-radius: 12px; background: #0f1115; border: 1px solid var(--fs-border); }
.fs-countdown-label { font-size: 12px; color: var(--fs-muted); }
.fs-countdown-digits { display: flex; align-items: flex-start; gap: 4px; font-family: var(--fs-display); }
.fs-countdown-digits > span { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 50px; }
.fs-countdown-digits > span[hidden] { display: none; }
.fs-countdown-digits b { font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.fs-countdown-digits b.is-accent { color: var(--fs-accent); }
.fs-countdown-digits small { font-family: 'Onest', sans-serif; font-size: 11px; color: var(--fs-faint); }
.fs-countdown-digits i { font-style: normal; font-size: 28px; font-weight: 700; line-height: 1; color: #4b5361; }
.fs-countdown-done { display: none; align-items: center; gap: 8px; font-weight: 600; color: var(--fs-live); }
.fs-countdown.is-started .fs-countdown-label, .fs-countdown.is-started .fs-countdown-digits { display: none; }
.fs-countdown.is-started .fs-countdown-done { display: inline-flex; }
.fs-motd-form { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fs-motd-form > span { display: flex; gap: 3px; }
.fs-motd .fs-btn { margin-top: auto; }
.fs-motd-venue { font-size: 12px; color: var(--fs-faint); text-align: center; }

.fs-scorers { display: flex; flex-direction: column; }
.fs-sub { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 12px; color: var(--fs-faint); }
.fs-scorer { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--fs-line); }
.fs-scorer-pos { flex: 0 0 16px; font-size: 13px; color: var(--fs-faint); }
a.fs-scorer { color: var(--fs-text); }
a.fs-scorer:hover .fs-scorer-who b { color: var(--fs-accent); }
/* аватар бомбардира: фото игрока с гербом клуба в углу; без фото — просто герб */
.fs-scorer-ava { position: relative; flex: 0 0 auto; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #1f2229; }
.fs-scorer-ava.has-photo { box-shadow: 0 0 0 2px #2a2d35; }
.fs-scorer-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; }
.fs-scorer-club { position: absolute; right: -5px; bottom: -4px; width: 20px; height: 20px; padding: 2px; border-radius: 50%; background: var(--fs-surface); object-fit: contain; }
.fs-scorer-crest { width: 24px; height: 24px; object-fit: contain; }
.fs-scorer-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fs-scorer-who b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-scorer-who small { font-size: 12px; color: var(--fs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-scorer-goals { flex: 0 0 auto; font-family: var(--fs-display); font-size: 18px; font-weight: 700; }

/* шапка на главной */
header .fs-livepill { margin-left: 4px; }

@media (max-width: 700px) {
    main.wrap--wide { padding-top: 20px; }
    header .fs-livepill { order: 1; margin-left: auto; height: 30px; padding: 0 10px; font-size: 12px; }
    header nav { order: 2; width: 100%; }
    .fs-section { margin-bottom: 32px; }
    .fs-h2 { font-size: 18px; }
    .fs-head { gap: 10px; }
    .fs-tabs { order: 3; width: 100%; }
    .fs-tab { flex: 1 1 0; height: 40px; padding: 0 8px; }
    .fs-scroller { margin: 0 -20px; padding: 2px 20px 8px; scroll-padding-left: 20px; }
    .fs-rail.can-prev .fs-arrow--prev, .fs-rail.can-next .fs-arrow--next { display: none; }
    .fs-card { flex-basis: 220px; }
    .fs-hero-title { font-size: 21px; }
    .fs-lead { font-size: 15px; }
    .fs-item { gap: 12px; padding: 12px 0; }
    .fs-item-title { font-size: 16px; }
    .fs-cover--thumb { flex-basis: 112px; width: 112px; height: 70px; }
    .fs-cover-chip { padding: 5px 8px; font-size: 10px; }
    .fs-empty { padding: 16px; }
    /* «Ещё новости» на телефоне — компактным списком, как блок справа от главной */
    .fs-grid { flex-direction: column; gap: 0; }
    .fs-tile { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) 112px; grid-template-areas: "meta cover" "title cover"; align-content: start; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--fs-line); }
    .fs-tile .fs-cover { grid-area: cover; width: 112px; height: 70px; aspect-ratio: auto; border-radius: 10px; }
    .fs-tile .fs-meta { grid-area: meta; }
    .fs-tile .fs-tile-title { grid-area: title; font-size: 16px; }
    .fs-tile .fs-cover-num em { display: none; }
    .fs-tile .fs-cover-num b { font-size: 34cqw; }
    .fs-tile .fs-cover-num i { font-size: 10cqw; }
    .fs-tile .fs-cover-word { font-size: 12cqw; }
    /* статистика на телефоне: сначала матч дня, в таблице — только И, О и форма */
    .fs-stats-row { gap: 16px; }
    .fs-motd { order: -1; }
    .fs-panel-card { padding: 16px; }
    .fs-h3 { font-size: 15px; }
    .fs-card-head .fs-more { padding: 0; }
    .fs-ltabs { margin: 0 -16px; padding: 0 16px; }
    .fs-trow { grid-template-columns: 28px minmax(0, 1fr) 26px 32px 96px; min-width: 0; }
    .fs-trow > :nth-child(4), .fs-trow > :nth-child(5), .fs-trow > :nth-child(6), .fs-trow > :nth-child(7) { display: none; }
    .fs-form { width: 16px; height: 16px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    .fs-pulse { animation: none; }
    .fs-card, .fs-cover img, .fs-pitch, .fs-title { transition: none; }
}

/* motd-eurocups: подпись «Матч дня» в одну строку; длинная стадия еврокубка («Лига чемпионов · 1/8 финала») переносится справа */
.fs-motd-label { white-space: nowrap; flex-shrink: 0; }
.fs-motd-league { min-width: 0; }
