/* ===== Game Lunev Pro — Design Tokens ===== */
:root {
  --bg: #0d0f1a;
  --bg-alt: #121524;
  --surface: #1a1e34;
  --surface-hover: #212646;
  --border: #2a2f4d;

  --accent: #7c5cff;
  --accent-soft: #a48bff;
  --accent-2: #ffb648;
  --success: #4ade80;
  --danger: #ff5c7a;

  --text: #f2f1f8;
  --text-muted: #8b8fa8;
  --text-dim: #5c6083;

  --glow-1: rgba(124, 92, 255, 0.14);
  --glow-2: rgba(255, 182, 72, 0.08);

  --navbar-bg: rgba(13, 15, 26, 0.85);

  --font-display: 'Chakra Petch', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-lift: 0 20px 40px -20px rgba(124, 92, 255, 0.35);
}

/* ===== Светлая тема ===== */
[data-theme="light"] {
  --bg: #f4f5fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-hover: #eef0f8;
  --border: #e0e2ee;

  --accent: #6b46e5;
  --accent-soft: #7c5cff;
  --accent-2: #e08a00;
  --success: #16a34a;
  --danger: #e0355a;

  --text: #1a1d2e;
  --text-muted: #5c6178;
  --text-dim: #9498ac;

  --glow-1: rgba(124, 92, 255, 0.08);
  --glow-2: rgba(255, 182, 72, 0.05);

  --navbar-bg: rgba(255, 255, 255, 0.85);

  --shadow-lift: 0 20px 40px -24px rgba(124, 92, 255, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, var(--glow-1), transparent 45%),
    radial-gradient(circle at 90% 20%, var(--glow-2), transparent 40%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* main растягивается, прижимая футер к низу на коротких страницах */
body > main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
  border-bottom: 1px solid var(--border);
  background: var(--navbar-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo {
  height: 38px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}
.brand-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transform: rotate(45deg);
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  font-size: 0.92rem;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--surface);
}
.nav-links a.cta {
  background: var(--accent);
  color: #fff;
}
.nav-links a.cta:hover { background: var(--accent-soft); }

/* ===== Бургер-меню (мобильная навигация) ===== */
.navbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
}
.navbar-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
}
.navbar-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navbar-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
  z-index: 90;
}
.nav-backdrop.open { opacity: 1; visibility: visible; }

@media (max-width: 860px) {
  .navbar-burger { display: flex; }
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(82vw, 320px);
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 96px 18px 24px;
    transform: translateX(100%);
    transition: transform .26s ease;
    z-index: 100;
    overflow-y: auto;
    font-size: 1rem;
  }
  .nav-links.open { transform: translateX(0); box-shadow: -24px 0 60px -20px rgba(0, 0, 0, 0.55); }
  .nav-links a {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }
  .nav-links a.cta { text-align: center; margin-top: 6px; }
  .nav-links .theme-toggle {
    margin-top: 14px;
    align-self: flex-start;
    width: auto;
    padding: 0 16px;
    height: 42px;
    gap: 8px;
  }
  .nav-links .theme-toggle::after {
    content: 'Сменить тему';
    font-size: 0.9rem;
    font-family: var(--font-body);
  }
  body.menu-open { overflow: hidden; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-lift); }
.btn-primary:hover { background: var(--accent-soft); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent-soft); color: var(--accent-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }

/* ===== Hero ===== */
.hero {
  padding: 72px 0 56px;
  text-align: center;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.hero-eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--accent-2);
  border-radius: 50%;
  animation: blink 1.4s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 14px;
}
.hero h1 span { color: var(--accent-soft); }
.hero p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 30px;
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero-stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text);
}
.hero-stat span {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Section ===== */
.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-head h2 { font-size: 1.6rem; }
.section-head p { color: var(--text-muted); margin: 4px 0 0; font-size: 0.95rem; }

/* ===== Category tabs ===== */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}
.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: background .15s, color .15s, border-color .15s;
}
.category-tab:hover { color: var(--text); border-color: var(--accent-soft); }
.category-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.category-tab-count {
  font-size: 0.75rem;
  opacity: 0.75;
}

/* ===== Platform links (Google Play / RuStore / App Store / Steam) ===== */
.platform-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 22px;
}
.platform-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.platform-link:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.platform-link::before { font-size: 1rem; }
.platform-link-google_play::before { content: "▶"; color: #34a853; }
.platform-link-rustore::before { content: "◆"; color: #0077ff; }
.platform-link-appstore::before { content: "◇"; color: #a2aaad; }
.platform-link-steam::before { content: "●"; color: #66c0f4; }

/* ===== Game cards (cartridge style) ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  transform: translateY(-6px) rotate(-0.6deg);
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-lift);
}
.game-card-cover {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--surface-hover), var(--bg-alt));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-dim);
  position: relative;
  overflow: hidden;
}
.game-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.game-card-body h3 { font-size: 1.05rem; margin-bottom: 6px; }
.game-card-body p {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex: 1;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Cards / panels ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-soft);
}
textarea.form-control { resize: vertical; min-height: 90px; }

.auth-shell {
  max-width: 420px;
  margin: 60px auto;
  padding: 0 24px;
}
.auth-shell .panel { padding: 32px; }
.auth-shell h1 { font-size: 1.6rem; text-align: center; }
.auth-shell .sub { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 26px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--text-muted); }
.auth-switch a { color: var(--accent-soft); }

/* ===== Flash messages ===== */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }
.flash-success { background: rgba(74, 222, 128, 0.12); border: 1px solid rgba(74, 222, 128, 0.35); color: var(--success); }
.flash-error { background: rgba(255, 92, 122, 0.12); border: 1px solid rgba(255, 92, 122, 0.35); color: var(--danger); }
.flash-info { background: rgba(124, 92, 255, 0.12); border: 1px solid rgba(124, 92, 255, 0.35); color: var(--accent-soft); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th, table.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--surface); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface-hover);
  color: var(--text-muted);
}
.rank-badge.gold { background: rgba(255, 182, 72, 0.18); color: var(--accent-2); }
.rank-badge.silver { background: rgba(200, 205, 225, 0.18); color: #c8cde1; }
.rank-badge.bronze { background: rgba(200, 120, 70, 0.18); color: #d4966a; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-active { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge-inactive { background: rgba(139, 143, 168, 0.15); color: var(--text-dim); }
.badge-admin { background: rgba(255, 182, 72, 0.15); color: var(--accent-2); }

/* ===== Achievement cards ===== */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ach-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: flex-start;
}
.ach-card.locked { opacity: 0.45; }
.ach-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  color: #fff;
  flex-shrink: 0;
}
.ach-card.locked .ach-icon { background: var(--surface-hover); color: var(--text-dim); }
.ach-title { font-weight: 600; font-size: 0.95rem; }
.ach-desc { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.ach-points { color: var(--accent-2); font-family: var(--font-mono); font-size: 0.78rem; margin-top: 6px; }

/* ===== Profile ===== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #0d0f1a;
  font-weight: 700;
}
.stats-row { display: flex; gap: 28px; flex-wrap: wrap; margin: 24px 0; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  min-width: 140px;
}
.stat-box b { display: block; font-family: var(--font-mono); font-size: 1.4rem; }
.stat-box span { color: var(--text-muted); font-size: 0.8rem; }

/* ===== Game page ===== */
.game-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.game-frame-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  min-height: 260px;
}
.game-frame-wrap iframe { width: 100%; height: 100%; display: block; border: 0; }

/* Полноэкранный режим через нативный Fullscreen API */
.game-frame-wrap:fullscreen,
.game-frame-wrap:-webkit-full-screen {
  aspect-ratio: unset;
  max-height: none;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: 0;
}
/* Резервный вариант для браузеров без Fullscreen API на произвольных элементах (напр. старый iOS Safari) */
.game-frame-wrap.game-fullscreen-fallback {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  aspect-ratio: unset;
  border-radius: 0;
  border: 0;
  z-index: 9999;
}
body.game-fullscreen-lock { overflow: hidden; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ===== Общая защита от горизонтального скролла ===== */
html, body { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
.container { width: 100%; }

/* Во флекс-контейнерах текстовые дочерние элементы по умолчанию не сжимаются
   меньше своего содержимого — это частая причина горизонтального скролла на мобильных
   (например, длинный ник игрока или e-mail). Разрешаем им сжиматься и переноситься. */
.section-head > div,
.profile-header > div,
.live-feed-text,
.ach-card > div:last-child,
.stat-box,
table.data-table td,
table.data-table th {
  min-width: 0;
}
.live-feed-text, .ach-desc, .ach-title, table.data-table td {
  overflow-wrap: anywhere;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .container { padding: 0 18px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 40px 0 36px; }
  .hero p { padding: 0 6px; }
  .hero-stats { gap: 22px; }
  .section { padding: 40px 0; }
  .section-head { margin-bottom: 20px; }
  .section-head h2 { font-size: 1.35rem; }
  .profile-header { flex-direction: column; text-align: center; }
  .stats-row { gap: 14px; }
  .stat-box { flex: 1 1 calc(50% - 14px); min-width: 130px; padding: 14px 16px; }
  .game-frame-wrap { aspect-ratio: 3 / 4; max-height: 72vh; min-height: 320px; }
  .game-toolbar { justify-content: center; }
  .panel { padding: 20px; }
  .auth-shell { margin: 32px auto; padding: 0 16px; }
  .auth-shell .panel { padding: 24px 20px; }

  /* Каталог игр — компактная 2-колоночная сетка под телефон */
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-card-cover { font-size: 1.5rem; }
  .game-card-body { padding: 12px; }
  .game-card-body h3 { font-size: 0.92rem; margin-bottom: 4px; }
  .game-card-body p { font-size: 0.76rem; margin-bottom: 10px; }
  .game-card-body .btn { padding: 8px 10px; font-size: 0.78rem; }

  .category-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 14px 0 20px; -webkit-overflow-scrolling: touch; }
  .category-tab { flex-shrink: 0; }

  .ach-grid { grid-template-columns: 1fr; }

  table.data-table th, table.data-table td { padding: 10px 10px; font-size: 0.85rem; }
  .live-feed-wrap { padding: 16px 18px; }
  .stats-row { justify-content: center; }
}

@media (max-width: 380px) {
  .games-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

/* ===== Переключатель темы ===== */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: color .15s, border-color .15s, background .15s;
  padding: 0;
}
.theme-toggle:hover { color: var(--accent-soft); border-color: var(--accent-soft); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="light"] .theme-toggle .icon-sun { display: inline; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

body { transition: background-color .25s ease, color .25s ease; }

/* ===== Декоративные плавающие фигуры в hero ===== */
.hero { position: relative; overflow: hidden; }
.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-shape {
  position: absolute;
  border-radius: 8px;
  opacity: 0.5;
  animation: float-shape 9s ease-in-out infinite;
}
.shape-1 {
  width: 46px; height: 46px;
  top: 14%; left: 8%;
  background: linear-gradient(135deg, var(--accent), transparent);
  transform: rotate(20deg);
  animation-duration: 10s;
}
.shape-2 {
  width: 30px; height: 30px;
  top: 62%; left: 14%;
  background: linear-gradient(135deg, var(--accent-2), transparent);
  border-radius: 50%;
  animation-duration: 8s;
  animation-delay: -2s;
}
.shape-3 {
  width: 38px; height: 38px;
  top: 20%; right: 10%;
  background: linear-gradient(135deg, var(--accent-2), transparent);
  transform: rotate(-15deg);
  animation-duration: 11s;
  animation-delay: -4s;
}
.shape-4 {
  width: 26px; height: 26px;
  top: 68%; right: 16%;
  background: linear-gradient(135deg, var(--accent), transparent);
  border-radius: 50%;
  animation-duration: 7s;
  animation-delay: -1s;
}
@keyframes float-shape {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-18px) rotate(var(--r, 0deg)); }
}
.hero .container { position: relative; z-index: 1; }

/* ===== Живая лента активности ===== */
.live-feed-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  max-width: 720px;
  margin: 0 auto;
}
.live-feed-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.live-feed-head h2 { font-size: 1rem; margin: 0; }
.live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: blink 1.6s infinite;
  flex-shrink: 0;
}
.live-feed-list { display: flex; flex-direction: column; gap: 2px; }
.live-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: background .15s;
}
.live-feed-item:hover { background: var(--surface-hover); }
.live-feed-icon { color: var(--accent-2); flex-shrink: 0; width: 16px; text-align: center; }
.live-feed-text { flex: 1; color: var(--text-muted); }
.live-feed-text b { color: var(--text); font-weight: 600; }
.live-feed-time { color: var(--text-dim); font-size: 0.78rem; white-space: nowrap; flex-shrink: 0; }

@media (max-width: 640px) {
  .hero-shape { display: none; } /* на мобильных фон проще — меньше отвлекающих деталей */
  .live-feed-time { display: none; }
  .live-feed-wrap { padding: 16px 18px; }
}

/* ===== Уточнения мобильной шапки и страницы игры ===== */
@media (max-width: 860px) {
  .navbar { z-index: 120; }
  .navbar-inner {
    min-height: 64px;
    padding: 9px 16px;
  }
  .brand {
    min-width: 0;
    font-size: 1.05rem;
    white-space: nowrap;
  }
  .brand-logo { height: 34px; max-width: 170px; }
  .navbar-burger {
    width: 44px;
    height: 44px;
    margin-left: 10px;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    position: relative;
    z-index: 132;
  }
  .navbar-burger span { width: 20px; height: 2px; }
  .nav-backdrop { z-index: 110; }
  .nav-links {
    z-index: 130;
    top: 64px;
    height: calc(100dvh - 64px);
    width: min(88vw, 340px);
    padding: 18px 16px 24px;
    border-top-left-radius: 22px;
    background: var(--bg-alt);
  }
  .nav-links.open { box-shadow: -18px 18px 45px rgba(0,0,0,.24); }
  .nav-links a {
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 13px 16px;
    border-radius: 14px;
  }
  .nav-links a.cta.auth-cta {
    justify-content: center;
    margin-top: 6px;
    background: var(--accent);
    color: #fff;
  }
}

@media (max-width: 640px) {
  .game-page-content {
    padding-left: 18px;
    padding-right: 18px;
  }
  .game-page-content .section-head p {
    line-height: 1.65;
  }
}
.category-tab-child { border-style: dashed; }


/* ===== Точечные мобильные исправления ===== */
.brand-dot {
  animation: brand-online 1.8s ease-in-out infinite;
}
@keyframes brand-online {
  0%, 100% { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
  45%, 65% { background: var(--success); box-shadow: 0 0 15px var(--success); }
}

.nav-close { display: none; }

@media (max-width: 860px) {
  .nav-backdrop {
    background: rgba(12, 14, 28, .52);
    backdrop-filter: blur(8px);
    z-index: 110;
  }
  .navbar { z-index: 120; }
  .nav-links { isolation: isolate; }
  .nav-links {
    inset: 0;
    top: 0;
    width: 100%;
    height: 100dvh;
    padding: 88px 24px 30px;
    border: 0;
    border-radius: 0;
    background: var(--bg-alt);
    align-items: center;
    justify-content: center;
    gap: 8px;
    transform: scale(.94);
    opacity: 0;
    visibility: hidden;
    transition: transform .25s ease, opacity .25s ease, visibility .25s ease;
    z-index: 140;
  }
  .nav-links.open {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
    box-shadow: none;
  }
  .nav-links a {
    width: min(100%, 420px);
    justify-content: center;
    min-height: 52px;
    font-size: 1.08rem;
    text-align: center;
  }
  .nav-links a.cta.auth-cta { width: min(100%, 420px); }
  .nav-links a.login-cta {
    background: var(--accent-2);
    color: #fff;
  }
  .nav-links a.login-cta:hover { filter: brightness(1.06); }
  .nav-links .theme-toggle {
    align-self: auto;
    justify-content: center;
    width: min(100%, 220px);
  }
  .nav-close {
    display: flex;
    position: absolute;
    top: 18px;
    right: 20px;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
  }
  .navbar-burger[aria-expanded="true"] { opacity: 0; pointer-events: none; }
}

@media (max-width: 640px) {
  .game-page-content {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  .game-page-content .section-head {
    display: block;
  }
  .game-page-content .section-head > div { width: 100%; }
  .game-page-content .section-head p {
    line-height: 1.65;
    overflow-wrap: anywhere;
  }
  .game-page-content .section-head > .btn { margin-top: 18px; }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 34px;
  }
  .hero-stat { min-width: 0; }
  .hero-stat b { font-size: 1.2rem; }
  .hero-stat span {
    display: block;
    font-size: .67rem;
    line-height: 1.25;
    letter-spacing: .03em;
    white-space: nowrap;
  }
}


/* Профиль: последние запущенные игры */
.profile-recent-games { margin-bottom: 34px; }
.recent-game-card { display:flex; flex-direction:column; gap:6px; text-decoration:none; }
.recent-game-card b { color:var(--text); }
.recent-game-card span { color:var(--text-muted); font-size:.86rem; }
.avatar img { width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block; }

/* Аватарки пользователя */
.avatar-default { background:#fff7d6; color:#303040; border:1px solid rgba(80,70,120,.12); box-shadow:0 8px 24px rgba(95,70,160,.10); }
.avatar-default span { line-height:1; filter:drop-shadow(0 3px 4px rgba(40,30,70,.12)); }
.avatar-sunny { background:linear-gradient(145deg,#fff9cf,#ffe6a8); }
.avatar-happy { background:linear-gradient(145deg,#e8fbff,#ccefff); }
.avatar-star { background:linear-gradient(145deg,#fff0fb,#ffd8f2); }
.avatar-rocket { background:linear-gradient(145deg,#eef0ff,#dfe5ff); }
.avatar-game { background:linear-gradient(145deg,#eaffea,#d4f8dc); }
.avatar-headset { background:linear-gradient(145deg,#fff3e7,#e9e4ff); }
.avatar-picker { display:flex; gap:12px; flex-wrap:wrap; }
.avatar-choice { cursor:pointer; position:relative; }
.avatar-choice input { position:absolute; opacity:0; pointer-events:none; }
.avatar-choice .avatar { width:58px; height:58px; font-size:1.65rem; transition:.15s ease; }
.avatar-choice input:checked + .avatar { outline:3px solid var(--accent); outline-offset:3px; transform:translateY(-2px); }

/* Любимые игры */
.game-card { position:relative; }
.game-card-main { color:inherit; text-decoration:none; display:flex; flex-direction:column; flex:1; }
.favorite-form { margin:0; }
.favorite-form-card { position:absolute; top:10px; right:10px; z-index:3; }
.favorite-btn { width:42px; height:42px; border-radius:50%; border:1px solid rgba(70,55,120,.14); background:rgba(255,255,255,.94); color:#8a7fa0; font-size:1.55rem; line-height:1; cursor:pointer; box-shadow:0 7px 20px rgba(35,25,70,.13); transition:.15s ease; }
.favorite-btn:hover { transform:scale(1.08); }
.favorite-btn.active { color:#ef4d78; background:#fff4f7; }
.favorite-games-grid { margin-bottom:34px; }
.game-page-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.favorite-page-btn { white-space:nowrap; }
.results-subtitle { margin:30px 0 14px; }
.result-best { margin-left:7px; background:#fff3c4; color:#765700; }

@media (max-width: 640px) {
  .favorite-btn { width:38px; height:38px; font-size:1.35rem; }
  .game-page-actions { width:100%; }
}

/* Рейтинги игроков */
.leaderboard-filters,.leaderboard-periods{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.leaderboard-periods{margin-top:-4px}
.player-rank-card{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 20px;padding:16px;border:1px solid var(--border);border-radius:18px;background:var(--card)}
.player-rank-card>div{display:flex;flex-direction:column;gap:3px;text-align:center}
.player-rank-card span{font-size:.82rem;color:var(--muted)}
.player-rank-card strong{font-size:1.35rem}
.leaderboard-player{display:flex;align-items:center;gap:10px;min-width:150px}
.leaderboard-avatar{width:34px;height:34px;border-radius:50%;overflow:hidden;display:grid;place-items:center;flex:0 0 34px;font-size:18px}
.leaderboard-avatar img{width:100%;height:100%;object-fit:cover}
.leaderboard-me td{background:rgba(124,92,255,.09);font-weight:600}
.leaderboard-player small{font-weight:500;color:var(--primary)}
@media(max-width:640px){
  .player-rank-card{gap:7px;padding:11px 8px}
  .player-rank-card span{font-size:.7rem}
  .player-rank-card strong{font-size:1.05rem}
  .leaderboard-table th,.leaderboard-table td{padding:10px 8px}
  .leaderboard-avatar{width:28px;height:28px;flex-basis:28px;font-size:15px}
}

/* Achievement images and secret state */
.ach-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.ach-card.unlocked { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.ach-card.secret .ach-title { letter-spacing: .01em; }
.ach-card.locked { opacity: .68; }
.ach-card.secret { background: linear-gradient(135deg, var(--surface), var(--surface-hover)); }


/* Этап 5: публичный профиль игрока */
.profile-header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.public-profile-shell{max-width:1100px}
.public-profile-header p{margin:4px 0 0;color:var(--text-muted)}
.public-profile-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.public-favorites-grid{margin-bottom:10px}
.privacy-toggle{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px solid var(--border);border-radius:14px;margin-bottom:16px;cursor:pointer;background:var(--surface)}
.privacy-toggle input{margin-top:4px;accent-color:var(--accent)}
.privacy-toggle span{display:flex;flex-direction:column;gap:3px}
.privacy-toggle small{color:var(--text-muted);line-height:1.45}
@media(max-width:640px){
  .profile-header-actions{width:100%;justify-content:center}
  .profile-header-actions .btn{flex:1}
  .public-profile-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
  .public-profile-stats .stat-box{padding:12px 5px}
  .public-profile-stats .stat-box b{font-size:1.15rem}
  .public-profile-stats .stat-box span{font-size:.68rem}
}

/* Этап 12: социальные функции */
.profile-social-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.profile-social-actions form{margin:0}.online-badge{font-size:.8rem;color:var(--text-muted);padding:6px 10px;border:1px solid var(--border);border-radius:999px}.online-badge.is-online{color:#168a4b;background:#ecfff4;border-color:#bde8ce}.social-stats{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:14px}.game-social-section{margin-top:42px}.social-form{display:grid;gap:12px;padding:18px;border:1px solid var(--border);border-radius:16px;background:var(--surface);margin-bottom:18px}.social-form label{display:grid;gap:6px}.social-form textarea,.report-box textarea{min-height:90px}.social-list{display:grid;gap:12px}.social-item{padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}.social-item p{margin:10px 0;line-height:1.6}.social-item-head{display:flex;justify-content:space-between;gap:12px;align-items:center}.social-item-head a{display:flex;align-items:center;gap:8px;color:inherit;text-decoration:none}.social-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;overflow:hidden;font-size:18px}.social-avatar img{width:100%;height:100%;object-fit:cover}.report-box{margin-top:9px;font-size:.82rem}.report-box summary{cursor:pointer;color:var(--text-muted)}.report-box form{display:grid;gap:7px;margin-top:8px;max-width:420px}.report-box input,.report-box textarea{width:100%}@media(max-width:640px){.profile-social-actions{width:100%}.profile-social-actions form,.profile-social-actions .btn{width:100%}.social-item-head{align-items:flex-start;flex-direction:column}}


/* Дополнение Этапа 12: современный интерфейс социальных функций */
.notification-bell{position:relative;display:inline-flex!important;align-items:center;justify-content:center;width:42px;height:42px;padding:0!important;border:1px solid var(--border);border-radius:13px;background:var(--surface);font-size:18px;text-decoration:none}.notification-bell:hover,.notification-bell.active{background:var(--surface-hover);border-color:color-mix(in srgb,var(--accent) 45%,var(--border))}.notification-bell b{position:absolute;right:-5px;top:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--accent);color:#fff;font:700 11px/20px var(--font-body);text-align:center;box-shadow:0 3px 10px rgba(79,55,190,.28)}
.game-social-section{display:grid;gap:28px}.game-social-section>.section-head{margin-bottom:-10px}.social-form{gap:16px;padding:22px;border-radius:22px;background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--surface) 92%,var(--accent) 8%));box-shadow:0 14px 40px rgba(35,25,70,.06)}.social-form label{font-weight:700;font-size:.9rem;color:var(--text)}.social-form input,.social-form select,.social-form textarea,.report-box input,.report-box select,.report-box textarea{appearance:none;width:100%;border:1px solid var(--border);border-radius:13px;background:var(--bg);color:var(--text);padding:12px 14px;font:500 .93rem/1.5 var(--font-body);outline:none;transition:border-color .15s,box-shadow .15s,background .15s}.social-form select{padding-right:42px;background-image:linear-gradient(45deg,transparent 50%,var(--text-muted) 50%),linear-gradient(135deg,var(--text-muted) 50%,transparent 50%);background-position:calc(100% - 19px) 50%,calc(100% - 13px) 50%;background-size:6px 6px,6px 6px;background-repeat:no-repeat}.social-form textarea,.report-box textarea{min-height:112px;resize:vertical}.social-form input:focus,.social-form select:focus,.social-form textarea:focus,.report-box input:focus,.report-box textarea:focus{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 14%,transparent);background:var(--surface)}.social-form .btn{justify-self:start;min-width:180px}.social-item{padding:19px;border-radius:19px;box-shadow:0 10px 30px rgba(35,25,70,.045)}.report-box{position:relative}.report-box>summary{display:inline-flex;align-items:center;gap:6px;list-style:none;padding:8px 11px;border-radius:10px;background:var(--surface-hover);font-weight:600}.report-box>summary::-webkit-details-marker{display:none}.report-box[open]>summary{color:var(--accent)}.report-box form{padding:14px;border:1px solid var(--border);border-radius:15px;background:var(--surface);box-shadow:0 12px 30px rgba(25,20,60,.08)}
.social-panel{margin:28px 0;padding:22px;border:1px solid var(--border);border-radius:22px;background:var(--surface);box-shadow:0 14px 42px rgba(35,25,70,.055)}.social-panel-title{display:flex;align-items:center;gap:12px;margin-bottom:18px}.social-panel-title>div{flex:1}.social-panel-title h2{margin:0 0 3px;font-size:1.12rem}.social-panel-title p{margin:0;color:var(--text-muted);font-size:.86rem}.social-panel-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:color-mix(in srgb,var(--accent) 11%,var(--surface));font-size:20px}.friends-count{display:grid;place-items:center;min-width:34px;height:34px;padding:0 8px;border-radius:999px;background:var(--surface-hover);font-weight:700}.friend-list,.notification-list{display:grid;gap:10px}.friend-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.friend-card{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px;border:1px solid var(--border);border-radius:17px;background:var(--bg);transition:transform .15s,border-color .15s,box-shadow .15s}.friend-card:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--accent) 34%,var(--border));box-shadow:0 10px 28px rgba(35,25,70,.07)}.friend-person,.friend-tile{color:inherit;text-decoration:none}.friend-person{display:flex;align-items:center;gap:11px;min-width:0}.friend-person span,.friend-tile span{display:flex;flex-direction:column;gap:2px;min-width:0}.friend-person small,.friend-tile small{color:var(--text-muted);font-size:.79rem}.friend-avatar{width:46px;height:46px;flex:0 0 46px;border-radius:15px;display:grid;place-items:center;overflow:hidden;font-size:23px}.friend-avatar img{width:100%;height:100%;object-fit:cover}.friend-actions{display:flex;gap:8px}.friend-actions form{margin:0}.friend-tile{justify-content:flex-start}.friend-tile.is-online{border-color:#afe2c5;background:linear-gradient(145deg,#f5fff9,var(--bg))}.friend-tile.is-online small{color:#168a4b;font-weight:700}.notification-card{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--border);border-radius:17px;color:inherit;text-decoration:none;background:var(--bg)}.notification-card.is-unread{border-color:color-mix(in srgb,var(--accent) 38%,var(--border));background:color-mix(in srgb,var(--accent) 7%,var(--surface))}.notification-copy{display:flex;flex-direction:column;gap:3px}.notification-copy small,.notification-copy time{color:var(--text-muted)}.notification-copy time{font-size:.75rem}.notification-glyph{display:grid;place-items:center;width:46px;height:46px;border-radius:15px;background:var(--surface-hover);font-size:21px}.empty-state.compact{padding:24px}
@media(max-width:760px){.friend-card.request-card{align-items:flex-start;flex-direction:column}.friend-actions{width:100%}.friend-actions form,.friend-actions .btn{flex:1;width:100%}.social-panel{padding:16px}.social-panel-title{align-items:flex-start;flex-wrap:wrap}.social-panel-title .btn{width:100%}.social-form .btn{width:100%;justify-self:stretch}.notification-bell{width:100%;justify-content:flex-start;padding:10px 14px!important;height:auto}.notification-bell b{position:static;margin-left:auto}.friend-grid{grid-template-columns:1fr}}


/* Этап 13.1: комнаты онлайн-игр */
.rooms-layout{display:grid;grid-template-columns:minmax(280px,360px) 1fr;gap:24px;align-items:start}.room-create-panel{position:sticky;top:88px;padding:22px;border-radius:22px}.room-create-panel h2,.room-create-panel h3{margin-top:0}.room-form{display:grid;gap:15px}.room-form label{display:grid;gap:7px;font-weight:700;font-size:.88rem}.room-form input,.room-form select,.room-join-code input,.room-filter select{width:100%;border:1px solid var(--border);border-radius:13px;background:var(--bg);color:var(--text);padding:12px 13px;font:500 .92rem var(--font-body);outline:none}.room-form input:focus,.room-form select:focus,.room-join-code input:focus,.room-filter select:focus{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 13%,transparent)}.room-form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.room-join-code{border-top:1px solid var(--border);margin-top:22px;padding-top:20px}.room-join-code form{display:grid;grid-template-columns:1fr auto;gap:8px}.room-filter{display:flex;justify-content:flex-end;margin-bottom:15px}.room-filter select{min-width:220px}.rooms-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:14px}.room-card{padding:19px;border:1px solid var(--border);border-radius:19px;background:var(--surface);box-shadow:0 10px 30px rgba(35,25,70,.045)}.room-card-head,.room-status-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.room-game{display:inline-flex;padding:6px 9px;border-radius:999px;background:color-mix(in srgb,var(--accent) 10%,var(--surface));color:var(--accent);font-size:.76rem;font-weight:700}.room-capacity{font:700 .8rem var(--font-mono);color:var(--text-muted)}.room-card h3{margin:15px 0 5px;font-size:1.08rem}.room-card p{margin:0 0 16px;color:var(--text-muted);font-size:.84rem}.room-card button:disabled{opacity:.5;cursor:not-allowed}.my-rooms{margin:0 0 22px}.my-rooms h2{font-size:1.05rem}.room-mini{display:flex;justify-content:space-between;gap:12px;padding:11px 14px;margin-bottom:8px;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:inherit;text-decoration:none}.room-mini span{color:var(--text-muted);font-size:.82rem}.room-detail{max-width:900px;margin:auto;padding:26px;border-radius:24px}.room-detail-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.room-detail-head h1{margin:12px 0 6px}.room-detail-head p{color:var(--text-muted)}.room-detail-head code{padding:4px 8px;border-radius:8px;background:var(--surface-hover);font:700 .9rem var(--font-mono);letter-spacing:.08em}.room-status-line{padding:13px 15px;margin:20px 0;border-radius:14px;background:var(--surface-hover);font-weight:700;font-size:.85rem}.room-members{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:11px}.room-member{display:flex;align-items:center;gap:11px;padding:13px;border:1px solid var(--border);border-radius:16px;color:inherit;text-decoration:none;background:var(--bg)}.room-member>span{display:flex;flex-direction:column;gap:3px}.room-member small{color:var(--text-muted)}.room-detail-actions{margin-top:22px}.room-stage-note{margin-top:22px;padding:13px;border-left:3px solid var(--accent);background:color-mix(in srgb,var(--accent) 7%,var(--surface));color:var(--text-muted);font-size:.84rem}
@media(max-width:900px){.rooms-layout{grid-template-columns:1fr}.room-create-panel{position:static}.room-detail-head{flex-direction:column}}@media(max-width:560px){.room-form-row,.room-join-code form{grid-template-columns:1fr}.room-filter,.room-filter form,.room-filter select{width:100%}.room-detail{padding:17px}.room-members{grid-template-columns:1fr}}

/* Этап 13.2: полноценное лобби */
.room-detail{max-width:1180px}.lobby-grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:22px;align-items:start}.lobby-sidebar{display:grid;gap:14px}.lobby-box{padding:18px;border:1px solid var(--border);border-radius:18px;background:var(--bg)}.lobby-box h3{margin:0 0 15px;font-size:1rem}.room-form textarea{width:100%;border:1px solid var(--border);border-radius:13px;background:var(--surface);color:var(--text);padding:12px 13px;font:500 .86rem/1.5 var(--font-mono);resize:vertical;outline:none}.room-form textarea:focus{border-color:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 13%,transparent)}.room-form label small{font-weight:500;color:var(--text-muted);line-height:1.45}.lobby-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.lobby-section-head h2{margin:0}.lobby-section-head p{margin:3px 0 0;color:var(--text-muted);font-size:.82rem}.room-member{position:relative;justify-content:space-between;flex-wrap:wrap}.room-member.is-ready{border-color:#a8dfbe;background:linear-gradient(145deg,#f5fff9,var(--bg))}.room-member-person{display:flex;align-items:center;gap:11px;min-width:0;color:inherit;text-decoration:none}.room-member-person>span{display:flex;flex-direction:column;gap:3px}.room-member-person small{color:var(--text-muted)}.member-ready{padding:5px 8px;border-radius:999px;background:var(--surface-hover);color:var(--text-muted);font-size:.72rem;font-weight:700}.room-member.is-ready .member-ready{background:#ddf8e8;color:#167849}.member-menu{position:relative}.member-menu summary{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:var(--surface-hover);cursor:pointer;list-style:none;font-weight:800}.member-menu summary::-webkit-details-marker{display:none}.member-menu>div{position:absolute;right:0;top:36px;z-index:8;width:190px;padding:7px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:0 14px 35px rgba(20,15,50,.14)}.member-menu form{margin:0}.member-menu button{width:100%;padding:9px 10px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left;cursor:pointer}.member-menu button:hover{background:var(--surface-hover)}.member-menu button.danger{color:#c43a4d}.room-detail-actions{display:flex;gap:9px;flex-wrap:wrap}.room-detail-actions form{margin:0}.room-detail-actions button:disabled{opacity:.48;cursor:not-allowed}.lobby-status{padding:6px 9px;border-radius:999px}.lobby-status-waiting{background:#fff6da;color:#876400}.lobby-status-ready{background:#ddf8e8;color:#167849}.lobby-status-closed{background:#f3e7ea;color:#a53749}.lobby-ready-banner,.lobby-invite-banner{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:0 0 20px;padding:16px 18px;border-radius:16px}.lobby-ready-banner{background:#e9fbf0;border:1px solid #bfe8cf}.lobby-invite-banner{background:color-mix(in srgb,var(--accent) 8%,var(--surface));border:1px solid color-mix(in srgb,var(--accent) 28%,var(--border))}.lobby-ready-banner>span,.lobby-invite-banner>div:first-child{display:flex;flex-direction:column;gap:3px}.lobby-ready-banner span,.lobby-invite-banner span{color:var(--text-muted);font-size:.84rem}.lobby-inline-actions{display:flex;gap:8px}.lobby-inline-actions form{margin:0}.lobby-friends{display:grid;gap:9px;max-height:330px;overflow:auto}.lobby-friend{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:9px;padding:9px;border:1px solid var(--border);border-radius:13px;background:var(--surface)}.lobby-friend>span{display:flex;flex-direction:column;min-width:0}.lobby-friend small{color:var(--text-muted);font-size:.72rem}.lobby-friend .friend-avatar{width:38px;height:38px;flex-basis:38px;font-size:19px}.lobby-friend form{margin:0}.lobby-danger{border-color:color-mix(in srgb,#d84b5d 24%,var(--border))}
@media(max-width:980px){.lobby-grid{grid-template-columns:1fr}.lobby-sidebar{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}}@media(max-width:640px){.lobby-ready-banner,.lobby-invite-banner{align-items:flex-start;flex-direction:column}.lobby-inline-actions,.lobby-inline-actions form,.lobby-inline-actions .btn{width:100%}.room-detail-actions,.room-detail-actions form,.room-detail-actions .btn{width:100%}.member-menu{margin-left:auto}.lobby-sidebar{grid-template-columns:1fr}.lobby-friend{grid-template-columns:auto 1fr}.lobby-friend form{grid-column:1/-1}.lobby-friend .btn{width:100%}}

/* Этап 13.3: соединение лобби в реальном времени */
.realtime-status{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;font-size:.72rem;font-weight:700;white-space:nowrap}.realtime-status:before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}.realtime-online{background:#ddf8e8;color:#167849}.realtime-connecting{background:#e9efff;color:#5066a8}.realtime-connecting:before{animation:realtime-pulse 1.1s infinite}.realtime-fallback{background:#fff3d7;color:#866300}.realtime-offline{background:#f6e5e8;color:#ad3549}@keyframes realtime-pulse{50%{opacity:.28}}@media(max-width:640px){.room-status-line{flex-wrap:wrap}.realtime-status{order:3;width:100%;justify-content:center}}

/* Этап 13.3: соединение лобби в реальном времени */
.realtime-status{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;font-size:.72rem;font-weight:700;white-space:nowrap}.realtime-status:before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}.realtime-online{background:#ddf8e8;color:#167849}.realtime-connecting{background:#e9efff;color:#5066a8}.realtime-connecting:before{animation:realtime-pulse 1.1s infinite}.realtime-fallback{background:#fff3d7;color:#866300}.realtime-offline{background:#f6e5e8;color:#ad3549}@keyframes realtime-pulse{50%{opacity:.28}}@media(max-width:640px){.room-status-line{flex-wrap:wrap}.realtime-status{order:3;width:100%;justify-content:center}}

/* Этапы 13.4–13.5: игровой матч */
.match-panel{overflow:hidden}.match-status-banner{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:16px 18px;margin:18px 0;border-radius:16px;background:var(--surface-2,#f4f7fb)}.match-status-active{background:#ecfdf3}.match-status-finished{background:#f1f5f9}.match-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px}.match-game-area{min-height:560px;border-radius:18px;overflow:hidden;background:#0b1020}.match-frame{display:block;width:100%;height:70vh;min-height:560px;border:0;background:#000}.match-sidebar{display:flex;flex-direction:column;gap:16px}.match-players{display:flex;flex-direction:column;gap:10px}.match-player{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid var(--border,#e4e8ef);border-radius:14px}.match-player span{display:flex;flex-direction:column;min-width:0;flex:1}.match-player small{color:var(--muted,#6b7280)}.match-player strong{font-size:14px}@media(max-width:900px){.match-layout{grid-template-columns:1fr}.match-game-area,.match-frame{min-height:420px;height:60vh}.match-status-banner{align-items:flex-start;flex-direction:column}}

/* Этап 13.6: чат онлайн-комнат и матчей */
.mp-chat-wrap{padding-top:0}.mp-chat{max-width:980px;margin:0 auto}.mp-chat-head{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:14px}.mp-chat-head h2{margin:0}.mp-chat-head span{font-size:.8rem;color:var(--text-muted)}.mp-chat-list{height:320px;overflow:auto;padding:12px;border:1px solid var(--border);border-radius:16px;background:var(--surface-soft);display:flex;flex-direction:column;gap:10px}.mp-chat-message{position:relative;padding:10px 12px;border-radius:14px;background:var(--surface);border:1px solid var(--border)}.mp-chat-message b{font-size:.86rem}.mp-chat-message p{margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}.mp-chat-message small{color:var(--text-muted);font-size:.7rem}.mp-chat-message.is-system{text-align:center;background:transparent;border-style:dashed;color:var(--text-muted);font-size:.82rem}.mp-chat-tools{position:absolute;right:8px;top:6px;display:none;gap:5px}.mp-chat-message:hover .mp-chat-tools{display:flex}.mp-chat-tools button{border:0;background:transparent;color:var(--text-muted);font-size:.7rem;cursor:pointer}.mp-chat form{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:12px}.mp-chat textarea{resize:none;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text);padding:12px;font:inherit}.mp-chat-error{min-height:20px;color:var(--danger);font-size:.82rem;margin-top:5px}@media(max-width:640px){.mp-chat-list{height:260px}.mp-chat form{grid-template-columns:1fr}.mp-chat-tools{position:static;display:flex;margin-top:5px}.mp-chat-head{align-items:start;flex-direction:column;gap:3px}}

/* Управляемые страницы, юридические документы и cookie */
.page-shell{max-width:980px;padding-top:34px;padding-bottom:54px}.legal-page{padding:34px}.legal-page-head{padding-bottom:22px;margin-bottom:24px;border-bottom:1px solid var(--border)}.legal-page-head h1{margin:0 0 10px}.legal-page-head p{margin:0 0 8px;color:var(--text-muted)}.legal-page-head small{color:var(--text-muted)}.legal-content{font-size:.97rem;line-height:1.75}.legal-content h2,.legal-requisites h2{font-size:1.2rem;margin:30px 0 10px}.legal-content p,.legal-content li,.legal-requisites p{color:var(--text-muted)}.legal-content ul{padding-left:22px}.legal-requisites{margin-top:34px;padding:20px;border:1px solid var(--border);border-radius:16px;background:var(--surface-hover)}.legal-requisites p{margin:7px 0}.footer-inner{display:flex;justify-content:space-between;gap:24px;align-items:flex-start}.footer-links{display:flex;gap:12px 18px;flex-wrap:wrap;justify-content:flex-end}.footer-links a{color:var(--text-muted);font-size:.82rem}.cookie-banner{position:fixed;left:18px;right:18px;bottom:18px;z-index:1000;max-width:780px;margin:auto;padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:0 18px 55px rgba(25,18,55,.2)}.cookie-banner[hidden]{display:none}.cookie-banner strong{display:block;margin-bottom:4px}.cookie-banner p{margin:0;color:var(--text-muted);font-size:.84rem;line-height:1.45}.cookie-actions{display:flex;gap:8px;flex:0 0 auto}.consent-check{display:grid!important;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:10px;margin:14px 0;font-size:.82rem;line-height:1.45;color:var(--text-muted)}.consent-check input{width:18px!important;height:18px!important;margin:2px 0 0!important;accent-color:var(--accent);justify-self:start}.consent-check span{min-width:0}.page-editor{font-family:var(--font-mono);font-size:.84rem;line-height:1.55}.form-group small{display:block;margin-top:5px;color:var(--text-muted);font-size:.78rem}@media(max-width:700px){.legal-page{padding:20px 16px}.footer-inner,.cookie-banner{flex-direction:column}.footer-links{justify-content:flex-start}.cookie-actions,.cookie-actions .btn{width:100%}.cookie-actions{flex-direction:column-reverse}}

/* ===== Аватар и выпадающее меню пользователя ===== */
.user-menu{position:relative;flex-shrink:0}.user-menu-toggle{display:flex;align-items:center;gap:7px;border:1px solid var(--border);background:var(--surface);padding:4px 9px 4px 5px;border-radius:999px;cursor:pointer;color:var(--text);transition:.15s}.user-menu-toggle:hover,.user-menu.open .user-menu-toggle{background:var(--surface-hover);border-color:var(--accent-soft)}.header-avatar{width:36px;height:36px;border-radius:50%;overflow:hidden;display:grid;place-items:center;font-size:19px;background:var(--surface-hover)}.header-avatar img{width:100%;height:100%;object-fit:cover}.user-menu-arrow{font-size:.75rem;color:var(--text-muted)}.user-menu-dropdown{position:absolute;right:0;top:calc(100% + 10px);z-index:1200;width:240px;padding:10px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:0 22px 55px rgba(20,20,50,.18);display:none}.user-menu.open .user-menu-dropdown{display:grid;gap:4px}.user-menu-head{padding:8px 10px 12px;border-bottom:1px solid var(--border);margin-bottom:4px;display:grid;gap:2px}.user-menu-head small{color:var(--text-muted);font-size:.75rem;overflow:hidden;text-overflow:ellipsis}.user-menu-dropdown a{padding:10px 12px;border-radius:10px;color:var(--text);text-decoration:none}.user-menu-dropdown a:hover{background:var(--surface-hover)}.user-menu-dropdown .user-menu-logout{color:#b23a3a;border-top:1px solid var(--border);margin-top:3px;border-radius:0 0 10px 10px}
@media(max-width:860px){.user-menu{width:100%}.user-menu-toggle{width:100%;justify-content:flex-start;border-radius:12px;padding:7px 10px}.user-menu-arrow{margin-left:auto}.user-menu-dropdown{position:static;width:100%;box-shadow:none;margin-top:6px;border-radius:12px}.header-avatar{width:34px;height:34px}}

/* Публичный профиль: все показатели одной строкой */
.public-profile-stats.without-follows{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:18px}
.public-profile-stats.with-follows{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px}
@media(max-width:760px){
 .public-profile-stats.without-follows,.public-profile-stats.with-follows{grid-template-columns:repeat(5,minmax(72px,1fr));overflow-x:auto;justify-content:start;padding-bottom:6px}
 .public-profile-stats.with-follows{grid-template-columns:repeat(7,minmax(72px,1fr))}
}


/* Profile avatar management */
.current-avatar-box{display:flex;align-items:center;gap:14px;padding:14px;margin:0 0 18px;border:1px solid var(--border);border-radius:16px;background:var(--surface-hover)}
.current-avatar-preview{width:64px;height:64px;border-radius:18px;display:grid;place-items:center;overflow:hidden;font-size:30px;flex:0 0 64px}.current-avatar-preview img{width:100%;height:100%;object-fit:cover}
.current-avatar-copy{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}.current-avatar-copy span{font-size:.82rem;color:var(--text-muted)}
.profile-recent-games{display:grid!important;grid-template-columns:1fr!important;gap:14px!important}.profile-recent-games .recent-game-card{border:1px solid var(--border)!important;border-radius:18px!important;padding:24px!important;box-shadow:none!important}
.profile-recent-games .recent-game-card+.recent-game-card{margin-top:0}
/* Friendly footer */
.site-footer{padding:34px 0;text-align:left;background:color-mix(in srgb,var(--surface) 75%,transparent)}
.footer-layout{display:grid;grid-template-columns:minmax(210px,.8fr) minmax(280px,1.5fr) auto;gap:32px;align-items:start}
.footer-brand{display:flex;flex-direction:column;gap:6px}.footer-brand b{color:var(--text);font-size:1rem}.footer-brand span,.footer-brand small{color:var(--text-muted);line-height:1.45}
.footer-links{display:grid;grid-template-columns:repeat(2,minmax(150px,1fr));gap:10px 22px;justify-content:initial}.footer-links a{display:block;color:var(--text-muted);font-size:.86rem;line-height:1.4;text-decoration:none}.footer-links a:hover{color:var(--accent)}
.footer-socials{display:flex;gap:10px;justify-content:flex-end}.footer-socials a{width:42px;height:42px;border:1px solid var(--border);border-radius:14px;display:grid;place-items:center;background:var(--surface);color:var(--text);text-decoration:none;transition:.15s}.footer-socials a:hover{transform:translateY(-2px);border-color:var(--accent);color:var(--accent)}.footer-socials span{font-weight:800;font-size:.82rem}
@media(max-width:760px){.current-avatar-box{align-items:flex-start;flex-wrap:wrap}.current-avatar-copy{min-width:160px}.current-avatar-box form{width:100%}.current-avatar-box .btn{width:100%}.site-footer{padding:28px 0}.footer-layout{grid-template-columns:1fr;gap:22px;text-align:center}.footer-brand{align-items:center}.footer-links{grid-template-columns:1fr;gap:12px}.footer-links a{padding:0 10px;line-height:1.45}.footer-socials{justify-content:center}.footer-socials a{width:46px;height:46px}}

/* Главная: центральная компактная композиция без ленты активности */
.hero {
  min-height: calc(100vh - 170px);
  display: flex;
  align-items: center;
  padding: 72px 0;
}
.hero .container { width: 100%; }
.hero h1 { font-size: clamp(3rem, 7vw, 5.4rem); line-height: 1.03; }

/* Отдельный блок ПК-игр в каталоге */
.catalog-pc-section {
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.catalog-pc-head { margin-bottom: 22px; }
.game-card-platform {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(70,55,120,.12);
  color: #9a6a18;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 0 5px 16px rgba(35,25,70,.10);
}

/* Карточка страницы ПК-игры */
.pc-game-card {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  overflow: hidden;
}
.pc-game-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.pc-game-placeholder {
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.pc-game-card h3 { margin: 12px 0 8px; }
.pc-game-description { color: var(--text-muted); overflow-wrap: anywhere; }
.pc-game-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pc-game-version { font-size: .82rem; color: var(--text-muted); margin-top: 14px; }

@media (max-width: 640px) {
  .hero { min-height: calc(100vh - 132px); padding: 42px 0 48px; }
  .hero h1 { font-size: clamp(2.65rem, 14vw, 4rem); }
  .catalog-pc-section { margin-top: 38px; padding-top: 28px; }
  .pc-game-card { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .pc-game-card > div { min-width: 0; width: 100%; }
  .pc-game-card img, .pc-game-placeholder { width: 100%; }
  .pc-game-actions { flex-direction: column; }
  .pc-game-actions .btn { width: 100%; text-align: center; justify-content: center; }
}
/* Донаты */
.donate-page{padding-top:54px;padding-bottom:70px}.donate-hero{text-align:center;max-width:900px;margin:0 auto 38px}.donate-kicker{display:inline-block;padding:7px 12px;border-radius:999px;background:color-mix(in srgb,var(--accent) 10%,var(--surface));color:var(--accent);font-weight:700;font-size:.82rem}.donate-hero h1{font-size:clamp(2.3rem,6vw,4.5rem);margin:16px 0 14px}.donate-hero>p{max-width:760px;margin:auto;color:var(--text-muted);font-size:1.04rem;line-height:1.7}.donate-points{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:22px}.donate-points span{padding:9px 13px;border:1px solid var(--border);border-radius:13px;background:var(--surface);font-size:.84rem}.donate-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.donate-card{border:1px solid var(--border);border-radius:24px;background:var(--surface);padding:24px;box-shadow:0 18px 55px rgba(35,25,70,.06);overflow:hidden}.donate-card-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:18px}.donate-card-head>span{font-size:30px}.donate-card h2{margin:0 0 7px}.donate-card p{margin:0;color:var(--text-muted);line-height:1.55}.donate-widget{width:100%;overflow:hidden;border-radius:18px;background:#fff}.donate-widget iframe{display:block;width:100%;max-width:500px;margin:auto}.donate-note{max-width:900px;margin:30px auto 0;padding:20px 22px;border:1px solid var(--border);border-radius:18px;background:var(--surface-hover);text-align:center}.donate-note p{margin:7px 0 0;color:var(--text-muted);line-height:1.55}
/* Поддержка */
.support-page{padding-top:42px;padding-bottom:70px}.support-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:22px}.support-sidebar{align-self:start;position:sticky;top:90px}.support-ticket-list{display:grid;gap:8px;margin-top:15px}.support-ticket-list a{display:grid;gap:4px;padding:12px;border-radius:13px;color:var(--text);text-decoration:none}.support-ticket-list a:hover,.support-ticket-list a.active{background:var(--surface-hover)}.support-ticket-list small{color:var(--text-muted)}.support-main{display:grid;gap:20px}.support-form{display:grid;gap:15px}.support-form label{display:grid;gap:7px;font-weight:700;font-size:.9rem}.support-form textarea{min-height:170px}.support-hp{position:absolute!important;left:-99999px!important;width:1px!important;height:1px!important;opacity:0!important}.support-guest-grid{display:grid;grid-template-columns:minmax(240px,.7fr) minmax(0,1.3fr);gap:24px;align-items:start}.support-info p,.support-info li{color:var(--text-muted);line-height:1.65}.support-chat-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding-bottom:16px;border-bottom:1px solid var(--border)}.support-chat-head h2{margin:0 0 5px}.support-chat-head small,.support-chat-head p{color:var(--text-muted);margin:0}.support-messages{display:flex;flex-direction:column;gap:12px;max-height:520px;overflow:auto;padding:20px 4px}.support-message{max-width:78%;padding:13px 15px;border-radius:17px;border:1px solid var(--border);background:var(--surface-hover)}.support-message.from-user{align-self:flex-end;background:color-mix(in srgb,var(--accent) 11%,var(--surface))}.support-message.from-admin{align-self:flex-start}.support-message p{margin:5px 0;white-space:pre-wrap;overflow-wrap:anywhere}.support-message small{color:var(--text-muted);font-size:.72rem}.support-reply{display:grid;grid-template-columns:1fr auto;gap:10px;padding-top:16px;border-top:1px solid var(--border)}.support-reply textarea{min-height:74px}.status-badge{font-size:.78rem;padding:7px 10px;border-radius:999px;background:var(--surface-hover);white-space:nowrap}.muted{color:var(--text-muted)}
@media(max-width:850px){.donate-grid,.support-layout,.support-guest-grid{grid-template-columns:1fr}.support-sidebar{position:static}.support-reply{grid-template-columns:1fr}.support-message{max-width:92%}}@media(max-width:560px){.donate-page,.support-page{padding-top:28px}.donate-card{padding:16px}.donate-widget{margin-left:-8px;width:calc(100% + 16px)}.donate-widget iframe{height:500px}.support-chat{padding:16px}.support-chat-head{flex-direction:column}.support-message{max-width:96%}}
