:root {
  --bg: #0d0f13;
  --card: #171a21;
  --card-2: #1e222b;
  --line: #2a2f3a;
  --text: #f2f3f5;
  --muted: #8d94a3;
  --accent: #ffb400;
  --accent-2: #ff8a00;
  --ok: #2fd27a;
  --err: #ff5d5d;
  --radius: 14px;
  --nav-h: 56px;
  --safe-b: env(safe-area-inset-bottom);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + 12px + var(--safe-b));
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- экран загрузки ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 42%, #2a1f05 0%, var(--bg) 62%);
  transition: opacity .45s ease, visibility .45s;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-glow {
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  top: calc(50% - 150px); left: calc(50% - 130px);
  background: radial-gradient(circle, #ffb40040, transparent 65%);
  animation: glow 1.6s ease-in-out infinite;
}
.splash-title { position: relative; font-weight: 900; font-style: italic; font-size: 40px; letter-spacing: 1px; text-shadow: 0 4px 24px #ffb40055; animation: pop .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.splash-title .star { display: inline-block; animation: spin 2.4s linear .5s infinite; }
.splash-sub { position: relative; font-size: 11px; font-weight: 700; letter-spacing: 5px; color: var(--muted); animation: fadeUp .4s .15s both; }
.splash-bar { position: relative; width: 140px; height: 3px; border-radius: 3px; background: var(--card-2); overflow: hidden; margin-top: 14px; animation: fadeUp .4s .2s both; }
.splash-bar i { position: absolute; inset: 0; width: 40%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); animation: load 1.1s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.15); opacity: .6; } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes spin { 50% { transform: rotate(180deg) scale(1.2); } 100% { transform: rotate(360deg); } }
@keyframes fadeUp { from { transform: translateY(8px); opacity: 0; } }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: 9px 12px; background: rgba(13, 15, 19, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; }
.logo { font-weight: 900; font-size: 17px; letter-spacing: .3px; font-style: italic; }
.one, .star { color: var(--accent); }
.star { font-style: normal; font-size: .8em; margin: 0 1px; }
.shop { font-size: 9.5px; font-weight: 700; letter-spacing: 2.5px; color: var(--muted); }

/* ---------- нижняя панель вкладок ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(13, 15, 19, .97); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tab {
  position: relative; border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1px; white-space: nowrap; transition: color .15s;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.tab:active svg { transform: scale(.88); }
.tab.active { color: var(--accent); }
.tab.active::before {
  content: ""; position: absolute; top: -1px; left: 50%; width: 28px; height: 3px; margin-left: -14px;
  border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.tab.active svg { filter: drop-shadow(0 0 6px #ffb40066); }

.test-banner { background: #3a2e00; color: #ffd866; text-align: center; font-size: 11.5px; padding: 4px 12px; }

.screen { padding: 0 12px; max-width: 520px; margin: 0 auto; }

.hero { display: flex; align-items: center; gap: 10px; padding: 12px 2px 4px; }
.hero img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 0 0 1px #ffb40044; }
.hero h1 {
  margin: 0; font-size: 18px; font-weight: 900; line-height: 1.15;
  background: linear-gradient(90deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 10px; }
.label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.label.sub { margin: 10px 0 6px; font-weight: 600; font-size: 12.5px; }

/* ---------- ввод ID ---------- */
.input-wrap { display: flex; gap: 6px; }
input {
  width: 100%; background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 15px; letter-spacing: .3px; outline: none; transition: border-color .15s;
}
input:focus { border-color: var(--accent); }
input.ok { border-color: var(--ok); }
input.bad { border-color: var(--err); }
.ghost { border: 1.5px solid var(--line); background: none; border-radius: 10px; padding: 0 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.player-status { min-height: 16px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.player-status.ok { color: var(--ok); }
.player-status.bad { color: var(--err); }
.hint { margin-top: 4px; color: var(--muted); font-size: 12px; }
.hint summary { cursor: pointer; color: var(--accent); list-style: none; }
.hint summary::-webkit-details-marker { display: none; }
.hint[open] summary { margin-bottom: 4px; }

/* ---------- пакеты ---------- */
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--card-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 4px 8px;
  transition: transform .1s, border-color .15s, background .15s;
}
.pack:active { transform: scale(.97); }
.pack.active { border-color: var(--accent); background: linear-gradient(170deg, #2b2410, var(--card-2) 70%); }
.pack-img { width: 100%; height: 58px; object-fit: contain; filter: drop-shadow(0 4px 8px #0008); }
.pack-uc { margin-top: 4px; font-size: 15px; font-weight: 900; line-height: 1.1; }
.pack-bonus { margin-top: 2px; font-size: 10px; color: var(--accent); min-height: 13px; }
.pack-price { margin-top: 4px; font-size: 13px; font-weight: 700; background: #ffffff0d; border-radius: 7px; padding: 2px 8px; }
.pack.active .pack-price { background: var(--accent); color: #1a1100; }
.badge { position: absolute; top: -7px; right: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); color: #1a1100; font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 5px; }
.skeleton { height: 124px; border-radius: 12px; background: linear-gradient(90deg, var(--card-2), #262b36, var(--card-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- оплата ---------- */
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.method { text-align: left; background: var(--card-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.method small { color: var(--muted); font-size: 11px; }
.method.active { border-color: var(--accent); }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.trust div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 4px; text-align: center; font-size: 14px; }
.trust span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.2; }

.foot { text-align: center; color: var(--muted); font-size: 11px; margin: 14px 0 6px; line-height: 1.7; }

/* ---------- нижняя панель ---------- */
.paybar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 6;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(13, 15, 19, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
/* на экране магазина снизу две панели: оплата + вкладки */
#shop { padding-bottom: 64px; }
.paybar-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.paybar-info span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paybar-info b { font-size: 16px; }
.primary {
  border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 800; font-size: 14px; color: #1a1100;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); min-width: 132px;
}
.primary:disabled { opacity: .4; }
.secondary { border: 1.5px solid var(--line); background: none; border-radius: 11px; padding: 10px; font-weight: 600; font-size: 13.5px; }
.btn-link { display: inline-block; text-decoration: none; text-align: center; }

/* ---------- статус ---------- */
.status-card { text-align: center; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.status-card .primary, .status-card .secondary { width: 100%; }
.st-icon { font-size: 38px; }
.status-card h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); margin: 0; font-size: 13px; }
.steps { list-style: none; display: flex; justify-content: space-between; padding: 0; margin: 8px 0; counter-reset: s; }
.steps li { flex: 1; font-size: 11px; color: var(--muted); position: relative; padding-top: 28px; }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1.5px solid var(--line); font-weight: 700; font-size: 11px;
}
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #04210f; }
.steps li.now::before { border-color: var(--accent); color: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px #ffb40022; } }
.details { background: var(--card-2); border-radius: 10px; padding: 9px 11px; text-align: left; font-size: 12.5px; line-height: 1.75; }
.details b { float: right; font-weight: 600; }

/* ---------- заказы ---------- */
.orders { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.order { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; }
.order-img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.order-main { flex: 1; min-width: 0; }
.order-main b { display: block; font-size: 14px; }
.order-main small { color: var(--muted); font-size: 11px; }
.order-side { text-align: right; white-space: nowrap; font-size: 13px; }
.pill { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 5px; margin-top: 3px; background: var(--card-2); color: var(--muted); }
.pill.completed { background: #2fd27a22; color: var(--ok); }
.pill.failed { background: #ff5d5d22; color: var(--err); }
.pill.processing, .pill.paid, .pill.pending_payment { background: #ffb40022; color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 32px 0; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 72px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: #2a2f3a; color: var(--text); padding: 8px 14px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 24px); text-align: center; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 340px) {
  .packs { grid-template-columns: repeat(2, 1fr); }
  .primary { min-width: 112px; padding: 11px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .splash *, .splash { animation: none !important; transition: none !important; }
}

/* ---------- бонусы при оплате ---------- */
.perk { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--card-2); font-size: 12.5px; }
.perk.welcome { background: #2fd27a14; color: var(--ok); }
.perk.welcome span { flex: 1; color: var(--text); }
.bonus-toggle { cursor: pointer; }
.perk-text { flex: 1; display: flex; flex-direction: column; }
.perk-text small { color: var(--muted); font-size: 11px; }
.bonus-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 34px; height: 20px; border-radius: 20px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.bonus-toggle input:checked + .switch { background: var(--accent); }
.bonus-toggle input:checked + .switch::after { transform: translateX(14px); }
.paybar-info s { color: var(--muted); font-size: 12px; font-weight: 400; }

/* ---------- вкладка «Бонусы» ---------- */
.tiny { font-size: 11px; }
.bonus-hero { background: linear-gradient(150deg, #2b2410, var(--card) 70%); border-color: #ffb40044; }
.bal { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; }
.bal small { display: block; color: var(--muted); font-size: 11px; }
.bal b { font-size: 26px; font-weight: 900; color: var(--accent); }
.bal .pend { text-align: right; }
.bal .pend b { font-size: 16px; color: var(--text); }
.lvl-head { display: flex; align-items: center; gap: 10px; }
.lvl-emoji { font-size: 26px; }
.lvl-head b { display: block; font-size: 15px; }
.lvl-bar { height: 6px; border-radius: 6px; background: var(--card-2); margin: 10px 0 5px; overflow: hidden; }
.lvl-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .6s; }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.levels div { background: var(--card-2); border: 1.5px solid var(--line); border-radius: 9px; padding: 6px 2px; text-align: center; font-size: 10.5px; color: var(--muted); }
.levels div b { display: block; font-size: 13px; color: var(--text); }
.levels div.cur { border-color: var(--accent); color: var(--text); }
.ref-steps { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.ref-steps div { display: flex; gap: 8px; align-items: flex-start; }
.ref-steps b { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--accent); font-size: 11px; }
.ref-steps em { font-style: normal; color: var(--accent); font-weight: 700; }
.ref-link { margin-top: 10px; background: var(--bg); border: 1.5px dashed var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; overflow-wrap: anywhere; }
.ref-btns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 8px; }
.ref-btns .primary { min-width: 0; }
.ref-stats { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.ref-stats b { color: var(--text); }
.rules summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.rules ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }

html, body { overflow-x: hidden; }
.primary { white-space: nowrap; }

/* ---------- фон магазина ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(13, 15, 19, .35), rgba(13, 15, 19, .55)), url("img/bg.jpg") center / cover no-repeat, var(--bg);
}
html, body { background-color: transparent; }
html { background: var(--bg); }
.card, .trust div, .order { background-color: rgba(23, 26, 33, .9); }
.top { background: rgba(13, 15, 19, .85); }

/* ---------- вкладка «Больше UC» ---------- */
.more-hero { text-align: center; background: linear-gradient(160deg, #3a2a05, rgba(23, 26, 33, .92) 70%); border-color: #ffb40055; }
.more-hero-icon { font-size: 34px; filter: drop-shadow(0 0 10px #ffb40088); }
.more-hero h2 {
  margin: 4px 0 4px; font-size: 19px; font-weight: 900;
  background: linear-gradient(90deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.more-card p { margin: 8px 0 10px; font-size: 13px; line-height: 1.45; color: #d6d9df; }
.more-card em { font-style: normal; color: var(--accent); font-weight: 800; }
.more-head { display: flex; align-items: center; gap: 10px; }
.more-head b { display: block; font-size: 15px; }
.more-head small { font-size: 11.5px; }
.more-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; font-size: 20px; border-radius: 11px; background: #ffb4001a; border: 1px solid #ffb40044; }
.more-btn { width: 100%; }
.more-tip { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 4px 4px; }

/* ---------- согласие ---------- */
#consent { padding-bottom: 20px; }
.consent-card { text-align: center; margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.consent-card img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 0 0 1px #ffb40055, 0 6px 20px #ffb40022; }
.consent-card h2 { margin: 4px 0 0; font-size: 18px; }
.doc-links { width: 100%; display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.doc-links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; text-decoration: none; color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 13px; }
.doc-links a::after { content: "›"; flex: none; color: var(--accent); font-weight: 800; }
.consent-check { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 12px; line-height: 1.45; color: #cfd3da; cursor: pointer; margin: 4px 0; }
.consent-check input { position: absolute; opacity: 0; pointer-events: none; }
.consent-check .box { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--bg); display: grid; place-items: center; transition: .15s; }
.consent-check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.consent-check input:checked + .box::after { content: "✓"; color: #1a1100; font-weight: 900; font-size: 13px; }
.consent-card .primary { width: 100%; }

/* ---------- отзывы ---------- */
.reviews-card { margin-top: 10px; }
.reviews-card .ref-btns { margin-top: 10px; }
.ref-btns.single { grid-template-columns: 1fr; }
