:root {
  --m-bg: #070a12;
  --m-surface: #12182a;
  --m-surface2: #1a2238;
  --m-border: rgba(148, 163, 184, 0.12);
  --m-text: #eef2ff;
  --m-muted: #94a3b8;
  --m-accent: #7c6cff;
  --m-accent2: #3dd6f5;
  --m-top: 52px;
  --m-tab: calc(56px + env(safe-area-inset-bottom, 0px));
  --m-fab: 56px;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--m-text);
  background: var(--m-bg);
  -webkit-tap-highlight-color: transparent;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--m-tab) + 12px);
}
body.m-body--sub { padding-bottom: env(safe-area-inset-bottom, 16px); }

.m-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(124, 108, 255, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(61, 214, 245, 0.08), transparent),
    var(--m-bg);
}

.m-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--m-top);
  padding: 0 1rem;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--m-border);
}
.m-topbar--sub { justify-content: flex-start; }
.m-topbar__title { font-weight: 700; font-size: 1rem; flex: 1; text-align: center; }
.m-topbar__spacer { width: 48px; }
.m-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--m-text);
  font-weight: 800;
  font-size: 1.05rem;
}
.m-brand img { border-radius: 10px; }
.m-topbar__cta {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--m-accent), #5b4fd6);
  color: #fff;
  text-decoration: none;
}
.m-back {
  color: var(--m-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0;
}

.m-main {
  padding: calc(var(--m-top) + 0.75rem) 1rem 1rem;
  max-width: 480px;
  margin: 0 auto;
}
.m-main--sub { padding-top: calc(var(--m-top) + 0.5rem); }

.m-panel { display: none; animation: mFade 0.2s ease; }
.m-panel--active { display: block; }
@keyframes mFade { from { opacity: 0; transform: translateY(6px); } }

.m-hero {
  background: linear-gradient(145deg, rgba(124, 108, 255, 0.14), rgba(26, 34, 56, 0.9));
  border: 1px solid rgba(124, 108, 255, 0.25);
  border-radius: 20px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.m-hero--compact { margin-bottom: 0.75rem; }
.m-hero h1 {
  margin: 0.5rem 0 0.65rem;
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.m-hero h1 span {
  background: linear-gradient(135deg, #c4b5fd, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.m-hero p { margin: 0 0 1rem; color: var(--m-muted); font-size: 0.92rem; line-height: 1.55; }

.m-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--m-muted);
}
.m-pill--live { color: #86efac; background: rgba(34, 197, 94, 0.12); }
.m-pill--off { color: #fca5a5; background: rgba(239, 68, 68, 0.1); }

.m-scroll-x {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.m-scroll-x::-webkit-scrollbar { display: none; }
.m-chip {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.m-section-title {
  margin: 1.25rem 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.m-lead { margin: 0 0 1rem; color: var(--m-muted); font-size: 0.9rem; line-height: 1.5; }

.m-cards {
  display: grid;
  gap: 0.65rem;
}
.m-cards--single { margin-bottom: 0.5rem; }
.m-card {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 16px;
  padding: 1rem;
}
.m-card--flat { margin-top: 0.5rem; }
.m-card--accent {
  border-color: rgba(124, 108, 255, 0.35);
  background: linear-gradient(145deg, rgba(124, 108, 255, 0.1), var(--m-surface));
}
.m-card__ico { font-size: 1.35rem; display: block; margin-bottom: 0.35rem; }
.m-card h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.m-card p { margin: 0 0 0.65rem; font-size: 0.85rem; color: var(--m-muted); line-height: 1.45; }
.m-card p:last-child { margin-bottom: 0; }
.m-card code { font-size: 0.8em; color: #c4b5fd; }

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s;
}
.m-btn:active { filter: brightness(0.92); }
.m-btn--primary { background: linear-gradient(135deg, var(--m-accent), #5b4fd6); color: #fff; }
.m-btn--ghost { background: transparent; border: 1px solid var(--m-border); color: var(--m-text); }
.m-btn--block { width: 100%; }
.m-btn--sm { padding: 0.5rem 0.85rem; font-size: 0.82rem; }

.m-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.m-stat {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 14px;
  padding: 0.75rem 0.5rem;
  text-align: center;
}
.m-stat__val { display: block; font-size: 1.15rem; font-weight: 800; }
.m-stat__lbl { font-size: 0.68rem; color: var(--m-muted); }

.m-leaderboard {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.m-leaderboard li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--m-border);
  font-size: 0.88rem;
  line-height: 1.4;
}
.m-leaderboard li:last-child { border-bottom: none; }
.m-leaderboard__empty { color: var(--m-muted); text-align: center; }
.m-leaderboard strong { color: var(--m-text); }
.m-leaderboard small { color: var(--m-muted); display: block; font-size: 0.78rem; }

.m-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--m-surface2);
  border: 1px solid var(--m-border);
  color: var(--m-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.m-link-card__arrow { color: var(--m-accent); }

.m-steps {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--m-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}
.m-steps li { margin-bottom: 0.5rem; }
.m-steps strong { color: var(--m-text); }

.m-faq {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.m-faq summary {
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
}
.m-faq summary::-webkit-details-marker { display: none; }
.m-faq p {
  margin: 0;
  padding: 0 1rem 0.85rem;
  font-size: 0.85rem;
  color: var(--m-muted);
  line-height: 1.5;
}

.m-cmd-search { margin-bottom: 0.75rem; }
.m-cmd-search input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--m-border);
  background: var(--m-surface);
  color: var(--m-text);
  font: inherit;
  font-size: 0.9rem;
}
.m-cmd-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.m-cmd-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--m-border);
  font-size: 0.88rem;
}
.m-cmd-list code {
  color: #a5b4fc;
  font-weight: 700;
}
.m-cmd-list span { display: block; color: var(--m-muted); font-size: 0.8rem; margin-top: 0.15rem; }

.m-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.m-links a {
  display: block;
  padding: 0.75rem 0;
  color: var(--m-text);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--m-border);
}
.m-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--m-muted);
  line-height: 1.5;
}
.m-note a { color: #a5b4fc; }

.m-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--m-muted);
  padding-bottom: 1rem;
}

.m-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--m-tab);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(7, 10, 18, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--m-border);
}
.m-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  border: none;
  background: transparent;
  color: var(--m-muted);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem;
}
.m-tab__ico { font-size: 1.2rem; line-height: 1; }
.m-tab--active { color: #c4b5fd; }
.m-tab--active .m-tab__ico { transform: scale(1.08); }

.m-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--m-tab) + 0.75rem);
  z-index: 40;
  width: var(--m-fab);
  height: var(--m-fab);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--m-accent), #5b4fd6);
  box-shadow: 0 8px 28px rgba(124, 108, 255, 0.45);
  display: grid;
  place-items: center;
  text-decoration: none;
}
.m-fab img { border-radius: 50%; }

.m-feed { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1rem; }
.m-feed__item {
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 14px;
  padding: 0.85rem;
}
.m-feed__item h4 { margin: 0 0 0.25rem; font-size: 0.92rem; }
.m-feed__item time { font-size: 0.72rem; color: var(--m-muted); }
.m-feed__item p { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--m-muted); line-height: 1.45; }
.m-feed__empty { color: var(--m-muted); font-size: 0.88rem; text-align: center; padding: 1rem; }

.m-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.m-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--m-muted);
  font-weight: 600;
}
.m-form input,
.m-form textarea {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--m-border);
  background: var(--m-surface);
  color: var(--m-text);
  font: inherit;
  font-size: 0.9rem;
}
.m-form__status { font-size: 0.85rem; margin: 0; }
.m-form__status--ok { color: #86efac; }
.m-form__status--bad { color: #fca5a5; }

@media (min-width: 520px) {
  .m-cards { grid-template-columns: 1fr 1fr; }
  .m-cards--single { grid-template-columns: 1fr; }
}
