/* ============ Alexwin32 — пиксельная тема ============ */
:root {
  --edge: #05081c;
  --ink: #0a0e26;
  --night: #0d1230;
  --panel: #16205a;
  --panel-2: #1c2870;
  --well: #0a0f2a;
  --blue: #2c46c4;
  --blue-l: #4f6be0;
  --blue-d: #1a2b86;
  --gold: #f5c518;
  --gold-l: #ffe27a;
  --gold-d: #b8900a;
  --brown: #6b4423;
  --cream: #f3efe4;
  --muted: #c3cbf2;
  --dim: #8f99d0;
  --green: #8fe39a;
  --red: #e2574e;
  --px: 'Press Start 2P', monospace;
  --body: 'Rubik', system-ui, sans-serif;
  --bevel: inset -4px -4px 0 rgba(0,0,0,.35), inset 4px 4px 0 rgba(255,255,255,.18);
  --ring: 0 0 0 4px var(--edge);
  --drop: 8px 8px 0 rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(79,107,224,.18), transparent 70%),
    linear-gradient(45deg, rgba(255,255,255,.028) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.028) 75%),
    linear-gradient(45deg, rgba(255,255,255,.028) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.028) 75%);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  background-position: 0 0, 0 0, 16px 16px;
  background-attachment: fixed, scroll, scroll;
  color: var(--cream); font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { image-rendering: pixelated; max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-l); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--night); }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--night); padding: 10px 14px; font-family: var(--px); font-size: 10px; }
.skip:focus { top: 12px; }
.blk { box-shadow: var(--ring), var(--bevel); }
.muted { color: var(--muted); }
code { font-family: ui-monospace, Consolas, monospace; background: var(--well); padding: 1px 6px; color: var(--gold-l); font-size: .92em; }

/* слой частиц поверх всего */
.fx-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ============ ШАПКА ============ */
.site-header { position: relative; isolation: isolate; padding-top: 12px; background: #0b1440; }
.site-header::before { /* пуговичная полоса */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; z-index: 3;
  background: repeating-linear-gradient(90deg, var(--gold) 0 12px, var(--blue) 12px 48px);
  box-shadow: 0 4px 0 var(--edge);
}
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; image-rendering: pixelated; }
.site-header .scene { top: 12px; height: calc(100% - 12px); }
.site-header::after { /* затемнение снизу для читаемости меню */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: -1;
  background: linear-gradient(to bottom, transparent, rgba(5,8,28,.55));
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 44px 24px 64px;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px;
  min-height: 330px;
}
.logo { display: flex; align-items: center; gap: 20px; color: var(--cream); }
.logo:hover { color: var(--cream); }
.logo-head { display: block; width: 72px; height: 72px; background: var(--blue); flex: none; animation: headBob 3.2s steps(4) infinite; }
.logo-head img { width: 100%; height: 100%; display: block; }
.logo-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.logo-name {
  position: relative; font-family: var(--px); font-size: clamp(22px, 4.4vw, 44px); line-height: 1; color: var(--gold);
  text-shadow: 0 3px 0 var(--gold-d), 0 6px 0 var(--brown), 4px 10px 0 var(--edge), -2px 0 0 var(--edge), 2px 0 0 var(--edge), 0 -2px 0 var(--edge);
}
.logo-name::after { /* блик, пробегающий по буквам */
  content: attr(data-text); position: absolute; inset: 0; color: transparent;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.85) 48%, transparent 60%) no-repeat;
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  animation: shine 5s ease-in-out infinite; text-shadow: none;
}
.logo-tag { font-size: 15px; color: var(--muted); text-shadow: 2px 2px 0 var(--edge); max-width: 460px; }
@keyframes shine { 0%, 55% { background-position: 150% 0; } 85%, 100% { background-position: -60% 0; } }
@keyframes headBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.mascot { position: relative; display: flex; flex-direction: column; align-items: center; margin-bottom: -44px; cursor: pointer; user-select: none; }
.mascot-img, .mascot canvas { display: block; width: 160px; height: 160px; filter: drop-shadow(6px 6px 0 rgba(5,8,28,.6)); }
.mascot canvas { width: auto; height: 250px; }
.mascot-shadow { width: 90px; height: 10px; background: rgba(5,8,28,.55); margin-top: -4px; }
.bubble {
  position: absolute; right: calc(100% - 30px); top: 4px; background: var(--cream); color: var(--night);
  padding: 12px 14px; font-family: var(--px); font-size: 10px; line-height: 1.8; width: max-content; max-width: 230px;
  transform-origin: 100% 100%; animation: bubbleIn .5s steps(5) both;
}
.bubble::after { content: ""; position: absolute; right: -12px; bottom: 8px; border: 6px solid transparent; border-left-color: var(--cream); border-bottom-color: var(--cream); }
.bubble.is-swap { animation: bubbleOut .25s steps(3) both; }
@keyframes bubbleIn { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bubbleOut { to { transform: scale(.3); opacity: 0; } }

/* меню-таблички */
.tabs {
  position: relative; z-index: 5; max-width: 1240px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; transform: translateY(36px);
}
.tab {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 72px; padding: 0 18px; background: var(--blue); color: var(--cream);
  font-family: var(--px); font-size: clamp(9px, 1vw, 12px); text-shadow: 2px 2px 0 var(--edge);
  box-shadow: var(--ring), var(--bevel), 0 10px 0 var(--blue-d), 0 10px 0 4px var(--edge);
  transition: transform .12s steps(2), background-color .12s;
}
.tab::before { /* узор досок */
  content: ""; position: absolute; inset: 4px; pointer-events: none; opacity: .25;
  background: repeating-linear-gradient(0deg, transparent 0 14px, rgba(0,0,0,.35) 14px 16px);
}
.tab:hover { color: var(--cream); background: var(--blue-l); transform: translateY(-4px); }
.tab:active { transform: translateY(4px); }
.tab.is-active { background: var(--gold); color: var(--night); text-shadow: 1px 1px 0 rgba(255,255,255,.4); box-shadow: var(--ring), var(--bevel), 0 10px 0 var(--gold-d), 0 10px 0 4px var(--edge); }
.tab-label { position: relative; flex: 1; text-align: center; }
.rivet { position: relative; width: 8px; height: 8px; flex: none; background: var(--gold); box-shadow: 2px 2px 0 rgba(0,0,0,.45); }
.tab.is-active .rivet { background: var(--night); }
.tab:hover .rivet { animation: rivet .6s steps(3) infinite; }
@keyframes rivet { 50% { background: #fff6c2; } }

/* ============ МАКЕТ ============ */
.layout {
  max-width: 1240px; margin: 0 auto; padding: 96px 24px 96px;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start;
}
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.main-col { min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.sidebar { display: flex; flex-direction: column; gap: 32px; position: sticky; top: 24px; }

.panel {
  background: var(--panel); padding: 22px; position: relative;
  box-shadow: var(--ring), inset 0 4px 0 var(--blue), inset 0 -4px 0 rgba(0,0,0,.25), var(--drop);
}
.panel-title { margin: 0 0 16px; font-family: var(--px); font-size: 13px; line-height: 1.5; color: var(--gold); text-shadow: 2px 2px 0 var(--edge); font-weight: 400; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head .panel-title { margin: 0; }
.panel-title .count { color: var(--muted); }
.h-pixel { margin: 0; font-family: var(--px); font-size: clamp(16px, 2.2vw, 22px); font-weight: 400; line-height: 1.4; text-shadow: 3px 3px 0 var(--edge); }
.h-sm { font-size: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.section-link { font-weight: 500; }
.stat-pill { background: var(--panel-2); padding: 8px 12px; font-size: 13px; color: var(--muted); }
.stat-pill b { color: var(--gold); font-family: var(--px); font-size: 11px; margin-right: 4px; }

/* ============ КНОПКИ И ПОЛЯ ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 12px 18px;
  border: 0; cursor: pointer; font-family: var(--px); font-size: 10px; line-height: 1.4; text-align: center;
  box-shadow: var(--ring), var(--bevel); transition: filter .1s, transform .06s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translate(2px, 2px); box-shadow: var(--ring), inset 4px 4px 0 rgba(0,0,0,.35); }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { color: var(--night); }
.btn-blue { background: var(--blue); color: var(--cream); }
.btn-blue:hover { color: var(--cream); }
.btn-red { background: var(--red); color: #fff; }
.btn-icon { padding: 0 14px; min-width: 48px; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.like-btn svg { fill: currentColor; stroke: none; }
.like-btn.is-pop { animation: pop .35s steps(3); }
@keyframes pop { 50% { transform: scale(1.15); } }
.link-btn { background: none; border: 0; padding: 0; color: var(--dim); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--gold); }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack > .btn { margin-top: 4px; }
.field-label { font-size: 14px; color: var(--muted); }
.field-hint { font-size: 13px; color: var(--dim); margin-top: -4px; }
.field {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 0; background: var(--well); color: var(--cream);
  font-family: var(--body); font-size: 15px; box-shadow: inset 3px 3px 0 var(--edge), 0 0 0 2px var(--blue);
}
.field:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
textarea.field { resize: vertical; line-height: 1.55; }
.field-code { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input[type="file"].field { padding: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); cursor: pointer; min-height: 32px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.hp { position: absolute; left: -9999px; }
.form-errors, .form-ok { padding: 12px 16px; background: #3a1420; color: #ffd6d2; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-ok { background: #123a25; color: #c9f7d2; }
.inline-form { display: inline; }

/* ============ НОВОСТИ ============ */
.news-list { display: flex; flex-direction: column; gap: 28px; }
.news-card { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; padding: 20px; transform-style: preserve-3d; transition: transform .25s ease-out, box-shadow .2s; will-change: transform; }
.news-card:hover { box-shadow: var(--ring), inset 0 4px 0 var(--gold), inset 0 -4px 0 rgba(0,0,0,.25), 12px 12px 0 rgba(0,0,0,.5); }
.news-thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--blue-d); }
.news-img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: auto; transition: transform .4s; }
.news-card:hover .news-img { transform: scale(1.06); }
.news-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.news-title { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 700; }
.news-title a { color: var(--cream); background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 3px; transition: background-size .25s; }
.news-title a:hover { color: var(--cream); background-size: 100% 3px; }
.news-excerpt { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { margin-top: auto; font-family: var(--px); font-size: 10px; }
.read-more span { display: inline-block; transition: transform .15s steps(2); }
.read-more:hover span { transform: translateX(6px); }
.news-card.is-featured { grid-template-columns: 1fr; padding: 0; overflow: hidden; }
.news-card.is-featured .news-thumb { aspect-ratio: 21 / 9; box-shadow: none; }
.news-card.is-featured .news-body { padding: 4px 26px 26px; }
.news-card.is-featured .news-title { font-size: clamp(22px, 2.6vw, 30px); }
.pin { position: absolute; left: 10px; top: 10px; background: var(--gold); color: var(--night); font-family: var(--px); font-size: 8px; padding: 6px 8px; box-shadow: var(--ring); }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--muted); }
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--gold); }
.meta-sep { color: var(--dim); }
.chip { font-family: var(--px); font-size: 8px; line-height: 1; padding: 7px 8px; background: var(--blue); color: var(--cream) !important; box-shadow: 0 0 0 2px var(--edge); }
.chip-reviews { background: #2f8f54; }
.chip-guides { background: #b85a1e; }
.chip-streams { background: #a2306d; }

/* заглушка обложки: пиксельный «блок» */
.cover-ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  background-color: var(--blue);
  background-image: linear-gradient(45deg, rgba(0,0,0,.2) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.2) 75%),
    linear-gradient(45deg, rgba(0,0,0,.2) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.2) 75%);
  background-size: 28px 28px; background-position: 0 0, 14px 14px; }
.cover-reviews { background-color: #2f8f54; }
.cover-guides { background-color: #b85a1e; }
.cover-streams { background-color: #a2306d; }
.cover-ph-block { width: 56px; height: 56px; background: var(--gold); box-shadow: var(--ring), var(--bevel), 8px 8px 0 rgba(0,0,0,.35); animation: float 3s steps(6) infinite; }
.cover-reviews .cover-ph-block { background: #8fe39a; }
.cover-guides .cover-ph-block { background: #ffb36b; }
.cover-streams .cover-ph-block { background: #ff8fc8; }
@keyframes float { 50% { transform: translateY(-8px) rotate(8deg); } }

.pager { display: flex; flex-wrap: wrap; gap: 12px; }
.pg { min-width: 46px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; background: var(--blue); color: var(--cream); font-family: var(--px); font-size: 10px; }
.pg:hover { color: var(--cream); background: var(--blue-l); }
.pg.is-active { background: var(--gold); color: var(--night); }

.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty p { margin: 0; color: var(--muted); }
.empty-icon { display: grid; grid-template-columns: repeat(2, 24px); gap: 4px; }
.empty-icon span { width: 24px; height: 24px; background: var(--blue); box-shadow: var(--bevel); animation: float 2.4s steps(4) infinite; }
.empty-icon span:nth-child(2) { animation-delay: .3s; background: var(--gold); }
.empty-icon span:nth-child(3) { animation-delay: .6s; }
.empty-icon span:nth-child(4) { animation-delay: .9s; background: var(--brown); }

/* ============ ПОЛНАЯ НОВОСТЬ ============ */
.post-full { padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--dim); }
.crumbs a { color: var(--muted); }
.crumbs span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.post-title { margin: 0; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2; font-weight: 700; text-shadow: 3px 3px 0 var(--edge); }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.byline-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.post-cover { margin: 0; overflow: hidden; }
.post-cover img { display: block; width: 100%; image-rendering: auto; }
.post-lead { margin: 0; font-size: 19px; color: var(--cream); font-weight: 500; }
.prose { font-size: 17px; line-height: 1.75; color: #e4e6f3; overflow-wrap: anywhere; }
.prose > * { margin: 0 0 1em; }
.prose h2, .prose h3 { font-family: var(--px); font-weight: 400; color: var(--gold); line-height: 1.5; text-shadow: 2px 2px 0 var(--edge); margin-top: 1.6em; }
.prose h2 { font-size: 16px; }
.prose h3 { font-size: 13px; }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 26px; margin-bottom: .4em; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: .65em; width: 8px; height: 8px; background: var(--gold); box-shadow: 2px 2px 0 var(--edge); }
.prose ol { counter-reset: n; }
.prose ol li { counter-increment: n; }
.prose ol li::before { content: counter(n); position: absolute; left: 0; top: .25em; font-family: var(--px); font-size: 10px; color: var(--gold); }
.prose blockquote { margin-left: 0; padding: 14px 18px; background: var(--well); box-shadow: inset 6px 0 0 var(--gold); color: var(--muted); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.md-img { margin: 1.4em 0; }
.md-img img { display: block; width: 100%; box-shadow: var(--ring); image-rendering: auto; }
.md-img figcaption { font-size: 14px; color: var(--dim); margin-top: 8px; }
.md-video { position: relative; aspect-ratio: 16 / 9; box-shadow: var(--ring); background: var(--ink); }
.md-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-actions { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.post-nav-link { display: flex; flex-direction: column; gap: 6px; color: var(--cream); padding: 18px 20px; }
.post-nav-link:hover { color: var(--gold); }
.post-nav-link.is-next { text-align: right; grid-column: 2; }
.post-nav-dir { font-family: var(--px); font-size: 9px; color: var(--gold); }

.comments { display: flex; flex-direction: column; gap: 18px; }
.comments .panel-title { margin: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 14px; align-items: flex-start; }
.comment .head { width: 44px; height: 44px; flex: none; background: var(--blue); }
.comment-body { min-width: 0; flex: 1; background: var(--well); padding: 12px 14px; box-shadow: inset 3px 3px 0 var(--edge); }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 13px; color: var(--dim); }
.comment-nick { font-weight: 700; font-size: 15px; color: var(--gold); }
.comment-nick.is-admin::after, .chat-nick.is-admin::after { content: "★"; margin-left: 4px; color: #ff8a3d; }
.comment-text { overflow-wrap: anywhere; }
.comment-text p { margin: .3em 0 0; }

/* ============ ПРАВАЯ КОЛОНКА ============ */
.me { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.me .head { width: 60px; height: 60px; background: var(--blue); }
.me-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.me-nick { font-family: var(--px); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 13px; color: var(--muted); }
.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile-form { display: contents; }
.tile-link {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; text-align: center;
  background: var(--well); color: var(--cream); font: inherit; font-size: 14px; border: 0; cursor: pointer;
  box-shadow: var(--ring), var(--bevel);
}
.tile-link:hover { background: var(--blue-d); color: var(--cream); }
.tile-gold { background: var(--gold); color: var(--night); }
.tile-gold:hover { background: var(--gold-l); color: var(--night); }

.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.link-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; background: var(--well); color: var(--cream); transition: transform .1s steps(2), background .1s; }
.link-list a:hover { background: var(--blue-d); transform: translateX(4px); color: var(--cream); }

.online { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--green); }
.dot { width: 8px; height: 8px; background: var(--green); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.chat-log { list-style: none; margin: 0 0 12px; padding: 12px; background: var(--well); box-shadow: inset 3px 3px 0 var(--edge); max-height: 320px; min-height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: var(--blue) transparent; }
.chat-msg { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-msg.is-new { animation: msgIn .35s steps(4); }
@keyframes msgIn { from { opacity: 0; transform: translateX(-10px); } }
.chat-time { color: var(--dim); font-size: 12px; margin-right: 4px; }
.chat-nick { font-weight: 700; color: var(--gold); }
.chat-nick::after { content: ":"; }
.chat-nick.is-admin::after { content: "★:"; }
.chat-del { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; padding: 0 4px; }
.chat-del:hover { color: var(--red); }
.chat-empty { color: var(--dim); font-size: 14px; }
.chat-form { display: flex; gap: 10px; }
.chat-guest { margin: 0; font-size: 14px; color: var(--muted); }
.chat-error { color: #ffb3ac; font-size: 13px; margin: 8px 0 0; }

.head { image-rendering: pixelated; display: block; }

/* ============ ФОРМЫ ВХОДА, ПРОФИЛЬ ============ */
.auth-card { max-width: 560px; width: 100%; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card .muted { margin: 0; }
.reg-preview { display: flex; align-items: center; gap: 16px; background: var(--well); padding: 12px; }
.reg-preview .head { width: 64px; height: 64px; flex: none; background: var(--blue); }
.reg-preview p { margin: 0; font-size: 14px; }
.profile-top { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.profile-skin { background: linear-gradient(var(--blue-d), var(--panel-2)); padding: 16px 24px; flex: none; }
.profile-skin img { display: block; height: 200px; width: auto; }
.profile-info { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.profile-role { color: var(--muted); }
.profile-about { margin: 0; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 0; }
.profile-stats div { background: var(--well); padding: 10px 14px; box-shadow: var(--ring); }
.profile-stats dt { font-size: 12px; color: var(--dim); }
.profile-stats dd { margin: 2px 0 0; font-family: var(--px); font-size: 11px; color: var(--gold); }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.mini-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-list .head { width: 24px; height: 24px; }

/* ============ СТРИМЫ, 404 ============ */
.stream-hero { display: flex; flex-direction: column; gap: 18px; }
.stream-off { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 30px 10px; text-align: center; color: var(--muted); }
.stream-off p { margin: 0; }
.tv { width: 140px; height: 96px; background: var(--well); position: relative; overflow: hidden; }
.tv span { position: absolute; inset: 8px; background: repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 2px, transparent 2px 4px), radial-gradient(circle, #2c46c4, #0a0f2a); animation: static .2s steps(2) infinite; }
@keyframes static { 50% { filter: brightness(1.4); transform: translateY(2px); } }
.stream-links { display: flex; flex-wrap: wrap; gap: 14px; }
.nf { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 56px 24px; }
.nf-code { font-family: var(--px); font-size: clamp(48px, 9vw, 96px); color: var(--gold); text-shadow: 0 6px 0 var(--gold-d), 6px 12px 0 var(--edge); animation: float 3s steps(6) infinite; }
.nf p { margin: 0; color: var(--muted); }

/* ============ СООБЩЕНИЯ ============ */
.flash { position: fixed; left: 50%; top: 20px; z-index: 70; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); animation: flashIn .4s steps(4); }
@keyframes flashIn { from { transform: translate(-50%, -24px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.flash-inner { padding: 14px 18px; font-weight: 500; }
.flash-ok .flash-inner { background: #1f6b43; }
.flash-bad .flash-inner { background: #7a2430; }

/* ============ ФУТЕР ============ */
.site-footer { position: relative; isolation: isolate; margin-top: 40px; background: linear-gradient(to bottom, transparent 28px, #2a1c14 28px, #1d1d24 160px); overflow: hidden; }
.scene-ground { z-index: -1; }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 112px 24px 36px;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start;
}
.founder { display: flex; gap: 22px; align-items: center; }
.founder-img { display: block; width: 116px; height: 116px; background: var(--blue); flex: none; overflow: hidden; }
.founder-img img { display: block; width: 100%; height: 100%; transition: transform .2s steps(3); }
.founder:hover .founder-img img { transform: translateY(-6px) scale(1.06); }
.founder-label { font-size: 14px; color: #e3d5c6; text-shadow: 2px 2px 0 #000; }
.founder-name { font-family: var(--px); font-size: 20px; color: var(--gold); margin: 10px 0; text-shadow: 0 3px 0 var(--gold-d), 3px 6px 0 #000; }
.founder-tag { font-size: 14px; color: #e3d5c6; text-shadow: 2px 2px 0 #000; }
.footer-title { font-family: var(--px); font-size: 11px; color: var(--cream); margin-bottom: 16px; text-shadow: 2px 2px 0 #000; }
.socials { display: flex; flex-wrap: wrap; gap: 14px; }
.social { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: var(--blue); color: var(--cream); transition: transform .12s steps(2), background .12s; }
.social svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: square; }
.social:hover { transform: translateY(-6px) rotate(-4deg); background: var(--gold); color: var(--night); }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.footer-links a { color: #f1e6d8; text-shadow: 2px 2px 0 #000; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom {
  max-width: 1240px; margin: 0 auto; padding: 18px 24px 28px; border-top: 4px solid rgba(0,0,0,.5);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13px; color: #cdbfb0; text-shadow: 2px 2px 0 #000;
}

/* ============ АДМИНКА ============ */
.admin { display: flex; flex-direction: column; gap: 24px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-tab { padding: 12px 16px; background: var(--panel-2); color: var(--cream); font-family: var(--px); font-size: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.admin-tab:hover { color: var(--cream); background: var(--blue); }
.admin-tab.is-active { background: var(--gold); color: var(--night); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px; }
.stat { text-align: center; }
.stat-v { font-family: var(--px); font-size: 22px; color: var(--gold); text-shadow: 3px 3px 0 var(--edge); }
.stat-l { color: var(--muted); font-size: 14px; margin-top: 10px; }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--dim); padding: 14px 16px; border-bottom: 4px solid var(--edge); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 2px solid rgba(0,0,0,.3); vertical-align: middle; }
.table td .head { display: inline-block; width: 24px; height: 24px; vertical-align: middle; margin-right: 6px; }
.table tr:hover td { background: rgba(255,255,255,.03); }
.t-actions { white-space: nowrap; text-align: right; }
.t-actions form + form { margin-left: 10px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; background: var(--blue-d); color: var(--muted); }
.badge-ok { background: #1f6b43; color: #d4f8de; }
.badge-bad { background: #7a2430; color: #ffd6d2; }
.badge-admin { background: #b85a1e; color: #fff; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.cover-box { aspect-ratio: 16 / 10; background: var(--well); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cover-box img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.hint { font-size: 14px; color: var(--muted); }
.hint summary { cursor: pointer; color: var(--gold); }
.hint ul { margin: 10px 0 0; padding-left: 18px; }
.danger-zone { display: flex; justify-content: flex-end; }
.search-row { display: flex; gap: 12px; max-width: 520px; }


/* ============ BB-КОД ============ */
.bb { overflow-wrap: anywhere; }
.bb-u { text-decoration: underline; text-underline-offset: 3px; }
.bb-c-red { color: #ff6b61; } .bb-c-orange { color: #ff9f43; } .bb-c-gold { color: var(--gold); } .bb-c-green { color: #8fe39a; }
.bb-c-teal { color: #5ee0d0; } .bb-c-blue { color: #7f9bff; } .bb-c-purple { color: #c39bff; } .bb-c-pink { color: #ff8fc8; } .bb-c-gray { color: var(--dim); }
.bb-s-sm { font-size: .85em; } .bb-s-md { font-size: 1em; } .bb-s-lg { font-size: 1.3em; } .bb-s-xl { font-size: 1.7em; line-height: 1.3; }
.bb-center { text-align: center; } .bb-right { text-align: right; }
.bb hr, .prose hr { border: 0; height: 4px; margin: 1.4em 0; background: repeating-linear-gradient(90deg, var(--blue) 0 12px, transparent 12px 20px); }
.bb-quote { margin: .6em 0; padding: 10px 14px; background: rgba(5,8,28,.55); box-shadow: inset 4px 0 0 var(--gold); color: var(--muted); }
.bb-quote cite { display: block; font-style: normal; font-size: 13px; color: var(--dim); margin-bottom: 4px; }
.bb-quote cite a { color: var(--gold); font-weight: 700; }
.bb-pre { margin: .6em 0; padding: 12px 14px; background: var(--ink); box-shadow: inset 3px 3px 0 var(--edge); overflow-x: auto; }
.bb-pre code { background: none; padding: 0; white-space: pre; }
.bb-spoiler { margin: .6em 0; background: rgba(5,8,28,.45); box-shadow: var(--ring); }
.bb-spoiler > summary { cursor: pointer; list-style: none; padding: 10px 14px; font-family: var(--px); font-size: 10px; color: var(--gold); display: flex; align-items: center; gap: 10px; user-select: none; }
.bb-spoiler > summary::-webkit-details-marker { display: none; }
.bb-spoiler > summary::before { content: ""; width: 8px; height: 8px; background: var(--gold); transition: transform .15s steps(2); }
.bb-spoiler[open] > summary::before { transform: rotate(45deg); }
.bb-spoiler-body { padding: 4px 14px 12px; }
.bb-img { margin: 1em 0; }
.bb-img img { display: block; max-width: 100%; box-shadow: var(--ring); image-rendering: auto; }
.bb-img figcaption { font-size: 14px; color: var(--dim); margin-top: 8px; }
.prose .bb > * + * { margin-top: .9em; }
.prose .bb h2, .prose .bb h3 { margin-top: 1.4em; }
.prose .bb ul, .prose .bb ol, .comment-text ul { padding-left: 0; list-style: none; }

/* панель редактора */
.bb-editor { display: flex; flex-direction: column; gap: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; background: var(--panel-2); box-shadow: 0 0 0 2px var(--blue); }
.tb-btn { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: var(--well); color: var(--cream); border: 0; cursor: pointer; box-shadow: var(--bevel); font: inherit; font-size: 13px; padding: 0 8px; }
.tb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.tb-btn:hover { background: var(--blue); }
.tb-btn:active { transform: translate(1px, 1px); }
.tb-text { margin-left: auto; font-family: var(--px); font-size: 9px; padding: 0 12px; }
.tb-danger:hover { background: var(--red); }
.tb-sep { width: 2px; height: 24px; background: rgba(255,255,255,.12); margin: 0 2px; }
.tb-select { height: 36px; background: var(--well); color: var(--cream); border: 0; box-shadow: var(--bevel); font: inherit; font-size: 13px; padding: 0 8px; cursor: pointer; }
.field-bb { min-height: 120px; }
.bb-preview { background: var(--well); padding: 14px 16px; box-shadow: inset 3px 3px 0 var(--edge); min-height: 120px; }

/* ============ РЕЙТИНГ ============ */
.stars { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 13px; }
.stars b { font-family: var(--px); font-size: 9px; }
.stars-row { display: inline-flex; gap: 2px; }
.stars-row i { width: 10px; height: 10px; background: rgba(255,255,255,.15); clip-path: polygon(50% 0, 63% 35%, 100% 38%, 71% 61%, 80% 100%, 50% 78%, 20% 100%, 29% 61%, 0 38%, 37% 35%); }
.stars-row i.on { background: var(--gold); }
.stars-sm .stars-row i { width: 9px; height: 9px; }
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 18px; background: var(--well); }
.rating-label { font-family: var(--px); font-size: 10px; color: var(--muted); }
.rating-stars { display: flex; gap: 4px; }
.rate-star { width: 36px; height: 36px; border: 0; padding: 0; cursor: pointer; background: rgba(255,255,255,.14); clip-path: polygon(50% 0, 63% 35%, 100% 38%, 71% 61%, 80% 100%, 50% 78%, 20% 100%, 29% 61%, 0 38%, 37% 35%); transition: transform .1s steps(2), background .1s; }
.rate-star.on { background: var(--gold); }
.rate-star:hover { transform: scale(1.15) rotate(-6deg); }
.rate-star:focus-visible { outline: none; background: var(--gold-l); }
.rating-sum { font-size: 14px; color: var(--muted); }
.rating-sum b { font-family: var(--px); font-size: 11px; color: var(--gold); }
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.top-list li { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; align-items: start; font-size: 15px; line-height: 1.35; }
.top-list .stars { grid-column: 2; }
.top-n { grid-row: span 2; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--blue); font-family: var(--px); font-size: 10px; box-shadow: var(--ring); }
.top-list li:first-child .top-n { background: var(--gold); color: var(--night); }
.top-list a { color: var(--cream); }
.top-list a:hover { color: var(--gold); }
.sort-tabs { display: flex; flex-wrap: wrap; gap: 12px; }
.sort-tab { padding: 10px 14px; min-height: 40px; display: inline-flex; align-items: center; background: var(--panel-2); color: var(--muted); font-family: var(--px); font-size: 9px; }
.sort-tab:hover { color: var(--cream); background: var(--blue); }
.sort-tab.is-active { background: var(--blue-l); color: #fff; }

/* ============ КОММЕНТАРИИ: ОТВЕТЫ И ЛАЙКИ ============ */
.comment-time { color: var(--dim); }
.reply-to { color: var(--dim); font-size: 13px; }
.reply-to a { color: var(--muted); }
.comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 8px; }
.c-act { background: none; border: 0; padding: 4px 0; color: var(--dim); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.c-act:hover:not(:disabled) { color: var(--gold); }
.c-act:disabled { cursor: default; opacity: .6; }
.c-like svg { width: 14px; height: 14px; fill: currentColor; }
.c-like.is-on { color: #ff6b61; }
.c-del:hover { color: var(--red) !important; }
.replies { list-style: none; margin-left: 54px; }
.replies .comment-list { gap: 14px; }
.comment.is-reply .head { width: 34px; height: 34px; }
.comment:target .comment-body { box-shadow: inset 3px 3px 0 var(--edge), 0 0 0 2px var(--gold); }
.replying { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--blue-d); font-size: 14px; }
.form-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.small { font-size: 13px; }
.chat-nick.is-moder::after, .comment-nick.is-moder::after { content: "◆"; margin-left: 4px; color: #5ee0d0; }
.chat-nick.is-moder::after { content: "◆:"; }
.chat-msg.is-mention { background: rgba(245,197,24,.12); box-shadow: -4px 0 0 var(--gold); margin-left: 4px; padding-left: 4px; }
.chat-rules { margin: 8px 0 0; font-size: 12px; color: var(--dim); }
.mute-note, .warn-note, .draft-note { margin: 0 0 14px; padding: 10px 14px; background: #3a1420; color: #ffd6d2; font-size: 14px; }
.warn-note { margin: 0; background: #4a3510; color: #ffe9b0; }
.draft-note { background: #4a3510; color: #ffe9b0; }
.rep { color: #ff8fa0; }
.ok-text { color: var(--green); }
.mod-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.btn-sm { min-height: 38px; padding: 8px 12px; font-size: 9px; }
.field-sm { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.field-code-big { font-family: var(--px); font-size: 18px; letter-spacing: 6px; text-align: center; }
.secret { display: block; padding: 14px; font-family: var(--px); font-size: 13px; line-height: 1.8; letter-spacing: 2px; background: var(--well); color: var(--gold); cursor: copy; word-break: break-all; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); }
.t-text { max-width: 420px; overflow-wrap: anywhere; }

/* редактор меню */
.menu-editor { display: flex; flex-direction: column; gap: 12px; }
.menu-editor .panel-title { margin: 0; }
.menu-editor .muted { margin: 0; }
.menu-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: row; }
.menu-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; }
.menu-editor[data-menu-editor="socials"] .menu-row { grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.row-btns { display: flex; gap: 6px; }
.menu-editor > .btn { align-self: flex-start; }
@media (max-width: 760px) {
  .menu-row, .menu-editor[data-menu-editor="socials"] .menu-row { grid-template-columns: 1fr; }
  .replies { margin-left: 22px; }
  .tb-text { margin-left: 0; }
}

/* ============ ПОЯВЛЕНИЕ ПРИ ПРОКРУТКЕ ============ */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .5s ease-out, transform .5s ease-out; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .news-card[data-reveal].is-in { transition: transform .2s ease-out, box-shadow .2s, opacity .5s; }

/* ============ АДАПТИВ ============ */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .founder { grid-column: 1 / -1; }
  .editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .header-inner { min-height: 0; padding: 32px 16px 72px; flex-direction: column; align-items: flex-start; }
  .mascot { display: none; }
  .logo-head { width: 56px; height: 56px; }
  .logo-tag { max-width: 60vw; font-size: 14px; }
  .tabs { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; padding: 0 16px; }
  .tab { min-height: 56px; padding: 0 10px; }
  .tab .rivet { display: none; }
  .layout { padding: 88px 16px 64px; gap: 28px; }
  .news-card { grid-template-columns: 1fr; padding: 16px; }
  .news-thumb, .news-card.is-featured .news-thumb { aspect-ratio: 16 / 7; }
  .news-card.is-featured .news-body { padding: 0 16px 18px; }
  .post-full, .auth-card { padding: 22px 18px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link.is-next { grid-column: auto; }
  .footer-inner { grid-template-columns: 1fr; padding: 100px 16px 28px; }
}
@media (max-width: 430px) {
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .founder { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
