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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: #0b0719;
    color: #e6e0ff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Статичное звёздное небо */
.star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse at 20% 20%, 
            rgba(93, 74, 138, 0.1) 0%,
            transparent 40%),
        radial-gradient(ellipse at 80% 80%, 
            rgba(157, 138, 255, 0.1) 0%,
            transparent 40%),
        linear-gradient(to bottom, 
            #0b0719 0%,
            #050310 100%);
}

.star-field:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 30% 40%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 40% 50%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 50% 60%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 70% 80%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 80% 90%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 100% 100%;
}

/* Контейнер */
.container {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.content-wrapper {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Шапка */
.header {
    margin-bottom: 40px;
    width: 100%;
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, #f0e6ff, #9d8aff, #c8b6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(157, 138, 255, 0.3);
    margin-bottom: 5px;
}

.logo-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 4px;
    color: #b8a9ff;
    text-transform: uppercase;
}

/* Основной контент */
.main-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.title {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    line-height: 1.2;
}

.title .line {
    display: block;
    font-size: 2rem;
    background: linear-gradient(45deg, #f0e6ff, #c8b6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #b8a9ff;
    max-width: 400px;
    font-style: italic;
}

/* Кнопки */
.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 320px;
    margin-top: 20px;
}

.btn {
    width: 100%;
    padding: 18px 25px;
    border: none;
    border-radius: 50px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.btn-primary {
    background: linear-gradient(45deg, #5d4a8a, #9d8aff);
    color: #f0e6ff;
    box-shadow: 0 0 25px rgba(157, 138, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(157, 138, 255, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: #c8b6ff;
    border: 2px solid rgba(157, 138, 255, 0.4);
}

.btn-secondary:hover {
    background: rgba(157, 138, 255, 0.1);
    border-color: #9d8aff;
}

.btn i {
    font-size: 1.1rem;
}

/* Попап */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.popup.active {
    display: block;
}

.popup-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(5, 3, 16, 0.95);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: linear-gradient(135deg, 
        rgba(26, 15, 51, 0.95) 0%,
        rgba(11, 7, 25, 0.98) 100%);
    border-radius: 15px;
    border: 1px solid rgba(157, 138, 255, 0.3);
    box-shadow: 0 0 50px rgba(157, 138, 255, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: popupAppear 0.3s ease;
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.popup-header {
    padding: 20px;
    border-bottom: 1px solid rgba(157, 138, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-shrink: 0;
}

.popup-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #f0e6ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-close {
    background: rgba(157, 138, 255, 0.1);
    border: 1px solid rgba(157, 138, 255, 0.3);
    color: #c8b6ff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.popup-close:hover {
    background: rgba(157, 138, 255, 0.2);
    transform: rotate(90deg);
    color: #f0e6ff;
}

.popup-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Скрываем скроллбар */
.popup-body::-webkit-scrollbar {
    width: 5px;
}

.popup-body::-webkit-scrollbar-track {
    background: rgba(157, 138, 255, 0.1);
    border-radius: 10px;
}

.popup-body::-webkit-scrollbar-thumb {
    background: rgba(157, 138, 255, 0.3);
    border-radius: 10px;
}

.popup-section {
    margin-bottom: 25px;
}

.popup-section h3 {
    font-family: 'Cinzel', serif;
    color: #c8b6ff;
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-section p {
    color: #b8a9ff;
    line-height: 1.6;
    font-size: 1rem;
}

/* Шаги */
.steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: rgba(157, 138, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 3px solid #9d8aff;
}

.step-number {
    background: linear-gradient(45deg, #5d4a8a, #9d8aff);
    color: #f0e6ff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(157, 138, 255, 0.3);
}

.step-content h4 {
    color: #f0e6ff;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    margin-bottom: 5px;
}

.step-content p {
    font-size: 0.9rem;
    color: #b8a9ff;
    line-height: 1.5;
}

/* Футер попапа */
.popup-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(157, 138, 255, 0.2);
    text-align: center;
}

.sacred-text {
    color: #9d8aff;
    font-size: 0.85rem;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Адаптивность для Telegram Mini App */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2.5rem;
    }
    
    .title .line {
        font-size: 1.7rem;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .buttons-container {
        max-width: 280px;
    }
    
    .btn {
        padding: 16px 20px;
        font-size: 0.95rem;
    }
    
    .popup-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .popup-header h2 {
        font-size: 1.1rem;
    }
}

@media (max-height: 700px) {
    .header {
        margin-bottom: 25px;
    }
    
    .title .line {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .buttons-container {
        margin-top: 10px;
        gap: 12px;
    }
    
    .btn {
        padding: 14px 18px;
    }
}

/* Для очень маленьких экранов */
@media (max-height: 600px) {
    .logo {
        font-size: 2rem;
    }
    
    .logo-subtitle {
        font-size: 0.8rem;
        letter-spacing: 3px;
    }
    
    .title .line {
        font-size: 1.3rem;
    }
    
    .subtitle {
        display: none; /* Скрываем подзаголовок на очень маленьких экранах */
    }
    
    .buttons-container {
        margin-top: 5px;
    }
}

/* Ориентация телефона */
@media (orientation: landscape) and (max-height: 500px) {
    .content-wrapper {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        max-width: 90%;
        gap: 30px;
    }
    
    .header {
        margin-bottom: 0;
        flex: 1;
    }
    
    .main-content {
        align-items: flex-start;
        flex: 1;
        max-width: 300px;
    }
    
    .buttons-container {
        max-width: 100%;
    }
}

/* ... предыдущие стили остаются без изменений ... */

/* Стили для экранов */
.active-screen {
    display: flex !important;
}

.content-wrapper {
    display: none;
    width: 100%;
    max-width: 500px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Анимация загрузки */
.loading-container {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.crystal-ball {
    width: 150px;
    height: 150px;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

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

.crystal-inner {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(circle at 30% 30%, 
        rgba(157, 138, 255, 0.3), 
        rgba(93, 74, 138, 0.1) 70%);
    border-radius: 50%;
    border: 2px solid rgba(157, 138, 255, 0.4);
    overflow: hidden;
    box-shadow: 
        0 0 50px rgba(157, 138, 255, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.crystal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(157, 138, 255, 0.6);
    animation: pulse 2s ease-in-out infinite;
    transform: translate(-50%, -50%);
}

@keyframes pulse {
    0% { 
        width: 0; 
        height: 0; 
        opacity: 1; 
    }
    100% { 
        width: 150px; 
        height: 150px; 
        opacity: 0; 
    }
}

.crystal-sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    animation: sparkle 2s linear infinite;
}

.sparkle:nth-child(1) { top: 20%; left: 30%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 40%; left: 70%; animation-delay: 0.4s; }
.sparkle:nth-child(3) { top: 70%; left: 40%; animation-delay: 0.8s; }
.sparkle:nth-child(4) { top: 60%; left: 20%; animation-delay: 1.2s; }
.sparkle:nth-child(5) { top: 30%; left: 60%; animation-delay: 1.6s; }

@keyframes sparkle {
    0%, 100% { 
        opacity: 0; 
        transform: scale(0); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1); 
        box-shadow: 0 0 10px #fff;
    }
}

.crystal-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 20px rgba(157, 138, 255, 0.8);
}

.loading-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #f0e6ff;
    background: linear-gradient(45deg, #f0e6ff, #9d8aff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.loading-progress {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(157, 138, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid rgba(157, 138, 255, 0.2);
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #5d4a8a, #9d8aff);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.loading-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #b8a9ff;
}

.loading-message {
    font-style: italic;
}

.loading-percentage {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: #9d8aff;
}

.loading-subtitle {
    color: #b8a9ff;
    font-style: italic;
    font-size: 0.95rem;
    max-width: 300px;
}

/* Форма ввода данных */
.form-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    background: rgba(26, 15, 51, 0.5);
    border-radius: 15px;
    border: 1px solid rgba(157, 138, 255, 0.2);
    box-shadow: 0 0 30px rgba(157, 138, 255, 0.1);
}

.form-icon {
    font-size: 3rem;
    color: #9d8aff;
    margin-bottom: 15px;
}

.form-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #f0e6ff;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #f0e6ff, #9d8aff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.form-subtitle {
    color: #b8a9ff;
    margin-bottom: 25px;
    font-style: italic;
    font-size: 1rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    color: #c8b6ff;
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-label i {
    color: #9d8aff;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px;
    background: rgba(11, 7, 25, 0.8);
    border: 1px solid rgba(157, 138, 255, 0.3);
    border-radius: 8px;
    color: #f0e6ff;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #9d8aff;
    box-shadow: 0 0 15px rgba(157, 138, 255, 0.3);
}

.form-input::placeholder {
    color: rgba(184, 169, 255, 0.5);
}

.form-textarea {
    resize: none;
    min-height: 80px;
}

.form-hint {
    color: rgba(184, 169, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

.form-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(157, 138, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(157, 138, 255, 0.2);
    color: #b8a9ff;
    font-size: 0.9rem;
    margin: 10px 0;
}

.form-notice i {
    color: #9d8aff;
    flex-shrink: 0;
}

.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.form-buttons .btn {
    flex: 1;
}

.form-buttons .btn-secondary {
    flex: 0.5;
}

/* Адаптивность для формы */
@media (max-width: 480px) {
    .form-container {
        padding: 15px;
    }
    
    .form-title {
        font-size: 1.3rem;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .form-buttons .btn-secondary {
        flex: 1;
    }
}

@media (max-height: 700px) {
    .form-container {
        padding: 15px;
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Плавные переходы между экранами */
.content-wrapper {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(10px);
}

.content-wrapper.active-screen {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}   
