:root {
  /* база держится нейтрально-холодной: цвет в макет приносят обложки и акценты,
     а не фон — иначе всё уплывает в фиолетовую муть */
  --ink: #090911;
  --surf: #14141f;
  --surf-2: #1b1b29;
  --surf-3: #23233a;
  --line-soft: rgba(255, 255, 255, .06);
  --text: #eef0f6;
  --dim: #9096a8;
  --dim-2: #656b80;

  --violet: #8b5cf6;
  --rose: #f43f5e;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --gold: #fbbf24;
  --green: #34d399;
  --blue: #4f8cff;
  --orange: #ff7a3c;
  --pink: #f472d0;
  --ice: #7dd3fc;

  --disp: 'Unbounded', 'Onest', system-ui, sans-serif;
  --ui: 'Onest', system-ui, -apple-system, sans-serif;
  --r-card: 16px;
  --shadow-card: 0 18px 40px -18px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body { min-height: 100vh; position: relative; }

/* ── атмосфера: пятна света + зерно вместо плоского градиента ── */
.aurora {
  position: fixed;
  inset: -20vh -10vw;
  z-index: -2;
  pointer-events: none;
  filter: blur(86px);
  opacity: .78;
}
.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: drift 44s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { width: 46vw; height: 46vw; left: 58%; top: -8%; background: #6d28d9; }
.aurora i:nth-child(2) { width: 34vw; height: 34vw; left: -6%; top: 6%; background: #be123c; animation-delay: -14s; }
.aurora i:nth-child(3) { width: 40vw; height: 40vw; left: 18%; top: 52%; background: #0e7490; animation-delay: -28s; }
.aurora i:nth-child(4) { width: 26vw; height: 26vw; left: 72%; top: 62%; background: #7c3aed; animation-delay: -8s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, -3vh, 0) scale(1.15); }
}
/* зерно снимает бандинг на больших размытиях и даёт «плёнку» */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  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 type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img, canvas { display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surf-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #2f2f4d; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: var(--violet); color: #fff; }

/* ── шапка ── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(9, 9, 17, .92), rgba(9, 9, 17, .74));
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.bar { max-width: 1440px; margin: 0 auto; height: 68px; padding: 0 22px; display: flex; align-items: center; gap: 20px; }

.logo { display: flex; align-items: center; gap: 11px; flex: none; cursor: pointer; }
.logo .mk {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(160deg, #1b1730, #110f1c);
  border: 1px solid rgba(255, 255, 255, .08);
  display: grid; place-content: center;
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.logo:hover .mk { box-shadow: 0 8px 22px -6px rgba(244, 63, 94, .55), inset 0 1px 0 rgba(255, 255, 255, .1); }
.logo .mk svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); transition: transform .25s cubic-bezier(.2,.7,.3,1); }
.logo:hover .mk svg { transform: rotate(-8deg) scale(1.06); }
.logo .wm { font-family: var(--disp); font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: #fff; }
.logo .wm b { color: var(--rose); font-weight: 800; }

.search { flex: 1; max-width: 440px; position: relative; }
.search input {
  width: 100%; height: 44px; border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  color: var(--text); font-family: var(--ui); font-size: 14px;
  padding: 0 52px 0 42px; outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.search input::placeholder { color: var(--dim-2); }
.search input:focus { background: rgba(255, 255, 255, .06); border-color: rgba(139, 92, 246, .6); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.search svg { position: absolute; left: 14px; top: 14px; stroke: var(--dim-2); pointer-events: none; }
.search kbd {
  position: absolute; right: 10px; top: 11px;
  font-family: var(--ui); font-size: 11px; font-weight: 600; color: var(--dim-2);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 3px 7px; pointer-events: none;
}

.hbtns { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.chip {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px;
  border-radius: 11px; background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.chip:hover { background: rgba(255, 255, 255, .07); }
.chip .coin { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(140deg, #fde68a, var(--gold)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3) inset; flex: none; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 11px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-soft);
  display: grid; place-content: center; cursor: pointer; color: var(--dim);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--rose); box-shadow: 0 0 0 2px var(--ink);
}
.me {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 3px 12px 3px 3px;
  border-radius: 999px; background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.me:hover { background: rgba(255, 255, 255, .08); border-color: rgba(139, 92, 246, .5); }
.me .pic {
  position: relative; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--violet), var(--cyan));
  padding: 2px;
}
.me .pic img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surf-2); image-rendering: pixelated; }
.me .pic::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 2.5px var(--ink);
}
.me .who { display: flex; flex-direction: column; line-height: 1.15; }
.me .who b { font-size: 13px; font-weight: 600; }
.me .who span { font-size: 11px; color: var(--dim-2); }

/* ── каркас ── */
.shell { max-width: 1440px; margin: 0 auto; padding: 0 22px; display: grid; grid-template-columns: 224px 1fr; gap: 28px; }
.side { position: sticky; top: 88px; align-self: start; padding: 20px 0 30px; }
.side .lbl { font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--dim-2); padding: 0 12px; margin-bottom: 10px; }
.navitem {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: 11px; cursor: pointer;
  color: var(--dim); font-family: var(--ui); font-size: 14px; font-weight: 500;
  border: 0; background: none; text-align: left; position: relative;
  transition: background .14s, color .14s;
}
.navitem svg { stroke: currentColor; flex: none; opacity: .85; }
.navitem:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.navitem.on { background: rgba(255, 255, 255, .06); color: #fff; }
.navitem.on::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--violet), var(--rose));
}
.navitem.on svg { color: var(--violet); opacity: 1; }
.mchips { display: none; }
main.feed { min-width: 0; padding-bottom: 48px; }

/* ── выпадающие панели шапки ── */
.dd {
  position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, #191926, #131320);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .06);
  padding: 16px; opacity: 0; transform: translateY(-8px) scale(.98);
  transition: opacity .16s ease, transform .16s cubic-bezier(.2, .7, .3, 1);
}
.dd.on { opacity: 1; transform: none; }
.dd-title { font-family: var(--disp); font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.dd-h { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.dd-h .coin-lg { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, #fde68a, var(--gold)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3) inset, 0 6px 16px -4px rgba(251, 191, 36, .6); flex: none; }
.dd-h b { font-family: var(--disp); font-weight: 800; font-size: 24px; display: block; }
.dd-h span { font-size: 12px; color: var(--dim-2); }
.dd-p { font-size: 13px; color: var(--dim); line-height: 1.5; margin: 0 0 14px; }
.dd-btn { width: 100%; font-family: var(--ui); font-weight: 600; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--violet), #6d28d9); border: 0; padding: 12px; border-radius: 11px; cursor: pointer; }
.dd-btn:hover { filter: brightness(1.08); }
.dd-btn.off { background: rgba(255, 255, 255, .05); color: var(--dim-2); cursor: default; }
.dd-empty { font-size: 13px; color: var(--dim-2); text-align: center; padding: 14px 0; }
.nt { display: flex; align-items: flex-start; gap: 11px; padding: 10px 8px; border-radius: 10px; font-size: 13px; color: var(--text); line-height: 1.4; }
.nt:hover { background: rgba(255, 255, 255, .04); }
.nt-i { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--violet); }
.nt-i.new { background: var(--cyan); } .nt-i.up { background: var(--gold); } .nt-i.game { background: var(--green); } .nt-i.info { background: var(--dim-2); }
.dd-me { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.dd-me img { border-radius: 50%; background: var(--surf-2); image-rendering: pixelated; border: 2px solid var(--violet); }
.dd-me b { font-family: var(--disp); font-weight: 700; font-size: 16px; display: block; }
.dd-me span { font-size: 12px; color: var(--dim-2); }
.dd-edit { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); color: var(--dim); cursor: pointer; }
.dd-edit:hover { color: var(--text); border-color: var(--violet); }
.xpbar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--rose)); }
.xp-cap { font-size: 11px; color: var(--dim-2); margin: 7px 0 14px; }
.dd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dd-stats > div { background: rgba(255, 255, 255, .04); border-radius: 11px; padding: 12px 6px; text-align: center; }
.dd-stats b { font-family: var(--disp); font-weight: 800; font-size: 18px; display: block; }
.dd-stats span { font-size: 10.5px; color: var(--dim-2); }

/* ── живой герой ── */
.phero { position: relative; margin-top: 22px; border-radius: 20px; overflow: hidden;
  min-height: 260px; display: flex; align-items: center;
  background: linear-gradient(120deg, #16121f 0%, #120f1d 60%, #1a1226 100%);
  border: 1px solid var(--line-soft); box-shadow: 0 24px 60px -30px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05); }
.phero-cv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .9; }
.phero-in { position: relative; z-index: 1; padding: 40px 42px; max-width: 620px; }
.phero-in::after { content: ""; position: absolute; inset: -40px -80px -40px -42px; z-index: -1;
  background: radial-gradient(600px 300px at 20% 50%, rgba(10,10,20,.86), rgba(10,10,20,.2) 70%, transparent); }
.phero-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); background: rgba(34,211,238,.09); border: 1px solid rgba(34,211,238,.22); padding: 6px 13px; border-radius: 999px; }
.phero-in h1 { font-family: var(--disp); font-weight: 800; font-size: clamp(30px,4.4vw,50px); line-height: 1.02; letter-spacing: -.02em; margin: 18px 0 0; }
.phero-in h1 .g { background: linear-gradient(120deg,#c4b5fd,#f472d0,#ff8a5c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.phero-in p { color: var(--dim); font-size: 15px; line-height: 1.5; max-width: 46ch; margin: 16px 0 0; }
.phero-btn { display: inline-block; margin-top: 24px; font-family: var(--ui); font-weight: 600; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--violet), #6d28d9); padding: 13px 24px; border-radius: 12px; cursor: pointer; box-shadow: 0 12px 30px -10px rgba(139,92,246,.7); transition: filter .15s, transform .08s; }
.phero-btn:hover { filter: brightness(1.09); }
.phero-btn:active { transform: translateY(1px); }
@media (max-width: 620px) { .phero-in { padding: 28px 24px; } .phero-in p { display: none; } }

section { margin-top: 30px; }
.sechead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sechead h2 { font-family: var(--disp); font-weight: 800; font-size: 19px; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 12px; color: #fff; }
.sechead h2 .bar-i { width: 4px; height: 22px; border-radius: 3px; background: linear-gradient(var(--violet), var(--rose)); }
.sechead .more { font-size: 13px; font-weight: 500; color: var(--dim-2); font-variant-numeric: tabular-nums; }

/* ── карточки ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 18px; }
.card {
  position: relative; border-radius: var(--r-card); overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, var(--surf-2), var(--surf));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s, border-color .2s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--tint) 55%, transparent);
  box-shadow: 0 26px 50px -20px rgba(0, 0, 0, .95),
              0 0 34px -8px color-mix(in srgb, var(--tint) 55%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, .12);
}
.card .cov { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #0b0b14; }
.card .cov img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2, .7, .3, 1); }
.card:hover .cov img { transform: scale(1.07); }
.card .cov::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(9, 9, 17, .55));
  pointer-events: none;
}
.card .ph { width: 100%; height: 100%; display: grid; place-content: center; font-family: var(--disp); font-weight: 600; font-size: 12px; color: var(--dim-2); background: linear-gradient(140deg, #191926, #101019); }
.card .badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 7px; color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}
.card .over { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; background: rgba(9, 9, 17, .5); opacity: 0; transition: opacity .2s; }
.card:hover .over { opacity: 1; }
.card .over .go {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(140deg, var(--rose), #e11d48);
  display: grid; place-content: center;
  box-shadow: 0 10px 26px -6px rgba(244, 63, 94, .85), inset 0 1px 0 rgba(255, 255, 255, .35);
  transform: scale(.85); transition: transform .2s cubic-bezier(.2, .7, .3, 1);
}
.card:hover .over .go { transform: scale(1); }
.card .over .go svg { fill: #fff; margin-left: 3px; }
.card .cap { padding: 12px 13px 13px; }
.card .cap .t { font-family: var(--disp); font-weight: 600; font-size: 13px; letter-spacing: -.01em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cap .m { margin-top: 7px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--dim-2); font-variant-numeric: tabular-nums; }
.card .cap .m .g { color: var(--tint); font-weight: 600; }
.card.soon { opacity: .45; }
.card.soon:hover { transform: none; box-shadow: var(--shadow-card); border-color: var(--line-soft); }
.card.soon .over .go { background: var(--surf-3); box-shadow: none; }

/* ── страница игры ── */
.pv-head { display: flex; align-items: center; gap: 16px; margin: 24px 0 16px; }
.back { font-family: var(--ui); font-weight: 600; font-size: 14px; color: var(--text); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-soft); padding: 11px 17px; border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.back:hover { background: rgba(255, 255, 255, .08); border-color: rgba(139, 92, 246, .5); }
.pv-title { flex: 1; min-width: 0; }
.pv-title h1 { font-family: var(--disp); font-weight: 800; font-size: 25px; letter-spacing: -.02em; margin: 0; color: #fff; }
.pv-sub { font-size: 13px; color: var(--dim); }
.btn2 { font-family: var(--ui); font-weight: 600; font-size: 14px; padding: 11px 17px; border-radius: 12px; cursor: pointer; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .04); color: var(--text); transition: background .15s, border-color .15s; }
.btn2:hover { background: rgba(255, 255, 255, .08); border-color: rgba(139, 92, 246, .5); }
.pv-stage {
  /* высоту режем под вьюпорт, чтобы игровой HUD и хотбар были видны без скролла;
     сам движок вписывает поле 960×600 с letterbox, поэтому пропорции не важны */
  position: relative; width: 100%;
  height: clamp(340px, calc(100vh - 200px), 880px);
  background: #06060d; border: 1px solid var(--line-soft);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 40px 80px -32px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.pv-stage:fullscreen { border-radius: 0; aspect-ratio: auto; height: 100vh; border: 0; }

/* ── загрузчик игры ── */
.gr-loader { position: absolute; inset: 0; display: grid; place-content: center; background: #0b0b14; z-index: 5; }
.gr-l-box { width: min(340px, 72vw); text-align: center; }
.gr-l-title { font-family: var(--disp); font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: #fff; margin-bottom: 18px; }
.gr-l-bar { height: 5px; background: rgba(255, 255, 255, .07); border-radius: 4px; overflow: hidden; }
.gr-l-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--rose)); transition: width .15s linear; }
.gr-l-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--dim-2); font-variant-numeric: tabular-nums; }
.gr-l-label { color: var(--cyan); font-weight: 600; }
.gr-l-err { color: #ff8095; font-size: 14px; line-height: 1.55; }

/* ── подвал ── */
footer { border-top: 1px solid var(--line-soft); margin-top: 24px; }
.frow { max-width: 1440px; margin: 0 auto; padding: 28px 22px 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.credit { font-size: 11px; color: var(--dim-2); margin-top: 8px; }
.credit a { text-decoration: underline; }
.fnote { font-size: 12px; color: var(--dim-2); }

@media (max-width: 1080px) {
  .search kbd { display: none; }
  .me .who { display: none; }
  .me { padding: 3px; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mchips { display: flex; gap: 9px; overflow-x: auto; padding: 16px 22px 4px; margin: 0 -22px; }
  .mchips::-webkit-scrollbar { display: none; }
  .mchip { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 15px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft); color: var(--dim); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
  .mchip.on { background: linear-gradient(140deg, var(--violet), #6d28d9); border-color: transparent; color: #fff; }
  .mchip svg { stroke: currentColor; }
}
@media (max-width: 640px) {
  .bar { gap: 12px; padding: 0 16px; }
  .logo .wm { display: none; }
  .chip { display: none; }
  .shell { padding: 0 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none; }
  .card, .card .cov img, .card .over .go { transition: none; }
}
