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

:root {
  --primary: #6F4BA8;
  --primary-dark: #5E418F;
  --primary-light: #8B63C8;
  --accent: #B77DFF;
  --accent-light: #CFA5FF;
  --bg: #1A0F2E;
  --bg-surface: #231540;
  --card: #2D1B4E;
  --card-hover: #3A2460;
  --card-selected: #4A2E7A;
  --glass: rgba(111, 75, 168, 0.15);
  --glass-border: rgba(183, 125, 255, 0.2);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(183, 125, 255, 0.25);
  --shadow-selected: 0 0 30px rgba(183, 125, 255, 0.45);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-canvas::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111, 75, 168, 0.35) 0%, transparent 70%);
  top: -200px;
  left: -150px;
  animation: floatOrb 12s ease-in-out infinite;
}

.bg-canvas::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 125, 255, 0.2) 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
  animation: floatOrb 15s ease-in-out infinite reverse;
}

.bg-orb-mid {
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 65, 143, 0.3) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation: floatOrb 10s ease-in-out infinite 3s;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(183, 125, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(183, 125, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 120px;
  min-height: 100vh;
}

/* ── HEADER ── */
.app-header {
  padding: 24px 20px 0;
  animation: slideDown 0.6s var(--transition) both;
}

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

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(183, 125, 255, 0.4);
  flex-shrink: 0;
}

.header-title-block h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
  background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-title-block .stars-icon {
  font-size: 16px;
  margin-right: 4px;
}

.premium-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 5px 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.badge-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.official-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.official-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.official-info {
  flex: 1;
}

.official-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.official-handle {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 2px;
}

.verified-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 4px rgba(183, 125, 255, 0.6));
}

/* ── INFO CARD ── */
.info-card {
  margin: 20px 20px 0;
  background: linear-gradient(135deg, rgba(94, 65, 143, 0.6) 0%, rgba(45, 27, 78, 0.6) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  animation: slideUp 0.6s var(--transition) 0.15s both;
}

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

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.info-check {
  font-size: 15px;
  margin-top: 1px;
  flex-shrink: 0;
}

.info-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.info-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 14px 0;
}

.info-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── SECTION LABEL ── */
.section-label {
  padding: 20px 20px 12px;
  animation: slideUp 0.6s var(--transition) 0.25s both;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

/* ── STARS GRID ── */
.stars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 20px;
  animation: slideUp 0.6s var(--transition) 0.35s both;
}

.star-card {
  position: relative;
  background: linear-gradient(145deg, var(--card) 0%, rgba(35, 21, 64, 0.9) 100%);
  border: 1.5px solid rgba(183, 125, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
}

.star-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(183, 125, 255, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.star-card:hover {
  border-color: rgba(183, 125, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), 0 4px 20px rgba(183, 125, 255, 0.15);
  background: linear-gradient(145deg, var(--card-hover) 0%, rgba(45, 27, 78, 0.9) 100%);
}

.star-card:hover::before {
  opacity: 1;
}

.star-card:active {
  transform: scale(0.96) translateY(0);
}

.star-card.selected {
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--card-selected) 0%, rgba(58, 36, 96, 0.95) 100%);
  box-shadow: var(--shadow-selected), inset 0 0 20px rgba(183, 125, 255, 0.08);
  transform: scale(1.02);
  animation: cardSelect var(--transition-bounce);
}

.star-card.selected::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(183, 125, 255, 0.15) 0%, transparent 60%);
}

@keyframes cardSelect {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1.02); }
}

.card-shine {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s;
}

.star-card.selected .card-shine {
  opacity: 1;
  animation: shine 2.5s linear infinite;
}

@keyframes shine {
  from { background-position: -200% center; }
  to   { background-position: 200% center; }
}

.card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  transform: scale(0) rotate(-30deg);
  transition: opacity var(--transition), transform var(--transition-bounce);
  box-shadow: 0 2px 8px rgba(183, 125, 255, 0.5);
  z-index: 2;
}

.star-card.selected .card-check {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.card-star-icon {
  font-size: 22px;
  margin-bottom: 6px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(183, 125, 255, 0.4));
  transition: transform var(--transition-bounce);
}

.star-card:hover .card-star-icon,
.star-card.selected .card-star-icon {
  transform: scale(1.1) rotate(-5deg);
}

.card-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 6px;
}

.card-price {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-light);
  background: rgba(183, 125, 255, 0.12);
  border-radius: 6px;
  padding: 3px 7px;
  display: inline-block;
}

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(183, 125, 255, 0.3);
  transform: scale(0);
  animation: ripple-anim 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* ── BOTTOM STICKY ── */
.bottom-section {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 16px 20px 24px;
  background: linear-gradient(to top, rgba(26, 15, 46, 0.98) 70%, transparent 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.35s var(--transition), transform 0.35s var(--transition);
}

.bottom-section.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.selected-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.summary-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.summary-divider {
  font-size: 12px;
  color: var(--text-muted);
}

.cta-button {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  background-size: 200% 200%;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(111, 75, 168, 0.55), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform var(--transition), box-shadow var(--transition), background-position var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.cta-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

.cta-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(111, 75, 168, 0.7), 0 4px 16px rgba(0,0,0,0.3);
  background-position: right center;
}

.cta-button:not(:disabled):active {
  transform: scale(0.98) translateY(0);
  box-shadow: 0 4px 16px rgba(111, 75, 168, 0.5);
}

.cta-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.cta-button:not(:disabled):hover::before {
  transform: translateX(100%);
}

.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-icon { font-size: 18px; }
.btn-text { font-size: 16px; font-weight: 700; }

.btn-loader {
  display: none;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.cta-button.loading .btn-content { display: none; }
.cta-button.loading .btn-loader { display: block; }

/* ── SUCCESS TOAST ── */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(45, 27, 78, 0.95) 100%);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 999;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
  min-width: 280px;
  text-align: center;
  justify-content: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon { font-size: 20px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(183, 125, 255, 0.3);
  border-radius: 4px;
}

/* ── RESPONSIVE ── */
@media (max-width: 380px) {
  .card-amount { font-size: 18px; }
  .card-price  { font-size: 11px; }
  .stars-grid  { gap: 8px; }
}

@media (min-width: 481px) {
  body { background: #0D0820; }
  .app-wrapper {
    box-shadow: 0 0 80px rgba(111, 75, 168, 0.2);
    background: var(--bg);
  }
}
