:root {
  --bg: #0B0714;
  --bg-2: #120B22;
  --panel: #171029;
  --line: #2A1E47;
  --text: #F3EEFF;
  --muted: #A99BC9;
  --violet: #7C3AED;
  --lav: #B794FF;
  --acid: #D4FF3A;
  --steam: #1B2838;
  --radius: 14px;
  --display: 'Russo One', Impact, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.55;
  overflow-x: hidden;
}
/* без выделения текста (клики-«выстрелы» не подсвечивают слова); в поле поиска — можно */
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
input, textarea { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: .02em; }

.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 800; font-size: 15px; cursor: pointer; font-family: var(--body);
  transition: transform .15s, box-shadow .2s, background .2s;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn:hover { transform: translateY(-2px); }
.btn { white-space: nowrap; }
.btn--sm { padding: 10px 16px; font-size: 14px; }
.btn--accent { background: var(--acid); color: #120B22; box-shadow: 0 0 0 0 rgba(212,255,58,.5); }
.btn--accent:hover { box-shadow: 0 8px 30px -6px rgba(212,255,58,.55); }
.btn--ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--lav); }
.btn.is-soon { opacity: .55; pointer-events: none; border-style: dashed; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(11,7,20,.75); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 22px; letter-spacing: .08em; }
.nav__links { display: flex; gap: 22px; margin-left: auto; font-weight: 700; font-size: 14px; color: var(--muted); }
.nav__links a:hover { color: var(--acid); }
.nav__auth { display: flex; align-items: center; gap: 10px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; overflow: clip; border-bottom: 1px solid var(--line); }
.hero__grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 10%, transparent 70%);
  opacity: .5;
}
.hero__inner {
  position: relative; z-index: 1;
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 32px;
  padding: clamp(48px, 9vw, 110px) clamp(16px, 4vw, 48px) 64px;
}
.tag { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.hero__title {
  font-size: clamp(76px, 15vw, 190px); line-height: .9; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff 30%, var(--lav));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 80px rgba(124,58,237,.35);
}
.hero__sub { font-size: clamp(17px, 2vw, 21px); color: var(--muted); max-width: 520px; margin: 18px 0 30px; }
.hero__sub b { color: var(--text); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__logo { position: relative; justify-self: center; }
.hero__logo img { width: min(360px, 70vw); height: auto; position: relative; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 30px 40px rgba(0,0,0,.6)); }
.hero__glow { position: absolute; inset: 10%; background: radial-gradient(circle, rgba(124,58,237,.6), transparent 65%); filter: blur(30px); }
@keyframes float { 50% { transform: translateY(-14px) rotate(-1.5deg); } }

.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 28px; margin: 44px 0 0; }
.stats div { border-left: 2px solid var(--violet); padding-left: 12px; }
.stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-family: var(--display); font-size: 30px; color: var(--acid); }

.ticker { position: relative; z-index: 1; overflow: hidden; background: var(--violet); padding: 12px 0; transform: skewY(-1deg); margin: 0 -10px -6px; }
.ticker__track { display: flex; gap: 28px; width: max-content; animation: tick 28s linear infinite; font-family: var(--display); font-size: 20px; letter-spacing: .1em; }
.ticker i { color: var(--acid); font-style: normal; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: clamp(64px, 9vw, 110px) clamp(16px, 4vw, 48px) 0; }
.section__head { max-width: 720px; margin-bottom: 40px; }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.kicker { margin: 0 0 10px; color: var(--acid); font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
h2 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; }
.hl { color: var(--lav); }
.lead { color: var(--muted); font-size: 17px; margin: 14px 0 0; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--violet); transform: translateY(-4px); }
.card__ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: rgba(124,58,237,.18); color: var(--acid); font-size: 22px; margin-bottom: 18px; }
.card h3 { font-size: 20px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- roster ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 8px; font: 700 14px var(--body); cursor: pointer; }
.seg button.is-on { background: var(--violet); color: #fff; }
.toolbar select, .toolbar input {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font: 500 14px var(--body);
}
.toolbar input { width: 170px; }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.player {
  position: relative; background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  transition: border-color .2s, transform .2s;
}
.player:hover { border-color: var(--lav); }
.player__top { display: flex; gap: 14px; align-items: center; }
.ava { position: relative; flex: none; width: 58px; height: 58px; border-radius: 12px; background: var(--violet); display: grid; place-items: center; font-family: var(--display); font-size: 22px; overflow: visible; }
.ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.ava::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--panel); background: #555; }
.ava.on::after { background: #57CBDE; }
.ava.game::after { background: var(--acid); }
.player__name { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__status { font-size: 13px; color: var(--muted); }
.player__status.game { color: var(--acid); }
.badge--red { background: rgba(255,70,70,.18) !important; color: #FF7B7B !important; }
.badge--mute { background: rgba(255,255,255,.06) !important; color: var(--muted) !important; }
.player__meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); min-height: 16px; }
.badge { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: rgba(183,148,255,.15); color: var(--lav); }
.player__bio { margin: 12px 0 0; color: var(--muted); font-size: 14px; min-height: 20px; }
.player__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.player__stats div { text-align: center; }
.player__stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 17px; }
.player__stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
/* фишки рангов */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font: 400 13px var(--display); letter-spacing: .03em; padding: 4px 9px; border-radius: 6px; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent); }
.chip--grey { color: #8E86A6; font-family: var(--body); font-weight: 700; font-size: 12px; }
.chip--sky { color: #8FC3F0; } .chip--blue { color: #4B8BFF; } .chip--purple { color: #A066FF; }
.chip--pink { color: #E25CE8; } .chip--red { color: #FF4D5E; } .chip--gold { color: #FFD24A; }
.chip--faceit { color: #FF7A1A; display: inline-flex; align-items: center; gap: 6px; }
a.chip--faceit:hover { background: color-mix(in srgb, currentColor 25%, transparent); }
.lvl { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 50%; font: 400 12px var(--display); color: #120B22; }
.tile .lvl { min-width: 30px; height: 30px; font-size: 18px; }
.lvl--f1 { background: #EEE; } .lvl--f2 { background: #1CE400; } .lvl--f4 { background: #FFC800; }
.lvl--f8 { background: #FF6309; } .lvl--f10 { background: #FE1F00; color: #fff; }
.recent { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.recent i { font: 400 12px var(--display); font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; }
.recent i.w { background: rgba(87,217,138,.18); color: #57D98A; }
.recent i.l { background: rgba(255,77,94,.18); color: #FF4D5E; }
.dlg h4 a { color: var(--acid); }
.player__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pd__csstats { width: 100%; justify-content: center; margin-top: 18px; }
.chips:empty { display: none; }
.stats-pick { position: relative; margin-top: 14px; }
.player:has(.stats-pick__menu:not([hidden])) { z-index: 30; transform: none; }
.stats-pick__btn { width: 100%; justify-content: center; }
.stats-pick__menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 2px; padding: 6px; background: var(--bg-2); border: 1px solid var(--violet); border-radius: 10px; box-shadow: 0 20px 40px -10px rgba(0,0,0,.7); }
.stats-pick__menu[hidden] { display: none; }
.stats-pick__menu a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: 7px; }
.stats-pick__menu a:hover { background: rgba(124,58,237,.2); }
.stats-pick__menu b { font-size: 14px; }
.stats-pick__menu small { font-size: 12px; color: var(--muted); }
.leetify-cta { margin-top: 12px; padding: 8px 10px; border-radius: 8px; border: 1px dashed rgba(212,255,58,.45); font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.leetify-cta a { color: var(--acid); font-weight: 800; text-decoration: underline; }
.player__more { white-space: nowrap; margin-top: 0; font-size: 13px; font-weight: 700; color: var(--lav); }
.player:hover .player__more { color: var(--acid); }
.player__stats span { white-space: nowrap; }

/* окно игрока */
.dlg { background: var(--panel); color: var(--text); border: 1px solid var(--violet); border-radius: var(--radius); padding: 0; width: min(720px, 94vw); max-height: 90vh; }
.dlg::backdrop { background: rgba(5,3,10,.75); backdrop-filter: blur(4px); }
.dlg__body { padding: 26px; }
.dlg__close { position: sticky; float: right; top: 12px; margin: 12px 12px 0 0; z-index: 2; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; font-size: 15px; }
.dlg__close:hover { border-color: var(--acid); color: var(--acid); }
.pd__head { display: flex; gap: 16px; align-items: center; }
.pd__head .ava { width: 76px; height: 76px; }
.pd__head h3 { font-size: 26px; }
.dlg h4 { font: 400 16px var(--display); color: var(--lav); margin: 24px 0 10px; letter-spacing: .03em; }
.dlg h4 small { font-family: var(--body); color: var(--muted); font-size: 12px; margin-left: 6px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.tile b { display: block; font: 400 22px var(--display); }
.tile span { font-size: 12px; color: var(--muted); }
.tile small { display: block; font-size: 11px; color: var(--muted); opacity: .7; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 100px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.bar i { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.bar em { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--acid)); }
.bar b { font-family: var(--display); font-weight: 400; text-align: right; }
.matches { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.matches th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; }
.matches td { padding: 8px; border-top: 1px solid var(--line); }
.matches tr.w td:first-child { box-shadow: inset 3px 0 #57D98A; }
.matches tr.l td:first-child { box-shadow: inset 3px 0 #FF4D5E; }
.nostat { margin-top: 20px; padding: 18px; border: 1px dashed var(--acid); border-radius: 10px; }
.nostat p { margin: 0 0 10px; color: var(--muted); }
.nostat b { color: var(--text); }
.pd__links { display: flex; gap: 16px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.pd__links a { color: var(--lav); }
.pd__links a:hover { color: var(--acid); }
.hint a { color: var(--acid); text-decoration: underline; }
@media (max-width: 600px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .matches th:nth-child(4), .matches td:nth-child(4) { display: none; }
}

.player__link { position: absolute; top: 14px; right: 14px; font-size: 12px; color: var(--muted); }
.player__link:hover { color: var(--acid); }

/* ---------- leaders ---------- */
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.lb li[data-id] { cursor: pointer; }
.lb li[data-id]:hover .nm { color: var(--acid); }
.lb { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.lb h3 { font-size: 18px; color: var(--lav); margin-bottom: 14px; }
.lb ol { list-style: none; margin: 0; padding: 0; }
.lb li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lb li:last-child { border: 0; }
.lb .pos { font-family: var(--display); width: 22px; color: var(--muted); }
.lb li:first-child .pos { color: var(--acid); }
.lb .nm { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .vl { font-family: var(--display); }

/* ---------- join ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps li { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.steps__n { font-family: var(--display); font-size: 48px; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--violet); }
.steps h3 { font-size: 19px; }
.steps p { margin: 0 0 6px; color: var(--muted); font-size: 15px; flex: 1; }
.hint { margin-top: 20px; color: var(--muted); font-size: 14px; border-left: 3px solid var(--acid); padding-left: 12px; }

/* ---------- brand ---------- */
.brand {
  position: relative; z-index: 1; max-width: 1240px; margin: clamp(64px, 9vw, 110px) auto 0;
  padding: 0 clamp(16px, 4vw, 48px);
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
}
.brand__logo { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(124,58,237,.6); }
.brand .btn { margin-top: 24px; }

.footer { position: relative; z-index: 1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 100px; padding: 28px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- вход в шапке ---------- */
#authBox { display: flex; }
.me { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.me img { width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--lav); }
.me button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; }
.me button:hover { color: var(--acid); }

/* ---------- чат ---------- */
/* кнопка «Чат» в шапке */
.btn--chat { position: relative; background: var(--violet); color: #fff; border-color: transparent; }
.btn--chat:hover { box-shadow: 0 8px 26px -6px rgba(124,58,237,.8); }
.chat-badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--acid); color: #120B22; font: 800 11px/20px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--bg); animation: pop .3s; }
.chat-badge[hidden] { display: none; }
@keyframes pop { from { transform: scale(.4); } }

/* выезжающая панель чата */
.chat-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5,3,10,.55); backdrop-filter: blur(2px); }
.chat-backdrop[hidden] { display: none; }
.chat-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(420px, 100vw);
  display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--violet);
  box-shadow: -30px 0 80px -20px rgba(0,0,0,.8);
  transform: translateX(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); visibility: hidden;
}
.chat-drawer.is-open { transform: none; visibility: visible; }
.chat-drawer__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.chat-drawer__title { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.chat-drawer__title > b { font: 400 18px var(--display); letter-spacing: .03em; }
.chat-drawer__title span { font-size: 12px; color: var(--muted); }
.chat-drawer__title span b { color: var(--acid); }
.chat-drawer__close { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 15px; }
.chat-drawer__close:hover { border-color: var(--acid); color: var(--acid); }
.chat-drawer__online { list-style: none; margin: 0; padding: 10px 16px; display: flex; gap: 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.chat-drawer__online:empty { display: none; }
.chat-drawer__online li { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 52px; }
.chat-drawer__online .ava { width: 38px; height: 38px; border-radius: 10px; font-size: 12px; }
.chat-drawer__online .ava::after { width: 11px; height: 11px; border-width: 2px; }
.chat-drawer__nick { font-size: 11px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.chat__main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
@media (max-width: 760px) {
  .chat-drawer { left: 0; width: auto; border-left: 0; }
  .msg { max-width: 95%; }
  .btn--chat { padding: 10px 12px; }
}
@media (max-width: 560px) {
  /* компактная шапка на телефоне: логотип, «Чат», аватар */
  .nav { gap: 10px; }
  .nav__brand span { display: none; }
  #groupLinkNav { display: none; }
  .nav__auth { gap: 8px; }
  .me { gap: 6px; }
  .me button { font-size: 12px; }
}
body.chat-open { overflow: hidden; }

/* всплывашки о новых сообщениях */
.msg-toasts { position: fixed; left: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(340px, calc(100vw - 32px)); }
.msg-toast { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--violet); background: rgba(23,16,41,.96); color: var(--text); font: inherit; box-shadow: 0 16px 40px -12px rgba(0,0,0,.8); animation: toastIn .25s ease-out; transition: opacity .3s, transform .3s; }
.msg-toast:hover { border-color: var(--acid); }
.msg-toast.is-out { opacity: 0; transform: translateY(10px); }
.msg-toast__ava { flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--violet); overflow: hidden; }
.msg-toast__ava img { width: 100%; height: 100%; object-fit: cover; }
.msg-toast__body { min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.msg-toast__body b { color: var(--acid); font-size: 13px; }
.msg-toast__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
body.chat-open .msg-toasts { display: none; }

/* настройки уведомлений 🔔 */
.chat-settings { position: absolute; inset: 64px 0 0 0; z-index: 5; overflow-y: auto; padding: 16px; background: var(--panel); border-top: 1px solid var(--line); }
.chat-settings[hidden] { display: none; }
.chat-settings__head { display: flex; justify-content: space-between; align-items: center; }
.chat-settings__head b { font: 400 18px var(--display); }
.chat-settings__head button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); }
.chat-settings__lead { color: var(--muted); font-size: 14px; margin: 8px 0 14px; }
.ns { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.ns__text { display: flex; flex-direction: column; gap: 3px; }
.ns__text b { font-size: 15px; }
.ns__text small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.ns__text em { font-style: normal; font-size: 12px; color: var(--acid); line-height: 1.4; }
.ns__switch { appearance: none; flex: none; width: 44px; height: 26px; margin-top: 2px; border-radius: 13px; background: #3A2E57; position: relative; transition: background .2s; }
.ns__switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ns__switch:checked { background: var(--violet); }
.ns__switch:checked::after { transform: translateX(18px); background: var(--acid); }
.ns__switch:disabled { opacity: .5; } /* страница не скроллится под открытым чатом */

.chat__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: var(--violet) transparent; }
.chat__empty { margin: auto; color: var(--muted); }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 85%; }
.msg__ava { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--violet); overflow: hidden; }
.msg__ava img { width: 100%; height: 100%; object-fit: cover; }
.msg__body { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 8px 12px; min-width: 0; }
.msg__head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.msg__head b { color: var(--lav); }
.msg__head time { color: var(--muted); font-size: 11px; }
.msg__text { margin-top: 2px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.msg--me { align-self: flex-end; flex-direction: row-reverse; }
.msg--me .msg__body { border-radius: 12px 4px 12px 12px; background: rgba(124,58,237,.22); border-color: rgba(124,58,237,.5); }
.msg--me .msg__head b { color: var(--acid); }
.msg__tools { margin-left: auto; display: none; gap: 4px; }
.msg:hover .msg__tools { display: inline-flex; }
.msg__tools button { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 0 2px; }
.msg__tools button:hover { color: #FF4D5E; }
.chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--bg-2); }
.chat__form input { flex: 1; min-width: 0; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 500 15px var(--body); }
.chat__form input:focus { outline: none; border-color: var(--violet); }
.chat__form button:disabled { opacity: .5; }
.chat__gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; background: rgba(11,7,20,.72); backdrop-filter: blur(6px); }
.chat__gate[hidden] { display: none; }
.chat__gate h3 { font-size: 24px; }
.chat__gate p { margin: 0; color: var(--muted); max-width: 380px; }
.chat__gate-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- эффекты (fx.js) ---------- */
/* курсор-прицел — только для мыши */
@media (hover: hover) and (pointer: fine) {
  html, body { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg stroke='%2305030A' stroke-width='4'%3E%3Cpath d='M16 3v8M16 21v8M3 16h8M21 16h8'/%3E%3C/g%3E%3Cg stroke='%23D4FF3A' stroke-width='2'%3E%3Cpath d='M16 4v7M16 21v7M4 16h7M21 16h7'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='1.6' fill='%23D4FF3A' stroke='%2305030A' stroke-width='.8'/%3E%3C/svg%3E") 16 16, crosshair; }
  a, button, select, [data-stats], .seg button { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg stroke='%2305030A' stroke-width='4'%3E%3Cpath d='M16 6v6M16 20v6M6 16h6M20 16h6'/%3E%3C/g%3E%3Cg stroke='%23FF4D5E' stroke-width='2'%3E%3Cpath d='M16 7v5M16 20v5M7 16h5M20 16h5'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='9' fill='none' stroke='%23FF4D5E' stroke-width='1.5'/%3E%3Ccircle cx='16' cy='16' r='1.6' fill='%23FF4D5E'/%3E%3C/svg%3E") 16 16, pointer; }
  input[type=search] { cursor: text; }
}
.fx-shots { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.fx-smoke { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.fx-radar { display: block; pointer-events: none; }

/* радар «Кто сейчас онлайн» в блоке «Состав» */
.roster-head { max-width: none; display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: center; }
.roster-head .toolbar { margin-top: 22px; }
.radar-box { justify-self: end; width: 300px; }
.radar-box__screen { width: 100%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 1px var(--line), 0 0 60px -10px rgba(124,58,237,.6); }
.radar-box__legend { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.radar-box__legend span { display: inline-flex; align-items: center; gap: 6px; }
.radar-box__legend b { color: var(--acid); font-weight: 800; }
.dot--on, .dot--game { width: 8px; height: 8px; border-radius: 50%; display: inline-block; animation: none; box-shadow: none; }
.dot--on { background: #57CBDE; } .dot--game { background: var(--acid); }
@media (max-width: 760px) {
  .roster-head { grid-template-columns: 1fr; }
  .radar-box { justify-self: center; width: min(300px, 86vw); }
}

/* карточка: 3D-наклон за мышью + уголки «захвата цели» + блик */
.player {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .2s ease-out, border-color .2s, box-shadow .2s;
  transform-style: preserve-3d;
}
.player:hover { box-shadow: 0 20px 50px -20px rgba(124,58,237,.7); }
.player::before {
  content: ''; position: absolute; inset: -7px; pointer-events: none; border-radius: 4px;
  --c: var(--acid); --l: 18px; --w: 2px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) top left / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) top right / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) bottom left / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--l);
  background-repeat: no-repeat;
  opacity: 0; transform: scale(1.08);
  transition: opacity .15s, transform .25s cubic-bezier(.2, 1.6, .4, 1);
}
.player:hover::before { opacity: 1; transform: scale(1); }
.player::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(212,255,58,.13), transparent 45%);
  opacity: 0; transition: opacity .2s;
}
.player:hover::after { opacity: 1; }
.player:hover .ava { box-shadow: 0 0 0 2px var(--acid), 0 0 18px rgba(212,255,58,.45); }
.ava { transition: box-shadow .2s; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .cards, .steps { grid-template-columns: repeat(2, 1fr); }
  .brand { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__auth { margin-left: auto; }
  .hide-sm { display: none; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__logo { order: -1; }
  .hero__logo img { width: 200px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards, .steps { grid-template-columns: 1fr; }
  .toolbar input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
