/* «Камень ВПН» — демо-дизайн «Кинуть камень?»
   Идея: тёмная вода, гладкий камень, круги по воде. Свой фирменный тёмный стиль
   (как у больших VPN-приложений), не зависящий от темы Telegram. */
:root {
  --bg: #0b0f12;
  --bg2: #10161b;
  --card: #151c22;
  --card2: #1b242c;
  --line: rgba(255, 255, 255, 0.07);
  --text: #eef2f4;
  --muted: #8a979f;
  --water: #3fd0c2;
  --water2: #2a8fd6;
  --sand: #e9d6ad;
  --danger: #ff6b6b;
  --ok: #4fdc8a;
  --radius: 18px;
  --font-head: "Unbounded", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
body {
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(63, 208, 194, 0.16), transparent 60%),
    radial-gradient(80% 50% at 100% 30%, rgba(42, 143, 214, 0.10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
main { padding: 16px 16px 108px; max-width: 560px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; margin: 26px 0 12px; }
p { margin: 8px 0; }
a { color: var(--water); }
.muted { color: var(--muted); font-size: 13.5px; }
.center { text-align: center; padding: 48px 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }
.sp { height: 12px; }

/* ---------- карточки и кнопки ---------- */
.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
button {
  font: 600 15px var(--font);
  border: 0; border-radius: 14px; padding: 12px 16px; cursor: pointer;
  color: #062522; background: linear-gradient(135deg, var(--water), #7be7d9);
  transition: transform 0.08s ease, filter 0.2s;
}
button:active { transform: scale(0.97); }
button:disabled { filter: grayscale(1) brightness(0.7); cursor: default; }
button.full { width: 100%; padding: 15px; font-size: 16px; }
button.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
button.ghost { background: transparent; color: var(--water); padding: 8px 4px; }
button.danger { background: transparent; color: var(--danger); padding: 6px 8px; font-size: 13px; }
input, textarea {
  width: 100%; font: 15px var(--font); color: var(--text);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  outline: none;
}
input:focus { border-color: var(--water); }
textarea.key { font: 12px ui-monospace, Menlo, monospace; resize: none; color: var(--sand); }
code { font: 12px ui-monospace, Menlo, monospace; color: var(--sand); word-break: break-all; }
.badge {
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: rgba(79, 220, 138, 0.14); color: var(--ok); }
.badge.bad { background: rgba(255, 107, 107, 0.14); color: var(--danger); }
.badge.hot { background: linear-gradient(135deg, var(--sand), #f4b860); color: #2b1d05; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.pills button { padding: 8px 12px; font-size: 13px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.pills button.active { color: #062522; background: var(--water); }

/* ---------- герой: камень на воде ---------- */
.hero { position: relative; text-align: center; padding: 6px 0 4px; }
.slogan { font-family: var(--font-head); font-weight: 800; font-size: 30px; line-height: 1.1; margin: 4px 0 2px; }
.slogan em { font-style: normal; background: linear-gradient(90deg, var(--water), var(--sand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pond {
  position: relative; height: 230px; margin: 6px auto 0; max-width: 360px;
  display: grid; place-items: center; user-select: none;
}
.pond::after { /* «поверхность воды» */
  content: ""; position: absolute; left: 6%; right: 6%; bottom: 26px; height: 46px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(63, 208, 194, 0.20), transparent);
}
.stone {
  position: relative; z-index: 2; width: 150px; height: 112px; border: 0; padding: 0; background: none;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.55));
  animation: bob 4.5s ease-in-out infinite;
}
.stone svg { width: 100%; height: 100%; }
.stone.armed { cursor: pointer; }
.stone.armed::before { /* приглашающее свечение */
  content: ""; position: absolute; inset: -18px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(63, 208, 194, 0.35), transparent);
  animation: glow 2.2s ease-in-out infinite; z-index: -1;
}
.stone.fly { animation: fly 1.1s cubic-bezier(.3, .1, .4, 1) forwards; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes glow { 0%, 100% { opacity: .45; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes fly {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  45% { transform: translate(0, -150px) rotate(220deg) scale(.6); }
  100% { transform: translate(0, 40px) rotate(400deg) scale(.15); opacity: 0; }
}
.ripple {
  position: absolute; left: 50%; bottom: 40px; width: 40px; height: 14px; margin-left: -20px; z-index: 1;
  border: 2px solid var(--water); border-radius: 50%; opacity: 0; pointer-events: none;
}
.ripple.go { animation: ripple 1.8s ease-out forwards; }
@keyframes ripple { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(7); } }
.splash { position: absolute; left: 50%; bottom: 50px; width: 6px; height: 6px; border-radius: 50%; background: var(--water); z-index: 3; opacity: 0; }
.splash.go { animation: splash .9s ease-out forwards; }
@keyframes splash { 0% { opacity: 1; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
.distance { font-family: var(--font-head); font-weight: 800; font-size: 44px; color: var(--water); line-height: 1; }
.distance small { font-size: 18px; color: var(--muted); margin-left: 4px; }
.status-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(79, 220, 138, 0.15); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(79, 220, 138, 0.05); } }

/* серия бросков */
.streak { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; }
.streak i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.streak i.on { background: linear-gradient(135deg, var(--water), #7be7d9); color: #062522; border: 0; font-weight: 800; }
.streak i.gift { border: 1px dashed var(--sand); color: var(--sand); }

.board { list-style: none; padding: 0; margin: 0; counter-reset: b; }
.board li { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); counter-increment: b; }
.board li::before { content: counter(b); width: 22px; color: var(--muted); font-weight: 700; }
.board li span:first-of-type { flex: 1; }
.board li.me { color: var(--water); font-weight: 700; }
.board li:last-child { border: 0; }

/* статы */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles.two { grid-template-columns: repeat(2, 1fr); }
.tile { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; text-align: center; }
.tile b { display: block; font-family: var(--font-head); font-size: 22px; }
.tile span { font-size: 12px; color: var(--muted); }

/* тарифы */
.plan { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.plan.best { border: 1.5px solid var(--water); box-shadow: 0 0 0 4px rgba(63, 208, 194, 0.08); }
.plan .price { font-family: var(--font-head); font-size: 22px; font-weight: 800; text-align: right; }
.plan .per { font-size: 12px; color: var(--muted); text-align: right; }
.plan .badge.hot { position: absolute; top: -10px; left: 14px; }
.features { list-style: none; padding: 0; margin: 4px 0 0; }
.features li { padding: 6px 0 6px 28px; position: relative; }
.features li::before { content: ""; position: absolute; left: 0; top: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(63, 208, 194, 0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%233fd0c2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* экран тарифов: срок → уровень → способ оплаты */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 14px 0 16px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; }
.seg button { background: none; color: var(--muted); padding: 10px 8px; border-radius: 12px; display: flex; gap: 8px; justify-content: center; align-items: center; }
.seg button.active { color: #062522; background: linear-gradient(135deg, var(--water), #7be7d9); }
.seg-save { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: linear-gradient(135deg, var(--sand), #f4b860); color: #2b1d05; }
.tier { position: relative; cursor: pointer; padding-right: 16px; transition: border-color .2s, box-shadow .2s; margin-top: 14px; }
.tier.sel { border: 1.5px solid var(--water); box-shadow: 0 0 0 4px rgba(63, 208, 194, 0.08); }
.tier h3 { font-size: 19px; margin-bottom: 2px; }
.tier .price { font-family: var(--font-head); font-size: 21px; font-weight: 800; white-space: nowrap; }
.tier .per { font-size: 12px; color: var(--muted); }
.tier-badges { display: flex; gap: 6px; position: absolute; top: -11px; left: 14px; }
/* бейджи лежат на рамке карточки — фон непрозрачный, чтобы рамка не просвечивала сквозь текст */
.tier-badges .badge { background: #1f2930; border: 1px solid var(--line); }
.tier-badges .badge.hot { background: linear-gradient(135deg, var(--sand), #f4b860); border: 0; }
.tier-badges .badge.ok { background: #16302a; border: 1px solid rgba(79, 220, 138, 0.35); }
.tier-dev { margin-top: 10px; font-size: 13px; color: var(--sand); }
.tier .features { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.method { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; text-align: center;
  background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.method.active { border: 1.5px solid var(--water); background: rgba(63, 208, 194, 0.10); }
.method .m-ic { font-size: 22px; }
.method .m-hint { font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.25; }
.pay-sum { font-family: var(--font-head); font-size: 20px; color: var(--water); }
.stub { margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px;
  background: rgba(233, 214, 173, 0.08); border: 1px dashed rgba(233, 214, 173, 0.35); color: var(--sand); }

/* рефералка */
.gift-hero { text-align: center; padding: 22px 16px; background:
  radial-gradient(100% 120% at 50% 0%, rgba(233, 214, 173, 0.16), transparent 60%), linear-gradient(180deg, var(--card2), var(--card)); }
.gift-hero .big { font-family: var(--font-head); font-size: 40px; font-weight: 800; color: var(--sand); }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--bg2); border: 1px dashed rgba(63, 208, 194, .4); border-radius: 12px; padding: 10px 12px; }
.linkbox code { flex: 1; color: var(--text); font-size: 12.5px; }
.steps3 { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps3 li { counter-increment: s; position: relative; padding: 4px 0 12px 40px; }
.steps3 li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #062522; background: var(--water); }

/* устройства */
.device { display: flex; gap: 12px; align-items: flex-start; }
.device .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(63, 208, 194, .12); font-size: 20px; flex: none; }
.device .body { flex: 1; min-width: 0; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
details:last-child { border: 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
summary::after { content: "+"; color: var(--water); font-size: 20px; line-height: 1; }
details[open] summary::after { content: "–"; }
ol.steps { padding-left: 20px; } ol.steps li { margin: 6px 0; }

/* профиль */
.avatar { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font: 800 22px var(--font-head);
  color: #062522; background: linear-gradient(135deg, var(--water), var(--sand)); }
.menu-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.menu-item:last-child { border: 0; }
.menu-item::after { content: "›"; color: var(--muted); font-size: 22px; }

/* нижняя навигация */
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(540px, calc(100% - 20px)); display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(21, 28, 34, 0.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 22px; padding: 6px; z-index: 10;
}
.tabs button { background: none; color: var(--muted); padding: 7px 2px 5px; font-size: 11px; font-weight: 600; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tabs button svg { width: 22px; height: 22px; }
.tabs button.active { color: var(--water); background: rgba(63, 208, 194, 0.10); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 30;
  background: #f1f5f6; color: #0b0f12; padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); text-align: center; }
.devmark { text-align: center; color: var(--sand); font-size: 12px; }

/* онбординг */
.onb { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; padding: 28px 22px calc(24px + env(safe-area-inset-bottom)); }
.onb .slide { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; animation: in .4s ease; }
.onb .emoji { font-size: 76px; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .5)); }
.onb h1 { font-size: 28px; }
.onb .dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.onb .dots i { width: 7px; height: 7px; border-radius: 9px; background: var(--card2); transition: width .2s; }
.onb .dots i.on { width: 22px; background: var(--water); }
@keyframes in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-in { animation: in .35s ease; }

/* Главная: крупный счётчик оставшихся дней и сводка */
.days-big { font-family: var(--font-head); font-weight: 800; font-size: 64px; line-height: 1; color: var(--water); margin: 22px 0 6px; }
.days-big small { font-size: 18px; color: var(--muted); margin-left: 6px; font-weight: 600; }
.days-big.low { color: var(--sand); }
.days-big.off { color: var(--muted); }
.warn { margin-top: 10px; color: var(--sand); font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat strong { display: block; margin-top: 4px; font-size: 17px; }

/* ---------- админка ---------- */
.small { font-size: 12px; }
.adm-h { margin: 22px 0 10px; font-size: 18px; }
.adm-h3 { margin: 14px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 12px; border-radius: 999px; font-size: 13px; background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.chip.on { background: var(--water); color: #062522; border-color: transparent; font-weight: 700; }
.tiles.money b { font-size: 16px; }
.share { padding: 10px 14px; }
.share-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.share-row:last-child { border: 0; }
.share-bar { height: 6px; border-radius: 3px; background: var(--card2); margin-top: 6px; overflow: hidden; }
.share-bar i { display: block; height: 100%; border-radius: 3px; background: var(--water); }
.chart .bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin: 8px 0; }
.bar-hit { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: pointer; }
.bar-hit .bar { display: block; width: 100%; background: var(--water); border-radius: 4px 4px 0 0; }
.bar-hit .bar.zero { background: var(--line); }
.bar-hit:hover .bar { filter: brightness(1.2); }
.chart-tip { margin-top: 6px; font-size: 13px; color: var(--muted); }
.list { padding: 4px 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border: 0; }
.user-row { cursor: pointer; }
.kv { margin-top: 10px; }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-row button { flex: 1; min-width: 56px; }
button.danger-fill { background: var(--danger); color: #fff; }
textarea { width: 100%; box-sizing: border-box; }
