/* ============================================================
   #всемтеннис — «Матч-программа»: editorial-каркас вокруг одной
   кинематографичной сцены. Две темы-покрытия:
   html[data-court="clay"] (грунт) / html[data-court="hard"] (хард).
   Мяч (лайм) един: на тёмном текстовый акцент — всегда цвет мяча.
   ============================================================ */

/* ---------- Токены: общие ---------- */
:root {
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-text: 'Golos Text', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 240ms;
  --ease: cubic-bezier(.22, .8, .36, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1); /* отскок мяча: только :active и мяч-детали */

  --ball: #E9F45B; /* optic yellow настоящего мяча (критики: теплее, не кислотный) */
  --ball-ink: #1A2005;

  --maxw: 1240px;
}

/* ---------- Тема «Грунт» (пересборка по вердикту критиков:
   «тёплые сумерки над кортом» вместо «чёрного шоколада») ---------- */
html[data-court="clay"] {
  --bg: #F6EFE6;
  --surface: #FBF6EF;
  --bg-deep: #342820;
  --bg-deep-2: #46332A;
  --ink: #241C17;
  --ink-inv: #F6EFE6;
  --muted: rgba(36, 28, 23, .62);
  --muted-inv: rgba(246, 239, 230, .74);

  --accent: #D96A3B;        /* солнечный грунт; тёмный текст на кнопке */
  --accent-strong: #C2582E;
  --on-accent: #241C17;
  --accent-ink: #A8431F;    /* текст на креме: AA */
  --accent-head: #C4552D;   /* крупная типографика */
  --accent-soft: rgba(196, 85, 45, .1);

  --sand: #E6D7C3;          /* средняя ступень света */
  --dust-a: #D96A3B;        /* частицы: рыжая пыль на солнце */
  --dust-b: #E9F45B;

  --hot-bg: #E9F45B;        /* мяч — константа бренда в обеих темах */
  --hot-ink: #1A2005;

  --cta-hover-bg: var(--ball);
  --cta-hover-ink: var(--ball-ink);

  --line: rgba(36, 28, 23, .16);
  --line-soft: rgba(36, 28, 23, .09);
  --line-inv: rgba(255, 255, 255, .18);
  --line-soft-inv: rgba(255, 255, 255, .1);
  --court-line-dark: rgba(255, 255, 255, .17);
  --bg-footer: #2A1F19;

  --glass-scrim-a: rgba(31, 24, 18, .82);
  --glass-scrim-b: rgba(35, 27, 21, .7); /* плотнее: меню не тонет над лаймом */
  --veil: 53, 40, 34;

  --shadow: 0 6px 24px rgba(36, 28, 23, .08);
  --shadow-lift: 0 18px 44px rgba(36, 28, 23, .16);
  /* контактная тень вместо цветного свечения: glow — маркер дешёвых сайтов */
  --shadow-accent: 0 1px 0 rgba(36, 28, 23, .12), 0 10px 22px -8px rgba(36, 28, 23, .38);
}

/* ---------- Тема «Хард» ---------- */
html[data-court="hard"] {
  --bg: #EEF3F8;
  --surface: #F9FBFD;
  --bg-deep: #14243F;
  --bg-deep-2: #1C3A66;
  --ink: #121A28;
  --ink-inv: #EDF3FA;
  --muted: rgba(18, 26, 40, .62);
  --muted-inv: rgba(237, 243, 250, .74);

  --accent: #E9F45B;
  --accent-strong: #D8E63F;
  --on-accent: #1A2005;
  --accent-ink: #1E4A8F;    /* мелкий текст и ссылки */
  --accent-head: #2A5FC7;   /* «спортивный азур» для крупных акцентов */
  --accent-soft: rgba(30, 74, 143, .09);

  --sand: #DCE5EF;
  --dust-a: #2A5FC7;
  --dust-b: #E9F45B;

  --hot-bg: #E9F45B;
  --hot-ink: #1A2005;

  --cta-hover-bg: #1E4A8F;
  --cta-hover-ink: #EEF3F8;

  --line: rgba(18, 26, 40, .16);
  --line-soft: rgba(18, 26, 40, .09);
  --line-inv: rgba(255, 255, 255, .18);
  --line-soft-inv: rgba(255, 255, 255, .1);
  --court-line-dark: rgba(255, 255, 255, .17);
  --bg-footer: #0F1D33;

  --glass-scrim-a: rgba(11, 18, 31, .82);
  --glass-scrim-b: rgba(13, 21, 36, .7);
  --veil: 12, 19, 33;

  --shadow: 0 6px 24px rgba(15, 22, 34, .08);
  --shadow-lift: 0 18px 44px rgba(15, 22, 34, .16);
  --shadow-accent: 0 1px 0 rgba(15, 22, 34, .12), 0 10px 22px -8px rgba(15, 22, 34, .42);
}

html { transition: background-color var(--dur-3) var(--ease); }
body, .site-header, .fmt, .cal-shell, .slot, .lvl-row {
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
  transition-duration: var(--dur-3);
  transition-timing-function: var(--ease);
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: calc(17px * var(--kms-fs, 1));
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { max-width: 100%; }
a { color: var(--accent-ink); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { position: relative; }
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section--deep { background: linear-gradient(180deg, var(--bg-deep), var(--bg-deep-2)); color: var(--ink-inv); }

/* рейлы: вертикальные линейки editorial-каркаса на светлых секциях;
   концы гаснут фейдом, а не обрываются в воздухе */
.ruled > .container { position: relative; }
.ruled > .container::before, .ruled > .container::after {
  content: ''; position: absolute; top: calc(-1 * clamp(72px, 10vw, 128px)); bottom: calc(-1 * clamp(72px, 10vw, 128px));
  width: 1px; background: var(--line-soft); pointer-events: none;
  mask-image: linear-gradient(180deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}
.ruled > .container::before { left: 0; }
.ruled > .container::after { right: 0; }
/* рейлы сквозные: на тёмных секциях — инверсной краской, каркас не рвётся */
.section--deep.ruled > .container::before, .section--deep.ruled > .container::after {
  background: var(--line-soft-inv);
}
.stats-band.ruled > .container::before, .stats-band.ruled > .container::after {
  top: calc(-1 * clamp(48px, 6vw, 72px)); bottom: calc(-1 * clamp(48px, 6vw, 72px));
  background: var(--line-soft);
}

h1, h2, h3 { margin: 0 0 .5em; }
h1, h2, .display {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: .98;
  text-wrap: balance;
}
h2 { font-size: calc(clamp(2rem, 4.6vw, 3.6rem) * var(--kms-fs, 1)); }
h2 em, h1 em { font-style: normal; font-weight: 800; color: var(--accent-head); }
.section--deep h2 em, .hero h1 em, .hero-final em { color: var(--ball); }
h3 { font-family: var(--font-text); font-size: calc(1.1rem * var(--kms-fs, 1)); font-weight: 600; }
.lead { font-size: calc(clamp(1.05rem, 1.6vw, 1.25rem) * var(--kms-fs, 1)); color: var(--muted); max-width: 56ch; }
.section--deep .lead { color: var(--muted-inv); }

/* eyebrow: индекс шага + мяч-маркер */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: calc(.72rem * var(--kms-fs, 1)); font-weight: 500; text-transform: uppercase;
  letter-spacing: .14em; color: var(--muted); margin: 0 0 16px;
}
.section--deep .eyebrow, .hero .eyebrow { color: var(--muted-inv); }
.eyebrow::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #A9BC28);
  /* кольцо: голый лайм на светлом невидим (вердикт критиков) */
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .22);
}

/* ---------- Разметка корта ---------- */
.court-lines { position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 40%, transparent 92%); }
.court-lines svg { position: absolute; width: 100%; height: 100%; }
.court-lines--dark { color: var(--court-line-dark); }

/* ---------- Кнопки: система «подача» ----------
   Один рецепт на весь сайт: мяч-точка живёт в кнопке, ховер приходит
   шторкой слева (background-size), мяч отвечает прыжком со сквошем. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-text); font-weight: 600; font-size: calc(.95rem * var(--kms-fs, 1));
  padding: 15px 30px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  --sw: transparent; /* цвет шторки задаёт вариант кнопки */
  background-image: linear-gradient(var(--sw), var(--sw));
  background-size: 0% 100%; background-repeat: no-repeat; background-position: 0 0;
  transition: background-size .32s var(--ease), background-color var(--dur-2) var(--ease),
    color .22s var(--ease) .06s, border-color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.btn:hover { background-size: 100% 100%; }
/* мяч-точка: кольцо держит её видимой и на лаймовой шторке */
.btn::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #A9BC28);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1.5px rgba(0, 0, 0, .32);
}
@keyframes btnServe {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  38% { transform: translateY(-5px) scale(1, 1); }
  72% { transform: translateY(0) scale(1.2, .78); }
  88% { transform: translateY(-1px) scale(1, 1); }
}
.btn:hover::before { animation: btnServe .6s cubic-bezier(.34, .5, .4, 1) 1; }
.btn-primary {
  background-color: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-accent); --sw: var(--cta-hover-bg);
}
.btn-primary:hover { color: var(--cta-hover-ink); transform: translateY(-2px); }
.btn-ghost {
  border-color: var(--line-inv); color: var(--ink-inv);
  background-color: rgba(255, 255, 255, .04); --sw: rgba(255, 255, 255, .07);
}
.btn-ghost:hover { border-color: var(--ball); color: var(--ball); }
.btn-hot { background-color: var(--hot-ink); color: var(--hot-bg); --sw: #F6EFE6; }
.btn-hot:hover { color: var(--hot-ink); transform: translateY(-2px); }
.btn:active { transform: scale(.96); transition-timing-function: var(--ease-bounce); }

/* ---------- Шапка-стекло (blur на ::before, НЕ на элементе) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--glass-scrim-a), var(--glass-scrim-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 32px rgba(0, 0, 0, .15);
  color: var(--ink-inv);
}
.site-header::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  filter: url(#glass);
}
.site-header::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  backdrop-filter: blur(.5px); -webkit-backdrop-filter: blur(.5px);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg-deep); }
  .site-header::before, .site-header::after { display: none; }
}
.header-inner {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 20px;
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
}
.logo {
  font-family: var(--font-display); font-weight: 800; font-size: calc(1.5rem * var(--kms-fs, 1));
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-inv);
  text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
}
.logo::after {
  content: ''; width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #B8D62E);
}
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
  color: var(--muted-inv); text-decoration: none; font-size: calc(.93rem * var(--kms-fs, 1)); font-weight: 500;
  position: relative; padding: 4px 0;
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--ball); border-radius: 2px; transition: width var(--dur-3) var(--ease);
}
.nav a:hover { color: var(--ink-inv); }
.nav a:hover::after { width: 100%; }
.header-cta { padding: 11px 22px; font-size: calc(.88rem * var(--kms-fs, 1)); }

.court-switch {
  display: inline-flex; align-items: center; position: relative;
  border: 1px solid var(--line-inv); border-radius: var(--r-pill);
  padding: 3px; background: rgba(0, 0, 0, .22); margin-left: auto;
}
.nav + .court-switch { margin-left: 0; }
.court-switch button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  font-family: var(--font-text); font-weight: 600; font-size: calc(.78rem * var(--kms-fs, 1));
  padding: 7px 14px; border-radius: var(--r-pill); color: var(--muted-inv);
  transition: color var(--dur-2) var(--ease);
}
.court-switch button[aria-pressed="true"] { color: var(--on-accent); }
html[data-court="hard"] .court-switch button[aria-pressed="true"] { color: var(--ball-ink); }
.court-switch .thumb {
  position: absolute; top: 3px; bottom: 3px; border-radius: var(--r-pill);
  background: var(--accent);
  transition: left var(--dur-3) var(--ease), width var(--dur-3) var(--ease), background var(--dur-3) var(--ease);
}

/* ---------- Хиро: трёхактная сцена ----------
   ГРАБЛЯ: предкам .hero-track нельзя transform — сломается sticky. */
.hero-track { position: relative; height: 360vh; }
.hero {
  position: sticky; top: 0;
  height: 100vh; height: 100svh; /* vh — фолбэк для браузеров без svh */
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-deep), var(--bg-deep-2));
  color: var(--ink-inv);
}
/* канвас-рассказчик: фон «Перезагрузки» -> #всемтеннис -> испарение.
   Живёт строго в своей зоне (ножницы рендера в particles.js) */
.story { position: fixed; inset: 0; z-index: 46; pointer-events: none; }
/* плёночное зерно: снимает цифровую стерильность */
.grain {
  position: fixed; inset: 0; z-index: 45; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05; mix-blend-mode: multiply;
}
.hero .court-lines { z-index: 0; }
.hero-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; }
.hero-veil {
  position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--veil), .38) 0%, rgba(var(--veil), 0) 34%, rgba(var(--veil), .66) 100%);
}
.panel-frame {
  position: absolute; z-index: 3; pointer-events: none;
  border: 1px solid var(--line-inv); box-shadow: var(--shadow-lift);
}
.frame-tag {
  position: absolute; z-index: 3; pointer-events: none;
  font-family: var(--font-mono);
  font-size: calc(.7rem * var(--kms-fs, 1)); font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-inv);
}
.frame-tag b { color: var(--ball); font-weight: 600; }
/* смена акта — вертикальный ролл слова, язык табло; посадка на базлайн счётчика */
.frame-tag { text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.frame-tag [data-act] { display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3; vertical-align: -0.35em; }
.frame-tag .ar { display: block; transition: transform .3s var(--ease); }
.frame-tag .ar > span { display: block; height: 1.3em; }
.frame-tag .ar.go { transform: translateY(-1.3em); }

.hero-grid { position: relative; z-index: 4; height: 100%; display: flex; align-items: center; }
.hero-copy { max-width: 54%; will-change: transform, opacity; }
.h1-big {
  display: block; font-size: calc(clamp(3.1rem, 9vw, 7.4rem) * var(--kms-fs, 1)); line-height: .95;
  letter-spacing: -.01em;
}
.h1-sub {
  display: block; font-size: calc(clamp(1.25rem, 2.5vw, 2rem) * var(--kms-fs, 1)); line-height: 1.1;
  margin-top: 14px; font-weight: 600; letter-spacing: .01em;
}
.hero .lead { color: var(--muted-inv); margin: 20px 0 30px; max-width: 40ch; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-final {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center;
  opacity: 0; transform: translateY(26px); pointer-events: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  padding: 0 24px; text-align: center;
}
.hero-final p {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: calc(clamp(1.5rem, 3.4vw, 2.8rem) * var(--kms-fs, 1)); line-height: 1.1; margin: 0 0 28px; max-width: 22ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
  overflow: hidden; /* маска: строка поднимается, как заголовки секций */
}
.fin-line { display: inline-block; transform: translateY(118%); transition: transform .75s var(--ease) .05s; }
.hero.fin .fin-line { transform: none; }
.hero-final em { font-style: normal; }
.hero.fin .hero-final { opacity: 1; transform: none; }
.hero-final .btn {
  opacity: 0; transform: translateY(18px); pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.hero.fin2 .hero-final .btn { opacity: 1; transform: none; pointer-events: auto; }
/* на оранжевом видео: лайм и терракота запрещены (вибрация/слияние) — крем.
   Текст кнопки — токен темы (clay: терракота, hard: синий). Локальный скрим
   держит контраст строки на светлых кадрах (крупный мяч). */
.hero-final > div {
  background: radial-gradient(closest-side, rgba(22, 14, 8, .42), transparent 78%);
  padding: clamp(28px, 6vw, 64px) clamp(36px, 8vw, 96px);
}
.hero-final p em { color: #FFF9EE; }
.hero-final .btn {
  background-color: #FFF6ED; color: var(--accent-ink); --sw: var(--ball);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  min-height: 56px; padding: 17px 38px; font-size: calc(1rem * var(--kms-fs, 1));
}
.hero-final .btn:hover { color: var(--ball-ink); }

.hero-corner {
  position: absolute; z-index: 4; bottom: 20px;
  font-family: var(--font-mono);
  font-size: calc(.7rem * var(--kms-fs, 1)); font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-inv); opacity: .85;
}
.hc-bl { left: 24px; }
.hc-br { right: 120px; } /* зона FAB зарезервирована */
.hero-hint {
  /* до пина низ хиро на высоту шапки ниже вьюпорта — отступ с запасом,
     иначе кью за кромкой экрана на старте */
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 0;
  font-family: var(--font-mono);
  font-size: calc(.7rem * var(--kms-fs, 1)); font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-inv); transition: opacity .4s var(--ease);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
/* подсказка живёт поверх видео всю сцену; гаснет только к финальной CTA */
.hero.fin .hero-hint { opacity: 0; }
/* скролл-кью: мяч-точка «капает» по тонкой линии вниз и тает */
.scroll-cue { position: relative; display: block; width: 14px; height: 34px; }
.scroll-cue::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px;
  transform: translateX(-50%); border-radius: 1px;
  background: currentColor; opacity: .25;
}
.scroll-cue::after {
  content: ''; position: absolute; left: 50%; top: 0; width: 7px; height: 7px;
  border-radius: 50%; transform: translate(-50%, -2px);
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #A9BC28);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  animation: cueDrop 2.1s var(--ease) infinite;
}
@keyframes cueDrop {
  0% { transform: translate(-50%, -2px); opacity: 0; }
  16% { opacity: 1; }
  68% { opacity: 1; }
  100% { transform: translate(-50%, 27px); opacity: 0; }
}
/* кью сцены частиц: живёт внизу sticky-кадра над служебной подписью,
   гаснет к распаду (JS) */
.hash-cue {
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%);
  color: var(--muted); opacity: .8; transition: opacity .3s var(--ease);
}
@media (prefers-reduced-motion: reduce) { .scroll-cue { display: none; } }
.hero-corner { transition: opacity .4s var(--ease); }
.hero-track.is-open .hero-corner { opacity: 0; } /* гаснут при раскрытии панели */

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.hero .eyebrow { animation: rise .7s var(--ease) both; }
.hero .h1-big { animation: rise .7s var(--ease) .07s both; }
.hero .h1-sub { animation: rise .7s var(--ease) .14s both; }
.hero .lead { animation: rise .7s var(--ease) .21s both; }
.hero .hero-cta { animation: rise .7s var(--ease) .28s both; }

/* ---------- Счётчики: песочная полоса света после тёмного хиро ---------- */
.stats-band.section--deep {
  background: var(--sand); color: var(--ink);
  padding-top: clamp(48px, 6vw, 72px); padding-bottom: clamp(48px, 6vw, 72px);
}
.band-meta {
  margin: 0 0 22px; font-family: var(--font-mono);
  font-size: calc(.72rem * var(--kms-fs, 1)); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.stat b {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: calc(clamp(2.3rem, 4.4vw, 3.5rem) * var(--kms-fs, 1)); line-height: 1; color: var(--accent-head);
}
.stat span { font-family: var(--font-mono); color: var(--muted); font-size: calc(.78rem * var(--kms-fs, 1)); letter-spacing: .06em; }

/* ---------- 01 Манифест: сплит ---------- */
.mani-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 90px); }
.mani-left { position: relative; }
/* «Перезагрузка» = спортивное табло: буквы прокручиваются как сплит-флап
   и защёлкиваются со стаггером; при каждом входе в секцию — заново */
.mani-word-scene { position: sticky; top: 110px; }
.mani-word {
  margin: 0;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: calc(clamp(1.9rem, 3.5vw, 3.2rem) * var(--kms-fs, 1)); line-height: 1.06; letter-spacing: 0;
  color: var(--accent-head);
}
.mani-word .fl-line { display: block; white-space: nowrap; }
.mani-word .fl {
  display: inline-block; overflow: hidden; height: 1.06em; vertical-align: bottom;
  text-align: center; /* ширина колонки фиксируется по целевой букве в JS */
}
.mani-word .fl-roll {
  display: block; transform: translateY(0);
  transition: transform var(--fl-dur, .9s) cubic-bezier(.16, .84, .3, 1);
  transition-delay: var(--fl-delay, 0s);
}
.mani-word .fl-roll > span { display: block; height: 1.06em; line-height: 1.06; }
.mani-word-scene.is-set .fl-roll { transform: translateY(var(--fl-shift, 0)); }
.mani-load {
  display: inline-block; margin-top: 14px;
  font-family: var(--font-mono); font-size: calc(.72rem * var(--kms-fs, 1)); font-weight: 500;
  letter-spacing: .14em; color: var(--muted); text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
  .mani-word .fl-roll { transition: none; transform: translateY(var(--fl-shift, 0)); }
  .mani-load { display: none; }
}
.mani-right p {
  font-weight: 500;
  font-size: calc(clamp(1.25rem, 2vw, 1.7rem) * var(--kms-fs, 1)); line-height: 1.5; margin: 0 0 28px;
  max-width: 44ch;
}
.mani-right em { font-style: normal; font-weight: 600; color: var(--accent-ink); }

/* ---------- Сцена частиц: sticky-трек (сборка -> пауза -> распад) ----------
   190vh: пин 90vh — сцена не пролетает за полколеса; хвост перекрыт #levels */
.hash-track { position: relative; height: 190vh; }
/* служебный якорь сцены — пустых кадров без единой подписи не бывает */
.hash-tag {
  position: absolute; left: 24px; bottom: 20px; margin: 0;
  font-family: var(--font-mono); font-size: calc(.7rem * var(--kms-fs, 1)); font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.hash-scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hash-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hash-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0;
  text-align: center; line-height: 1.04;
  font-family: var(--font-display); font-weight: 800;
  text-transform: uppercase; font-size: calc(clamp(3rem, 11vw, 10rem) * var(--kms-fs, 1));
  color: var(--accent-head); /* заливка, не контур */
}
.hash-scene.has-gl .hash-fallback { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hash-track { height: auto; }
  .hash-scene { position: relative; height: 60vh; }
}

/* ---------- 02 Уровни: строки-индекс с «прожектором» ---------- */
/* секция выезжает сквозь дотаивающую пыль хеш-сцены — дыры после распада нет */
#levels { margin-top: -33vh; }
.lvl { list-style: none; margin: 0; padding: 0; }
.lvl-row {
  display: grid; grid-template-columns: 52px minmax(0, 4fr) minmax(0, 7fr) 52px;
  gap: 22px; align-items: center;
  padding: 26px 18px; border-top: 1px solid var(--line);
  cursor: pointer; position: relative;
  transition: background var(--dur-3) var(--ease), color var(--dur-3) var(--ease),
    border-color var(--dur-3) var(--ease); /* смена темы не дёргает бордер скачком */
}
.lvl-row:last-child { border-bottom: 1px solid var(--line); }
.lvl-ball {
  width: 16px; height: 16px; border-radius: 50%; justify-self: center;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #B8D62E);
  transition: transform var(--dur-3) var(--ease-bounce);
  position: relative;
}
/* 3D-мяч вместо кружка (прогрессивное улучшение) */
.lvl-ball.has-3d { width: 32px; height: 32px; background: none; }
.lvl-ball.has-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* пока строка выделена — мяч прыгает туда-сюда с приземлением */
@keyframes ballHop {
  0%, 100% { transform: translateY(0) scale(1, .96); }
  16% { transform: translateY(-11px) scale(1, 1); }
  36% { transform: translateY(0) scale(1.05, .88); }
  52% { transform: translateY(-6px) scale(1, 1); }
  70% { transform: translateY(0) scale(1.04, .92); }
  84% { transform: translateY(-3px) scale(1, 1); }
}
.lvl-row:hover .lvl-ball { animation: ballHop 1.15s cubic-bezier(.34, .5, .4, 1) infinite; transform: none; }
.lvl-row h3 {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: calc(clamp(1.2rem, 2.3vw, 1.9rem) * var(--kms-fs, 1)); margin: 0; line-height: 1.05;
}
.lvl-row p { margin: 0; color: var(--muted); font-size: calc(.97rem * var(--kms-fs, 1)); max-width: 52ch; }
.lvl-arrow {
  font-size: calc(1.5rem * var(--kms-fs, 1)); justify-self: center; opacity: .35;
  transition: transform var(--dur-3) var(--ease), opacity var(--dur-3) var(--ease);
}
.lvl-row:hover { background: var(--accent); color: var(--on-accent); }
html[data-court="hard"] .lvl-row:hover { background: var(--hot-bg); color: var(--hot-ink); }
.lvl-row:hover p { color: inherit; opacity: .85; }
.lvl-row:hover .lvl-arrow { opacity: 1; transform: translateX(8px); }
.lvl-row:hover .lvl-ball { transform: translateY(-6px); }
.lvl-row:active { transform: scale(.995); }

/* ---------- 03 Форматы: колонки-материал ---------- */
.fmt-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-inv); border-bottom: 1px solid var(--line-inv);
}
.fmt {
  padding: 40px 30px 34px; display: flex; flex-direction: column;
  border-left: 1px solid var(--line-inv); position: relative;
  background: rgba(0, 0, 0, .14); /* линии корта не просвечивают сквозь карту */
}
.fmt:last-child { border-right: 1px solid var(--line-inv); }
.fmt h3 {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: calc(1.2rem * var(--kms-fs, 1)); margin: 0 0 4px;
}
.fmt-price {
  font-family: var(--font-display); font-weight: 800; line-height: 1;
  font-size: calc(clamp(2.1rem, 3.2vw, 3.1rem) * var(--kms-fs, 1)); margin: 10px 0 4px;
}
.fmt-price small { font-size: calc(.76rem * var(--kms-fs, 1)); font-family: var(--font-mono); font-weight: 500; opacity: .7; letter-spacing: .02em; white-space: nowrap; }
.fmt ul { list-style: none; padding: 0; margin: 18px 0 28px; }
.fmt li { padding: 8px 0 8px 24px; position: relative; font-size: calc(.95rem * var(--kms-fs, 1)); opacity: .85; border-bottom: 1px dashed var(--line-inv); }
.fmt li::before {
  content: ''; position: absolute; left: 0; top: 1.05em; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #B8D62E);
}
.fmt .btn { margin-top: auto; align-self: flex-start; }
.fmt--hot { background: var(--hot-bg); color: var(--hot-ink); margin: -1px 0; padding-top: 41px; }
.fmt--hot li { border-bottom-color: rgba(0, 0, 0, .18); }
.fmt--hot li::before { background: currentColor; }
/* ховер: карта приподнимается, сверху растёт акцент-линия (не glow) */
.fmt {
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease),
    background-color var(--dur-3) var(--ease), color var(--dur-3) var(--ease),
    border-color var(--dur-3) var(--ease);
}
.fmt::after {
  content: ''; position: absolute; top: -1px; left: 0; height: 2px; width: 0;
  background: var(--ball); transition: width .35s var(--ease);
}
.fmt--hot::after { background: var(--hot-ink); }
.fmt:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.fmt:hover::after { width: 100%; }
.fmt-badge {
  position: absolute; top: -13px; left: 30px; margin: 0;
  background: var(--bg-deep); color: var(--ink-inv); border: 1px solid var(--line-inv);
  font-size: calc(.72rem * var(--kms-fs, 1)); font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  padding: 5px 12px; border-radius: var(--r-pill);
}
/* Абонемент: полоса на всю ширину под форматами */
.fmt-band {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(18px, 3vw, 44px);
  align-items: center;
  border-top: 1px solid var(--line-inv);
  border-left: 1px solid var(--line-inv); border-right: 1px solid var(--line-inv);
  padding: 26px 30px;
}
.fmt-band h3 {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: calc(1.05rem * var(--kms-fs, 1)); margin: 0 0 6px;
}
.fmt-band .fmt-price { font-size: calc(clamp(1.7rem, 2.4vw, 2.3rem) * var(--kms-fs, 1)); margin: 0; }
.fmt-band-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 0; margin: 0; }
.fmt-band-list li { position: relative; padding-left: 20px; font-size: calc(.92rem * var(--kms-fs, 1)); opacity: .85; }
.fmt-band-list li::before {
  content: ''; position: absolute; left: 0; top: .42em; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #B8D62E);
}
/* сборка: линии сетки и контент приходят каскадом (делэй --ad из JS) */
.fmt-grid.js-assemble { border-color: transparent; transition: border-color .5s var(--ease); }
.fmt-grid.js-assemble .fmt, .fmt-grid.js-assemble .fmt-band { border-color: transparent; transition: border-color .5s var(--ease) .1s, transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease); }
.fmt-grid.js-assemble.is-built, .fmt-grid.js-assemble.is-built .fmt, .fmt-grid.js-assemble.is-built .fmt-band { border-color: var(--line-inv); }
.fmt-grid.js-assemble .fmt > *, .fmt-grid.js-assemble .fmt-band > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity .55s var(--ease) var(--ad, 0s), transform .55s var(--ease) var(--ad, 0s);
}
.fmt-grid.js-assemble.is-built .fmt > *, .fmt-grid.js-assemble.is-built .fmt-band > * { opacity: 1; transform: none; }
.fmt-grid.js-assemble .fmt-badge { transform: scale(0); transition: transform .45s var(--ease-bounce) calc(var(--ad, 0s) + .15s), opacity .3s var(--ease) var(--ad, 0s); }
.fmt-grid.js-assemble.is-built .fmt-badge { transform: scale(1); }
/* одометр: цифры прокручиваются в маске как на табло */
.od-col { display: inline-block; overflow: hidden; height: 1em; vertical-align: bottom; text-align: center; }
.od-roll { display: block; transform: translateY(0); transition: transform .8s cubic-bezier(.16, .84, .3, 1); transition-delay: var(--od, 0s); }
.od-roll > span { display: block; height: 1em; line-height: 1; }
.is-built .od-roll { transform: var(--od-shift, none); }

/* ---------- 04 Календарь ---------- */
.cal-meta {
  margin: 26px 0 0; font-family: var(--font-mono);
  font-size: calc(.72rem * var(--kms-fs, 1)); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.cal-meta b { color: var(--accent-ink); font-weight: 600; }
.cal-shell {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; overflow: hidden; color: var(--ink);
}
/* сборка: оболочка -> шапка/легенда -> дни волной -> слоты каскадом */
.cal-shell.js-assemble { border-color: transparent; box-shadow: none; transition: border-color .5s var(--ease), box-shadow .5s var(--ease); }
.cal-shell.js-assemble.is-built { border-color: var(--line); }
.cal-shell.js-assemble .cal-head, .cal-shell.js-assemble .cal-legend,
.cal-shell.js-assemble .cal-note, .cal-shell.js-assemble .cal-day > * {
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s var(--ease) var(--ad, 0s), transform .5s var(--ease) var(--ad, 0s);
}
.cal-shell.js-assemble.is-built .cal-head, .cal-shell.js-assemble.is-built .cal-legend,
.cal-shell.js-assemble.is-built .cal-note, .cal-shell.js-assemble.is-built .cal-day > * {
  opacity: 1; transform: none;
}
.cal-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cal-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.cal-tabs button {
  border: 0; background: none; font: 600 .85rem var(--font-text); color: var(--muted);
  padding: 7px 16px; border-radius: var(--r-pill); cursor: pointer;
}
.cal-tabs button.is-on { background: var(--accent); color: var(--on-accent); }
html[data-court="hard"] .cal-tabs button.is-on { color: var(--ball-ink); }
.cal-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cal-nav button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: none; cursor: pointer; color: var(--ink); font-size: calc(1rem * var(--kms-fs, 1));
}
.cal-nav button:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: calc(.8rem * var(--kms-fs, 1)); color: var(--muted); margin-bottom: 14px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.cal-legend .lg-free i { border: 1.5px solid var(--line); background: var(--surface); } /* копия стиля слота */
.cal-legend .lg-pend i { background: repeating-linear-gradient(45deg, rgba(0,0,0,.14) 0 4px, rgba(0,0,0,.05) 4px 8px); }
.cal-legend .lg-busy i { background: var(--line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.cal-day { scroll-snap-align: start; }
.cal-day h4 { font: 700 .95rem var(--font-text); margin: 0 0 10px; color: var(--ink); }
.cal-day h4 span { color: var(--muted); font-weight: 500; font-size: calc(.8rem * var(--kms-fs, 1)); display: block; }
.cal-day.is-today h4 { color: var(--accent-ink); }
.slot {
  display: block; width: 100%; text-align: center; margin-bottom: 8px; cursor: pointer;
  font: 600 .86rem var(--font-text); padding: 10px 6px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
/* ховер свободного часа — «мяч»: лайм в обеих темах, как и вся бронь */
.slot:hover { border-color: transparent; background: var(--ball); color: var(--ball-ink); transform: translateY(-2px); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .35); }
.slot:active { transform: scale(.96); }
.slot--pending {
  cursor: default; color: var(--muted); border-style: dashed;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.07) 0 5px, transparent 5px 10px);
}
.slot--busy { cursor: default; background: var(--line-soft); border-color: transparent; color: var(--muted); }
.slot--pending:hover { transform: none; border-color: var(--line); color: var(--muted); }
.slot--busy:hover { transform: none; border-color: transparent; color: var(--muted); }
.cal-note { margin: 14px 0 0; font-size: calc(.8rem * var(--kms-fs, 1)); color: var(--muted); }

/* ---------- 05 Турниры ---------- */
.tourney-chips { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 30px; }
.chip {
  border: 1px solid var(--line-inv); color: var(--ink-inv); border-radius: var(--r-pill);
  padding: 8px 18px; font-size: calc(.88rem * var(--kms-fs, 1)); font-weight: 500;
}
.chip b { color: var(--ball); font-weight: 600; }
.tourney-next {
  margin: 0 0 26px; font-family: var(--font-mono);
  font-size: calc(.72rem * var(--kms-fs, 1)); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted-inv);
}
.tourney-next::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 9px; vertical-align: 1px;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #A9BC28);
}

/* ---------- Футер: темнее турниров, шов — теннисная сетка ---------- */
.footer {
  background: var(--bg-footer); color: var(--muted-inv);
  padding: 72px 0 40px; position: relative;
}
.footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 16px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .13) 0 1px, transparent 1px 8px);
  border-bottom: 1px solid var(--line-soft-inv);
}
.footer .container { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.footer .container > div > p:first-child, .footer .container > div > p:first-of-type { margin-top: 0; }
.footer .logo { display: inline-block; margin-bottom: 10px; }
.footer a { color: var(--ink-inv); text-decoration: none; }
.footer a:hover { color: var(--ball); }
.footer-note { font-size: calc(.8rem * var(--kms-fs, 1)); color: var(--muted-inv); max-width: 46ch; }
.footer .logo { font-size: calc(1.3rem * var(--kms-fs, 1)); }

/* ---------- FAB: мяч лежит на контактной тени, без свечения ---------- */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.fab-btn {
  width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--on-accent);
  display: grid; place-items: center; position: relative; padding: 0;
  overflow: visible;
}
.fab-ball { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.fab-ico { width: 26px; height: 26px; position: relative; z-index: 1; color: var(--ball-ink); }
/* пока 3D-мяч не инициализировался — обычная кнопка */
.fab-btn:not(.has-ball) { background: var(--accent); box-shadow: var(--shadow-accent); }
.fab-btn.has-ball .fab-ico { display: none; }
/* тень-эллипс: мяч стоит на земле; сжимается, когда мяч в прыжке */
.fab-btn.has-ball::before {
  content: ''; position: absolute; left: 50%; bottom: -8px;
  width: 72%; height: 13px; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 12, 6, .34), transparent 72%);
}
/* редкое приглашение: одиночная «подача» вместо вечного пульса */
@keyframes fabIdleHop {
  0%, 86%, 100% { transform: translateY(0) scale(1, 1); }
  90% { transform: translateY(-10px) scale(1, 1); }
  94% { transform: translateY(0) scale(1.07, .88); }
  97% { transform: translateY(-3px) scale(1, 1); }
}
@keyframes fabIdleShadow {
  0%, 86%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  90% { transform: translateX(-50%) scale(.72); opacity: .55; }
  94% { transform: translateX(-50%) scale(1.08); opacity: 1; }
  97% { transform: translateX(-50%) scale(.9); opacity: .8; }
}
.fab-btn.has-ball .fab-ball { animation: fabIdleHop 9s var(--ease) infinite; }
.fab-btn.has-ball::before { animation: fabIdleShadow 9s var(--ease) infinite; }
.fab.is-open .fab-ball, .fab.is-open .fab-btn.has-ball::before { animation: none; }
.fab-menu {
  position: absolute; right: 0; bottom: 72px; display: flex; flex-direction: column;
  gap: 10px; align-items: flex-end;
  visibility: hidden; transition: visibility 0s .3s; /* страховка без inert */
}
.fab.is-open .fab-menu { visibility: visible; transition: none; }
body.fab-open .mob-cta { transform: translateY(calc(100% + 24px)); } /* бар — под сценарий меню */
.fab-menu a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 10px 18px; font-size: calc(.9rem * var(--kms-fs, 1)); font-weight: 600;
  box-shadow: var(--shadow); white-space: nowrap;
  opacity: 0; transform: translateY(14px) scale(.9); transition: all var(--dur-3) var(--ease);
}
.fab.is-open .fab-menu a { opacity: 1; transform: none; }
.fab.is-open .fab-menu a:nth-child(1) { transition-delay: .12s; }
.fab.is-open .fab-menu a:nth-child(2) { transition-delay: .08s; }
.fab.is-open .fab-menu a:nth-child(3) { transition-delay: .04s; }
.fab-scrim { position: fixed; inset: 0; background: rgba(10, 8, 6, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity var(--dur-3) var(--ease); }
.fab-scrim.is-on { opacity: 1; pointer-events: auto; }

/* ---------- Панель заявки: шторка с рамкой-кадром ---------- */
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(460px, 100%);
  background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -30px rgba(0, 0, 0, .4);
  transform: translateX(103%);
  /* visibility — страховка для браузеров без inert: офскрин-поля вне tab-order */
  visibility: hidden;
  transition: transform .45s var(--ease), visibility 0s .45s;
  display: flex;
}
.sheet.is-open { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.sheet-frame {
  width: 100%; overflow-y: auto; position: relative;
  padding: 26px 30px 34px;
  display: flex; flex-direction: column; gap: 18px;
}
.sheet-tag {
  margin: 0; font-family: var(--font-mono);
  font-size: calc(.72rem * var(--kms-fs, 1)); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.sheet-tag b { color: var(--accent-ink); font-weight: 600; }
.sheet-close {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--ink);
  font-size: calc(1.3rem * var(--kms-fs, 1)); line-height: 1; cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.sheet-close:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.sheet-close:active { transform: scale(.92); }
.sheet-title {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: calc(1.35rem * var(--kms-fs, 1)); line-height: 1.15; margin: 4px 44px 2px 0;
}
.sheet-form { display: flex; flex-direction: column; gap: 18px; }
/* hidden обязан побеждать display:flex/grid */
.sheet-form[hidden], .sheet-done[hidden] { display: none !important; }
.f-field { display: grid; gap: 4px; }
.f-field > span {
  font-family: var(--font-mono); font-size: calc(.68rem * var(--kms-fs, 1)); font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.f-field em { font-style: normal; opacity: .7; }
.f-field input {
  border: 0; border-bottom: 1.5px solid var(--line); border-radius: 0;
  background: none; color: var(--ink);
  font: 500 1.02rem var(--font-text); padding: 9px 2px;
  transition: border-color var(--dur-2) var(--ease);
}
.f-field input::placeholder { color: var(--muted); opacity: .55; }
.f-field input:focus { outline: none; border-color: var(--accent-ink); }
.f-level { border: 0; padding: 0; margin: 0; }
.f-level legend {
  font-family: var(--font-mono); font-size: calc(.68rem * var(--kms-fs, 1)); font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 0; margin-bottom: 8px;
}
.f-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.f-chips label { position: relative; }
.f-chips input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.f-chips span {
  display: inline-block; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  padding: 8px 16px; font-size: calc(.88rem * var(--kms-fs, 1)); font-weight: 600;
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.f-chips span:hover { border-color: var(--accent-ink); }
.f-chips span:active { transform: scale(.95); }
.f-chips input:checked + span {
  background: var(--ball); color: var(--ball-ink); border-color: transparent;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .3);
}
.f-chips input:focus-visible + span { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.f-agree { display: flex; gap: 10px; align-items: flex-start; font-size: calc(.85rem * var(--kms-fs, 1)); color: var(--muted); }
.f-agree input { margin-top: 3px; accent-color: var(--accent-strong); }
.f-agree a { color: var(--accent-ink); }
.sheet-submit { justify-content: center; }
.sheet-note { margin: 0; font-size: calc(.8rem * var(--kms-fs, 1)); color: var(--muted); }
@keyframes sheetShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.sheet-form.is-shake { animation: sheetShake .38s var(--ease); }
.sheet-done { display: grid; gap: 14px; justify-items: start; padding-top: 6vh; }
.sheet-done-word {
  margin: 0; font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: calc(clamp(2rem, 6vw, 2.8rem) * var(--kms-fs, 1)); color: var(--accent-head); line-height: 1.05;
}
.sheet-done-word .fl { display: inline-block; overflow: hidden; height: 1.06em; vertical-align: bottom; text-align: center; }
.sheet-done-word .fl-roll { display: block; transform: translateY(0); transition: transform var(--fl-dur, .8s) cubic-bezier(.16, .84, .3, 1); transition-delay: var(--fl-delay, 0s); }
.sheet-done-word .fl-roll > span { display: block; height: 1.06em; line-height: 1.06; }
.sheet-done-word.is-set .fl-roll { transform: translateY(var(--fl-shift, 0)); }
.sheet-done-note {
  margin: 0 0 8px; font-family: var(--font-mono); font-size: calc(.74rem * var(--kms-fs, 1)); font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.sheet-scrim {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(10, 8, 6, .5);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-3) var(--ease);
}
.sheet-scrim.is-on { opacity: 1; pointer-events: auto; }
.no-scroll { overflow: hidden; }
@media (max-width: 640px) {
  .sheet {
    top: auto; left: 0; width: 100%; max-height: 92svh;
    border-left: 0; border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    transform: translateY(103%);
    box-shadow: 0 -20px 60px -30px rgba(0, 0, 0, .5);
  }
  .sheet.is-open { transform: none; }
}

/* ---------- Reveal + маски заголовков ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .65s var(--ease), transform .65s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
h2.t-rise { overflow: hidden; }
h2.t-rise > span {
  display: inline-block; transform: translateY(118%);
  transition: transform .75s var(--ease); transition-delay: var(--d, 0s);
}
h2.t-rise.is-in > span { transform: none; }
@media print { .reveal, h2.t-rise > span { opacity: 1 !important; transform: none !important; } }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .mani-grid { grid-template-columns: 1fr; }
  .mani-word-scene { position: static; height: clamp(180px, 30vh, 260px); }
  .fmt-grid { grid-template-columns: 1fr; border: 0; gap: 14px; }
  .fmt { border: 1px solid var(--line-inv); }
  .fmt--hot { margin: 0; }
  .fmt-band { grid-template-columns: 1fr; border: 1px solid var(--line-inv); gap: 16px; }
  .fmt-grid.js-assemble.is-built .fmt, .fmt-grid.js-assemble.is-built .fmt-band { border-color: var(--line-inv); }
  .lvl-row { grid-template-columns: 34px 1fr 44px; grid-template-rows: auto auto; }
  .lvl-row h3 { grid-column: 2; }
  .lvl-row p { grid-column: 2; grid-row: 2; }
  .lvl-arrow { grid-row: 1 / 3; }
  .lvl-ball { grid-row: 1 / 3; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .header-inner { gap: 12px; }
  .hero-copy { max-width: 100%; }
  .hero-grid { align-items: flex-start; padding-top: 96px; }
  .hero .lead { max-width: 34ch; }
}
@media (max-width: 640px) {
  body { font-size: calc(16px * var(--kms-fs, 1)); }
  .container { padding: 0 16px; }
  .header-cta { display: none; }
  .logo { font-size: calc(1.25rem * var(--kms-fs, 1)); }
  .header-inner { padding: 10px 14px; }
  .h1-big { font-size: calc(clamp(3.2rem, 17vw, 4.6rem) * var(--kms-fs, 1)); }
  .h1-sub { font-size: calc(clamp(1.1rem, 5vw, 1.5rem) * var(--kms-fs, 1)); }
  .hero-grid { padding-top: 84px; }
  .hero .lead { margin: 14px 0 22px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; padding: 14px 18px; }
  /* одна CTA на мобильном хиро: ghost прятать, чтобы не ложилась на панель-кадр */
  .hero-cta .btn-ghost { display: none; }
  .hero-corner { display: none; }
  h2 { font-size: calc(clamp(1.7rem, 8.4vw, 2.4rem) * var(--kms-fs, 1)); }
  .lead { font-size: calc(1.02rem * var(--kms-fs, 1)); }
  /* «Перезагрузка» на мобиле: крупно, по центру, без мёртвой высоты сцены */
  .mani-left { text-align: center; }
  .mani-word-scene { height: auto; }
  .mani-word { font-size: calc(clamp(2.7rem, 12vw, 3.6rem) * var(--kms-fs, 1)); }
  .mani-load { margin-top: 10px; }
  .manifesto .eyebrow { justify-content: center; width: 100%; }
  .mani-grid { gap: 26px; }
  .mani-right p { font-size: calc(1.15rem * var(--kms-fs, 1)); max-width: none; }
  .hash-fallback { font-size: calc(clamp(2rem, 13vw, 3.2rem) * var(--kms-fs, 1)); }
  /* мобильная сцена частиц короче: длинный пин читается как «сайт закончился» */
  .hash-track { height: 150vh; }
  #levels { margin-top: -28vh; }
  .cal-meta-city { display: none; }
  /* CTA карточек и турнира — по центру */
  .fmt .btn, .fmt-band .btn { align-self: center; }
  #tourney .btn { display: flex; width: max-content; margin-left: auto; margin-right: auto; }
  .tourney-next { text-align: center; }
  .tourney-chips { justify-content: center; }
  .lvl-row { padding: 18px 6px; gap: 14px; }
  .lvl-row h3 { font-size: calc(1.25rem * var(--kms-fs, 1)); }
  .fmt { padding: 26px 18px; }
  .fmt-grid { margin-top: 30px !important; }
  .cal-shell { padding: 14px; }
  .cal-grid { grid-template-columns: repeat(7, 78vw); }
  .frame-tag { display: none; }
  .stats { gap: 20px; grid-template-columns: repeat(2, 1fr); }
  .footer .container { flex-direction: column; gap: 18px; }
  .fab { right: 14px; bottom: 20px; transition: bottom .35s var(--ease); }
  body.has-mobcta .fab { bottom: 84px; } /* бар виден — мяч над ним */
  .fab-btn { width: 56px; height: 56px; }
  .cal-legend { font-size: calc(.74rem * var(--kms-fs, 1)); gap: 8px 12px; }
  .tourney-chips { gap: 8px; }
  .chip { padding: 7px 13px; font-size: calc(.82rem * var(--kms-fs, 1)); }
  .footer { padding-bottom: 110px; } /* зона мобильного бара */
  a.mob-cta { display: flex; } /* специфичность выше базового display:none */
}
/* мобильный sticky-бар записи (C3 из ревью): выезжает после хиро,
   на первом экране CTA не дублируется */
.mob-cta {
  display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 58;
  justify-content: center; align-items: center; gap: 10px; min-height: 54px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: calc(.98rem * var(--kms-fs, 1)); text-decoration: none;
  border-radius: var(--r-pill); box-shadow: var(--shadow-accent);
  transform: translateY(calc(100% + 24px));
  transition: transform .4s var(--ease);
}
.mob-cta.is-vis { transform: none; }
.mob-cta::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #F3FF9A, var(--ball) 60%, #A9BC28);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 1.5px rgba(0, 0, 0, .32);
}
.mob-cta:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .mob-cta { transform: none; } }

/* ---------- Доступность ---------- */
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 4px; }
.section--deep :focus-visible, .hero :focus-visible { outline-color: var(--ball); }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  html { scroll-behavior: auto; } /* селектор html сильнее *, нужен явный оверрайд */
  .reveal { opacity: 1; transform: none; }
  h2.t-rise > span { transform: none; }
  .hero-track { height: auto; }
  .hero { position: relative; }
  .hero-final, .hero-hint, .hero-dust { display: none; }
  .story { display: none; } /* рассказчик — fixed канвас, прячем именно его */
  .hash-scene .hash-fallback { display: grid !important; }
  #levels { margin-top: 0; } /* без sticky-сцены перекрытие не нужно */
}
/* ==========================================================================
   Надстройка темы vsemtennis над CSS прототипа (public/css/style.css).
   Склеивается в theme.css сборщиком cms/build-theme.sh ПОСЛЕ style.css.
   Содержимое: (1) классы вместо inline style-атрибутов прототипа (CSP
   style-src 'self'); (2) шкала размеров текста ядра (31 ступень, класс
   объявляет --kms-fs, база каждого текста домножается сборщиком);
   (3) режим правки и полоса редактора; (4) баннер согласия, чат, ошибки.
   ========================================================================== */

/* --- (1) Замена inline-стилей index.html ---------------------------------- */
.svg-defs { position: absolute; width: 0; height: 0; }
/* Разметка корта фоном: три положения вместо семи процентов в разметке */
.court-lines--hero svg    { left: -16%; bottom: -38%; width: 70%; height: 170%; transform: rotate(-8deg); }
.court-lines--formats svg { right: -14%; top: -24%;  width: 58%; height: 155%; transform: rotate(7deg); }
.court-lines--tourney svg { right: -10%; bottom: -34%; width: 62%; height: 165%; transform: rotate(6deg); }
.court-lines--nf svg      { right: -12%; bottom: -30%; width: 64%; height: 160%; transform: rotate(6deg); }
.lvl { margin-top: 40px; }
.fmt-grid { margin-top: 44px; }
.cal-shell { margin-top: 16px; }

/* --- (2) Шкала размеров текста (App\Core\Blocks\TextSizeScale) ------------ */
/* Класс задаёт долю; каждый текст темы считает свой кегль как
   calc(<своя основа> * var(--kms-fs, 1)) — домножение делает сборщик. Переменная
   наследуется, поэтому ступень на контейнере действует на тексты внутри. */
.kms-fs-50 { --kms-fs: 0.50; }
.kms-fs-55 { --kms-fs: 0.55; }
.kms-fs-60 { --kms-fs: 0.60; }
.kms-fs-65 { --kms-fs: 0.65; }
.kms-fs-70 { --kms-fs: 0.70; }
.kms-fs-75 { --kms-fs: 0.75; }
.kms-fs-80 { --kms-fs: 0.80; }
.kms-fs-85 { --kms-fs: 0.85; }
.kms-fs-90 { --kms-fs: 0.90; }
.kms-fs-95 { --kms-fs: 0.95; }
.kms-fs-100 { --kms-fs: 1.00; }
.kms-fs-105 { --kms-fs: 1.05; }
.kms-fs-110 { --kms-fs: 1.10; }
.kms-fs-115 { --kms-fs: 1.15; }
.kms-fs-120 { --kms-fs: 1.20; }
.kms-fs-125 { --kms-fs: 1.25; }
.kms-fs-130 { --kms-fs: 1.30; }
.kms-fs-135 { --kms-fs: 1.35; }
.kms-fs-140 { --kms-fs: 1.40; }
.kms-fs-145 { --kms-fs: 1.45; }
.kms-fs-150 { --kms-fs: 1.50; }
.kms-fs-155 { --kms-fs: 1.55; }
.kms-fs-160 { --kms-fs: 1.60; }
.kms-fs-165 { --kms-fs: 1.65; }
.kms-fs-170 { --kms-fs: 1.70; }
.kms-fs-175 { --kms-fs: 1.75; }
.kms-fs-180 { --kms-fs: 1.80; }
.kms-fs-185 { --kms-fs: 1.85; }
.kms-fs-190 { --kms-fs: 1.90; }
.kms-fs-195 { --kms-fs: 1.95; }
.kms-fs-200 { --kms-fs: 2.00; }

/* --- (3) Режим правки ----------------------------------------------------- */
/* Полоса редактора ядра стоит в потоке сверху; всё прибитое к окну —
   шапка, холст сцены — сдвигается на её высоту (переменную меряет ядро). */
html:has(#kms-admin-bar) .site-header { top: var(--kms-bar-height, 44px); }
html:has(#kms-admin-bar) .hash-video { display: none; } /* ролик в правке не идёт, кадр — фолбэк */
/* В правке движения нет (main.js/particles.js гасят его сами по #kms-admin-bar);
   треки хиро и сцены остаются в потоке, чтобы редактируемые поля были на месте. */
html:has(#kms-admin-bar) .hero-track,
html:has(#kms-admin-bar) .hash-track { height: auto; }
html:has(#kms-admin-bar) .hero,
html:has(#kms-admin-bar) .hash-scene { position: relative; height: auto; min-height: 70vh; }
html:has(#kms-admin-bar) .hash-scene .hash-fallback { display: grid; position: relative; padding: 12vh 0; }
html:has(#kms-admin-bar) #levels { margin-top: 0; }
html:has(#kms-admin-bar) .mob-cta,
html:has(#kms-admin-bar) .scroll-cue { display: none; }

/* --- (4) Баннер согласия на cookie (партиал consent-bar) ------------------ */
.cookie-bar {
  position: fixed; left: 20px; bottom: 20px; z-index: 70;
  width: min(440px, calc(100vw - 40px));
  padding: 18px 20px 16px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-2, 16px);
  box-shadow: var(--shadow-lift);
  transform: translateY(12px); opacity: 0;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.cookie-bar[hidden] { display: none; }
html.cookie-open .cookie-bar { transform: none; opacity: 1; }
.cookie-text { margin: 0 0 14px; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.cookie-text a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.cb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cb-btn { padding: 10px 16px; font-size: .9rem; }
.cb-btn[hidden] { display: none; }
/* Мобильная CTA уступает баннеру место */
html.cookie-open .mob-cta { transform: translateY(calc(100% + 24px)); }
@media (max-width: 640px) {
  .cookie-bar { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
/* Кнопка «Настройки cookie» в подвале — как ссылка подвала */
.footer-consent { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* --- Чат ядра: свою кнопку-запуск прячем, открывает пункт меню FAB --------- */
.kms-chat__launcher { display: none !important; }
.fab-menu button { all: unset; cursor: pointer; }

/* --- Страницы ошибок ------------------------------------------------------ */
.nf { position: relative; min-height: 100svh; display: grid; place-items: center; background: var(--bg-deep); color: var(--ink-inv); overflow: hidden; }
.nf-inner { position: relative; z-index: 1; text-align: center; padding: 96px 24px; }
.nf-eyebrow { justify-content: center; color: var(--muted-inv); }
.nf-title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.2rem, 7vw, 5rem); line-height: 1; margin: 12px 0 18px; }
.nf-text { color: var(--muted-inv); max-width: 46ch; margin: 0 auto 32px; font-size: 1.1rem; line-height: 1.5; }

/* --- Обвязка ядра в оформлении темы ---------------------------------------- */
/* Скип-линк: невидим до фокуса (приём ядра), в фокусе — плашка над шапкой */
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 14px; background: var(--ball); color: var(--ball-ink); border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
/* Призрачная кнопка баннера стоит на светлом — рисуется чернилами, не белым */
.cookie-bar .btn-ghost { color: var(--ink); border-color: var(--line); }
.cookie-bar .btn-ghost:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

/* --- Форма ядра в панели заявки (блок form темы) -------------------------- */
/* Ловушка для ботов: прячем КЛИПОМ, а не display:none — поле обязано
   остаться заполняемым для того, кто разметку читает, а не видит. */
.f-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* Строка отказа приёмника: без JavaScript форма возвращается с ошибкой,
   и место под неё не должно зиять, пока ошибки нет. */
.sheet-form .form-status { margin: 0; font-size: .82rem; color: var(--accent-ink); }
.sheet-form .form-status:empty { display: none; }
/* Календарь без свободных слотов (этап 3 включает надпись скриптом) */
.cal-empty { margin: 0 0 14px; font-size: .92rem; color: var(--muted); }
.cal-empty[hidden] { display: none; }

/* Санитайзер ядра канонизирует <em> в <i> в richtext-полях: акцент абзацев
   манифеста должен ловиться и на <i>, иначе он станет обычным курсивом. */
.mani-right i { font-style: normal; font-weight: 600; color: var(--accent-ink); }

/* Панель заявки в режиме правки: в потоке, раскрыта, без скрима */
.sheet.is-static { position: relative; transform: none; visibility: visible; inset: auto; width: auto; max-width: 560px; margin: 48px auto; height: auto; box-shadow: none; border: 1px solid var(--line); }
.sheet.is-static .sheet-close { display: none; }

/* Панель заявки в режиме записи: чипы формата и ссылка на статус */
.f-format { margin-top: -6px; }
.sheet-status-link { margin-right: 10px; }
.sheet-status-link[hidden] { display: none; }
/* Открытая панель заявки (html.no-scroll) — баннер cookie уступает ей экран */
html.no-scroll .cookie-bar { transform: translateY(120%); opacity: 0; pointer-events: none; }

/* --- Живой календарь модуля записи (contract calendar.js) ------------------ */
/* Состояние слота приходит атрибутом data-state — оформление прототипа */
.slot[data-state="busy"], .slot[data-state="gone"] { cursor: default; background: var(--line-soft); border-color: transparent; color: var(--muted); }
.slot[data-state="busy"]:hover, .slot[data-state="gone"]:hover { transform: none; border-color: transparent; color: var(--muted); box-shadow: none; }
.slot[data-state="pending"] { cursor: default; color: var(--muted); border-style: dashed; background: repeating-linear-gradient(45deg, rgba(0,0,0,.07) 0 5px, transparent 5px 10px); }
.slot[data-state="pending"]:hover { transform: none; border-color: var(--line); color: var(--muted); box-shadow: none; }
.slot[data-state="pending"]:not([disabled]) { cursor: pointer; }
.slot.is-picked { border-color: transparent; background: var(--ball); color: var(--ball-ink); }
/* Слово состояния — для программы чтения экрана; глазу — цвет и штриховка */
.slot__state, .cal-status { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Сетка недели прокручивается внутри себя, но абсолютно позиционированные потомки
   (скрытые подписи состояния .slot__state) без позиционированного предка считались от
   .container секции и не обрезались прокруткой: на телефоне документ становился шириной
   в семь дней (1945 px при окне 430) и страница ездила вбок. Контейнер прокрутки —
   их containing block, обрезка работает. */
.cal-grid { position: relative; }
.cal-day__slots { display: contents; }
/* Заголовок дня в две строки одинаковой высоты во всех колонках: «Вт» и под ним
   «22 сентября» (вторую строку делает тихой правило прототипа .cal-day h4 span).
   Одна строка «Вторник, 22 сентября» на широком экране переносилась не у всех
   дней, и ряды часов расползались по колонкам. */
.cal-day h4 .cal-day__weekday { display: inline; font: inherit; color: inherit; }
.cal-day[data-day="today"] h4 { color: var(--accent-ink); }
.cal-day[data-day="today"] .cal-day__weekday::after { content: ' · сегодня'; font-weight: 500; font-size: .78rem; }
.cal-day[data-day="past"] h4 { color: var(--muted); }
.cal-day__none { margin: 0; padding: 10px 0; font-size: .8rem; color: var(--muted); }
/* Нажатая вкладка — по aria-pressed: класс is-on календарь ядра не ставит */
.cal-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
html[data-court="hard"] .cal-tabs button[aria-pressed="true"] { color: var(--ball-ink); }
/* День: одна колонка, часы плиткой во всю ширину; заголовок дня повторяет
   подпись периода в шапке — оставлен только программе чтения экрана */
.cal-shell[data-kms-booking-current="day"] .cal-grid { grid-template-columns: minmax(0, 1fr); overflow: visible; scroll-snap-type: none; }
.cal-shell[data-kms-booking-current="day"] .cal-day__date { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cal-shell[data-kms-booking-current="day"] .cal-day__slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.cal-shell[data-kms-booking-current="day"] .slot { margin: 0; }
/* Месяц: настенный календарь — семь колонок по дням недели, клетка = число и
   счёт свободных занятий; клетка со свободными ведёт в этот день */
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; font: 500 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal-weekdays[hidden] { display: none; }
.cal-shell[data-kms-booking-current="month"] .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; }
.cal-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 66px; padding: 8px 4px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .95rem var(--font-text); cursor: pointer; transition: transform .2s var(--ease), background .2s, border-color .2s; }
.cal-cell:hover { border-color: transparent; background: var(--ball); color: var(--ball-ink); transform: translateY(-2px); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .35); }
.cal-cell:hover .cal-cell__free { color: inherit; }
.cal-cell[disabled] { cursor: default; color: var(--muted); background: var(--line-soft); border-color: transparent; }
.cal-cell[disabled]:hover { transform: none; box-shadow: none; background: var(--line-soft); color: var(--muted); }
.cal-cell[data-day="past"], .cal-cell[data-day="past"]:hover { background: transparent; opacity: .55; }
.cal-cell[data-day="today"] .cal-cell__num { color: var(--accent-ink); }
.cal-cell__free { font: 500 .72rem var(--font-mono); letter-spacing: .04em; color: var(--accent-ink); }
.cal-cell__free:empty { display: none; }
.cal-cell__free::before { content: 'свободно '; }
/* Пустое состояние занимает всю сетку */
.cal-grid > .cal-empty { grid-column: 1 / -1; margin: 0; padding: 22px 0; color: var(--muted); }
.cal-nav button { cursor: pointer; }
@media (max-width: 640px) {
  /* Неделя на телефоне — списком дней сверху вниз, часы плиткой по четыре в ряд:
     все семь дней видны обычной прокруткой, ничего не спрятано за краем экрана
     (в прототипе неделя листалась вбок по одному дню на экран) */
  .cal-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; overflow: visible; scroll-snap-type: none; padding-bottom: 0; }
  .cal-day__slots { display: flex; flex-wrap: wrap; gap: 8px; }
  .cal-day .slot { width: calc(25% - 6px); margin: 0; padding: 10px 2px; }
  .cal-day h4 { margin-bottom: 8px; }
  .cal-day h4 .cal-day__when { display: inline; margin-left: 6px; }
  .cal-day[data-day="past"] { display: flex; align-items: baseline; gap: 10px; }
  .cal-day[data-day="past"] h4 { margin: 0; }
  .cal-day__none { padding: 0; }
  .cal-shell[data-kms-booking-current="day"] .cal-day__slots { display: flex; }
  .cal-shell[data-kms-booking-current="month"] .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
  .cal-weekdays { gap: 6px; font-size: .62rem; letter-spacing: .06em; }
  .cal-cell { min-height: 54px; padding: 6px 2px; gap: 2px; font-size: .85rem; }
  .cal-cell__free { font-size: .66rem; }
  .cal-cell__free::before { content: ''; }
  .cal-cell:not([disabled]) .cal-cell__free { background: var(--ball); color: var(--ball-ink); border-radius: 999px; padding: 1px 6px; }
}

/* 07 · Вопросы и ответы: аккордеон на details/summary в языке темы */
.faq-list { margin-top: 30px; max-width: 900px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: baseline; padding: 20px 0; cursor: pointer; list-style: none; font: 700 1.15rem/1.3 var(--font-text); color: var(--ink); }
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover .faq-q-text { color: var(--accent-ink); }
.faq-idx { font: 500 .72rem var(--font-mono); letter-spacing: .12em; color: var(--accent-ink); }
.faq-plus { position: relative; width: 22px; height: 22px; align-self: center; border-radius: 50%; border: 1.5px solid var(--line); transition: transform .35s var(--ease), border-color .35s; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; background: var(--ink); transform: translate(-50%, -50%); }
.faq-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-plus { transform: rotate(45deg); border-color: var(--accent-ink); }
.faq-item[open] .faq-plus::before, .faq-item[open] .faq-plus::after { background: var(--accent-ink); }
.faq-a { padding: 0 60px 22px 46px; color: var(--muted); font-size: 1.02rem; line-height: 1.6; max-width: 66ch; }
.faq-a p { margin: 0 0 10px; } .faq-a p:last-child { margin-bottom: 0; }
.faq-a a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .faq-q { gap: 12px; padding: 16px 0; font-size: 1.02rem; } .faq-a { padding: 0 0 18px; font-size: .98rem; } }

/* Подвал: полное имя — для поиска по имени */
.footer-name { color: var(--paper, #fff); font-weight: 600; }

/* Видео первой сцены из медиатеки: кадры уходят на холст, сам элемент за
   экраном (display: none лишил бы холст кадров на iOS) */
.hero-video { position: absolute; left: -9999px; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

/* Экран «Принято»: просьба закрепить время звонком. Тренер не следит за
   сайтом круглосуточно — заявка, подтверждённая голосом, не теряется. */
.sheet-call { display: grid; gap: 12px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); max-width: 100%; }
.sheet-call-text { margin: 0; font-size: .98rem; line-height: 1.5; color: var(--ink); }
.sheet-call-actions, .sheet-done-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-call-actions .btn { white-space: nowrap; }
.sheet-done-actions { margin-top: 4px; }
/* Прозрачные кнопки панели — на светлой поверхности чернилами: прототипный
   .btn-ghost рассчитан на тёмные секции и здесь читался бледным */
.sheet .btn-ghost { color: var(--ink); border-color: var(--line); }
.sheet .btn-ghost:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
@media (max-width: 640px) { .sheet-call { padding: 14px; } .sheet-call-actions .btn { width: 100%; justify-content: center; } }

/* ==========================================================================
   Галерея учеников (vt_gallery, vt_gallery_teaser): мозаика «полароидов»
   ========================================================================== */
.gallery-section { }
.gal-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 22px; }
.gal-filter .chip { cursor: pointer; font: inherit; }
.gal-filter .chip.is-on { background: var(--ball); color: var(--ball-ink); border-color: transparent; }
.section--deep .gal-filter .chip.is-on { color: var(--ball-ink); }
/* Сетка: плотные ряды по 8 колонок; вертикаль 2×2, квадрат 2×1, широкий 4×1 */
.gal { display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 20vw; grid-auto-flow: dense; gap: 14px; margin-top: 8px; }
.gal-item { margin: 0; position: relative; grid-column: span 2; grid-row: span 1; }
.gal-item[data-form="tall"] { grid-row: span 2; }
.gal-item[data-form="wide"] { grid-column: span 4; }
.gal-item.is-hidden { display: none; }
.gal-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--sand); cursor: pointer;
  border-radius: 14px; overflow: hidden; position: relative; box-shadow: var(--shadow); transform: rotate(var(--tilt, 0deg));
  transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.gal-item:nth-child(3n+1) .gal-open { --tilt: -1.2deg; }
.gal-item:nth-child(3n+2) .gal-open { --tilt: .8deg; }
.gal-item:nth-child(3n) .gal-open { --tilt: -.6deg; }
.gal-open:hover, .gal-open:focus-visible { transform: rotate(0) translateY(-4px); box-shadow: var(--shadow-lift); }
.gal-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.gal-open img, .gal-open picture { width: 100%; height: 100%; }
/* Один ч/б снимок в цветной сетке — намеренный акцент; остальные цветные */
.gal-play { position: absolute; left: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--ball); box-shadow: 0 6px 14px -6px rgba(0,0,0,.5);
  transition: opacity .4s var(--ease); }
.gal-play::after { content: ""; position: absolute; left: 13px; top: 10px; border-left: 11px solid var(--ball-ink); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.gal-item.is-playing .gal-play { opacity: 0; }
.gal-cap { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 3px; align-items: baseline; margin: 10px 4px 0; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gal-idx { color: var(--accent-ink); grid-row: 1; }
/* Метка раздела — в служебной строке рядом с номером, а не справа от подписи:
   там она отжимала текст в узких карточках до столбика из пяти строк */
.gal-tag { grid-row: 1; grid-column: 2; justify-self: start; white-space: nowrap; }
.gal-text { grid-column: 1 / -1; font-family: var(--font-text); text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); line-height: 1.35; }
.section--deep .gal-cap, .section--deep .gal-text { color: var(--muted-inv); }
.section--deep .gal-idx { color: var(--ball); }
.gal-cta { margin-top: 36px; }
/* Лайтбокс */
.gal-box { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.gal-box::backdrop { background: rgba(20, 14, 10, .92); }
.gal-box[open] { display: grid; grid-template-rows: 1fr auto; place-items: center; }
.gal-box-stage { max-width: min(1200px, 92vw); max-height: 82vh; display: grid; place-items: center; }
.gal-box-stage img, .gal-box-stage video { max-width: min(1200px, 92vw); max-height: 82vh; width: auto; height: auto; border-radius: 12px; background: #000; }
.gal-box-cap { margin: 10px 0 24px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-inv); text-align: center; padding: 0 24px; }
.gal-box-close, .gal-box-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.gal-box-close { top: 20px; right: 20px; transform: none; }
.gal-box-prev { left: 20px; } .gal-box-next { right: 20px; }
.gal-box-close:hover, .gal-box-nav:hover { background: var(--ball); color: var(--ball-ink); border-color: transparent; }
@media (max-width: 900px) { .gal { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 38vw; } .gal-item[data-form="wide"] { grid-column: span 4; } }
@media (max-width: 640px) {
  .gal { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 44vw; gap: 10px; }
  .gal-item { grid-column: span 1; } .gal-item[data-form="wide"] { grid-column: span 2; grid-row: span 1; } .gal-item[data-form="tall"] { grid-row: span 2; }
  .gal-open { border-radius: 10px; }
  .gal-tag { display: none; }
  .gal-box-nav { top: auto; bottom: 20px; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .gal-open { transform: none; transition: none; } }
/* Тизер на главной — ровная сетка одинаковых карточек 4:5 (три в ряд, на
   планшете и телефоне две): мозаика из шести карточек разной формы оставляла
   пустые клетки в углу. Полная мозаика — на странице галереи. */
.gal--teaser { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; }
.gal--teaser .gal-item, .gal--teaser .gal-item[data-form="tall"], .gal--teaser .gal-item[data-form="wide"] { grid-column: span 1; grid-row: span 1; aspect-ratio: 4 / 5; }
@media (max-width: 900px) { .gal--teaser { grid-template-columns: repeat(2, 1fr); } }

/* Галерея: доводка по кадрам 1080/430 */
/* Чипы фильтра на светлой секции — чернилами (прототипный .chip рассчитан на тёмную) */
.gallery-section .gal-filter .chip { color: var(--ink); border-color: var(--line); background: var(--surface); }
.gallery-section .gal-filter .chip:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.gallery-section .gal-filter .chip.is-on { background: var(--ball); color: var(--ball-ink); border-color: transparent; }
/* Подпись — поверх плитки на градиенте: под плиткой её съедала следующая строка сетки */
.gal-item { overflow: hidden; border-radius: 14px; }
.gal-cap { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 26px 14px 12px; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.62)); pointer-events: none; border-radius: 0 0 14px 14px; }
.gal-text, .section--deep .gal-text { color: #fff; }
.gal-idx, .section--deep .gal-idx { color: var(--ball); }
.gal-tag, .section--deep .gal-cap { color: rgba(255,255,255,.75); }
.gal-item[data-kind="video"] .gal-cap { padding-left: 58px; }
@media (max-width: 640px) { .gal-cap { padding: 18px 10px 8px; } .gal-item[data-kind="video"] .gal-cap { padding-left: 50px; } .gal-text { font-size: .8rem; } }

/* --- Сцена мячей «#всем / теннис»: ночной корт --------------------------- */
/* Лаймовые мячи на светлом невидимы — сцена тёмная; ритм: манифест (светлый) →
   сцена (тёмная) → уровни (светлые). #levels наезжает на sticky-хвост и обязан
   иметь свой фон и быть над холстом. */
.hash-track { background: linear-gradient(180deg, var(--bg-deep-2), var(--bg-deep)); height: 200vh; } /* два экрана хода: подлёт с въезда секции (экран), стоянка на слове (16vh, ролик идёт сам), распад (72vh); 240vh владелец назвал растянутыми */
@media (max-width: 640px) { .hash-track { height: 180vh; } } /* телефон: длинный пин читается как «сайт закончился», зоны плеер считает от высоты */
@media (prefers-reduced-motion: reduce) { .hash-track { height: auto; } } /* без анимации — статичное слово без пина (правило style.css перебивалось высотой выше) */
/* cover с якорем ближе к низу: в окне шире ролика режется верх, а пол сцены (низ кадра) остаётся на экране */
.hash-scene .hash-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
.hash-scene:not(.has-gl) .hash-video { visibility: hidden; } /* до первого кадра — фолбэк-текст */
.hash-fallback { color: var(--ball); }
.hash-tag { color: var(--muted-inv); }
.hash-scene .scroll-cue { --cue: var(--ball); }
#levels { position: relative; z-index: 47; background: var(--bg); }
