/* === БАЗОВЫЕ СТИЛИ === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary-color: #8b5cf6;
  --primary-dark: #7c3aed;
  --secondary-color: #ec4899;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --bg-dark: #0f0f0f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === ФОН С АНИМАЦИЕЙ === */
.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #1a1a2e 0%, #0f0f0f 50%, #000000 100%);
}

.particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.8) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% {
    transform: translateY(100vh) translateX(0) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(var(--drift)) scale(1);
    opacity: 0;
  }
}

.gradient-overlay {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  animation: gradient-shift 15s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* === КОНТЕЙНЕР === */
.container {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

/* === ХЕДЕР === */
.header {
  text-align: center;
  margin-bottom: 16px;
  animation: fadeInDown 0.8s ease-out;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.ghost-icon {
  width: 60px;
  height: 60px;
  color: var(--primary-color);
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.5));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

h1 {
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
  margin-top: 8px;
  line-height: 1.4;
}

/* === КАРТОЧКИ === */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  transition: var(--transition);
  animation: fadeInUp 0.8s ease-out backwards;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.subscriptions-card {
  animation-delay: 0.1s;
}

.support-card {
  animation-delay: 0.2s;
}

.partners-card {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.card-title .icon {
  width: 22px;
  height: 22px;
  color: var(--primary-color);
  stroke-width: 2.5;
  flex-shrink: 0;
}

/* === ПОДПИСКИ === */
.subscription-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.subscription-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  transition: var(--transition);
}

.subscription-item:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(0, 0, 0, 0.4);
}

.sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.sub-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.sub-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  white-space: nowrap;
}

.sub-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-direction: column;
}

.sub-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  transition: var(--transition);
  outline: none;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-input:focus {
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* === КНОПКИ === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  outline: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  min-height: 48px;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.btn-text {
  position: relative;
  z-index: 1;
}

.btn-copy {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  width: 100%;
}

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

.btn-copy.copied {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
  flex: 1;
  min-width: 0;
}

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

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

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.98);
}

.btn-full {
  width: 100%;
}

/* === ГРУППА КНОПОК === */
.button-group {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.support-text {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* === СОЦИАЛЬНЫЕ ССЫЛКИ === */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInUp 0.8s ease-out backwards;
  animation-delay: 0.4s;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  min-height: 52px;
  touch-action: manipulation;
}

.social-link:active {
  background: var(--bg-card-hover);
  border-color: var(--primary-color);
  transform: scale(0.98);
}

.social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* === МОБИЛЬНАЯ ОПТИМИЗАЦИЯ === */
@media (max-width: 640px) {
  .container {
    padding: 24px 16px;
    gap: 16px;
  }

  h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 14px;
  }

  .ghost-icon {
    width: 50px;
    height: 50px;
  }

  .card {
    padding: 18px;
  }

  .card-title {
    font-size: 17px;
    margin-bottom: 14px;
  }

  .subscription-item {
    padding: 12px;
  }

  .sub-input {
    font-size: 11px;
    padding: 10px 12px;
  }

  .btn {
    font-size: 13px;
    padding: 12px 18px;
  }

  .support-text {
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 20px 12px;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 13px;
  }

  .logo {
    gap: 12px;
  }

  .ghost-icon {
    width: 45px;
    height: 45px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .card-title {
    font-size: 16px;
    gap: 10px;
  }

  .sub-label {
    font-size: 12px;
  }

  .sub-status {
    font-size: 10px;
    padding: 2px 8px;
  }

  .sub-input {
    font-size: 10px;
    padding: 10px;
  }

  .btn {
    font-size: 13px;
    padding: 12px 16px;
  }

  .btn-icon {
    width: 16px;
    height: 16px;
  }

  .button-group {
    gap: 8px;
  }
}

/* === ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ НА МОБИЛЬНЫХ === */
@media (max-height: 600px) and (orientation: landscape) {
  .container {
    padding: 20px 16px;
    justify-content: flex-start;
  }

  .header {
    margin-bottom: 12px;
  }

  .ghost-icon {
    width: 40px;
    height: 40px;
  }

  h1 {
    font-size: 28px;
  }

  .card {
    padding: 16px;
  }
}

/* === ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

html {
  scroll-behavior: smooth;
}

/* Скроллбар */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}

/* Улучшение для iOS Safari */
@supports (-webkit-touch-callout: none) {
  .btn, .social-link {
    -webkit-tap-highlight-color: rgba(139, 92, 246, 0.2);
  }
  
  input {
    font-size: 16px !important;
  }
}
