/* ═══════════════════════════════════════════════════════════
   Планшеты: сайт как приложение для iPad (логика — tablet.js, режим — класс html.lb-tab).
   Портрет — компактная рельса слева (иконка + подпись), альбомная (≥ 1024 px) — сайдбар с группами.
   ═══════════════════════════════════════════════════════════ */
.t-rail, .t-bar-title, .t-bar-right, .t-up { display: none; }

html.lb-tab {
  --t-rail-w: 92px; --t-gap: 12px; --t-bar-h: 60px; --section-pad: 80px;
  scroll-padding-top: calc(var(--t-bar-h) + 24px);
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 1024px) { html.lb-tab { --t-rail-w: 236px; } }

html.lb-tab body { padding-left: calc(var(--t-rail-w) + var(--t-gap)); background: #eef2fa; }
html.lb-tab .section { padding-left: 32px; padding-right: 32px; }
html.lb-tab #hero { border-radius: 0 0 0 32px; }
html.lb-tab .container { max-width: 1100px; }
html.lb-tab .section-title { font-size: clamp(2rem, 4.6vw, 2.9rem); }

/* ── Боковая панель ── */
html.lb-tab .t-rail {
  display: flex; flex-direction: column; position: fixed; z-index: 1100;
  left: var(--t-gap); top: var(--t-gap); bottom: var(--t-gap); width: var(--t-rail-w);
  padding: 14px 10px 12px; border-radius: 30px;
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: saturate(1.8) blur(26px); backdrop-filter: saturate(1.8) blur(26px);
  border: 1px solid rgba(255,255,255,.9); box-shadow: 0 20px 50px -20px rgba(15,23,42,.28), 0 0 0 1px rgba(200,210,230,.45);
  animation: tIn .7s cubic-bezier(.16,1,.3,1) both;
}
@keyframes tIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.t-logo { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 2px 4px 12px; text-decoration: none; color: var(--text-primary); }
.t-logo img { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 6px 16px -6px rgba(37,99,235,.55); transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.t-logo:active img { transform: rotate(-25deg) scale(.92); }
.t-logo span { display: none; flex-direction: column; line-height: 1.05; }
.t-logo b { font: 800 1.08rem var(--font-display); letter-spacing: -.02em; color: var(--blue-600); }
.t-logo small { font: 800 .82rem var(--font-display); color: var(--text-primary); letter-spacing: -.01em; }

.t-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.t-list::-webkit-scrollbar { display: none; }
.t-grp { flex: 0 0 auto; height: 1px; margin: 8px 14px; background: rgba(148,163,184,.25); }
.t-grp span { display: none; }
.t-item {
  position: relative; z-index: 1; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 58px; padding: 6px 2px; border-radius: 18px; color: var(--text-secondary, #475569); text-decoration: none;
  font: 600 .64rem/1.1 var(--font-body); letter-spacing: .01em; text-align: center; transition: color .25s, transform .2s;
}
.t-item svg { width: 23px; height: 23px; flex: 0 0 auto; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
@media (hover: hover) { .t-item:hover { color: var(--blue-600); } }
.t-item:active { transform: scale(.94); }
.t-item.on { color: var(--blue-700, #1d4ed8); }
.t-item.on svg { transform: scale(1.1); }
.t-ind {
  position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; border-radius: 18px; opacity: 0; pointer-events: none;
  background: linear-gradient(135deg, #e0ebff, #f1f6ff); box-shadow: inset 0 0 0 1.5px rgba(59,130,246,.22), 0 6px 16px -10px rgba(37,99,235,.6);
  transition: transform .55s cubic-bezier(.34,1.25,.5,1), width .4s, height .4s, opacity .3s;
}
.t-ind.on { opacity: 1; }

.t-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 10px; margin-top: 6px; border-top: 1px solid rgba(148,163,184,.22); }
.t-acc, .t-cta { position: relative; display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer; font: 700 .64rem var(--font-body); transition: transform .2s, box-shadow .3s, background .3s; }
.t-acc { flex-direction: column; gap: 3px; width: 100%; min-height: 54px; border-radius: 18px; background: none; color: var(--text-secondary, #475569); }
.t-acc svg { width: 23px; height: 23px; }
.t-acc-dot { display: none; position: absolute; top: 8px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px #fff; }
.t-acc.is-in { color: var(--blue-600); }
.t-acc.is-in .t-acc-dot { display: block; }
.t-cta { width: 56px; height: 56px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, var(--blue-600, #2563eb), #3b82f6); box-shadow: 0 10px 22px -8px rgba(37,99,235,.7); }
.t-cta svg { width: 26px; height: 26px; stroke-width: 2.4; }
.t-cta span { display: none; }
.t-acc:active, .t-cta:active { transform: scale(.94); }
.t-cta::after { content: ''; position: absolute; inset: -4px; border-radius: 24px; border: 2px solid rgba(59,130,246,.35); animation: tPulse 2.6s ease-out infinite; }
@keyframes tPulse { 0% { opacity: .9; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.12); } }

/* альбомная: сайдбар с подписями и группами */
@media (min-width: 1024px) {
  html.lb-tab .t-rail { padding: 18px 14px 14px; }
  html.lb-tab .t-logo { justify-content: flex-start; padding: 0 8px 16px; }
  html.lb-tab .t-logo span { display: flex; }
  html.lb-tab .t-grp { height: auto; margin: 12px 12px 4px; background: none; }
  html.lb-tab .t-grp:first-of-type { margin-top: 2px; }
  html.lb-tab .t-grp span { display: block; font: 800 .62rem var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted, #94a3b8); }
  html.lb-tab .t-item { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 42px; padding: 0 14px; border-radius: 14px; font-size: .9rem; text-align: left; }
  html.lb-tab .t-item svg { width: 21px; height: 21px; }
  html.lb-tab .t-ind { border-radius: 14px; }
  html.lb-tab .t-ind::before { content: ''; position: absolute; left: 5px; top: 50%; width: 3px; height: 18px; margin-top: -9px; border-radius: 3px; background: var(--blue-600, #2563eb); }
  html.lb-tab .t-foot { flex-direction: row; gap: 8px; }
  html.lb-tab .t-acc { flex-direction: row; gap: 8px; width: auto; flex: 0 0 auto; min-height: 50px; padding: 0 12px; background: #f1f5fb; font-size: .78rem; }
  html.lb-tab .t-acc span { display: none; }
  html.lb-tab .t-acc-dot { top: 10px; left: 30px; }
  html.lb-tab .t-cta { flex: 1; width: auto; height: 50px; gap: 8px; border-radius: 16px; font-size: .84rem; }
  html.lb-tab .t-cta span { display: inline; }
  html.lb-tab .t-cta svg { width: 20px; height: 20px; }
  html.lb-tab .t-cta::after { border-radius: 20px; }
}
/* невысокий экран (альбомная iPad mini): плотнее */
@media (max-height: 820px) and (min-width: 1024px) {
  html.lb-tab .t-item { min-height: 38px; }
  html.lb-tab .t-grp { margin-top: 8px; }
}
@media (max-height: 900px) and (max-width: 1023px) {
  html.lb-tab .t-item { min-height: 52px; font-size: .6rem; }
  html.lb-tab .t-item svg { width: 21px; height: 21px; }
}

/* ── Верхняя панель ── */
html.lb-tab .nav, html.lb-tab .nav.scrolled {
  left: calc(var(--t-rail-w) + var(--t-gap) * 2); right: var(--t-gap); top: var(--t-gap); height: var(--t-bar-h);
  padding: 0 10px 0 22px; border-radius: 22px; gap: 12px;
  background: rgba(255,255,255,.72); -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px);
  border: 1px solid rgba(255,255,255,.85); box-shadow: 0 10px 30px -18px rgba(15,23,42,.3), 0 0 0 1px rgba(200,210,230,.4);
  transform: none !important; transition: background .35s, box-shadow .35s;
}
html.lb-tab:not(.t-scrolled) .nav { background: rgba(255,255,255,.4); box-shadow: 0 0 0 1px rgba(200,210,230,.3); }
html.lb-tab .nav-logo, html.lb-tab .nav-links, html.lb-tab .burger, html.lb-tab .m-nav-pill { display: none !important; }
html.lb-tab .t-bar-title { display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; }
.t-bar-title small { font: 800 .6rem var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--blue-600, #2563eb); opacity: .85; }
.t-bar-title b { position: relative; display: block; height: 1.3em; overflow: hidden; font: 800 1.3rem/1.3 var(--font-display); letter-spacing: -.02em; color: var(--text-primary); }
.t-bar-title b span { position: absolute; left: 0; top: 0; white-space: nowrap; transform: translateY(100%); opacity: 0; transition: transform .45s cubic-bezier(.16,1,.3,1), opacity .3s; }
.t-bar-title b span.in { transform: none; opacity: 1; }
.t-bar-title b span.out { transform: translateY(-100%); opacity: 0; }
html.lb-tab .t-bar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
html.lb-tab .soundtrack-btn.t-in-bar, html.lb-tab .ballsnd-btn.t-in-bar {
  position: static; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 10px; border-radius: 999px;
  background: rgba(255,255,255,.85); border: 1px solid rgba(200,210,230,.6); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; font-size: .78rem;
}
html.lb-tab .soundtrack-btn.t-in-bar:hover, html.lb-tab .ballsnd-btn.t-in-bar:hover { transform: none; }
html.lb-tab .ballsnd-btn.t-in-bar .bs-ico { width: 22px; height: 22px; }
@media (max-width: 1023px) {
  html.lb-tab .soundtrack-btn.t-in-bar, html.lb-tab .ballsnd-btn.t-in-bar { width: 42px; padding: 0; justify-content: center; gap: 0; }
  html.lb-tab .soundtrack-btn.t-in-bar .soundtrack-label, html.lb-tab .ballsnd-btn.t-in-bar .bs-label { display: none; }
}
html.lb-tab .hero-audio:empty { display: none; }

/* ── Наверх ── */
html.lb-tab .t-up {
  display: grid; place-items: center; position: fixed; z-index: 1050; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 52px; height: 52px; border-radius: 18px; border: 0;
  color: var(--blue-600); background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 12px 28px -12px rgba(15,23,42,.35), 0 0 0 1px rgba(200,210,230,.5);
  opacity: 0; transform: translateY(20px) scale(.9); pointer-events: none; transition: opacity .3s, transform .4s cubic-bezier(.34,1.56,.64,1);
}
html.lb-tab .t-up svg { width: 22px; height: 22px; stroke-width: 2.2; }
html.lb-tab .t-up.on { opacity: 1; transform: none; pointer-events: auto; }
html.lb-tab .t-up:active { transform: scale(.92); }

/* ── Герой ── */
html.lb-tab #hero { min-height: 100svh; }
html.lb-tab .hero-text { padding-top: 120px; }
html.lb-tab .scroll-ind { display: none !important; }

/* ── Разделы ── */
html.lb-tab .news-grid { grid-template-columns: 1fr; gap: 18px; }
html.lb-tab .news-featured.nf { min-height: 400px; }
html.lb-tab .fas-news-scroll { max-height: none !important; overflow: visible; }
@media (min-width: 1100px) {
  html.lb-tab .ticker-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  html.lb-tab .coach-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  html.lb-tab .coach-photo { max-width: none; }
}
/* главный тренер на планшете в одну колонку: у блока с фото должна быть ширина (фото внутри позиционируется абсолютно) */
html.lb-tab .coach-photo.has-img { width: 100%; max-width: 360px; }
@media (min-width: 1100px) { html.lb-tab .coach-photo.has-img { max-width: none; } }
html.lb-tab .fas-dock { left: calc(var(--t-rail-w) + var(--t-gap) * 2 + 8px); }
html.lb-tab .toast { top: calc(var(--t-bar-h) + var(--t-gap) * 2 + 4px); }
html.lb-tab .lbt-stack { top: calc(var(--t-bar-h) + var(--t-gap) * 2 + 4px); }

/* модальные окна — как «листы» iPad: по центру, крупное скругление, выезжают снизу */
html.lb-tab .modal-overlay { padding: 24px; }
html.lb-tab .modal { max-width: 620px; border-radius: 30px; max-height: calc(100svh - 48px); }
html.lb-tab .modal-overlay.show .modal { animation: tSheet .5s cubic-bezier(.16,1,.3,1) both; }
@keyframes tSheet { from { opacity: 0; transform: translateY(40px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Ленты (горизонтальный свайп; логика — mobile.js) ── */
html.lb-tab .m-rail {
  display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
  grid-template-columns: none !important; column-count: auto !important;
  gap: 16px !important; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-padding: 0 32px; overscroll-behavior-x: contain;
  margin: -12px -32px -10px !important; padding: 16px 32px 26px !important;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: none !important;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}
html.lb-tab .m-rail::-webkit-scrollbar { display: none; }
html.lb-tab .m-rail > * { flex: 0 0 46%; max-width: 46%; scroll-snap-align: start; margin: 0 !important; break-inside: auto; height: auto; align-self: stretch; }
html.lb-tab .m-rail > .m-rail-end { flex: 0 0 1px; }
html.lb-tab .m-rail.m-rail--narrow > * { flex-basis: 34%; max-width: 34%; }
@media (min-width: 1024px) {
  html.lb-tab .m-rail > * { flex-basis: 31.5%; max-width: 31.5%; }
  html.lb-tab .m-rail.m-rail--narrow > * { flex-basis: 23.5%; max-width: 23.5%; }
}
html.lb-tab .m-rail-meta { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 6px; min-height: 18px; }
html.lb-tab .m-rail-dots { display: flex; gap: 6px; }
html.lb-tab .m-rail-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--blue-200, #bfdbfe); transition: width .3s, background .3s; }
html.lb-tab .m-rail-dots i.on { width: 22px; background: var(--blue-600, #2563eb); }
html.lb-tab .m-rail-count { font: 600 .78rem var(--font-body); color: var(--text-muted); }
html.lb-tab .m-rail > * { box-shadow: 0 6px 18px -8px rgba(15,23,42,.12) !important; }
html.lb-tab .fas-roster-note { width: fit-content; margin: 0 0 12px; }

/* касание — короткий отклик карточек, без «залипшего» наведения */
@media (hover: none) {
  html.lb-tab .news-card:active, html.lb-tab .player-card:active, html.lb-tab .video-card:active, html.lb-tab .lrn-card:active, html.lb-tab .result-card:active { transform: scale(.98); transition: transform .15s; }
}
@media (prefers-reduced-motion: reduce) {
  html.lb-tab .t-rail, .t-ind, .t-bar-title b span, .t-cta::after { animation: none !important; transition: none !important; }
}

/* «Тренерская» в боковой панели — тренеру и админу вместо «Записаться» */
.t-coach { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 56px; height: 56px; border: 0; border-radius: 20px; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, #fb923c, #f97316 55%, #ea580c); box-shadow: 0 10px 22px -8px rgba(234, 88, 12, .75); font: 800 .56rem var(--font-body); transition: transform .2s; }
.t-coach i { font-style: normal; font-size: 1.35rem; line-height: 1; }
.t-coach span { display: none; }
.t-coach:active { transform: scale(.94); }
.t-coach[hidden], .t-cta[hidden] { display: none !important; }
@media (min-width: 1024px) {
  html.lb-tab .t-coach { flex: 1; flex-direction: row; gap: 8px; width: auto; height: 50px; border-radius: 16px; font-size: .84rem; }
  html.lb-tab .t-coach span { display: inline; }
  html.lb-tab .t-coach i { font-size: 1.15rem; }
}
