/* Mini App — палитра и структура под логотип YOUR PRIVATE VPN (тёмно-синий + белый щит). */
:root {
  --bg: #0a1526;
  --bg2: #0d1b30;
  --card: #12203a;
  --card2: #182a49;
  --text: #eaf0ff;
  --muted: #8ea0bd;
  --accent: #4f7cff;
  --accent2: #7b93ff;
  --ok: #35d07f;
  --warn: #f5b544;
  --danger: #ff5c5c;
  --line: rgba(255, 255, 255, .08);
  --radius: 18px;
}

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

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

.app {
  max-width: 560px; margin: 0 auto;
  padding: 14px 14px calc(88px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ---------- шапка с логотипом ---------- */
.hdr { display: flex; align-items: center; gap: 11px; margin: 2px 2px 16px; }
.logo {
  width: 38px; height: 38px; flex: 0 0 auto;
  filter: drop-shadow(0 6px 16px rgba(79, 124, 255, .35));
}
.logo svg { width: 100%; height: 100%; display: block; }
.brand { min-width: 0; flex: 1; }
.brand b {
  display: block; font-size: 13.5px; font-weight: 750; letter-spacing: .06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand span { color: var(--muted); font-size: 12px; }
.burger {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  display: grid; place-items: center; cursor: pointer; font-size: 17px;
}
.burger:active { background: var(--card2); }

/* ---------- карточки ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.card h2 {
  margin: 0 0 12px; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #16305c 0%, #12203a 55%, #0f1b30 100%);
  border: 1px solid rgba(79, 124, 255, .25);
}
.hero:after {
  content: ""; position: absolute; right: -70px; top: -80px; width: 210px; height: 210px;
  background: radial-gradient(circle, rgba(79, 124, 255, .38), transparent 65%);
  pointer-events: none;
}
.hero .label { color: rgba(234, 240, 255, .72); font-size: 12.5px; letter-spacing: .04em; }
.hero .big {
  font-size: 36px; font-weight: 780; letter-spacing: -.03em; line-height: 1.1; margin-top: 2px;
}
.hero .meta { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 4px; }
.kv div { background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 9px 10px; }
.kv span { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; }
.kv b { font-size: 13.5px; font-weight: 650; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: rgba(53, 208, 127, .14); color: var(--ok); white-space: nowrap;
}
.badge.off { background: rgba(245, 181, 68, .14); color: var(--warn); }
.badge.danger { background: rgba(255, 92, 92, .14); color: var(--danger); }

.bar { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .09); margin-top: 14px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

/* ---------- кнопки ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; padding: 13px 16px;
  border-radius: 14px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  width: 100%; transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: rgba(255, 255, 255, .07); color: var(--text); }
.btn.small { padding: 9px 13px; font-size: 13px; width: auto; }
.btn.wide { margin-top: 14px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- быстрые действия ---------- */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.quick button {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 8px; color: var(--text); font: inherit; cursor: pointer;
  display: grid; gap: 7px; justify-items: center; font-size: 12px; font-weight: 650;
}
.quick button:active { background: var(--card2); }
.quick svg { width: 25px; height: 25px; }

/* ---------- списки ---------- */
.list { display: grid; gap: 2px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item .t { font-weight: 600; font-size: 14px; }
.item .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.item .right { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); font-size: 13.5px; padding: 6px 0; }

/* ---------- рефералка ---------- */
.balance { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.plan {
  background: var(--card2); border: 1px solid var(--line); border-radius: 15px;
  padding: 12px; cursor: pointer; text-align: left; color: var(--text); font: inherit;
}
.plan:disabled { opacity: .4; cursor: default; }
.plan .p { font-size: 16px; font-weight: 750; }
.plan .d { color: var(--muted); font-size: 12px; margin-top: 3px; }
.linkbox {
  display: flex; gap: 8px; align-items: center; background: var(--card2);
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; margin-top: 12px;
}
.linkbox input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: var(--muted);
  font: inherit; font-size: 12.5px; outline: none;
}

/* ---------- чат ---------- */
.chat { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px 2px 8px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 15px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.user { justify-self: end; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-bottom-right-radius: 5px; }
.msg.admin { justify-self: start; background: var(--card2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.bot { justify-self: start; background: rgba(79, 124, 255, .12); border: 1px solid rgba(79, 124, 255, .3); border-bottom-left-radius: 5px; }
.msg .who { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent2); margin-bottom: 3px; }
.msg .time { display: block; font-size: 10.5px; opacity: .6; margin-top: 4px; }
.composer { display: flex; gap: 8px; margin-top: 10px; }
.composer input {
  flex: 1; min-width: 0; background: var(--card2); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px 14px; color: var(--text); font: inherit; outline: none;
}
.composer input:focus { border-color: rgba(79, 124, 255, .55); }

/* ---------- навигация ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 2px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 21, 38, .88); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.nav button {
  flex: 1; max-width: 110px; background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 650;
  display: grid; gap: 3px; justify-items: center; padding: 6px 2px;
  border-radius: 12px; position: relative;
}
.nav button.on { color: var(--accent2); }
.nav svg { width: 22px; height: 22px; }
.nav .dot {
  position: absolute; top: 8px; right: 26%;
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
}

/* ---------- бургер-меню ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(4, 10, 20, .6); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 340px);
  background: var(--bg2); border-left: 1px solid var(--line); z-index: 41;
  transform: translateX(100%); transition: transform .24s ease;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 4px;
}
.sheet.on { transform: translateX(0); }
.sheet .head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet .head b { font-size: 13px; letter-spacing: .06em; }
.sheet a {
  display: flex; align-items: center; gap: 11px; padding: 13px 12px;
  border-radius: 13px; color: var(--text); text-decoration: none; font-size: 14.5px;
  cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; font-family: inherit;
}
.sheet a:active, .sheet a:hover { background: rgba(255, 255, 255, .06); }
.sheet a svg { width: 20px; height: 20px; flex: 0 0 20px; opacity: .85; }
.sheet .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.sheet .foot { margin-top: auto; color: var(--muted); font-size: 11.5px; text-align: center; }

/* ---------- приветствие ---------- */
.welcome {
  min-height: 78vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 6px;
}
.welcome .logo { width: 96px; height: 96px; margin-bottom: 10px; }
.welcome h1 { font-size: 24px; margin: 6px 0 8px; letter-spacing: -.02em; }
.welcome p { color: var(--muted); font-size: 14px; max-width: 320px; margin: 0 0 18px; }
.welcome .btn { max-width: 320px; }

/* ---------- прочее ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
  background: #1b2b4a; color: var(--text); border: 1px solid var(--line);
  padding: 11px 16px; border-radius: 13px; font-size: 13.5px; max-width: 88vw;
  opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 60; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 92, 92, .55); }

.skeleton { height: 96px; border-radius: var(--radius); background: var(--card); margin-bottom: 12px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.pill { align-self: center; display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .08); color: var(--muted); }
.pill.ok { background: rgba(53, 208, 127, .14); color: var(--ok); }
.mt8 { margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.big { font-size: 22px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }

.seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 650; padding: 9px; border-radius: 10px; cursor: pointer; }
.seg button.on { background: rgba(255, 255, 255, .08); color: var(--text); }

/* ---------- админка: табы и плитки ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 650;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.tabs button.on {
  background: rgba(79, 124, 255, .16); border-color: rgba(79, 124, 255, .5);
  color: var(--text);
}
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 13px;
}
.tile .big { font-size: 20px; margin: 2px 0; }
/* ---------- «67» от руки и огонь карандашом ---------- */
.draw67 {
  width: 150px; height: 78px;
  color: var(--accent2);
  margin: 4px 0 2px;
  overflow: visible;
  filter: drop-shadow(0 4px 18px rgba(79, 124, 255, .35));
}
.draw67 path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw67 1.15s cubic-bezier(.5, .1, .3, 1) forwards;
}
.draw67 .d7 {
  stroke-dasharray: 190;
  stroke-dashoffset: 190;
  animation-delay: 1s;
}
@keyframes draw67 { to { stroke-dashoffset: 0; } }

.flame {
  width: 15px; height: 19px;
  margin-right: 5px;
  vertical-align: -4px;
  animation: flicker 1.9s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  35% { transform: scale(1.07) rotate(-3deg); opacity: .88; }
  70% { transform: scale(.97) rotate(2deg); opacity: .95; }
}

.badge.paid {
  background: rgba(245, 166, 35, .14);
  color: #f5a623;
  border: 1px solid rgba(245, 166, 35, .35);
}
/* ---------- счётчик устройств ---------- */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper b { font-size: 18px; min-width: 26px; text-align: center; }
.stepper .btn.small { width: 36px; padding: 6px 0; }
