/* Палитра снята с playerok.com */
:root {
  --bg: #14161a;
  --surface: #282933;
  --surface-2: #32333f;
  --line: rgba(255, 255, 255, .07);
  --text: #ebecf0;
  --muted: #a4a8b2;
  --accent: #3390ec;
  --green: #31c48d;
  --red: #f0505a;
  --star: #f7b32b;
  --pay-from: #fa7223;
  --pay-to: #ffb74c;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 14px calc(84px + env(safe-area-inset-bottom));
}

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 10px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg) 70%, transparent);
  z-index: 20;
}

.user { display: flex; align-items: center; gap: 10px; min-width: 0; }

.avatar {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #3390ec, #8e5cf0);
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
  object-fit: cover;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 72px; height: 72px; font-size: 26px; }

.user-text { min-width: 0; }
.user-name {
  font-weight: 650; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-sub { color: var(--muted); font-size: 12px; }

.balance {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 8px 8px 14px;
  border-radius: 100px;
  font: inherit; font-weight: 650;
  cursor: pointer;
  flex: none;
}
.balance-plus {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  font-size: 16px; line-height: 1;
  padding-bottom: 2px;
}
.balance:active { transform: scale(.97); }

/* ---------- search ---------- */

.search {
  position: relative;
  margin-bottom: 12px;
}
.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  padding: 12px 14px 12px 42px;
  outline: none;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); }
.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  fill: none; stroke: var(--muted); stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- brands ---------- */

.brands {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.brands::-webkit-scrollbar { display: none; }

.brand {
  flex: none;
  width: 74px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand-tile {
  width: 66px; height: 66px;
  border-radius: 16px;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  transition: transform .12s ease;
}
.brand:active .brand-tile { transform: scale(.93); }
.brand-tile .logo { fill: #fff; }

.brand-name {
  font-size: 11.5px; font-weight: 600;
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-kind { font-size: 10px; color: var(--muted); margin-top: -4px; }

.brand.soon .brand-tile { filter: grayscale(.85); opacity: .45; }
.brand.soon .brand-name { color: var(--muted); }

.brand.active .brand-tile {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- banner ---------- */

.banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #2b6df0 0%, #7a45e8 55%, #b13ce0 100%);
  padding: 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.banner-title { font-size: 21px; font-weight: 750; line-height: 1.15; }
.banner-sub { margin-top: 6px; font-size: 13px; opacity: .85; }
.banner-art {
  font-size: 92px;
  line-height: 1;
  color: rgba(255,255,255,.22);
  margin-right: -8px;
  flex: none;
}

/* ---------- sections ---------- */

.section { margin-bottom: 26px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 18px; font-weight: 700; }
.section-more {
  color: var(--accent); font-size: 14px; font-weight: 550;
  background: none; border: 0; font-family: inherit; cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- card ---------- */

.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .12s ease;
}
.card:active { transform: scale(.975); }

.card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 11px 9px;
}
.card-logo {
  width: 26px; height: 26px; flex: none;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
}
.card-brand { min-width: 0; line-height: 1.2; }
.card-brand b {
  display: block; font-size: 12.5px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-brand span { font-size: 11px; color: var(--muted); }

.card-art {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
  overflow: hidden;
}

.card-photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.card-wm {
  position: absolute;
  right: 8px; bottom: 6px;
  font-size: 9.5px; font-weight: 650;
  letter-spacing: .3px;
  color: rgba(255,255,255,.5);
}
.art-main {
  font-size: 30px; font-weight: 800; line-height: 1;
  letter-spacing: -.5px;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.art-sub {
  font-size: 12px; font-weight: 650;
  opacity: .9; margin-top: 5px;
  text-transform: uppercase; letter-spacing: .5px;
}

.card-tag {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(10,10,14,.78);
  color: #c9a3ff;
  font-size: 10.5px; font-weight: 650;
  padding: 4px 8px;
  border-radius: 100px;
  display: flex; align-items: center; gap: 3px;
}

.card-info { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 5px; flex: 1; }

.price-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.price { font-size: 16px; font-weight: 750; color: var(--green); }
.price.zero { color: var(--accent); }
.discount {
  background: rgba(240,80,90,.16);
  color: var(--red);
  font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
}
.price-old { color: var(--muted); font-size: 12px; text-decoration: line-through; }

.card-title {
  font-size: 13px; line-height: 1.3; font-weight: 550;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-rate { font-size: 11.5px; color: var(--muted); }
.card-rate b { color: var(--star); font-weight: 700; }

.card-foot {
  display: flex; align-items: center; gap: 4px;
  margin-top: auto;
  font-size: 11.5px; color: var(--muted);
}
.stars { color: var(--star); letter-spacing: -1px; }
.verified { color: var(--accent); }
.fresh { color: var(--green); font-weight: 600; }

/* ---------- sheet ---------- */

.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 40;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line);
  max-height: 92vh;
  overflow-y: auto;
  animation: rise .24s cubic-bezier(.2,.8,.3,1);
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
@keyframes rise { from { transform: translateY(100%) } }

.sheet-grip {
  width: 38px; height: 4px;
  background: var(--line);
  border-radius: 100px;
  margin: 10px auto 4px;
  position: sticky; top: 10px;
}

.sheet-body { padding: 8px 16px 0; }

.sheet-art {
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  display: grid; place-items: center; text-align: center;
  margin-bottom: 16px;
}
.sheet-art .art-main { font-size: 44px; }

.sheet-title { font-size: 20px; font-weight: 750; line-height: 1.25; }
.sheet-desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 8px; }

.sheet-price {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0;
}
.sheet-price .price { font-size: 26px; }

.rows {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 14px;
  font-size: 14px;
}
.row + .row { border-top: 1px solid var(--line); }
.row span { color: var(--muted); }
.row b { font-weight: 600; }
.row .link { color: var(--accent); }

.field { margin: 16px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  padding: 13px 14px;
  outline: none;
}
.field input:focus { border-color: var(--accent); }

/* ---------- buy panel ---------- */

.buypanel {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 24px;
  border: 0;
  background: var(--surface);
}

.bp-head {
  flex: 1 1 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
}
.bp-head b { font-size: 19px; font-weight: 750; line-height: 1.1; }
.bp-rate { font-size: 12.5px; color: rgba(255,255,255,.6); }

.bp-badge {
  display: inline-block;
  background: var(--star);
  color: #241a04;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 2px;
}

.bp-field {
  flex: 1 1 165px;
  min-width: 0;
  background: rgba(0,0,0,.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.bp-field > span { font-size: 11.5px; color: var(--muted); }
.bp-field input {
  width: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  padding: 0;
}
.bp-field input::placeholder { color: #555c69; font-weight: 550; }
.bp-field input::-webkit-outer-spin-button,
.bp-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bp-field input[type=number] { -moz-appearance: textfield; }
.bp-field:focus-within { border-color: rgba(255,255,255,.28); }

.bp-static { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.75); }

.bp-qty { display: flex; align-items: center; gap: 6px; }
.bp-qty i { font-style: normal; font-size: 15px; flex: none; }

.bp-pay {
  flex: 1 1 200px;
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  padding: 8px 20px;
  background: linear-gradient(to right, var(--pay-from), var(--pay-to));
  color: #fff;
  font: inherit; font-size: 18px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .12s ease;
}
.bp-pay:active { filter: brightness(.92); }
.bp-pay:disabled { opacity: .5; cursor: default; }

/* ---------- topup ---------- */

.pay {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: filter .12s ease;
}
.pay:active { filter: brightness(.92); }
.pay:disabled { opacity: .5; cursor: default; }

.topup-quick { display: flex; gap: 8px; margin: 16px 0 4px; }
.topup-quick button {
  flex: 1;
  padding: 12px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 15px; font-weight: 650;
  cursor: pointer;
}
.topup-quick button:active { background: var(--surface-2); }

/* ---------- payment ---------- */

.pay-head { padding: 6px 0 20px; text-align: center; }
.pay-title { font-size: 13px; color: var(--muted); }
.pay-sub { font-size: 17px; font-weight: 650; margin-top: 6px; }
.pay-amount { font-size: 34px; font-weight: 800; color: var(--green); margin-top: 10px; }

.pay-methods { display: flex; flex-direction: column; gap: 10px; }

.pay-method {
  display: flex; align-items: center; gap: 13px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pay-method:active { background: var(--surface-2); }
.pay-method.soon { opacity: .45; }
.pay-method:disabled { opacity: .4; cursor: default; }

.pm-logo {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.pm-logo svg { width: 24px; height: 24px; fill: #fff; }
.pm-text { min-width: 0; flex: 1; line-height: 1.3; }
.pm-text b { display: block; font-size: 15px; font-weight: 650; }
.pm-text span { font-size: 12.5px; color: var(--muted); }
.pm-chev { color: var(--muted); font-size: 22px; line-height: 1; }

.pay-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ---------- admin ---------- */

.admin-loading { text-align: center; padding: 60px 0; color: var(--muted); }

.admin-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin: 6px 0 8px;
}
.stat {
  background: var(--surface); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat b { font-size: 20px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); }

.admin-sec {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin: 22px 2px 10px;
}

.admin-edit { margin-bottom: 10px; }
.admin-edit > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.admin-edit-ctl { display: flex; gap: 8px; }
.admin-edit-ctl input {
  flex: 1; min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; color: var(--text); font: inherit; font-size: 16px;
  padding: 11px 13px; outline: none;
}
.admin-edit-ctl input:focus { border-color: var(--accent); }
.admin-save {
  flex: none; padding: 0 20px;
  border: 0; border-radius: 11px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer;
}
.admin-save:active { filter: brightness(.9); }

.admin-imgs { display: flex; flex-direction: column; gap: 10px; }
.admin-img {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: 14px; padding: 10px 12px;
}
.admin-img-preview {
  width: 56px; height: 42px; flex: none;
  border-radius: 9px; overflow: hidden;
  background: var(--surface-2);
  display: grid; place-items: center;
}
.admin-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.admin-img-preview span { font-size: 11px; color: var(--muted); }
.admin-img-main { flex: 1; min-width: 0; }
.admin-img-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.admin-img-btn {
  display: inline-block;
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.admin-list {
  background: var(--surface); border-radius: 14px; overflow: hidden;
}
.admin-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
}
.admin-item + .admin-item { border-top: 1px solid var(--line); }
.admin-item-main { flex: 1; min-width: 0; }
.admin-item-title {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-item-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.admin-item-sum { font-weight: 700; white-space: nowrap; }
.admin-item-sum.ok { color: var(--green); }
.admin-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- tabbar ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: #14161c;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  background: none; border: 0;
  color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 550;
  padding: 9px 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
}
.tab-icon { font-size: 20px; line-height: 1; filter: grayscale(1) opacity(.7); }
.tab.active { color: var(--accent); }
.tab.active .tab-icon { filter: none; }

/* ---------- empty / profile ---------- */

.empty { text-align: center; padding: 90px 20px; }
.empty-icon { font-size: 46px; margin-bottom: 14px; filter: grayscale(.4); }
.empty-title { font-size: 17px; font-weight: 650; }
.empty-sub { color: var(--muted); font-size: 14px; margin-top: 7px; line-height: 1.5; }

/* ---------- profile ---------- */

.wallet {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  margin: 6px 0 22px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.wallet:active { background: var(--surface-2); }
.wallet-icon { width: 30px; height: 30px; flex: none; fill: var(--accent); }
.wallet-sum { font-size: 22px; font-weight: 750; }
.wallet-chev { margin-left: auto; font-size: 26px; color: var(--muted); line-height: 1; }

.pf {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.avatar.xl { width: 84px; height: 84px; font-size: 30px; }

.pf-info { min-width: 0; }
.pf-name {
  font-size: 26px; font-weight: 800; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-rating {
  display: flex; align-items: center; gap: 7px;
  margin-top: 7px;
  font-size: 16px;
}
.pf-stars { color: var(--accent); letter-spacing: 1px; font-size: 15px; }
.pf-rating b { font-weight: 700; }
.pf-reviews { color: var(--accent); font-size: 15px; }
.pf-since { color: var(--muted); font-size: 14px; margin-top: 6px; }

.pf-tabs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.pf-row { display: flex; gap: 10px; flex-wrap: wrap; }

.pill {
  padding: 13px 26px;
  border: 0;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.pill.active { background: var(--accent); font-weight: 700; }
.pill:active { filter: brightness(.9); }

.pf-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
}
.pf-item + .pf-item { margin-top: 10px; }
.pf-item-main { min-width: 0; flex: 1; }
.pf-item-title { font-size: 14.5px; font-weight: 600; }
.pf-item-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.pf-item-sum { font-weight: 700; color: var(--green); white-space: nowrap; }
