/* ============================================================
   Экран матча: трансляционное табло, поле, дуэли, таймлайн,
   интро событий, хроника, сплэш гола, мобильная вёрстка
   ============================================================ */

.match-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  position: relative;
}

/* ---------- Верхняя панель управления (выше строки команд и табло) ---------- */
.sb-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 7px 22px 0;
  position: relative;
  /* поповеры громкости — над полем и панелями */
  z-index: 40;
}
/* «закрыть матч» — как крестик окна приложения, всегда крайняя справа */
.btn-close-match {
  margin-left: 2px;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  color: #ff9aa1;
  background: rgba(224, 40, 48, 0.12);
  border: 1px solid rgba(224, 40, 48, 0.45);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-close-match:hover { background: rgba(224, 40, 48, 0.3); color: #fff; border-color: var(--red); transform: scale(1.06); }

/* ---------- Табло ---------- */
.sb {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 8px 22px 10px;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.92), rgba(8, 12, 20, 0.78));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 30;
}
.sb-team { min-width: 170px; }
.sb-team.sb-away { text-align: right; }
.sb-name { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-name.me { color: var(--gold-2); }
.sb-name.me::after { content: var(--you-tag, ' (вы)'); font-size: 11px; color: var(--gold-dim); }
.sb-meta { font-size: 11.5px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }
.sb-away .sb-meta { justify-content: flex-end; }
.sb-syn {
  color: var(--gold-2);
  border: 1px solid var(--gold-dim);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  white-space: nowrap;
}
.sb-team.attacking .sb-name { animation: attackPulse 1.2s ease-in-out infinite; }
@keyframes attackPulse { 50% { text-shadow: 0 0 14px rgba(245, 215, 110, 0.8); } }

.sb-center { text-align: center; }
.sb-score { font-size: 30px; font-weight: 900; letter-spacing: 2px; line-height: 1.05; }
.sb-clock { font-size: 17px; color: var(--gold-2); font-weight: 700; }
.sb-half { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-faint); }

/* ---------- Импульс ---------- */
.sb-momentum { width: 190px; }
.mom-row { display: flex; align-items: center; gap: 6px; }
.mom-team { font-size: 10.5px; font-weight: 800; color: var(--text-dim); min-width: 26px; text-align: center; }
.mom-team.hot { color: var(--gold-2); text-shadow: 0 0 8px rgba(245,215,110,0.5); }
.mom-team.cold { color: var(--text-faint); }
.mom-info {
  font-size: 9.5px;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.05);
  color: var(--gold-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.mom-info:hover { border-color: var(--gold); color: var(--gold-2); }
.mom-bar {
  position: relative;
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
/* две заливки: левая (команда 0) растёт от центра влево,
   правая (команда 1) — от центра вправо; pos = подъём, neg = спад */
.mom-fill {
  position: absolute;
  top: 0; bottom: 0;
  width: 0%;
  transition: width 0.8s ease, background 0.4s;
}
.mom-l { right: 50%; left: auto; border-radius: 999px 0 0 999px; }
.mom-r { left: 50%; right: auto; border-radius: 0 999px 999px 0; }
.mom-fill.pos { background: linear-gradient(90deg, #3a6fd8, #6fa3ff); box-shadow: 0 0 8px rgba(111, 163, 255, 0.55); }
.mom-fill.neg { background: linear-gradient(90deg, #ff6b5e, #d82a34); box-shadow: 0 0 8px rgba(216, 42, 52, 0.5); }
.mom-fill.mom-r.pos { background: linear-gradient(90deg, #6fa3ff, #3a6fd8); }
.mom-fill.mom-r.neg { background: linear-gradient(90deg, #d82a34, #ff6b5e); }
.mom-tick { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255,255,255,0.35); }
.mom-pct { font-size: 10px; text-align: center; color: var(--text-dim); margin-top: 3px; letter-spacing: 0.5px; cursor: default; white-space: nowrap; overflow: hidden; }
.mom-pct.lead { color: var(--gold-2); font-weight: 800; cursor: help; }
.mom-help-text { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.mom-help-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.mom-help-pct { margin-top: 12px; text-align: center; color: var(--gold-2); font-weight: 800; }

/* ---------- Контролы шапки (в sb-topbar) ---------- */
.sb-log-btn { display: none; }
.ml-close { display: none; }

/* ---------- Центр: поле + хроника + дуэль ---------- */
.match-center {
  flex: 1;
  position: relative;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 14px 22px 8px;
  gap: 20px;
}

.pitch-wrap {
  position: relative;
  flex: 1;
  max-width: 760px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.18);
  /* тон под апрон SVG, чтобы letterbox при meet не выделялся */
  background: #0a0f14;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.6), var(--shadow-md);
}

.pitch { width: 100%; height: 100%; display: block; color: rgba(220, 255, 230, 0.4); }
.pitch-line { stroke: currentColor; stroke-width: 0.35; opacity: 0.75; }

/* ворота: рамка + сетка */
.goal-frame { fill: rgba(10, 16, 26, 0.85); stroke: rgba(240, 250, 255, 0.85); stroke-width: 0.5; }
.goal-net { stroke: rgba(230, 240, 255, 0.35); stroke-width: 0.18; }
.goal.scored .goal-frame { stroke: #f5d76e; stroke-width: 0.8; filter: drop-shadow(0 0 3px rgba(245,215,110,0.9)); }
.goal.scored { animation: goalFlash 0.5s ease-out 3; }
@keyframes goalFlash { 50% { opacity: 0.35; } }

#ball { filter: drop-shadow(0 0 3px rgba(255,255,255,0.8)); transition: cx 0.9s ease, cy 0.9s ease; }
#event-marker { animation: none; }
#event-marker.visible { animation: markerPulse 1.2s ease-out infinite; }
@keyframes markerPulse {
  0% { r: 2; opacity: 0.9; }
  100% { r: 6; opacity: 0; }
}

/* мини-баннер события над полем */
.event-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translate(-50%, -130%);
  background: rgba(8, 12, 20, 0.92);
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
  padding: 10px 22px;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1.2);
  z-index: 5;
  min-width: 220px;
  box-shadow: var(--shadow-md);
}
.event-banner.show { transform: translate(-50%, 0); }
.eb-head { font-size: 18px; font-weight: 900; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; justify-content: center; }
.eb-head.drama { color: var(--gold-2); text-shadow: 0 0 18px rgba(245, 215, 110, 0.6); }
.eb-icon { font-size: 22px; }
.eb-ot { font-size: 10px; background: var(--red); border-radius: 4px; padding: 2px 6px; letter-spacing: 1.5px; }
.eb-teams { font-size: 12px; color: var(--text-dim); margin-top: 3px; letter-spacing: 1px; }
.eb-deadline { height: 3px; margin-top: 8px; border-radius: 2px; background: rgba(255,255,255,0.1); overflow: hidden; }
.eb-deadline i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); }

/* ---------- Хроника матча ---------- */
.match-log {
  width: 252px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.ml-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-2);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ml-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ml-entry {
  border: 1px solid var(--line-soft);
  border-left: 3px solid #6a8fe0;
  border-radius: 8px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.03);
  animation: mlIn 0.35s ease;
  font-size: 11.5px;
  line-height: 1.45;
}
@keyframes mlIn { from { opacity: 0; transform: translateY(-8px); } }
.ml-entry.goal { border-left-color: var(--gold-2); background: rgba(212, 175, 55, 0.08); }
.ml-head { font-weight: 800; color: var(--text); font-size: 11px; letter-spacing: 0.4px; }
.ml-duel { color: var(--text-dim); margin-top: 2px; }
.ml-duel b { color: var(--gold-2); font-variant-numeric: tabular-nums; }
.ml-outcome { margin-top: 2px; color: var(--text-dim); }
.ml-goal { color: var(--gold-2); text-shadow: 0 0 10px rgba(245,215,110,0.4); }
.ml-save { color: #9ec6ff; }
.ml-mom { color: #c9f5d5; }
.ml-red { color: #ff8d94; }
.ml-var { color: #7cffbe; }

/* ---------- Дуэль ---------- */
.duel-area {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* таймер и карты дуэли — поверх табло и панелей */
  z-index: 45;
  opacity: 0;
  transition: opacity 0.4s;
}
.duel-area.show { opacity: 1; pointer-events: auto; }
.duel-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(4, 7, 12, 0.88) 30%, rgba(4, 7, 12, 0.55));
  backdrop-filter: blur(3px);
}
.duel-grid {
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
}
.duel-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.duel-team-name { font-size: 14px; font-weight: 800; letter-spacing: 1px; color: var(--text-dim); }
.role-tag {
  font-size: 9.5px;
  background: rgba(224, 40, 48, 0.25);
  color: #ff8d94;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 1.5px;
}
.role-tag.def { background: rgba(74, 143, 224, 0.25); color: #9ec6ff; }
.duel-slot { width: 190px; height: 268px; }
.duel-slot .card { width: 100%; height: 100%; }
/* шрифты вскрытых карт масштабируются под слот, имена — в две строки */
.duel-slot .card .card-name {
  font-size: 13px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.15;
  overflow: hidden;
}
.duel-slot .card .card-ovr { font-size: 24px; }
.duel-slot .card .card-ovr small { font-size: 8px; }
.duel-slot .card .card-pos { font-size: 10px; margin-top: 1px; }
.duel-slot .card .card-stats { gap: 10px; }
.duel-slot .card .card-stat b { font-size: 15px; }
.duel-slot .card .card-stat span { font-size: 7.5px; letter-spacing: 0.6px; }
.duel-slot .card .card-ability { font-size: 9.5px; }
.duel-slot .card .card-crest { width: 28px; height: 31px; }
.slot-q {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 900;
  color: rgba(212, 175, 55, 0.5);
  border: 2px dashed rgba(212, 175, 55, 0.4);
  border-radius: 14px 14px 20px 20px;
  background: rgba(10, 14, 24, 0.6);
}
.slot-q.ok { color: var(--green); border-color: var(--green); font-size: 54px; animation: popIn 0.3s cubic-bezier(0.2,0.7,0.2,1.4); }
@keyframes popIn { from { transform: scale(0.5); } }
.duel-power { font-size: 34px; font-weight: 900; color: var(--text); min-height: 40px; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(255,255,255,0.25); cursor: help; }
.duel-vs { font-size: 30px; font-weight: 900; color: var(--gold); letter-spacing: 2px; text-shadow: 0 0 20px rgba(212,175,55,0.5); }

.duel-outcome { position: relative; margin-top: 16px; text-align: center; min-height: 54px; }
.outcome { font-size: 26px; font-weight: 900; letter-spacing: 1.5px; animation: popIn 0.4s cubic-bezier(0.2,0.7,0.2,1.4); }
.goal-text { color: var(--gold-2); text-shadow: 0 0 30px rgba(245, 215, 110, 0.7); }
.save-text { color: #9ec6ff; }
.mom-text { color: #c9f5d5; }
.extra-badge {
  display: inline-block;
  margin: 6px 4px 0;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-soft);
  animation: popIn 0.4s cubic-bezier(0.2,0.7,0.2,1.4);
}
.extra-badge.red { border-color: var(--red); color: #ff8d94; }
.extra-badge.var_cancel_goal, .extra-badge.var_penalty { border-color: var(--gold); color: var(--gold-2); }

.card.winner { animation: winnerGlow 0.8s ease forwards; }
@keyframes winnerGlow {
  50% { transform: scale(1.07); }
  100% { box-shadow: 0 0 46px rgba(245, 215, 110, 0.65); outline: 2px solid var(--gold-2); }
}
.card.loser { filter: grayscale(0.8) brightness(0.55); transform: scale(0.94); }

.pre-match {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 15px;
}

/* ---------- Отсчёт события (в потоке дуэли) ---------- */
.duel-countdown {
  position: relative;
  font-size: 26px;
  font-weight: 900;
  color: var(--gold-2);
  text-shadow: 0 0 24px rgba(245,215,110,0.55);
  letter-spacing: 2px;
  padding: 2px 16px;
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid var(--gold-dim);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.duel-countdown.urgent { color: #ff8d94; border-color: var(--red); animation: cdBlink 0.6s steps(2) infinite; }
@keyframes cdBlink { 50% { opacity: 0.55; } }

/* ---------- Интро события ---------- */
.event-intro {
  position: absolute;
  inset: 0;
  /* карточка с таймером — поверх табло */
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.event-intro.show { display: flex; }
.ei-card {
  position: relative;
  max-width: 560px;
  width: 88%;
  max-height: 86%;
  padding: 26px 30px 22px;
  border-radius: 20px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(10, 16, 28, 0.96), rgba(7, 11, 20, 0.96));
  border: 1px solid var(--gold-dim);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), inset 0 0 60px rgba(212,175,55,0.05);
  animation: eiIn 0.45s cubic-bezier(0.2, 0.7, 0.25, 1.35);
  overflow: hidden;
  /* колонка: длинное описание скроллится, шапка и кнопки всегда видны */
  display: flex;
  flex-direction: column;
}
.ei-desc {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  opacity: 0.92;
}
.ei-hint { margin-top: 10px; font-size: 12px; color: var(--gold-dim); letter-spacing: 0.5px; flex-shrink: 0; }
@keyframes eiIn {
  from { transform: scale(0.6) translateY(30px); opacity: 0; }
  60% { transform: scale(1.04); }
  to { transform: scale(1); opacity: 1; }
}
.event-intro:not(.show) .ei-card { animation: eiOut 0.3s ease both; }
@keyframes eiOut { to { transform: scale(0.85) translateY(-20px); opacity: 0; } }

.ei-deco {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 84px;
  opacity: 0.10;
  pointer-events: none;
  filter: blur(1px);
}
.ei-icon { font-size: 52px; line-height: 1; filter: drop-shadow(0 4px 18px rgba(245,215,110,0.45)); animation: eiPulse 1.2s ease-in-out infinite; flex-shrink: 0; }
@keyframes eiPulse { 50% { transform: scale(1.12); } }
.ei-name { font-size: 28px; font-weight: 900; letter-spacing: 1.5px; margin-top: 8px; color: var(--text); flex-shrink: 0; }
.ei-drama { font-size: 12px; background: var(--gold); color: #241b05; border-radius: 6px; padding: 2px 8px; vertical-align: middle; letter-spacing: 1px; }
.ei-ot { font-size: 12px; background: var(--red); color: #fff; border-radius: 6px; padding: 2px 8px; vertical-align: middle; letter-spacing: 1px; }
.ei-teams { margin-top: 8px; font-size: 15px; color: var(--text-dim); letter-spacing: 1px; flex-shrink: 0; }
.ei-att { color: #ff8d94; font-weight: 800; }
.ei-def { color: #9ec6ff; font-weight: 800; }
.ei-count { position: absolute; top: 14px; left: 18px; right: auto; font-size: 15px; font-weight: 800; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.ei-close {
  position: absolute;
  top: 10px; right: 14px;
  font-size: 13px;
  color: var(--text-faint);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.ei-toggle {
  margin-top: 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.ei-toggle:hover { color: var(--text); border-color: var(--gold-dim); }
.event-intro:hover .ei-close { color: var(--text); border-color: var(--gold-dim); }

/* темы интро */
.event-intro.theme-goal .ei-card    { border-color: rgba(245,215,110,0.65); box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 60px rgba(245,215,110,0.18); }
.event-intro.theme-penalty .ei-card { border-color: rgba(255,120,120,0.6); }
.event-intro.theme-corner .ei-card  { background: linear-gradient(180deg, rgba(28,16,10,0.96), rgba(10,16,28,0.96)); border-color: rgba(232,180,137,0.5); }
.event-intro.theme-freekick .ei-card{ border-color: rgba(120,200,255,0.45); }
.event-intro.theme-duel .ei-card    { border-color: rgba(255,160,80,0.5); }
.event-intro.theme-offside .ei-card { background: repeating-linear-gradient(90deg, rgba(10,16,28,0.96) 0 26px, rgba(20,30,50,0.96) 26px 28px), rgba(10,16,28,0.96); border-color: rgba(160,200,255,0.4); }
.event-intro.theme-referee .ei-card { background: linear-gradient(135deg, rgba(50,44,8,0.96) 0 50%, rgba(10,16,28,0.96) 50% 100%); border-color: rgba(245,215,110,0.5); }
.event-intro.theme-var .ei-card     { background: repeating-linear-gradient(0deg, rgba(10,16,28,0.96) 0 6px, rgba(16,26,44,0.96) 6px 8px); border-color: rgba(120,255,180,0.4); }
.event-intro.theme-chaos .ei-card   { border-color: rgba(200,120,255,0.5); }
.event-intro.theme-chaos .ei-card .ei-icon { animation: eiSpin 2.4s linear infinite; }
@keyframes eiSpin { to { transform: rotate(360deg); } }
.event-intro.theme-fatigue .ei-card { border-color: rgba(120,200,160,0.4); }
.event-intro.theme-hero .ei-card    { border-color: rgba(255,200,80,0.7); box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 80px rgba(255,200,80,0.2); }
.event-intro.drama .ei-card { animation: eiIn 0.45s cubic-bezier(0.2,0.7,0.25,1.35), eiShake 0.5s ease 0.5s; }
@keyframes eiShake { 25% { transform: translateX(-6px) rotate(-0.6deg); } 75% { transform: translateX(6px) rotate(0.6deg); } }

/* ---------- Низ: сегментный таймлайн + рука ---------- */
.match-bottom { padding: 4px 22px 4px; display: flex; flex-direction: column; gap: 6px; }

.timeline { position: relative; padding: 10px 0 2px; }
.tl-bar {
  position: relative;
  height: 12px;
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
}
.tl-seg { position: relative; background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04)); }
.tl-seg.stop {
  background: repeating-linear-gradient(-45deg, rgba(212,175,55,0.20) 0 5px, rgba(212,175,55,0.06) 5px 10px);
}
.tl-seg.et { background: repeating-linear-gradient(-45deg, rgba(224,40,48,0.22) 0 5px, rgba(224,40,48,0.07) 5px 10px); }
.tl-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(212,175,55,0.25), rgba(245,215,110,0.55));
  pointer-events: none;
  transition: width 0.25s linear;
  mix-blend-mode: screen;
}
.tl-cursor {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--gold-2);
  box-shadow: 0 0 8px rgba(245,215,110,0.8);
  border-radius: 2px;
  pointer-events: none;
}
/* пины поверх полосы, выступают сверху и снизу */
.tl-marks { position: absolute; left: 0; right: 0; top: -6px; height: 24px; pointer-events: none; }
.tl-pin {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  animation: pinIn 0.35s cubic-bezier(0.2,0.7,0.2,1.4) forwards;
}
@keyframes pinIn { to { transform: translateY(-50%) scale(1); } }
.tl-pin.future { background: transparent; border: 1.5px solid var(--gold-dim); width: 7px; height: 7px; opacity: 0.75; }
.tl-pin.past {
  background: transparent;
  border: none;
  width: auto;
  height: auto;
  margin-left: -10px;
  font-size: 17px;
  line-height: 1;
  filter: saturate(0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.6);
}
.tl-pin.past.goal {
  font-size: 21px;
  animation: pinGoal 2.2s ease-in-out infinite;
}
@keyframes pinGoal {
  0%, 100% { text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(245,215,110,0.8); }
  50% { text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 20px rgba(245,215,110,1); }
}
.tl-labels {
  display: flex;
  margin-top: 14px;
  gap: 4px;
  font-size: 9.5px;
  color: var(--text-faint);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tl-seg-label { text-align: center; white-space: nowrap; overflow: hidden; }
.tl-seg-label.stop { color: var(--gold-dim); }
.tl-seg-label.et { color: rgba(255,120,120,0.8); }

/* ---------- Рука и скамейка ---------- */
.hand-bar { display: flex; gap: 14px; align-items: stretch; padding: 2px 0 8px; }
.hand-block { flex: 1; min-width: 0; position: relative; }
.bench-block {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--line-soft);
  padding-left: 14px;
}
.hand-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hand-label {
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.bench-tip { cursor: help; color: var(--gold-dim); }
.hand-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 4px 8px;
  min-height: 168px;
  align-items: center;
}
.hand-cards .card { animation: cardDeal 0.4s cubic-bezier(0.2,0.7,0.2,1.2) backwards; }
/* карта уже была в руке — не проигрываем раздачу заново при перерисовке */
.hand-cards .card.dealt { animation: none; }
.hand-empty { color: var(--text-faint); font-size: 13px; padding: 20px; }

.bench-cards { display: flex; flex-direction: column; gap: 5px; max-height: 158px; overflow-y: auto; }
.bench-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: rgba(35, 192, 90, 0.07);
  border: 1px solid rgba(35, 192, 90, 0.3);
  cursor: pointer;
  font-size: 12.5px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.bench-chip:hover { background: rgba(35, 192, 90, 0.15); border-color: var(--green); transform: translateX(-3px); }
.bench-chip b { color: var(--gold-2); font-size: 13px; }
.bench-chip .chip-pos { font-size: 9px; font-weight: 800; background: rgba(212,175,55,0.15); color: var(--gold-2); padding: 1px 5px; border-radius: 4px; }
.bench-chip em { font-style: normal; color: var(--green); font-size: 10.5px; margin-left: auto; opacity: 0.8; }
.bench-chip.off { opacity: 0.4; cursor: not-allowed; }
.bench-empty { color: var(--text-faint); font-size: 12px; padding: 8px; }

/* ---------- Подсказка выбора карты ---------- */
.hint-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #241b05;
  background: linear-gradient(180deg, #f5e08a, #d4af37);
  border: 1px solid rgba(255, 240, 180, 0.7);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.hint-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4); }
.hint-pop {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 8px;
  z-index: 40;
  width: 320px;
  background: rgba(10, 15, 26, 0.96);
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  line-height: 1.5;
  animation: popIn 0.3s cubic-bezier(0.2, 0.7, 0.2, 1.4);
  pointer-events: none;
}
.hint-pop.show { display: block; }
.hp-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 4px;
}
.hp-card b { color: var(--gold-2); font-size: 14px; }
.hp-line { color: var(--text-dim); margin-top: 3px; }
.hp-line b { color: var(--text); }
.card.hinted {
  outline: 2px dashed var(--gold-2);
  outline-offset: 2px;
  animation: hintPulse 1.1s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(245, 215, 110, 0.4); }
  50% { box-shadow: 0 0 30px rgba(245, 215, 110, 0.9); }
}
.sub-preview { display: flex; justify-content: center; margin: 12px 0; }

/* ---------- Бегущая строка ---------- */
.ticker {
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 12, 20, 0.9);
  padding: 9px 22px;
  min-height: 38px;
  display: flex;
  align-items: center;
}
.ticker-text { font-size: 14px; color: var(--text-dim); letter-spacing: 0.3px; }
.ticker-text.pop { animation: tickerPop 0.4s ease; color: var(--text); }
@keyframes tickerPop { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Оверлеи: перерыв / пенальти / итоги ---------- */
.match-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3, 5, 9, 0.7);
  backdrop-filter: blur(5px);
}
.match-overlay.show { display: flex; animation: fadeIn 0.3s; }

.ht-panel, .so-panel, .end-panel { padding: 30px 34px; text-align: center; max-width: 640px; width: 92%; }
.tactic-row { display: flex; gap: 12px; margin: 18px 0 10px; }
.tactic-btn { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 10px; }
.tb-icon { font-size: 26px; }
.tb-name { font-size: 15px; }
.tb-sub { font-size: 11px; color: var(--text-dim); }
.ht-wait { color: var(--text-dim); font-size: 13.5px; margin-top: 10px; }
/* обратный отсчёт до автопродолжения перерыва */
.ht-count {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 12px;
  font-size: 14px;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
}
.ht-count.urgent { color: #ff8d94; border-color: var(--red); animation: cdBlink 0.6s steps(2) infinite; }

.so-teams { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0 8px; }
.so-team { font-weight: 800; font-size: 15px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-tally { font-size: 30px; font-weight: 900; }
.so-dots { display: flex; flex-direction: column; gap: 8px; align-items: center; margin: 10px 0; }
.so-row { display: flex; gap: 7px; }
.so-dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-soft); }
.so-dot.goal { background: var(--green); border-color: var(--green); box-shadow: 0 0 8px rgba(35,192,90,0.7); }
.so-dot.miss { background: var(--red); border-color: var(--red); }
.so-action { min-height: 30px; font-size: 16px; margin: 6px 0; }
.so-count {
  display: inline-block;
  padding: 1px 10px;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  vertical-align: middle;
}
.so-count.urgent { color: #ff8d94; border-color: var(--red); animation: cdBlink 0.6s steps(2) infinite; }
.so-hint { margin-left: 10px; padding: 3px 10px; font-size: 13px; }
.so-hint-text { color: var(--gold-2); font-weight: 800; font-size: 14px; }
.so-cards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-height: 180px; overflow-y: auto; padding: 6px; }

.end-panel { animation: endPop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1.3); }
@keyframes endPop { from { transform: scale(0.7); opacity: 0; } }
.end-crest { font-size: 52px; }
.end-title { font-size: 34px; font-weight: 900; letter-spacing: 4px; margin: 6px 0; }
.end-score { font-size: 22px; color: var(--text-dim); }
.end-shootout, .end-forfeit { font-size: 13px; color: var(--text-faint); margin-top: 6px; }
.end-rewards { margin: 18px auto; max-width: 300px; }
.rw { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-dim); padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.rw b { color: var(--gold-2); }
.end-elo { min-height: 26px; margin-bottom: 6px; }

/* ---------- Сплэш гола ---------- */
.goal-splash {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.goal-splash.show { display: block; }
.gs-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 250, 220, 0.5), transparent 70%);
  animation: flashBurst 0.5s ease-out 2;
}
@keyframes flashBurst { from { opacity: 1; } to { opacity: 0; } }
.gs-body { position: relative; text-align: center; animation: goalIn 0.55s cubic-bezier(0.2, 0.7, 0.3, 1.4); }
.gs-word {
  font-size: clamp(64px, 14vw, 170px);
  font-weight: 900;
  letter-spacing: 8px;
  background: linear-gradient(180deg, #fff6d8 0%, #f5d76e 40%, #d4af37 70%, #8a6a12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px rgba(245, 215, 110, 0.55));
}
.gs-team { font-size: 26px; font-weight: 800; letter-spacing: 3px; color: var(--text); }
.gs-scorer { font-size: 16px; color: var(--text-dim); margin-top: 4px; }
@keyframes goalIn {
  from { transform: scale(0.4) rotate(-4deg); opacity: 0; }
  60% { transform: scale(1.08); }
  to { transform: scale(1); opacity: 1; }
}
.gs-confetti { position: absolute; inset: 0; overflow: hidden; }
.gs-confetti i {
  position: absolute;
  top: -14px;
  width: var(--s);
  height: calc(var(--s) * 0.42);
  background: var(--c);
  opacity: 0.9;
  border-radius: 2px;
  animation: confettiFall var(--t) linear var(--d) forwards;
  transform: rotate(20deg);
}
@keyframes confettiFall {
  to { transform: translateY(108vh) rotate(720deg); opacity: 0.7; }
}
@keyframes cardDeal {
  from { transform: translateY(40px) scale(0.7); opacity: 0; }
}

/* ---------- Телефоны ---------- */
@media (max-width: 620px) {
  /* панель управления — первой строкой, над табло */
  .sb-topbar { padding: 5px 8px 0; gap: 5px; justify-content: flex-start; }
  .sb-topbar .btn { padding: 4px 7px; font-size: 12px; }
  .sb-log-btn { display: flex; }
  .sb { grid-template-columns: 1fr auto 1fr; grid-auto-rows: auto; gap: 5px 8px; padding: 5px 10px 7px; }
  .sb-home { grid-row: 1; }
  .sb-center { grid-row: 1; }
  .sb-away { grid-row: 1; }
  /* импульс — полной шириной второй строкой шапки */
  .sb-momentum {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-top: 0;
  }
  .mom-pct { font-size: 9px; margin-top: 1px; }
  .mom-team { font-size: 9px; min-width: 22px; }
  .mom-info { width: 15px; height: 15px; font-size: 8.5px; }
  .sb-name { font-size: 11px; }
  .sb-score { font-size: 17px; white-space: nowrap; }
  .sb-clock { font-size: 12px; }
  .sb-half { font-size: 8px; }
  .sb-meta { font-size: 9px; }
  .sb-team { min-width: 0; }
  .sb-syn { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }

  /* поле крупнее: меньше отступов вокруг центра */
  .match-center { padding: 4px 6px 2px; gap: 0; }
  .pitch-wrap { border-radius: 10px; }
  .event-banner { min-width: 160px; padding: 6px 12px; top: 8px; }
  .eb-head { font-size: 13px; }
  .eb-icon { font-size: 15px; }

  .duel-grid { gap: 12px; }
  .duel-slot { width: 122px; height: 172px; }
  .duel-slot .card .card-ovr { font-size: 15px; }
  .duel-slot .card .card-ovr small { font-size: 6.5px; }
  .duel-slot .card .card-pos { font-size: 8px; }
  .duel-slot .card .card-name { font-size: 8.5px; margin: 2px 4px 0; letter-spacing: 0; }
  .duel-slot .card .card-stats { gap: 6px; padding: 4px 2px 3px; }
  .duel-slot .card .card-stat b { font-size: 11px; }
  .duel-slot .card .card-stat span { font-size: 6px; letter-spacing: 0.3px; }
  .duel-slot .card .card-ability { font-size: 7.5px; padding: 2px 4px; margin: 0 4px 4px; }
  .duel-slot .card .card-crest { width: 18px; height: 20px; }
  .duel-slot .card .card-top { padding: 5px 5px 0; }
  .duel-slot .card .card-club-band { margin: 3px 5px 0; }
  .duel-slot .card .card-stars { font-size: 6.5px; }
  .duel-vs { font-size: 18px; }
  .duel-power { font-size: 22px; }
  .duel-team-name { font-size: 10px; }
  .duel-countdown { font-size: 18px; padding: 1px 10px; margin-bottom: 4px; }
  .role-tag { font-size: 7.5px; padding: 1px 4px; }

  /* интро события: вся карточка компактна, описание скроллится */
  .event-intro .ei-card { padding: 14px 12px 12px; max-height: 92%; }
  .event-intro .ei-desc { max-height: 30vh; }
  .ei-icon { font-size: 30px; }
  .ei-name { font-size: 16px; margin-top: 5px; }
  .ei-desc { font-size: 11.5px; line-height: 1.45; }
  .ei-hint { font-size: 10px; margin-top: 7px; }
  .ei-teams { font-size: 12px; margin-top: 5px; }
  .ei-deco { font-size: 40px; }
  .ei-toggle { margin-top: 8px; font-size: 10px; padding: 4px 10px; }

  .match-bottom { padding: 2px 8px; }

  /* рука: одна горизонтальная полоса с прокруткой */
  .hand-bar { flex-direction: column; gap: 4px; }
  .hand-block { width: 100%; }
  .hand-cards { min-height: 128px; }
  .hand-cards .card { width: 88px; height: 124px; flex-shrink: 0; }
  .hand-cards .card .card-ovr { font-size: 15px; }
  .hand-cards .card .card-pos { font-size: 9px; }
  .hand-cards .card .card-stars { font-size: 7px; }
  .hand-cards .card .card-stat { gap: 6px; }
  .hand-cards .card .card-stats { gap: 6px; padding: 4px 3px 3px; }
  .hand-cards .card .card-stat b { font-size: 10.5px; }
  .hand-cards .card .card-stat span { font-size: 6.5px; letter-spacing: 0.3px; }
  .hand-cards .card .card-stat .stat-up { font-size: 6.5px; }
  .hand-cards .card .card-name {
    font-size: 8.5px;
    margin: 3px 4px 0;
    letter-spacing: 0;
    /* длинные имена — в две строки вместо обрезки */
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.12;
    overflow: hidden;
  }
  .hand-cards .card .card-ability { font-size: 8px; padding: 3px 4px; margin: 0 4px 5px; }
  .hand-cards .card .card-crest { display: block; width: 20px; height: 22px; }
  .hand-cards .card .card-top { padding: 5px 5px 0; }

  /* скамейка — ниже руки, одна прокручиваемая строка (экономит высоту поля) */
  .bench-block {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line-soft);
    padding-left: 0;
    padding-top: 4px;
  }
  .bench-cards { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; max-height: none; gap: 5px; padding-bottom: 2px; }
  .bench-chip { font-size: 9.5px; padding: 4px 6px; gap: 4px; flex-shrink: 0; }
  .bench-chip em { display: none; }

  /* хроника на весь экран */
  .match-log {
    position: fixed;
    inset: 0;
    z-index: 90;
    width: 100%;
    border-radius: 0;
    border: none;
    display: none;
    background: rgba(6, 9, 16, 0.98);
  }
  .match-log.mobile-open { display: flex; }
  .match-log .ml-title { padding: 14px 16px; font-size: 13px; }
  .ml-close {
    display: flex;
    margin-left: auto;
    background: none;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    color: var(--text-dim);
    padding: 3px 9px;
    font-size: 12px;
    cursor: pointer;
  }
  .ml-list { padding: 12px; }

  .ticker { padding: 5px 10px; min-height: 26px; }
  .ticker-text { font-size: 10.5px; }

  .goal-splash .gs-word { font-size: 64px; letter-spacing: 3px; }
  .gs-team { font-size: 15px; }
  .outcome { font-size: 16px; }
  .duel-outcome { margin-top: 8px; }
  .extra-badge { font-size: 10px; }

  .ht-panel, .so-panel, .end-panel { padding: 18px 14px; }
  .end-title { font-size: 22px; }
  .end-score { font-size: 15px; }
  .tactic-row { flex-direction: column; }
  .so-cards .card { width: 88px; height: 124px; }

  .timeline { padding: 7px 0 2px; }
  .tl-pin.past { font-size: 14px; }
  .tl-pin.past.goal { font-size: 17px; }
  .tl-labels { font-size: 8px; }
}

/* телефон в горизонтальной ориентации */
@media (max-height: 480px) and (orientation: landscape) {
  .hand-cards { min-height: 110px; }
  .hand-cards .card { width: 72px; height: 100px; }
  .duel-slot { width: 104px; height: 148px; }
  .event-intro .ei-card { max-height: 92%; }
  .match-bottom { gap: 2px; }
}

/* ---------- Хроника: клик по эпизоду ---------- */
.ml-entry.ml-click { cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.ml-entry.ml-click:hover { border-color: var(--gold-dim); background: rgba(212, 175, 55, 0.06); }

/* ---------- Модалка развёрнутого эпизода ---------- */
.evd { min-width: 300px; }
.evd-min { color: var(--gold-2); font-size: 15px; }
.evd-desc { margin: 8px 0 16px; color: var(--text-dim); font-size: 13.5px; line-height: 1.55; }
.evd-grid { display: flex; gap: 24px; justify-content: center; align-items: flex-start; }
.evd-side { text-align: center; }
.evd-team { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.evd-side .card { width: 118px; height: 166px; margin: 0 auto; }
.evd-pow { margin-top: 8px; font-size: 19px; font-weight: 800; color: var(--gold-2); cursor: help; }
.evd-outcome { margin-top: 16px; text-align: center; font-size: 14.5px; font-weight: 700; }
.evd-extra { margin-top: 6px; font-size: 12px; font-weight: 400; color: var(--text-dim); }

@media (max-width: 1120px) {
  .match-log:not(.mobile-open) { display: none; }
}

/* сверхширокие мониторы: поле и хроника крупнее, без мёртвых зон */
@media (min-width: 2000px) {
  .pitch-wrap { max-width: 1020px; }
  .match-log { width: 320px; }
  .match-center { gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01s !important; transition-duration: 0.01s !important; }
}
