/* ============================================
   MATRIX SQUAD — Global Styles v3
   Premium, calm, space (Star Citizen / Elite Dangerous vibe)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Rajdhani:wght@400;500;600;700&display=swap');

/* CSS @property for sweep angle (Chromium/Edge/Safari; fallback gracefully) */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg:         #05070f;
  --bg-2:       #0a0c18;
  --panel:      rgba(14, 18, 30, 0.7);
  --panel-2:    rgba(20, 24, 38, 0.7);
  --border:     rgba(255, 255, 255, 0.08);
  --border-2:   rgba(255, 255, 255, 0.14);
  --cyan:       #00f5ff;
  --magenta:    #ff00aa;
  --silver:     #d8dee9;
  --text:       #e0e0e0;
  --muted:      #8a8fa3;
  --dim:        #5a6076;
  --twitch:     #9146FF;
  --header-h:   72px;
  --footer-h:   34px;
  --radius:     16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Rajdhani', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  letter-spacing: 0.2px;
  padding-bottom: var(--footer-h);
}

/* Cosmic backdrop */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 600px at 18% -10%, rgba(120,140,180,0.08), transparent 60%),
    radial-gradient(800px 500px at 88% 12%, rgba(180,150,200,0.06), transparent 60%),
    radial-gradient(900px 500px at 50% 115%, rgba(140,160,200,0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#starfield {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============== GRID OVERLAY (reusable) ============== */
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}

/* ============== PREMIUM HOVER (white sweep) ==============
   Used by .premium (cards, buttons). Pure CSS, no JS.
   Light ray traverses border using conic-gradient + @property.
======================================================= */
.premium {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  transition: border-color 0.4s ease, transform 0.35s ease, background 0.4s ease;
  overflow: hidden;
}
.premium::before,
.premium::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}
/* Outer light ring (the actual sweep) */
.premium::before {
  padding: 1.5px;
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0deg,
    rgba(255,255,255,0)   60deg,
    rgba(255,255,255,0.10) 95deg,
    rgba(255,255,255,0.92) 115deg,
    rgba(255,255,255,0.10) 135deg,
    rgba(255,255,255,0)   170deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  z-index: 1;
}
/* Soft inner sheen following the ray */
.premium::after {
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0deg,
    rgba(255,255,255,0)   80deg,
    rgba(216,222,233,0.05) 110deg,
    rgba(255,255,255,0.10) 120deg,
    rgba(216,222,233,0.05) 130deg,
    rgba(255,255,255,0)   160deg,
    transparent 360deg
  );
  z-index: 0;
  filter: blur(8px);
}
.premium:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}
.premium:hover::before,
.premium:hover::after {
  opacity: 1;
  animation: sweep 3.2s linear infinite;
}
@keyframes sweep {
  to { --angle: 360deg; }
}

/* Fallback when @property unsupported (Firefox older) — gentle border highlight */
@supports not (background: conic-gradient(from 0deg, #000 0%, #000 100%)) {
  .premium:hover { border-color: rgba(255,255,255,0.35); box-shadow: 0 0 0 1px rgba(255,255,255,0.1); }
}

/* ============== HEADER ============== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(5, 7, 15, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 20px;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 2px;
  display: inline-flex;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.logo-matrix { color: var(--cyan); text-shadow: 0 0 18px rgba(0,245,255,0.45); }
.logo-squad  { color: var(--magenta); text-shadow: 0 0 18px rgba(255,0,170,0.4); }

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-link {
  position: relative;
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  border-radius: 8px;
  transition: color 0.25s ease, background 0.25s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(0,245,255,0.5);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: #fff; background: rgba(0,245,255,0.05); }
.nav-link.active::after { transform: scaleX(1); }

.header-right { display: flex; align-items: center; gap: 12px; }

.twitch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(145, 70, 255, 0.10);
  border: 1px solid rgba(145, 70, 255, 0.25);
  color: var(--twitch);
  font-size: 16px;
  text-decoration: none;
  transition: all 0.25s ease;
}
.twitch-icon:hover {
  background: rgba(145, 70, 255, 0.2);
  border-color: rgba(145, 70, 255, 0.5);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-2);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

/* User picker (mock auth) */
.user-picker {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.user-picker:hover { color: #fff; border-color: var(--border-2); }
.user-picker .av { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #3a4255, #20253a); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 700; }
.user-picker.is-admin { border-color: rgba(255,255,255,0.25); color: #fff; }
.user-picker.is-admin .av { background: linear-gradient(135deg, #b8c1d6, #5a6076); color: #000; }
.user-picker.is-guest { opacity: 0.7; }

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(10,12,22,0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 6px;
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}
.user-menu.open { display: block; }
.user-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 12px;
  background: none; border: none;
  color: var(--text);
  font-size: 0.88rem; font-family: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
.user-menu button:hover { background: rgba(255,255,255,0.05); }
.user-menu button.active { background: rgba(255,255,255,0.08); color: #fff; }
.user-menu .menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.user-menu .menu-label { padding: 6px 12px; font-size: 0.7rem; letter-spacing: 2px; color: var(--dim); text-transform: uppercase; }
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
.user-picker-wrap { position: relative; }

/* ============== MAIN CONTENT ============== */
.main-content {
  flex: 1;
  padding: calc(var(--header-h) + 40px) 28px 60px;
  position: relative;
  z-index: 1;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.page-header { text-align: center; margin-bottom: 40px; }
.page-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #00f5ff 0%, #ffffff 50%, #ff00aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  text-shadow: 0 0 30px rgba(0,245,255,0.10);
}
.page-subtitle { color: var(--muted); font-size: 1.05rem; }

/* ============== HERO (index) ============== */
.hero {
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  display: flex;
  align-items: center;
  position: relative;
  padding: calc(var(--header-h) + 40px) 28px 60px;
  z-index: 1;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  pointer-events: none;
}

.hero-content {
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: var(--silver);
  margin-bottom: 22px;
  background: rgba(255,255,255,0.02);
}

.hero-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 0 0 40px rgba(0,245,255,0.18);
}
.hero-title .row-2 {
  background: linear-gradient(90deg, #00f5ff 0%, #8b6dff 50%, #ff00aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 36px;
  line-height: 1.6;
}
.hero-subtitle .highlight { color: var(--silver); }

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 32px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(90deg, #00f5ff, #8b6dff 50%, #ff00aa);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(0,245,255,0.35), 0 0 22px rgba(255,0,170,0.25);
  transition: transform 0.25s ease, box-shadow 0.3s ease, filter 0.3s ease;
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 44px rgba(0,245,255,0.5), 0 0 30px rgba(255,0,170,0.4); filter: brightness(1.1); }
.hero-btn i { transition: transform 0.25s ease; }
.hero-btn:hover i { transform: translateX(6px); }

.hero-stats {
  margin-top: 50px;
  display: grid;
  grid-template-columns: repeat(3, 120px);
  gap: 32px;
  max-width: 720px;
}

.hero-stats > div {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.hero-stats .stat-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.85rem;
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(0,245,255,0.4);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.hero-stats .stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  letter-spacing: 3px;
}

/* ============== INFO SECTION ============== */
.info-section {
  padding: 80px 28px;
  position: relative; z-index: 1;
  max-width: 1480px; margin: 0 auto;
}

.section-eyebrow {
  display: block;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 6px;
  color: var(--silver);
  margin-bottom: 12px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  opacity: 0.7;
}
.section-title {
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 50px;
  background: linear-gradient(90deg, #00f5ff 0%, #ffffff 50%, #ff00aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1.5px;
  text-shadow: 0 0 24px rgba(0,245,255,0.08);
}

.section-row {
  display: flex; justify-content: space-between; align-items: center;
  margin: 36px 0 22px;
  flex-wrap: wrap; gap: 16px;
}
.section-row h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

/* ============== CARDS (premium) ============== */
.card {
  padding: 28px;
}
.card h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 1.5px;
}
.card p { color: var(--muted); line-height: 1.65; font-size: 0.98rem; }

.info-card { position: relative; cursor: default; }
.info-card.is-link { cursor: pointer; }
.info-card .info-num {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  color: var(--silver);
  letter-spacing: 4px;
  margin-bottom: 8px;
  opacity: 0.7;
}
.info-card .edit-pencil {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  font-size: 12px;
}
.info-card .edit-pencil:hover { color: #fff; background: rgba(255,255,255,0.1); }
.is-admin .info-card .edit-pencil { display: inline-flex; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============== STATS PAGE ============== */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-bottom: 50px;
}
.stat-card { padding: 26px 22px; text-align: center; }
.stat-card .stat-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  margin: 6px 0 6px;
  letter-spacing: 1px;
}
.stat-card .stat-desc { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 2.5px; }
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
.stat-card h3 { color: var(--silver); font-size: 0.78rem; letter-spacing: 3px; text-transform: uppercase; opacity: 0.85; }
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;

/* Stats: horizontal rows */
.stat-rows { display: flex; flex-direction: column; gap: 10px; }
.stat-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 16px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.stat-row:hover { border-color: var(--border-2); background: var(--panel-2); }
.stat-row .rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--silver);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: rgba(255,255,255,0.03);
}
.stat-row:nth-child(1) .rank { color: #ff5a6e; border-color: rgba(255,90,110,0.55); background: rgba(255,90,110,0.10); }
.stat-row:nth-child(2) .rank { color: #5fb6e8; border-color: rgba(95,182,232,0.55); background: rgba(95,182,232,0.10); }
.stat-row:nth-child(3) .rank { color: #4ade80; border-color: rgba(74,222,128,0.55); background: rgba(74,222,128,0.10); }
.stat-row .rank.rank-yellow { color: #f5c46c; border-color: rgba(245,196,108,0.45); background: rgba(245,196,108,0.07); }
.stat-row .nick {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.stat-row .row-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: center; }
.stat-row .row-stats .ist {
  display: grid;
  grid-template-columns: 26px 42px 1fr;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}
.stat-row .row-stats .ist b { text-align: right; }
.stat-row .row-stats .ist b {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  color: #fff;
  font-size: 0.98rem;
}
.stat-row .row-stats .ist i {
  width: 22px; height: 22px; min-width: 22px; flex-shrink: 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--silver);
}

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: color 0.3s ease, background 0.3s ease, transform 0.25s ease;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle,0deg), transparent 0deg, rgba(255,255,255,0) 75deg, rgba(255,255,255,0.85) 115deg, rgba(255,255,255,0) 155deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.btn:hover { color: #fff; background: rgba(255,255,255,0.07); transform: translateY(-1px); }
.btn:hover::before { opacity: 1; animation: sweep 3s linear infinite; }

.btn.btn-solid {
  color: #0a0c18;
  background: linear-gradient(135deg, #f0f4ff, #b8c1d6);
  border-color: transparent;
}
.btn.btn-solid:hover { background: linear-gradient(135deg, #ffffff, #cdd6e6); }
.btn.btn-ghost { background: transparent; border-color: var(--border); }
.btn.btn-icon { padding: 11px 14px; }

/* ============== MEMBERS PAGE — Person cards ============== */
.toolbar {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.search-bar {
  flex: 1; min-width: 240px;
  position: relative;
}
.search-bar i {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--dim);
}
.search-bar input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  background: rgba(10,12,25,0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--border-2);
  background: rgba(10,12,25,0.85);
}
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 10px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover { color: #fff; border-color: var(--border-2); }
.chip.active { color: #fff; border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.06); }

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.member-card {
  display: flex; flex-direction: column;
  padding: 0;
  text-decoration: none;
  color: inherit;
  cursor: default;
}
.member-card.is-clickable { cursor: pointer; }

.member-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1f30, #0a0d18);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 5rem;
  font-weight: 900;
  color: var(--silver);
  letter-spacing: -2px;
}
.member-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(5,7,15,0.7) 100%);
  pointer-events: none;
}
.member-photo .game-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 5px 11px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: inline-flex; align-items: center; gap: 5px;
  z-index: 2;
  max-width: calc(100% - 56px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.member-photo .game-badge i { color: var(--silver); }
.member-photo .status-dot {
  position: absolute;
  top: 14px; right: 14px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(5,7,15,0.6);
  z-index: 2;
}
.member-photo .status-dot.online { background: #4ade80; box-shadow: 0 0 12px rgba(74,222,128,0.7); }
.member-photo .status-dot.offline { background: #5a6076; }
.member-photo .name-overlay {
  position: absolute;
  bottom: 14px; left: 16px; right: 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  z-index: 2;
  text-shadow: 0 2px 14px rgba(0,0,0,0.7);
  word-break: break-word;
}

.member-body {
  padding: 14px 18px 18px;
  display: flex; flex-direction: column;
  gap: 12px;
  flex: 1;
}
.member-bio {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.member-bio.is-empty { color: var(--dim); font-style: italic; }
.member-platforms {
  display: flex; gap: 6px;
  flex-wrap: wrap;
}
.member-platforms a, .member-platforms span {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.member-platforms a:hover { background: rgba(255,255,255,0.08); border-color: var(--border-2); }
.member-platforms .p-twitch { color: var(--twitch); }
.member-platforms .p-discord { color: #7d8edf; }
.member-platforms .p-steam { color: #c7d5e0; }
.member-platforms .p-youtube { color: #e58a8a; }
.member-platforms .p-tiktok { color: #d8d8d8; }
.member-platforms .p-kick { color: #67e0a3; }
.member-platforms .p-telegram { color: #5fb6e8; }
.member-tags {
  display: flex; gap: 5px;
  flex-wrap: wrap;
  margin-top: auto;
}
.member-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--silver);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.empty {
  text-align: center; padding: 60px 20px;
  color: var(--muted); font-size: 1rem;
  grid-column: 1 / -1;
}

/* ============== EVENTS PAGE ============== */
.event-list { display: flex; flex-direction: column; gap: 18px; }
.event-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 24px; align-items: center;
  padding: 22px 24px;
  min-height: 180px;
}
.event-row .e-photo {
  width: 180px;
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a1f30, #0a0d18);
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim);
  font-size: 2.5rem;
}
.event-row .e-info { min-width: 0; }
.event-row .e-date {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.74rem;
  letter-spacing: 2px;
  color: var(--silver);
  margin-bottom: 10px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
}
.event-row h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.event-row p { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.event-row .e-actions { display: flex; flex-direction: column; gap: 8px; }

/* Event editor modal (admin) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: min(560px, 100%);
  background: rgba(10,12,22,0.97);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 22px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
}
.modal .field { margin-bottom: 16px; }
.modal label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: var(--silver);
  margin-bottom: 6px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
}
.modal input[type=text], .modal input[type=date], .modal input[type=number], .modal input[type=url], .modal textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.modal input:focus, .modal textarea:focus { outline: none; border-color: var(--border-2); }
.modal textarea { resize: vertical; min-height: 80px; }
.modal .photo-preview {
  margin-top: 10px;
  width: 100%;
  height: 160px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  background-color: rgba(255,255,255,0.03);
  display: flex; align-items: center; justify-content: center;
  color: var(--dim);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* ============== RULES PAGE (vertical, big blocks) ============== */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}
.rule-block {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 22px;
  align-items: flex-start;
  padding: 32px 32px;
}
.rule-block .rule-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, #b8c1d6 50%, #8a93a8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.rule-block h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 1.5px;
}
.rule-block p {
  color: var(--text);
  line-height: 1.7;
  font-size: 1.02rem;
}
.rule-block .row-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.is-admin .rule-block .row-actions { display: flex; }
.rule-block .row-actions { display: none; }

/* ============== USER / PROFILE PAGE ============== */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}
.profile-main { min-width: 0; }

.profile-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 300px; height: 300px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1a1f30, #0a0d18);
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 7rem;
  font-weight: 900;
  color: var(--silver);
  position: relative;
  overflow: hidden;
  letter-spacing: -2px;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.profile-avatar input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-avatar .avatar-edit-overlay {
  position: absolute; inset: 0;
  background: rgba(5,7,15,0.65);
  display: none;
  align-items: center; justify-content: center;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  pointer-events: none;
}
.profile-avatar.editing .avatar-edit-overlay { display: flex; }

.profile-hero-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.profile-hero-right h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  word-break: break-word;
}
.profile-hero-right h1 input {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 6px 12px;
  width: 100%;
}
.profile-twitch {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--twitch);
  text-decoration: none;
  font-weight: 600;
  width: fit-content;
}
.profile-twitch:hover { color: #b388ff; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.profile-block {
  padding: 24px 26px;
  margin-bottom: 18px;
}
.profile-block h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 2.5px;
  color: var(--silver);
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.profile-block h2 .ic { font-size: 1.1rem; }

.profile-desc {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.6;
  min-height: 60px;
}
.profile-desc[contenteditable=true] {
  outline: 1px dashed var(--border-2);
  outline-offset: 4px;
  border-radius: 8px;
}

.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-tag {
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--silver);
  font-size: 0.85rem;
  font-weight: 600;
}
.profile-tags-input[contenteditable=true] {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  outline: none;
}

.profile-games { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-game {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 600;
}
.profile-game .ic { color: var(--silver); }

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.profile-stats-row .ist {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.profile-stats-row .ist .v {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.7rem;
  color: #fff;
  font-weight: 800;
}
.profile-stats-row .ist .l {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.platform-list { display: flex; flex-direction: column; gap: 10px; }
.platform-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 10px; align-items: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.platform-row .pname { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; }
.platform-row a, .platform-row .ptext { color: var(--silver); text-decoration: none; word-break: break-all; }
.platform-row a:hover { text-decoration: underline; }
.platform-row input, .platform-row select {
  padding: 8px 12px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
}
.platform-row .rm-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.platform-row .rm-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

.add-platform-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.add-platform-row select, .add-platform-row input {
  padding: 10px 14px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
}
.add-platform-row input { flex: 1; min-width: 180px; }

/* ============== SQUAD CHAT (sidebar) ============== */
.chat-panel {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  height: calc(100vh - var(--header-h) - var(--footer-h) - 40px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 480px;
}
.chat-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-head h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 2.5px;
  color: #fff;
  display: flex; align-items: center; gap: 8px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
}
.chat-head h3 i { color: var(--silver); }
.chat-head .online-count { font-size: 0.72rem; color: #4ade80; letter-spacing: 1.5px; text-transform: uppercase; }
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
.chat-head .online-count::before {
  content: ''; display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  margin-right: 5px; vertical-align: middle;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }

.chat-msg { display: flex; flex-direction: column; gap: 2px; }
.chat-msg .who { font-size: 0.78rem; color: var(--silver); font-weight: 700; letter-spacing: 0.5px; }
.chat-msg .who .ts { color: var(--dim); font-weight: 400; font-size: 0.7rem; margin-left: 6px; }
.chat-msg.is-mine .who { color: #fff; }
.chat-msg.is-system { opacity: 0.6; font-style: italic; }
.chat-msg.is-system .who { color: var(--muted); }
.chat-msg .body {
  background: rgba(255,255,255,0.03);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.4;
  word-break: break-word;
}
.chat-msg.is-mine .body { background: rgba(255,255,255,0.07); border-color: var(--border-2); }

.chat-input {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1; padding: 10px 14px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
}
.chat-input input:focus { outline: none; border-color: var(--border-2); }
.chat-input input:disabled { opacity: 0.5; }
.chat-input button {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-2);
  color: #fff;
  width: 42px; border-radius: 10px;
  cursor: pointer; font-size: 14px;
}
.chat-input button:hover { background: rgba(255,255,255,0.14); }

.chat-toggle {
  display: none;
  position: fixed;
  bottom: 52px;
  right: 18px;
  z-index: 100;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(20,24,38,0.95);
  border: 1px solid var(--border-2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* Pagination */
.pager {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.pager button {
  min-width: 40px; height: 40px;
  padding: 0 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pager button:hover { color: #fff; border-color: var(--border-2); }
.pager button.active { background: rgba(255,255,255,0.08); border-color: var(--border-2); }
.pager button:disabled { opacity: 0.3; cursor: not-allowed; }

/* Sign In button (guest) */
.sign-in-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  background: rgba(145,70,255,0.10);
  border: 1px solid rgba(145,70,255,0.45);
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.25s ease;
  cursor: pointer;
}
.sign-in-btn i { color: var(--twitch); }
.sign-in-btn:hover { background: rgba(145,70,255,0.2); border-color: rgba(145,70,255,0.7); }

/* Avatar in header */
.user-picker .av img { display: block; }

/* Events: participation + likes */
.event-row .e-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.event-meta-bottom {
  display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap;
}
.event-meta-bottom .pill-stat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text);
  position: relative;
}
.event-meta-bottom .pill-stat i { color: var(--silver); }
.participants-pill {
  cursor: help;
}
.participants-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: rgba(10,12,22,0.97);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 0.82rem;
  z-index: 60;
  max-width: 260px;
  white-space: normal;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.participants-pill:hover .participants-tooltip { display: block; }

.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.like-btn:hover { background: rgba(255,90,110,0.1); border-color: rgba(255,90,110,0.4); }
.like-btn.liked { background: rgba(255,90,110,0.18); border-color: rgba(255,90,110,0.55); color: #ff8095; }
.like-btn i { color: #ff5a6e; }

/* Event date gradient */
.event-row .e-date {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  background-clip: padding-box;
}
.event-row .e-date span.grad {
  background: linear-gradient(90deg, #ff6e9c, #b86dff 50%, #6dd5ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* Admin "Удалить аккаунт" button */
.danger-btn {
  background: rgba(255,90,110,0.08);
  border-color: rgba(255,90,110,0.4);
  color: #ff8095;
}
.danger-btn:hover { background: rgba(255,90,110,0.18); color: #fff; }

/* Galaxy parity: ensure starfield works on Galaxy too */
.galaxy-wrap #starfield {
  z-index: 0;
}

/* ============== AUTH NOTICE ============== */
.auth-hint {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 18px 0;
  display: flex; align-items: center; gap: 12px;
}
.auth-hint i { color: var(--silver); font-size: 18px; }

/* ============== FOOTER ============== */
.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  text-align: center;
  color: var(--dim);
  font-size: 11px;
  background: rgba(5,7,15,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  letter-spacing: 1.2px;
}
.footer .matrxsquad {
  color: var(--silver);
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  margin: 0 4px;
  text-decoration: none;
  transition: color 0.25s;
}
.footer .matrxsquad:hover { color: #fff; }

/* ============== RESPONSIVE ============== */
@media (max-width: 1100px) {
  .profile-layout { grid-template-columns: 1fr; }
  .chat-panel {
    position: fixed;
    top: 0; bottom: 0; right: 0;
    width: min(360px, 92vw);
    height: 100vh;
    border-radius: 0;
    transform: translateX(110%);
    transition: transform 0.3s ease;
    z-index: 200;
    border-left: 1px solid var(--border-2);
  }
  .chat-panel.open { transform: translateX(0); }
  .chat-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 18px 24px;
    background: rgba(5,7,15,0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-150%);
    transition: transform 0.35s ease;
    align-items: stretch;
  }
  .nav.open { transform: translateY(0); }
  .nav-link { padding: 12px 16px; }
  .profile-hero { grid-template-columns: 1fr; }
  .profile-avatar { width: 220px; height: 220px; font-size: 5rem; margin: 0 auto; }
  .event-row { grid-template-columns: 1fr; }
  .event-row .e-photo { width: 100%; height: 200px; }
  .stat-row { grid-template-columns: 50px 1fr; }
  .stat-row .row-stats { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 8px; }
  .rule-block { grid-template-columns: 1fr; padding: 24px; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .main-content { padding-left: 16px; padding-right: 16px; }
  .info-section { padding: 60px 16px; }
  .hero { padding: calc(var(--header-h) + 24px) 16px 40px; }
}


/* ===================== v6 OVERRIDES (visual fix pass) ===================== */

/* --- Header: bigger Sign-in pill for guests, no isolated twitch icon --- */
.sign-in-btn {
  padding: 8px 16px;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, rgba(145,70,255,0.18), rgba(0,245,255,0.10));
  border-color: rgba(145,70,255,0.55);
  gap: 8px;
}
.sign-in-btn i { font-size: 14px; }

/* --- Member cards & friend badge --- */
.member-bio { font-size: 0.85rem !important; }
.member-tag { font-size: 0.66rem !important; padding: 2px 7px !important; }
.member-photo .friend-badge {
  position: absolute;
  top: 12px; right: 12px;
  padding: 4px 10px;
  background: rgba(255,90,110,0.18);
  border: 1px solid rgba(255,90,110,0.55);
  color: #ff8095;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  line-height: 1.4;
  letter-spacing: 1px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
  z-index: 3;
}
.member-photo .friend-badge i { color: #ff5a6e; }

/* --- Filter chips row: ensure single row on mobile --- */
.members-filters { gap: 6px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.members-filters::-webkit-scrollbar { display: none; }
@media (max-width: 720px) {
  .toolbar { gap: 10px; }
  .members-filters { gap: 5px; flex-wrap: nowrap; }
  .members-filters .chip {
    padding: 7px 11px; font-size: 0.66rem; letter-spacing: 1px; flex-shrink: 0;
  }
}

/* --- TOP cards: compact, no stats, no bio --- */
.members-grid.grid-top { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.members-grid.grid-top .top-card .member-photo { aspect-ratio: 1 / 1; }
.top-card-body { padding: 12px 14px 16px; min-height: 50px; }
.top-card-game {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--silver); font-weight: 600;
  background: rgba(0,245,255,0.05);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 999px;
  padding: 6px 12px;
}
.top-card-game.empty {
  background: transparent;
  border-color: var(--border);
  color: var(--dim);
  font-style: italic;
}
.top-card-game i { color: var(--magenta); }

/* --- Mobile header (single row nav) --- */
@media (max-width: 720px) {
  .container { flex-wrap: wrap; gap: 8px; padding: 8px 14px; height: auto; min-height: var(--header-h); }
  .logo { order: 1; font-size: 1.05rem; }
  .header-right { order: 2; margin-left: auto; gap: 8px; }
  .nav {
    order: 3; flex-basis: 100%; transform: none !important;
    position: static !important; flex-direction: row !important;
    overflow-x: auto; overflow-y: hidden;
    white-space: nowrap;
    padding: 4px 0 6px;
    gap: 2px; background: transparent !important;
    border: none !important; backdrop-filter: none !important;
    scrollbar-width: none;
    scroll-behavior: auto;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link { padding: 7px 11px !important; font-size: 0.74rem; flex-shrink: 0; }
  .menu-toggle { display: none !important; }
  .sign-in-btn { padding: 8px 16px; font-size: 0.82rem; gap: 8px; }
  .sign-in-btn span { display: inline; }
  .sign-in-btn::after { content: none; }
}

/* --- Community Life list (homepage) --- */
.community-life { display: flex; flex-direction: column; gap: 16px; max-width: 980px; margin: 0 auto; }
.life-card {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 22px; align-items: center;
  padding: 18px 22px; min-height: 140px;
}
.life-card .life-photo {
  width: 180px; height: 120px; border-radius: 12px;
  background: linear-gradient(135deg,#1a1f30,#0a0d18) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim); font-size: 2.2rem;
}
.life-card .life-body { min-width: 0; }
.life-card .life-date {
  display: inline-block; padding: 4px 11px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 999px; font-family: 'Orbitron',sans-serif; font-size: 0.72rem;
  letter-spacing: 2px; color: var(--silver); margin-bottom: 8px;
}
.life-card h3 {
  font-family: 'Orbitron',sans-serif; font-size: 1.1rem; color: #fff;
  margin-bottom: 6px; letter-spacing: 1px;
}
.life-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 720px) {
  .life-card { grid-template-columns: 1fr; padding: 14px; }
  .life-card .life-photo { width: 100%; height: 160px; }
}

/* --- Info-card with photo (Сила в команде) --- */
.info-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.info-card .info-card-photo {
  width: 100%; height: 180px;
  background-position: center; background-size: cover; background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
}
.info-card .info-card-body { padding: 22px 24px; flex: 1; }
.info-card.with-photo { min-height: 380px; }
.info-card:not(.with-photo) .info-card-body { padding: 28px; }
.info-card .info-num { display: block; margin-bottom: 8px; }

/* --- Stats summary: 5-card row, perfectly aligned --- */
.stats-summary.stats-summary-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: stretch;
}
.stats-summary.stats-summary-5 .stat-card {
  display: flex; flex-direction: column;
  justify-content: space-between;
  text-align: center;
  padding: 22px 18px;
  min-height: 200px;
}
.stats-summary.stats-summary-5 .stat-card h3 {
  min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 2.5px;
  line-height: 1.25;
}
.stats-summary.stats-summary-5 .stat-card .stat-number {
  font-size: 2.4rem;
  margin: 12px 0;
}
.stats-summary.stats-summary-5 .stat-card .stat-desc {
  min-height: 18px;
  margin: 0;
}
.stats-summary.stats-summary-5 .stat-card:not(:last-child)::after {
  content: ''; position: absolute; right: -8px; top: 25%; height: 50%;
  width: 1px; background: var(--border);
}
@media (max-width: 980px) {
  .stats-summary.stats-summary-5 {
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 8px;
  }
  .stats-summary.stats-summary-5 .stat-card {
    padding: 14px 8px; min-height: 150px;
  }
  .stats-summary.stats-summary-5 .stat-card h3 {
    font-size: 0.62rem; letter-spacing: 1.5px; min-height: 32px;
  }
  .stats-summary.stats-summary-5 .stat-card .stat-number { font-size: 1.5rem; margin: 6px 0; }
  .stats-summary.stats-summary-5 .stat-card .stat-desc { font-size: 0.6rem; letter-spacing: 1.2px; }
  .stats-summary.stats-summary-5 .stat-card::after { display: none !important; }
}
@media (max-width: 480px) {
  .stats-summary.stats-summary-5 .stat-card { padding: 10px 4px; min-height: 130px; }
  .stats-summary.stats-summary-5 .stat-card h3 { font-size: 0.56rem; }
  .stats-summary.stats-summary-5 .stat-card .stat-number { font-size: 1.25rem; }
  .stats-summary.stats-summary-5 .stat-card .stat-desc { font-size: 0.54rem; }
}

/* --- Stat rows: align start-of-rows on a single vertical --- */
.stat-row { grid-template-columns: 1fr auto !important; gap: 18px; align-items: center; }
.stat-row .stat-row-left {
  display: flex; align-items: center; gap: 14px; min-width: 0;
}
.stat-row .stat-row-left .rank { flex-shrink: 0; }
.stat-row .stat-row-left .nick-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-row .stat-row-left .nick { font-family: 'Orbitron',sans-serif; font-weight: 700; font-size: 1.02rem; color: #fff; }
.stat-row .stat-row-left .last-game {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; color: var(--silver);
  background: rgba(0,245,255,0.06);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 999px;
  padding: 2px 9px;
  width: fit-content; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-row .stat-row-left .last-game i { color: var(--magenta); }
.stat-row .row-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: center; }
.stat-row .row-stats .ist {
  padding: 0 14px; display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-size: 0.9rem; font-weight: 600; white-space: nowrap;
}
.stat-row .row-stats .ist:last-child { border-right: none; padding-right: 0; }
.stat-row .row-stats .ist b { font-family: 'Orbitron',sans-serif; font-weight: 800; color: #fff; font-size: 0.95rem; }
.stat-row .row-stats .ist i {
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.stat-row .row-stats .ist:nth-child(1) i { color: #00f5ff; background: rgba(0,245,255,0.08); border-color: rgba(0,245,255,0.3); }
.stat-row .row-stats .ist:nth-child(2) i { color: #ff00aa; background: rgba(255,0,170,0.08); border-color: rgba(255,0,170,0.3); }
.stat-row .row-stats .ist:nth-child(3) i { color: #ffd24a; background: rgba(255,210,74,0.08); border-color: rgba(255,210,74,0.3); }
.stat-row .row-stats .ist:nth-child(4) i { color: #4ade80; background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.3); }

@media (max-width: 720px) {
  .stat-row { grid-template-columns: 1fr; gap: 10px; }
  .stat-row .row-stats { padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
  .stat-row .row-stats .ist { padding: 0 8px; font-size: 0.78rem; }
}

/* --- Profile hero: inline stats + edit button --- */
.profile-online-status {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.92rem;
  margin-top: 2px;
}
.profile-online-status i { font-size: 8px; }
.profile-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
}
.profile-hero-stats .phs-cell { text-align: center; min-width: 0; }
.profile-hero-stats .phs-v {
  font-family: 'Orbitron',sans-serif; font-weight: 800;
  font-size: 1.5rem; color: #fff;
  line-height: 1.1;
}
.profile-hero-stats .phs-l {
  font-size: 0.68rem;
  letter-spacing: 2.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
  line-height: 1.3;
}
.profile-hero-stats .phs-sub {
  font-size: 0.62rem;
  letter-spacing: 1px;
  color: var(--dim);
  text-transform: uppercase;
  margin-top: 1px;
}
.last-game-text {
  margin-top: 12px;
  color: var(--silver);
  font-size: 0.96rem;
}
.last-game-text b { color: #fff; font-weight: 700; }
.last-game-text input {
  margin-top: 4px; width: 100%; max-width: 340px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border-2);
  border-radius: 8px; padding: 6px 10px; color: #fff;
}
.profile-hero-actions {
  display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap;
}

/* --- Block-level edit on profile --- */
.profile-block h2 { position: relative; padding-right: 36px; }
.profile-block .block-edit-btn {
  position: absolute; right: 0; top: -2px;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.profile-block .block-edit-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.profile-block .block-edit-btn.hidden-during-edit { display: none; }
.block-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 14px;
}
.btn.btn-sm { padding: 7px 14px; font-size: 0.72rem; letter-spacing: 1.3px; }
.btn.btn-xs { padding: 6px 11px; font-size: 0.68rem; letter-spacing: 1px; }
.btn.btn-magenta { background: rgba(255,90,110,0.08); border-color: rgba(255,90,110,0.4); color: #ff8095; }

/* --- Last-game inline in stats top --- */
.last-game-block { display: none !important; /* Replaced by last-game-text in hero */ }

/* --- Profile games edit --- */
.profile-game .rm-game-btn {
  margin-left: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  color: var(--muted);
  width: 22px; height: 22px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px; line-height: 1;
}
.profile-game .rm-game-btn:hover { color: #fff; background: rgba(255,90,110,0.18); border-color: rgba(255,90,110,0.4); }
.add-game-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add-game-row input {
  flex: 1; min-width: 200px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--border-2);
  border-radius: 8px; color: var(--text); font-family: inherit;
}

/* --- Platform list (unified card) --- */
.platform-list { background: rgba(255,255,255,0.025); border: 1px solid var(--border); border-radius: 14px; padding: 0 4px; }
.platform-list .platform-row {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 12px 14px !important;
}
.platform-list .platform-row:last-child { border-bottom: none !important; }

/* --- Events: bottom row aligned --- */
.event-meta-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; gap: 10px; flex-wrap: wrap;
}
.event-meta-bottom .event-meta-left { display: flex; align-items: center; gap: 10px; }
.event-meta-bottom .event-meta-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-row { grid-template-columns: 180px 1fr; }
.event-row .e-actions { display: none; }
.event-row .e-info { display: flex; flex-direction: column; }
.event-row .e-info p { flex: 1; }
.like-btn { padding: 6px 11px; font-size: 0.78rem; }
.like-btn i { font-size: 12px; }
.pill-stat { padding: 5px 10px; font-size: 0.78rem; }
@media (max-width: 720px) {
  .event-row { grid-template-columns: 1fr; }
  .event-row .e-photo { width: 100%; height: 180px; }
  .event-meta-bottom { gap: 8px; }
  .event-meta-bottom .btn-xs { padding: 6px 9px; font-size: 0.62rem; letter-spacing: 0.8px; }
  .event-meta-bottom .like-btn { padding: 5px 9px; font-size: 0.72rem; }
  .pill-stat { padding: 4px 9px; font-size: 0.72rem; }
}

/* --- Hide old top-actions in profile (now in hero) --- */
.profile-actions-bottom { display: flex; justify-content: center; gap: 12px; margin: 30px 0 10px; }

/* --- Chat (squad) - always visible for squad members (has-chat) --- */
body:not(.has-chat) .chat-panel,
body:not(.has-chat) .chat-toggle { display: none !important; }
body.has-chat .profile-layout { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1100px) {
  body.has-chat .profile-layout { grid-template-columns: 1fr; }
}

/* --- "Хочу в сквад" block --- */
.want-squad-section { max-width: 900px; margin: 60px auto 0; padding: 0 20px; }
.want-squad-section .section-title { text-align: center; margin-bottom: 24px; }
.want-squad-card { padding: 32px; text-align: center; }
.want-squad-card .want-squad-text {
  color: var(--text); font-size: 1.05rem; line-height: 1.7;
  margin-bottom: 24px; white-space: pre-wrap;
}
.want-squad-platforms {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-bottom: 18px;
}
.ws-plat-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 1px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.84rem;
  text-decoration: none;
  transition: all 0.25s ease;
}
.ws-plat-btn:hover { color: #fff; transform: translateY(-2px); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); }
.ws-plat-btn i { font-size: 16px; }
.ws-plat-btn.discord  { color: #7d8edf; border-color: rgba(125,142,223,0.4); background: rgba(125,142,223,0.06); }
.ws-plat-btn.discord:hover { color: #fff; background: rgba(125,142,223,0.18); }
.ws-plat-btn.telegram { color: #5fb6e8; border-color: rgba(95,182,232,0.4); background: rgba(95,182,232,0.06); }
.ws-plat-btn.telegram:hover { color: #fff; background: rgba(95,182,232,0.18); }
.ws-plat-btn.twitch   { color: #b388ff; border-color: rgba(145,70,255,0.4); background: rgba(145,70,255,0.08); }
.ws-plat-btn.twitch:hover { color: #fff; background: rgba(145,70,255,0.22); }
.ws-plat-btn.youtube  { color: #e58a8a; border-color: rgba(229,138,138,0.4); background: rgba(229,138,138,0.06); }
.ws-plat-btn.youtube:hover { color: #fff; background: rgba(229,138,138,0.18); }
.ws-plat-btn.vk       { color: #6dadff; border-color: rgba(109,173,255,0.4); background: rgba(109,173,255,0.06); }
.ws-plat-btn.vk:hover { color: #fff; background: rgba(109,173,255,0.18); }
.ws-plat-btn.email    { color: var(--silver); }
.want-squad-actions { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }

/* --- Want-squad edit modal --- */
.ws-plat-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 220px; overflow-y: auto; }
.ws-plat-edit-row {
  display: grid; grid-template-columns: 110px 1fr auto;
  gap: 8px; align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ws-plat-edit-row .ws-plat-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 0.86rem;
}
.ws-plat-edit-row .ws-plat-val { color: var(--muted); font-size: 0.85rem; word-break: break-all; min-width: 0; }
.ws-plat-edit-row .rm-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 7px; cursor: pointer; font-size: 16px;
}
.ws-plat-edit-row .rm-btn:hover { color: #fff; background: rgba(255,90,110,0.18); }
.ws-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-add-row select, .ws-add-row input {
  padding: 9px 12px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
}
.ws-add-row input { flex: 1; min-width: 180px; }

/* --- Mobile profile tweaks --- */
@media (max-width: 960px) {
  .profile-hero { grid-template-columns: 1fr; }
  .profile-avatar { width: 200px; height: 200px; font-size: 4.5rem; margin: 0 auto; }
  .profile-hero-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .profile-hero-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; }
  .profile-hero-stats .phs-v { font-size: 1.25rem; }
.profile-hero-stats .phs-l {
  font-size: 0.68rem;
  letter-spacing: 2.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
  line-height: 1.3;
}
}

/* --- Galaxy: tooltip name --- */
.galaxy-tooltip .name {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Bigger touch targets on mobile, minor polish --- */
@media (max-width: 720px) {
  .btn { min-height: 38px; }
  .main-content { padding-left: 14px; padding-right: 14px; padding-top: calc(var(--header-h) + 28px); }
  .modal { padding: 22px 18px; }
  .info-section { padding: 50px 14px; }
  .page-title { font-size: clamp(1.5rem, 5vw, 2rem); }
}

/* Mobile homepage info-grid */
@media (max-width: 720px) {
  .info-grid { gap: 14px; }
  .info-card .info-card-photo { height: 150px; }
  .info-card .info-card-body { padding: 18px; }
}

/* ===================== v7 OVERRIDES (final polish) ===================== */

/* --- Hero stats: one row on mobile (under Explore Galaxy button) --- */
.hero-stats {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start;
  flex-wrap: nowrap !important;
  gap: 18px;
}

.hero-stats > div {
  width: 100px;
  text-align: center;
  flex: 0 0 100px;
  min-width: 0;
}

@media (max-width: 720px) {
  .hero-stats {
    gap: 3px !important;
    margin: 24px auto 0 !important;
    padding: 14px 10px !important;
    width: auto !important;
    max-width: calc(100% - 28px);
    overflow: hidden;
  }
  .hero-stats > div { min-width: 0; padding: 0 6px; }
  .hero-stats .stat-num {
    font-size: clamp(1.45rem, 5.6vw, 1.9rem) !important;
    line-height: 1;
	font-weight: 800 !important;
  }
  .hero-stats .stat-label {
    font-size: 0.54rem !important;
    letter-spacing: 1px !important;
  }
}
@media (max-width: 380px) {
  .hero-stats { gap: 3px !important; padding: 12px 6px !important; }
  .hero-stats .stat-num { font-size: 1rem !important; }
  .hero-stats .stat-label { font-size: 0.5rem !important; }
}

/* --- Events: participants -> button -> heart close together --- */
.event-meta-bottom {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 10px !important;
}
.event-meta-bottom .event-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.event-meta-bottom .event-meta-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 720px) {
  .event-meta-bottom { gap: 8px !important; }
  .event-meta-bottom .event-meta-actions { gap: 6px; }
}

/* --- Rules / "Хочу в сквад": same container width as rules list --- */
.want-squad-section {
  max-width: 900px !important;
  margin: 60px auto 0 !important;
  padding: 0 !important;
}
.rules-list { max-width: 900px; margin: 0 auto; }
@media (max-width: 980px) {
  .want-squad-section { padding: 0 20px !important; }
  .rules-list { padding: 0 20px; }
}

/* Smaller platform buttons in want-squad */
.ws-plat-btn {
  padding: 8px 16px !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.8px !important;
  gap: 7px !important;
}
.ws-plat-btn i { font-size: 13px !important; }

/* --- Profile invite-friend button counter --- */
#invFriendCount, #toolbarFriendCount {
  font-size: 0.68rem;
  opacity: 0.85;
  margin-left: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* --- Friends modal list --- */
.friend-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}
.friend-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.friend-item .friend-nick {
  font-weight: 700; color: #fff; min-width: 0;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend-item .friend-inviter {
  font-size: 0.78rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend-item .rm-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  color: var(--muted);
  width: 26px; height: 26px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 15px; line-height: 1;
}
.friend-item .rm-btn:hover {
  color: #fff;
  background: rgba(255,90,110,0.18);
  border-color: rgba(255,90,110,0.4);
}
.friend-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.friend-add-row input {
  flex: 1; min-width: 200px;
  padding: 9px 12px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
}

/* --- Toolbar invite button (members page) --- */
.toolbar #toolbarInviteBtn {
  margin-left: 0;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar #toolbarInviteBtn { font-size: 0.68rem; padding: 7px 12px; flex-shrink: 0; }
}

/* --- Profile last-game text: more visible, read-only --- */
.last-game-text {
  display: block;
  color: var(--silver);
  font-size: 0.96rem;
  margin-top: 12px;
}
.last-game-text b {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), var(--silver));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Stat-card text: keep alignment with new "Получено от сквада" wording --- */
.stats-summary.stats-summary-5 .stat-card h3 { line-height: 1.18; }

/* --- Mobile hero rows tighter so 3 columns fit edge-to-edge --- */
@media (max-width: 480px) {
  .hero-content { padding: 0 12px; }
  .hero-title .row-1, .hero-title .row-2 { font-size: clamp(2rem, 11vw, 3.4rem); }
  .hero-subtitle { font-size: 0.92rem; }
}

/* --- Member counter friend mention --- */
.page-subtitle b { color: #fff; font-weight: 700; }

/* profile stats fix */
.profile-hero-stats .phs-sub{
  display:none;
}

/* ===== MATRIX SQUAD Platform Hover ===== */

.platform-list .platform-row {
  transition:
    transform .25s ease,
    box-shadow .25s ease,
    border-color .25s ease,
    background .25s ease;
}

.platform-list .platform-row:hover {
  transform: translateY(-6px) scale(1.02);

  background: rgba(255,255,255,0.04) !important;

  box-shadow:
    0 10px 25px rgba(0,0,0,.35),
    0 0 20px rgba(124,58,237,.18);

  border-radius: 12px !important;

  position: relative;
  z-index: 5;
}

.platform-list .platform-row .pname i {
  transition:
    transform .25s ease,
    filter .25s ease;
}

.platform-list .platform-row:hover .pname i {
  transform: scale(1.25);

  filter:
    drop-shadow(0 0 6px rgba(124,58,237,.7))
    drop-shadow(0 0 12px rgba(6,182,212,.4));
}

.platform-list .platform-row:hover .pname {
  color: #ffffff;
}

.platform-list .platform-row:hover a {
  color: #ffffff;
}


/* ===== MATRIX SQUAD Members Platform Animation ===== */

.member-platforms a {
  transition:
    transform .25s ease,
    box-shadow .25s ease,
    filter .25s ease,
    background .25s ease,
    border-color .25s ease !important;
}

.member-platforms a:hover {
  transform: scale(1.4);

  box-shadow:
    0 6px 14px rgba(0,0,0,.25),
    0 0 6px currentColor;

  filter:
    drop-shadow(0 0 3px currentColor);

  z-index: 5;
}

.member-platforms a:hover i {
  transform: scale(1.10);
}

.member-platforms a i {
  transition:
    transform .25s ease,
    filter .25s ease;
}


/* MATRIX SQUAD custom platform PNG icons */
.member-platforms a img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  transition:
    transform .25s ease,
    filter .25s ease;
}

.member-platforms a:hover img {
  transform: scale(1.15);
}


/* ===== MATRIX SQUAD Members Platform Animation v2 ===== */

.member-platforms a {
  transition:
    transform .30s ease,
    border-color .30s ease,
    box-shadow .30s ease;
  position: relative;
  z-index: 1;
}

.member-platforms a:hover {
  transform: scale(1.55);
  z-index: 25;

  border-color: rgba(255,255,255,.35);

  box-shadow:
    0 0 8px rgba(255,255,255,.10);
}

.member-platforms a img,
.member-platforms a i {
  transition: transform .30s ease;
}

.member-platforms a:hover img,
.member-platforms a:hover i {
  transform: scale(1.10);
}


/* ===== Platform Hover Test ===== */

.member-platforms a:hover {
  transform: scale(1.62) !important;
  z-index: 25 !important;

  border-color: rgba(255,255,255,.55) !important;

  box-shadow:
    0 0 14px rgba(255,255,255,.16),
    0 0 24px rgba(255,255,255,.08) !important;
}


.member-platforms a:hover {
  transform: scale(1.62) !important;
  z-index: 25 !important;

  border-color: rgba(255,255,255,.50) !important;

  box-shadow:
    0 0 12px rgba(255,255,255,.12),
    0 0 22px rgba(255,255,255,.06) !important;
}


.member-platforms a:hover {
  transform: scale(1.62) !important;
  z-index: 25 !important;

  border-color: rgba(255,255,255,.42) !important;

  box-shadow:
    0 0 18px rgba(255,255,255,.10),
    0 0 36px rgba(255,255,255,.05) !important;

  background: rgba(255,255,255,.03) !important;
}

.member-platforms a:hover img,
.member-platforms a:hover i {
  transform: scale(1.12) !important;
  filter: none !important;
}


/* ===== Platform Hover Speed + No Inner Glow ===== */

.member-platforms a {
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease !important;
}

.member-platforms a:hover {
  transform: scale(1.62) !important;
  z-index: 25 !important;

  background: rgba(255,255,255,.02) !important;

  border-color: rgba(255,255,255,.45) !important;

  box-shadow:
    0 0 14px rgba(255,255,255,.08),
    0 0 28px rgba(255,255,255,.04) !important;
}

.member-platforms a img,
.member-platforms a i,
.member-platforms a:hover img,
.member-platforms a:hover i {
  filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transform: none !important;
}


/* ===== MAC DOCK EFFECT ===== */

.member-platforms {
  overflow: visible !important;
}

.member-platforms a {
  position: relative;
  z-index: 1;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;

  transform-origin: center center;
}

.member-platforms a:hover {
  transform: scale(1.35) translateY(-6px);
  z-index: 20;

  border-color: rgba(255,255,255,.45);

  box-shadow:
    0 0 10px rgba(255,255,255,.08),
    0 0 20px rgba(255,255,255,.04);
}

/* сосед справа */
.member-platforms a:hover + a {
  transform: scale(1.12) translateY(-3px);
}

/* сосед слева */
.member-platforms a:has(+ a:hover) {
  transform: scale(1.12) translateY(-3px);
}


/* ===== NO GLOW ===== */

.member-platforms a:hover {
  box-shadow: none !important;
}


/* ===== EVENTS v2: author pill, wider card, reordered meta ===== */

/* Карточка: шире (убираем третью колонку), чуть ниже по высоте */
.event-row {
  grid-template-columns: 160px 1fr !important;
  min-height: 140px !important;
  padding: 16px 22px !important;
  gap: 20px !important;
}
.event-row .e-photo {
  width: 160px !important;
  height: 120px !important;
}

/* Плашка автора мероприятия */
.ev-author-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(145, 70, 255, 0.08);
  border: 1px solid rgba(145, 70, 255, 0.28);
  border-radius: 999px;
  font-size: 0.80rem;
  color: var(--muted);
  text-decoration: none;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}
.ev-author-pill i {
  color: var(--twitch);
  font-size: 0.82rem;
}
.ev-author-pill:hover {
  background: rgba(145, 70, 255, 0.16);
  border-color: rgba(145, 70, 255, 0.5);
  color: var(--silver);
}

/* Лайк-кнопка теперь в event-meta-right рядом с карандашом */
.event-meta-bottom .event-meta-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px !important;
}

/* Tooltip участников: новый формат Создатель + Участники */
.participants-tooltip {
  min-width: 180px;
}
.participants-tooltip .tt-section-label {
  font-weight: 700;
  color: var(--silver);
  margin-bottom: 4px;
  font-size: 0.80rem;
}
.participants-tooltip .tt-section-label + .tt-section-label,
.participants-tooltip div[style*="margin:8px"] {
  margin-top: 8px;
}

@media (max-width: 720px) {
  .event-row {
    grid-template-columns: 1fr !important;
    min-height: unset !important;
  }
  .event-row .e-photo {
    width: 100% !important;
    height: 170px !important;
  }
  .ev-author-pill { font-size: 0.75rem; padding: 4px 10px; }
}

/* ===== EVENTS v3: plain author link, larger photo ===== */

/* Фото мероприятия +18% */
.event-row .e-photo {
  width: 185px !important;
  height: 145px !important;
}
.event-row {
  grid-template-columns: 185px 1fr !important;
}

/* Убираем кнопку-плашку автора */
.ev-author-pill { display: none !important; }

/* Ссылка автора мероприятия — точно как .profile-twitch в профиле */
.ev-author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--twitch);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  transition: color 0.15s;
}
.ev-author-link i {
  font-size: 1rem;
}
.ev-author-link:hover {
  color: #b388ff;
  text-decoration: none;
}

@media (max-width: 720px) {
  .event-row .e-photo { width: 100% !important; height: 185px !important; }
  .event-row { grid-template-columns: 1fr !important; }
}

.row-stats-table { border-collapse: collapse; margin-left: auto; }
.row-stats-table td { padding: 0 6px; vertical-align: middle; white-space: nowrap; }
.row-stats-table .rst-icon { width: 28px; text-align: center; }
.row-stats-table .rst-icon i { width:22px;height:22px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;border:1px solid var(--border);background:rgba(255,255,255,0.05); }
.row-stats-table .rst-num { width: 36px; text-align: right; font-family: Orbitron,sans-serif; font-weight:800; color:#fff; font-size:0.98rem; }
.row-stats-table .rst-label { width: 70px; color:var(--text); font-size:0.88rem; font-weight:600; padding-right:12px; }
.row-stats-table .ist-icon-1 { color:#00f5ff; background:rgba(0,245,255,0.08)!important; border-color:rgba(0,245,255,0.3)!important; }
.row-stats-table .ist-icon-2 { color:#ff00aa; background:rgba(255,0,170,0.08)!important; border-color:rgba(255,0,170,0.3)!important; }
.row-stats-table .ist-icon-3 { color:#ffd24a; background:rgba(255,210,74,0.08)!important; border-color:rgba(255,210,74,0.3)!important; }
.row-stats-table .ist-icon-4 { color:#4ade80; background:rgba(74,222,128,0.08)!important; border-color:rgba(74,222,128,0.3)!important; }

@media (max-width: 720px) {
  .stat-row { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
  .stat-row-left { display: flex; align-items: center; gap: 10px; }
  .row-stats-table { width: 100%; margin-left: 0; }
  .row-stats-table tr { display: grid; grid-template-columns: 26px 30px 60px 26px 30px 60px; gap: 4px; align-items: center; }
  .row-stats-table .rst-label { padding-right: 4px; font-size: 0.82rem; }
  .row-stats-table .rst-num { font-size: 0.88rem; width: auto; }
}

