/* TransChange — оформление */
:root {
  --bg: #0c0d18;
  --bg-2: #141628;
  --bg-3: #1b1e36;
  --card: #15172b;
  --line: #262a4a;
  --text: #eef0fb;
  --muted: #9097b8;
  --violet: #7c5cff;
  --violet-2: #9d7bff;
  --green: #36d98a;
  --accent: var(--violet);
  --grad: linear-gradient(100deg, #7c5cff 0%, #5b8cff 55%, #36d98a 100%);
  --ok: #36d98a;
  --warn: #f5b443;
  --err: #ff5c74;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  font: 15px/1.55 var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(124, 92, 255, .22), transparent 60%),
    radial-gradient(800px 480px at 95% 5%, rgba(54, 217, 138, .12), transparent 60%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--violet-2); text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: clamp(26px, 4.2vw, 44px); margin: 0 0 12px; font-weight: 700; }
h2 { font-size: clamp(20px, 2.6vw, 28px); margin: 0 0 18px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 8px; font-weight: 600; }

/* ---------- Шапка ---------- */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(12, 13, 24, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 19px; white-space: nowrap; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.search { flex: 1; max-width: 520px; position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px; border-radius: 999px; background: var(--bg-2); height: 42px; }
nav.top-nav, header.top nav { margin-left: auto; display: flex; gap: 22px; }
nav.top-nav a, header.top nav a { color: var(--muted); font-weight: 600; font-size: 14px; }
nav.top-nav a:hover, header.top nav a:hover { color: var(--text); }
@media (max-width: 860px) {
  header.top nav.top-nav { display: none; }
  header.top .wrap { gap: 12px; }
  .logo span { display: none; }
}

/* ---------- Формы и кнопки ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
input, textarea, select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2); }
textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--grad); color: #fff; text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(124, 92, 255, .9);
  transition: transform .12s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.block { width: 100%; margin-top: 16px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--violet); }
.btn.white { background: #fff; color: #17182c; box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: 13px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
}
.chip:hover { border-color: var(--violet); }
.chip.active { background: var(--violet); border-color: var(--violet); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.error { color: var(--err); font-size: 14px; margin-top: 10px; min-height: 1em; }

/* ---------- Переключатель режимов ---------- */
.intro { padding: 34px 16px 8px; text-align: center; }
.intro p { max-width: 640px; margin: 0 auto; }
.switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 560px; margin: 0 auto 26px;
  padding: 6px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line);
}
.switch button {
  border: 0; border-radius: 999px; padding: 12px 10px; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.switch button.active { background: linear-gradient(100deg, #36d98a, #2bb673); color: #0b1a12; box-shadow: 0 8px 22px -10px rgba(54, 217, 138, .8); }

/* ---------- Баннер-слайдер ---------- */
.slider { position: relative; margin-top: 26px; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.slides { display: flex; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.slide {
  min-width: 100%; min-height: 300px; padding: 44px clamp(22px, 5vw, 60px);
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 20px; position: relative; overflow: hidden;
}
.slide h2 { font-size: clamp(22px, 3.4vw, 38px); text-transform: uppercase; margin-bottom: 12px; }
.slide p { margin: 0 0 22px; color: rgba(255, 255, 255, .8); max-width: 420px; }
.slide-art { position: relative; height: 230px; }
.slide-art .tile {
  position: absolute; width: 140px; height: 180px; border-radius: 18px;
  display: grid; place-items: center; font-size: 64px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .8); backdrop-filter: blur(6px);
}
.slide-art .tile:nth-child(1) { left: 6%; top: 30px; transform: rotate(-12deg); }
.slide-art .tile:nth-child(2) { left: 34%; top: 0; transform: rotate(2deg); z-index: 2; background: rgba(255, 255, 255, .14); }
.slide-art .tile:nth-child(3) { left: 62%; top: 34px; transform: rotate(13deg); }
.slide.s1 { background: radial-gradient(500px 300px at 85% 50%, rgba(91, 140, 255, .55), transparent 70%), linear-gradient(120deg, #141a3c, #1d2f6b); }
.slide.s2 { background: radial-gradient(500px 300px at 85% 50%, rgba(124, 92, 255, .6), transparent 70%), linear-gradient(120deg, #1b1236, #3a1f73); }
.slide.s3 { background: radial-gradient(500px 300px at 85% 50%, rgba(54, 217, 138, .45), transparent 70%), linear-gradient(120deg, #0f2420, #145a45); }
.dots { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; }
.dots button { width: 9px; height: 9px; border-radius: 9px; border: 0; padding: 0; background: rgba(255, 255, 255, .35); cursor: pointer; transition: width .25s, background .25s; }
.dots button.active { width: 26px; background: var(--green); }
@media (max-width: 720px) {
  .slide { grid-template-columns: 1fr; min-height: 340px; padding-bottom: 50px; }
  .slide-art { display: none; }
}

/* ---------- Плитки категорий ---------- */
.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 22px 0 10px; }
@media (max-width: 1100px) {
  .cat .label { font-size: 11px; padding: 6px 10px; left: 10px; right: 10px; justify-content: center; }
  .cat .art { font-size: 62px; }
}
@media (max-width: 760px) {
  .cat .label { font-size: 12px; right: auto; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .cats .cat:first-child { grid-column: 1 / -1; }
  .cat { height: 140px; }
  .cat .art { font-size: 68px; }
}
.cat {
  position: relative; height: 170px; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .08); color: #fff; text-align: left; padding: 0;
  font: inherit; box-shadow: var(--shadow); transition: transform .18s, border-color .18s;
}
.cat:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .3); }
.cat .art { position: absolute; right: -8px; top: 8px; font-size: 84px; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .5)); transform: rotate(-8deg); transition: transform .25s; }
.cat:hover .art { transform: rotate(0) scale(1.06); }
.cat .label {
  position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(10, 10, 20, .55); backdrop-filter: blur(8px); border-radius: 999px; padding: 7px 12px;
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .02em;
}
.cat .count { position: absolute; left: 14px; top: 12px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .75); }
.cat.c-steam { background: linear-gradient(150deg, #1d3b78, #0f1b3a); }
.cat.c-keys { background: linear-gradient(150deg, #6b2a2a, #2a1218); }
.cat.c-gift { background: linear-gradient(150deg, #155a46, #0d241f); }
.cat.c-subs { background: linear-gradient(150deg, #4a2c8f, #1d1340); }
.cat.c-mobile { background: linear-gradient(150deg, #7a4a12, #2b1a08); }
.cat.c-other { background: linear-gradient(150deg, #2a2f55, #15172b); }

/* ---------- Пополнение Steam ---------- */
.steam-view { display: grid; grid-template-columns: 1fr 1.05fr; gap: 26px; align-items: start; margin-top: 4px; }
@media (max-width: 900px) { .steam-view { grid-template-columns: 1fr; } }
.steam-card h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.steam-card .steam-ico { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(150deg, #1d3b78, #0f1b3a); display: grid; place-items: center; font-size: 18px; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.total b { font-size: 24px; font-family: var(--font-display); }
.steps { display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 16px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.step .n { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: rgba(124, 92, 255, .16); color: var(--violet-2); }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.notice { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(245, 180, 67, .08); border: 1px solid rgba(245, 180, 67, .25); color: #f3d59a; font-size: 13px; }

/* ---------- Каталог ---------- */
.section { padding-top: 40px; padding-bottom: 10px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .16s, border-color .16s;
}
.product:hover { transform: translateY(-3px); border-color: var(--violet); }
.cover { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 64px; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .tag {
  position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  background: rgba(10, 10, 20, .6); backdrop-filter: blur(6px); padding: 4px 9px; border-radius: 999px; letter-spacing: .03em;
}
.product .body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product .title { font-weight: 700; line-height: 1.3; }
.product .row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; font-size: 19px; font-family: var(--font-display); }
.stock { font-size: 12px; color: var(--ok); font-weight: 600; }
.stock.out { color: var(--err); }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); grid-column: 1 / -1; }

.g-steam { background: linear-gradient(150deg, #1d3b78, #0f1b3a); }
.g-keys { background: linear-gradient(150deg, #6b2a2a, #2a1218); }
.g-gift { background: linear-gradient(150deg, #155a46, #0d241f); }
.g-subs { background: linear-gradient(150deg, #4a2c8f, #1d1340); }
.g-mobile { background: linear-gradient(150deg, #7a4a12, #2b1a08); }
.g-other { background: linear-gradient(150deg, #2a2f55, #15172b); }

/* ---------- Как это работает / FAQ ---------- */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 800px) { .how { grid-template-columns: 1fr; } }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--violet-2); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Модальное окно ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 5, 12, .7); backdrop-filter: blur(4px); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: grid; }
.modal { width: 100%; max-width: 460px; position: relative; padding: 0; overflow: hidden; }
.modal .cover { aspect-ratio: 16 / 7; font-size: 72px; }
.modal .inner { padding: 20px 22px 22px; }
.modal .close { position: absolute; right: 12px; top: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(10, 10, 20, .6); color: #fff; font-size: 20px; cursor: pointer; }

/* ---------- Форма покупки товара GiftAPI ---------- */
.modal { max-height: calc(100vh - 32px); overflow-y: auto; }
.buy-form .fields:empty { display: none; }
.hint-line { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.sku-chips { max-height: 190px; overflow-y: auto; padding: 2px; }
.desc { margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; background: var(--bg-2); }
.desc summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 700; color: var(--violet-2); }
.desc p { white-space: pre-line; font-size: 13px; margin: 0 0 12px; max-height: 220px; overflow-y: auto; }
.more { display: flex; justify-content: center; margin-top: 18px; }
.cover img { background: #fff; }

/* ---------- Поддержка ---------- */
.support-btn {
  position: fixed; left: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text); font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
}
.support-btn:hover { border-color: var(--violet); }

/* ---------- Подвал ---------- */
footer { margin-top: 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 26px 0 34px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pay-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-badges span { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-weight: 700; color: var(--text); font-size: 12px; }

/* ---------- 152-ФЗ: согласие, уведомление, документы ---------- */
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.45; cursor: pointer; }
.consent input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; padding: 0; accent-color: var(--violet); cursor: pointer; }
.consent a { color: var(--violet-2); text-decoration: underline; text-underline-offset: 2px; }

.pd-banner {
  position: fixed; z-index: 60; left: 50%; bottom: 16px; width: min(720px, calc(100% - 32px));
  transform: translate(-50%, 20px); opacity: 0; transition: transform .3s, opacity .3s;
  display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--radius);
  background: rgba(21, 23, 43, .96); backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 13px; color: var(--muted); line-height: 1.5;
}
.pd-banner.show { transform: translate(-50%, 0); opacity: 1; }
.pd-banner.hide { transform: translate(-50%, 20px); opacity: 0; }
.pd-banner b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.pd-banner a { color: var(--violet-2); text-decoration: underline; text-underline-offset: 2px; }
.pd-banner .btn { flex: none; }
@media (max-width: 560px) { .pd-banner { flex-direction: column; align-items: stretch; } }

.doc { max-width: 860px; padding-top: 34px; padding-bottom: 40px; line-height: 1.7; }
.doc h1 { font-size: clamp(24px, 3.4vw, 34px); }
.doc h2 { font-size: 19px; margin: 30px 0 10px; }
.doc p, .doc li { color: #cfd3ea; }
.doc ul { padding-left: 22px; }
.doc table { font-size: 14px; }
.doc td, .doc th { padding: 10px; }
.email-text { color: var(--text); font-weight: 600; white-space: nowrap; }
.legal-missing { color: var(--warn); background: rgba(245, 180, 67, .12); border-radius: 6px; padding: 0 6px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Заказ, статусы ---------- */
.status { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.status.pending { background: rgba(245, 180, 67, .14); color: var(--warn); }
.status.paid { background: rgba(124, 92, 255, .16); color: var(--violet-2); }
.status.delivered { background: rgba(54, 217, 138, .14); color: var(--ok); }
.status.failed, .status.expired { background: rgba(255, 92, 116, .14); color: var(--err); }
.keybox { background: var(--bg-2); border: 1px dashed var(--ok); border-radius: var(--radius-sm); padding: 14px; font-family: ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin-top: 10px; }

.result-page { max-width: 560px; padding-top: 40px; padding-bottom: 60px; }
.result { text-align: center; }
.result h1 { font-size: 26px; margin-top: 6px; }
.result #box, .result .reasons { text-align: left; }
.result-icon { width: 76px; height: 76px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; font-weight: 800; }
.result.ok .result-icon { background: rgba(54, 217, 138, .15); color: var(--ok); box-shadow: 0 0 0 9px rgba(54, 217, 138, .06); }
.result.fail .result-icon { background: rgba(255, 92, 116, .15); color: var(--err); box-shadow: 0 0 0 9px rgba(255, 92, 116, .06); }
.reasons { margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; }
.reasons p { margin: 0 0 4px; }
.reasons ul { margin: 0; padding-left: 20px; color: var(--muted); }
.hint { font-size: 13px; margin-top: 14px; text-align: center; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Админка ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.tabs { display: flex; gap: 8px; margin: 20px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Мои покупки (Telegram Mini App) */
.my-orders-btn { margin-top: 14px; }
.my-orders { display: grid; gap: 10px; }
.my-order { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.my-order:hover { border-color: var(--violet); }
.my-order .title { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.my-order .muted { grid-column: 1 / -1; font-size: 13px; }
