:root {
  --bg: #0a0908;
  --bg-2: #13110f;
  --card: rgba(22, 19, 17, .88);
  --line: #2c2622;
  --line-2: #4a3a2e;
  --text: #ddd2bc;
  --muted: #8f8474;
  --accent: #a3241f;
  --accent-hi: #c8352d;
  --ember: #d0702a;
  --gold: #b08a3e;
  --accent-2: #6f7f4a;
  --radius: 4px;
  --display: "Ruslan Display", "Cormorant Garamond", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Golos Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  min-height: 100vh; display: flex; flex-direction: column;
  position: relative; overflow-x: hidden;
}
main, .site-header, .site-footer { position: relative; z-index: 2; }
main { flex: 1; }
a { color: var(--ember); }
::selection { background: var(--accent); color: #fff; }

/* ---------- Фон: виньетка, шум, геральдика, туман, угли ---------- */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-fx > * { position: absolute; inset: 0; }
.bg-glow {
  background:
    radial-gradient(ellipse 80% 50% at 50% 115%, rgba(163, 36, 31, .28), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(80, 60, 40, .25), transparent 70%);
}
.bg-pattern {
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23d8c9a8' stroke-width='1.5'%3E%3Cpath d='M40 20 L60 26 V42 C60 54 51 61 40 65 C29 61 20 54 20 42 V26 Z'/%3E%3Cpath d='M40 28 V58 M33 52 H47'/%3E%3Cpath d='M100 95 L140 135 M140 95 L100 135 M96 99 L104 91 M144 99 L136 91'/%3E%3Cpath d='M110 25 h6 v-5 h5 v5 h6 v-5 h5 v5 h6 v22 h-28 z'/%3E%3Cpath d='M30 110 l10 -10 l10 10 l-10 10 z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.bg-noise {
  opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-fog {
  inset: -20% -50%;
  background:
    radial-gradient(ellipse 30% 18% at 20% 70%, rgba(120, 110, 100, .10), transparent 70%),
    radial-gradient(ellipse 35% 20% at 70% 80%, rgba(120, 110, 100, .08), transparent 70%),
    radial-gradient(ellipse 25% 15% at 45% 90%, rgba(140, 120, 100, .09), transparent 70%);
  animation: fog 60s linear infinite alternate;
}
.bg-fog.f2 { animation-duration: 90s; animation-direction: alternate-reverse; opacity: .7; }
@keyframes fog { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
.bg-vignette { background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .75) 100%); }
#embers { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .bg-fog { animation: none; } #embers { display: none; } }

/* ---------- Каркас ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; padding-top: 48px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 9, 8, .95), rgba(10, 9, 8, .8));
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5;
  box-shadow: 0 1px 0 rgba(163, 36, 31, .25), 0 10px 30px rgba(0, 0, 0, .6);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-family: var(--display); font-size: 22px; letter-spacing: .04em; }
.logo-mark { width: 40px; height: 40px; filter: drop-shadow(0 0 8px rgba(200, 53, 45, .35)); transition: filter .3s; }
.logo:hover .logo-mark { filter: drop-shadow(0 0 14px rgba(208, 112, 42, .6)); }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--ember); }

.btn {
  display: inline-block; color: #f1e6cf !important; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent) 55%, #6e1512);
  border: 1px solid #3a0a08; border-radius: var(--radius); padding: 12px 22px;
  font: 600 15px var(--sans); letter-spacing: .03em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 200, 170, .25), 0 4px 14px rgba(0, 0, 0, .5);
  transition: box-shadow .2s, filter .2s;
}
.btn:hover { filter: brightness(1.12); box-shadow: inset 0 1px 0 rgba(255, 200, 170, .3), 0 0 18px rgba(200, 53, 45, .45); }
.btn-small { padding: 8px 14px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--text) !important; border: 1px solid var(--line-2); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.lang-toggle { background: transparent; color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 6px 10px; font: 600 13px var(--sans); cursor: pointer; }
.lang-toggle:hover { color: var(--text); border-color: var(--gold); }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; }

/* ---------- Главная ---------- */
.hero { padding: 64px 0 28px; text-align: center; }
.hero h1 {
  font-family: var(--display); font-weight: 400; letter-spacing: .03em;
  font-size: clamp(30px, 6vw, 56px); margin: 0 auto 14px; max-width: 900px;
  color: #e8dcc2; text-shadow: 0 0 24px rgba(163, 36, 31, .5), 0 2px 0 #000;
}
.hero p, .lead { color: var(--muted); font-size: 18px; max-width: 680px; }
.hero p { margin: 0 auto; }
.divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px auto 0; color: var(--accent); max-width: 420px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }
.divider svg { width: 22px; height: 22px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 8px 0 28px; }
.chip {
  background: rgba(19, 17, 15, .8); color: var(--muted); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 7px 16px; font: 500 14px var(--sans); cursor: pointer;
  letter-spacing: .02em; transition: color .15s, border-color .15s, box-shadow .15s;
}
.chip.active, .chip:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 10px rgba(163, 36, 31, .35); }

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding-bottom: 56px; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px 22px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .55), 0 6px 20px rgba(0, 0, 0, .5);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .6;
}
/* уголки, как оковка */
.card::after {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  background:
    linear-gradient(var(--line-2), var(--line-2)) top left / 12px 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) top left / 1px 12px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) top right / 12px 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) top right / 1px 12px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) bottom left / 12px 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) bottom left / 1px 12px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) bottom right / 12px 1px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) bottom right / 1px 12px no-repeat;
}
.card:hover { border-color: #5a1d18; transform: translateY(-3px); box-shadow: inset 0 0 40px rgba(0, 0, 0, .55), 0 10px 30px rgba(0, 0, 0, .6), 0 0 22px rgba(163, 36, 31, .25); }
.card h2 { font-size: 26px; margin: 0; color: #eadfc6; }
.card p { margin: 0; color: var(--muted); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.tag { border: 1px solid var(--line-2); border-radius: 2px; padding: 1px 8px; font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.tag.mmo { color: var(--accent-hi); border-color: var(--accent); }
.tag.yo { color: var(--gold); border-color: var(--gold); }
.tag.all { color: var(--muted); }
.tag.community { color: var(--ember); border-color: var(--ember); }
.empty { color: var(--muted); }

/* ---------- Пост ---------- */
.back { display: inline-block; margin: 28px 0 8px; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--ember); }
.article {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px 30px; margin-bottom: 56px; box-shadow: inset 0 0 60px rgba(0, 0, 0, .6), 0 10px 30px rgba(0, 0, 0, .5);
}
.article:empty { display: none; }
.article h1 { font-size: clamp(30px, 5.5vw, 46px); margin: 12px 0; color: #eadfc6; }
.article .summary { font-size: 19px; color: #b3a790; border-left: 3px solid var(--accent); padding-left: 14px; font-style: italic; }
.article > p:first-of-type + p::first-letter, .article .summary + p::first-letter {
  float: left; font-family: var(--display); font-size: 3.2em; line-height: .9; padding: 4px 8px 0 0; color: var(--accent-hi);
}
.article h2 { font-size: 28px; margin-top: 34px; color: #e3d6bb; }
.article h2::before { content: "✠ "; color: var(--accent); font-size: .8em; }
.article li { margin-bottom: 6px; }
.article li::marker { color: var(--accent); }
.source { margin-top: 32px; padding: 14px 16px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Формы ---------- */
main.narrow > h1 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 44px); margin: 40px 0 8px; text-shadow: 0 0 20px rgba(163, 36, 31, .45); }
.form {
  display: grid; gap: 16px; margin: 24px 0 56px; padding: 26px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .6), 0 10px 30px rgba(0, 0, 0, .5);
}
.form label { display: grid; gap: 6px; font-weight: 500; }
.form input, .form select, .form textarea {
  width: 100%; background: #0d0c0b; color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 12px 14px; font: 16px var(--sans); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 0 0 2px rgba(163, 36, 31, .25); }
.form small { color: var(--muted); font-weight: 400; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .check input { width: auto; margin-top: 5px; accent-color: var(--accent); box-shadow: none; }
.hp { position: absolute; left: -9999px; }
.seal { width: 96px; height: 96px; filter: drop-shadow(0 0 24px rgba(200, 53, 45, .5)); animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { filter: drop-shadow(0 0 36px rgba(208, 112, 42, .65)); } }
.center h1 { font-family: var(--display); font-weight: 400; }
.center .lead { margin: 0 auto 24px; }

/* ---------- Модерация ---------- */
.approve-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 28px 0 12px; }
.status { color: var(--muted); }
.status.ok { color: var(--accent-2); }
.status.err { color: #e06b5a; }
.status a { margin-left: 8px; }
.approve-tabs { display: flex; gap: 8px; margin-bottom: 12px; }

.site-footer { border-top: 1px solid var(--line); color: #6f665a; font-size: 14px; padding: 22px 0; background: rgba(5, 5, 4, .8); text-align: center; }

.made-by { margin: 0 0 8px; color: var(--muted); }
.made-by a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.made-by a:hover { color: var(--ember); border-color: var(--ember); }
.made-by a.order { color: var(--accent-hi); border-color: rgba(163,36,31,.5); }

/* ---------- Плашка разработчика (цвета aiworkhelper.ru) ---------- */
.dev-badge {
  position: fixed; right: 18px; bottom: 18px; z-index: 20; width: 250px;
  background: linear-gradient(160deg, #142057 0%, #0b1238 100%);
  border: 1px solid #2f4bff; border-radius: 14px; padding: 16px 16px 14px;
  color: #e6ebff; font-family: var(--sans); font-size: 14px; line-height: 1.45;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .6), 0 0 26px rgba(47, 75, 255, .35);
  animation: badgeIn .6s ease-out both .8s;
}
@keyframes badgeIn { from { opacity: 0; transform: translateY(16px); } }
.dev-badge .db-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding-right: 18px; }
.dev-badge .db-mark {
  flex: none; width: 34px; height: 34px; border-radius: 9px; background: #2f4bff; color: #fff;
  display: grid; place-items: center; font: 700 15px var(--sans); letter-spacing: -.02em;
}
.dev-badge .db-by { color: #9fb0ff; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.dev-badge .db-name { font-weight: 600; color: #fff; }
.dev-badge p { margin: 0 0 12px; color: #c3cdf7; }
.dev-badge .db-btn {
  display: block; text-align: center; background: #2f4bff; color: #fff; text-decoration: none;
  border-radius: 9px; padding: 9px 12px; font-weight: 600; transition: background .2s, box-shadow .2s;
}
.dev-badge .db-btn:hover { background: #4560ff; box-shadow: 0 0 16px rgba(47, 75, 255, .6); }
.dev-badge .db-site { display: block; text-align: center; margin-top: 8px; color: #9fb0ff; font-size: 13px; text-decoration: none; }
.dev-badge .db-site:hover { color: #fff; }
.dev-badge .db-close {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: transparent; color: #9fb0ff; font-size: 18px; line-height: 1; cursor: pointer;
}
.dev-badge .db-close:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.dev-badge.mini { width: auto; padding: 0; border-radius: 12px; animation: none; }
.dev-badge.mini > :not(.db-open) { display: none; }
.dev-badge .db-open {
  display: none; align-items: center; gap: 8px; border: 0; background: transparent; color: #fff;
  padding: 8px 12px 8px 8px; font: 600 13px var(--sans); cursor: pointer;
}
.dev-badge.mini .db-open { display: flex; }
.dev-badge .db-open .db-mark { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
@media (max-width: 640px) {
  .dev-badge { right: 12px; bottom: 12px; left: 12px; width: auto; }
  .dev-badge.mini { left: auto; }
  body { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { .dev-badge { animation: none; } }

.helped-by { margin: 0 0 8px; font-size: 13px; color: #6f665a; }
.helped-by .nick { color: var(--gold); font-family: ui-monospace, Consolas, monospace; }
