/* Общие стили сайта. Палитра — от названия ЖК: изумруд + нейтралы с зелёным подмесом. */

:root {
  --ground: #F4F6F4;
  --surface: #FFFFFF;
  --ink: #131A17;
  --ink-soft: #4A5A53;
  --ink-faint: #7E8E86;
  --accent: #1B6B4C;
  --accent-soft: #E4EFE9;
  --line: #DCE4DF;
  --focus: #1B6B4C;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0E1412; --surface: #161E1B; --ink: #E8EFEB;
    --ink-soft: #A3B3AC; --ink-faint: #74847D; --accent: #4FB98A;
    --accent-soft: #172A22; --line: #24302B; --focus: #4FB98A;
  }
}
:root[data-theme="dark"] {
  --ground: #0E1412; --surface: #161E1B; --ink: #E8EFEB;
  --ink-soft: #A3B3AC; --ink-faint: #74847D; --accent: #4FB98A;
  --accent-soft: #172A22; --line: #24302B; --focus: #4FB98A;
}
:root[data-theme="light"] {
  --ground: #F4F6F4; --surface: #FFFFFF; --ink: #131A17;
  --ink-soft: #4A5A53; --ink-faint: #7E8E86; --accent: #1B6B4C;
  --accent-soft: #E4EFE9; --line: #DCE4DF; --focus: #1B6B4C;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2rem);
}

/* ---------- панель навигации ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 4vw, 2rem);
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  min-height: 3.1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin-right: 0.6rem;
  padding: 0.4rem 0;
}
.nav-logo img { width: 1.9rem; height: 1.9rem; }

.nav a:not(.nav-logo) {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav a:not(.nav-logo):hover { color: var(--ink); }
.nav a.on { color: var(--accent); border-bottom-color: var(--accent); }

/* display:flex у пунктов меню перебивает атрибут hidden — возвращаем
   скрытие принудительно, иначе staff-вкладки видны всем. */
.nav a[hidden] { display: none !important; }

/* ---------- заголовок страницы ---------- */

.page-head {
  padding: clamp(2rem, 6vw, 3.25rem) 0 0;
}
.page-head h1 {
  font-size: clamp(1.9rem, 6.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.7rem;
  text-wrap: balance;
}
.page-head p {
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0;
  font-size: clamp(1rem, 2.4vw, 1.08rem);
  text-wrap: pretty;
}

/* ---------- обложка (только на главной) ---------- */

.hero {
  position: relative;
  min-height: min(70vh, 30rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top,
    rgba(6,12,10,0.92) 0%, rgba(6,12,10,0.6) 40%,
    rgba(6,12,10,0.25) 72%, rgba(6,12,10,0.34) 100%);
}
.hero-inner {
  width: 100%;
  padding: 5rem 0 clamp(2rem, 6vw, 3rem);
  color: #fff;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 8.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
.hero p {
  margin: 0; max-width: 30rem;
  font-size: clamp(1rem, 2.6vw, 1.1rem);
  color: rgba(255,255,255,0.87);
  text-wrap: pretty;
}

/* ---------- кнопки ---------- */

.cta { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.94rem; font-weight: 600;
  text-decoration: none; border-radius: 10px;
  padding: 0.7rem 1.05rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-solid  { background: #fff; color: #10201A; }
.btn-ghost  { color: #fff; border-color: rgba(255,255,255,0.42); backdrop-filter: blur(3px); }
.btn-ghost:hover { border-color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-line   { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- секции и текст ---------- */

section { padding: clamp(2.25rem, 6vw, 3.5rem) 0; }

.label {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 0.9rem;
  margin: 0 0 1.3rem;
}
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

h2.head {
  font-size: clamp(1.5rem, 4.5vw, 1.95rem);
  font-weight: 700; letter-spacing: -0.025em;
  margin: 0 0 0.85rem; text-wrap: balance;
}

.body-text {
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 1rem;
  text-wrap: pretty;
}
.body-text:last-child { margin-bottom: 0; }

.shot {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 1.6rem;
  aspect-ratio: 16 / 10;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- факты ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1.5rem;
}
.fact { background: var(--surface); padding: 0.9rem 1.05rem; }
.fact dt {
  font-size: 0.67rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.2rem;
}
.fact dd { margin: 0; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- шаги ---------- */

.steps { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.6rem; counter-reset: s; }
.steps li {
  counter-increment: s;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.9rem 1.1rem 0.9rem 3.1rem;
  position: relative;
  color: var(--ink-soft);
}
.steps li::before {
  content: counter(s);
  position: absolute; left: 1.05rem; top: 0.9rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.8rem; font-weight: 700;
  display: grid; place-items: center;
}
.steps b { color: var(--ink); font-weight: 600; }

/* ---------- карточки разделов (главная) ---------- */

.tiles { display: grid; gap: 0.8rem; margin-top: 1.5rem; }
@media (min-width: 34rem) { .tiles { grid-template-columns: repeat(3, 1fr); } }

.tile {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile b { font-size: 1.05rem; font-weight: 650; }
.tile span { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- ближайшая тренировка ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.2rem, 4vw, 1.7rem);
  margin-top: 1.5rem;
}

.card-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.card-title { margin: 0; font-size: 1.15rem; font-weight: 650; letter-spacing: -0.015em; }

.count {
  font-size: 0.8rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 100px; padding: 0.25rem 0.7rem;
  font-variant-numeric: tabular-nums;
}

/* Список бывает на 15+ человек — держим строки плотными,
   иначе он занимает весь экран телефона. */
.people {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0;
  grid-template-columns: 1fr;
}
@media (min-width: 30rem) {
  .people { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
}
.people li {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.92rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.people li > span:nth-child(2),
.people li > .who {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.people .n {
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint); font-size: 0.8rem;
  min-width: 1.4rem; flex: 0 0 auto;
}
.people .guest { color: var(--accent); font-size: 0.8rem; font-weight: 600; }

.subhead {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
  margin: 1.3rem 0 0.6rem;
}

.muted { color: var(--ink-faint); font-size: 0.92rem; margin: 0; }

.stamp {
  font-size: 0.76rem; color: var(--ink-faint);
  margin-top: 1rem; font-variant-numeric: tabular-nums;
}

/* ---------- лента новостей ---------- */

.feed { display: grid; gap: 0.8rem; margin-top: 1.5rem; }
.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  padding: 1rem 1.2rem;
}
.post time {
  display: block;
  font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.post h3 { margin: 0 0 0.3rem; font-size: 1rem; font-weight: 650; }
.post p { margin: 0; color: var(--ink-soft); font-size: 0.93rem; }

/* ---------- турнир ---------- */

.promo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 1.5rem;
}
.promo-img { aspect-ratio: 16 / 8; }
.promo-img img { width: 100%; height: 100%; object-fit: cover; }
.promo-body {
  padding: clamp(1.3rem, 4vw, 1.8rem);
  display: flex; flex-direction: column; gap: 1rem; align-items: flex-start;
}
.pill {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 100px; padding: 0.25rem 0.65rem;
}

/* ---------- галерея ---------- */

/* Две колонки максимум: на групповых кадрах лица мелкие,
   в три колонки уже не разобрать, кто есть кто. */
.grid { display: grid; grid-template-columns: 1fr; gap: 0.7rem; margin-top: 1.5rem; }
@media (min-width: 34rem) { .grid { grid-template-columns: repeat(2, 1fr); } }

.grid a {
  display: block; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 4 / 3;
  transition: transform 0.16s ease;
}
.grid a:hover { transform: scale(1.015); }
.grid img { width: 100%; height: 100%; object-fit: cover; }

.video {
  margin-top: 1.5rem; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #000;
}
.video video { width: 100%; display: block; }

/* ---------- просмотр фото ---------- */

.lb {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8,12,10,0.94);
  display: none; align-items: center; justify-content: center;
  padding: 3.5rem 0.75rem 1rem;
}
.lb[open] { display: flex; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

.lb-close {
  position: absolute; top: 0.7rem; right: 0.7rem;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 1.35rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.lb-close:hover { background: rgba(255,255,255,0.2); }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.8rem; height: 3.4rem; border: 0;
  background: rgba(255,255,255,0.09); color: #fff;
  font-size: 1.5rem; cursor: pointer;
  display: grid; place-items: center;
}
.lb-prev { left: 0; border-radius: 0 8px 8px 0; }
.lb-next { right: 0; border-radius: 8px 0 0 8px; }
.lb-nav:hover { background: rgba(255,255,255,0.2); }

.lb-count {
  position: absolute; top: 1.35rem; left: 1rem;
  color: rgba(255,255,255,0.7); font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- подвал ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.5rem;
  display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--ink-faint);
}
.foot a { color: var(--ink-faint); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.foot-contacts b {
  font-weight: 600;
  color: var(--ink-soft);
  margin-right: 0.35rem;
}
.foot-contacts a { color: var(--ink-soft); }
.foot-contacts a:hover { color: var(--accent); }

/* ---------- форма заявки ---------- */

.form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
  max-width: 32rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.2rem, 4vw, 1.7rem);
}

.field { display: grid; gap: 0.35rem; }

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.field .req { color: var(--accent); }

.field input {
  font: inherit;
  font-size: 1rem;              /* 16px — иначе iOS зумит при фокусе */
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.65rem 0.8rem;
  width: 100%;
  transition: border-color 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.field input.bad { border-color: #C2453C; }

.field small { font-size: 0.78rem; color: var(--ink-faint); }

.trap {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-note {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin: 0;
  padding-top: 0.2rem;
  border-top: 1px solid var(--line);
}

.form button { justify-content: center; }
.form button[disabled] { opacity: 0.55; cursor: default; transform: none; }

.form-msg { margin: 0; font-size: 0.9rem; min-height: 1.2em; }
.form-msg.ok  { color: var(--accent); font-weight: 600; }
.form-msg.err { color: #C2453C; }

/* ---------- список записавшихся ---------- */

/* Метка источника: маленькая точка. Плашка у каждой строки
   зашумляла список — читались метки, а не имена. */
/* Два оттенка одного цвета глазом не различались — берём
   контрастную пару: тёмный для чата, зелёный для сайта. */
.tag-src {
  margin-left: auto;
  flex: 0 0 auto;
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  font-size: 0;
  overflow: hidden;
}
.tag-src.tg { background: var(--ink); }
.tag-src.site { background: var(--accent); }

.src-legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 0.9rem; padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--ink-faint);
}
.src-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.src-legend i {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--accent); display: inline-block;
}
.src-legend i.tg { background: var(--ink); }



/* ---------- карточка профиля ---------- */

.pcard-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 12, 10, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.pcard-back[hidden] { display: none; }

.pcard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  width: min(24rem, 100%);
  max-height: 85vh;
  overflow-y: auto;
  display: grid;
  gap: 1rem;
}

.pcard-close {
  position: absolute; top: 0.7rem; right: 0.7rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--ground); color: var(--ink-soft);
  cursor: pointer; font-size: 0.95rem; line-height: 1;
  display: grid; place-items: center;
}
.pcard-close:hover { color: var(--ink); border-color: var(--accent); }

.pcard-head { display: flex; align-items: center; gap: 0.9rem; }
.pcard-head h3 { margin: 0; font-size: 1.15rem; font-weight: 650; }
.pcard-login { margin: 0.1rem 0 0; font-size: 0.82rem; color: var(--ink-faint); }

.pcard-ava {
  width: 3.6rem; height: 3.6rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: 1.3rem; font-weight: 700;
  overflow: hidden; flex: 0 0 auto;
}
.pcard-ava img { width: 100%; height: 100%; object-fit: cover; }

.pcard-about {
  margin: 0; font-size: 0.92rem; color: var(--ink-soft);
  background: var(--ground); border-radius: 10px; padding: 0.7rem 0.85rem;
}

.pcard-contacts { display: grid; gap: 0.5rem; }

.contact {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--ink);
  font-size: 0.9rem; font-weight: 550;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.contact:hover { border-color: var(--accent); color: var(--accent); }

/* Контакт, который человек не указал */
.contact.off {
  color: var(--ink-faint);
  background: var(--ground);
  border-style: dashed;
  cursor: default;
  pointer-events: none;
}

.contact .ic {
  width: 1.6rem; height: 1.6rem; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 700; flex: 0 0 auto;
}
.contact.off .ic { background: var(--line); color: var(--ink-faint); }

.contact .val {
  margin-left: auto; font-weight: 400;
  color: var(--ink-faint); font-size: 0.82rem;
  max-width: 11rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.contact .hint { margin-left: auto; font-size: 0.74rem; color: var(--ink-faint); }

.people li .who { cursor: pointer; color: var(--ink); text-decoration: none; }
.people li .who:hover { color: var(--accent); text-decoration: underline; }

.note-box {
  display: grid; gap: 0.4rem; margin: 1rem 0;
}
.note-box input {
  font: inherit; font-size: 1rem;
  color: var(--ink); background: var(--ground);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 0.6rem 0.8rem;
}
.note-box input:focus { outline: none; border-color: var(--accent); }
.note-box label { font-size: 0.85rem; font-weight: 600; }

/* ---------- вход/профиль в шапке ---------- */

.nav-auth {
  margin-left: auto;
  flex: 0 0 auto;
  padding-left: 0.75rem;
  display: flex;
  align-items: center;
}

/* Специфичность как у .nav a:not(.nav-logo) — иначе полоска активного
   пункта (border-bottom: 2px transparent) перебивает нижнюю рамку кнопки,
   и она выглядит обрезанной снизу. */
.nav .nav-auth .nav-login {
  display: inline-block;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
}
.nav .nav-auth .nav-login:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav .nav-auth .nav-me {
  display: inline-flex; align-items: center; gap: 0.45rem;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 0;
}
.nav-ava {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; overflow: hidden;
  font-size: 0.8rem; font-weight: 700; flex: 0 0 auto;
}
.nav-ava img { width: 100%; height: 100%; object-fit: cover; }
.nav-mename { font-size: 0.85rem; font-weight: 550; color: var(--ink); }

.field input[type="file"] {
  padding: 0.45rem; font-size: 0.85rem;
  background: var(--ground); cursor: pointer;
}

/* ---------- контакты в новости ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--ground);
  font-size: 0.82rem; font-weight: 550;
  color: var(--ink); text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.chip-ic {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 4px; padding: 0.1rem 0.28rem;
}

.chip-draft {
  display: inline-block; margin-bottom: 0.35rem;
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint); background: var(--line);
  border-radius: 100px; padding: 0.12rem 0.5rem;
}

.post-img {
  margin-top: 0.85rem; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--line);
}
.post-img img { width: 100%; display: block; }

/* ---------- подсказка гостю ---------- */

.need-auth {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--accent-soft);
  border-radius: 11px;
}
.need-auth[hidden] { display: none; }
.need-auth p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--ink);
}

/* ---------- таблица прошедшего турнира ---------- */

.tour + .tour { margin-top: 1rem; }

.tt { width: 100%; border-collapse: collapse; margin-top: 0.9rem; }
.tt td {
  padding: 0.45rem 0.5rem 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: baseline;
}
.tt tr:last-child td { border-bottom: 0; }

.tt-place {
  width: 2rem; text-align: center;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  padding-left: 0 !important;
}
.tt-nop { color: var(--ink-faint); }
.tt-name { font-weight: 600; white-space: nowrap; }
.tt-players { color: var(--ink-soft); font-size: 0.86rem; }

@media (max-width: 30rem) {
  .tt-name { white-space: normal; }
  .tt-players { font-size: 0.8rem; }
}

/* ---------- показать пароль ---------- */

.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { padding-right: 5.5rem; }

.pwd-eye {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}
.pwd-eye:hover { color: var(--accent); background: var(--accent-soft); }

/* ---------- кадрирование аватарки ---------- */

.crop-back {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(8, 12, 10, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.crop-back[hidden] { display: none; }

.crop {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem;
  width: min(20rem, 100%);
  display: grid; gap: 0.9rem; justify-items: center;
}

.crop-title { margin: 0; font-weight: 650; font-size: 1.02rem; }

.crop-stage {
  position: relative;
  width: 260px; height: 260px;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  touch-action: none;          /* иначе телефон крутит страницу вместо фото */
  cursor: grab;
}
.crop-stage:active { cursor: grabbing; }

.crop-stage img {
  position: absolute;
  left: 50%; top: 50%;
  max-width: none;
  user-select: none; -webkit-user-drag: none;
}

/* Затемняем всё вне круга одним box-shadow — проще, чем рисовать маску */
.crop-hole {
  position: absolute;
  left: 50%; top: 50%;
  width: 240px; height: 240px;
  margin: -120px 0 0 -120px;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.crop-zoom-row {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; color: var(--ink-faint); font-size: 1rem;
}
.crop-zoom-row input { flex: 1; accent-color: var(--accent); }

.crop-hint { margin: 0; font-size: 0.8rem; color: var(--ink-faint); }
.crop-actions { width: 100%; }
.crop-actions .btn { flex: 1; justify-content: center; }

/* ---------- раздел участников ---------- */

.uch + .uch { margin-top: 0.9rem; }

.uch-head { display: flex; align-items: center; gap: 0.9rem; }
.uch-who { min-width: 0; flex: 1; }
.uch-who h3 {
  margin: 0; font-size: 1.05rem; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uch-role { flex: 0 0 auto; }

.role-sel {
  font: inherit; font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
}
.role-sel:focus { outline: none; border-color: var(--accent); }

.role-badge {
  font-size: 0.75rem; font-weight: 600;
  padding: 0.22rem 0.6rem; border-radius: 100px;
  background: var(--ground); border: 1px solid var(--line);
  color: var(--ink-soft); white-space: nowrap;
}
.role-badge.role-admin { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }
.role-badge.role-editor { color: var(--ink); }

.uch .chips { margin-top: 0.8rem; }
.uch .form-msg { margin-top: 0.5rem; }

@media (max-width: 30rem) {
  .uch-head { flex-wrap: wrap; }
  .uch-role { width: 100%; }
  .role-sel { width: 100%; }
}

/* ---------- запись на тренировку ---------- */

.tr-state {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.tr-state b { color: var(--ink); }
.tr-wait {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.tr-buttons .btn { flex: 1; justify-content: center; min-width: 7rem; }

/* ---------- блоки турниров ---------- */

.back-link {
  display: inline-block; margin-bottom: 0.9rem;
  font-size: 0.85rem; color: var(--ink-faint); text-decoration: none;
}
.back-link:hover { color: var(--accent); }

.tour-block + .tour-block { margin-top: 1rem; }
.tour-block .card-title a { color: var(--ink); text-decoration: none; }
.tour-block .card-title a:hover { color: var(--accent); }
.tour-date { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--ink-faint); }
.tour-count { margin: 0.6rem 0 1rem; font-size: 0.9rem; color: var(--ink-soft); }

.pill.st-open { color: var(--accent); background: var(--accent-soft); }
.pill.st-closed { color: var(--ink-soft); background: var(--line); }
.pill.st-done { color: var(--ink-faint); background: var(--ground); border: 1px solid var(--line); }

.tour-info {
  color: var(--ink-soft); font-size: 0.95rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 1rem 1.2rem;
}

/* ---------- кто хочет участвовать ---------- */

.who-grid {
  display: grid; gap: 0.6rem;
  grid-template-columns: 1fr;
  margin-top: 0.5rem;
}
@media (min-width: 34rem) { .who-grid { grid-template-columns: 1fr 1fr; } }

.who-card {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 0.6rem 0.8rem;
  min-width: 0;
}
.who-ava {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; overflow: hidden;
  font-size: 0.85rem; font-weight: 700; flex: 0 0 auto;
}
.who-ava img { width: 100%; height: 100%; object-fit: cover; }
.who-body { display: grid; min-width: 0; }
.who-name { font-size: 0.93rem; font-weight: 550; }
.who-name .who { color: var(--ink); text-decoration: none; }
.who-name .who:hover { color: var(--accent); text-decoration: underline; }
.who-note {
  font-size: 0.8rem; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- панель редактора тренировки ---------- */

.manage-panel {
  margin-top: 1.5rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: 12px;
}
.manage-head {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.8rem;
}
.manage-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.manage-row .btn { font-size: 0.85rem; padding: 0.5rem 0.85rem; }
.manage-form:not(:empty) { margin-top: 0.9rem; display: grid; gap: 0.7rem; }
.manage-form .btn { justify-self: start; }

/* группы кнопок в панели редактора */
.manage-group + .manage-group { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }

.btn-danger {
  border: 1px solid #C2453C; color: #C2453C; background: var(--surface);
}
.btn-danger:hover { background: #C2453C; color: #fff; }

/* ---------- матчи (публичный вид) ---------- */

.matches { display: grid; gap: 0.5rem; margin: 0.5rem 0 1.2rem; }
.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.6rem 0.85rem;
}
.m-team { font-size: 0.92rem; }
.m-team:first-child { text-align: right; }
.m-team.win { font-weight: 700; color: var(--accent); }
.m-score {
  font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 0.15rem 0.6rem; background: var(--ground); border-radius: 7px;
  position: relative;
}
.m-live {
  display: block; font-size: 0.62rem; font-weight: 600; color: #C2453C;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.m-sets {
  grid-column: 1 / -1; text-align: center;
  display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap;
}
.mset {
  font-size: 0.75rem; color: var(--ink-faint);
  background: var(--ground); border-radius: 5px; padding: 0.05rem 0.4rem;
  font-variant-numeric: tabular-nums;
}

.standings { margin-top: 0.5rem; }
.standings th {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-faint); text-align: left; padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.st-num { text-align: center; font-variant-numeric: tabular-nums; }

.team-list { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.team-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.6rem 0.85rem;
  display: grid; gap: 0.15rem;
}
.team-item span { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- панель редактора турнира ---------- */

.mg-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.6rem;
}
.mg-add { display: grid; gap: 0.5rem; margin-top: 0.7rem; }
.mg-add input {
  font: inherit; font-size: 0.95rem; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--ground);
}
.mg-team, .mg-match {
  background: var(--ground); border: 1px solid var(--line);
  border-radius: 9px; padding: 0.55rem 0.75rem; margin-bottom: 0.5rem;
}
.mg-team { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.mg-team span { display: block; font-size: 0.82rem; color: var(--ink-soft); }
.mg-x {
  border: 0; background: none; color: var(--ink-faint);
  cursor: pointer; font-size: 1rem; flex: 0 0 auto; padding: 0.2rem;
}
.mg-x:hover { color: #C2453C; }
.mg-match-top { display: flex; align-items: center; gap: 0.6rem; }
.mg-match-top > span:first-child { flex: 1; font-size: 0.9rem; }
.mg-match-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.mg-sets { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.5rem 0; }
.mg-set { display: inline-flex; align-items: center; gap: 0.15rem; }
.mg-set input {
  width: 2.6rem; text-align: center; font: inherit; font-size: 0.9rem;
  padding: 0.3rem; border: 1px solid var(--line); border-radius: 6px;
}
.mg-set-add { font-size: 0.8rem; padding: 0.35rem 0.6rem; }

/* ---------- кнопки редактора внутри карточки тренировки ---------- */

.card-manage {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
}
.cm-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-sm { font-size: 0.83rem; padding: 0.45rem 0.8rem; }
.cm-form:not(:empty) { margin-top: 0.8rem; display: grid; gap: 0.6rem; }
.cm-form .btn { justify-self: start; }

/* дата+время в создании тренировки */
.dt-row { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.dt-row .note-box { flex: 1; min-width: 8rem; }
.dt-row input {
  font: inherit; font-size: 1rem; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--ground); color: var(--ink); width: 100%;
}

/* поля создания турнира */
.note-box textarea {
  font: inherit; font-size: 1rem; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--ground); color: var(--ink); resize: vertical;
  width: 100%;
}
.note-box textarea:focus { outline: none; border-color: var(--accent); }
#add-form:not(:empty) { display: grid; gap: 0.7rem; margin-top: 0.8rem; }

/* заметная подсветка ошибки формы */
.form-msg { font-size: 0.9rem; min-height: 1.2em; margin: 0.3rem 0 0; }
.form-msg.err { color: #C2453C; font-weight: 600; }
.form-msg.flash {
  animation: msg-flash 0.5s ease;
  background: rgba(194, 69, 60, 0.1);
  border-radius: 7px; padding: 0.4rem 0.6rem;
}
@keyframes msg-flash {
  0%, 100% { background: rgba(194,69,60,0.1); }
  30% { background: rgba(194,69,60,0.28); }
}

/* раскрытие строки таблицы: партии по клику */
.st-row { cursor: pointer; }
.st-row:hover td { background: var(--accent-soft); }
.st-caret {
  font-size: 0.7rem; color: var(--ink-faint);
  transition: transform 0.15s ease; display: inline-block;
}
.st-row.open .st-caret { transform: rotate(180deg); color: var(--accent); }
.st-detail td { background: var(--ground); padding: 0.5rem 0.6rem !important; }
.st-match {
  font-size: 0.85rem; color: var(--ink-soft);
  padding: 0.2rem 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.st-sets { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }

/* каретка раскрытия — CSS-треугольник (юникод-символ рендерился как дефис) */
.st-caret {
  display: inline-block; width: 0; height: 0; margin-left: 0.3rem;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-faint);
  vertical-align: middle; transition: transform 0.15s ease;
}
.st-row.open .st-caret { transform: rotate(180deg); border-top-color: var(--accent); }

/* редактирование команды */
.mg-team-info { display: grid; gap: 0.1rem; min-width: 0; }
.mg-team-info span { font-size: 0.82rem; color: var(--ink-soft); }
.mg-team-btns { display: flex; gap: 0.2rem; flex: 0 0 auto; }
.mg-team-btns { opacity: 0; transition: opacity 0.15s ease; }
.mg-team:hover .mg-team-btns,
.mg-team:focus-within .mg-team-btns { opacity: 1; }
/* на тач-устройствах наведения нет — показываем всегда */
@media (hover: none) { .mg-team-btns { opacity: 1; } }

.mg-edit { border: 0; background: none; color: var(--ink-faint); cursor: pointer; font-size: 1rem; padding: 0.25rem; }
.mg-edit:hover { color: var(--accent); }
.mg-edit-form { display: grid; gap: 0.5rem; width: 100%; }
.mg-edit-form input {
  font: inherit; font-size: 0.95rem; padding: 0.5rem 0.65rem;
  border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
}
.mg-edit-form input:focus { outline: none; border-color: var(--accent); }

/* ---------- альбомы ---------- */

.album-grid {
  display: grid; gap: 1rem; margin-top: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}
.album-card {
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.album-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.album-cover { position: relative; aspect-ratio: 4 / 3; background: var(--ground); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-nocover { width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.5rem; opacity: 0.4; }
.album-count {
  position: absolute; bottom: 0.5rem; right: 0.5rem;
  background: rgba(8,12,10,0.7); color: #fff; font-size: 0.72rem;
  padding: 0.15rem 0.5rem; border-radius: 100px;
}
.album-meta { padding: 0.7rem 0.85rem; display: grid; gap: 0.15rem; }
.album-meta b { font-size: 0.98rem; font-weight: 650; }
.album-meta span { font-size: 0.8rem; color: var(--ink-faint); }

.album-photos {
  display: grid; gap: 0.5rem; margin-top: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
}
.ph-item { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.ph-item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.ph-del {
  position: absolute; top: 0.35rem; right: 0.35rem;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 0;
  background: rgba(8,12,10,0.6); color: #fff; cursor: pointer; font-size: 0.85rem;
  display: grid; place-items: center; opacity: 0; transition: opacity 0.15s ease;
}
.ph-item:hover .ph-del { opacity: 1; }
@media (hover: none) { .ph-del { opacity: 1; } }

.manage-panel input[type="file"] {
  font-size: 0.9rem; padding: 0.5rem; width: 100%;
  border: 1px dashed var(--line); border-radius: 8px; background: var(--ground); cursor: pointer;
}

.tr-warn {
  font-size: 0.85rem; color: var(--ink-soft);
  background: rgba(224, 168, 0, 0.12); border-radius: 8px;
  padding: 0.6rem 0.8rem; margin: 0 0 0.9rem;
}
.tr-warn a { color: var(--accent); font-weight: 600; }

/* метка карточки тренировки (Идёт / Ближайшая) */
.tr-label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.6rem;
}
.card[data-live] .tr-label { color: #C2453C; }
.card[data-live] { border-color: rgba(194,69,60,0.35); }
#training .card + .card { margin-top: 1rem; }
