:root {
  --bg-main: #0B0E14;
  --bg-card: rgba(18, 22, 33, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #6366F1;
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-cyan: #06B6D4;
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --success: #10B981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Блокировка скролла фона при открытой модалке */
body.modal-open {
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
}
.glow-1 { top: -100px; left: -100px; background: #4F46E5; }
.glow-2 { top: 400px; right: -150px; background: #06B6D4; }

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 24px;
}

/* Header */
.header {
  padding: 20px 0;
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.logo-accent {
  color: var(--accent-cyan);
}
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--success);
}
.live-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
  padding: 30px 0 60px;
}
.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
}
.gradient-text {
  background: linear-gradient(135deg, #A5B4FC 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* Steam Card Form */
.steam-card {
  padding: 36px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.steam-icon-wrap {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #38bdf8;
  flex-shrink: 0;
}
.card-title {
  font-size: 20px;
  font-weight: 700;
}
.card-desc {
  color: var(--text-muted);
  font-size: 13px;
}

.input-group {
  margin-bottom: 18px;
}
.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.required { color: #F43F5E; }
.optional { color: var(--text-muted); font-size: 12px; font-weight: normal; }

.input-group input, textarea {
  width: 100%;
  background: rgba(11, 14, 20, 0.85);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 14px 16px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}
.input-group input:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.input-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.quick-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.quick-btn:hover, .quick-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.calc-summary {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.fee-text { color: #F59E0B; font-weight: 600; }
.calc-divider { height: 1px; background: var(--border-card); margin: 8px 0; }
.total-row { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 0; }
.total-text { font-size: 20px; color: var(--accent-cyan); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.2s, transform 0.2s;
  min-height: 52px;
}
.btn-primary:hover { opacity: 0.95; transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

/* Products Catalog Grid */
.products-section { padding: 40px 0 80px; }
.section-header { margin-bottom: 30px; }
.section-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.section-subtitle { color: var(--text-muted); font-size: 15px; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  min-height: 380px;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
}
.product-img-wrap {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  background: #1e2433;
  margin-bottom: 16px;
  overflow: hidden;
  flex-shrink: 0;
}
.product-img { width: 100%; height: 100%; object-fit: cover; }
.product-info { flex-grow: 1; display: flex; flex-direction: column; }
.product-info h3 { font-size: 18px; margin-bottom: 8px; line-height: 1.3; }

.product-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-card);
  margin-top: auto;
}
.product-price { font-size: 18px; font-weight: 800; color: var(--accent-cyan); }
.btn-buy-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-buy-card:hover { background: var(--accent); border-color: var(--accent); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 32px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-prod-img-wrap {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #1e2433;
}
.modal-prod-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.modal-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.modal-price { font-size: 24px; font-weight: 800; color: var(--accent-cyan); margin-bottom: 16px; }
.modal-desc-box {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
  white-space: pre-line;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
}

.waiting-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.modal-action-buttons { display: flex; flex-direction: column; gap: 10px; }

.result-card { text-align: center; }
.success-icon {
  width: 60px;
  height: 60px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
  font-size: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.result-message { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.result-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-card);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  word-break: break-all;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-label { font-size: 12px; color: var(--text-muted); }
.result-box code {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 15px;
  background: rgba(6, 182, 212, 0.08);
  padding: 8px;
  border-radius: 8px;
}
.btn-copy {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-copy:hover { background: var(--accent); }

.btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  color: #fff;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 48px;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.14); }

/* Footer */
.footer {
  border-top: 1px solid var(--border-card);
  padding: 50px 0 30px;
  background: rgba(8, 10, 15, 0.85);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
}
.footer-heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}
.footer-link:hover { color: var(--accent-cyan); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* =================================================== */
/* 📱 ИДЕАЛЬНАЯ МОБИЛЬНАЯ АДАПТАЦИЯ (iOS / Android)     */
/* =================================================== */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 10px 0 40px;
  }
  .hero-title {
    font-size: 32px;
  }
  .hero-subtitle {
    font-size: 15px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }
  .header {
    padding: 16px 0;
  }
  .logo {
    font-size: 20px;
  }
  .hero-title {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 12px;
  }
  .steam-card {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .card-header {
    margin-bottom: 18px;
    gap: 12px;
  }
  .steam-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .steam-icon-wrap svg {
    width: 24px;
    height: 24px;
  }
  .card-title {
    font-size: 18px;
  }
  .quick-amounts {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .quick-btn {
    padding: 12px 8px;
    font-size: 14px;
  }
  .input-group input {
    font-size: 16px; /* Защита от авто-зума на iPhone в Safari */
    padding: 12px 14px;
  }
  .products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .product-card {
    min-height: auto;
    padding: 16px;
    border-radius: 20px;
  }
  .product-img-wrap {
    height: 150px;
  }

  /* Мобильная шторка (Bottom Sheet) для модалок */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-card {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 34px;
    max-height: 85vh;
  }
  .modal-close {
    top: 14px;
    right: 16px;
  }
  .modal-prod-img-wrap {
    height: 160px;
    margin-bottom: 16px;
  }
  .modal-title {
    font-size: 20px;
  }
  .modal-price {
    font-size: 22px;
    margin-bottom: 12px;
  }
}