/* ============================================================
   БУНКЕР · ПОРТАЛ ИГР — тёмный хаб, один файл без сборки
   ============================================================ */

:root {
  --bg: #070a08;
  --bg-soft: #0b100c;
  --panel: #101612;
  --panel-2: #151e17;
  --panel-3: #1b271e;
  --line: #253028;
  --line-strong: #39483a;
  --text: #eef3e7;
  --muted: #939f90;
  --muted-2: #6c786c;
  --accent: #d8ff3e;
  --accent-2: #b6d92f;
  --accent-ink: #0e1302;
  --danger: #ff6b5a;
  --warn: #ffc266;
  --violet: #c3b0ff;
  --win: #8ef0a1;
  --blue: #8ecbff;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1000px 700px at 12% -12%, rgba(216, 255, 62, 0.075), transparent 60%),
    radial-gradient(900px 700px at 102% 4%, rgba(142, 203, 255, 0.055), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(216, 255, 62, 0.26); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; }
li { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b372d; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3d4d3e; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

/* ------------------------------------------------------------ кнопки/поля */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #526253; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-accent {
  background: linear-gradient(180deg, #e4ff68, var(--accent));
  border-color: #eaff7a;
  color: var(--accent-ink);
  box-shadow: 0 10px 30px rgba(216, 255, 62, 0.16);
}
.btn-accent:hover { background: linear-gradient(180deg, #edff8f, #dcff5c); border-color: #f2ffab; }
.btn-ghost { background: rgba(255, 255, 255, 0.025); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 15px; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 13px; }
.btn-danger { border-color: rgba(255, 107, 90, 0.45); color: #ffb4aa; background: rgba(255, 107, 90, 0.08); }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }

.field {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0a0f0b;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--muted-2); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.1); }
.field-label { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; font-family: var(--mono); }
textarea.field { min-height: 90px; resize: vertical; }

/* ------------------------------------------------------------ верхняя панель */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 10, 8, 0.82);
  backdrop-filter: blur(18px);
}
.topbar-inner {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); flex: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: radial-gradient(circle at 30% 25%, #efffa8, var(--accent) 60%, #9cbb16);
  color: #101502;
  font-size: 21px;
  box-shadow: 0 0 0 1px rgba(216, 255, 62, 0.35), 0 10px 30px rgba(216, 255, 62, 0.12);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 16px; letter-spacing: 0.16em; }
.brand-text i { font-style: normal; font-size: 9px; letter-spacing: 0.26em; color: var(--muted); margin-top: 5px; font-family: var(--mono); }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.main-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  padding: 9px 12px;
  border-radius: 9px;
  transition: color 0.15s ease, background 0.15s ease;
}
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.join-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0a0f0b;
  overflow: hidden;
  height: 42px;
}
.join-box input {
  width: 92px;
  border: 0;
  background: transparent;
  padding: 0 6px 0 15px;
  outline: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.join-box input::placeholder { color: var(--muted-2); letter-spacing: 0.06em; }
.join-box button {
  border: 0;
  height: 100%;
  padding: 0 15px;
  background: rgba(216, 255, 62, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.join-box button:hover { background: rgba(216, 255, 62, 0.18); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px 0 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  max-width: 210px;
}
.user-chip:hover { border-color: var(--line-strong); }
.avatar {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2c3a2e, #172019);
  border: 1px solid #3a493b;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 86px; height: 86px; font-size: 26px; border-radius: 24px; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .lvl { color: var(--muted); font-family: var(--mono); font-size: 10px; }

/* ------------------------------------------------------------ hero */

main { position: relative; z-index: 1; }
.hero { padding: 54px 0 34px; overflow: hidden; }
.hero-inner {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 40px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hero h1 {
  margin: 20px 0 18px;
  font-size: clamp(40px, 6.2vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); text-shadow: 0 0 50px rgba(216, 255, 62, 0.22); }
.hero p.lead { max-width: 560px; color: var(--muted); font-size: clamp(15px, 1.4vw, 17px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; }
.hero-stat { display: flex; flex-direction: column; gap: 3px; }
.hero-stat b { font-size: 23px; font-family: var(--mono); letter-spacing: -0.02em; }
.hero-stat span { color: var(--muted-2); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.hero-stat + .hero-stat { padding-left: 22px; border-left: 1px solid var(--line); }

.hero-art { position: relative; height: 440px; display: grid; place-items: center; }
.radar {
  position: relative;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  border: 1px solid rgba(216, 255, 62, 0.18);
  background:
    radial-gradient(circle, rgba(216, 255, 62, 0.08), transparent 58%),
    repeating-radial-gradient(circle, transparent 0 38px, rgba(216, 255, 62, 0.09) 39px 40px);
  box-shadow: inset 0 0 60px rgba(216, 255, 62, 0.06), 0 0 90px rgba(216, 255, 62, 0.06);
}
.radar::before, .radar::after { content: ""; position: absolute; background: rgba(216, 255, 62, 0.1); }
.radar::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.radar::after { top: 50%; left: 0; right: 0; height: 1px; }
.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(216, 255, 62, 0.34), transparent 22%, transparent 100%);
  /* Радар крутится против часовой стрелки. */
  animation: sweep 6s linear infinite reverse;
  mask-image: radial-gradient(circle, black 62%, transparent 78%);
}
@keyframes sweep { to { transform: rotate(360deg); } }
.blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); animation: blink 3s infinite; }
.blip.b1 { left: 22%; top: 34%; animation-delay: 0.2s; }
.blip.b2 { right: 26%; top: 22%; animation-delay: 1.4s; }
.blip.b3 { right: 34%; bottom: 20%; animation-delay: 2.4s; background: var(--warn); box-shadow: 0 0 14px var(--warn); }
@keyframes blink { 0%, 12%, 100% { opacity: 0.15; transform: scale(0.7); } 4% { opacity: 1; transform: scale(1); } }
.radar-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 40px;
  filter: drop-shadow(0 0 24px rgba(216, 255, 62, 0.35));
}
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(16, 22, 18, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 650;
  animation: float 7s ease-in-out infinite;
}
.float-card i { font-style: normal; font-size: 18px; }
.float-card span { color: var(--muted); font-family: var(--mono); font-size: 10px; display: block; letter-spacing: 0.04em; }
.float-card.f1 { left: -6px; top: 46px; animation-delay: -1s; }
.float-card.f2 { right: -12px; top: 150px; animation-delay: -3.5s; }
.float-card.f3 { left: 16px; bottom: 34px; animation-delay: -5s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ------------------------------------------------------------ секции */

.section { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 10px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.035em; }
.section-head p { color: var(--muted); margin-top: 7px; max-width: 560px; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.filter:hover { color: var(--text); border-color: var(--line-strong); }
.filter.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------ карточки игр */

.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 246px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(400px 160px at 100% 0%, color-mix(in srgb, var(--game, var(--accent)) 9%, transparent), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.game-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--game, var(--accent)) 45%, var(--line)); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.game-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.game-emoji {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: color-mix(in srgb, var(--game, var(--accent)) 13%, #0b100c);
  border: 1px solid color-mix(in srgb, var(--game, var(--accent)) 30%, transparent);
}
.game-mode { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--mono); color: var(--muted-2); padding-top: 4px; }
.game-card h3 { margin-top: 16px; font-size: 20px; letter-spacing: -0.025em; }
.game-card p { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1; }
.game-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.game-meta span {
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
}
.game-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.live-tag .dot { width: 5px; height: 5px; background: var(--muted-2); box-shadow: none; animation: none; }
.live-tag.on { color: var(--win); }
.live-tag.on .dot { background: var(--win); box-shadow: 0 0 8px var(--win); animation: pulse 2s infinite; }
.game-play {
  border: 0;
  background: transparent;
  color: var(--game, var(--accent));
  font-weight: 750;
  font-size: 13px;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.game-play:hover { gap: 10px; }
.game-card.is-solo .game-play { color: var(--accent); }
.skeleton-card { min-height: 246px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(100deg, #101612 30%, #18221a 45%, #101612 60%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ------------------------------------------------------------ панели / split */

.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: start; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), #0c120e);
  padding: 22px;
  min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 17px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.panel-head a, .panel-head button.link { font-size: 12px; color: var(--muted); background: none; border: 0; padding: 0; font-weight: 600; }
.panel-head a:hover, .panel-head button.link:hover { color: var(--accent); }
.panel + .panel { margin-top: 0; }
.stack { display: grid; gap: 16px; }

.profile-brief { display: flex; align-items: center; gap: 16px; }
.profile-brief .meta { min-width: 0; flex: 1; }
.profile-brief h3 { font-size: 21px; }
.profile-brief .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 10px; font-family: var(--mono); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.lime { border-color: rgba(216, 255, 62, 0.35); color: var(--accent); background: rgba(216, 255, 62, 0.06); }
.xp { margin-top: 14px; }
.xp-bar { height: 7px; border-radius: 99px; background: #0a0f0b; border: 1px solid var(--line); overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.xp-label { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted-2); margin-top: 6px; font-family: var(--mono); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.stat-box { border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.02); padding: 10px 11px; }
.stat-box b { display: block; font-family: var(--mono); font-size: 19px; letter-spacing: -0.03em; }
.stat-box span { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }

.friend-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.friend-row:last-child { border-bottom: 0; }
.friend-row .name { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row .sub { font-size: 10.5px; color: var(--muted-2); }
.friend-row .grow { flex: 1; min-width: 0; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; }
.online-dot.on { background: var(--win); box-shadow: 0 0 8px rgba(142, 240, 161, 0.6); }
.empty { color: var(--muted-2); font-size: 13px; padding: 12px 0; }

.ach-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ach {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.02);
  filter: grayscale(1) opacity(0.35);
  position: relative;
}
.ach.on { filter: none; background: rgba(216, 255, 62, 0.06); border-color: rgba(216, 255, 62, 0.22); }
.ach[title]:hover { z-index: 2; }

.leader-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.leader-row:last-child { border-bottom: 0; }
.rank { width: 24px; font-family: var(--mono); font-size: 12px; color: var(--muted-2); flex: none; }
.rank.top { color: var(--accent); }
.leader-row .who { flex: 1; min-width: 0; }
.leader-row .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-row .who span { font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }
.leader-row .pts { font-family: var(--mono); font-size: 13px; color: var(--text); }

/* ------------------------------------------------------------ шаги */

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: rgba(255, 255, 255, 0.018); }
.step b.num { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.14em; }
.step h3 { margin: 12px 0 8px; font-size: 18px; }
.step p { color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------ footer */

footer { width: min(1240px, calc(100% - 40px)); margin: 70px auto 0; padding: 26px 0 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted-2); font-size: 12px; }
footer .brand-text b { color: var(--muted); }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* ------------------------------------------------------------ модалка */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 5, 4, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade 0.16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(180deg, #151d17, #0c110d);
  box-shadow: var(--shadow);
  padding: 26px;
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(0.985); opacity: 0; } }
.modal h2 { font-size: 26px; letter-spacing: -0.03em; }
.modal .modal-sub { color: var(--muted); margin-top: 7px; font-size: 13.5px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-head { position: relative; padding-right: 36px; }
.modal-body { margin-top: 20px; display: grid; gap: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.rules { display: grid; gap: 8px; margin-top: 4px; }
.rules li { display: flex; gap: 9px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.rules li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.tg-steps { display: grid; gap: 10px; counter-reset: s; }
.tg-step { display: flex; gap: 11px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.tg-step::before { counter-increment: s; content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(216, 255, 62, 0.1); color: var(--accent); font-family: var(--mono); font-size: 11px; flex: none; }
.code-big { font-family: var(--mono); font-size: 30px; letter-spacing: 0.28em; color: var(--accent); text-align: center; padding: 14px; border: 1px dashed rgba(216, 255, 62, 0.35); border-radius: 12px; background: rgba(216, 255, 62, 0.04); }
.pending-note { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 12.5px; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(216, 255, 62, 0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.room-code-box { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.room-code-box b { font-family: var(--mono); font-size: 24px; letter-spacing: 0.2em; color: var(--accent); }
.room-code-box button { margin-left: auto; }

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 100;
  background: #18221a;
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  max-width: min(92vw, 560px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 107, 90, 0.5); color: #ffc1b9; }
.toast.success { border-color: rgba(142, 240, 161, 0.45); color: #bdf8c8; }

/* ------------------------------------------------------------ адаптив */

@media (max-width: 1080px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; gap: 10px; }
  .hero-art { height: 340px; margin-top: 6px; }
  .radar { width: 250px; height: 250px; }
  .main-nav { display: none; }
}
@media (max-width: 840px) {
  .split { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-grid { grid-template-columns: 1fr; }
  .topbar-inner { width: calc(100% - 24px); gap: 12px; }
  .join-box { display: none; }
  .hero-inner, .section, footer { width: calc(100% - 24px); }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(36px, 10vw, 58px); }
  .hero-art { height: 300px; }
  .float-card.f2 { right: 0; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 210px; }
  .auth-btn span.long { display: none; }
  .user-chip span.name { display: none; }
  .user-chip { padding-right: 8px; }
  .hero-stats { gap: 14px; }
  .hero-stat + .hero-stat { padding-left: 14px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .ach-grid { grid-template-columns: repeat(5, 1fr); }
  .modal { padding: 20px; }
  .hero-art { height: 260px; }
  .radar { width: 210px; height: 210px; }
  .float-card { font-size: 11.5px; padding: 9px 12px; }
}

/* Уважаем системную настройку «уменьшить движение»: радар, блики и
   плавающие карточки замирают, интерфейс остаётся полностью рабочим. */
@media (prefers-reduced-motion: reduce) {
  .radar-sweep,
  .blip,
  .dot,
  .float-card,
  .skeleton-card,
  .is-loading {
    animation: none !important;
  }
  .radar-sweep {
    opacity: 0.35;
  }
}

/* ============================================================
   Выравнивание и защита вёрстки.
   Здесь собраны точечные исправления «кривых» мест: карточки с
   разной высотой, длинные имена, узкие экраны, вылезающая панель
   действий в шапке. Всё — через переменные темы.
   ============================================================ */

/* Случайный горизонтальный скролл от декоративных элементов. */
html,
body {
  overflow-x: clip;
}

/* Карточки игр одной высоты, текст не вылезает за пределы. */
.game-card {
  min-height: 0;
  height: 100%;
  min-width: 0;
}

.game-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.game-meta {
  margin-top: auto;
  padding-top: 12px;
}

/* Панели: длинные слова (ники, ссылки) не растягивают колонку. */
.panel {
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel-head h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Шапка: на средних экранах действия переносятся, а не вылезают. */
.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.user-chip {
  min-width: 0;
}

.user-chip .grow {
  min-width: 0;
}

/* Кнопка сообщений с бейджем. */
.btn-icon {
  position: relative;
}

.btn-icon .dm-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 800;
  font-family: var(--mono);
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.btn-icon .dm-badge[hidden] {
  display: none;
}

/* Строки статистики по играм на средних экранах: меньше колонок. */
@media (max-width: 900px) {
  .stat-game {
    grid-template-columns: 30px minmax(0, 1fr) repeat(2, 62px);
  }
  .stat-game .cell:nth-child(4),
  .stat-game .cell:nth-child(5) {
    display: none;
  }
}

/* Модалка не вылезает за экран и прокручивается внутри. */
.modal {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* Сетки карточек: ровные ряды без «рваных» отступов. */
.games-grid,
.steps-grid,
.leader-row,
.friend-row {
  align-items: stretch;
}

/* Лидерборд и друзья: длинный текст не ломает строку. */
.leader-row .who b,
.friend-row .name {
  min-width: 0;
}

/* На очень узких экранах кнопки в шапке не прыгают по высоте. */
@media (max-width: 560px) {
  .top-actions {
    gap: 6px;
  }
  .top-actions .btn,
  .top-actions .user-chip {
    min-height: 38px;
  }
  .hero {
    padding-top: 24px;
  }
  .float-card {
    display: none;
  }
}
