:root {
  --bg: #070a12;
  --bg-card: #111827;
  --bg-card-hover: #1a2236;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --text: #ffffff;
  --text-muted: #94a3b8;
  --border: rgba(99, 102, 241, 0.22);
  --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #db2777 100%);
  --gradient-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.18) 0%, rgba(124, 58, 237, 0.18) 55%, rgba(219, 39, 119, 0.14) 100%);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.12), transparent);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  min-height: 100vh;
}

.header {
  margin-bottom: 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-size: 1.85rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.9);
  color: var(--text-muted);
  white-space: nowrap;
}

.status-badge.telegram {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(37, 99, 235, 0.12);
}

.status-badge.browser {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.35);
  background: rgba(124, 58, 237, 0.12);
}

.tagline {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 8px;
  line-height: 1.45;
}

.banner {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}

.banner-loading {
  background: var(--gradient-soft);
  color: var(--text-muted);
}

.banner-demo {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.3);
  color: #ddd6fe;
}

.banner-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.banner-empty {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient);
}

.profile-main {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-level {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.profile-stat {
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.metric-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.metric-icon {
  font-size: 1.1rem;
}

.metric-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.quick-actions {
  margin-bottom: 22px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 14px;
  min-height: 72px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, border-color 0.15s;
  text-align: left;
  font-family: inherit;
}

.action-btn:active {
  transform: scale(0.97);
  background: var(--bg-card-hover);
}

.action-btn.loading {
  opacity: 0.65;
  pointer-events: none;
}

.action-btn .action-icon {
  font-size: 1.3rem;
}

.action-btn .action-label {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.sections-block {
  margin-bottom: 20px;
}

.sections-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color 0.2s;
}

.section-card.highlight {
  border-color: rgba(236, 72, 153, 0.35);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.08);
}

.section-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.section-card .card-cmd {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 6px 12px;
  border-radius: 8px;
}

.footer {
  margin-top: 8px;
  padding: 16px 4px;
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.footer .app-version {
  color: #c4b5fd;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 448px;
  margin: 0 auto;
  padding: 14px 18px;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: toast-in 0.25s ease;
}

.toast p {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 360px) {
  .logo {
    font-size: 1.5rem;
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }

  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
