/* ==========================================================================
   TELEGRAM MINI APP - LUXURY CYBER-FINTECH DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800&family=Space+Grotesk:wght@600;700;800&display=swap');

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f1424;
  --bg-card: rgba(18, 25, 42, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.09);
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.45);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.45);
  --accent-violet: #8b5cf6;
  --accent-indigo: #6366f1;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-brand: 'Space Grotesk', 'Outfit', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-main);
  padding: 1rem;
  min-height: 100vh;
  user-select: none;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Aurora Blobs in Mini App */
body::before {
  content: '';
  position: fixed;
  top: -15%;
  left: -20%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.35), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: 0%;
  right: -20%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.15) 60%, transparent 80%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.miniapp-container {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.2rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #8b5cf6 100%);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.power-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0 0.85rem;
  position: relative;
}

.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(18, 25, 42, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
  margin-bottom: 1.25rem;
}

.power-btn-wrap {
  position: relative;
  width: 156px;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.power-btn-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 180deg at 50% 50%, #10b981 0deg, #06b6d4 120deg, #8b5cf6 240deg, #10b981 360deg);
  filter: blur(6px);
  opacity: 0.8;
  animation: rotate-conic 8s linear infinite;
}

@keyframes rotate-conic {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.power-circle {
  position: relative;
  z-index: 2;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #18233a 0%, #0d121e 80%);
  border: 2px solid rgba(16, 185, 129, 0.75);
  box-shadow: 0 0 35px var(--accent-emerald-glow), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #34d399;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
}

.power-circle:active {
  transform: scale(0.95);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  padding: 1.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem;
  border-radius: 0.95rem;
  border: none;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4 0%, #6366f1 50%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.12);
}

/* Switch */
.switch-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch {
  position: relative;
  width: 50px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.switch.active {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.45);
}

.switch.active::after {
  transform: translateX(22px);
}

/* MiniApp Modals & Setup Guides */
.miniapp-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.miniapp-modal-overlay.active {
  display: flex;
}

.miniapp-modal-body {
  background: #0d121f;
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.miniapp-guide-tab {
  padding: 0.45rem 0.2rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.miniapp-guide-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 360px) {
  body {
    padding: 0.5rem;
  }
  .miniapp-container {
    gap: 0.75rem;
  }
}

