/* 🛡️ Сезоны/лиги и 🗓️ турниры по расписанию (season.js).
   Главная (карточка в каталоге «1 на 1», лобби сетки, значки лиг у ников),
   /rating (вкладка «Сезон»), /tournaments (расписание + Зал славы),
   /dashboard (секция «Сезон»). Mobile-first, 390px без горизонтального скролла. */

/* ── цвета лиг ─────────────────────────────────────────────────────────── */
.lg-bronze   { --lg-a: #8a4a22; --lg-b: #f0a868; }
.lg-silver   { --lg-a: #5d6c85; --lg-b: #dfe8f5; }
.lg-gold     { --lg-a: #a8760c; --lg-b: #ffe07a; }
.lg-platinum { --lg-a: #25737a; --lg-b: #b6fff4; }
.lg-diamond  { --lg-a: #1d6f92; --lg-b: #8ef0ff; }
.lg-legend   { --lg-a: #7b2ff2; --lg-b: #ff5edb; }

/* значок у ника (лобби, таблицы) */
.lg-badge {
  display: inline-grid; place-items: center;
  width: 1.35em; height: 1.35em; margin-inline-start: 0.3em;
  border-radius: 50%; font-size: 0.82em; line-height: 1; vertical-align: -0.12em;
  background: radial-gradient(circle at 35% 30%, var(--lg-b, #dfe8f5) 0 18%, var(--lg-a, #5d6c85) 75%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 8px -2px var(--lg-b, #fff);
  flex: none;
}

/* ── карточка «Ближайший турнир» ───────────────────────────────────────── */
.stour-empty { display: none !important; }
.stour-catalog-slot { grid-column: 1 / -1; min-width: 0; }
.stour-card {
  position: relative; min-width: 0;
  padding: 12px 14px 10px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.38);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(251, 191, 36, 0.16), transparent 58%),
    linear-gradient(155deg, #1d1534, #11102a);
  color: #f2f2f8;
  box-shadow: 0 10px 28px -18px rgba(251, 191, 36, 0.55);
  overflow: hidden;
}
.stour-card.is-live { border-color: rgba(255, 82, 102, 0.55); }
.stour-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stour-ico {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1);
}
.stour-head-t { min-width: 0; display: flex; flex-direction: column; }
.stour-head b { font-size: 0.95rem; line-height: 1.2; }
.stour-head small { color: var(--muted, #a29dbd); font-size: 0.74rem; line-height: 1.3; overflow-wrap: anywhere; }
.stour-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 10px; }
.stour-game { font-weight: 800; font-size: 1.05rem; color: #ffe07a; }
.stour-time { font-size: 0.84rem; color: #e6e3f5; }
.stour-left { color: var(--neon-cyan, #22d3ee); font-weight: 700; white-space: nowrap; }
.stour-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 0.76rem; color: var(--muted, #a29dbd); }
.stour-note { margin-top: 8px; font-size: 0.78rem; color: #ffb4a8; }
.stour-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.stour-btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: 40px; padding: 8px 16px; border-radius: 999px;
  font: inherit; font-weight: 800; font-size: 0.9rem; color: #1a1205;
  background: linear-gradient(135deg, #ffe07a, #fbbf24 55%, #f59e0b);
  box-shadow: 0 6px 18px -8px rgba(251, 191, 36, 0.8);
}
.stour-btn:disabled { opacity: 0.6; cursor: default; }
.stour-btn.ghost { background: transparent; color: #e6e3f5; box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.22); font-weight: 600; font-size: 0.8rem; min-height: 34px; padding: 6px 12px; }
.stour-btn:focus-visible, .stour-banner button:focus-visible { outline: 2px solid var(--neon-cyan, #22d3ee); outline-offset: 2px; }
.stour-in { font-size: 0.8rem; color: #a7f3c8; flex: 1 1 180px; min-width: 0; }
.stour-live { font-weight: 700; color: #ff8a9a; font-size: 0.86rem; }
.stour-name {
  flex: 1 1 140px; min-width: 0; max-width: 220px; min-height: 40px;
  padding: 8px 12px; border-radius: 12px; font: inherit; font-size: 0.9rem;
  color: #f2f2f8; background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.18);
}
.stour-err { min-height: 0; font-size: 0.78rem; color: #ff9aa8; margin-top: 4px; }
.stour-err:empty { display: none; }
.stour-next { margin-top: 10px; font-size: 0.76rem; color: var(--muted, #a29dbd); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.stour-next-l { font-weight: 700; }
.stour-next-i { white-space: nowrap; color: #d9d5ee; }
.stour-foot { margin-top: 8px; font-size: 0.68rem; color: rgba(162, 157, 189, 0.85); }
.stour-off .stour-head small { color: var(--muted, #a29dbd); }

/* ── Зал славы ─────────────────────────────────────────────────────────── */
.stour-hall-empty { display: flex; align-items: center; gap: 10px; color: var(--muted, #a29dbd); font-size: 0.86rem; padding: 6px 0; }
.stour-hall-empty span { font-size: 1.6rem; }
.stour-legends { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.stour-legends-t { width: 100%; font-size: 0.74rem; color: var(--muted, #a29dbd); text-transform: uppercase; letter-spacing: 0.04em; }
.stour-legend {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 4px 10px; border-radius: 999px; font-size: 0.8rem;
  background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3);
}
.stour-legend bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
.stour-legend-n { color: #ffe07a; font-weight: 700; }
.stour-hall-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stour-hall-row {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07);
}
.stour-hall-ico { flex: none; font-size: 1.2rem; }
.stour-hall-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.stour-hall-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stour-hall-main small { color: var(--muted, #a29dbd); font-size: 0.72rem; overflow-wrap: anywhere; }
.stour-hall-stars { flex: none; font-weight: 800; color: #ffe07a; font-size: 0.82rem; }

/* ── баннер напоминания / старта ───────────────────────────────────────── */
.stour-banner {
  position: fixed; z-index: 9000;
  left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 14px; border-radius: 16px;
  background: linear-gradient(135deg, #2a1d4d, #1b1236);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  color: #f2f2f8; font-size: 0.88rem;
  transform: translateY(140%); opacity: 0; pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.stour-banner.show { transform: none; opacity: 1; pointer-events: auto; }
.stour-banner.go { border-color: rgba(52, 211, 153, 0.7); }
.stour-banner-t { flex: 1; min-width: 0; line-height: 1.3; }
.stour-banner-go {
  flex: none; border: 0; cursor: pointer; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  font: inherit; font-weight: 800; color: #1a1205; background: linear-gradient(135deg, #ffe07a, #fbbf24);
}
.stour-banner-x { flex: none; border: 0; background: transparent; color: #a29dbd; cursor: pointer; width: 32px; height: 32px; font-size: 1rem; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .stour-banner { transition: none; } }

/* ── лобби сетки по расписанию (главная) ───────────────────────────────── */
body.stour-room #btn-start,
body.stour-room #btn-add-bot,
body.stour-room #tour-picker,
body.stour-room .btn-kick,
body.stour-room #screen-lobby .invite-box,
body.stour-room #lobby-guest-wait { display: none !important; }
.stour-lobby {
  display: flex; flex-direction: column; gap: 3px;
  margin: 10px 0; padding: 10px 12px; border-radius: 14px;
  background: rgba(251, 191, 36, 0.09); border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.84rem; color: #f2f2f8;
}
.stour-lobby-g { color: #ffe07a; font-weight: 700; }
.stour-lobby small { color: var(--muted, #a29dbd); }

/* ── сезон: общие блоки (/rating, /dashboard) ──────────────────────────── */
.ss-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 6px; }
.ss-head h2 { margin: 0; font-size: 1.1rem; }
.ss-ends { font-size: 0.78rem; color: var(--neon-cyan, #22d3ee); font-weight: 700; }
.ss-sub { font-size: 0.8rem; color: var(--muted, #a29dbd); margin: 0 0 10px; line-height: 1.4; }
.ss-best {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 12px; border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--lg-a, #5d6c85) 32%, transparent), rgba(255, 255, 255, 0.03));
  border: 1px solid color-mix(in srgb, var(--lg-b, #dfe8f5) 35%, transparent);
}
.ss-emblem {
  flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem;
  background: radial-gradient(circle at 35% 30%, var(--lg-b, #dfe8f5) 0 14%, var(--lg-a, #5d6c85) 80%);
  box-shadow: 0 0 18px -6px var(--lg-b, #fff);
}
.ss-best-body { min-width: 0; flex: 1; }
.ss-best-cap { font-size: 0.7rem; color: var(--muted, #a29dbd); text-transform: uppercase; letter-spacing: 0.05em; }
.ss-best-name {
  font-weight: 800; font-size: 1.1rem;
  background: linear-gradient(100deg, var(--lg-b, #dfe8f5), var(--lg-a, #5d6c85));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ss-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 6px; }
.ss-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lg-a, #5d6c85), var(--lg-b, #dfe8f5)); }
.ss-note { font-size: 0.72rem; color: var(--muted, #a29dbd); margin-top: 4px; overflow-wrap: anywhere; }
.ss-games { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.ss-game {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07);
}
.ss-game-i { font-size: 1.15rem; }
.ss-game-n { min-width: 0; display: flex; flex-direction: column; }
.ss-game-n b { font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-game-n small { font-size: 0.7rem; color: var(--muted, #a29dbd); overflow-wrap: anywhere; }
.ss-game-r { text-align: end; font-size: 0.8rem; white-space: nowrap; }
.ss-game-r b { font-size: 0.95rem; }
.ss-game .ss-bar { grid-column: 2 / -1; margin-top: 0; height: 4px; }
.ss-trophies { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-trophy {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 0.76rem;
  background: color-mix(in srgb, var(--lg-a, #5d6c85) 28%, transparent); border: 1px solid color-mix(in srgb, var(--lg-b, #dfe8f5) 40%, transparent);
}
.ss-trophy-none { font-size: 0.78rem; color: var(--muted, #a29dbd); }
.ss-ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0 4px; }
.ss-rung {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; border-radius: 12px; font-size: 0.78rem;
  background: color-mix(in srgb, var(--lg-a, #5d6c85) 22%, transparent); border: 1px solid color-mix(in srgb, var(--lg-b, #dfe8f5) 30%, transparent);
}
.ss-rung b { font-size: 0.82rem; }
.ss-rung span { color: var(--muted, #a29dbd); white-space: nowrap; }
.ss-rung em { font-style: normal; margin-inline-start: auto; color: #ffe07a; font-weight: 700; white-space: nowrap; }
.ss-how { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.78rem; color: #d9d5ee; line-height: 1.4; }
.ss-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.ss-chips::-webkit-scrollbar { display: none; }
.ss-chip {
  flex: none; appearance: none; cursor: pointer; border-radius: 999px; padding: 6px 12px; min-height: 36px;
  font: inherit; font-size: 0.8rem; color: #e6e3f5; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.14);
}
.ss-chip.active { background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.55); color: #ffe07a; font-weight: 700; }
.ss-link { display: inline-block; margin-top: 8px; font-size: 0.8rem; color: var(--neon-cyan, #22d3ee); text-decoration: none; }

/* ── /rating: место карточки турнира и блоки вкладки «Сезон» ───────────── */
.rt-stour { margin: 12px 0 10px; }
.rt-stour:empty { display: none; }
.ss-card { margin: 0 0 12px; }
.ss-card h2 { font-size: 1.05rem; }
.ss-h3 { font-size: 0.9rem; margin: 4px 0 8px; color: #e6e3f5; }
.ss-block { padding: 6px 2px 10px; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.ss-block:first-child { border-top: 0; }
