/* DvizuhaVPN mini — тёмный неон, большая кнопка, всё под палец. */

:root {
  --bg: #05070d;
  --card: rgba(18, 24, 40, 0.72);
  --card2: rgba(24, 31, 52, 0.66);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --muted: #8b95b5;
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --green: #34d399;
  --gold: #fbbf24;
  --red: #fb7185;
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
               Roboto, Inter, Arial, sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── фон ─────────────────────────────────────────────────────── */

.bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: #05070d; }

.blob {
  position: absolute;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite alternate;
}
.b1 { left: -25vw; top: -20vw; background: radial-gradient(circle, #6d4dff 0%, transparent 65%); }
.b2 { right: -30vw; top: 18vh; background: radial-gradient(circle, #0ea5e9 0%, transparent 65%); animation-delay: -6s; }
.b3 { left: 5vw; bottom: -35vw; background: radial-gradient(circle, #db2777 0%, transparent 65%); opacity: 0.28; animation-delay: -11s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}

.grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 72%);
}

/* ── каркас ──────────────────────────────────────────────────── */

.app {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
  animation: appear 0.5s ease both;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 8px 24px rgba(124,92,255,0.35);
  overflow: hidden;
  flex: 0 0 auto;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.who { flex: 1; min-width: 0; }
.hello { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }

.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  display: inline-block;
}

.level-badge {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(124,92,255,0.45);
  background: linear-gradient(135deg, rgba(124,92,255,0.25), rgba(34,211,238,0.12));
  color: #d9d4ff;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.2px;
  box-shadow: inset 0 0 18px rgba(124,92,255,0.18);
}

/* ── подписка ────────────────────────────────────────────────── */

.sub-card {
  position: relative;
  padding: 15px 16px 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(124,92,255,0.18), rgba(34,211,238,0.06) 55%, transparent),
    var(--card);
  border: 1px solid rgba(124,92,255,0.26);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
}
.sub-card::after {
  content: "";
  position: absolute; inset: -40% -30% auto auto;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(34,211,238,0.18), transparent 65%);
  pointer-events: none;
}

.sub-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sub-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #cfd6f5; font-weight: 650; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.expired { background: var(--red); box-shadow: 0 0 10px var(--red); }
.sub-hint { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sub-hint b { color: #cfc6ff; }

.timer {
  font-size: 38px;
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: 1px;
  margin: 9px 0 2px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 15%, #b9b0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(124,92,255,0.25);
}
.timer.expired { background: linear-gradient(180deg, #ffd6dd, #fb7185); -webkit-background-clip: text; background-clip: text; }

.sub-note { font-size: 12px; color: var(--muted); }
.sub-bar {
  height: 5px;
  margin-top: 11px;
  border-radius: 99px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.sub-bar > div {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  box-shadow: 0 0 12px rgba(34,211,238,0.65);
  transition: width 0.35s linear;
}
.sub-bar > div.low { background: linear-gradient(90deg, var(--gold), var(--red)); box-shadow: 0 0 12px rgba(251,113,133,0.6); }

/* ── тапалка ─────────────────────────────────────────────────── */

.tap-zone {
  position: relative;
  height: 268px;
  display: grid;
  place-items: center;
  margin: 2px 0 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.halo {
  position: absolute;
  width: 226px; height: 226px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,0.3), transparent 62%);
  filter: blur(10px);
  animation: breathe 3.4s ease-in-out infinite;
}
.halo.h2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(34,211,238,0.13), transparent 60%);
  animation-delay: -1.6s;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.75; }
  50% { transform: scale(1.08); opacity: 1; }
}

.tap-core {
  position: relative;
  width: 208px; height: 208px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,0.2), transparent 45%),
    linear-gradient(160deg, #7c5cff 0%, #4c2dd8 52%, #0e7490 100%);
  box-shadow:
    0 0 0 7px rgba(124,92,255,0.13),
    0 0 0 1px rgba(255,255,255,0.16) inset,
    0 22px 60px rgba(76,45,216,0.5),
    0 0 60px rgba(34,211,238,0.18);
  display: grid;
  place-items: center;
  transition: transform 0.06s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  overflow: hidden;
}
.tap-core img {
  width: 86px; height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
  pointer-events: none;
  transform: translateY(-7px);
}
.tap-text {
  position: absolute;
  bottom: 34px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.88);
  pointer-events: none;
}
.core-ring {
  position: absolute; inset: 11px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.22);
  pointer-events: none;
}
.tap-core:active,
.tap-core.pressed {
  transform: scale(0.945);
  box-shadow:
    0 0 0 10px rgba(124,92,255,0.18),
    0 0 0 1px rgba(255,255,255,0.2) inset,
    0 12px 40px rgba(76,45,216,0.55),
    0 0 90px rgba(34,211,238,0.35);
}

.ripple {
  position: absolute;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.55);
  pointer-events: none;
  animation: ripple 0.62s ease-out forwards;
}
@keyframes ripple {
  from { transform: scale(0.5); opacity: 0.9; }
  to   { transform: scale(9); opacity: 0; }
}

.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floater {
  position: absolute;
  left: 50%; top: 48%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 0 18px rgba(124,92,255,0.9), 0 2px 8px rgba(0,0,0,0.6);
  animation: floatUp 0.9s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes floatUp {
  from { opacity: 0; transform: translate(-50%, -20%) scale(0.7); }
  25%  { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }
  to   { opacity: 0; transform: translate(-50%, -190%) scale(0.95); }
}

/* ── статистика ──────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 0 0 14px;
}
.stat {
  padding: 11px 8px;
  border-radius: 15px;
  background: var(--card2);
  border: 1px solid var(--line);
  text-align: center;
}
.stat b { display: block; font-size: 18px; font-weight: 850; letter-spacing: 0.2px; }
.stat span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ── уровень ─────────────────────────────────────────────────── */

.level-card {
  padding: 14px 15px 12px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.level-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.level-title-wrap b { display: block; font-size: 14.5px; }
.level-title-wrap span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.level-frac { font-size: 11.5px; color: #cfc6ff; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.level-bar {
  height: 8px;
  margin: 12px 0 9px;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  overflow: hidden;
}
.level-bar > div {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--green));
  background-size: 200% 100%;
  box-shadow: 0 0 14px rgba(124,92,255,0.6);
  transition: width 0.35s ease;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
  to { background-position: 200% 0; }
}
.link-btn {
  width: 100%;
  padding: 8px 0 2px;
  background: none;
  border: 0;
  color: #a99cff;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.link-btn span { display: inline-block; transition: transform 0.2s; }
.link-btn:active span { transform: translateX(4px); }

/* ── серверы ─────────────────────────────────────────────────── */

.servers { margin-bottom: 18px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.sec-head h2 { margin: 0; font-size: 18px; letter-spacing: 0.2px; }
.tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.05); padding: 3px; border-radius: 999px; }
.tabs button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.tabs button.on {
  background: linear-gradient(135deg, rgba(124,92,255,0.9), rgba(34,211,238,0.6));
  color: #fff;
  box-shadow: 0 3px 12px rgba(124,92,255,0.35);
}

.server-list { display: grid; gap: 8px; }

.server {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 16px;
  background: var(--card2);
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.1s;
}
.server.unlocked { border-color: rgba(52,211,153,0.18); }
.server.unlocked:active { transform: scale(0.99); }
.server.locked { opacity: 0.62; }

.sflag {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 19px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  flex: 0 0 auto;
}
.sinfo { flex: 1; min-width: 0; }
.sinfo b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sinfo span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.sinfo span.ok { color: var(--green); }
.sinfo span.lock { color: #b8a9ff; }

.saction { flex: 0 0 auto; }
.saction button {
  border: 0;
  padding: 8px 11px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  color: #071018;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 4px 14px rgba(34,211,238,0.25);
}
.saction button.auto { background: linear-gradient(135deg, var(--gold), #fb7185); }
.saction button:active { transform: scale(0.96); }
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  color: #b8a9ff;
  background: rgba(124,92,255,0.12);
  border: 1px solid rgba(124,92,255,0.22);
  padding: 6px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

/* ── подвал ──────────────────────────────────────────────────── */

.foot { text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.foot a { color: #a99cff; text-decoration: none; font-weight: 700; }
.tiny { font-size: 10px; opacity: 0.65; }

/* ── сплэш ───────────────────────────────────────────────────── */

.splash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  background: #05070d;
  z-index: 50;
  padding: 24px;
  text-align: center;
}
.splash-logo img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 12px 30px rgba(124,92,255,0.5)); }
.spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--violet);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash-text { font-size: 13px; color: var(--muted); max-width: 300px; line-height: 1.5; }

/* ── тост ────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translate(-50%, -20px);
  max-width: min(92vw, 430px);
  padding: 10px 14px;
  border-radius: 13px;
  background: rgba(22, 28, 46, 0.96);
  border: 1px solid rgba(124,92,255,0.35);
  box-shadow: 0 14px 40px rgba(0,0,0,0.45);
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── модальное окно ──────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 18px calc(22px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #121a2e 0%, #0a0e1a 100%);
  border: 1px solid rgba(255,255,255,0.09);
  border-bottom: 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheetUp { from { transform: translateY(50px); opacity: 0.5; } to { transform: none; opacity: 1; } }

.modal-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal h3 { margin: 0 0 5px; font-size: 19px; padding-right: 34px; }
.modal .sub { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 14px; }
.modal .server-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(124,92,255,0.09);
  border: 1px solid rgba(124,92,255,0.22);
  margin-bottom: 14px;
}
.modal .server-hero .sflag { width: 44px; height: 44px; font-size: 22px; }
.modal .server-hero b { display: block; font-size: 14px; }
.modal .server-hero span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.copybox {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 11px;
}
.copybox code {
  flex: 1;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--line);
  color: #cfd6f5;
  font-size: 10.5px;
  line-height: 1.45;
  word-break: break-all;
  max-height: 96px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.copybox button {
  flex: 0 0 auto;
  border: 1px solid rgba(124,92,255,0.35);
  background: rgba(124,92,255,0.16);
  color: #d9d4ff;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
  padding: 0 12px;
  cursor: pointer;
}

.btn {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin-top: 9px;
}
.btn.primary {
  background: linear-gradient(135deg, var(--violet), #4f46e5 55%, #0e7490);
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(76,45,216,0.35);
}
.btn.ghost { background: transparent; }
.btn:active { transform: scale(0.985); }

.hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  margin: 11px 0 0;
}

.roadmap { display: grid; gap: 8px; margin-top: 4px; }
.rm-item {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 10px 11px;
  border-radius: 13px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
  opacity: 0.7;
}
.rm-item.reached { opacity: 1; border-color: rgba(52,211,153,0.18); }
.rm-item.current { border-color: rgba(124,92,255,0.45); background: rgba(124,92,255,0.1); }
.rm-num {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 900;
  background: rgba(124,92,255,0.14);
  color: #cfc6ff;
  flex: 0 0 auto;
}
.rm-item.reached .rm-num { background: rgba(52,211,153,0.15); color: var(--green); }
.rm-body b { display: block; font-size: 12.5px; }
.rm-body span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.rm-taps { margin-left: auto; font-size: 10.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }

/* ── адаптив ─────────────────────────────────────────────────── */

@media (max-height: 700px) {
  .tap-zone { height: 236px; }
  .tap-core { width: 184px; height: 184px; }
  .halo { width: 200px; height: 200px; }
  .timer { font-size: 34px; }
}
@media (max-width: 360px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .timer { font-size: 32px; }
  .tabs button { padding: 6px 7px; }
  .sub-hint { display: none; }
}
