:root {
  --bg: #0e0f11;
  --bg2: #16181b;
  --panel: #1b1d21;
  --panel2: #22252a;
  --line: #2c2f35;
  --text: #e8e6e3;
  --muted: #8b8f96;
  --accent: #ff5a1f;
  --accent2: #ff8a3d;
  --green: #3fbf6f;
  --red: #e5484d;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg) radial-gradient(1200px 500px at 50% -200px, #2a1609 0%, transparent 70%) no-repeat;
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: Oswald, Inter, sans-serif; font-weight: 700; letter-spacing: .02em; margin: 0 0 12px; }
h1 { font-size: 28px; text-transform: uppercase; }
h2 { font-size: 19px; }
h3 { font-size: 16px; margin-top: 18px; }
code { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 40px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.r { text-align: right; }
.center { text-align: center; }
.inline { display: inline; }

/* Шапка */
.top { background: rgba(14,15,17,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.logo { font-family: Oswald, sans-serif; font-weight: 700; font-size: 20px; color: var(--text); letter-spacing: .06em; display: flex; align-items: center; gap: 10px; }
.logo:hover { text-decoration: none; }
.logo-img { height: 38px; width: auto; display: block; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text b { font: 700 20px Oswald, sans-serif; color: var(--accent); letter-spacing: .06em; }
.hero-by { color: var(--accent2); font-weight: 600; }
.price.free { color: #3ecf8e; }
.menu { display: flex; gap: 6px; flex: 1; }
.menu a { color: var(--muted); padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.menu a.on, .menu a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.account { display: flex; align-items: center; gap: 10px; }
.balance { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 34px 4px 12px; position: relative; color: var(--text); line-height: 1.2; }
.balance small { color: var(--muted); font-size: 11px; }
.balance .plus { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.balance:hover { text-decoration: none; border-color: var(--accent); }
.me { display: flex; align-items: center; gap: 8px; color: var(--text); }
.me img { width: 34px; height: 34px; border-radius: 8px; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.icon-btn:hover { color: var(--red); border-color: var(--red); }

/* Кнопки и формы */
.btn { display: inline-block; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 16px; font: 600 14px Inter, sans-serif; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.steam { background: #1b2838; border-color: #2a475e; }
input, select, textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font: 14px Inter, sans-serif; margin-top: 5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; color: var(--muted); font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
label.check input, .radios input { width: auto; margin: 0; }
.radios { display: flex; gap: 18px; }
.radios label { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: 14px; }
.stack > * + * { margin-top: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.search { display: flex; gap: 8px; margin-bottom: 14px; max-width: 520px; }
.search input { margin: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select, .inline-form input { margin: 0; width: auto; padding: 5px 8px; font-size: 13px; }
.w60 { width: 64px !important; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }

/* Сообщения */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: rgba(63,191,111,.1); border-color: rgba(63,191,111,.4); }
.flash.error { background: rgba(229,72,77,.1); border-color: rgba(229,72,77,.4); }

/* Каталог */
.hero { padding: 24px 0 28px; }
.hero h1 { font-size: 40px; margin-bottom: 6px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.card-img { aspect-ratio: 16/10; background: var(--bg2); position: relative; display: grid; place-items: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 22% !important; height: auto !important; opacity: .25; filter: grayscale(1); }
.ph.big { width: 40% !important; }
.tag { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.7); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.card-body { padding: 14px 16px 16px; }
.price { color: var(--accent); font: 700 20px Oswald, sans-serif; }
.price.big { font-size: 32px; }
.name { font-weight: 600; font-size: 16px; margin-top: 2px; }
.short { color: var(--muted); font-size: 13px; margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

/* Страница мода */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; margin-bottom: 24px; }
.product-img { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.lead { color: var(--muted); font-size: 16px; }
.facts { list-style: none; padding: 0; margin: 18px 0; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts span { color: var(--muted); }
.buy { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pre { white-space: pre-line; }

/* Панели и кабинет */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.layout { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; position: sticky; top: 84px; }
.side a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.side a.on, .side a:hover { background: var(--panel2); text-decoration: none; }
.side a.on { box-shadow: inset 3px 0 0 var(--accent); }
.content { min-width: 0; }
.lic.off { opacity: .7; }
.lic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lic-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.key-row { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.key { font-size: 16px; padding: 8px 12px; cursor: pointer; align-self: flex-start; color: var(--accent2); }
.bind { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; margin-top: 14px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge.green { background: rgba(63,191,111,.15); color: var(--green); }
.badge.red { background: rgba(229,72,77,.15); color: var(--red); }
.badge.grey { background: rgba(139,143,150,.18); color: var(--muted); }
.badge.gold { background: rgba(240,180,41,.15); color: #f0b429; border: 1px solid rgba(240,180,41,.5); }
b.gold { color: #f0b429; }
h2 .badge { vertical-align: middle; margin-left: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.grey { background: var(--muted); }
.count { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 6px; border-radius: 10px; background: var(--panel2); color: var(--muted); font: 600 12px Inter, sans-serif; vertical-align: middle; text-align: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cards .panel { margin: 0; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.file { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.file-head { display: flex; justify-content: space-between; gap: 8px; width: 100%; align-items: flex-start; }
.chip { font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.agree { margin: 8px 0; }
.agree a { color: var(--accent); }
input[readonly] { opacity: .85; }
.qcard { border-left: 3px solid var(--accent); }
.profile { display: flex; gap: 20px; align-items: center; }
.avatar { width: 96px; height: 96px; border-radius: 14px; }

/* Таблицы */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.dim td { opacity: .5; }
.tbl tr.bad td { color: #f2a3a5; }
.plus { color: var(--green); }
.minus { color: var(--red); }
.panel { overflow-x: auto; }

/* Сводка */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat small { color: var(--muted); display: block; }
.stat b { font: 700 26px Oswald, sans-serif; }
.stat.warn { border-color: var(--accent); }
.warnbox { border-color: var(--accent); }

.tabs { display: flex; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; }
.tabs a { color: var(--muted); padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; }
.tabs a.on, .tabs a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
/* Новости, гайды, истории */
.post-list { display: grid; gap: 14px; }
.post-list.three-col { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.post-item { display: block; color: var(--text); transition: border-color .15s; }
.post-item:hover { border-color: var(--accent); text-decoration: none; }
.post-item h2, .post-item h3 { margin: 6px 0 6px; }
.post-item .more { color: var(--accent); font-weight: 600; font-size: 14px; }
.story-names { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.story-names b { color: var(--accent2); }
.story-body { max-height: 320px; overflow: auto; background: var(--bg2); padding: 12px; border-radius: 8px; margin: 10px 0; }
.home-block { margin-top: 36px; }
.home-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.home-head h2 { margin: 0 0 14px; }
.w80 { width: 90px !important; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-row { display: flex; justify-content: space-between; padding: 18px 16px; }

@media (max-width: 820px) {
  .product, .layout, .two, .three, .bind { grid-template-columns: 1fr; }
  .side { position: static; display: flex; overflow-x: auto; }
  .side a { white-space: nowrap; }
  .hero h1 { font-size: 30px; }
  .me span { display: none; }
  .top-row { flex-wrap: wrap; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; }
  .menu a { white-space: nowrap; }
  .top-row { gap: 10px; padding: 8px 0; }
}
.inline-forms { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.inline-form label { display: flex; gap: 8px; align-items: center; }
.w160 { width: 160px !important; }
.qcard .inline-form input[name=reason] { min-width: 260px; }

.slots { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.slots-head { display: flex; justify-content: space-between; }
.slot-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.slot-row select { margin: 0; flex: 1; padding: 5px 8px; font-size: 13px; }
.slot-row form { margin: 0; }
