/* Meme Party — страница /tournaments.
   Поверх дизайн-системы account.css. Сетка плей-офф всегда LTR (dir="ltr"
   на контейнере + direction:ltr здесь), остальная страница зеркалится в he.
   Широкая сетка скроллится ВНУТРИ своего контейнера — у страницы
   горизонтального скролла не появляется ни на 390px, ни на 1280px. */

/* Языковые кнопки в мини-навбаре страницы */
.pg-langs { display: flex; gap: 3px; align-items: center; }
.pg-langs .lang-btn {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; cursor: pointer; font-size: 0.9rem; line-height: 1;
  padding: 5px 7px; transition: 0.15s; color: inherit;
}
.pg-langs .lang-btn:hover { border-color: rgba(103, 232, 249, 0.5); }
.pg-langs .lang-btn.active-locale { border-color: #a78bfa; background: rgba(167, 139, 250, 0.2); }

/* ── Хиро ─────────────────────────────────────────────────────────────── */
.tb-hero-in { text-align: center; padding: 26px 16px 22px; }
.tb-hero-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: #d5c4ff; background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.4);
}
.tb-hero-title {
  margin: 12px 0 0; font-family: 'Unbounded', 'Manrope', sans-serif;
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  background: linear-gradient(100deg, #67e8f9, #a78bfa 48%, #ffd75e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tb-hero-sub {
  margin: 10px auto 0; max-width: 50ch; font-size: 0.9rem; line-height: 1.5;
  color: rgba(232, 235, 255, 0.78);
}
.tb-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.tb-hero-actions .acc-btn { text-decoration: none; text-align: center; }
.tb-cta {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  box-shadow: 0 6px 22px rgba(236, 72, 153, 0.42);
}

/* display:flex перебивает атрибут hidden — гасим явно, иначе пустая плашка */
.tb-live[hidden] { display: none; }
.tb-live {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center;
  margin: 16px auto 0; max-width: 520px; padding: 10px 14px; border-radius: 14px;
  font-size: 0.8rem;
  background: rgba(57, 255, 20, 0.08); border: 1px solid rgba(110, 231, 160, 0.35);
}
.tb-live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #6ee7a0; flex-shrink: 0;
  box-shadow: 0 0 10px #6ee7a0; animation: tbPulse 1.6s ease-in-out infinite;
}
@keyframes tbPulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tb-live-dot { animation: none; } }
.tb-live-sub { color: var(--muted, #9aa0b5); font-size: 0.74rem; }

/* ── Секции ───────────────────────────────────────────────────────────── */
.tb-sec-sub { margin: -6px 0 16px; font-size: 0.82rem; line-height: 1.5; color: var(--muted, #9aa0b5); }

.tb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
.tb-steps li {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px;
  border-radius: 14px; background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.tb-step-n {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 800; font-size: 0.85rem; color: #fff;
  background: linear-gradient(140deg, #8b5cf6, #ec4899);
  box-shadow: 0 4px 14px rgba(150, 70, 255, 0.4);
}
.tb-steps b { display: block; font-size: 0.9rem; margin-bottom: 3px; }
.tb-steps p { margin: 0; font-size: 0.79rem; line-height: 1.5; color: var(--muted, #9aa0b5); }

.tb-games { margin-top: 16px; }
.tb-games-cap { font-size: 0.76rem; color: var(--muted, #9aa0b5); margin-bottom: 8px; }
.tb-games-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tb-game {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  padding: 7px 13px; border-radius: 999px; font-size: 0.79rem; font-weight: 700;
  color: var(--text, #f2f2f8);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.15s;
}
.tb-game:hover { border-color: rgba(103, 232, 249, 0.5); transform: translateY(-1px); }
.tb-game-i { font-size: 1rem; }

/* ── Сетка плей-офф ───────────────────────────────────────────────────── */
.tb-bracket-scroll {
  overflow-x: auto; overflow-y: hidden; padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  /* контейнер прокручивается сам — страница остаётся без бокового скролла */
  max-width: 100%;
}
.tb-bracket-scroll::-webkit-scrollbar { height: 5px; }
.tb-bracket-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 4px; }

.tb-bracket {
  position: relative; direction: ltr; text-align: left;
  display: flex; align-items: stretch; gap: 26px;
  min-width: max-content; padding: 4px 2px 6px;
}
.tb-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.tb-line { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 2; }
.tb-line.on { stroke: rgba(255, 215, 94, 0.85); stroke-width: 2.5; filter: drop-shadow(0 0 5px rgba(255, 200, 60, 0.55)); }

.tb-round {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: space-around;
  gap: 12px; width: 152px; flex: 0 0 auto;
}
.tb-round-title {
  position: absolute; top: -4px; inset-inline-start: 0; width: 100%;
  font-size: 0.63rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: rgba(232, 235, 255, 0.5); text-align: center;
}
.tb-round { padding-top: 20px; }

.tb-match {
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  border-radius: 11px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.tb-match.path { border-color: rgba(255, 215, 94, 0.35); background: rgba(255, 215, 94, 0.06); }
.tb-match.bye { border-style: dashed; }

.tb-seat {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 5px 7px; border-radius: 8px; font-size: 0.74rem;
  background: rgba(0, 0, 0, 0.25);
}
.tb-seat.bye {
  justify-content: center; font-size: 0.66rem; font-style: italic;
  color: var(--muted, #9aa0b5); background: transparent;
}
.tb-seat.win { background: rgba(103, 232, 249, 0.14); }
.tb-seat.win .tb-seat-name { font-weight: 800; }
.tb-seat.champ {
  background: linear-gradient(100deg, rgba(255, 215, 94, 0.28), rgba(255, 157, 60, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 215, 94, 0.45);
}
.tb-seat-ava {
  flex: 0 0 auto; width: 19px; height: 19px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, #7b3ff2, #00c8ff);
}
.tb-seat-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-seat-mark { flex: 0 0 auto; font-size: 0.68rem; color: #6ee7a0; }
.tb-seat.champ .tb-seat-mark { color: #ffd75e; }

.tb-round-champ { width: 132px; justify-content: center; }
.tb-champ {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
  padding: 14px 8px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 215, 94, 0.2), rgba(255, 94, 219, 0.08));
  border: 1px solid rgba(255, 215, 94, 0.45);
  box-shadow: 0 8px 26px rgba(255, 180, 40, 0.18);
}
.tb-champ-cup { font-size: 1.7rem; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45)); }
.tb-champ-name {
  font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 800; font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.tb-champ-sub { font-size: 0.62rem; color: rgba(232, 235, 255, 0.65); line-height: 1.3; }

.tb-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px;
  font-size: 0.72rem; color: var(--muted, #9aa0b5);
}
.tb-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.tb-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.tb-dot.champ { background: linear-gradient(140deg, #ffd75e, #ff9d3c); }
.tb-dot.win { background: rgba(103, 232, 249, 0.7); }
.tb-dot.bye { background: transparent; border: 1px dashed rgba(255, 255, 255, 0.45); }

/* ── Архив ────────────────────────────────────────────────────────────── */
.tb-hist-total { font-size: 0.76rem; color: var(--muted, #9aa0b5); margin-bottom: 10px; }
.tb-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.tb-hist-item {
  padding: 12px 13px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07);
}
.tb-hist-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; justify-content: space-between; }
.tb-hist-game { font-size: 0.82rem; font-weight: 700; }
.tb-hist-meta { font-size: 0.7rem; color: var(--muted, #9aa0b5); }
.tb-hist-champ { margin-top: 6px; font-size: 0.88rem; }
.tb-hist-champ b { color: #ffe07a; overflow-wrap: anywhere; }
.tb-hist-pod {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tb-hist-pod li {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09);
  overflow-wrap: anywhere;
}
.tb-hist-cta { margin-top: 14px; }
.tb-hist-cta .acc-btn { text-decoration: none; display: inline-block; }

.tb-first { text-align: center; padding: 18px 8px 8px; }
.tb-first-i { font-size: 2.6rem; }
.tb-first-t {
  margin-top: 8px; font-family: 'Unbounded', 'Manrope', sans-serif;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em;
}
.tb-first-s { margin: 6px auto 14px; max-width: 40ch; font-size: 0.82rem; color: var(--muted, #9aa0b5); }
.tb-first .acc-btn { text-decoration: none; display: inline-block; }

/* ── Подвал ───────────────────────────────────────────────────────────── */
.tb-foot {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  padding: 8px 0 28px; font-size: 0.82rem;
}
.tb-foot a { color: #67e8f9; text-decoration: none; }
.tb-foot a:hover { text-decoration: underline; }

/* ── RTL ──────────────────────────────────────────────────────────────── */
/* сетка плей-офф читается слева направо на любом языке */
[dir="rtl"] .tb-bracket, [dir="rtl"] .tb-bracket-scroll { direction: ltr; }
[dir="rtl"] .tb-bracket-scroll { text-align: start; }
[dir="rtl"] .tb-hist-meta { direction: ltr; unicode-bidi: isolate; }

/* ── Десктоп ──────────────────────────────────────────────────────────── */
@media (min-width: 720px) {
  .tb-hero-in { padding: 38px 30px 30px; }
  .tb-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-round { width: 176px; gap: 16px; }
  .tb-bracket { gap: 34px; }
  .tb-seat { font-size: 0.78rem; padding: 6px 8px; }
  .tb-round-champ { width: 156px; }
}
