/* ==========================================================================
   CSTV — «Киберспорт» (esports-style.css)
   Подключать ПОСЛЕДНИМ. Пункты: 1 плотность · 3 шрифты · 4 строка матча
   5 лента-шапка и навигация · 7 фон и детали · 8 флаги команд на фоне + прогнозы в строке матча.
   Отключается скином minimal. Откат: убрать <link> на этот файл.
   ========================================================================== */

:root{
  --es-r:4px;           /* единый маленький радиус */
  --es-accent:var(--accent,#3D7FFF);
  --es-accent-rgb:var(--accent-rgb,61,127,255);
  --es-live:#ff4d4d;
  --es-win:#3ddc84;
  --es-head:'Oswald','Arial Narrow',Impact,sans-serif;
  --es-mono:'JetBrains Mono','Roboto Mono','SF Mono',Consolas,ui-monospace,monospace;
}

/* ---------- 7. Фон: сетка + шум + свечение сверху ---------- */
html:not([data-skin="minimal"]) body {
  background-color:var(--bg,#070A10);
  background-image:
    radial-gradient(900px 380px at 50% -120px,rgba(var(--es-accent-rgb),.16),transparent 70%),
    linear-gradient(rgba(255,255,255,.022) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.022) 1px,transparent 1px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size:auto,32px 32px,32px 32px,160px 160px;
  background-attachment:fixed,scroll,scroll,scroll;
}

/* ---------- 3. Шрифты: заголовки капсом, цифры моноширинные ---------- */
html:not([data-skin="minimal"]) body h1,html:not([data-skin="minimal"]) body h2,html:not([data-skin="minimal"]) body .section-title,html:not([data-skin="minimal"]) body .th-sec-title,html:not([data-skin="minimal"]) body .match-date-head,html:not([data-skin="minimal"]) body .nav-title,html:not([data-skin="minimal"]) body .ah-title{
  font-family:var(--es-head);text-transform:uppercase;letter-spacing:.05em;font-weight:700}
html:not([data-skin="minimal"]) body .section-title{font-size:22px}
html:not([data-skin="minimal"]) body .th-sec-title,html:not([data-skin="minimal"]) body .nav-title{font-size:13px;color:var(--muted)}
html:not([data-skin="minimal"]) body .mono,html:not([data-skin="minimal"]) body .tk-score,html:not([data-skin="minimal"]) body .tvres,html:not([data-skin="minimal"]) body td.num,html:not([data-skin="minimal"]) body th.num,html:not([data-skin="minimal"]) body .bc-num,html:not([data-skin="minimal"]) body .rkc-pts,html:not([data-skin="minimal"]) body .tai-mt em,html:not([data-skin="minimal"]) body .mr-center .mono{
  font-family:var(--es-mono);font-variant-numeric:tabular-nums;letter-spacing:-.01em}
html:not([data-skin="minimal"]) body table td,html:not([data-skin="minimal"]) body table th{font-variant-numeric:tabular-nums}
html:not([data-skin="minimal"]) body table th{font-family:var(--es-head);text-transform:uppercase;letter-spacing:.06em;font-size:12px;font-weight:700;color:var(--muted)}
html:not([data-skin="minimal"]) body .logo{font-family:var(--es-head);letter-spacing:.06em}

/* ---------- 1. Плотность: маленькие радиусы, тесные таблицы ---------- */
html:not([data-skin="minimal"]) body .card,html:not([data-skin="minimal"]) body .panel-box,html:not([data-skin="minimal"]) body .rkc,html:not([data-skin="minimal"]) body .tai-card,html:not([data-skin="minimal"]) body .live-now-strip,html:not([data-skin="minimal"]) body .btn,html:not([data-skin="minimal"]) body input,html:not([data-skin="minimal"]) body select,html:not([data-skin="minimal"]) body textarea,
html:not([data-skin="minimal"]) body .mf-tabs button,html:not([data-skin="minimal"]) body .ah-season{border-radius:var(--es-r)}
html:not([data-skin="minimal"]) body table td,html:not([data-skin="minimal"]) body table th{padding:6px 10px}
html:not([data-skin="minimal"]) body table tbody tr{transition:background .12s}
html:not([data-skin="minimal"]) body table tbody tr:nth-child(even){background:rgba(255,255,255,.022)}
html:not([data-skin="minimal"]) body table tbody tr:hover{background:rgba(var(--es-accent-rgb),.09)}
html:not([data-skin="minimal"]) body .rkc-head{padding:7px 14px}
html:not([data-skin="minimal"]) body .rkc{margin-bottom:6px}
html:not([data-skin="minimal"]) body .toolbar{gap:6px}
html:not([data-skin="minimal"]) body .toolbar input,html:not([data-skin="minimal"]) body .toolbar select{padding-top:6px;padding-bottom:6px}
html:not([data-skin="minimal"]) body .mf-tabs{display:flex;gap:0;border-bottom:1px solid var(--border);margin:10px 0}
html:not([data-skin="minimal"]) body .mf-tabs button{font-family:var(--es-head);text-transform:uppercase;letter-spacing:.05em;border-radius:0;background:transparent;
  border:0;border-bottom:2px solid transparent;padding:8px 16px;margin-bottom:-1px}
html:not([data-skin="minimal"]) body .mf-tabs button.active{border-bottom-color:var(--es-accent);color:var(--text,#fff)}
html:not([data-skin="minimal"]) body .mf-tabs button.has-live span{background:var(--es-live);color:#fff}

/* ---------- 4. Строка матча как у HLTV ---------- */
html:not([data-skin="minimal"]) body .match-date-head{display:flex;align-items:center;gap:12px;margin:18px 0 6px;font-size:13px;color:var(--muted)}
html:not([data-skin="minimal"]) body .match-date-head::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,var(--border),transparent)}
html:not([data-skin="minimal"]) body .match-row{position:relative;display:flex;align-items:center;flex-wrap:wrap;gap:2px 14px;min-height:46px;
  padding:6px 14px;margin:0 0 4px;border:1px solid var(--border);border-left:3px solid var(--border);
  background:var(--bg-elev);border-radius:var(--es-r);transition:background .12s,border-color .12s}
html:not([data-skin="minimal"]) body .match-row:hover{background:var(--bg-elev-2);border-left-color:var(--es-accent)}
html:not([data-skin="minimal"]) body .match-row.st-scheduled{border-left-color:rgba(var(--es-accent-rgb),.7)}
html:not([data-skin="minimal"]) body .match-row.st-pending{border-left-style:dashed;opacity:.85}
html:not([data-skin="minimal"]) body .match-row.is-live{border-color:rgba(255,77,77,.5);border-left-color:var(--es-live);
  background:linear-gradient(90deg,rgba(255,77,77,.12),var(--bg-elev) 45%);box-shadow:inset 0 0 28px rgba(255,77,77,.07)}
/* левая колонка: стадия/турнир */
html:not([data-skin="minimal"]) body .match-row .mr-meta{flex:0 0 190px;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-family:var(--es-head);text-transform:uppercase;letter-spacing:.05em;font-size:12px;color:var(--muted)}
/* центр: TAG [флаг]  счёт  [флаг] TAG */
html:not([data-skin="minimal"]) body .match-row .mr-teams{flex:1 1 300px;display:grid;grid-template-columns:minmax(0,1fr) 92px minmax(0,1fr);align-items:center;gap:8px}
html:not([data-skin="minimal"]) body .match-row .mr-team{display:flex;align-items:center;gap:8px;min-width:0;cursor:pointer;
  font-weight:800;font-size:15px;letter-spacing:.02em}
html:not([data-skin="minimal"]) body .match-row .mr-team.right{justify-content:flex-end;text-align:right}
html:not([data-skin="minimal"]) body .match-row .mr-team:hover span{color:var(--es-accent)}
html:not([data-skin="minimal"]) body .match-row .mr-team.win span{color:var(--text,#fff)}
html:not([data-skin="minimal"]) body .match-row .mr-team.lose span{color:var(--muted);font-weight:600}
html:not([data-skin="minimal"]) body .match-row .mr-center{display:flex;justify-content:center}
html:not([data-skin="minimal"]) body .match-row .mr-center .mono{padding:2px 10px;border-radius:var(--es-r);background:rgba(0,0,0,.35);
  border:1px solid var(--border);min-width:64px;text-align:center;font-size:18px !important;font-weight:800 !important}
html:not([data-skin="minimal"]) body .match-row.is-live .mr-center .mono{border-color:rgba(255,77,77,.6);color:#ff8a8a;text-shadow:0 0 12px rgba(255,77,77,.5)}
html:not([data-skin="minimal"]) body .match-row.st-scheduled .mr-center .mono{color:var(--es-accent);font-size:15px !important}
/* статус компактной таблеткой, действия вправо */
html:not([data-skin="minimal"]) body .match-row .mr-status .status{font-family:var(--es-head);text-transform:uppercase;letter-spacing:.06em;font-size:11px;
  padding:2px 8px;border-radius:2px}
html:not([data-skin="minimal"]) body .match-row .mr-actions{margin-left:auto}
html:not([data-skin="minimal"]) body .match-row .mr-actions .btn{padding:4px 10px;font-size:12px}
/* срезанный правый верхний угол */
html:not([data-skin="minimal"]) body .match-row,html:not([data-skin="minimal"]) body .tai-card{clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%)}
html:not([data-skin="minimal"]) body .match-row::after,html:not([data-skin="minimal"]) body .tai-card::after{content:"";position:absolute;top:0;right:0;width:10px;height:10px;pointer-events:none;
  background:linear-gradient(225deg,var(--bg,#070A10) 50%,var(--border) 50%,var(--border) calc(50% + 1px),transparent calc(50% + 1px))}
html:not([data-skin="minimal"]) body .match-row.is-live::after{background:linear-gradient(225deg,var(--bg,#070A10) 50%,var(--es-live) 50%,var(--es-live) calc(50% + 1px),transparent calc(50% + 1px))}
/* карточка матча в профиле команды */
html:not([data-skin="minimal"]) body .tai-card{position:relative;border:1px solid var(--border);background:var(--bg-elev)}
html:not([data-skin="minimal"]) body .tai-ev{font-family:var(--es-head);text-transform:uppercase;letter-spacing:.05em;font-size:11px;color:var(--muted)}
html:not([data-skin="minimal"]) body .tai-mt em.w{color:var(--es-win);text-shadow:0 0 10px rgba(61,220,132,.45)}
html:not([data-skin="minimal"]) body .tai-mt em.l{color:var(--muted)}
html:not([data-skin="minimal"]) body .tvres{padding:1px 8px;border-radius:2px;font-weight:800}
html:not([data-skin="minimal"]) body .tvres.win{color:var(--es-win);background:rgba(61,220,132,.12);box-shadow:inset 3px 0 0 var(--es-win)}
html:not([data-skin="minimal"]) body .tvres.loss{color:#ff7b7b;background:rgba(255,77,77,.10);box-shadow:inset 3px 0 0 #ff4d4d}

/* ---------- 5. Лента-шапка (чуть шире) и навигация ---------- */
html:not([data-skin="minimal"]) body .ticker-wrap{display:flex;align-items:stretch;min-height:42px;
  background:linear-gradient(180deg,rgba(255,255,255,.03),transparent),var(--ticker-bg,#0C121B);
  border-top:1px solid var(--border);border-bottom:2px solid rgba(var(--es-accent-rgb),.55)}
html:not([data-skin="minimal"]) body .ticker-wrap .tag{display:flex;align-items:center;gap:8px;padding:0 16px;font-family:var(--es-head);text-transform:uppercase;
  letter-spacing:.08em;font-size:13px;font-weight:700;background:var(--es-accent);color:#fff;
  clip-path:polygon(0 0,100% 0,calc(100% - 12px) 100%,0 100%);padding-right:26px}
html:not([data-skin="minimal"]) body .ticker-wrap .tk-live{width:8px;height:8px;border-radius:50%;background:#fff;box-shadow:0 0 0 0 rgba(255,255,255,.7);animation:esPulse 1.4s infinite}
@keyframes esPulse{70%{box-shadow:0 0 0 7px rgba(255,255,255,0)}100%{box-shadow:0 0 0 0 rgba(255,255,255,0)}}
html:not([data-skin="minimal"]) body .tk-item{display:inline-flex;align-items:center;gap:10px;padding:0 20px;min-height:42px;border-right:1px solid var(--border);
  text-decoration:none;transition:background .12s}
html:not([data-skin="minimal"]) body .tk-item:hover{background:rgba(var(--es-accent-rgb),.12)}
html:not([data-skin="minimal"]) body .tk-team{font-weight:800;font-size:14px;letter-spacing:.03em}
html:not([data-skin="minimal"]) body .tk-team.win{color:var(--text,#fff)}
html:not([data-skin="minimal"]) body .tk-team.lose{color:var(--muted);font-weight:600}
html:not([data-skin="minimal"]) body .tk-score{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:2px;background:rgba(0,0,0,.4);
  border:1px solid var(--border);font-size:15px;font-weight:800}
html:not([data-skin="minimal"]) body .tk-score b.win{color:var(--es-win)}
html:not([data-skin="minimal"]) body .tk-score i{color:var(--muted);font-style:normal}
html:not([data-skin="minimal"]) body .tk-stage{font-family:var(--es-head);text-transform:uppercase;letter-spacing:.05em;font-size:11px;color:var(--muted)}
/* «Сейчас в эфире» */
html:not([data-skin="minimal"]) body .live-now-strip{border:1px solid rgba(255,77,77,.4);background:linear-gradient(90deg,rgba(255,77,77,.12),transparent 60%)}
html:not([data-skin="minimal"]) body .lns-label{font-family:var(--es-head);text-transform:uppercase;letter-spacing:.06em;color:#ff7b7b}
/* навигация: капс и акцентная линия у активного пункта */
html:not([data-skin="minimal"]) body .nav-item{font-family:var(--es-head);text-transform:uppercase;letter-spacing:.06em;font-size:14px;font-weight:600;
  border-radius:var(--es-r);transition:background .12s,color .12s,box-shadow .12s}
html:not([data-skin="minimal"]) body .nav-item:hover{background:rgba(var(--es-accent-rgb),.1)}
html[data-layout="side"]:not([data-skin="minimal"]) .nav-item.active{box-shadow:inset 3px 0 0 var(--es-accent);background:rgba(var(--es-accent-rgb),.12)}
html:not([data-layout="side"]):not([data-skin="minimal"]) .nav-item.active{box-shadow:inset 0 -2px 0 var(--es-accent)}

/* ---------- Мобильные ---------- */
@media (max-width:720px){
  html:not([data-skin="minimal"]) body .match-row .mr-meta{flex:1 1 100%;max-width:100%}
  html:not([data-skin="minimal"]) body .match-row .mr-teams{grid-template-columns:minmax(0,1fr) 72px minmax(0,1fr)}
  html:not([data-skin="minimal"]) body .tk-item{padding:0 14px}
  html:not([data-skin="minimal"]) body .ticker-wrap .tag{padding:0 18px 0 12px}
}
@media (prefers-reduced-motion:reduce){html:not([data-skin="minimal"]) body .ticker-wrap .tk-live{animation:none}}


/* ---------- 8. Флаг команды на фоне (везде, где показана команда) ----------
   <i class="tfbg tfbg-l|r|c" style="--tf:url(...)"> вставляется из app.js (teamFlagBgHtml)
   внутрь контейнера .has-tfbg. l/r — флаг у левого/правого края с затуханием к центру,
   c — на всю карточку с затуханием вниз. Сила — переменная --tf-op. */
.has-tfbg{position:relative;isolation:isolate}
.tfbg{position:absolute;top:0;bottom:0;z-index:-1;pointer-events:none;border-radius:inherit;
  width:46%;background:var(--tf) center/cover no-repeat;opacity:var(--tf-op,.22)}
.tfbg-l{left:0;-webkit-mask-image:linear-gradient(90deg,#000 0%,rgba(0,0,0,.4) 55%,transparent 100%);
  mask-image:linear-gradient(90deg,#000 0%,rgba(0,0,0,.4) 55%,transparent 100%)}
.tfbg-r{right:0;-webkit-mask-image:linear-gradient(270deg,#000 0%,rgba(0,0,0,.4) 55%,transparent 100%);
  mask-image:linear-gradient(270deg,#000 0%,rgba(0,0,0,.4) 55%,transparent 100%)}
.tfbg-c{left:0;right:0;width:auto;--tf-op:.18;
  -webkit-mask-image:linear-gradient(180deg,#000 0%,rgba(0,0,0,.25) 70%,transparent 100%);
  mask-image:linear-gradient(180deg,#000 0%,rgba(0,0,0,.25) 70%,transparent 100%)}
.match-hero .tfbg,.th-hero .tfbg{width:55%;--tf-op:.26}
.tk-item .tfbg{--tf-op:.3}
.tai-card .tfbg,.rk-head .tfbg,.rkc-head .tfbg{--tf-op:.2}
html[data-theme="light"] .tfbg{--tf-op:.32}
html[data-skin="minimal"] .tfbg{display:none}

/* ---------- 8b. Публичные прогнозы «кто победит» прямо в строке матча ---------- */
.mr-pick{order:5;width:100%;display:flex;align-items:center;gap:10px;padding:2px 0 0;box-sizing:border-box}
.mrp-lbl{flex:0 0 auto;min-width:82px;display:inline-flex;align-items:center;gap:6px;box-sizing:border-box;
  padding:2px 8px;line-height:1.4;font-size:12px;letter-spacing:.05em;text-transform:uppercase;
  font-family:var(--es-head,inherit);color:var(--muted);background:transparent;
  border:1px solid var(--border);border-radius:var(--es-r,4px);cursor:default}
.mrp-lbl.l{justify-content:flex-start}
.mrp-lbl.r{justify-content:flex-end}
.mrp-lbl b{font-family:var(--es-mono,ui-monospace,monospace);font-variant-numeric:tabular-nums;font-size:13px;color:var(--text,#fff)}
button.mrp-lbl{cursor:pointer;transition:border-color .12s,background .12s,color .12s}
button.mrp-lbl:hover{border-color:var(--es-accent,var(--accent));background:rgba(var(--es-accent-rgb,61,127,255),.12);color:var(--text,#fff)}
.mrp-lbl.mine{border-color:var(--es-accent,var(--accent));box-shadow:inset 0 0 0 1px var(--es-accent,var(--accent));color:var(--text,#fff)}
.mrp-lbl.crowd-win b{color:var(--es-win,#3ddc84)}
.mrp-mid{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.mrp-track{display:flex;height:6px;border-radius:3px;overflow:hidden;background:rgba(255,255,255,.08)}
.mrp-track i{display:block;height:100%;transition:width .35s}
.mrp-f1{background:var(--mh-a,#3a7bd5)}
.mrp-f2{background:var(--mh-b,#d55a3a)}
.mr-pick.empty .mrp-f1,.mr-pick.empty .mrp-f2{background:rgba(255,255,255,.14)}
.mrp-info{text-align:center;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.match-hero .mr-pick{order:0}
@media (max-width:720px){
  .mrp-lbl{min-width:0;padding:2px 6px}
  .mrp-info{display:none}
}

/* ---------- 8c. Фоновый флаг — только в матче ----------
   Рейтинг, лента-шапка, карточки команд, призы и т.д. — без фонового флага.
   Остаётся в строке матча, шапке матча и карточке матча в профиле команды.
   Вернуть везде: удалить этот блок. */
.tfbg{display:none}
.match-row .tfbg,.match-hero .tfbg,.tai-card .tfbg{display:block}


/* ---------- 9. Динамичный фон (переключается в Настройках: data-bg="static" отключает) ----------
   Базовый цвет переносится на html, а body становится прозрачным — иначе body
   закрывает анимированные слои. Слои: плывущие свечения (::before), сетка (::after). */
html:not([data-skin="minimal"]):not([data-bg="static"]){background-color:var(--bg,#070A10)}
html:not([data-skin="minimal"]):not([data-bg="static"]) body{background:transparent !important}
html:not([data-skin="minimal"]):not([data-bg="static"])::before,
html:not([data-skin="minimal"]):not([data-bg="static"])::after{
  content:"";position:fixed;z-index:-1;pointer-events:none;will-change:transform}
html:not([data-skin="minimal"]):not([data-bg="static"])::before{
  inset:-25%;
  background:
    radial-gradient(38vmax 32vmax at 20% 30%,rgba(var(--es-accent-rgb),.30),transparent 70%),
    radial-gradient(42vmax 34vmax at 80% 20%,rgba(var(--es-accent-rgb),.18),transparent 70%),
    radial-gradient(40vmax 38vmax at 60% 85%,rgba(130,80,255,.20),transparent 70%);
  animation:esBgDrift 16s ease-in-out infinite alternate}
html:not([data-skin="minimal"]):not([data-bg="static"])::after{
  inset:0;
  background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);
  background-size:32px 32px;
  -webkit-mask-image:radial-gradient(ellipse at 50% 30%,#000 0%,transparent 75%);
  mask-image:radial-gradient(ellipse at 50% 30%,#000 0%,transparent 75%);
  animation:esGridMove 12s linear infinite}
@keyframes esBgDrift{
  0%{transform:translate3d(-8%,-6%,0) scale(1)}
  50%{transform:translate3d(9%,6%,0) scale(1.15)}
  100%{transform:translate3d(-3%,10%,0) scale(1.05)}}
@keyframes esGridMove{from{background-position:0 0}to{background-position:32px 64px}}
html[data-theme="light"]:not([data-bg="static"])::before{opacity:.5}
html[data-theme="light"]:not([data-bg="static"])::after{opacity:.3}
@media (prefers-reduced-motion:reduce){
  html::before,html::after{animation:none !important}}
