:root {
  --bg: #0d0f14;
  --surface: #161924;
  --surface-2: #1d2130;
  --border: rgba(255,255,255,0.08);
  --text: #eef0f6;
  --muted: #8f98ad;
  --accent: #8b7cff;
  --accent-2: #ff6fb1;
  --green: #35d4a0;
  --red: #ff6b7a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  background-image: radial-gradient(900px 420px at 80% -10%, rgba(139,124,255,0.16), transparent),
                    radial-gradient(700px 380px at -10% 0%, rgba(255,111,177,0.10), transparent);
  background-repeat: no-repeat;
}
a { color: #b3a9ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- Шапка ---- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(13,15,20,0.8);
       backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { color: var(--accent); margin-right: 4px; }
.nav nav { display: flex; gap: 22px; }
.nav nav a { color: var(--muted); font-weight: 500; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav-admin { color: var(--accent) !important; }
main { padding-top: 28px; padding-bottom: 60px; min-height: 70vh; }
.footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .9rem; }

/* ---- Заголовки секций ---- */
.hero { padding: 36px 0 18px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800;
           background: linear-gradient(90deg, #fff, #b3a9ff 60%, var(--accent-2));
           -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero.small { padding: 10px 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.section-title { font-size: 1.4rem; font-weight: 700; margin: 34px 0 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
section { margin-bottom: 8px; }

/* ---- Кнопки и бейджи ---- */
.btn { display: inline-block; padding: 10px 20px; border: 0; border-radius: 10px; cursor: pointer;
       font: inherit; font-weight: 600; color: #fff !important; text-decoration: none !important;
       background: linear-gradient(135deg, var(--accent), #6c5ce7);
       transition: transform .12s ease, filter .12s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-big { padding: 14px 28px; font-size: 1.05rem; }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border); }
.btn-green { background: linear-gradient(135deg, #25c28f, #1a9d74); }
.btn-danger { background: rgba(255,107,122,0.15); border: 1px solid rgba(255,107,122,0.4); color: var(--red) !important; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
         background: rgba(139,124,255,0.18); color: #c6beff; }
.badge-gray { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge-green { background: rgba(53,212,160,0.16); color: var(--green); }

/* ---- Карточки игр ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.game-card { display: block; background: var(--surface); border: 1px solid var(--border);
             border-radius: var(--radius); overflow: hidden; color: var(--text);
             transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.game-card:hover { transform: translateY(-4px); border-color: rgba(139,124,255,0.5);
                   box-shadow: 0 14px 40px rgba(0,0,0,0.4); text-decoration: none; }
.cover { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.game-card:hover .cover img { transform: scale(1.05); }
.cover-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3.5rem; font-weight: 800;
            background: linear-gradient(135deg, #2a2f4a, #3b2a4a); color: rgba(255,255,255,0.5); }
.card-body { padding: 16px 18px 18px; }
.card-body h3 { margin: 0 0 4px; font-size: 1.15rem; }
.card-body p { margin: 0 0 10px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 18px 20px; margin-bottom: 16px; }
.card h3 { font-size: 1.05rem; }

/* ---- Страница игры ---- */
.game-hero { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 28px;
             background: linear-gradient(135deg, #1b1f33, #2b1f3a); border: 1px solid var(--border); }
.game-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--cover);
                     background-size: cover; background-position: center; filter: blur(2px) brightness(0.45); transform: scale(1.05); }
.game-hero::after { content: ""; position: absolute; inset: 0;
                    background: linear-gradient(0deg, rgba(13,15,20,0.9), rgba(13,15,20,0.2) 70%); }
.game-hero-inner { position: relative; z-index: 1; padding: 90px 32px 32px; max-width: 700px; }
.game-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 8px; }
.game-hero .row { margin: 18px 0 8px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.col-side { position: sticky; top: 82px; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; text-align: right; font-weight: 600; }
.version { padding: 10px 0; border-top: 1px solid var(--border); }
.version:first-of-type { border-top: 0; }
.version summary { cursor: pointer; }
.changelog { margin: 8px 0; color: var(--muted); white-space: pre-line; }
.hash { font-size: .7rem; color: var(--muted); word-break: break-all; margin-top: 6px; }

.prose { color: #d9dcea; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose img { max-width: 100%; border-radius: 10px; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.prose pre { background: var(--surface-2); padding: 14px; border-radius: 10px; overflow-x: auto; }
.prose blockquote { margin: 0 0 1em; padding-left: 16px; border-left: 3px solid var(--accent); color: var(--muted); }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.demo-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: var(--radius); background: #000; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.06); }
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center;
            background: rgba(5,6,10,0.92); cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 10px; }

/* ---- Dev-лог ---- */
.posts { display: grid; gap: 14px; }
.post-card { display: block; background: var(--surface); border: 1px solid var(--border);
             border-radius: var(--radius); padding: 18px 22px; color: var(--text);
             transition: border-color .15s ease, transform .15s ease; }
.post-card:hover { border-color: rgba(139,124,255,0.5); transform: translateY(-2px); text-decoration: none; }
.post-card h3 { margin: 6px 0; font-size: 1.15rem; }
.post-card p { margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: .85rem; }
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0 22px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 22px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
        color: var(--muted); font-size: .9rem; }
.chip.active, a.chip:hover { color: #fff; border-color: var(--accent); text-decoration: none; }
.chip.active { background: rgba(139,124,255,0.25); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty.big h1 { font-size: 4rem; color: var(--text); }

/* ---- Формы ---- */
.form label { display: block; font-size: .88rem; color: var(--muted); margin: 14px 0 4px; }
.form label:first-child { margin-top: 0; }
input, textarea, select { width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 4px; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--accent); }
input[type=file] { padding: 8px; }
.form .btn { margin-top: 14px; }
.auth { max-width: 380px; margin: 50px auto; }
.auth input { margin-bottom: 14px; }
.error { color: var(--red); }
.flash { padding: 12px 16px; border-radius: 10px; margin-top: 18px; font-weight: 500; }
.flash.ok { background: rgba(53,212,160,0.14); color: var(--green); border: 1px solid rgba(53,212,160,0.3); }
.flash.err { background: rgba(255,107,122,0.14); color: var(--red); border: 1px solid rgba(255,107,122,0.3); }

/* ---- Админка ---- */
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.thumb { max-width: 280px; border-radius: 10px; display: block; margin-bottom: 8px; }
.admin-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.shot img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 6px; }

/* ---- Статистика ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-n { font-size: 1.9rem; font-weight: 800; }
.stat-n small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.stat-l { color: var(--muted); font-size: .85rem; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.chart-box { position: relative; height: 260px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td:last-child { white-space: normal; word-break: break-all; }

/* ---- Мобильные ---- */
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .game-hero-inner { padding: 60px 20px 24px; }
  .charts { grid-template-columns: 1fr; }
  .nav nav { gap: 14px; font-size: .92rem; }
}

/* ---- Переключатель языка ---- */
.lang { display: inline-flex; gap: 2px; margin-left: 6px; padding: 3px; border-radius: 999px;
        background: var(--surface-2); border: 1px solid var(--border); }
.lang a { padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--muted) !important; }
.lang a:hover { color: var(--text) !important; text-decoration: none; }
.lang a.active { background: var(--accent); color: #fff !important; }
.nav nav { align-items: center; }

/* ---- Планы ---- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.board-col h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.board-planned h3 { color: #c6beff; }
.board-progress h3 { color: #ffd166; }
.board-done h3 { color: var(--green); }
.rm-item { margin-bottom: 10px; padding: 14px 16px; }
.board-done .rm-item { opacity: .8; }

/* ---- Статистика: проблемные уровни ---- */
.row-hard td { background: rgba(255, 107, 122, 0.10); }

@media (max-width: 820px) {
  .board { grid-template-columns: 1fr; }
  .nav-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 8px; }
  .nav nav { flex-wrap: wrap; gap: 10px 14px; }
}

/* ---- Обратная связь, ошибки ---- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.narrow { max-width: 640px; }
.badge-red { background: rgba(255,107,122,0.18); color: var(--red); }
.unread { border-color: rgba(139,124,255,0.6); box-shadow: 0 0 0 1px rgba(139,124,255,0.25); }
.msg { white-space: pre-wrap; word-break: break-word; }
.err-msg { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
           overflow-x: auto; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---- Блок переводов в админке ---- */
.tr-box { margin: 14px 0 4px; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 10px; }
.tr-box summary { cursor: pointer; color: var(--muted); }
