/* Основные стили для Проекта Наталья */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Оптимизация для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .mystical-button:hover {
        transform: none;
    }
    
    .tarot-card:hover {
        transform: none;
    }
    
    .settings-button:hover {
        transform: none;
    }
}

:root {
    --deep-purple: #1a0b2e;
    --dark-purple: #0d0519;
    --gold: #d4af37;
    --light-gold: #f4e4bc;
    --mystic-blue: #4a148c;
    --text-glow: rgba(212, 175, 55, 0.5);
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(135deg, var(--deep-purple) 0%, var(--dark-purple) 50%, #0a0414 100%);
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
    color: var(--light-gold);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Предотвращаем влияние анимаций на скролл на мобильных */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    body {
        /* Дополнительная защита от влияния анимаций на мобильных */
        position: relative;
        height: auto;
        min-height: 100vh;
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.app-container {
    position: relative;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Изолируем основной контент от анимаций */
    isolation: isolate;
}

@media (max-width: 768px) {
    .app-container {
        /* На мобильных предотвращаем влияние анимаций */
        position: relative;
        overflow: visible;
        contain: layout style;
    }
}

/* Фоновые эффекты */
.background-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: stars-drift 20s linear infinite;
    opacity: 0.6;
    z-index: 0;
}

/* Particles.js контейнер */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
    background: radial-gradient(ellipse at center, rgba(74, 20, 140, 0.1) 0%, transparent 70%);
}

.background-fog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(74, 20, 140, 0.3) 0%, transparent 70%);
    animation: fog-breathe 8s ease-in-out infinite;
    z-index: 0;
}

/* Основной контент */
.main-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fade-in 0.8s ease-in;
}

.section.active {
    display: block;
}

.section.hidden {
    display: none;
}

/* Сообщения Натальи */
.natalia-message {
    background: rgba(13, 5, 25, 0.7);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 0 20px var(--text-glow);
    backdrop-filter: blur(10px);
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    animation: message-appear 0.8s ease-out;
    overflow: hidden;
    min-height: fit-content;
}

.natalia-message p {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--light-gold);
    text-shadow: 0 0 10px var(--text-glow), 0 0 20px rgba(212, 175, 55, 0.3);
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    margin: 0;
    animation: text-glow-pulse 3s ease-in-out infinite;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes text-glow-pulse {
    0%, 100% {
        text-shadow: 0 0 10px var(--text-glow), 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% {
        text-shadow: 0 0 15px var(--text-glow), 0 0 30px rgba(212, 175, 55, 0.5);
    }
}

/* Поля ввода */
.input-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mystical-input,
.mystical-textarea {
    background: rgba(13, 5, 25, 0.8);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 15px 20px;
    color: var(--light-gold);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}

.mystical-textarea {
    resize: vertical;
    min-height: 120px;
}

.mystical-input:focus,
.mystical-textarea:focus {
    border-color: var(--light-gold);
    box-shadow: 0 0 15px var(--text-glow);
    transform: scale(1.02);
}

.mystical-input::placeholder,
.mystical-textarea::placeholder {
    color: rgba(212, 175, 55, 0.5);
}

/* Кнопки */
.mystical-button {
    background: linear-gradient(135deg, var(--gold) 0%, #b8941f 100%);
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    color: var(--deep-purple);
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* Минимальный размер для удобного нажатия */
}

.mystical-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    animation: button-glow 1.5s ease-in-out infinite;
    text-shadow: 0 0 15px var(--gold), 0 0 25px rgba(212, 175, 55, 0.5);
}

@keyframes button-glow {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    }
    50% {
        box-shadow: 0 6px 30px rgba(212, 175, 55, 0.8), 0 0 40px rgba(212, 175, 55, 0.4);
    }
}

.mystical-button:active {
    transform: translateY(0);
}

/* Загрузка */
.loading-container {
    text-align: center;
    padding: 50px 20px;
    position: relative;
}

.loading-text {
    font-size: 1.5rem;
    margin-top: 30px;
    color: var(--light-gold);
    text-shadow: 0 0 10px var(--text-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Анимированные карты во время загрузки */
.loading-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    position: relative;
    min-height: 400px;
    /* Изолируем от основного контента */
    contain: layout style paint;
    overflow: hidden;
    /* Предотвращаем влияние на высоту страницы */
    will-change: contents;
}

.loading-tarot-card {
    position: relative;
    width: 120px;
    aspect-ratio: 9/16;
    perspective: 1000px;
    flex-shrink: 0;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Изолируем анимацию от layout */
    contain: layout style paint;
    /* Предотвращаем влияние на высоту страницы */
    isolation: isolate;
}

.loading-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.loading-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--mystic-blue) 0%, var(--deep-purple) 100%);
    border: 3px solid var(--gold);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    animation: loading-card-pulse 2s ease-in-out infinite;
}

.loading-card-back .card-symbol {
    font-size: 3rem;
    color: var(--gold);
    text-shadow: 0 0 20px var(--text-glow);
    animation: symbol-rotate 3s linear infinite;
}

@keyframes loading-card-pulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 35px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.6);
        transform: scale(1.05);
    }
}

@keyframes symbol-rotate {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.8;
    }
}

@media (max-width: 768px) {
    .loading-cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        /* Уменьшаем размеры на мобильных */
        max-width: 100%;
        padding: 10px;
        min-height: 250px;
        /* Дополнительная изоляция на мобильных */
        position: relative;
        overflow: hidden;
        contain: strict;
    }
    
    .loading-tarot-card {
        /* Уменьшаем размер карт на мобильных */
        width: 80px;
        /* Убираем влияние на layout */
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) translateZ(0);
    }
    
    /* Специальные позиции для карт на мобильных */
    .loading-tarot-card:nth-child(1) {
        transform: translate(-50%, -50%) translate(-60px, -40px) translateZ(0);
    }
    
    .loading-tarot-card:nth-child(2) {
        transform: translate(-50%, -50%) translate(60px, -40px) translateZ(0);
    }
    
    .loading-tarot-card:nth-child(3) {
        transform: translate(-50%, -50%) translate(-60px, 40px) translateZ(0);
    }
    
    .loading-tarot-card:nth-child(4) {
        transform: translate(-50%, -50%) translate(60px, 40px) translateZ(0);
    }
    
    .loading-tarot-card:nth-child(5) {
        transform: translate(-50%, -50%) translate(-30px, -60px) translateZ(0);
    }
    
    .loading-tarot-card:nth-child(6) {
        transform: translate(-50%, -50%) translate(30px, -60px) translateZ(0);
    }
    
    .loading-tarot-card:nth-child(7) {
        transform: translate(-50%, -50%) translate(-30px, 60px) translateZ(0);
    }
    
    .loading-tarot-card:nth-child(8) {
        transform: translate(-50%, -50%) translate(30px, 60px) translateZ(0);
    }
}

/* Расклад */
.reading-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px auto;
    max-width: 600px;
    justify-items: center;
    align-items: start;
}

.tarot-card {
    position: relative;
    width: 100%;
    max-width: 280px;
    cursor: pointer;
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto 20px auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    z-index: 1;
    isolation: isolate;
}

.tarot-card .card-inner {
    aspect-ratio: 9/16;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.tarot-card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* При перевороте показываем лицевую сторону, скрываем рубашку */
.tarot-card.flipped .card-back {
    display: none;
}

.tarot-card.flipped .card-front {
    display: block;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.card-back {
    background: linear-gradient(135deg, var(--mystic-blue) 0%, var(--deep-purple) 100%);
    border: 3px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateY(0deg);
    z-index: 2;
}

.card-back::before {
    content: "✦";
    font-size: 4rem;
    color: var(--gold);
    text-shadow: 0 0 20px var(--text-glow);
    animation: card-glow 2s ease-in-out infinite;
}

.card-front {
    transform: rotateY(180deg);
    border: 3px solid var(--gold);
    background: linear-gradient(135deg, var(--mystic-blue) 0%, var(--deep-purple) 100%);
    z-index: 1;
    display: none; /* По умолчанию скрыта, показывается только при перевороте */
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(1); /* Убираем зеркальное отображение */
    display: block;
}

/* Информация о раскладе */
.reading-info {
    background: rgba(13, 5, 25, 0.8);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    font-size: 1rem;
    color: var(--light-gold);
    word-wrap: break-word;
}

/* Текст под картами */
.card-description {
    position: relative;
    margin-top: 10px;
    padding: 12px;
    background: rgba(13, 5, 25, 0.6);
    border: 1px solid var(--gold);
    border-radius: 8px;
    color: var(--light-gold);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
    word-wrap: break-word;
    font-style: italic;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tarot-card.flipped .card-description {
    opacity: 1;
    transform: translateY(0);
}

.card-meaning {
    position: relative;
    margin-top: 15px;
    padding: 15px;
    background: rgba(13, 5, 25, 0.7);
    border: 2px solid var(--gold);
    border-radius: 10px;
    color: var(--light-gold);
    font-size: 1rem;
    text-align: center;
    line-height: 1.6;
    word-wrap: break-word;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tarot-card.flipped .card-meaning {
    opacity: 1;
    transform: translateY(0);
}

.card-name {
    position: relative;
    margin-top: 10px;
    padding: 10px;
    background: rgba(13, 5, 25, 0.8);
    border: 2px solid var(--gold);
    border-radius: 8px;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 0 10px var(--text-glow);
    animation: card-name-glow 2s ease-in-out infinite;
}

@keyframes card-name-glow {
    0%, 100% {
        text-shadow: 0 0 10px var(--text-glow), 0 0 20px rgba(212, 175, 55, 0.3);
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    }
    50% {
        text-shadow: 0 0 15px var(--text-glow), 0 0 30px rgba(212, 175, 55, 0.5), 0 0 40px rgba(74, 20, 140, 0.3);
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    }
}

.tarot-card.flipped .card-name {
    opacity: 1;
    transform: translateY(0);
}

/* Магические эффекты для интерактивных элементов */
.magical-glow {
    animation: magical-pulse 2s ease-in-out infinite;
}

@keyframes magical-pulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--text-glow), 0 0 40px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 30px var(--text-glow), 0 0 60px rgba(212, 175, 55, 0.5), 0 0 80px rgba(212, 175, 55, 0.3);
    }
}

/* Улучшенные анимации карт */
.tarot-card.dealing {
    animation: card-deal 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes card-deal {
    0% {
        opacity: 0;
        transform: translateY(-100px) rotateY(180deg) scale(0.5);
    }
    50% {
        transform: translateY(20px) rotateY(90deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateY(0deg) scale(1);
    }
}

.tarot-card.magical-flip {
    animation: magical-card-flip 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes magical-card-flip {
    0% {
        transform: rotateY(0deg) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: rotateY(90deg) scale(1.1);
        filter: brightness(1.5) drop-shadow(0 0 20px var(--gold));
    }
    100% {
        transform: rotateY(180deg) scale(1);
        filter: brightness(1);
    }
}

/* Эффект свечения при появлении карт */
.tarot-card.revealing {
    position: relative;
}

.tarot-card.revealing::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    opacity: 0;
    animation: reveal-glow 1s ease-out;
    z-index: -1;
    border-radius: 20px;
}

@keyframes reveal-glow {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Адаптивность для мобильных устройств */

/* Планшеты и маленькие ноутбуки (769px - 1024px) */
@media (max-width: 1024px) {
    .main-content {
        max-width: 90%;
    }
    
    .cards-container {
        max-width: 100%;
        gap: 20px;
    }
    
    .modal-content {
        max-width: 90%;
        padding: 25px;
    }
}

/* Планшеты (481px - 768px) */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .main-content {
        max-width: 100%;
    }
    
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 10px;
    }
    
    .tarot-card {
        max-width: 100%;
    }
    
    .tarot-card .card-inner {
        max-width: 100%;
    }
    
    .natalia-message {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .natalia-message p {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .mystical-input,
    .mystical-textarea {
        font-size: 1rem;
        padding: 12px 15px;
    }
    
    .mystical-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .loading-cards-container {
        gap: 15px;
        padding: 15px;
    }
    
    .loading-tarot-card {
        width: 100px;
    }
    
    .settings-button {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        top: 15px;
        right: 15px;
    }
    
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .mode-selection {
        flex-direction: column;
        gap: 15px;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .share-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .share-button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }
    
    .main-content {
        max-width: 100%;
    }
    
    .section {
        padding: 10px;
    }
    
    .cards-container {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 10px;
        margin: 20px auto;
        display: grid !important;
        align-items: start;
        justify-items: center;
    }
    
    .tarot-card {
        max-width: 280px;
        width: 100%;
        margin-bottom: 0 !important;
        position: relative;
        z-index: auto;
    }
    
    .tarot-card .card-inner {
        max-width: 100%;
        width: 100%;
    }
    
    .natalia-message {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 10px;
    }
    
    .natalia-message p {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .input-container {
        margin-top: 20px;
        gap: 12px;
    }
    
    .mystical-input,
    .mystical-textarea {
        font-size: 0.95rem;
        padding: 12px 15px;
        border-radius: 8px;
    }
    
    .mystical-textarea {
        min-height: 100px;
    }
    
    .mystical-button {
        padding: 12px 20px;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .loading-container {
        padding: 30px 10px;
    }
    
    .loading-text {
        font-size: 1.2rem;
        margin-top: 20px;
    }
    
    .loading-cards-container {
        gap: 10px;
        padding: 10px;
        min-height: 300px;
    }
    
    .loading-tarot-card {
        width: 80px;
    }
    
    .settings-button {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
        top: 10px;
        right: 10px;
    }
    
    .modal-content {
        padding: 15px;
        max-width: 95%;
        border-radius: 15px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-subtitle {
        font-size: 1rem;
    }
    
    .mode-selection {
        gap: 12px;
    }
    
    .mode-btn {
        padding: 15px;
    }
    
    .mode-name {
        font-size: 1rem;
    }
    
    .mode-desc {
        font-size: 0.85rem;
    }
    
    .share-container {
        padding: 15px;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .share-button {
        width: 100%;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .reading-intro {
        font-size: 1.1rem;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .card-name {
        font-size: 1.1rem;
        margin-top: 10px;
    }
    
    .card-description {
        font-size: 0.9rem;
        margin-top: 8px;
    }
    
    .card-meaning-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .reading-conclusion {
        font-size: 1rem;
        padding: 15px;
        margin-top: 20px;
    }
    
    /* Уменьшаем эффекты для производительности на мобильных */
    #particles-js {
        opacity: 0.3;
    }
    
    .background-stars {
        opacity: 0.4;
    }
    
    .background-fog {
        opacity: 0.2;
    }
    
    #smoke-canvas {
        opacity: 0.5;
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .natalia-message p {
        font-size: 0.95rem;
    }
    
    .mystical-input,
    .mystical-textarea {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .mystical-button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .loading-tarot-card {
        width: 70px;
    }
    
    .card-name {
        font-size: 1rem;
    }
    
    .card-description {
        font-size: 0.85rem;
    }
    
    .card-meaning-text {
        font-size: 0.9rem;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .tarot-card {
        max-width: 200px;
    }
    
    .app-container {
        padding: 10px;
    }
    
    .natalia-message {
        padding: 15px;
    }
}

/* Кнопка настроек */
.settings-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(13, 5, 25, 0.8);
    border: 2px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(10px);
}

.settings-button:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.1);
    animation: settings-pulse 1s ease-in-out infinite;
}

@keyframes settings-pulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    }
    50% {
        box-shadow: 0 6px 30px rgba(212, 175, 55, 0.8), 0 0 40px rgba(212, 175, 55, 0.4);
    }
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: fade-in 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, var(--deep-purple) 0%, var(--dark-purple) 100%);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    transform: scale(1.2);
    color: var(--light-gold);
}

.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 10px;
    text-align: center;
}

.modal-subtitle {
    font-size: 1.1rem;
    color: var(--light-gold);
    margin-bottom: 25px;
    text-align: center;
    opacity: 0.9;
}

.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-btn {
    background: rgba(13, 5, 25, 0.6);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--light-gold);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    animation: mode-glow 2s ease-in-out infinite;
}

@keyframes mode-glow {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 5px 25px rgba(212, 175, 55, 0.5), 0 0 30px rgba(212, 175, 55, 0.3);
    }
}

.mode-btn.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--light-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.mode-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.mode-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold);
    font-weight: 600;
}

.mode-desc {
    font-size: 0.95rem;
    color: var(--light-gold);
    opacity: 0.8;
}

.current-mode {
    text-align: center;
    padding: 15px;
    background: rgba(13, 5, 25, 0.5);
    border-radius: 10px;
    border: 1px solid var(--gold);
    color: var(--light-gold);
    font-size: 1rem;
}

.current-mode strong {
    color: var(--gold);
    font-family: 'Cinzel', serif;
}

/* Дополнительные магические эффекты */
.mystical-input:hover,
.mystical-textarea:hover {
    border-color: var(--light-gold);
    transition: all 0.3s ease;
}

/* Эффект свечения для активных элементов */
.magical-active {
    animation: magical-pulse 2s ease-in-out infinite;
}

/* Плавное появление элементов */
.fade-in-up {
    animation: fade-in-up 0.6s ease-out forwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Кнопка шаринга */
.share-container {
    margin-top: 30px;
    text-align: center;
}

.share-button {
    position: relative;
    overflow: hidden;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.share-link {
    padding: 10px 20px;
    background: rgba(13, 5, 25, 0.8);
    border: 2px solid var(--gold);
    border-radius: 8px;
    color: var(--light-gold);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.share-link:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--light-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* Современные тренды дизайна */
.natalia-message {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid transparent;
    background: linear-gradient(rgba(13, 5, 25, 0.7), rgba(13, 5, 25, 0.7)) padding-box,
                linear-gradient(135deg, var(--gold), var(--mystic-blue)) border-box;
}

.mystical-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--gold) 0%, #b8941f 50%, var(--gold) 100%);
    background-size: 200% 200%;
    animation: gradient-shift-button 3s ease infinite;
}

@keyframes gradient-shift-button {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Glassmorphism эффект */
.modal-content {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    background: linear-gradient(135deg, 
        rgba(26, 11, 46, 0.9) 0%, 
        rgba(13, 5, 25, 0.95) 100%);
}

/* Утилиты */
.hidden {
    display: none !important;
}
