:root {
  --bg: var(--tg-theme-bg-color, #17212b);
  --text: var(--tg-theme-text-color, #f5f5f5);
  --hint: var(--tg-theme-hint-color, #8a9aa9);
  --card: var(--tg-theme-secondary-bg-color, #232e3c);
  --accent: var(--tg-theme-button-color, #3390ec);
  --accent-text: var(--tg-theme-button-text-color, #fff);
  --blue: #3aa0ff;
  --red: #ff5b5b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 12px 12px 32px;
}

#app { max-width: 560px; margin: 0 auto; }

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--hint); font-size: 14px; }

header { padding: 6px 2px 14px; }
.vs {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 18px; flex-wrap: wrap; text-align: center;
}
.vs .pa b { color: var(--blue); }
.vs .pb b { color: var(--red); }
.vs .dash { color: var(--hint); font-size: 14px; }
#progress { text-align: center; margin-top: 6px; }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin: 10px 0;
}
.warn { color: var(--red); font-weight: 600; }

.q-text { font-weight: 600; font-size: 16px; margin-bottom: 12px; }

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.opt {
  border: none;
  border-radius: 10px;
  padding: 12px 0;
  font-size: 18px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform .05s ease, background .12s ease;
}
.opt:active { transform: scale(0.94); }
.opt.sel-blue { background: var(--blue); color: #fff; box-shadow: 0 0 0 2px var(--blue) inset; }
.opt.sel-red  { background: var(--red);  color: #fff; box-shadow: 0 0 0 2px var(--red)  inset; }
.opt.sel-draw { background: #d9a441; color: #1b1b1b; }

.scale-legend {
  display: flex; justify-content: space-between;
  margin-top: 8px; font-size: 12px; color: var(--hint);
}

.answered-pill {
  display: inline-block; margin-left: 6px; font-size: 13px;
  color: var(--accent);
}

footer { margin-top: 18px; text-align: center; font-size: 13px; line-height: 1.4; }

/* ── Обратный таймер (countdown) ─────────────────────────────────────────── */
.timer { font-size: 14px; color: var(--hint); text-align: center; margin-top: 4px; }
.timer.warn    { color: #d9a441; }
.timer.danger  { color: var(--red); }
.timer.pulse   { animation: pulse 1.2s ease-in-out infinite; }
.timer.expired { color: var(--hint); text-decoration: line-through; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ── Шкала оценки (3 кнопки: 👍/😐/👎) ───────────────────────────────────── */
.opt.sel-pos  { background: #4ec97a; color: #fff; }
.opt.sel-neut { background: #d9a441; color: #1b1b1b; }
.opt.sel-neg  { background: var(--red);  color: #fff; }

.self-note { font-size: 13px; color: var(--hint); padding: 8px 0; }

/* ── Сет из 3 дуэлей: вертикальный стек с фото в шапке каждой секции ─────── */
.duel-section {
  margin: 0 -2px 18px;
  padding: 0 0 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.duel-section:last-child { border-bottom: none; }
.duel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 4px 14px;
}
.duel-middle { flex: 1; text-align: center; }
.duel-num {
  font-size: 12px; color: var(--hint); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 4px;
}
.duel-vs {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 15px; flex-wrap: wrap;
}
.duel-vs .pa b { color: var(--blue); }
.duel-vs .pb b { color: var(--red); }
.duel-vs .dash { color: var(--hint); font-size: 12px; }
.q-list { padding: 0 2px; }

/* ── Марафон: навигация между парами ─────────────────────────────────────── */
.marathon-nav {
  display: flex; gap: 10px; padding: 14px 2px 6px;
}
.mbtn {
  flex: 1; padding: 14px 10px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.mbtn:active { transform: scale(0.97); }
.mbtn.skip { background: rgba(255,255,255,0.08); color: var(--hint); }
.mbtn.next { background: var(--accent); color: var(--accent-text); }

/* ── Мультик за пройденный марафон: рисованный футбольный гэг (SVG, 10с) ───── */
.cartoon { text-align: center; padding: 10px 4px 22px; }
.ft-scene {
  position: relative; width: 100%; max-width: 320px; height: 240px; margin: 0 auto;
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 6px #2b2b2b, 0 8px 26px rgba(0,0,0,0.45);
}
.ft2-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Общая ось времени 10с; transform-box: fill-box делает transform-origin
   относительным к bbox самого элемента (нужно для поворотов ноги/нырка/спина). */
.ft2-ball    { animation: ft2Ball 10s linear infinite; }
.ft2-squash  { transform-box: fill-box; transform-origin: center;
  animation: ft2Squash 10s linear infinite; }
.ft2-post    { transform-box: fill-box; transform-origin: center;
  animation: ft2Post 10s linear infinite; }
.ft2-spin    { transform-box: fill-box; transform-origin: center;
  animation: ft2Spin .55s linear infinite; }
.ft2-leg     { transform-box: fill-box; transform-origin: 50% 0%;
  animation: ft2Kick 10s ease-in-out infinite; }
.ft2-body    { transform-box: fill-box; transform-origin: 50% 100%;
  animation: ft2Body 10s ease-in-out infinite; }
.ft2-keeper  { transform-box: fill-box; transform-origin: 50% 100%;
  animation: ft2Keeper 10s ease-in-out infinite; }
.ft2-crowd   { transform-box: fill-box; transform-origin: 50% 100%;
  animation: ft2Crowd 10s ease-in-out infinite; }
.ft2-face-ok    { animation: ft2FaceOk 10s linear infinite; }
.ft2-face-dizzy { opacity: 0; animation: ft2FaceDz 10s linear infinite; }
.ft2-kface-ok    { animation: ft2KOk 10s linear infinite; }
.ft2-kface-shock { opacity: 0; animation: ft2KShock 10s linear infinite; }
.ft2-stars   { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ft2Stars 10s linear infinite; }
.ft2-impact  { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ft2Impact 10s linear infinite; }
.ft2-banner  { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ft2Banner 10s ease-in-out infinite; }

@keyframes ft2Spin { 100% { transform: rotate(360deg); } }
/* Физика: парабола удара (вверх — замедление, вниз — ускорение) → ШТАНГА
   (перекладина) → резкий отскок → бумеранг в лоб → отскоки об землю → в сетку.
   Покадровый easing имитирует гравитацию; ключевые удары: штанга 33%, лоб 51%. */
@keyframes ft2Ball {
  0%,19% { transform: translate(98px,190px);  animation-timing-function: cubic-bezier(.25,.6,.5,1); }
  26%    { transform: translate(208px,44px);   animation-timing-function: cubic-bezier(.55,0,.85,.45); } /* апекс параболы */
  33%    { transform: translate(295px,118px);  animation-timing-function: cubic-bezier(.2,.7,.5,1); }    /* ШТАНГА (перекладина) */
  37%    { transform: translate(258px,150px);  animation-timing-function: cubic-bezier(.3,0,.7,.5); }    /* резкий отскок вниз-влево */
  43%    { transform: translate(300px,176px);  animation-timing-function: cubic-bezier(.3,.5,.6,1); }    /* дуга */
  48%    { transform: translate(150px,120px);  animation-timing-function: cubic-bezier(.4,0,.7,.6); }    /* бумеранг вверх-влево */
  51%    { transform: translate(80px,104px);   animation-timing-function: cubic-bezier(.3,.6,.5,1); }    /* по голове */
  55%    { transform: translate(82px,150px);   animation-timing-function: cubic-bezier(.4,0,.7,1); }     /* падает */
  58%    { transform: translate(94px,188px);   animation-timing-function: cubic-bezier(.2,.8,.5,1); }    /* удар об землю */
  60%    { transform: translate(100px,176px);  animation-timing-function: cubic-bezier(.4,0,.7,1); }     /* отскок 1 */
  62%    { transform: translate(106px,188px);  animation-timing-function: cubic-bezier(.2,.8,.5,1); }
  63.5%  { transform: translate(112px,182px);  animation-timing-function: cubic-bezier(.4,0,.7,1); }     /* отскок 2 (мельче) */
  65%    { transform: translate(118px,189px);  animation-timing-function: cubic-bezier(.4,.2,.6,1); }
  67%    { transform: translate(160px,191px);  animation-timing-function: cubic-bezier(.5,0,.6,1); }     /* катится */
  77%,100% { transform: translate(300px,166px); }
}
@keyframes ft2Squash {                /* деформация на ударах (штанга/лоб/земля) */
  0%,32% { transform: scale(1,1); }
  33%    { transform: scale(1.32,0.7); }   /* штанга — сплющивание */
  35%    { transform: scale(0.86,1.16); }  /* отскок — растяжение */
  37%    { transform: scale(1,1); }
  50%    { transform: scale(1,1); }
  51%    { transform: scale(1.3,0.72); }    /* лоб */
  53%    { transform: scale(0.9,1.1); } 55% { transform: scale(1,1); }
  57.5%  { transform: scale(1,1); }
  58%    { transform: scale(1.22,0.82); }   /* земля */
  60%    { transform: scale(1,1); }
  61.5%  { transform: scale(1.14,0.9); } 63% { transform: scale(1,1); }
  100%   { transform: scale(1,1); }
}
@keyframes ft2Post {                  /* перекладина дрожит после попадания */
  0%,33% { transform: translate(0,0); }
  34%  { transform: translate(0,1.4px); } 36% { transform: translate(0,-1.1px); }
  38%  { transform: translate(0,0.7px); } 40% { transform: translate(0,-0.4px); }
  42%,100% { transform: translate(0,0); }
}
@keyframes ft2Kick {                  /* замах и удар ногой (пивот у бедра) */
  0%,15% { transform: rotate(8deg); }
  18%    { transform: rotate(-34deg); }   /* замах назад */
  21%    { transform: rotate(50deg); }     /* удар вперёд */
  26%    { transform: rotate(12deg); }     /* проводка */
  50%,100% { transform: rotate(8deg); }
}
@keyframes ft2Body {                  /* наклон на удар, потом качается от мяча в лоб */
  0%,17% { transform: rotate(0); }
  21%    { transform: rotate(-9deg); }
  26%    { transform: rotate(0); }
  50%    { transform: rotate(0); }
  52%    { transform: rotate(-7deg); }
  57%    { transform: rotate(6deg); }
  63%    { transform: rotate(-5deg); }
  70%    { transform: rotate(3deg); }
  76%,100% { transform: rotate(0); }
}
@keyframes ft2Keeper {                /* приседает и ныряет НЕ в ту сторону */
  0%,54% { transform: translate(0,0) rotate(0); }
  60%    { transform: translate(-5px,5px) rotate(-8deg); }
  66%    { transform: translate(-30px,16px) rotate(-62deg); }
  100%   { transform: translate(-30px,16px) rotate(-62deg); }
}
@keyframes ft2Crowd {                 /* трибуны подпрыгивают на голе */
  0%,76% { transform: translateY(0); }
  80% { transform: translateY(-4px); } 84% { transform: translateY(0); }
  88% { transform: translateY(-3px); } 92% { transform: translateY(0); }
  100% { transform: translateY(0); }
}
@keyframes ft2FaceOk { 0%,50% { opacity: 1; } 52%,74% { opacity: 0; } 76%,100% { opacity: 1; } }
@keyframes ft2FaceDz { 0%,50% { opacity: 0; } 52%,74% { opacity: 1; } 76%,100% { opacity: 0; } }
@keyframes ft2KOk    { 0%,64% { opacity: 1; } 67%,100% { opacity: 0; } }
@keyframes ft2KShock { 0%,64% { opacity: 0; } 67%,100% { opacity: 1; } }
@keyframes ft2Stars {
  0%,50% { opacity: 0; transform: scale(.4) rotate(0); }
  53% { opacity: 1; transform: scale(1) rotate(50deg); }
  66% { opacity: 1; transform: scale(1) rotate(150deg); }
  72% { opacity: 0; } 100% { opacity: 0; } }
@keyframes ft2Impact {
  0%,50% { opacity: 0; transform: scale(.2); }
  51% { opacity: 1; transform: scale(1.1); }
  54% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; } }
@keyframes ft2Banner {
  0%,75% { opacity: 0; transform: scale(.4); }
  79% { opacity: 1; transform: scale(1.16); }
  84% { transform: scale(1); }
  97% { opacity: 1; } 100% { opacity: 0; } }

/* Тень мяча: едет за мячом по земле, сжимается и бледнеет, когда мяч в воздухе.
   X-позиции совпадают с траекторией ft2Ball, Y фиксирован на газоне (201). */
.ft2-ballshadow { transform-box: fill-box; transform-origin: center;
  animation: ft2BallShadow 10s linear infinite; }
@keyframes ft2BallShadow {
  0%,19% { transform: translate(98px,201px)  scale(1);   opacity: .6; }
  26% { transform: translate(208px,201px) scale(.4);  opacity: .26; }
  33% { transform: translate(295px,201px) scale(.55); opacity: .4; }
  37% { transform: translate(258px,201px) scale(.7);  opacity: .5; }
  43% { transform: translate(300px,201px) scale(.95); opacity: .6; }
  48% { transform: translate(150px,201px) scale(.55); opacity: .32; }
  51% { transform: translate(80px,201px)  scale(.5);  opacity: .3; }
  55% { transform: translate(82px,201px)  scale(.75); opacity: .48; }
  58% { transform: translate(94px,201px)  scale(.95); opacity: .6; }
  62% { transform: translate(106px,201px) scale(.95); opacity: .58; }
  65% { transform: translate(118px,201px) scale(1);   opacity: .6; }
  67% { transform: translate(160px,201px) scale(1);   opacity: .6; }
  77%,100% { transform: translate(300px,201px) scale(1); opacity: .5; }
}
/* Лёгкий параллакс: трибуны качаются по X, облака медленно дрейфуют (глубина). */
.ft2-parallax { animation: ft2Parallax 10s ease-in-out infinite; }
@keyframes ft2Parallax { 0% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 100% { transform: translateX(-5px); } }
.ft2-clouds { animation: ft2Clouds 10s ease-in-out infinite; }
@keyframes ft2Clouds { 0% { transform: translateX(0); } 50% { transform: translateX(12px); } 100% { transform: translateX(0); } }

/* ── Мультик #1: «Сухой лист» — навес-парашют через рано прыгнувшего вратаря ──
   Та же ось времени 10с. Фон/трибуны/бьющий переиспользуют классы мультика #0
   (ft2-clouds/ft2-parallax/ft2-leg/ft2-body/ft2-spin); ниже — только новые
   траектории мяча, прыжок вратаря, баннер и подскок трибун под гол на ~69%. */
.ft3-ball       { animation: ft3Ball 10s linear infinite; }
.ft3-ballshadow { transform-box: fill-box; transform-origin: center;
  animation: ft3BallShadow 10s linear infinite; }
.ft3-keeper { transform-box: fill-box; transform-origin: 50% 100%;
  animation: ft3Keeper 10s ease-in-out infinite; }
.ft3-crowd  { transform-box: fill-box; transform-origin: 50% 100%;
  animation: ft3Crowd 10s ease-in-out infinite; }
.ft3-banner { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ft3Banner 10s ease-in-out infinite; }

/* Парабола черпака: пологий взлёт от ноги (21%) → высокий апекс над центром
   (45%) → плавный спуск ЗА спину вратаря (66%) → в сетку (70%). */
@keyframes ft3Ball {
  0%,20% { transform: translate(96px,186px);  animation-timing-function: cubic-bezier(.3,.5,.5,1); }
  33%    { transform: translate(128px,72px);   animation-timing-function: cubic-bezier(.55,0,.75,.4); }
  45%    { transform: translate(172px,30px);   animation-timing-function: cubic-bezier(.4,.15,.7,.55); }  /* апекс параболы */
  56%    { transform: translate(228px,74px);   animation-timing-function: cubic-bezier(.45,0,.78,.45); }
  66%    { transform: translate(286px,150px);  animation-timing-function: cubic-bezier(.3,.6,.6,1); }     /* за спиной вратаря */
  70%    { transform: translate(299px,172px);  animation-timing-function: cubic-bezier(.35,.2,.6,1); }    /* в сетку */
  73%    { transform: translate(300px,184px); }
  77%,100% { transform: translate(300px,184px); }
}
@keyframes ft3BallShadow {
  0%,20% { transform: translate(96px,201px)  scale(1);   opacity: .6; }
  33% { transform: translate(128px,201px) scale(.5);  opacity: .3; }
  45% { transform: translate(172px,201px) scale(.32); opacity: .2; }
  56% { transform: translate(228px,201px) scale(.5);  opacity: .3; }
  66% { transform: translate(286px,201px) scale(.85); opacity: .5; }
  73%,100% { transform: translate(300px,201px) scale(1); opacity: .55; }
}
@keyframes ft3Keeper {                /* прыгает СЛИШКОМ рано и зависает — мяч над ним */
  0%,30% { transform: translateY(0); }
  38% { transform: translateY(-7px); }
  46% { transform: translateY(-24px); }
  55% { transform: translateY(-24px); }   /* зависает, мяч переливается через перчатки */
  62% { transform: translateY(0); }
  65% { transform: translateY(2px); }       /* приземляется тяжело */
  69%,100% { transform: translateY(0); }
}
@keyframes ft3Crowd {                 /* трибуны подпрыгивают на голе (~69%) */
  0%,66% { transform: translateY(0); }
  70% { transform: translateY(-4px); } 74% { transform: translateY(0); }
  78% { transform: translateY(-3px); } 82% { transform: translateY(0); }
  100% { transform: translateY(0); }
}
@keyframes ft3Banner {
  0%,66% { opacity: 0; transform: scale(.4); }
  70% { opacity: 1; transform: scale(1.16); }
  75% { transform: scale(1); }
  96% { opacity: 1; } 100% { opacity: 0; }
}

/* ── Мультик #2: «Гол с углового» в стиле аниме ──────────────────────────────
   Та же ось 10с. Мяч-банан летит с флажка в девятку (~67%); вратарь прыгает, но
   не достаёт. Аниме-эффекты: манга-лучи, белая вспышка-удар, траектория-след,
   капля пота со «шок-линиями», лепестки сакуры. Бьющий — общий ft2-leg/ft2-body. */
.ft4-ball       { animation: ft4Ball 10s linear infinite; }
.ft4-ballshadow { transform-box: fill-box; transform-origin: center;
  animation: ft4BallShadow 10s linear infinite; }
.ft4-keeper { transform-box: fill-box; transform-origin: 50% 100%;
  animation: ft4Keeper 10s ease-in-out infinite; }
.ft4-banner { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ft4Banner 10s ease-in-out infinite; }
.ft4-trail  { stroke: #ffffff; stroke-width: 2.2; stroke-linecap: round; opacity: 0;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: ft4Trail 10s linear infinite; }
.ft4-speed  { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ft4Speed 10s linear infinite; }
.ft4-flash  { opacity: 0; animation: ft4Flash 10s linear infinite; }
.ft4-impact { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: ft4Impact 10s linear infinite; }
.ft4-shock  { opacity: 0; animation: ft4Shock 10s linear infinite; }
.ft4-petal  { transform-box: fill-box; transform-origin: center;
  animation: ft4Petal 7s linear infinite; }
.ft4-petal.p2 { animation-duration: 9s; animation-delay: -3s; }
.ft4-petal.p3 { animation-duration: 6s; animation-delay: -1.5s; }

/* Банан-парабола: пологий взлёт от флажка (21%) → высокий апекс (45%) → заверт
   вниз-вправо в дальнюю девятку (67%) → в сетку (70%). */
@keyframes ft4Ball {
  0%,20% { transform: translate(62px,190px);  animation-timing-function: cubic-bezier(.2,.5,.4,1); }
  33%    { transform: translate(140px,66px);   animation-timing-function: cubic-bezier(.5,0,.75,.45); }
  45%    { transform: translate(178px,30px);   animation-timing-function: cubic-bezier(.4,.1,.7,.5); }   /* апекс */
  56%    { transform: translate(240px,62px);   animation-timing-function: cubic-bezier(.45,0,.78,.45); }
  67%    { transform: translate(300px,122px);  animation-timing-function: cubic-bezier(.3,.55,.6,1); }   /* в девятку */
  70%    { transform: translate(310px,144px);  animation-timing-function: cubic-bezier(.35,.2,.6,1); }
  73%    { transform: translate(306px,162px); }
  77%,100% { transform: translate(306px,172px); }
}
@keyframes ft4BallShadow {
  0%,20% { transform: translate(62px,201px)  scale(1);   opacity: .6; }
  33% { transform: translate(140px,201px) scale(.5);  opacity: .3; }
  45% { transform: translate(178px,201px) scale(.3);  opacity: .18; }
  56% { transform: translate(240px,201px) scale(.5);  opacity: .3; }
  67% { transform: translate(300px,201px) scale(.85); opacity: .45; }
  73%,100% { transform: translate(306px,201px) scale(1); opacity: .5; }
}
@keyframes ft4Keeper {                /* прыжок в дальний угол — но не достаёт */
  0%,42% { transform: translate(0,0) rotate(0); }
  52% { transform: translate(2px,1px) rotate(0); }      /* подсед */
  60% { transform: translate(12px,-16px) rotate(14deg); }
  67% { transform: translate(18px,-20px) rotate(20deg); }  /* пик прыжка, мяч выше */
  72% { transform: translate(16px,-6px) rotate(16deg); }
  78% { transform: translate(12px,8px) rotate(9deg); }      /* падает битым */
  100% { transform: translate(12px,8px) rotate(9deg); }
}
@keyframes ft4Banner {
  0%,65% { opacity: 0; transform: scale(.3); }
  68% { opacity: 1; transform: scale(1.25); }
  73% { transform: scale(1.05); }
  96% { opacity: 1; } 100% { opacity: 0; }
}
@keyframes ft4Trail {                 /* след-банан «рисуется» вслед за мячом */
  0%,20% { stroke-dashoffset: 1; opacity: 0; }
  22% { opacity: .85; }
  67% { stroke-dashoffset: 0; opacity: .85; }
  80% { stroke-dashoffset: 0; opacity: 0; }
  100% { opacity: 0; }
}
@keyframes ft4Speed {                 /* манга-лучи вспыхивают на голе */
  0%,64% { opacity: 0; transform: scale(.6); }
  67% { opacity: .55; transform: scale(1); }
  74% { opacity: .5; transform: scale(1.05); }
  78% { opacity: 0; transform: scale(1.2); }
  100% { opacity: 0; }
}
@keyframes ft4Flash {                 /* белая вспышка-удар: на ударе и на голе */
  0%,20% { opacity: 0; } 21% { opacity: .5; } 24% { opacity: 0; }
  65% { opacity: 0; } 67.5% { opacity: .7; } 71% { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes ft4Impact {                /* звезда-вспышка в момент удара по мячу */
  0%,19% { opacity: 0; transform: scale(.2); }
  21% { opacity: 1; transform: scale(1.1); }
  25% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; }
}
@keyframes ft4Shock {                 /* шок-линии и капля пота над вратарём */
  0%,58% { opacity: 0; } 62% { opacity: 1; } 76% { opacity: 1; }
  82% { opacity: 0; } 100% { opacity: 0; }
}
@keyframes ft4Petal {                 /* лепестки сакуры медленно дрейфуют вниз */
  0% { transform: translate(0,-10px) rotate(0); opacity: 0; }
  10% { opacity: .9; } 90% { opacity: .9; }
  100% { transform: translate(46px,250px) rotate(220deg); opacity: 0; }
}

/* Постер-кадр до тапа: всё на паузе, поверх — кнопка ▶ (нужна для звука: в
   Telegram WebView автозвук без жеста режется, тап по ▶ даёт активацию). */
.ft-scene.ft-paused * { animation-play-state: paused !important; }
.ft-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 26px; padding-left: 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.ft-play:active { transform: translate(-50%, -50%) scale(0.94); }

.eg-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.eg-piece { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation-name: egConfetti; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes egConfetti {
  0% { transform: translateY(-12px) rotate(0); opacity: 1; }
  100% { transform: translateY(260px) rotate(560deg); opacity: .15; }
}
.cartoon-cap { margin-top: 14px; font-size: 14px; line-height: 1.45;
  color: var(--hint); padding: 0 10px; }

/* ── Геймификация: ранг, прогресс-бар, подбадривания, награды ─────────────── */
.mrank { font-size: 12px; color: var(--hint); }
.mrank b { color: var(--accent); }
.mbar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.12);
  margin: 5px auto 0; max-width: 240px; overflow: hidden; }
.mbar > i { display: block; height: 100%; border-radius: 4px;
  background: var(--accent); transition: width .45s ease; }
.q-quip { text-align: center; font-size: 12px; color: var(--hint); margin: 2px 0 8px; }

.reward-pop { position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
  background: rgba(0,0,0,0.45); opacity: 0; transition: opacity .35s ease; }
.reward-pop.show { opacity: 1; }
.reward-card { position: relative; background: var(--card); color: var(--text);
  border-radius: 18px; padding: 22px 24px; text-align: center; max-width: 80%;
  box-shadow: 0 12px 44px rgba(0,0,0,0.5); transform: scale(.7);
  transition: transform .4s cubic-bezier(.2,1.35,.4,1); }
.reward-pop.show .reward-card { transform: scale(1); }
.reward-badge { font-size: 56px; line-height: 1; }
.reward-title { font-size: 20px; font-weight: 800; margin-top: 6px; }
.reward-msg { font-size: 14px; margin-top: 8px; color: var(--hint); }
.reward-sub { font-size: 12px; margin-top: 12px; color: var(--accent); }
.reward-conf { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.reward-piece { position: absolute; top: -16px; width: 9px; height: 14px;
  border-radius: 2px; animation-name: rewardFall;
  animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes rewardFall {
  0% { transform: translateY(-16px) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(680deg); opacity: .1; } }

.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  object-fit: cover; flex-shrink: 0; font-size: 22px; font-weight: 700;
}
.avatar.blue { box-shadow: 0 0 0 2px var(--blue) inset; }
.avatar.red  { box-shadow: 0 0 0 2px var(--red)  inset; }
.avatar.placeholder.blue { background: rgba(58,160,255,0.25); color: var(--blue); }
.avatar.placeholder.red  { background: rgba(255,91,91,0.25);  color: var(--red); }

/* Аватар-курсор: если фото есть, по тапу увеличиваем. */
.avatar:not(.placeholder) { cursor: zoom-in; }

/* Компактный аватар для списка оценки матча. */
.avatar.sm { width: 44px; height: 44px; font-size: 18px; }
.avatar.placeholder { background: rgba(255,255,255,0.10); color: var(--hint); }

/* Шапка карточки оценки: миниатюра фото + имя в одну строку. */
.assess-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.assess-head .q-text.assess-name { margin: 0; }

/* ── Lightbox: большое фото поверх всего UI ──────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
  animation: lb-fade 0.18s ease-out;
}
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img {
  max-width: 92vw; max-height: 80vh;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: lb-zoom 0.20s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes lb-zoom { from { transform: scale(0.85); } to { transform: scale(1); } }
.lightbox-cap {
  margin-top: 14px; color: #fff; font-size: 16px; font-weight: 600;
  text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; backdrop-filter: blur(6px);
}
.lightbox-close:active { background: rgba(255,255,255,0.30); transform: scale(0.94); }

/* Анонимный live-счётчик голосов (assessment) */
.tally {
  margin-top: 10px;
  font-size: 13px;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}
.tally-numbers {
  display: flex; justify-content: space-between;
  margin-bottom: 5px;
}
.tally-numbers .t-pos  { color: #4ec97a; font-weight: 600; }
.tally-numbers .t-neut { color: #d9a441; font-weight: 600; }
.tally-numbers .t-neg  { color: var(--red); font-weight: 600; }
.tally-empty { color: var(--hint); font-style: italic; }
.tally-bar {
  display: flex; height: 6px; border-radius: 3px; overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.tally-bar .seg.pos  { background: #4ec97a; }
.tally-bar .seg.neut { background: #d9a441; }
.tally-bar .seg.neg  { background: var(--red); }

/* ── Лучший игрок матча (MOTM) — один выбор под оценками ──────────────────── */
.motm-card { border: 1px solid #d9a44155; }
.motm-sub { font-size: 12px; color: var(--hint); margin: 4px 0 10px; }
.motm-list { display: flex; flex-direction: column; gap: 8px; }
.motm-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 11px 14px; border: none; cursor: pointer;
  border-radius: 12px; font-size: 15px; text-align: left;
  background: rgba(255, 255, 255, 0.06); color: var(--text);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: background .12s ease, box-shadow .12s ease;
}
.motm-opt:active { transform: scale(0.98); }
.motm-opt.sel {
  background: #d9a441; color: #1b1b1b; font-weight: 600;
  box-shadow: 0 0 0 2px #d9a441 inset;
}
.motm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.motm-count {
  flex: none; font-variant-numeric: tabular-nums; font-size: 13px;
  color: var(--hint); font-weight: 600;
}
.motm-opt.sel .motm-count { color: #1b1b1b; }

/* ── Переоценка игрока (rating, шкала 1–10) ──────────────────────────────── */
.rating-head {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 6px 0 2px;
}
.rating-photo {
  width: 92px; height: 92px; border-radius: 50%;
  object-fit: cover; background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px var(--accent) inset, 0 4px 18px rgba(0,0,0,0.35);
}
.rating-photo.placeholder {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.12) inset;
}
.rating-photo.placeholder::after {
  content: "👤"; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 38px;
}
.rating-name { font-size: 20px; font-weight: 700; text-align: center; }
.rating-old  { font-size: 14px; }
/* Счётчик проголосовавших стоит вне .rating-head — центрируем под остальной шапкой. */
.rating-head + #voterCount { text-align: center; margin-top: 6px; }

.rating-card { padding: 16px 14px 14px; }

/* Большой индикатор текущего выбора */
.rating-pick {
  border-radius: 14px; padding: 14px 12px; margin-bottom: 14px;
  text-align: center; min-height: 58px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: background .18s ease;
}
.rating-pick .pick-num   { font-size: 34px; font-weight: 800; line-height: 1; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35); }
.rating-pick .pick-cap   { font-size: 14px; color: rgba(255,255,255,0.92); font-weight: 600; }
.rating-pick .pick-empty { font-size: 15px; color: var(--hint); }
.rating-pick .pick-abst  { font-size: 16px; color: var(--text); font-weight: 600; }

/* Сетка кнопок 1–10 */
.rating-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.rnum {
  border: none; border-radius: 12px; padding: 14px 0;
  font-size: 19px; font-weight: 700;
  background: rgba(255,255,255,0.06); color: var(--text);
  cursor: pointer; position: relative;
  transition: transform .05s ease, box-shadow .12s ease, background .12s ease;
}
.rnum::before {
  content: ""; position: absolute; left: 0; bottom: 0; right: 0; height: 4px;
  border-radius: 0 0 12px 12px; background: var(--c); opacity: .65;
}
.rnum:active { transform: scale(0.92); }
.rnum.sel {
  background: var(--c); color: #fff;
  box-shadow: 0 0 0 2px var(--c) inset, 0 4px 14px rgba(0,0,0,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.rnum.sel::before { opacity: 0; }

.rabstain {
  width: 100%; margin-top: 12px; border: none; border-radius: 12px;
  padding: 12px 0; font-size: 15px; cursor: pointer;
  background: rgba(255,255,255,0.06); color: var(--hint);
  transition: transform .05s ease, background .12s ease;
}
.rabstain:active { transform: scale(0.97); }
.rabstain.sel { background: rgba(255,255,255,0.16); color: var(--text); font-weight: 600; }

/* Анонимная гистограмма распределения 1–10 */
.rtally { margin-top: 16px; font-variant-numeric: tabular-nums; }
.rt-title {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--hint); margin-bottom: 8px;
}
.rt-proj b { color: var(--text); font-size: 15px; }
.rt-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.rt-label { width: 18px; text-align: right; font-weight: 700; font-size: 13px; }
.rt-track {
  flex: 1; height: 10px; border-radius: 5px; overflow: hidden;
  background: rgba(255,255,255,0.06);
}
.rt-bar { display: block; height: 100%; border-radius: 5px; transition: width .3s ease; }
.rt-count { width: 20px; font-size: 12px; color: var(--hint); }
.rt-abst { margin-top: 8px; font-size: 12px; color: var(--hint); }

/* ═══ Админ-панель дуэлей (admin.js, ?startapp=admin) ═══════════════════════ */
.admin { padding: 8px 10px 40px; }
.admin-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px;
  position: sticky; top: 0; background: var(--bg); z-index: 5;
  -webkit-overflow-scrolling: touch;
}
.atab {
  flex: 0 0 auto; border: none; border-radius: 16px; cursor: pointer;
  padding: 7px 12px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,0.08); color: var(--hint); white-space: nowrap;
}
.atab.active { background: var(--accent); color: var(--accent-text); }
.admin-body { margin-top: 6px; }
.admin .card { background: var(--card); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.admin .card-h { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--text); }
.admin .card-h.big { font-size: 16px; margin: 12px 0 6px; }
.admin .line {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 14px;
}
.admin .line:last-child { border-bottom: none; }
.admin .line.small, .admin .small { font-size: 12px; }
.admin .big { font-size: 16px; }
.admin .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.admin .stat {
  background: var(--card); border-radius: 12px; padding: 12px; text-align: center;
}
.admin .stat b { display: block; font-size: 22px; color: var(--accent); }
.admin .stat span { font-size: 12px; color: var(--hint); }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.admin .rowbtns { display: flex; gap: 6px; }
.admin .inp {
  width: 100%; padding: 10px; margin: 6px 0; border-radius: 10px; font-size: 15px;
  border: 1px solid rgba(255,255,255,0.12); background: var(--bg); color: var(--text);
}
.admin .btn {
  width: 100%; padding: 11px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font-size: 15px; font-weight: 600;
  margin-top: 6px;
}
.admin .btn.danger, .admin .mini.danger { background: var(--red); color: #fff; }
.admin .mini {
  flex: 0 0 auto; border: none; border-radius: 8px; cursor: pointer;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.10); color: var(--text);
}
.admin .vline {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px;
}
.admin .vline.excl { opacity: 0.5; }
.admin .spark { vertical-align: middle; }
.admin .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin .chip {
  background: rgba(255,255,255,0.08); color: var(--hint);
  border-radius: 12px; padding: 4px 9px; font-size: 12px;
}
.admin .ok { color: #2ecc71; font-weight: 600; }

/* ── Сетка плей-офф (Pick-em, bracket.js) ─────────────────────────────────── */
.brk-wrap { padding: 12px 12px 90px; max-width: 760px; margin: 0 auto; }
.brk-title { font-size: 18px; font-weight: 800; margin: 4px 0 10px; color: var(--text); }
.brk-status { font-size: 13px; color: var(--hint); background: var(--card);
  border-radius: 10px; padding: 9px 11px; margin-bottom: 10px; }
.brk-status.warn { color: #ffce6b; }
.brk-status b { color: var(--text); }
.brk-champ { font-size: 15px; font-weight: 700; text-align: center; color: var(--text);
  background: linear-gradient(90deg, rgba(51,144,236,.18), rgba(51,144,236,.04));
  border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.brk-champ-view { background: linear-gradient(90deg, rgba(241,196,15,.18), rgba(241,196,15,.04)); }
.brk-back { display: inline-block; margin-left: 8px; padding: 3px 10px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); color: var(--text); border-radius: 6px; font-size: 12px;
  font-weight: 600; cursor: pointer; }
.brk-back:hover { background: rgba(255,255,255,.12); }
.brk-champ b { color: var(--accent); }
.brk-my-tier { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 7px;
  font-size: 12px; font-weight: 700; vertical-align: middle; }
.brk-tier { display: inline-block; min-width: 28px; text-align: center;
  font-size: 14px; line-height: 1; }
.brk-tier.none { color: var(--hint); }
.tier-bronze  { background: rgba(205,127,50,.20);  color: #f0c987; }
.tier-silver  { background: rgba(192,192,210,.22); color: #ecedf2; }
.tier-gold    { background: rgba(241,196,15,.25);  color: #ffe28a; box-shadow: 0 0 0 1px rgba(241,196,15,.4) inset; }
.tier-diamond { background: rgba(125,222,255,.22); color: #d6f3ff;
  box-shadow: 0 0 0 1px rgba(125,222,255,.55) inset, 0 0 8px rgba(125,222,255,.35); }
.brk-lb-name { margin-left: 4px; }
.brk-round { margin-bottom: 14px; }
.brk-round-title { font-size: 13px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em; margin: 0 2px 7px; }
/* Итог по стадии (readonly): полоска угаданного + «N/M · +очки». */
.brk-round-sum { display: flex; align-items: center; gap: 8px; margin: -3px 2px 8px; }
.brk-round-bar { flex: 1; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,.08); overflow: hidden; }
.brk-round-bar > span { display: block; height: 100%; background: #2ecc71; border-radius: 3px; }
.brk-round-sum-txt { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #2ecc71;
  font-variant-numeric: tabular-nums; }
.brk-round-sum-txt.zero { color: var(--hint); }
.brk-matches { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brk-round:last-of-type .brk-matches { grid-template-columns: 1fr; }
.brk-match { background: var(--card); border-radius: 10px; padding: 8px; }
.brk-mno { font-size: 11px; color: var(--hint); margin-bottom: 5px; }
.brk-when { font-size: 11px; color: var(--accent); font-weight: 600;
  margin: -2px 0 6px; padding: 1px 6px; background: rgba(46,204,113,.12);
  border-radius: 5px; display: inline-block; }
.brk-vs { font-size: 10px; color: var(--hint); text-align: center; margin: 3px 0; }
/* Матч за 3-е место (M103) — отдельная карточка вне сетки, бронзовый акцент. */
.brk-third { border-left: 3px solid #cd7f32; }
.brk-third .tp-match { max-width: 420px; margin: 6px auto 0; }
.brk-third .brk-seed-actions { margin-top: 8px; }
.brk-third .tp-result-score { justify-content: center; align-items: center; gap: 6px; margin-top: 8px; }
.brk-third .tp-result-score .brk-vs { margin: 0; }
.brk-third .tp-score-in { flex: 0 0 48px; }
/* Строка точного счёта пика: «<пик> [ ] : [ ] <соперник>», по центру. */
.brk-third .tp-pick-score { justify-content: center; align-items: center; gap: 6px;
  margin: 8px auto 0; max-width: 420px; }
.brk-third .tp-pick-score .brk-vs { margin: 0; }
.brk-third .tp-pick-in { flex: 0 0 48px; }
.brk-third .tp-sc-team { font-size: 12px; font-weight: 600; color: var(--text);
  max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brk-third .tp-sc-team:first-child { text-align: right; }
/* Список «кто что поставил» — сворачиваемый. */
.brk-third .tp-picks { margin-top: 10px; }
.brk-third .tp-picks summary { cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--accent); padding: 4px 0; }
.brk-third .tp-picks-list { list-style: none; margin: 6px 0 0; padding: 0; }
.brk-third .tp-plrow { font-size: 13px; padding: 3px 0; display: flex;
  align-items: center; gap: 4px; flex-wrap: wrap; }
.brk-third .tp-plrow .brk-team-flag { width: 16px; height: 12px; }
.brk-third .tp-plname { color: var(--hint); }
/* Строка матча: кнопка выбора команды (flex:1) + опциональный счёт справа.
   Кнопка и инпут — соседи, поэтому клик по инпуту НЕ триггерит выбор команды. */
.brk-team-row { display: flex; align-items: stretch; gap: 6px; margin-bottom: 3px; }
.brk-team { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
  text-align: left; border: none; cursor: pointer;
  background: rgba(255,255,255,0.06); color: var(--text); border-radius: 8px;
  padding: 9px 10px; font-size: 14px; font-weight: 600; }
.brk-team-flag { width: 22px; height: 15px; flex: 0 0 22px; object-fit: cover; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18); background: rgba(255,255,255,.06); }
.brk-team-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brk-team:active { transform: scale(0.98); }
.brk-team.sel { background: var(--accent); color: var(--accent-text);
  box-shadow: 0 0 0 2px var(--accent) inset; }
.brk-team.empty { background: transparent; color: var(--hint); font-style: italic;
  font-weight: 500; padding: 9px 10px; }
.brk-team.ro { cursor: default; }
.brk-team.win { background: rgba(46,204,113,.12); color: #2ecc71;
  border: 2px solid #2ecc71; }
.brk-team.lose { background: rgba(231,76,60,.12); color: #e74c3c;
  border: 2px solid #e74c3c; }
/* Фактический победитель, которого игрок НЕ выбрал: золотой «прошла ▲» — чтобы
   промах показывал реальный исход пары, а не обрывался. */
.brk-team.actual { background: rgba(241,196,15,.10); color: #ffe28a;
  border: 2px solid rgba(241,196,15,.55); }
.brk-team-mark { flex: 0 0 auto; margin-left: 2px; font-size: 10px; line-height: 1;
  color: #ffd94d; }
/* Инлайн-инпут точного счёта — справа от кнопки команды. Только когда оба
   участника матча известны; пустой ввод = не угадывал (опционально). */
.brk-score-in { flex: 0 0 36px; width: 36px; padding: 6px 4px; border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px; text-align: center; font-size: 14px; font-weight: 600;
  background: rgba(255,255,255,.06); color: var(--text); -moz-appearance: textfield;
  align-self: stretch; min-height: 0; }
.brk-score-in::-webkit-outer-spin-button,
.brk-score-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.brk-score-in::placeholder { color: var(--hint); opacity: .5; font-weight: 400; }
.brk-score-in:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,.12); }
/* Read-only (view/locked): счёт в том же слоте, где был инпут. Колонка, чтобы у
   сыгранной пары под крупным фактом помещалась мелкая цифра прогноза без сдвига
   вёрстки (ширина слота не меняется — растёт только высота, ряд stretch'ится). */
.brk-score-text { flex: 0 0 36px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.05;
  font-size: 14px; font-weight: 700; color: var(--accent); }
/* Фактический счёт (матч сыгран) — нейтрально-яркий, а рядом с раскрашенной
   командой (win/lose/actual) наследует её цвет. */
.brk-score-text.fact { color: var(--text); }
.brk-team.win + .brk-score-text,
.brk-team.lose + .brk-score-text,
.brk-team.actual + .brk-score-text { color: inherit; }
/* Двойной слот: крупный факт + мелкий прогноз игрока под ним. */
.brk-sc-fact { font-size: 15px; font-weight: 800; }
.brk-sc-pred { font-size: 10px; font-weight: 700; color: var(--accent); opacity: .9; }
.brk-sc-pred.hit { color: #2ecc71; }   /* прогноз совпал с фактом по этой команде */
/* Строка под парами в readonly: либо «твой прогноз X:Y», либо «🎯 точный счёт». */
.brk-score-fact { font-size: 11px; color: var(--hint); margin-top: 4px;
  padding: 2px 6px; background: rgba(255,255,255,.04); border-radius: 5px; }
.brk-score-fact.exact { color: #ffe28a; background: rgba(241,196,15,.14);
  font-weight: 700; }
.brk-lb-wrap { margin-top: 16px; }
.brk-lb { width: 100%; border-collapse: collapse; }
.brk-lb td { padding: 6px 4px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brk-lb tr.brk-lb-row { cursor: pointer; transition: background .12s; }
.brk-lb tr.brk-lb-row:hover { background: rgba(255,255,255,.06); }
.brk-lb tr.brk-lb-row:active { background: rgba(255,255,255,.12); }
.brk-lb td.r { width: 30px; color: var(--hint); }
.brk-lb td.p { text-align: right; white-space: nowrap; }
.brk-lb td.p b { color: var(--accent); }
.brk-lb td.c { text-align: right; white-space: nowrap; font-size: 12px; }
.brk-savebar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px;
  background: linear-gradient(180deg, transparent, var(--bg) 35%); }
.brk-savebar-row { display: flex; gap: 8px; max-width: 736px; margin: 0 auto; }
.brk-save { display: block; width: 100%; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-text); border-radius: 10px;
  padding: 12px; font-size: 15px; font-weight: 700; }
.brk-save.big { flex: 1; }
.brk-save.ai { flex: 0 0 auto; padding: 12px 14px; font-size: 14px;
  background: linear-gradient(135deg, #7ddeff 0%, #5b8eff 100%);
  color: #0a1a2c; }
.brk-save.ai:active { transform: scale(0.98); }
.brk-save.secondary { background: rgba(255,255,255,.12); color: var(--text); }
.brk-save.small { padding: 8px 10px; font-size: 13px; flex: 1; }
.brk-seed-actions { display: flex; gap: 8px; margin: 8px 0 4px; }
.brk-save.warn { background: #c0392b; }
.brk-save[disabled] { opacity: .55; cursor: not-allowed; }
.brk-cd { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px;
  background: rgba(241,196,15,.18); color: #ffe28a; font-size: 12px; font-weight: 600; }
.brk-cd b { color: #fff; font-variant-numeric: tabular-nums; }
.brk-admin { margin-bottom: 12px; }
.brk-admin-h { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--text); }
.brk-modes { display: flex; gap: 6px; margin-bottom: 8px; }
.brk-mode { flex: 1; border: none; cursor: pointer; background: rgba(255,255,255,0.08);
  color: var(--hint); border-radius: 8px; padding: 8px; font-size: 13px; font-weight: 600; }
.brk-mode.active { background: var(--accent); color: var(--accent-text); }
.brk-seed { margin-bottom: 8px; }
.brk-seed summary { font-size: 13px; color: var(--hint); cursor: pointer; padding: 4px 0; }
.brk-seed textarea { width: 100%; box-sizing: border-box; margin: 6px 0; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: var(--bg); color: var(--text);
  padding: 8px; font-size: 13px; resize: vertical; }
.brk-seed-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.brk-seed-slot { display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; padding: 4px 6px;
  min-width: 0; overflow: hidden; }                /* min-width:0 чтобы grid не
                                                     выпирал за 1fr из-за длинных option'ов */
.brk-seed-flag { width: 22px; height: 15px; flex: 0 0 22px; object-fit: cover; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18); background: rgba(255,255,255,.06); }
.brk-seed-flag[hidden] { display: none; }
.brk-seed-no { font-size: 11px; color: var(--hint); min-width: 18px; flex: 0 0 18px; text-align: right; }
.brk-team-sel { flex: 1 1 0; width: 0;                 /* width:0 + flex-basis:0 чтобы
                                                         реально сжимался, иначе
                                                         select диктует min-content */
  min-width: 0; max-width: 100%; background: transparent; color: var(--text);
  border: none; font-size: 13px; font-weight: 600; padding: 4px 2px;
  overflow: hidden; text-overflow: ellipsis; }
.brk-team-sel:focus { outline: 1px solid var(--accent); border-radius: 4px; }
/* На узких экранах — компактные карточки в 2 колонки. Флаги остаются (мини),
   название — ellipsis; width:0 на .brk-team заставляет строку сжиматься. */
@media (max-width: 520px) {
  .brk-wrap { padding: 8px 6px calc(88px + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
  .brk-title { font-size: 16px; }
  .brk-matches { grid-template-columns: 1fr 1fr; gap: 6px; }
  .brk-match { min-width: 0; padding: 6px 5px; border-radius: 8px; overflow: hidden; }
  .brk-mno { font-size: 10px; margin-bottom: 2px; }
  .brk-when { font-size: 9px; margin: 0 0 4px; padding: 0 4px; }
  .brk-vs { font-size: 9px; margin: 1px 0; }
  .brk-team-row { gap: 3px; margin-bottom: 2px; min-width: 0; }
  .brk-team { flex: 1 1 0; width: 0; min-width: 0; padding: 4px 3px; font-size: 11px;
    gap: 3px; border-radius: 6px; font-weight: 600; }
  .brk-team-name { white-space: nowrap; }
  .brk-matches .brk-team-flag { width: 16px; height: 11px; flex: 0 0 16px; }
  .brk-score-in,
  .brk-score-text { flex: 0 0 24px; width: 24px; font-size: 12px; padding: 3px 0; border-radius: 5px; }
  .brk-sc-fact { font-size: 13px; }
  .brk-sc-pred { font-size: 9px; }
  .brk-score-fact { font-size: 10px; margin-top: 2px; padding: 1px 4px; }
  .brk-round-sum { gap: 6px; margin: -2px 2px 7px; }
  .brk-round-sum-txt { font-size: 11px; }
  .brk-team-mark { font-size: 9px; }
  .brk-champ { font-size: 14px; padding: 9px 8px; line-height: 1.35; }
  .brk-champ-view { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .brk-back { margin-left: 0; align-self: flex-start; }
  .brk-lb td { font-size: 13px; padding: 6px 2px; }
  .brk-lb td.c { font-size: 11px; }
  .brk-savebar { padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .brk-seed-list { grid-template-columns: 1fr; }
  .brk-modes { flex-direction: column; }
}
.brk-small, .small { font-size: 12px; }

/* Модалка превью AI-филла. Раскрывается поверх всей сетки, по центру. Закрытие
   по «Отмена», клику по фону или подтверждению «Применить». */
.brk-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; }
.brk-modal { background: var(--bg); color: var(--text); border-radius: 14px;
  width: 100%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); overflow: hidden; }
.brk-modal-h { padding: 14px 16px 4px; font-size: 16px; font-weight: 700; }
.brk-modal-sub { padding: 0 16px 12px; }
.brk-modal-body { flex: 1 1 auto; overflow-y: auto; padding: 4px 16px 12px; }
.brk-modal-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08); }
.brk-modal-foot .brk-save { flex: 1; }
.brk-modal-progress { flex: 1 0 100%; text-align: center; padding: 4px 0 0; }
.brk-preview-round { font-weight: 700; font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 4px; }
.brk-preview-row { display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px; line-height: 1.3; }
.brk-preview-row:last-child { border-bottom: none; }
.brk-preview-num { color: var(--hint); font-size: 11px; min-width: 26px; flex: 0 0 26px; }
.brk-preview-row > span:nth-child(2) { flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.brk-preview-row > span:nth-child(4) { flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brk-preview-score { flex: 0 0 auto; min-width: 38px; text-align: center;
  font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.brk-preview-winner { flex: 0 0 auto; color: var(--accent-text); font-weight: 700;
  font-size: 12px; padding: 2px 6px; background: rgba(46,204,113,.18);
  border-radius: 5px; white-space: nowrap; max-width: 38%;
  overflow: hidden; text-overflow: ellipsis; }
.brk-preview-champ { background: rgba(255,255,255,.04); border-radius: 6px;
  padding: 8px 10px; margin-top: 6px; font-size: 14px;
  justify-content: center; gap: 6px; }

/* ═══ Подсказки: единая система онбординга/аннотаций (common.js) ═══════════════
   Три примитива: сворачиваемый блок «❓ Как это работает» (.help-panel),
   значок «?» у секции (.help-chip) → нижний лист (.help-sheet), и
   приветственный онбординг при первом входе (.onb). Общие для всех экранов. */

/* Сворачиваемый блок «❓ Как это работает» (вверху экрана) */
.help-panel { background: var(--card); border-radius: 12px; margin: 10px 0 14px;
  overflow: hidden; }
.help-summary { list-style: none; cursor: pointer; padding: 11px 14px;
  font-size: 14px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.help-summary::-webkit-details-marker { display: none; }
.help-summary::after { content: "▸"; color: var(--hint); font-size: 12px;
  transition: transform .18s ease; }
.help-panel[open] .help-summary::after { transform: rotate(90deg); }
.help-body { padding: 2px 14px 14px; font-size: 14px; line-height: 1.5; color: var(--text); }
.help-body p { margin: 0 0 8px; }
.help-body p:last-child { margin-bottom: 0; }
.help-body ul { margin: 6px 0 8px; padding-left: 18px; }
.help-body li { margin: 4px 0; }
.help-body b { color: var(--text); }
.help-body .k { color: var(--accent); font-weight: 700; }   /* акцент термина/глоссарий */

/* Значок «?» рядом с заголовком секции */
.help-chip { border: none; cursor: pointer; flex: 0 0 auto; display: inline-flex;
  align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; padding: 0; margin-left: 6px;
  font-size: 12px; font-weight: 800; line-height: 1; vertical-align: middle;
  background: rgba(128,128,128,.22); color: var(--hint); }
.help-chip:active { transform: scale(.9); }

/* Нижний лист с объяснением одной механики (открывается по «?») */
.help-sheet { position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.5); opacity: 0; transition: opacity .2s ease; }
.help-sheet.show { opacity: 1; }
.help-sheet-card { background: var(--bg); color: var(--text);
  width: 100%; max-width: 560px; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(0,0,0,.5); position: relative;
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2,.8,.3,1);
  max-height: 82vh; overflow-y: auto; }
.help-sheet.show .help-sheet-card { transform: translateY(0); }
.help-sheet-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: rgba(128,128,128,.18); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer; }
.help-sheet-title { font-size: 17px; font-weight: 800; margin: 2px 40px 10px 2px; }
.help-sheet-body { font-size: 14px; line-height: 1.55; }
.help-sheet-body p { margin: 0 0 9px; }
.help-sheet-body p:last-child { margin-bottom: 0; }
.help-sheet-body ul { margin: 6px 0 9px; padding-left: 18px; }
.help-sheet-body li { margin: 5px 0; }
.help-sheet-body b { color: var(--text); }
.help-sheet-body .k { color: var(--accent); font-weight: 700; }
.help-sheet-ok { width: 100%; margin-top: 14px; border: none; border-radius: 12px;
  padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-text); }

/* Онбординг при первом входе — приветственный экран с 2-4 шагами */
.onb { position: fixed; inset: 0; z-index: 300; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,.62); opacity: 0; transition: opacity .25s ease; }
.onb.show { opacity: 1; }
.onb-card { background: var(--bg); color: var(--text); width: 100%; max-width: 420px;
  border-radius: 18px; padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 14px 50px rgba(0,0,0,.55);
  transform: scale(.85); transition: transform .3s cubic-bezier(.2,1.3,.4,1);
  max-height: 88vh; overflow-y: auto; }
.onb.show .onb-card { transform: scale(1); }
.onb-title { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.onb-lead { font-size: 14px; color: var(--hint); text-align: center; margin-bottom: 16px; }
.onb-steps { display: flex; flex-direction: column; gap: 14px; }
.onb-step { display: flex; align-items: flex-start; gap: 12px; }
.onb-ic { flex: 0 0 auto; font-size: 24px; line-height: 1.2; width: 30px; text-align: center; }
.onb-txt { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; }
.onb-txt b { font-size: 15px; }
.onb-txt span { color: var(--hint); }
.onb-ok { width: 100%; margin-top: 20px; border: none; border-radius: 12px;
  padding: 14px; font-size: 16px; font-weight: 800; cursor: pointer;
  background: var(--accent); color: var(--accent-text); }
.onb-ok:active { transform: scale(.98); }

/* Кнопка «❓» в шапке экрана — заново открыть онбординг/помощь */
.help-reopen { border: none; cursor: pointer; background: rgba(128,128,128,.18);
  color: var(--hint); border-radius: 50%; width: 30px; height: 30px; font-size: 15px;
  line-height: 1; flex: 0 0 auto; }
.help-reopen:active { transform: scale(.92); }
