/* =========================================
   БАЗОВЫЕ СТИЛИ И ПЕРЕМЕННЫЕ
   ========================================= */
:root {
    --bg-dark: #0d0d0d;
    --card-bg: #141416;
    --text-main: #ffffff;
    --text-muted: #9f9f9f;
    --accent-purple: #5243e6;
    --accent-orange: #f97316;
    --error-red: #ef4444;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Inter Tight", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
}

body { 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    overflow-x: hidden; 
    min-height: 100vh; 
}

/* =========================================
   ФОН И КАНВАСЫ
   ========================================= */
.bg-canvas { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: -2; pointer-events: none; 
    opacity: 0; /* Скрыто по умолчанию */
    transition: opacity 1s ease; /* Плавное появление */
}
.bg-canvas.show { opacity: 1; }

.fg-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }

.nebula-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
    background: 
      radial-gradient(ellipse at 20% 30%, rgba(82, 67, 230, 0.15) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 50%, rgba(82, 67, 230, 0.05) 0%, transparent 70%);
}

/* =========================================
   УПРАВЛЕНИЕ ЭКРАНАМИ (СЦЕНАМИ)
   ========================================= */
.stage {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.hidden { opacity: 0; pointer-events: none; z-index: -10; transform: scale(0.95); }
.active { opacity: 1; z-index: 10; transform: scale(1); }

.container { width: 100%; max-width: 28rem; padding: 1rem; margin: 0 auto; z-index: 10; padding-bottom: 120px; }

/* =========================================
   ГЕРОЙ-БЛОК (Заголовок и Ракета)
   ========================================= */
.hero-section { text-align: center; margin-bottom: 1.5rem; display: flex; flex-direction: column; align-items: center; }
.badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.375rem 0.75rem; border-radius: 9999px;
    background-color: rgba(82, 67, 230, 0.2); border: 1px solid rgba(82, 67, 230, 0.3);
    font-size: 0.875rem; color: #a5a5a5; margin-bottom: 1rem;
}
.icon-sparkle { color: var(--accent-purple); display: inline-block; vertical-align: text-bottom; }

.hero-rocket-wrapper { position: relative; margin-bottom: 1rem; animation: float 3s ease-in-out infinite; }
.hero-rocket-glow {
    position: absolute; inset: 0; border-radius: 50%; filter: blur(24px);
    background-color: rgba(82, 67, 230, 0.5); z-index: 0;
}
.hero-rocket-icon { position: relative; z-index: 2; width: 4rem; height: 4rem; margin: 0 auto; }
.hero-flame {
    position: absolute;
    bottom: -1.1rem; /* Приподняли к соплу */
    left: 32%;      /* Сдвинули влево к соплу */
    transform: translateX(-50%) rotate(45deg); /* Повернули по оси ракеты */
    width: 1.5rem; height: 2.5rem; border-radius: 0 0 50% 50%;
    transform-origin: top center;
    background: linear-gradient(to top, var(--accent-orange), #facc15, transparent);
    animation: pulseFlameHero 0.1s infinite alternate; z-index: 1;
}

/* Новая анимация для маленького пламени с учетом угла */
@keyframes pulseFlameHero { 
    from { transform: translateX(-50%) rotate(45deg) scaleY(0.8); } 
    to { transform: translateX(-50%) rotate(45deg) scaleY(1.2); } 
}

.main-title { font-size: 1.875rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.5rem; }
.text-gradient-purple {
    background: linear-gradient(to right, #a78bfa, #818cf8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-muted); font-size: 1rem; }
.subtitle span { color: white; font-weight: 600; }

/* =========================================
   ФОРМА И ЭФФЕКТ СТЕКЛА
   ========================================= */
.glass-card {
    background: rgba(26, 26, 28, 0.4);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 1.25rem; 
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 60px rgba(82, 67, 230, 0.05);
}

.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.375rem; }
.input-relative { position: relative; width: 100%; display: flex; align-items: center; }
.input-icon { 
    position: absolute; 
    left: 1rem; 
    top: 50%; 
    transform: translateY(-50%); 
    color: #7a7a7a; 
    pointer-events: none; 
}

.cosmic-input {
    width: 100%; background-color: var(--card-bg); border: 1px solid rgba(255, 255, 255, 0.1);
    color: white; border-radius: 0.75rem; 
    padding: 0.75rem 1rem; font-size: 0.875rem; outline: none;
    transition: all 0.3s ease;
}
.cosmic-input.pl-9 { padding-left: 2.75rem; }
.cosmic-input:focus {
    border-color: var(--accent-purple); background-color: rgba(82, 67, 230, 0.05);
    box-shadow: 0 0 15px rgba(82, 67, 230, 0.3);
}
.cosmic-input.error { border-color: var(--error-red); }

.error-msg { display: block; color: #f87171; font-size: 0.75rem; margin-top: 0.25rem; min-height: 1rem; }

/* Селектор страны */
.phone-row { display: flex; gap: 0.5rem; position: relative; width: 100%; }
.country-selector { position: relative; }
.country-btn { display: flex; align-items: center; gap: 0.25rem; min-width: 80px; justify-content: center; cursor: pointer; }
.dropdown-menu {
    position: absolute; top: 100%; left: 0; margin-top: 0.25rem; width: 12rem;
    background-color: var(--card-bg); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0.75rem;
    overflow: hidden; z-index: 50; box-shadow: 0 10px 25px rgba(0,0,0,0.8);
}
.dropdown-item {
    width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.75rem;
    background: none; border: none; color: white; cursor: pointer; text-align: left;
    transition: background-color 0.2s;
}
.dropdown-item:hover { background-color: rgba(255, 255, 255, 0.05); }
.dropdown-item .prefix { margin-left: auto; color: #7a7a7a; font-size: 0.75rem; }

/* Способы связи */
.contact-methods { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 0.5rem; 
    width: 100%;
}
.hidden-radio { display: none; }
.method-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.375rem;
    padding: 0.75rem 0.25rem; 
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0.75rem;
    background-color: transparent; cursor: pointer; transition: all 0.2s;
}
.method-btn span { font-size: 0.65rem; color: var(--text-muted); }
.method-btn svg { color: #7a7a7a; width: 18px; height: 18px; }
.method-btn:hover { border-color: rgba(255, 255, 255, 0.2); }
.method-btn.active { border-color: var(--accent-purple); background-color: rgba(82, 67, 230, 0.15); }
.method-btn.active span { color: white; }
.method-btn.active svg { color: var(--accent-purple); }

/* Кнопка отправки */
.cosmic-button {
    width: 100%; padding: 0.875rem; border-radius: 0.75rem; border: none; cursor: pointer;
    background: var(--accent-purple);
    color: white; font-weight: 500; font-size: 0.875rem;
    display: flex; justify-content: center; align-items: center; gap: 0.5rem; transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(82, 67, 230, 0.4);
}
.cosmic-button:hover { 
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(82, 67, 230, 0.6);
}
.cosmic-button:active { transform: scale(0.98); }
.cosmic-button:disabled { opacity: 0.7; cursor: not-allowed; transform: scale(1); }

.privacy-note { text-align: center; font-size: 0.625rem; color: rgba(255, 255, 255, 0.3); margin-top: 0.75rem; }

/* =========================================
   АНИМАЦИЯ ЗАПУСКА (ЭКРАН 2)
   ========================================= */
#rocket-flight { position: relative; z-index: 10; transition: transform 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
#rocket-container { position: relative; transition: transform 0.1s; }

.rocket-glow {
    position: absolute; width: 180px; height: 180px; left: -30px; top: -30px;
    background: radial-gradient(circle, rgba(82,67,230,0.8) 0%, rgba(249,115,22,0.5) 50%, transparent 100%);
    filter: blur(20px); border-radius: 50%; transition: all 0.15s; opacity: 0.8;
}
.rocket-icon { position: relative; z-index: 2; transform: rotate(-45deg);}
.flame {
    position: absolute; bottom: -40px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 100px; border-radius: 0 0 50% 50%; filter: blur(3px); transform-origin: top center;
    background: linear-gradient(to top, #f97316 0%, #fbbf24 30%, #06b6d4 60%, transparent 100%);
    animation: flickerFlame 0.1s infinite alternate;
}
.launch-text-wrapper { position: absolute; bottom: 15%; text-align: center; z-index: 20; width: 100%; }
.launch-title { font-size: 1.5rem; font-weight: bold; margin-bottom: 0.5rem; }
.launch-subtitle { color: var(--text-muted); font-size: 0.875rem; }

/* Эффекты состояний */
.state-ignite .rocket-glow { transform: scale(1.3); opacity: 1; }
.state-ignite #rocket-container { animation: shakeRocket 0.1s infinite; }
.warp-effect {
    position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(82, 67, 230, 0.4) 0%, transparent 50%);
    animation: warpPulse 1.5s forwards; z-index: 1;
}

/* =========================================
   МОДАЛКА ПРИЗА (ЭКРАН 3)
   ========================================= */
.prize-modal { position: relative; width: 100%; max-width: 26rem; margin: 0 auto; z-index: 10; }

.prize-glow {
    position: absolute; inset: 0; filter: blur(40px);
    background: linear-gradient(to right, rgba(82, 67, 230, 0.6), rgba(139, 92, 246, 0.6));
    border-radius: 2rem; z-index: -1; animation: pulseGlow 2s infinite alternate;
}

.prize-card {
    position: relative; overflow: hidden;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 1.5rem;
    padding: 2rem; text-align: center;
}

/* ФОНОВЫЕ ЗВЕЗДЫ ВНУТРИ КАРТОЧКИ */
.bg-star { position: absolute; color: rgba(82, 67, 230, 0.3); animation: spinSlow 20s linear infinite; pointer-events: none; }
.star-top-right { top: -1.5rem; right: -1.5rem; }
.bg-sparkle { position: absolute; color: rgba(139, 92, 246, 0.3); animation: spinSlowRev 15s linear infinite; pointer-events: none; }
.star-bottom-left { bottom: -1rem; left: -1rem; }

/* ЗЕЛЕНАЯ ГАЛОЧКА */
.success-icon {
    width: 4.5rem; height: 4.5rem; margin: 0 auto 1rem; border-radius: 50%;
    background: linear-gradient(to bottom right, #4ade80, #10b981);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.prize-title-main { font-size: 1.75rem; font-weight: bold; margin-bottom: 0.25rem; }
.prize-subtitle-main { color: #a5a5a5; margin-bottom: 1.5rem; font-size: 0.95rem; }

/* БЛОК С ПРИЗОМ */
.prize-box-container { position: relative; margin-bottom: 1.5rem; }
.prize-box-glow {
    position: absolute; inset: 0; filter: blur(20px); border-radius: 1rem;
    background: linear-gradient(to right, rgba(82, 67, 230, 0.4), rgba(139, 92, 246, 0.4)); z-index: -1;
}
.prize-box-inner {
    position: relative; background: linear-gradient(to bottom right, rgba(82, 67, 230, 0.3), rgba(139, 92, 246, 0.3));
    border: 1px solid rgba(82, 67, 230, 0.4); border-radius: 1rem; padding: 1.25rem; z-index: 1;
}
.prize-box-header { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.prize-box-header span { color: #a5a5a5; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.prize-name { font-size: 1.5rem; font-weight: bold; color: white; margin-bottom: 0.25rem; }
.prize-desc-text { color: rgba(255,255,255,0.8); font-size: 1rem; }

/* ТЕКСТЫ И КНОПКИ */
.manager-text { color: #a5a5a5; font-size: 0.8rem; line-height: 1.4; margin-bottom: 1.5rem; }
.social-prompt { margin-bottom: 1.5rem; }
.social-prompt p { font-size: 0.7rem; color: #7a7a7a; margin-bottom: 0.75rem; }
.social-buttons { display: flex; justify-content: center; gap: 0.75rem; }
.social-btn {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 0.75rem;
    font-size: 0.875rem; text-decoration: none; transition: background 0.3s;
}
.tg-btn { background: rgba(34, 158, 217, 0.2); border: 1px solid rgba(34, 158, 217, 0.3); color: white; }
.tg-btn:hover { background: rgba(34, 158, 217, 0.3); }
.max-btn { background: rgba(123, 104, 238, 0.2); border: 1px solid rgba(123, 104, 238, 0.3); color: white; }
.max-btn:hover { background: rgba(123, 104, 238, 0.3); }

.reset-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.5rem;
    padding: 0.6rem 1.5rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem; color: white; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: background 0.2s;
}
.reset-btn:hover { background: rgba(255, 255, 255, 0.1); }

@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes spinSlowRev { to { transform: rotate(-360deg); } }

/* =========================================
   KEYFRAMES (АНИМАЦИИ)
   ========================================= */
@keyframes float { 
    0%, 100% { transform: translateY(0px); } 
    50% { transform: translateY(-10px); } 
}
@keyframes pulseFlame { 
    0%, 100% { transform: translateX(-50%) scaleY(1); opacity: 0.8; } 
    50% { transform: translateX(-50%) scaleY(1.3); opacity: 1; } 
}
@keyframes flickerFlame { 
    from { transform: translateX(-50%) scaleY(0.8); } 
    to { transform: translateX(-50%) scaleY(1.2); } 
}
@keyframes shakeRocket { 
    0%, 100% { transform: translate(0, 0); } 
    25% { transform: translate(-2px, 2px); } 
    50% { transform: translate(2px, -2px); } 
    75% { transform: translate(-2px, 2px); } 
}
@keyframes warpPulse { 
    0% { transform: scale(1); opacity: 0.8; } 
    50% { transform: scale(4); opacity: 0.4; } 
    100% { transform: scale(6); opacity: 0; } 
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #5243e6; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6b5ce7; }
::selection { background: rgba(82, 67, 230, 0.4); color: white; }

.flex-1 { flex: 1; }