@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@500;600;700;800;900&display=swap");

* { box-sizing: border-box; }

/* Убираем синюю подсветку тапа/focus в WebView Telegram */
button, a, .nav-btn, .menu-list li, [role="button"], summary {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  outline: none;
  -webkit-focus-ring-color: transparent;
}
button:focus, button:focus-visible,
.nav-btn:focus, .nav-btn:focus-visible,
.menu-list li:focus, summary:focus {
  outline: none;
  box-shadow: none;
}

:root {
  --ink: #000000;
  --surface: #0f0f0f;
  --surface-up: #181818;
  --stroke: #222222;
  --stroke-lo: #1a1a1a;
  --text: #f0f0f0;
  --text-2: #aaaaaa;
  --muted: #666666;
  --lime: #a3cb38;
  --lime-hi: #bfe044;
  --lime-lo: #6b9428;
  --lime-ink: #0a0a0a;
  --lime-dim: rgba(163, 203, 56, 0.10);
  --lime-glow: rgba(163, 203, 56, 0.12);
  --err: #e06060;
  --nav-circle: 48px;
  --nav-pad: 12px;
  --nav-dock-h: calc(var(--nav-circle) + var(--nav-pad));
  --tg-top: env(safe-area-inset-top, 0px);
  --tg-bottom: env(safe-area-inset-bottom, 0px);
  --app-vh: 100dvh;
  --nav-gap: 6px;
  --r: 14px;
  --r-sm: 10px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: var(--ink);
}

body {
  font-family: "Rubik", system-ui, sans-serif;
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ── Фон: всегда на весь экран ── */
.bg-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
}
.bg-glow {
  position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 110%; height: 45%;
  background: radial-gradient(ellipse, var(--lime-glow) 0%, transparent 70%);
}
.bg-glow-bottom {
  position: absolute; bottom: 5%; left: 0; width: 50%; height: 28%;
  background: radial-gradient(ellipse, rgba(107, 148, 40, 0.06) 0%, transparent 70%);
}

/* ── Корневой контейнер: на весь viewport Telegram ── */
.app-root {
  position: fixed;
  inset: 0;
  width: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding-top: var(--tg-top);
  box-sizing: border-box;
  overflow: hidden;
  background: transparent;
}

#screen-app {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-page.loader-screen {
  display: flex;
  flex-direction: column;
}

.app-page.hidden { display: none !important; }

.ban-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: var(--app-vh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--tg-top) + 24px) 24px calc(var(--tg-bottom) + 24px);
  background: var(--ink);
  z-index: 300;
  box-sizing: border-box;
}

body.ban-active .bg-scene {
  display: none;
}

body.ban-active .app-root {
  padding-top: 0;
}

.ban-screen-inner {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.ban-icon-x {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ban-icon-x svg {
  display: block;
  width: 48px;
  height: 48px;
}

.ban-title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: #fff;
}

.ban-message {
  margin: 0 0 10px;
  color: #eee;
  font-size: 1rem;
  line-height: 1.5;
}

.ban-until {
  margin: 0 0 16px;
  color: var(--muted, #888);
  font-size: 0.9rem;
}

.ban-hint {
  margin: 0;
  color: var(--muted, #666);
  font-size: 0.82rem;
  line-height: 1.45;
}

.loader-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.app-top {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px 6px;
}

.app-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px calc(var(--nav-dock-h) + var(--nav-gap) * 2 + var(--tg-bottom) + 16px);
  background: transparent;
}

body.nav-hidden .app-scroll {
  padding-bottom: calc(var(--tg-bottom) + 16px);
}

/* ── Баланс в шапке ── */
.header-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.header-balance .stat-ico { display: flex; color: var(--lime); }
.header-balance .stat-ico .ico-svg { width: 16px; height: 16px; }
.header-balance .value {
  font-size: 0.86rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--lime-hi);
}
.header-balance .value small {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Баланс на главной (legacy) ── */
.home-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r);
}
.home-balance .stat-ico { display: flex; color: var(--lime); }
.home-balance .stat-ico .ico-svg { width: 16px; height: 16px; }
.home-balance .stat-data {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.home-balance .stat-data .label {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.home-balance .stat-data .value {
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--lime-hi);
}
.home-balance .stat-data .value small {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--muted);
}

.profile-stats { margin-bottom: 10px; }
.profile-stats .stat-chip .stat-ico { display: flex; color: var(--lime); }
.profile-stats .stat-chip .stat-ico .ico-svg { width: 14px; height: 14px; margin-bottom: 2px; }

#toast { position: fixed; z-index: 60; }

/* ── Brand ── */
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-text { min-width: 0; }

.brand-mark {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--lime); color: var(--lime-ink);
  flex-shrink: 0;
}
.brand-mark .ico-svg { width: 18px; height: 18px; }

.brand h1 {
  font-size: 1.1rem; font-weight: 900; margin: 0;
  letter-spacing: 0.07em; color: var(--lime-hi);
}
.greeting-line {
  margin: 0; font-size: 0.64rem; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pill-admin, .pill-mod {
  font-size: 0.52rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 7px; border-radius: 6px;
  background: var(--lime-dim); color: var(--lime); border: 1px solid var(--lime-lo);
}

/* ── Stats bar ── */
.stats-bar {
  flex-shrink: 0;
  display: flex;
  margin: 0 12px 10px;
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--r); overflow: hidden;
}
.stat-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 1px; padding: 8px 4px; min-width: 0;
  border-right: 1px solid var(--stroke-lo);
}
.stat-chip:last-child { border-right: none; }
.stat-chip .stat-ico { display: none; }
.stat-data { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.stat-data .label {
  font-size: 0.48rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.stat-data .value {
  font-size: 0.82rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--lime-hi);
}
.stat-data .value small { font-size: 0.52rem; font-weight: 600; color: var(--muted); }

/* ── Panels ── */
.panel { display: none; }
.panel.active { display: block; }

.feed-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 4px 0 10px;
}
.section-title {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--lime); margin: 0;
}
.feed-count { font-size: 0.65rem; font-weight: 600; color: var(--muted); }

/* ── Card (общий: формы, лобби, меню) ── */
.card {
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--r); padding: 12px; margin-bottom: 10px;
}
.card .section-title { margin-bottom: 10px; }
.card.highlight { border-color: var(--lime-lo); }

.info-box {
  font-size: 0.76rem; color: var(--muted); background: var(--ink);
  border-radius: var(--r-sm); padding: 9px 11px; line-height: 1.5;
  border: 1px solid var(--stroke);
}

/* ── Tournament card ── */
.t-card {
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--r); padding: 12px; margin-bottom: 10px;
}
.t-card.mode-showdown { border-color: rgba(107, 148, 40, 0.4); }
.t-card.hero-spotlight {
  border-color: var(--lime-lo);
  background: linear-gradient(160deg, rgba(163,203,56,0.05) 0%, var(--surface) 60%);
  margin-bottom: 14px;
}

.t-card-top { display: flex; gap: 10px; align-items: flex-start; }

.t-sticker { flex-shrink: 0; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.t-sticker.lg { width: 62px; height: 62px; }
.t-mode-img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(1px 2px 0 rgba(0,0,0,0.7)); mix-blend-mode: multiply; }
.t-mode-fallback {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--surface-up); border: 1px solid var(--stroke); color: var(--lime);
}
.t-mode-fallback .ico-svg { width: 26px; height: 26px; }

.t-card-body { flex: 1; min-width: 0; padding-top: 1px; }
.t-mode-label {
  font-size: 0.56rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--lime); margin-bottom: 3px;
}
.t-card .t-title {
  font-size: 0.95rem; font-weight: 800; line-height: 1.2;
  margin: 0 0 4px; color: var(--text);
}
.t-line { font-size: 0.72rem; font-weight: 600; color: var(--text-2); }
.t-line strong { color: var(--text); font-weight: 800; }
.t-line .prize { color: var(--lime-hi); }
.t-card-status { flex-shrink: 0; padding-top: 1px; }

.t-fill { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.t-fill-bar {
  flex: 1; height: 5px; background: var(--stroke); border-radius: 99px; overflow: hidden;
}
.t-fill-bar > span {
  display: block; height: 100%; background: var(--lime);
  border-radius: 99px; transition: width 0.3s ease;
}
.t-fill-num {
  font-size: 0.66rem; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right;
}
.t-item { padding: 0; border: none; }
.t-meta { font-size: 0.66rem; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* ── Статусы ── */
.status {
  font-size: 0.5rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 7px; border-radius: 6px;
  white-space: nowrap; border: 1px solid transparent;
}
.status.filling { background: var(--lime); color: var(--lime-ink); }
.status.scheduled { background: var(--surface-up); color: var(--muted); border-color: var(--stroke); }
.status.live { background: var(--lime); color: var(--lime-ink); }
.status.verifying { background: rgba(224,96,96,0.12); color: var(--err); border-color: var(--err); }
.status.completed { background: var(--surface-up); color: var(--muted); }

.badge-mine {
  display: inline-block; font-size: 0.46rem; font-weight: 900;
  padding: 2px 5px; border-radius: 4px;
  background: var(--lime-dim); color: var(--lime);
  border: 1px solid var(--lime-lo);
  margin-left: 5px; vertical-align: middle; text-transform: uppercase;
}

/* ── Progress (legacy) ── */
.progress { height: 5px; background: var(--stroke); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--lime); border-radius: 99px; }

/* ── Inputs ── */
input {
  width: 100%; padding: 11px 12px; margin: 5px 0;
  border-radius: var(--r-sm); border: 1px solid var(--stroke);
  background: var(--surface-up); color: var(--text);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
}
input:focus { outline: none; border-color: var(--lime); }
input::placeholder { color: var(--muted); }

/* ── Кнопки ── */
/* Иерархия: primary (лайм) > secondary > ghost > devtool */

button.action {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--lime-lo); border-radius: var(--r-sm);
  font-family: inherit; font-weight: 800; font-size: 0.86rem;
  margin-top: 8px;
  background: var(--lime); color: var(--lime-ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--lime-lo);
  transition: transform 0.08s, box-shadow 0.08s;
}
button.action:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: none;
  opacity: 0.92;
}
button.action:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
button.action.btn-loading { color: transparent; position: relative; }
button.action.btn-loading::after {
  content: ""; position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.15); border-top-color: var(--lime-ink);
  border-radius: 50%; left: 50%; top: 50%; margin: -8px 0 0 -8px;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

button.secondary {
  background: var(--surface-up); color: var(--text);
  border-color: var(--stroke); box-shadow: none;
}
button.action.danger {
  background: transparent;
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 55%, var(--stroke));
  box-shadow: none;
}
button.action.danger:active:not(:disabled) {
  background: color-mix(in srgb, var(--err) 12%, transparent);
}
button.warn { background: var(--lime-lo); color: #eee; border-color: #4a7020; box-shadow: none; }
button.ghost {
  background: transparent; border-color: var(--stroke);
  color: var(--muted); box-shadow: none;
}
/* Кнопки-тесты в sandbox — минимальные */
button.devtool {
  width: auto; padding: 5px 10px; margin-top: 8px;
  border: 1px solid var(--stroke); border-radius: 6px;
  font-family: inherit; font-size: 0.68rem; font-weight: 600;
  background: transparent; color: var(--muted); cursor: pointer; box-shadow: none;
}
button.devtool:active { opacity: 0.6; }

button.row { flex: 1; margin-top: 0; padding: 10px 8px; font-size: 0.8rem; }
.row-btns, .btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row .action { flex: 1; margin-top: 0; }

/* Кнопки действий внутри карточек турниров */
.t-card .btn-row {
  margin-top: 10px;
  justify-content: center;
}
.t-card .btn-row button.action {
  flex: none;
  width: auto;
  min-width: min(100%, 220px);
  padding: 10px 18px;
  font-size: 0.82rem;
  border-radius: 10px;
  box-shadow: none;
  border-width: 1.5px;
  text-align: center;
}
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.btn-icon .ico-svg { width: 15px; height: 15px; }

/* Кнопка «Обновить» в ленте */
.btn-refresh-feed {
  width: auto; margin: 12px auto 0; display: flex;
  padding: 8px 16px; font-size: 0.76rem;
}

/* Текстовая ссылка-навигация */
.btn-text-link {
  background: none; border: none; padding: 0; margin-top: 12px;
  font-family: inherit; font-size: 0.8rem; font-weight: 700;
  color: var(--lime); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ── Timeline / лобби ── */
.timeline { display: flex; justify-content: space-between; margin: 10px 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 10px; left: 8%; right: 8%;
  height: 1px; background: var(--stroke);
}
.tl-step {
  flex: 1; text-align: center; position: relative; z-index: 1;
  font-size: 0.48rem; font-weight: 700; color: var(--muted);
}
.tl-dot {
  width: 20px; height: 20px; border-radius: 50%; margin: 0 auto 3px;
  background: var(--surface-up); border: 1px solid var(--stroke);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.54rem; font-weight: 900;
}
.tl-step.done .tl-dot { background: var(--lime-dim); border-color: var(--lime-lo); color: var(--lime); }
.tl-step.active .tl-dot { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.tl-step.active { color: var(--text); }

.step-banner {
  border-radius: var(--r-sm); padding: 10px 11px; margin: 8px 0;
  background: var(--surface-up); border-left: 3px solid var(--lime);
  font-size: 0.78rem; font-weight: 600;
}
.step-banner strong {
  display: block; margin-bottom: 2px; font-size: 0.55rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--lime); font-weight: 800;
}

.lobby-code-wrap {
  text-align: center; margin: 10px 0; padding: 16px;
  border-radius: var(--r); background: var(--surface-up);
  border: 1px solid var(--lime-lo);
}
.lobby-code {
  font-size: 1.8rem; font-weight: 900; letter-spacing: 0.14em;
  color: var(--lime-hi); font-variant-numeric: tabular-nums;
}
.lobby-link-hint {
  margin: 10px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.lobby-steps { margin: 8px 0; padding: 0; list-style: none; font-size: 0.76rem; color: var(--text-2); }
.lobby-steps li { display: flex; align-items: flex-start; margin: 5px 0; }
.step-num {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--lime-dim); color: var(--lime);
  font-size: 0.58rem; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 7px; flex-shrink: 0;
}

.lobby-list { list-style: none; padding: 0; margin: 8px 0 0; }
.lobby-list li {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--stroke);
  font-size: 0.8rem; font-weight: 600;
}
.lobby-list li:last-child { border-bottom: none; }
.lobby-list .check { color: var(--lime); }

.avatar {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface-up); border: 1px solid var(--lime-lo);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: var(--lime);
}
.profile-row { display: flex; gap: 10px; align-items: flex-start; }

/* ── Icons ── */
.ico-svg { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.empty-art .ico-svg { width: 40px; height: 40px; color: var(--muted); }

/* ── Empty states ── */
.empty-state { text-align: center; padding: 24px 16px; }
.empty-art { display: flex; justify-content: center; margin-bottom: 10px; }
.empty-title { font-size: 0.9rem; font-weight: 800; margin: 0 0 4px; }
.empty-text { font-size: 0.74rem; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
.empty { text-align: center; padding: 18px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }

/* ── Skeleton ── */
.skeleton {
  height: 88px; border-radius: var(--r); margin-bottom: 8px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-up) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite;
  border: 1px solid var(--stroke);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Навбар: плавающий, поверх контента ── */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(8px, var(--tg-bottom), env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  max-width: calc(100% - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  flex: 0 0 auto;
  width: var(--nav-circle); height: var(--nav-circle);
  border: 1px solid var(--stroke); border-radius: 50%;
  background: transparent; color: var(--muted);
  padding: 0; display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  -webkit-appearance: none;
  appearance: none;
}
.nav-btn:active {
  opacity: 0.85;
  transform: scale(0.96);
}
.nav-btn.active {
  border-color: var(--lime); background: var(--lime); color: var(--lime-ink);
}
.nav-ico { display: flex; }
.nav-ico .ico-svg { width: 22px; height: 22px; }
.nav-label { display: none; }
.nav-btn .dot {
  position: absolute; top: 1px; right: 1px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime-hi); border: 1.5px solid var(--ink); display: none;
}
.nav-btn.active .dot { border-color: var(--lime); }
.nav-btn.has-alert .dot { display: block; }

/* ── Toast ── */
.toast {
  bottom: calc(var(--nav-dock-h) + var(--nav-gap) * 2 + var(--tg-bottom) + 16px);
  left: 12px; right: 12px;
  padding: 10px 13px; border-radius: var(--r);
  font-size: 0.82rem; font-weight: 700;
  background: var(--surface-up); border: 1px solid var(--stroke);
  z-index: 99;
}
.toast.ok { border-color: var(--lime-lo); }
.toast.err { border-color: var(--err); }
.hidden { display: none !important; }

/* ── Loader ── */
.loader-logo {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--lime); color: var(--lime-ink);
}
.loader-logo .ico-svg { width: 26px; height: 26px; }
.loader-bar { width: 90px; height: 3px; background: var(--stroke); border-radius: 99px; overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 35%; background: var(--lime); animation: loadSlide 1s ease-in-out infinite; }
@keyframes loadSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }
.loader-text { font-size: 0.66rem; font-weight: 800; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin: 0; }

/* ── Меню ── */
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--stroke);
  cursor: pointer; font-weight: 700; font-size: 0.9rem;
}
.menu-list li:last-child { border-bottom: none; }
.menu-ico {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--surface-up); color: var(--lime);
  border: 1px solid var(--stroke); flex-shrink: 0;
}
.menu-ico .ico-svg { width: 16px; height: 16px; }
.menu-list .menu-label { flex: 1; }
.menu-list .arrow { opacity: 0.3; }

details.how {
  margin-bottom: 10px; border-radius: var(--r);
  border: 1px solid var(--stroke); background: var(--surface);
}
details.how summary {
  padding: 11px 12px; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
}
details.how summary::-webkit-details-marker { display: none; }
details.how .how-body { padding: 0 12px 12px; font-size: 0.74rem; color: var(--muted); line-height: 1.55; font-weight: 600; }

.panel-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.8rem; font-weight: 700; color: var(--lime);
  background: none; border: none; padding: 0 0 10px; font-family: inherit; cursor: pointer;
}
.panel-back .ico-svg { width: 13px; height: 13px; }

/* ── Profile wizard ── */
.wizard-steps {
  display: flex; gap: 6px; margin-bottom: 14px;
}
.wiz-step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: 0.4;
}
.wiz-step.done, .wiz-step.active { opacity: 1; }
.wiz-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 900;
  background: var(--surface-up); border: 1px solid var(--stroke); color: var(--muted);
}
.wiz-step.done .wiz-dot { background: var(--lime-dim); border-color: var(--lime-lo); color: var(--lime); }
.wiz-step.active .wiz-dot { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.wiz-label { font-size: 0.48rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.wiz-step.active .wiz-label { color: var(--lime); }

.wizard-hint {
  font-size: 0.74rem; font-weight: 600; color: var(--text-2);
  margin: 0 0 10px; line-height: 1.4;
}

.profile-meta { flex: 1; min-width: 0; }
.profile-tag { font-size: 0.95rem; font-weight: 800; margin: 0 0 2px; color: var(--text); }
.profile-nick { font-size: 0.78rem; font-weight: 600; margin: 0 0 4px; color: var(--text-2); }
.profile-status { font-size: 0.72rem; font-weight: 700; margin: 0; color: var(--lime); }
.profile-status:empty { display: none; }

#profile-verify-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--stroke); }
#profile-verify-block .action { margin-top: 8px; }

.verify-icon-wrap { margin-top: 10px; }
.verify-tag-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}
.verify-tag-row input { margin: 0; }
.verify-tag-row .action { margin: 0; padding: 10px 12px; white-space: nowrap; }
.verify-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: var(--surface-up);
}
.verify-icon-card.featured {
  border-color: var(--lime-lo);
  background: var(--lime-dim);
}
.verify-icon-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.bs-icon-frame {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 16px;
  overflow: hidden;
  background: #0f1420;
  border: 2px solid var(--lime-lo);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.bs-icon-frame.lg { width: 96px; height: 96px; border-radius: 18px; }
.bs-icon-frame.sm { width: 72px; height: 72px; border-radius: 14px; }
.bs-icon-frame.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--lime);
}
.bs-icon-frame.plain {
  border: none;
  box-shadow: none;
  background: transparent;
}
.bs-icon-frame.plain.lg { border-radius: 18px; }
.bs-account-avatar-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
}
.bs-account-avatar-wrap .bs-profile-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  transform: scale(1.12);
}
.bs-profile-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}
.bs-icon-frame.plain .bs-profile-icon {
  object-fit: cover;
  border-radius: inherit;
}
.bs-profile-icon.broken { opacity: 0.35; }

.verify-icon-caption {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  line-height: 1.35;
}
.verify-check-result { margin-top: 10px; }
.verify-compare {
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: var(--surface-up);
}
.verify-compare.ok { border-color: var(--lime-lo); background: var(--lime-dim); }
.verify-compare.fail { border-color: rgba(224, 96, 96, 0.35); background: rgba(224, 96, 96, 0.08); }
.verify-compare-icons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.verify-compare-icons .verify-icon-card { padding: 10px; }
.verify-check-msg {
  margin: 10px 0 0;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-2);
}

.verify-flow-steps {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
}
.verify-flow-steps li { margin-bottom: 4px; }
.verify-flow-steps strong { color: var(--text-2); }

.profile-game-accounts { margin-top: 4px; }
.field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.platform-profile-card { padding: 0; overflow: hidden; position: relative; }
.profile-edit-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.profile-edit-btn:active { opacity: 0.85; }
.profile-edit-btn .ico-svg { width: 18px; height: 18px; }
.platform-profile-banner {
  position: relative;
  min-height: 132px;
  padding: 18px 16px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-end;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.platform-profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(198, 255, 61, 0.18), transparent 45%);
  pointer-events: none;
}
.platform-profile-avatar {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #111;
  border: 3px solid rgba(255,255,255,0.12);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  background: linear-gradient(135deg, #667eea, #764ba2);
  flex-shrink: 0;
}
.platform-profile-meta { position: relative; z-index: 1; min-width: 0; padding-bottom: 2px; }
.platform-display-name {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.platform-display-sub {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.preset-chip {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 8px;
  background: var(--surface-up);
  cursor: pointer;
  text-align: center;
}
.preset-chip.active { border-color: var(--lime); box-shadow: 0 0 0 1px rgba(198,255,61,0.25); }
.preset-chip-preview {
  height: 42px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.preset-chip-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #111;
}
.preset-chip-label { font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.editor-bs-row {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.editor-bs-status { margin: 0; font-size: 0.82rem; color: var(--text-2); }
.editor-bs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.game-accounts-label {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.bs-account-card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--r) + 4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.bs-account-card.loading { min-height: 120px; display: flex; align-items: center; justify-content: center; }
.bs-account-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.bs-account-meta { flex: 1; min-width: 0; }
.bs-account-game {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(26, 111, 212, 0.28);
  border: 1px solid rgba(120, 180, 255, 0.25);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fd0ff;
}
.bs-account-name {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-account-tag {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}
.bs-verified-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lime-dim);
  border: 1px solid var(--lime-lo);
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 900;
}
.bs-account-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.bs-stat {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 68px;
}
.bs-stat.featured {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  min-height: auto;
  justify-content: flex-start;
  flex-direction: row;
}
.bs-stat-featured-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bs-stat-featured-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  text-transform: none;
  line-height: 1.2;
}
.bs-stat-featured-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.bs-stat:not(.featured) .label {
  display: block;
  margin-bottom: 2px;
  min-height: 2.4em;
  line-height: 1.2;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bs-stat.featured .label {
  margin: 0;
  min-height: 0;
  line-height: 1.2;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bs-stat .value {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
}
.bs-account-club {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(26, 111, 212, 0.12);
  border: 1px solid rgba(120, 180, 255, 0.22);
  font-size: 0.82rem;
  font-weight: 700;
  color: #dbeafe;
}
.bs-account-club span {
  display: block;
  margin-bottom: 2px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fd0ff;
}
.bs-account-note {
  margin: 12px 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}
.bs-top-brawlers { margin-top: 12px; }
.bs-top-brawlers-label {
  margin: 0 0 8px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bs-top-brawlers-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.bs-brawler-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}
.bs-brawler-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
}
.bs-brawler-icon-wrap.sm {
  width: 44px;
  height: 44px;
}
.bs-brawler-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 12px;
}
.bs-brawler-icon-wrap.sm img {
  border-radius: 12px;
}
.bs-brawler-name {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  text-transform: none;
}
.bs-brawler-trophies {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--lime);
}
.bs-account-link {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--lime-lo);
  background: rgba(198, 255, 61, 0.08);
  color: var(--lime);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.bs-account-link:active { opacity: 0.88; transform: scale(0.99); }

.filter-group { margin-bottom: 10px; }
.filter-group:last-of-type { margin-bottom: 12px; }
.filter-label {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Lobby ── */
.lobby-card .lobby-code-wrap { margin-top: 10px; }
.lobby-card .btn-row .action { padding: 9px 12px; font-size: 0.78rem; }
.lobby-card #btn-lobby-submit-code,
.lobby-card #btn-lobby-start,
.lobby-card #btn-lobby-confirm { padding: 10px 14px; font-size: 0.84rem; }

/* ── Фильтры каталога ── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface-up);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip.active {
  background: var(--lime-dim);
  border-color: var(--lime-lo);
  color: var(--lime);
}

/* ── Выбор дисциплины ── */
.discipline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.discipline-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 12px 10px;
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: var(--surface-up);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.discipline-tile:active { opacity: 0.9; transform: scale(0.98); }
.discipline-tile.soon {
  opacity: 0.45;
  cursor: default;
  position: relative;
}
.discipline-tile .menu-ico { color: var(--lime); }
.discipline-tile .menu-ico .ico-svg { width: 22px; height: 22px; }
.disc-soon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ── Новости недели ── */
.news-card { margin-bottom: 12px; padding-bottom: 10px; }
.news-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.news-card-head .section-title { margin: 0; }
.news-week-badge {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lime);
  background: var(--lime-dim);
  border: 1px solid var(--lime-lo);
}
.news-feed { display: flex; flex-direction: column; gap: 12px; }
.news-feed-compact { gap: 8px; }

.news-item {
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: var(--surface-up);
  overflow: hidden;
}
.news-item.featured {
  border-color: rgba(163, 203, 56, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.news-item-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.news-item-btn:active { opacity: 0.94; }

.news-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}
.news-item.featured .news-media { aspect-ratio: 2 / 1; }
.news-item.compact .news-media { aspect-ratio: 2.4 / 1; }
.news-media img,
.news-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-media-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.82) 100%);
  pointer-events: none;
}
.news-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lime-ink);
  background: var(--lime);
}
.news-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-size: 0.9rem;
  padding-left: 3px;
}
.news-media-text {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  padding: 10px;
}

.news-body { padding: 11px 12px 12px; }
.news-item.compact .news-body { padding: 9px 10px 10px; }
.news-title {
  margin: 0 0 5px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.news-item.compact .news-title { font-size: 0.8rem; margin-bottom: 3px; }
.news-excerpt {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item.compact .news-excerpt {
  font-size: 0.7rem;
  -webkit-line-clamp: 1;
  margin-bottom: 6px;
}
.news-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--muted);
}
.news-source {
  color: var(--lime-hi);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.news-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text);
}
.news-link-ico { display: inline-flex; opacity: 0.45; }
.news-link-ico .ico-svg { width: 12px; height: 12px; transform: rotate(-90deg); }

.news-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.news-rail::-webkit-scrollbar { display: none; }
.news-rail .news-item {
  flex: 0 0 min(78%, 280px);
  scroll-snap-align: start;
}

.news-stack { display: flex; flex-direction: column; gap: 8px; }
.news-empty {
  margin: 0;
  padding: 14px 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

body.theme-light .news-item { background: #fff; }
body.theme-light .news-media-shade {
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

/* ── Кликабельные карточки ── */
.is-clickable { cursor: pointer; }
.is-clickable:active { opacity: 0.92; }

/* ── Страница турнира ── */
.tournament-page-card { padding: 0; overflow: hidden; }
.tournament-map {
  height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.tournament-map-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
}
.tournament-head {
  display: flex;
  gap: 10px;
  padding: 12px;
  align-items: flex-start;
}
.tournament-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.2;
}
.tournament-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 12px;
}
.tournament-stat {
  background: var(--surface-up);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
.tournament-stat .label {
  display: block;
  font-size: 0.48rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}
.tournament-stat .value {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--lime-hi);
}
.tournament-stat .value-sm { font-size: 0.68rem; font-weight: 700; color: var(--text); }
.tournament-page-card .section-title,
.tournament-page-card .rules-list,
.tournament-page-card .participants-list,
.tournament-page-card .info-box,
.tournament-page-card .t-fill,
.tournament-page-card .action {
  margin-left: 12px;
  margin-right: 12px;
}
.tournament-page-card .action { margin-bottom: 12px; }
.rules-list {
  margin: 0 12px 0;
  padding-left: 18px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.55;
}

/* ── Список участников ── */
.participants-list {
  list-style: none;
  padding: 0;
  margin: 0 12px 12px;
}
.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--stroke);
  cursor: pointer;
}
.participant-row:last-child { border-bottom: none; }
.participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-up);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--lime);
  flex-shrink: 0;
}
.participant-meta { flex: 1; min-width: 0; }
.participant-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
}
.participant-tag {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Модалки ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.65);
}
.modal-overlay.hidden { display: none !important; }
.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: min(82vh, calc(var(--app-vh, 100dvh) * 0.82));
  overflow-y: auto;
  margin-bottom: max(var(--tg-bottom), env(safe-area-inset-bottom, 0px));
  padding: 16px 14px 20px;
  border: 1px solid var(--stroke);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  background: var(--surface);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--surface-up);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.modal-body { margin-bottom: 12px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-actions .action { margin-top: 0; }

/* ── Поддержка ── */
body.support-tab-active .app-scroll {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.support-tab-active #panel-support.active {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.support-tab-active .support-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}
body.support-tab-active #support-list-view:not(.hidden),
body.support-tab-active #support-new-view:not(.hidden),
body.support-tab-active #support-chat-view:not(.hidden) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#support-chat-view .support-chat {
  flex: 1 1 auto;
  min-height: 120px;
}
.support-new-attach-row {
  margin: 8px 0;
}
.support-intro {
  flex-shrink: 0;
  margin-bottom: 10px;
}
.support-chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin-bottom: 0;
  padding: 10px;
  background: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
}
.support-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke);
}
.support-compose {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.support-compose-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.support-compose-row textarea { flex: 1; min-width: 0; }
.support-attach-btn {
  flex: 0 0 auto;
  min-width: 56px;
  width: 56px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface-up);
  cursor: pointer;
  color: var(--lime);
  transition: border-color 0.15s, background 0.15s;
}
.support-attach-btn:active {
  background: var(--ink);
}
.support-attach-btn-wide {
  width: auto;
  min-width: 112px;
  padding: 0 16px;
  gap: 10px;
  justify-content: flex-start;
}
.support-attach-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.support-attach-ico .ico-svg {
  width: 24px;
  height: 24px;
}
.support-attach-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.support-attach-preview {
  position: relative;
  flex-shrink: 0;
  max-height: min(132px, 22vh);
  overflow: hidden;
  padding: 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: var(--surface-up);
}
.support-attach-preview.hidden { display: none !important; }
.support-attach-preview .chat-media,
.support-attach-preview img,
.support-attach-preview video {
  display: block;
  max-height: 116px;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}
.support-attach-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.65);
  color: #fff;
  cursor: pointer;
}
.support-load-hint {
  text-align: center;
  padding: 6px 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.support-load-btn {
  border: 1px solid var(--stroke);
  background: var(--surface-up);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.support-load-btn:active {
  background: var(--ink);
}
.chat-author {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--lime);
  margin-bottom: 4px;
  opacity: 0.9;
}
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-media {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 6px;
}
.chat-bubble time {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 500;
}
.support-compose .action { margin-top: 0; }
.support-compose textarea { margin: 0; resize: none; }

.support-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.support-list-head .section-title { margin: 0; }
.support-appeals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.support-appeal-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border, #2a2a2a);
  background: var(--card-2, #141414);
  border-radius: 12px;
  padding: 12px;
  color: inherit;
  cursor: pointer;
}
.support-appeal-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.support-appeal-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.support-appeal-id {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}
.support-appeal-head time {
  font-size: 0.72rem;
  opacity: 0.65;
  white-space: nowrap;
}
.support-status {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}
.support-status-waiting {
  color: #ffb020;
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 176, 32, 0.25);
}
.support-status-answered {
  color: var(--lime);
  background: var(--lime-dim);
  border: 1px solid var(--lime-lo);
}
.support-status-closed {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
}
.support-closed-hint {
  margin-top: 8px;
}
.support-chat-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}
.support-appeal-preview {
  font-size: 0.85rem;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-chat-head {
  margin: 8px 0 12px;
}
#support-chat-footer.hidden { display: none !important; }
.chat-bubble {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.chat-bubble.mod {
  background: var(--surface-up);
  color: var(--text-2);
  border: 1px solid var(--stroke);
}
.chat-bubble.user {
  margin-left: auto;
  background: var(--lime-dim);
  color: var(--lime);
  border: 1px solid var(--lime-lo);
}
textarea {
  width: 100%;
  padding: 11px 12px;
  margin: 5px 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--stroke);
  background: var(--surface-up);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--lime); }

/* ── Настройки ── */
.settings-list li.danger .menu-label { color: var(--err); }
.settings-list li.danger .menu-ico { color: var(--err); }
.setting-value {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.social-links li.disabled { opacity: 0.45; cursor: default; }
.link-status {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
#profile-bs-hint.ok { color: var(--lime); }

/* ── Анимация переключения темы ── */
.theme-flash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 20%, var(--flash-to, transparent) 0%, transparent 72%);
}
body.theme-switching .theme-flash {
  animation: theme-flash-pulse 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
body.theme-switching,
body.theme-switching .app-top,
body.theme-switching .card,
body.theme-switching .bottom-nav,
body.theme-switching .t-card {
  transition:
    background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
@keyframes theme-flash-pulse {
  0% { opacity: 0; transform: scale(0.98); }
  28% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}

/* ── Светлая тема ── */
body.theme-light {
  --ink: #f2f2f2;
  --surface: #ffffff;
  --surface-up: #f7f7f7;
  --stroke: #e0e0e0;
  --stroke-lo: #ebebeb;
  --text: #111111;
  --text-2: #555555;
  --muted: #888888;
  --lime-ink: #1a1a1a;
}
body.theme-light .bg-glow,
body.theme-light .bg-glow-bottom { opacity: 0.35; }
body.theme-light .bottom-nav { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

