/* Тактика 7×7.
   Концепция: магнитная тактическая доска в алюминиевой рамке — поле главное,
   рядом «блокнот тренера». Акцент — жёлтый свисток, команды — синий и красный маркеры. */
:root {
  --paper: #edf2eb;
  --dot: #cdd8cb;
  --card: #ffffff;
  --ink: #15241b;
  --ink-2: #4b5e52;
  --rule: #d3dcd2;
  --frame: #c3ccc6;
  --whistle: #ffc928;
  --whistle-deep: #d19e00;
  --whistle-ink: #271d00;
  --star: #f0b000;
  --home: #2457d6;
  --away: #d23a2b;
  --tok-home: #2457d6;
  --tok-away: #e0402f;
  --tok-gk-home: #f5b818;
  --tok-gk-away: #8a4fe0;
  --grass-a: #3c984e;
  --grass-b: #45a557;
  --grass-out: #2e8241;
  --good: #167f45;
  --bad: #be3426;
  --warn: #946000;
  --good-bg: #e2f4e8;
  --bad-bg: #fde7e3;
  --warn-bg: #fff3d1;
  --info-bg: #e8eef8;
  --shelf: #f3efe2;
  --shadow: 0 1px 2px rgba(21, 36, 27, .06), 0 6px 18px rgba(21, 36, 27, .07);

  --f-display: 'Russo One', 'Arial Black', Impact, system-ui, sans-serif;
  --f-body: 'Nunito', 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  --f-marker: 'Caveat', 'Comic Sans MS', 'Segoe Print', cursive;
  --radius: 16px;
  --header-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1913; --dot: #1d2b22; --card: #17241c; --ink: #e5efe7; --ink-2: #9cb2a4; --rule: #2a3a30; --frame: #34433a;
    --whistle: #ffc928; --whistle-deep: #a87f00; --whistle-ink: #271d00; --star: #ffcc33;
    --home: #7fa2ff; --away: #ff7d6e;
    --grass-a: #2f7f40; --grass-b: #358a47; --grass-out: #246a35;
    --good: #5ad493; --bad: #ff8576; --warn: #ffcd57;
    --good-bg: #16331f; --bad-bg: #3b1d19; --warn-bg: #362c10; --info-bg: #1b2839; --shelf: #1f2c23;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1913; --dot: #1d2b22; --card: #17241c; --ink: #e5efe7; --ink-2: #9cb2a4; --rule: #2a3a30; --frame: #34433a;
  --whistle: #ffc928; --whistle-deep: #a87f00; --whistle-ink: #271d00; --star: #ffcc33;
  --home: #7fa2ff; --away: #ff7d6e;
  --grass-a: #2f7f40; --grass-b: #358a47; --grass-out: #246a35;
  --good: #5ad493; --bad: #ff8576; --warn: #ffcd57;
  --good-bg: #16331f; --bad-bg: #3b1d19; --warn-bg: #362c10; --info-bg: #1b2839; --shelf: #1f2c23;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* Без случайного увеличения: двойное касание не приближает страницу (касание и прокрутка работают как обычно). */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 16px/1.5 var(--f-body);
  min-height: 100vh;
}
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.15; }
p { margin: 0; }
a { color: var(--home); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--home); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.lead { font-size: 18px; color: var(--ink-2); max-width: 62ch; }

/* ---------- Шапка ---------- */
/* Вырез экрана (приложение на «Домой» на iPhone) — внутри шапки: при top: <вырез> липкая шапка
   в начале страницы съезжала вниз и закрывала заголовок страницы. */
.site-header {
  position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px);
  background: var(--card); border-bottom: 1px solid var(--rule);
}
.header-inner, .site-main {
  max-width: 1280px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
/* Шапка — сетка: название, вход, разделы, счётчики, язык; на телефоне — название и язык, ниже вход и счётчики, ниже разделы. */
.header-inner {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "brand acc nav tools lang";
  align-items: center; gap: 8px 16px; min-height: var(--header-h); padding-block: 8px;
}
.header-inner > .brand { grid-area: brand; }
.header-inner > .acc-link { grid-area: acc; }
.header-inner > .main-nav { grid-area: nav; }
.header-inner > .header-tools { grid-area: tools; }
.header-inner > .header-lang { grid-area: lang; justify-self: end; }
/* Кнопка «Меню» — только у свёрнутой шапки на телефоне (уроки и задачи). */
.hdr-handle { display: none; grid-area: hdl; }
.header-lang .lang-pick { margin: 0; }
.acc-link {
  display: inline-flex; align-items: center; gap: 4px; justify-self: start; max-width: 42vw; padding: 5px 12px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--rule); color: var(--ink); font-weight: 800; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acc-link:hover { border-color: var(--ink-2); }
.acc-link.is-active { background: var(--ink); border-color: var(--ink); color: var(--card); }
a.star-pill { color: var(--ink); text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font: 20px var(--f-display); letter-spacing: .01em; white-space: nowrap; }
.brand-name b { font-weight: 400; background: #15241b; color: var(--whistle); padding: 0 .25em; border-radius: 6px; margin-left: .1em; }
.logo-mark svg { width: 40px; height: 28px; display: block; }
.lm-grass { fill: var(--grass-a); }
.lm-line { fill: none; stroke: #fff; stroke-width: 1.2; opacity: .85; }
.lm-home { fill: var(--tok-home); stroke: #fff; stroke-width: 1; }
.lm-away { fill: var(--tok-away); stroke: #fff; stroke-width: 1; }
.main-nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink);
  font-weight: 800; white-space: nowrap;
}
.main-nav a:hover { background: var(--paper); }
.main-nav a.is-active { background: var(--ink); color: var(--card); }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.star-pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--rule); font-weight: 800; font-variant-numeric: tabular-nums; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px;
  border: 2px solid var(--rule); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 800; font-size: 14px;
}
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn[aria-pressed="true"] { background: var(--whistle); border-color: var(--whistle-deep); color: var(--whistle-ink); }

.site-main { padding-block: 24px 48px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 9px 16px; border-radius: 12px;
  border: 2px solid var(--rule); background: var(--card); color: var(--ink);
  font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--whistle); border-color: var(--whistle-deep); color: var(--whistle-ink); box-shadow: 0 3px 0 var(--whistle-deep); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--whistle-deep); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--paper); }
.btn.big { min-height: 52px; padding: 12px 22px; font-size: 17px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn[hidden] { display: none !important; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.back-link { font-size: 14px; font-weight: 800; color: var(--ink-2); text-decoration: none; }
.back-link:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Звёзды ---------- */
.star { color: var(--rule); }
.star.on { color: var(--star); }
.stars { display: inline-flex; gap: 1px; font-size: 16px; line-height: 1; letter-spacing: 0; }
.stars.mid { font-size: 20px; vertical-align: -3px; }
.stars.big { font-size: 46px; gap: 4px; }

/* ---------- Доска (рамка, поле, фишки) ---------- */
.board-wrap {
  position: relative; border: 7px solid var(--frame); border-radius: 18px;
  background: var(--grass-out); overflow: hidden; box-shadow: var(--shadow);
}
.board { position: relative; }
.pitch { display: block; width: 100%; height: auto; max-height: calc(100vh - var(--header-h) - 150px); margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.board.is-vertical .pitch { max-height: none; }
.grass-out { fill: var(--grass-out); }
.grass-a { fill: var(--grass-a); }
.grass-b { fill: var(--grass-b); }
.lines { fill: none; stroke: rgba(255, 255, 255, .88); stroke-width: .22; }
.offside-line { stroke: rgba(255, 255, 255, .55); stroke-width: .18; stroke-dasharray: .9 .7; }
.spots { fill: rgba(255, 255, 255, .9); }
.goal { fill: rgba(255, 255, 255, .3); stroke: #fff; stroke-width: .22; }

.pl { outline: none; }
.pl.is-hidden { display: none; }
.pl-shadow { fill: rgba(0, 0, 0, .3); }
.pl-body { fill: var(--tok-home); stroke: #fff; stroke-width: .28; }
.pl.away .pl-body { fill: var(--tok-away); }
.pl.gk.home .pl-body { fill: var(--tok-gk-home); }
.pl.gk.away .pl-body { fill: var(--tok-gk-away); }
.pl-shine { pointer-events: none; }
.pl-num { font: 1.5px var(--f-display); fill: #fff; text-anchor: middle; pointer-events: none; }
.pl.gk.home .pl-num { fill: #2a1f00; }
.pl-role { display: none; font: 800 1.05px var(--f-body); fill: #fff; text-anchor: middle; stroke: rgba(0, 0, 0, .55); stroke-width: .32; paint-order: stroke; pointer-events: none; }
.pl.show-role .pl-role { display: inline; }
.pl-ring { fill: none; stroke: var(--whistle); stroke-width: .38; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pl.is-hl .pl-ring { opacity: 1; animation: ring 1.4s ease-in-out infinite; }
.pl.is-dim { opacity: .32; }
.pl.is-clickable, .pl.is-draggable { cursor: pointer; }
.pl.is-draggable { cursor: grab; }
.pl.is-dragging { cursor: grabbing; }
.pl.is-clickable:hover .pl-ring, .pl.is-draggable:hover .pl-ring, .pl:focus-visible .pl-ring { opacity: 1; stroke: #fff; }
.pl.is-clickable .pl-body { stroke: var(--whistle); stroke-width: .34; }
@keyframes ring { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1.12); } }

.ball.is-hidden { display: none; }
.ball-body { fill: #fff; stroke: #1c1c1c; stroke-width: .14; }
.ball-patch { fill: #1c1c1c; }
.ball-shadow { fill: rgba(0, 0, 0, .3); }
[data-tool="move"] .ball { cursor: grab; }

.ar-line { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }   /* нажатие — по фишке под стрелкой (на доске тренера стрелки ловит .ar-hit) */
.ar-pass .ar-line { stroke: #fff; stroke-width: .32; }
.ar-run .ar-line { stroke: #ffe45c; stroke-width: .3; stroke-dasharray: .9 .7; }
.ar-dribble .ar-line { stroke: #fff; stroke-width: .26; }
.ar-shot .ar-line { stroke: #ffb03a; stroke-width: .52; }
.ar-option .ar-line { stroke: rgba(255, 255, 255, .8); stroke-width: .22; stroke-dasharray: .5 .6; }
.ar-away .ar-line { stroke: #ffc4ba; }
.mk-white { fill: #fff; }
.mk-yellow { fill: #ffe45c; }
.mk-orange { fill: #ffb03a; }
.mk-red { fill: #ffc4ba; }
.mk-faint { fill: rgba(255, 255, 255, .8); }
.arrows { transition: opacity .3s ease; }
.arrows.is-moving { opacity: .35; }
.ar-hit { fill: none; stroke: transparent; stroke-width: 2.4; pointer-events: none; }
/* Доска тренера: нажатие на стрелку открывает её меню (кроме показа кадров). */
[data-tool] .ar-hit { pointer-events: stroke; cursor: pointer; }
.board-wrap.is-playing .ar-hit { pointer-events: none; }
[data-tool] .ar:hover .ar-line { filter: drop-shadow(0 0 .35px #fff); }
.temp .ar { opacity: .85; }

.zn { fill: rgba(255, 255, 255, .13); stroke: rgba(255, 255, 255, .7); stroke-width: .2; stroke-dasharray: .8 .6; }
.zn-good { fill: rgba(255, 233, 92, .2); stroke: #ffe45c; }
.zn-bad { fill: rgba(255, 70, 50, .24); stroke: #ffa092; }
.zn-target { fill: rgba(255, 255, 255, .2); stroke: #fff; stroke-dasharray: 1 .6; animation: blink 1.2s ease-in-out infinite; }
.zn-rope { fill: none; stroke: #ffe45c; stroke-width: .32; stroke-dasharray: .6 .5; }
.zn-label { font: 700 2.6px var(--f-marker); fill: #fff; stroke: rgba(0, 0, 0, .45); stroke-width: .4; paint-order: stroke; pointer-events: none; }
.zn-label-good { fill: #fff3a3; }
.zn-label-bad { fill: #ffd5cf; }
.zn-label-big { font-size: 5.5px; }
.spot-mark circle { fill: rgba(255, 255, 255, .25); stroke: #fff; stroke-width: .25; stroke-dasharray: .6 .4; }
.spot-mark path { stroke: #fff; stroke-width: .4; stroke-linecap: round; }
@keyframes blink { 50% { opacity: .45; } }

.rot-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(10, 30, 16, .45); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.rot-btn:hover { background: rgba(10, 30, 16, .65); }
.rot-btn svg { width: 20px; height: 20px; fill: currentColor; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-icon { display: inline-grid; place-items: center; width: 34px; height: 20px; border-radius: 5px; background: var(--grass-a); flex: none; }
.lg-icon svg { width: 30px; height: 18px; }
.lg-pass { stroke: #fff; stroke-width: 2; }
.lg-run { stroke: #ffe45c; stroke-width: 2; stroke-dasharray: 3 2.5; }
.lg-dribble { stroke: #fff; stroke-width: 1.7; fill: none; }
.lg-shot { stroke: #ffb03a; stroke-width: 3.4; }
.lg-head { fill: #fff; }
.lg-head-run { fill: #ffe45c; }
.lg-head-shot { fill: #ffb03a; }
.lg-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rule); flex: none; display: inline-block; }
.lg-dot.home { background: var(--tok-home); }
.lg-dot.away { background: var(--tok-away); }

/* ---------- Сцена: поле + панель ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; align-items: start; }
.stage-main { min-width: 0; }
.panel {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
  position: sticky; top: calc(var(--header-h) + 16px + env(safe-area-inset-top, 0px));
}
.panel-title { font: 26px var(--f-display); }
.panel-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dock { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.coach { display: flex; gap: 12px; align-items: flex-start; }
.coach-ava { width: 64px; height: 64px; flex: none; }
.coach-ava svg { width: 100%; height: 100%; display: block; overflow: visible; }
.quiz-coach .quiz-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.quiz-coach .quiz-head .task-badge, .quiz-coach .quiz-q { margin: 0; }
.coach .coach-ava { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Тренер-персонаж (FT.ui.coach): части и настроения */
.m-shadow { fill: rgba(0, 0, 0, .14); }
.m-thumb path, .m-thumb rect { fill: var(--thumb, #f6c7a1); stroke: rgba(120, 60, 30, .45); stroke-width: .8; stroke-linejoin: round; }
.m-thumb .m-cuff { fill: var(--cuff, #23824f); stroke: none; }
.m-thumb .m-crease { fill: none; stroke: rgba(120, 60, 30, .45); stroke-width: .8; stroke-linecap: round; }
.m-cheek { fill: #ff8a8a; opacity: .45; }
.m-brows path { fill: none; stroke-linecap: round; }
.m-eye { fill: #fff; stroke: rgba(150, 90, 50, .4); stroke-width: .6; }
.m-pupils circle { fill: #1f2a22; }
.m-pupils .m-glint { fill: #fff; }
.m-nose { fill: rgba(170, 80, 40, .3); }
.m-smile, .m-ow { fill: none; stroke: #6a2a22; stroke-width: 2; stroke-linecap: round; }
.m-open, .m-grin { fill: #7a2a2a; }
.m-sweat { fill: #6cc3ff; }
.m-star { fill: #ffcc33; stroke: #b8860b; stroke-width: .6; }
.m-q { font: 800 15px var(--f-display, sans-serif); fill: var(--ink, #1f2a22); }
.m-open, .m-grin, .m-ow, .m-sweat, .m-thumb, .m-star, .m-q { display: none; }
.m-all { animation: m-bob 3.2s ease-in-out infinite; }
.m-eyes { transform-origin: 40px 43px; animation: m-blink 4.6s infinite; }
.m-head, .m-capall, .m-brows, .m-pupils { transition: transform .25s; }
.m-head { transform-origin: 40px 62px; }
@keyframes m-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2px); } }
@keyframes m-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
/* говорит */
.is-talking .m-smile { display: none; }
.is-talking .m-open { display: inline; transform-origin: 40px 56px; animation: m-talk .24s ease-in-out infinite alternate; }
.is-talking .m-stache { transform-origin: 40px 51px; animation: m-stache .24s ease-in-out infinite alternate; }
.is-talking .m-head { animation: m-nod 1.3s ease-in-out infinite; }
@keyframes m-talk { from { transform: scaleY(.25); } to { transform: scaleY(1.15); } }
@keyframes m-stache { from { transform: translateY(0); } to { transform: translateY(-.7px) scaleX(1.04); } }
@keyframes m-nod { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 70% { transform: rotate(2.5deg); } }
/* радуется */
.is-happy .m-all { animation: m-jump .5s cubic-bezier(.3, .7, .4, 1) 3; }
.is-happy .m-smile, .is-happy .m-open { display: none; }
.is-happy .m-grin { display: inline; }
.is-happy .m-thumb { display: inline; transform-box: fill-box; transform-origin: 50% 80%; animation: m-pop .35s ease-out both; }
.is-happy .m-star { display: inline; transform-origin: 40px 30px; animation: m-twinkle .5s ease-in-out infinite alternate; }
.is-happy .m-star2 { animation-delay: .25s; }
.is-happy .m-brows { transform: translateY(-1.6px); }
.is-happy .m-capall { transform: translateY(-2.5px) rotate(-5deg); }
@keyframes m-jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } }
@keyframes m-pop { from { transform: scale(0); } 70% { transform: scale(1.2); } to { transform: scale(1); } }
@keyframes m-twinkle { from { opacity: .4; transform: scale(.8); } to { opacity: 1; transform: scale(1.1); } }
/* огорчился */
.is-oops .m-head { animation: m-shake .42s ease-in-out 2; }
.is-oops .m-smile, .is-oops .m-open { display: none; }
.is-oops .m-ow { display: inline; }
.is-oops .m-sweat { display: inline; animation: m-drip 1.1s ease-in infinite; }
.is-oops .m-brows { transform: translateY(1.2px); }
@keyframes m-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes m-drip { from { transform: translateY(0); opacity: 1; } to { transform: translateY(6px); opacity: 0; } }
/* задумался */
.is-think .m-head { transform: rotate(-7deg); }
.is-think .m-pupils { transform: translate(1px, -1.6px); }
.is-think .m-q { display: inline; animation: m-float 1s ease-in-out infinite alternate; }
@keyframes m-float { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.bubble {
  position: relative; flex: 1; min-width: 0; background: var(--paper); border: 1px solid var(--rule);
  border-radius: 4px 16px 16px 16px; padding: 12px 14px;
}
.bubble-text { font-size: 17px; line-height: 1.5; font-weight: 600; }
.steps { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.seg-bar { display: flex; gap: 4px; flex: 1 1 200px; min-width: 0; }
.seg { flex: 1; min-width: 8px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.seg::before { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 8px; border-radius: 4px; background: var(--rule); }
.seg.done::before { background: var(--home); }
.seg.now::before { background: var(--whistle); box-shadow: 0 0 0 2px var(--whistle-deep) inset; }
.step-count { font-size: 13px; font-weight: 800; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kbd-hint { font-size: 13px; color: var(--ink-2); }
@media (pointer: coarse) { .kbd-hint { display: none; } }
.task-help { font-size: 14px; color: var(--ink-2); }
.hint { font-size: 15px; background: var(--info-bg); border-radius: 12px; padding: 10px 14px; }
.hint::before { content: 'Подсказка: '; font-weight: 800; }

.feedback { font-size: 15px; line-height: 1.5; border-radius: 12px; padding: 0; }
.feedback:empty { display: none; }
.feedback.good, .feedback.bad, .feedback.warn, .feedback.info { padding: 11px 14px; border: 1.5px solid transparent; }
.feedback.good { background: var(--good-bg); border-color: var(--good); }
.feedback.bad { background: var(--bad-bg); border-color: var(--bad); }
.feedback.warn { background: var(--warn-bg); border-color: var(--warn); }
.feedback.info { background: var(--info-bg); border-color: transparent; }

.quiz { display: flex; flex-direction: column; gap: 12px; }
.quiz-q { font-size: 21px; font-weight: 800; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt {
  text-align: left; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--rule);
  background: var(--card); font-weight: 700; font-size: 16px; cursor: pointer; min-height: 48px;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--home); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.is-right { border-color: var(--good); background: var(--good-bg); }
.quiz-opt.is-wrong { border-color: var(--bad); background: var(--bad-bg); opacity: .8; }
.quiz-fb { font-size: 15px; }
.quiz-fb:empty { display: none; }
.quiz-fb.good { color: var(--good); font-weight: 700; }
.quiz-fb.bad { color: var(--bad); font-weight: 700; }
.finish { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.finish-title { font: 24px var(--f-display); }
/* После урока — в матч. */
.finish-play {
  align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px;
  background: var(--paper); border: 2px solid var(--whistle);
}
.finish-play h3 { margin: 0; font: 20px var(--f-display); }
.finish-play p { margin: 0; }
.daily-done { margin: 0; font-weight: 800; }
.btn.friend { background: #2f6fe0; border-color: #1d4fae; color: #fff; box-shadow: 0 3px 0 #1d4fae; }
.btn.friend:hover { filter: brightness(1.06); border-color: #1d4fae; }

/* Урок дня */
.daily {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 24px;
  padding: 14px; background: var(--card); border: 2px solid var(--whistle); border-radius: var(--radius); box-shadow: var(--shadow);
}
.daily-thumb { display: block; border-radius: 12px; overflow: hidden; }
.daily-thumb .mini-board { border-bottom: 0; }
.daily-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.daily-title { margin: 0; font: 24px var(--f-display); }
.daily-text { margin: 0; color: var(--ink-2); }
.daily-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.streak { font-weight: 800; white-space: nowrap; }
.daily-why { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
/* Неделя: урок каждый день — мешок мячей */
.week { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.wk-days { display: inline-flex; gap: 4px; }
.wk-day { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; text-transform: uppercase; border: 2px solid var(--rule); color: var(--ink-2); }
.wk-day.is-today { border-color: var(--whistle-deep); }
.wk-day.is-on { background: var(--good); border-color: var(--good); color: var(--card); }
.week small { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.daily-go { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.daily.is-done { border-color: var(--good, #2e8241); }
.daily-badge { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--whistle); color: var(--whistle-ink); letter-spacing: .02em; }
@media (max-width: 860px) {
  .daily { grid-template-columns: 150px minmax(0, 1fr); }
  .daily-go { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .daily-go .btn { flex: 1; }
}
@media (max-width: 520px) {
  .daily { grid-template-columns: minmax(0, 1fr); }
  .daily-thumb { display: none; }
}

/* Окно «Урок дня» при входе в игру */
.daily-offer {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow-y: auto;
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px max(12px, env(safe-area-inset-bottom, 0px));
  background: rgba(8, 20, 13, .58);
}
.daily-offer-card {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: center; width: min(640px, 100%);
  padding: 16px; background: var(--card); color: var(--ink); border: 3px solid var(--whistle); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35); animation: offer-in .25s ease-out;
}
.daily-offer-thumb { border-radius: 12px; overflow: hidden; }
.daily-offer-thumb .mini-board { border-bottom: 0; }
.daily-offer-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.daily-offer-body .eyebrow { margin: 0; }
.daily-offer-why { margin: 0; font-weight: 700; }
.daily-offer-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.daily-offer-go .btn.primary { flex: 1 1 auto; }
@keyframes offer-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@media (max-width: 560px) { .daily-offer-card { grid-template-columns: minmax(0, 1fr); } .daily-offer-thumb { display: none; } }
@media (max-height: 460px) { .daily-offer-card { grid-template-columns: 150px minmax(0, 1fr); padding: 12px; gap: 12px; } .daily-offer .daily-text { display: none; } }
@media (prefers-reduced-motion: reduce) { .daily-offer-card { animation: none; } }

/* ---------- Главная ---------- */
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); gap: 36px; align-items: center; padding-block: 12px 32px; }
.hero-text { display: flex; flex-direction: column; gap: 16px; }
.hero-title { font: clamp(40px, 6vw, 64px)/1 var(--f-display); letter-spacing: -.01em; }
.hero-77 { display: inline-block; background: #15241b; color: var(--whistle); padding: .06em .22em .1em; border-radius: 12px; transform: rotate(-2deg); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hero-demo { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.demo-cap { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.demo-cap .coach-ava { width: 40px; height: 40px; }
.demo-caption { font-weight: 800; font-size: 16px; }

.rank-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 18px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 28px; }
.rank-now { display: flex; flex-direction: column; }
.rank-name { font: 24px var(--f-display); }
.rank-bar-wrap { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.rank-bar { height: 12px; border-radius: 6px; background: var(--paper); border: 1px solid var(--rule); overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--whistle); border-radius: 6px; min-width: 4px; }
.rank-next { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Мои значки */
.badges-strip { margin-bottom: 28px; padding: 16px 18px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
/* «Мои темы» в профиле: тема, полоска «с первой попытки», число и оценка, ссылка на тренировку для слабой темы. */
.topics-strip { margin-bottom: 28px; padding: 16px 18px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.topics-strip h2 { margin: 0 0 10px; }
.topic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.topic { display: grid; grid-template-columns: minmax(90px, 140px) 1fr; gap: 4px 12px; align-items: center; }
.topic-name { font-weight: 800; }
.topic-bar { height: 10px; border-radius: 6px; background: var(--rule); overflow: hidden; }
.topic-bar span { display: block; height: 100%; background: var(--ink-2); border-radius: 6px; }
.topic.is-good .topic-bar span { background: var(--good); }
.topic.is-fine .topic-bar span { background: var(--warn); }
.topic.is-weak .topic-bar span { background: var(--bad); }
.topic-num { grid-column: 2; font-size: 13px; color: var(--ink-2); }
.topic .btn { grid-column: 2; justify-self: start; }
/* Домашние задания в группах и в тренажёре. */
.fr-list li.hw-item { display: block; }
.fr-list li.hw-item:has(> a) { display: flex; }
.hw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.hw-head .fr-acts { margin-left: auto; }
/* Результаты задания (окно «Результаты»): имя слева, счёт справа; не помещаются в строку — счёт ниже, имя не рвётся. */
.hw-players { font-size: 15px; }
.fr-list.hw-players li { flex-wrap: wrap; gap: 2px 12px; }
.hw-players .fr-name { flex: 1 1 auto; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-players .hw-score { flex: 0 1 auto; color: var(--ink-2); font-size: 14px; }
.hw-players li.is-done, .hw-item.is-done { color: var(--ink-2); }
.hw-what { flex: 1 1 200px; min-width: 0; }
/* Новое задание: вид, уровень, сколько и «Задать» — сеткой, на телефоне по два в строку (списки не сжимаются в «Вс»). */
.hw-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; align-items: center; }
.hw-form .field { width: 100%; min-width: 0; }
.hw-banner { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--paper); border: 1px solid var(--rule); font-size: 14px; }
.badges-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.badges-head h2 { margin: 0; font: 22px var(--f-display); }
.badges-count { font-weight: 800; color: var(--ink-2); }
.cup-link { margin-left: auto; }
.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; border: 2px dashed var(--rule); opacity: .55; filter: grayscale(1); }
.badge.is-on { border: 2px solid var(--whistle); opacity: 1; filter: none; background: var(--paper); }
.badge-ic { font-size: 26px; line-height: 1; }
.badge b { font-size: 14px; }
.badge small { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.tm-stats { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; font-weight: 700; }
.home-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); }
/* Выбор языка (FT.i18n.picker) */
.lang-pick { display: inline-flex; align-items: center; gap: 6px; margin: 0 10px 8px 0; vertical-align: middle; }
.lang-pick-icon { font-size: 18px; line-height: 1; }
.lang-pick select { font: 600 14px var(--f-body); padding: 6px 8px; border-radius: 10px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); cursor: pointer; }
.linklike { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* ---------- Списки уроков и задач ---------- */
.page-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.page-head h1 { font: clamp(30px, 4vw, 40px) var(--f-display); }
/* Заголовок и вкладки «Уроки / Задачи» в одну строку (на узком экране вкладки переносятся под заголовок). */
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.page-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--rule); }
.page-tab { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 800; white-space: nowrap; }
.page-tab:hover { background: var(--paper); }
.page-tab.is-on { background: var(--ink); color: var(--card); }
.card-group { margin-bottom: 28px; }
.group-title { font: 20px var(--f-display); margin-bottom: 12px; }
.group-lead { margin: -6px 0 12px; color: var(--ink-2); font-size: 14px; }
.trainer-card { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 14px 18px; border-radius: 16px; background: var(--card); border: 2px solid var(--accent, #ffcf33); color: inherit; text-decoration: none; box-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
.trainer-card:hover { transform: translateY(-1px); }
.trainer-icon { font-size: 32px; line-height: 1; }
.trainer-text { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 14px; color: var(--ink-2); }
.trainer-text strong { font: 20px var(--f-display); color: var(--ink); }
.trainer-go { font-size: 24px; color: var(--ink-2); }
.trainer-picks { display: flex; gap: 8px; margin: 6px 0 2px; }
.trainer-pick { flex: 1; min-width: 0; }
.trainer-pick select { width: 100%; padding: 6px 8px; border: 1.5px solid var(--rule); border-radius: 10px; background: var(--card); color: var(--ink); font: 600 14px var(--f-body); }
.trainer-stat { margin: 4px 0; font-size: 13px; color: var(--ink-2); }
.drill-status { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.lesson-card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease;
}
.lesson-card:hover, .puzzle-card:hover { transform: translateY(-3px); }
.mini-board { background: var(--grass-out); border-bottom: 5px solid var(--frame); }
.mini-board .pitch { max-height: none; pointer-events: none; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card-num { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.card-title { font-size: 18px; font-weight: 800; }
.card-text { color: var(--ink-2); font-size: 15px; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.card-go { font-weight: 800; color: var(--home); }

.puzzles-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.puzzle-card {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease;
}
.pz-num {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font: 20px var(--f-display); color: #fff; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 55%), var(--tok-home);
  border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
}
.puzzle-card.is-done .pz-num { background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5), transparent 55%), var(--tok-gk-home); color: #2a1f00; }
.pz-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pz-type { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- Доска тренера ---------- */
.stage-board .pitch { max-height: calc(100vh - var(--header-h) - 250px); }
/* Горизонтальное поле: рамка облегает поле (без пустых зелёных полос по бокам). Ширина — по высоте экрана,
   но не меньше 460 px (на низком экране страница прокручивается, а не сжимает поле) и не шире колонки. */
@supports (width: 1cqw) {
  .stage-board > .stage-main { container-type: inline-size; }
  .stage-board .board-wrap:not(.is-vertical) { width: fit-content; max-width: 100%; }
  .stage-board .board-wrap:not(.is-vertical) .pitch { max-height: none; width: min(calc(100cqw - 14px), max(460px, calc((100vh - var(--header-h) - 250px) * 1.4425))); }
  .stage-board .board-wrap:not(.is-vertical) ~ .toolbar { max-width: min(100cqw, calc(max(460px, calc((100vh - var(--header-h) - 250px) * 1.4425)) + 14px)); }
}
/* Одна строка: «Двигать | Рисовать», отменить, вернуть, во весь экран (справа). */
.toolbar { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.tool {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 6px 11px;
  border-radius: 11px; border: 2px solid var(--rule); background: var(--card); cursor: pointer; font-weight: 800; font-size: 14px;
}
.tool:hover { border-color: var(--ink-2); }
.tool:disabled { opacity: .4; cursor: default; border-color: var(--rule); }
.tool[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
.tool-ico svg { width: 20px; height: 20px; display: block; fill: currentColor; }
.tool-modes { display: inline-flex; margin-right: 4px; }
.tool-modes .tool:first-child { border-radius: 11px 0 0 11px; }
.tool-modes .tool:last-child { border-radius: 0 11px 11px 0; margin-left: -2px; }
.tool-icon { width: 42px; padding: 0; justify-content: center; flex: none; }
.tool-full { margin-left: auto; }
.board-hint { margin-top: 6px; }
.att-box { display: flex; flex-direction: column; gap: 6px; }
.att-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.att-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.att-name { min-width: 0; overflow-wrap: anywhere; }
.att-name small { color: var(--ink-2); font-weight: 600; }
.att-acts { display: flex; gap: 6px; flex: none; }

/* «Поделиться» в панели доски: заголовок с «?», три кнопки; пояснения раскрываются под «?». */
.share-block { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.share-head { display: flex; align-items: center; gap: 8px; }
.share-title { font-size: 16px; font-weight: 800; margin: 0; }
.help-btn {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--rule); background: var(--card); color: var(--ink-2); font-weight: 800; font-size: 14px; line-height: 1;
}
.help-btn:hover, .help-btn[aria-expanded="true"] { border-color: var(--ink-2); color: var(--ink); }
.share-help { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--rule); font-size: 14px; }
.share-help p { margin: 0; }
.share-btns { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.share-btns .btn { justify-content: flex-start; }
.share-send { display: flex; flex-direction: column; gap: 6px; }
/* Меню стрелки: вид или «Удалить», у середины стрелки. */
.ar-menu {
  position: absolute; z-index: 6; display: flex; flex-wrap: wrap; gap: 4px; max-width: min(340px, calc(100% - 12px)); padding: 6px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow);
}
.ar-menu-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 10px 4px 6px; border-radius: 9px;
  border: 2px solid transparent; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 14px; cursor: pointer;
}
.ar-menu-btn:hover { border-color: var(--ink-2); }
.ar-menu-btn.is-on { border-color: var(--whistle); }
.ar-menu-btn.is-del { color: var(--bad); padding-left: 8px; }
.ar-menu-btn.is-del .tool-ico svg { width: 18px; height: 18px; }
/* «Во весь экран»: поле, кадры и инструменты поверх страницы. */
body.board-full { overflow: hidden; }
body.board-full .stage-board > .stage-main {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--paper);
  padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
}
body.board-full .stage-board .board-hint, body.board-full .stage-board .board-edit { display: none; }
/* Поле как можно крупнее, рамка облегает поле (без пустых зелёных полос). Ширина поля — из свободного места
   и пропорций поля: 65,2 × 45,2 м с запасом у линий (по горизонтали 1,4425, по вертикали 0,6933). */
body.board-full .stage-board > .stage-main { display: flex; flex-direction: column; align-items: center; justify-content: center; }
body.board-full .stage-board .board-wrap { width: fit-content; max-width: 100%; }
body.board-full .stage-board .board .pitch { max-height: none; width: min(calc(100vw - 34px), calc((100vh - 150px) * 1.4425)); width: min(calc(100vw - 34px), calc((100dvh - 150px) * 1.4425)); }
body.board-full .stage-board .board.is-vertical .pitch { width: min(calc(100vw - 34px), calc((100vh - 150px) * .6933)); width: min(calc(100vw - 34px), calc((100dvh - 150px) * .6933)); }
body.board-full .stage-board .frames, body.board-full .stage-board .toolbar { width: 100%; max-width: 640px; }
/* Альбомная ориентация: кадры и инструменты — колонкой справа, поле на всю высоту. */
@media (orientation: landscape) {
  body.board-full .stage-board > .stage-main {
    display: grid; grid-template-columns: auto 232px; grid-template-rows: 1fr 1fr; column-gap: 14px; row-gap: 10px;
    justify-content: center; align-content: center; align-items: center;
  }
  body.board-full .stage-board .board-wrap { grid-row: 1 / span 2; }
  body.board-full .stage-board .board .pitch { width: min(calc(100vw - 280px), calc((100vh - 34px) * 1.4425)); width: min(calc(100vw - 280px), calc((100dvh - 34px) * 1.4425)); }
  body.board-full .stage-board .board.is-vertical .pitch { width: min(calc(100vw - 280px), calc((100vh - 34px) * .6933)); width: min(calc(100vw - 280px), calc((100dvh - 34px) * .6933)); }
  body.board-full .stage-board .frames { align-self: end; margin-top: 0; }
  body.board-full .stage-board .toolbar { align-self: start; flex-wrap: wrap; margin-top: 0; }
  body.board-full .stage-board .tool-modes { margin-right: 0; }
}
.frames { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.frames::before { content: attr(data-label); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-right: 4px; }
.frame-chip {
  width: 42px; height: 42px; border-radius: 11px; border: 2px solid var(--rule); background: var(--card);
  font: 17px var(--f-display); cursor: pointer; font-variant-numeric: tabular-nums;
}
.frame-chip.is-current { background: var(--whistle); border-color: var(--whistle-deep); color: var(--whistle-ink); }
.frame-add { border-style: dashed; color: var(--ink-2); }
/* Показ кадров: жёлтая кнопка ▶ сразу за кадрами. */
.play-btn {
  display: grid; place-items: center; width: 58px; height: 42px; margin-left: 4px; border-radius: 11px; cursor: pointer;
  background: var(--whistle); border: 2px solid var(--whistle-deep); color: var(--whistle-ink); box-shadow: 0 3px 0 var(--whistle-deep);
}
.play-btn svg { width: 24px; height: 24px; display: block; fill: currentColor; }
.play-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.board-edit { margin-top: 6px; }
.board-wrap.is-playing .rot-btn { display: none; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 800; }
.field {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--rule);
  background: var(--paper); color: var(--ink); font-size: 15px;
}
textarea.field { resize: vertical; min-height: 64px; }
.voice-name { font-weight: 800; padding: 6px 4px; }
/* iPhone и iPad приближают страницу к полю ввода с шрифтом мельче 16px — на сенсорных экранах шрифт полей не мельче. */
@media (pointer: coarse) { input, select, textarea, .field { font-size: max(16px, 1em); } }
select.field { width: auto; min-width: 110px; margin-left: auto; }
#board-demo { width: 100%; margin-left: 0; }
.field-row { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--home); }
.fold { border-top: 1px solid var(--rule); padding-top: 4px; }
.fold summary { cursor: pointer; font-weight: 800; padding: 8px 0; }
.fold-body { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.small-msg { font-size: 13px; color: var(--ink-2); }
.small-msg:empty { display: none; }

/* ---------- Узкие экраны ---------- */
@media (max-width: 980px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
/* Планшет стоя: панель урока или задачи под полем. Поле уменьшается, чтобы и оно, и панель вместе со словами тренера
   и ответом помещались на экране (высоту панели --panel-h ставит FT.ui.trackDock); 104px — отступы, рамка поля и подписи. */
@media (min-width: 641px) and (max-width: 980px) {
  .stage-lesson .board .pitch, .stage-puzzle .board .pitch {
    max-height: max(300px, calc(100vh - var(--header-h) - var(--panel-h, 420px) - 104px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    max-height: max(300px, calc(100dvh - var(--header-h) - var(--panel-h, 420px) - 104px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  }
}
@media (max-width: 640px) {
  :root { --header-h: 140px; }
  /* Урок и задача: шапка свёрнута в строку — «Меню» и звук. «Меню» или движение вниз по строке разворачивает
     шапку поверх страницы, нажатие мимо или движение вверх сворачивает. */
  body.page-stage { --header-h: 46px; }
  html:has(body.page-stage) { overscroll-behavior-y: contain; }   /* движение вниз у верха страницы не обновляет её */
  body.page-stage .site-header { min-height: calc(46px + env(safe-area-inset-top, 0px)); }
  body.page-stage .header-inner { min-height: 46px; padding-block: 4px; }
  body.page-stage:not(.hdr-open) .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "hdl . tools"; }
  body.page-stage:not(.hdr-open) .header-inner > :is(.brand, .acc-link, .main-nav, .header-lang) { display: none; }
  body.page-stage:not(.hdr-open) .header-tools > :is(.star-pill, .ball-pill) { display: none; }
  body.page-stage .hdr-handle {
    display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 38px; padding: 4px 14px 4px 10px;
    border-radius: 999px; background: var(--paper); border: 1px solid var(--rule); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer;
  }
  body.page-stage .hdr-chev { display: inline-block; font-size: 18px; line-height: 1; transform: translateY(-2px); transition: transform .2s; }
  body.page-stage .header-tools .icon-btn { min-height: 38px; padding: 4px 10px; }
  body.page-stage.hdr-open .site-header { z-index: 50; }
  body.page-stage.hdr-open .header-inner {
    position: absolute; left: 0; right: 0; top: env(safe-area-inset-top, 0px); background: var(--card);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18); border-bottom: 1px solid var(--rule); padding-block: 8px;
    grid-template-areas: "brand . lang" "acc tools tools" "nav nav nav" "hdl hdl hdl"; animation: hdr-down .18s ease-out;
  }
  body.page-stage.hdr-open .hdr-handle { justify-self: center; }
  body.page-stage.hdr-open .hdr-chev { transform: rotate(180deg) translateY(-2px); }
  .hdr-shade { position: fixed; inset: 0; z-index: 45; background: rgba(10, 30, 16, .25); }
  @keyframes hdr-down { from { transform: translateY(-12px); opacity: .4; } to { transform: none; opacity: 1; } }
  .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand . lang" "acc tools tools" "nav nav nav"; gap: 6px 10px; }
  .header-inner > .header-tools { justify-self: end; }
  .main-nav { overflow-x: auto; scrollbar-width: none; }
  .main-nav { gap: 2px; }
  .main-nav a { padding: 7px 9px; font-size: 15px; }
  .nav-badge { margin-left: 3px; }
  .nav-long { display: none; }
  .icon-btn-text { display: none; }
  .site-main { padding-block: 16px 40px; }
  .panel { padding: 16px; }
  .board-wrap { border-width: 5px; border-radius: 14px; }
  .lead { font-size: 16px; }
  .bubble-text { font-size: 16px; }
  .tool-name { font-size: 13px; }
  /* Доска: кадры в одну строку (до шести), без подписи «Кадры». */
  .stage-board .frames { gap: 5px; }
  .stage-board .frames::before { display: none; }
  .stage-board .frame-chip { width: 38px; height: 40px; }
  .stage-board .play-btn { width: 50px; height: 40px; }
  /* Урок и задача: заголовок над полем, слова тренера и кнопки — в панели у нижнего края. */
  .stage-lesson .panel, .stage-puzzle .panel { order: -1; padding: 0; background: transparent; border: 0; box-shadow: none; gap: 6px; }
  .stage-lesson .panel, .stage-puzzle .panel { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .stage-lesson .panel > .eyebrow, .stage-puzzle .panel > .eyebrow { display: none; }
  .stage-lesson .panel > .steps { flex-basis: 100%; }
  .stage-lesson .panel > .principles, .stage-puzzle .panel > .principles { display: none; }
  .dock .task-help { font-size: 13px; margin: 0; line-height: 1.3; }
  .dock .quiz-q { font-size: 17px; margin: 0; }
  .dock .quiz-opt { padding: 9px 12px; }
  .stage-lesson .panel-body, .stage-puzzle .panel-body { flex-basis: 100%; gap: 10px; }
  .stage-lesson .panel-title, .stage-puzzle .panel-title { font-size: 22px; }
  .dock .kbd-hint { display: none; }
  .stage-lesson, .stage-puzzle { padding-bottom: var(--dock-h, 200px); }
  .dock {
    position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; gap: 10px;
    background: var(--card); border-top: 1px solid var(--rule); box-shadow: 0 -6px 18px rgba(0, 0, 0, .12);
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    max-height: 60vh; overflow-y: auto;
  }
  .dock .coach-ava { width: 46px; height: 46px; }
  .dock .bubble { padding: 8px 12px; }
  .dock .bubble-text { font-size: 15px; }
  .dock .btn { min-height: 42px; padding: 8px 14px; }
  /* Поле целиком между заголовком урока и нижней панелью — и вертикальное, и повёрнутое горизонтально. */
  .stage-lesson .board .pitch { max-height: calc(100vh - var(--header-h) - var(--dock-h, 200px) - 150px); max-height: calc(100dvh - var(--header-h) - var(--dock-h, 200px) - 150px); }
  /* Компактная нижняя панель урока: больше места полю. */
  .stage-lesson .dock { gap: 8px; padding-top: 8px; }
  .stage-lesson .dock .coach { gap: 8px; align-items: center; }
  .stage-lesson .dock .bubble { padding: 6px 10px; }
  .stage-lesson .dock .task-badge { margin: 0; font-size: 12px; }
  .stage-lesson .dock .feedback { padding: 8px 10px; font-size: 14px; }
  .stage-lesson .dock .feedback .cheer { display: none; }
  .stage-lesson .dock .hint { margin: 0; font-size: 14px; }
  .stage-lesson .dock .controls { flex-wrap: nowrap; }
  .stage-lesson .dock .btn { min-height: 40px; padding: 7px 12px; }
  .stage-puzzle .board .pitch { max-height: calc(100vh - var(--header-h) - var(--dock-h, 120px) - 230px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Значки принципов игры */
.principles { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 8px 0 0; padding: 0; }
.pr-chip { font-size: 12px; font-weight: 800; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--info-bg); color: var(--ink); border: 1px solid var(--rule); }
.panel > .principles { margin: 4px 0 12px; }

/* Напутствия тренера */
.cheer { font: 700 20px/1.25 var(--f-marker); color: var(--ink); }
.feedback .cheer { display: block; margin-top: 6px; }

/* ---------- Игра: матч во весь экран ---------- */
body.game-mode { overflow: hidden; }
body.game-mode .site-header { display: none; }
.game-root {
  position: fixed; inset: 0; z-index: 40; background: #0d2a3d; color: #fff;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overflow: hidden;
}
.game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
.g-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px;
  padding: max(8px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.g-top > * { pointer-events: auto; }
.g-exit, .g-icon, .g-score, .g-turn { background: rgba(8, 20, 13, .72); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; color: #fff; }
.g-exit { padding: 7px 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.g-score { padding: 5px 12px; font: 18px var(--f-display); white-space: nowrap; }
.g-score .g-team { font: 800 13px var(--f-body); text-transform: uppercase; letter-spacing: .04em; }
.g-turn { padding: 6px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-turn-short { display: none; }
.g-timer[hidden] { display: none; }
.g-timer.hurry { background: rgba(196, 44, 32, .9); border-color: rgba(255, 200, 190, .7); animation: g-blink 1s ease-in-out infinite; }
.g-top-tools { margin-left: auto; display: flex; gap: 8px; }
.g-icon { width: 38px; height: 38px; display: grid; place-items: center; font-size: 18px; font-weight: 800; cursor: pointer; }
.g-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 10px;
  padding: 6px max(12px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.g-bottom > * { pointer-events: auto; }
.g-coach {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 56px;
  background: rgba(255, 255, 255, .95); color: #15241b; border-radius: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.g-coach .coach-ava { width: 40px; height: 40px; flex: none; }
.g-coach-text { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 600; }
.g-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.g-btn {
  appearance: none; border: 1px solid rgba(255, 255, 255, .25); background: rgba(8, 20, 13, .78); color: #fff;
  border-radius: 14px; min-height: 46px; padding: 8px 14px; font: 800 15px var(--f-body); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
}
.g-btn.primary { background: var(--whistle); color: var(--whistle-ink); border-color: var(--whistle-deep); box-shadow: 0 3px 0 var(--whistle-deep); }
.g-btn.ghost { background: rgba(255, 255, 255, .92); color: #15241b; border-color: transparent; }
.g-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.g-btn[hidden] { display: none; }
.g-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4, 12, 8, .6); padding: 12px; z-index: 5; }
.g-dialog {
  background: var(--card); color: var(--ink); border-radius: 20px; padding: 18px 22px; width: min(620px, 100%);
  max-height: calc(100% - 8px); overflow-y: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: 10px;
}
.g-dialog > * { flex-shrink: 0; }
.g-tag { display: inline-flex; align-items: center; gap: .3em; font-weight: 800; white-space: nowrap; }
.g-tag i { width: .8em; height: .8em; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px rgba(21, 36, 27, .45); flex: none; }
.g-dialog .tm-open { align-self: flex-start; }
/* Страница «Команда»: редактор в карточке, как в окне матча, но в потоке страницы. */
.team-page { width: min(760px, 100%); max-height: none; overflow: visible; box-shadow: var(--shadow); border: 1px solid var(--rule); }
/* «Моя команда» */
.tm { display: flex; flex-direction: column; gap: 10px; }
.tm-tabs { align-self: flex-start; }
.tm-grid { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 14px; align-items: start; }
.tm-show { display: flex; flex-direction: column; gap: 4px; }
.tm-canvas { width: 100%; height: 190px; display: block; border-radius: 14px; }
.tm-caps { display: flex; justify-content: space-around; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.tm-kit { display: flex; flex-direction: column; gap: 10px; }
.tm-canvas.wide { height: 170px; }
.tm-kitgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tm-sub { margin: 0; font: 16px var(--f-display); }
.tm-dot:disabled { opacity: .25; cursor: not-allowed; outline: none; }
.tm-kit .tm-sw { gap: 5px; }
.tm-kit .tm-dot { width: 28px; height: 28px; }
.tm-controls { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tm-field { display: flex; flex-direction: column; gap: 4px; }
.tm-teamname { max-width: 260px; }
.tm-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.tm-sw { display: flex; flex-wrap: wrap; gap: 7px; }
.tm-dot {
  appearance: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(21, 36, 27, .25); background: var(--c);
  cursor: pointer; padding: 0; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.tm-dot[aria-checked="true"] { outline: 3px solid var(--whistle); outline-offset: 2px; border-color: rgba(21, 36, 27, .6); }
.tm-dot:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.tm-note { margin: 2px 0 0; font-size: 14px; font-weight: 700; }
.tm-hint { margin: 0; font-size: 13px; color: var(--ink-2); }
.tm-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; }
.tm-chip {
  appearance: none; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink); font: 700 13px var(--f-body); cursor: pointer; max-width: 150px;
}
.tm-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-chip b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--card); font: 13px var(--f-display); flex: none; }
.tm-chip.is-on { background: var(--whistle); border-color: var(--whistle-deep); color: var(--whistle-ink); }
.tm-name { width: 100%; max-width: 260px; }
.tm-random { align-self: flex-start; min-height: 36px; }
.tm-tabs { flex-wrap: wrap; }
.tm-form { display: flex; flex-direction: column; gap: 10px; }
.tm-pitch { width: 100%; max-width: 460px; max-height: 56vh; display: block; border-radius: 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.tm-chipg { cursor: grab; }
.tm-transfer { display: flex; flex-direction: column; gap: 8px; }
.tm-transfer p { margin: 0; }
.tm-cloud { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 2px solid var(--rule); border-radius: 14px; }
.tm-cloud p { margin: 0; }
/* Вход по логину и паролю (FT.accountBox): в «Моя команда» → «Перенос» и на главной (кнопка «Вход» внизу) */
.tm-acc-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.tm-acc-form[hidden] { display: none; }
.tm-acc-form input:not([type="checkbox"]) { width: 100%; max-width: 280px; }
.tm-acc-show { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13px; font-weight: 600; cursor: pointer; }
.tm-acc-show input { width: 18px; height: 18px; }
.tm-acc .g-err.is-ok { color: var(--good); }
.tm-acc .g-err.is-wait { color: var(--ink-2); }
.tm-acc-del, .tm-acc-rec, .tm-acc-forgot { margin-top: 4px; }
.tm-acc-del summary, .tm-acc-rec summary, .tm-acc-forgot summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.tm-recov { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 2px dashed var(--whistle); border-radius: 12px; background: var(--paper); }
.tm-recov-code { font: 22px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .08em; user-select: all; -webkit-user-select: all; }
.tm-recov-in { text-transform: uppercase; letter-spacing: .06em; }
.tm-acc-delbtn { color: var(--bad); border-color: var(--bad); }
.tm-code { width: 100%; font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; word-break: break-all; }
@media (max-width: 560px) {
  .tm-grid, .tm-kitgrid { grid-template-columns: 1fr; }
  .tm-canvas { height: 160px; }
}
@media (max-height: 460px) {
  .tm-canvas { height: 150px; }
  .tm-dot { width: 28px; height: 28px; }
}
.g-title { font: 26px var(--f-display); margin: 0; }
.g-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 15px; }
.g-label { margin: 4px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.g-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.g-dialog .g-btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.g-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; align-self: flex-start; }
.g-seg-btn { appearance: none; border: 0; background: transparent; color: var(--ink); padding: 8px 14px; font: 800 14px var(--f-body); cursor: pointer; }
.g-seg-btn.is-on { background: var(--whistle); color: var(--whistle-ink); }
.g-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.g-grid label, .g-dialog > label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.g-select { font: 600 15px var(--f-body); padding: 7px 8px; border-radius: 10px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); }
.g-check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 600 !important; }
.g-check input { width: 20px; height: 20px; }
.g-note { font-size: 13px; color: var(--ink-2); margin: 0; }
.g-final { font: 30px var(--f-display); margin: 0; }
.g-stats { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.g-splash {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
  font: clamp(44px, 11vw, 110px) var(--f-display); color: #ffe45c; text-shadow: 0 5px 0 #8a6a00, 0 10px 30px rgba(0, 0, 0, .55);
}
.g-splash.go { animation: g-pop 1.5s ease-out both; }
.g-splash.small { font-size: clamp(30px, 6vw, 60px); color: #ffffff; text-shadow: 0 4px 0 rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .5); }
@keyframes g-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.g-rotate { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: #0b1f15; text-align: center; padding: 24px; }
.g-rotate-box { max-width: 320px; display: grid; gap: 10px; justify-items: center; }
.g-rotate-box p { margin: 0; }
.g-rotate-phone { width: 46px; height: 78px; border: 4px solid #fff; border-radius: 10px; animation: g-turn 2.2s ease-in-out infinite; }
@keyframes g-turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
.g-icon[aria-pressed="true"] { background: var(--whistle); color: var(--whistle-ink); border-color: var(--whistle-deep); }
/* Игра с другом: значок друга сверху, код игры, ожидание. */
.g-net {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; white-space: nowrap;
  background: rgba(8, 20, 13, .72); border: 1px solid rgba(255, 255, 255, .16); color: #fff; max-width: 40vw; overflow: hidden;
}
.g-net[hidden] { display: none; }
.g-net b { overflow: hidden; text-overflow: ellipsis; }
.g-net em { font-style: normal; opacity: .85; }
.g-net i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #9aa5a0; }
.g-net.is-ready i, .g-net.is-on i { background: #5ce08a; }
.g-net.is-think i { background: #ffd34d; animation: g-blink 1.1s ease-in-out infinite; }
.g-net.is-ready { border-color: #5ce08a; }
@keyframes g-blink { 50% { opacity: .3; } }
.g-big .g-net { padding: 3px 8px; font-size: 12px; border-radius: 10px; }
@media (max-width: 700px) { .g-net em { display: none; } }
.g-btn.friend { background: #2f6fe0; color: #fff; border-color: #1d4fae; box-shadow: 0 3px 0 #1d4fae; }
.g-code { margin: 0; font: clamp(48px, 13vw, 76px) var(--f-display); letter-spacing: .18em; text-align: center; color: var(--ink); }
.g-code-in { font: 32px var(--f-display); letter-spacing: .3em; text-align: center; width: 100%; max-width: 220px; padding: 8px 10px; }
.g-name { max-width: 260px; }
.g-err { margin: 0; min-height: 1.3em; font-size: 14px; font-weight: 700; color: #c0392b; }
.g-wait { margin: 0; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.g-ping { margin: 0; font-weight: 800; color: #1d4fae; }
/* Разбор хода: карточка с моментом перед ходом. */
.g-review {
  position: absolute; top: 58px; right: max(12px, env(safe-area-inset-right, 0px)); z-index: 4; width: min(320px, calc(100% - 24px));
  background: var(--card); color: var(--ink); border-radius: 16px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  display: flex; flex-direction: column; gap: 6px;
}
.g-review[hidden] { display: none; }
.g-replay {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 10px;
  background: rgba(8, 20, 13, .85); color: #ffe45c; padding: 6px 8px 6px 14px; border-radius: 14px; font: 16px var(--f-display); letter-spacing: .06em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.g-replay b { font-weight: 400; animation: g-blink 1.6s ease-in-out infinite; }
.g-replay[hidden] { display: none; }
.g-btn.cup { background: #f5b818; border-color: #b8860b; color: #2a1f00; box-shadow: 0 3px 0 #b8860b; }
.g-btn.league { background: #2e8241; border-color: #1d5c2c; color: #fff; box-shadow: 0 3px 0 #1d5c2c; }
/* Чемпионат: кубки на полке и таблица */
.lg-shelf { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 6px; padding: 8px 10px; border-radius: 12px; background: var(--shelf); }
.lg-slot { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.lg-slot small { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.lg-cup { display: inline-flex; }
.lg-cup:not(.is-won) { opacity: .55; }
.lg-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.lg-table th, .lg-table td { padding: 3px 6px; text-align: center; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.lg-table th { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.lg-table .lg-team { text-align: left; width: 100%; }
.lg-table tr.is-me td { background: var(--good-bg); color: var(--ink); font-weight: 800; }
.lg-table tr.is-next td { background: var(--warn-bg); color: var(--ink); }
.lg-style { margin-left: 6px; font-size: 11px; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.g-coin-rival { max-width: 420px; font-size: 14px; font-weight: 600 !important; color: #ffe9a8; }
.lg-lv { margin-left: 6px; padding: 0 6px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; }
.lg-lv.lv-easy { background: #3f9a57; } .lg-lv.lv-normal { background: #c68a00; } .lg-lv.lv-hard { background: #c0392b; }
/* Монетка перед началом матча */
.g-coin { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(5, 15, 10, .35); cursor: pointer; }
.g-coin[hidden] { display: none; }
.g-coin-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 24px; border-radius: 16px; background: rgba(8, 20, 13, .88); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.g-coin-card p { margin: 0; font-weight: 700; text-align: center; }
.g-coin-names .g-tag { color: #fff; }
.g-coin-cap { font-size: 18px; min-height: 1.4em; }
.g-coin-stage { width: 96px; height: 120px; display: grid; place-items: end center; perspective: 600px; }
.g-coin-disc { position: relative; width: 88px; height: 88px; transform-style: preserve-3d; animation: coin-flip 1.6s cubic-bezier(.25, .7, .3, 1) forwards; }
.g-coin-disc.tails { animation-name: coin-flip-tails; }
.g-coin-face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--c); border: 6px solid #f3d36b; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .2); color: #fff; font-size: 34px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.g-coin-face.back { transform: rotateY(180deg); }
@keyframes coin-flip { 0% { transform: translateY(0) rotateY(0); } 45% { transform: translateY(-34px) rotateY(900deg); } 100% { transform: translateY(0) rotateY(1800deg); } }
@keyframes coin-flip-tails { 0% { transform: translateY(0) rotateY(0); } 45% { transform: translateY(-34px) rotateY(990deg); } 100% { transform: translateY(0) rotateY(1980deg); } }
@media (prefers-reduced-motion: reduce) { .g-coin-disc { animation-duration: .01s; } }
.g-cup { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.g-cup li.is-done { color: var(--ink-2); }
.g-cup li.is-now { font-weight: 800; }
.g-cupres { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--ink); }
.g-cupres p { margin: 0; }
.g-badges { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 700; }
.g-badge { display: inline-flex; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--whistle); color: var(--whistle-ink); font-size: 13px; font-weight: 800; }
.g-emote-panel {
  position: absolute; top: 56px; right: max(12px, env(safe-area-inset-right, 0px)); z-index: 5; display: flex; gap: 4px; padding: 6px;
  background: rgba(8, 20, 13, .9); border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}
.g-emote-panel[hidden] { display: none; }
.g-emote-panel button { appearance: none; border: 0; background: transparent; font-size: 26px; width: 42px; height: 42px; border-radius: 10px; cursor: pointer; }
.g-emote-panel button:hover { background: rgba(255, 255, 255, .15); }
.g-emote {
  position: absolute; left: 50%; top: 30%; z-index: 4; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  animation: g-emote 2.2s ease-out forwards;
}
.g-emote span { font-size: 72px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.g-emote small { color: #fff; font-weight: 800; font-size: 14px; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
@keyframes g-emote { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.5); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
.g-replay .g-btn { min-height: 32px; padding: 2px 10px; font: 800 13px var(--f-body); letter-spacing: 0; }
.g-big .g-replay { top: 40px; }
.g-review-h { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.g-review-t { margin: 0; font-size: 14px; line-height: 1.35; }
.g-review .mini-board { border-radius: 10px; overflow: hidden; border-bottom: 0; }
.g-review .g-row { margin-top: 2px; }
.g-review .g-btn { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.g-review .g-btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.g-big .g-review { top: 42px; }
@media (max-height: 460px) {
  .g-review { width: min(270px, calc(100% - 24px)); padding: 8px 10px; gap: 4px; }
  .g-review-t { font-size: 12.5px; }
  .g-review .mini-board { max-height: 120px; }
  .g-review .mini-board svg { max-height: 120px; }
}
.g-focus { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--ink); font-size: 15px; }
.g-wait::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--whistle-deep);
  animation: g-spin .9s linear infinite; flex: none;
}
@keyframes g-spin { to { transform: rotate(360deg); } }
.g-toast {
  position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 4; width: max-content; max-width: min(520px, calc(100% - 24px));
  background: rgba(8, 20, 13, .9); color: #fff; border-radius: 12px; padding: 8px 14px; font-size: 14px; font-weight: 700; text-align: center;
  pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
/* «Большое поле»: панели компактные и полупрозрачные, поле занимает почти весь экран. */
.g-big .g-top { padding-top: max(4px, env(safe-area-inset-top, 0px)); padding-bottom: 0; gap: 6px; }
.g-big .g-top-tools { gap: 6px; }
.g-big .g-exit { padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.g-big .g-score { padding: 2px 10px; font-size: 15px; border-radius: 10px; }
.g-big .g-score .g-team { font-size: 0; }
.g-big .g-score .g-team::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.g-big .g-turn { padding: 3px 8px; font-size: 12px; border-radius: 10px; }
.g-big .g-turn-long { display: none; }
.g-big .g-turn-short { display: inline; }
.g-big .g-icon { width: 32px; height: 32px; font-size: 15px; border-radius: 10px; }
.g-big .g-bottom { padding-top: 0; padding-bottom: max(4px, env(safe-area-inset-bottom, 0px)); gap: 6px; align-items: center; }
.g-big .g-coach { min-height: 0; padding: 4px 10px; gap: 8px; border-radius: 12px; background: rgba(255, 255, 255, .86); box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.g-big .g-coach .coach-ava { width: 26px; height: 26px; }
.g-big .g-coach-text { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-big .g-actions { gap: 6px; flex-wrap: nowrap; }
.g-big .g-btn { min-height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 11px; }
.g-big .g-toast { top: 44px; }
@media (max-height: 460px) {
  .g-coach { min-height: 48px; padding: 6px 10px; }
  .g-coach .coach-ava { width: 32px; height: 32px; }
  .g-coach-text { font-size: 13.5px; }
  .g-btn { min-height: 40px; padding: 6px 11px; font-size: 14px; }
  .g-turn-long { display: none; }
  .g-turn-short { display: inline; }
  .g-title { font-size: 22px; }
  .g-list { font-size: 14px; }
}
@media (max-width: 520px) {
  .g-top { gap: 6px; }
  .g-top-tools { gap: 6px; }
  .g-score .g-team { font-size: 0; }
  .g-score .g-team::before { content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: currentColor; vertical-align: middle; }
}
@media (max-width: 700px) {
  .g-turn { padding: 5px 8px; }
  .g-turn-long { display: none; }
  .g-turn-short { display: inline; }
}
/* Узкий экран стоя: подсказка тренера сверху, кнопки — строкой под ней. Лёжа панель остаётся в одну строку. */
@media (max-width: 700px) and (orientation: portrait) {
  .g-bottom, .g-big .g-bottom { flex-direction: column; align-items: stretch; }
  .g-actions { justify-content: stretch; }
  .g-actions .g-btn { flex: 1; }
}

/* Салют за верный ответ */
.confetti { position: fixed; z-index: 90; width: 0; height: 0; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: confetti 1.3s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 140px)) rotate(var(--r)); opacity: 0; }
}

/* Урок: задания между шагами теории */
/* Задание на полосе — кружок со звёздочкой, а не полоска. */
.seg.task { flex: 0 1 22px; min-width: 16px; }
.seg.task::before { left: 2px; right: 2px; top: 1px; height: 18px; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 2px var(--rule) inset; }
.seg.task::after { content: '★'; position: absolute; left: 0; right: 0; top: 1px; line-height: 18px; font-size: 11px; color: var(--ink-2); text-align: center; }
.seg.task.done::before { background: var(--whistle); box-shadow: none; }
.seg.task.done::after { color: var(--whistle-ink); }
.seg.task.now::before { background: var(--whistle); box-shadow: 0 0 0 3px var(--whistle-deep) inset; }
.seg.task.now::after { color: var(--whistle-ink); }
.seg:disabled { cursor: default; opacity: .6; }
.task-badge { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
/* Тренажёр: «похожий момент — здесь ты ошибался», «задачи посложнее» — отдельной строкой под видом задачи. */
.task-badge .task-note { display: block; margin-top: 3px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--accent-ink, var(--ink)); }
.task-badge strong { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }
.lesson-task .pz-play { display: flex; flex-direction: column; gap: 10px; }
.task-back { margin-top: 4px; }
.pz-from { margin: 0; font-size: 14px; color: var(--ink-2); }
.card-tasks { margin: 0; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.btn-back { min-width: 44px; font-size: 18px; }

/* ---------- Друзья и группы ---------- */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; vertical-align: 2px; }
.fr-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.fr-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fr-title { font: 22px var(--f-display); margin: 0 0 2px; }
.fr-msg { min-height: 1.4em; margin: 0 0 10px; font-weight: 700; }
.fr-code-row { margin: 0; font-size: 17px; }
.fr-code { font: 26px var(--f-display); letter-spacing: .08em; background: var(--paper); border: 1px dashed var(--rule); border-radius: 8px; padding: 2px 10px; white-space: nowrap; }
.fr-code-in { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.fr-inline { display: flex; gap: 8px; align-items: center; }
.fr-inline .field { flex: 1; min-width: 0; }
.fr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fr-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.fr-list li:last-child { border-bottom: 0; }
.fr-name { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.fr-name small { font-weight: 600; color: var(--ink-2); }
.fr-acts { display: flex; gap: 6px; flex: none; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 14px; }
.fr-group summary { cursor: pointer; }
.fr-member-group + .fr-member-group { border-top: 1px solid var(--rule); padding-top: 8px; }
.fr-danger summary { color: var(--ink-2); font-size: 14px; }
.gr-sub { font-size: 15px; margin: 8px 0 2px; }
.gr-sub small { font-weight: 600; color: var(--ink-2); }
.gr-inbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gr-scheme { display: block; width: 100%; text-align: left; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.fr-list .gr-scheme { width: auto; flex: 1; }
.gr-scheme span { color: var(--ink-2); font-size: 14px; }
.gr-scheme.is-fresh { border-color: #e5484d; box-shadow: 0 0 0 1px #e5484d inset; }
.gr-scheme.is-fresh b::before { content: '● '; color: #e5484d; }
.board-groups .field + .field { margin-top: 6px; }

/* ---------- Мячи: счётчик и анимации наград ---------- */
.ball-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--rule); font-weight: 800; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.ball-pill svg, .fx-capball svg, .ball-ico svg { width: 18px; height: 18px; display: block; }
.ball-pill.is-bump { animation: ball-bump .6s ease-out; }
@keyframes ball-bump { 30% { transform: scale(1.25); } 100% { transform: scale(1); } }
.ball-ico { display: inline-block; vertical-align: -3px; }
.ball-fx { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(10, 30, 16, .62), rgba(10, 30, 16, .88)); overflow: hidden; cursor: pointer; animation: fx-in .25s ease-out; }
.ball-fx.is-out { animation: fx-out .35s ease-in forwards; }
@keyframes fx-in { from { opacity: 0; } }
@keyframes fx-out { to { opacity: 0; } }
.fx-stage { position: absolute; inset: 0; pointer-events: none; }
.fx-ball { position: absolute; display: block; width: var(--s, 56px); height: var(--s, 56px); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.fx-ball svg { width: 100%; height: 100%; display: block; }
.fx-cap { position: relative; z-index: 2; margin-top: 34vh; text-align: center; color: #fff; display: flex; flex-direction: column; gap: 6px; align-items: center; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); animation: fx-cap .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: .55s; }
.fx-cap b { font: 44px var(--f-display); display: inline-flex; align-items: center; gap: 8px; }
.fx-cap .fx-capball svg { width: 38px; height: 38px; }
.fx-cap small { font-size: 16px; font-weight: 700; opacity: .92; max-width: 80vw; }
.fx-cap .fx-total { font-size: 14px; opacity: .8; }
@keyframes fx-cap { from { transform: scale(.3); opacity: 0; } }
/* 1. Мяч влетает в экран: из глубины, с вращением, и замирает над подписью. */
.fx-flyer { --s: 120px; left: 50%; top: 30%; margin-left: -60px; animation: fx-fly 1.1s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes fx-fly {
  0% { transform: translate(-40vw, 60vh) scale(.15) rotate(0); }
  70% { transform: translate(0, -4vh) scale(1.35) rotate(600deg); }
  100% { transform: translate(0, 0) scale(1) rotate(720deg); }
}
/* 2. Мячи падают в сетчатый мешок; мешок покачивается на завязке. */
.fx-sack { position: absolute; left: 50%; top: 8%; width: min(56vw, 230px); transform: translateX(-50%); animation: fx-cap .4s ease-out both; }
.fx-sack > svg { width: 100%; height: auto; display: block; overflow: visible; }
.fx-bagbody { transform-box: fill-box; transform-origin: 50% 0; animation: fx-swing 2.6s ease-in-out .3s; }
@keyframes fx-swing { 20% { transform: rotate(3deg); } 45% { transform: rotate(-2.5deg); } 70% { transform: rotate(1.5deg); } }
.fx-bb { transform-box: fill-box; transform-origin: center; animation: fx-bdrop .5s cubic-bezier(.35, 0, .6, 1.3) both; animation-delay: calc(.4s + var(--d)); }
@keyframes fx-bdrop { from { transform: translateY(-260px) rotate(-200deg); opacity: 0; } 30% { opacity: 1; } }
/* 3. Россыпь мячей падает и отскакивает от пола. */
.fx-bounce { left: var(--x); top: 0; animation: fx-bounce 1.7s linear both; animation-delay: var(--d); }
@keyframes fx-bounce {
  0% { transform: translateY(-15vh) rotate(0); animation-timing-function: cubic-bezier(.5, 0, 1, .6); }
  40% { transform: translateY(calc(92vh - var(--s))) rotate(calc(var(--r) * .4)); animation-timing-function: cubic-bezier(0, .45, .55, 1); }
  60% { transform: translateY(58vh) rotate(calc(var(--r) * .6)); animation-timing-function: cubic-bezier(.5, 0, 1, .6); }
  76% { transform: translateY(calc(92vh - var(--s))) rotate(calc(var(--r) * .78)); animation-timing-function: cubic-bezier(0, .45, .55, 1); }
  86% { transform: translateY(78vh) rotate(calc(var(--r) * .88)); animation-timing-function: cubic-bezier(.5, 0, 1, .6); }
  94% { transform: translateY(calc(92vh - var(--s))) rotate(calc(var(--r) * .95)); }
  100% { transform: translateY(calc(92vh - var(--s))) rotate(var(--r)); }
}
.finish-balls { font: 22px var(--f-display); display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; }
.finish-balls .ball-ico svg { width: 26px; height: 26px; }
.g-balls { font: 20px var(--f-display); display: inline-flex; align-items: center; gap: 6px; margin: 2px 0; color: #ffe27a; }
.g-balls .ball-ico svg, .g-btn .ball-ico svg { width: 20px; height: 20px; }
.g-btn .ball-ico { vertical-align: -4px; margin-left: 2px; }
.g-btn.replay[disabled] { opacity: .5; cursor: not-allowed; }
.kit-shop { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.kit-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kit-wallet { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.kit-wallet .ball-ico svg, .kit-state .ball-ico svg { width: 16px; height: 16px; }
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.kit-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; border: 2px solid var(--rule, #dfe5df); background: var(--card, #fff); color: var(--ink, #1f2a22); font: inherit; cursor: pointer; }
.kit-card.is-on { border-color: #d9a800; background: var(--warn-bg); }
.kit-card.is-locked .kit-shirt { opacity: .55; filter: saturate(.6); }
.kit-card[disabled] { cursor: not-allowed; opacity: .6; }
.kit-shirt svg { width: 46px; height: 50px; display: block; }
.kit-name { font-weight: 800; font-size: 13px; }
.kit-state { font-size: 12px; opacity: .9; display: inline-flex; align-items: center; gap: 3px; }
.kit-msg { margin: 0; min-height: 1.2em; }
/* Шапка: разделы прокручиваются, а не налезают на счётчики; подпись у кнопки озвучки — только на широком экране. */
.main-nav { overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.header-tools { flex: none; }
@media (min-width: 1441px) { .nav-short { display: none; } }   /* перевод полного названия — вместо короткого */
@media (max-width: 1440px) { .icon-btn-text { display: none; } .nav-long { display: none; } .main-nav a { padding: 8px 11px; } }
/* Разделы не помещаются в строку (iPad, длинный логин или перевод): сперва у логотипа нет надписи «Тактика 7×7»
   (hdr-tight), не хватает и так — разделы второй строкой во всю ширину (hdr-wrap). Классы ставит js/app.js (fitHeader). */
@media (min-width: 641px) {
  body.hdr-tight .brand-name { display: none; }
  body.hdr-wrap { --header-h: 104px; }
  body.hdr-wrap .header-inner { grid-template-areas: "brand acc . tools lang" "nav nav nav nav nav"; row-gap: 4px; padding-block: 8px 6px; }
}
@media (max-width: 640px) {
  .header-tools { gap: 5px; }
  .star-pill, .ball-pill { padding: 4px 9px; gap: 4px; }
  .ball-pill svg { width: 16px; height: 16px; }
  .brand { gap: 7px; }
  .brand-name { font-size: 18px; }
}
/* Онлайн-чемпионат: строка в итоге матча с другом и раздел на странице «Друзья» */
.g-online { font-size: 14px; font-weight: 700; color: var(--ink); }
.g-online.is-up { padding: 8px 12px; border-radius: 12px; background: var(--warn-bg); font-size: 16px; }
.ol-div { margin: 0; font: 24px var(--f-display); }
.ol-table { margin-top: 4px; }
.ol-table td.lg-team { white-space: normal; overflow-wrap: anywhere; }

/* ---------- Своя задача на доске тренера (js/my-tasks.js) ---------- */
.task-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.task-entry .small-msg { margin: 0; flex: 1 1 160px; }
.tk-bar { scroll-margin-top: calc(var(--header-h) + 8px); margin: 0 0 10px; min-height: 44px; display: flex; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--info-bg); color: var(--ink); font-weight: 800; font-size: 15px; line-height: 1.3; }
.tk-bar.is-ready { background: var(--good-bg); box-shadow: 0 0 0 1.5px var(--good) inset; }
.tk-editor .feedback { font-size: 14px; }
.tk-close { align-self: flex-start; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.tk-head { font: 22px var(--f-display); margin: 0; }
.tk-types { display: flex; flex-wrap: wrap; gap: 6px; }
/* Ответ есть в схеме — зелёная точка на типе задачи; кадры со стрелками подчёркнуты. */
.tk-types .btn.has-auto::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--good); vertical-align: middle; }
.tk-frames { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-frames .frame-chip { width: 38px; height: 38px; font-size: 16px; }
.tk-frames .frame-chip.has-arrows { box-shadow: inset 0 -4px 0 var(--good); }
.tk-auto { margin: 0; }
.tk-msg { margin: 0; font-weight: 700; }
.tk-msg.is-bad { color: var(--bad); }
.board-tasks .fold-body { gap: 6px; }
.tk-item { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); padding: 0 10px; }
.tk-item summary { cursor: pointer; padding: 8px 0; overflow-wrap: anywhere; }
.tk-item summary span { color: var(--ink-2); font-size: 14px; }
.tk-item-body { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
/* Название команды: ответ проверки под полем (FT.ui.teamNameField) */
.tn-msg:empty { display: none; }
.tn-msg.is-bad { color: var(--bad); font-weight: 700; }
.tn-msg.is-ok { color: var(--good); }
.tm-field .tn-msg { margin: 2px 0 0; }
/* Профиль (#me): звание, значки, вход и перенос */
.me-acc { margin: 0 0 28px; display: grid; gap: 10px; max-width: 640px; }
.me-acc h2 { margin: 0; }
/* Окно под счётчиками в шапке (звёзды, мячи) */
button.star-pill, button.ball-pill { font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; }
button.star-pill[aria-expanded="true"], button.ball-pill[aria-expanded="true"] { border-color: var(--ink-2); }
.hdr-pop {
  position: fixed; z-index: 40; width: max-content; max-width: min(320px, calc(100vw - 32px)); padding: 12px 14px;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); font-size: 15px;
}
.hdr-pop p { margin: 0; }
.hdr-pop .pop-title { font-weight: 800; }
.hdr-pop ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.hdr-pop a { color: inherit; font-weight: 800; }
/* Разделы в шапке на телефоне — все пять видны, без прокрутки */
@media (max-width: 640px) {
  .main-nav { justify-content: space-between; gap: 0; }
  .main-nav a { padding: 7px 5px; font-size: 14px; }
}
@media (max-width: 370px) { .main-nav a { font-size: 13px; padding: 7px 3px; } }
/* Главная: неделя под доской; тренировка дня — её живая доска, ниже название и неделя */
.demo-week { margin-top: 10px; }
.daily-live { display: block; border-radius: var(--radius); }
.daily-live:focus-visible { outline: 3px solid var(--whistle); outline-offset: 3px; }
.hero-daily .daily-body { margin-top: 12px; }
.hero-daily .daily-title a { color: inherit; text-decoration: none; }
.hero-daily .streak { margin: 0; }
/* Окно онлайн-чемпионата: таблица и рейтинг лучших — по раскрытию */
.g-fold { margin-top: 8px; }
.g-fold summary { cursor: pointer; font-weight: 800; }
.ol-tables { display: grid; gap: 6px; margin-top: 6px; max-height: 50vh; overflow: auto; }
.ol-tables .g-sub { margin: 6px 0 0; font-size: 15px; }
/* Подписка (js/plan.js): экран «по подписке» и вопрос для взрослого. */
.page-narrow { max-width: 640px; margin: 0 auto; padding: 16px; }
.paywall { padding: 18px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.paywall h2 { margin: 0 0 8px; }
.pw-list { margin: 8px 0 12px; padding-left: 20px; }
.pw-list li { margin: 4px 0; }
.pw-gate { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }

/* Окно выбора (FT.ui.choice): вход, когда игра есть и на устройстве, и в аккаунте */
.choice-card { grid-template-columns: minmax(0, 1fr); width: min(520px, 100%); gap: 10px; }
.choice-text { margin: 0; }
.choice-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.choice-btn { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; white-space: normal; }
.choice-note { font-weight: 400; font-size: 14px; opacity: .85; }
/* Окно со списком поверх страницы (FT.ui.sheet): все схемы от друзей или группы. Список прокручивается внутри окна. */
.daily-offer-card.sheet-card { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-close { flex: none; min-width: 40px; }
.sheet-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.fr-more { margin-top: 2px; }
/* Игра с другом: друзья списком (нажал — игра создаётся, другу уходит приглашение) и строка «позвали» */
.g-friends { display: flex; flex-direction: column; gap: 2px; }
.g-dialog .g-sub { margin: 6px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.g-friend-list { margin-top: 2px; }
.g-dialog .g-btn.friend-pick { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); }
.g-invite { margin: 0; font-weight: 800; }
.g-invite.is-bad { color: var(--bad); }
/* Тренажёр закрыт (не все задачи решены): карточка без ссылки, полоска «решено N из M» */
.trainer-card.is-locked { border-style: dashed; border-color: var(--rule); flex-wrap: wrap; }
.trainer-card.is-locked:hover { transform: none; }
.trainer-card.is-locked .topic-bar { display: block; margin-top: 6px; max-width: 320px; }
.trainer-card.is-locked .topic-bar > span { display: block; height: 100%; background: var(--good); border-radius: inherit; }
