/* ===== TAROT CARDS — КОСМИЧЕСКИЙ МИСТИЧЕСКИЙ ДИЗАЙН ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --tarot-space: #050510;
    --tarot-nebula: #1a0a2e;
    --tarot-deep: #0d0d1a;
    --tarot-violet: #4a2c7a;
    --tarot-magenta: #8b3a8b;
    --tarot-cyan: #00d4ff;
    --tarot-gold: #e8c547;
    --tarot-gold-light: #f5e6a3;
    --tarot-silver: #c0c0e0;
    --tarot-glow-cyan: rgba(0, 212, 255, 0.6);
    --tarot-glow-magenta: rgba(139, 58, 139, 0.6);
    --tarot-glow-gold: rgba(232, 197, 71, 0.7);
}

/* Убираем границы и скроллбары на странице Таро */
body:has(.tarot-page-wrapper),
.container:has(.tarot-page-wrapper) {
    overflow-x: hidden;
}

.container:has(.tarot-page-wrapper) {
    border: none;
}

.tarot-page-wrapper {
    position: relative;
    min-height: calc(100vh - 120px);
    overflow-x: hidden;
    overflow-y: visible;
    border: none;
}

/* ===== КОСМИЧЕСКИЙ ФОН ===== */
.tarot-cosmic-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(74, 44, 122, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(139, 58, 139, 0.3) 0%, transparent 45%),
        radial-gradient(ellipse 50% 60% at 20% 70%, rgba(232, 197, 71, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, var(--tarot-nebula) 0%, var(--tarot-space) 100%);
    pointer-events: none;
}

.tarot-nebula-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.6;
    pointer-events: none;
    animation: tarot-nebula-drift 30s ease-in-out infinite;
}

@keyframes tarot-nebula-drift {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
}

/* Звёздный слой */
.tarot-stars-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.tarot-star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: tarot-star-twinkle 4s ease-in-out infinite;
}

.tarot-star.small { width: 2px; height: 2px; }
.tarot-star.medium { width: 3px; height: 3px; }
.tarot-star.large { width: 4px; height: 4px; box-shadow: 0 0 6px var(--tarot-gold-light); }

@keyframes tarot-star-twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Плавающие космические орбы */
.tarot-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.tarot-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    animation: tarot-orb-float 20s ease-in-out infinite;
}

.tarot-orb.orb-1 {
    width: 300px; height: 300px;
    background: var(--tarot-magenta);
    top: 10%; left: 5%;
    animation-delay: 0s;
}

.tarot-orb.orb-2 {
    width: 250px; height: 250px;
    background: var(--tarot-cyan);
    top: 60%; right: 10%;
    animation-delay: -7s;
}

.tarot-orb.orb-3 {
    width: 200px; height: 200px;
    background: var(--tarot-gold);
    bottom: 20%; left: 20%;
    animation-delay: -14s;
}

@keyframes tarot-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.1); }
    50% { transform: translate(-20px, 30px) scale(0.9); }
    75% { transform: translate(20px, 20px) scale(1.05); }
}

/* Луна */
.tarot-moon {
    position: fixed;
    top: 80px;
    right: 50px;
    width: 70px;
    height: 70px;
    z-index: 2;
    background: radial-gradient(circle at 35% 35%, var(--tarot-gold-light), var(--tarot-gold));
    border-radius: 50%;
    box-shadow: 
        0 0 40px var(--tarot-glow-gold),
        0 0 80px rgba(232, 197, 71, 0.3),
        inset -10px -10px 20px rgba(0,0,0,0.2);
    animation: tarot-moon-glow 5s ease-in-out infinite;
}

.tarot-moon::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 25%;
    height: 25%;
    background: rgba(5, 5, 16, 0.4);
    border-radius: 50%;
}

@keyframes tarot-moon-glow {
    0%, 100% { box-shadow: 0 0 40px var(--tarot-glow-gold), 0 0 80px rgba(232, 197, 71, 0.3); }
    50% { box-shadow: 0 0 60px var(--tarot-glow-gold), 0 0 120px rgba(232, 197, 71, 0.5); }
}

/* ===== КОНТЕЙНЕР (широкий и высокий, без скроллбаров внутри) ===== */
.tarot-page-container {
    position: relative;
    z-index: 10;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 2rem;
    min-height: calc(100vh - 120px);
    overflow-x: hidden;
}

/* ===== ЗАГОЛОВОК ===== */
.tarot-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem 2rem 2.5rem;
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.7), rgba(74, 44, 122, 0.3));
    border-radius: 20px;
    border: 1px solid rgba(232, 197, 71, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    animation: tarot-header-in 0.8s ease-out;
}

.tarot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(232, 197, 71, 0.04) 0%, transparent 50%);
    opacity: 0.30;
    animation: tarot-shimmer-rotate 15s linear infinite;
}

.tarot-header-constellation {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 280px;
    opacity: 0.7;
}

@keyframes tarot-header-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tarot-shimmer-rotate {
    to { transform: rotate(360deg); }
}

.tarot-header h1 {
    font-family: 'Farang', 'Cinzel', serif !important;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--tarot-gold);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px var(--tarot-glow-gold);
    position: relative;
}

.tarot-header p {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--tarot-silver);
    opacity: 0.9;
}

.tarot-pack-row {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.tarot-pack-row label {
    font-family: 'Cormorant Garamond', serif;
    color: var(--tarot-silver);
    font-size: 1rem;
}

.tarot-pack-row select {
    background: rgba(26, 10, 46, 0.8);
    border: 1px solid rgba(232, 197, 71, 0.3);
    color: var(--tarot-gold-light);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.tarot-pack-row select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--tarot-glow-cyan);
}

.tarot-pack-label {
    font-family: 'Cormorant Garamond', serif;
    color: var(--tarot-silver);
    font-size: 1rem;
}

.tarot-pack-label strong {
    color: var(--tarot-gold-light);
    font-weight: 600;
}

.tarot-pack-change-link {
    color: var(--tarot-cyan);
    font-size: 0.85rem;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.tarot-pack-change-link:hover {
    opacity: 1;
    color: var(--tarot-gold-light);
}

.tarot-pack-change-link i {
    font-size: 0.75rem;
}

/* ===== МЕНЮ РАСКЛАДОВ ===== */
.tarot-spread-menu {
    margin-bottom: 2rem;
    animation: tarot-fade-up 0.6s ease-out 0.2s both;
}

@keyframes tarot-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tarot-spread-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1rem 0;
    overflow: visible;
    animation: tarot-grid-in 0.5s ease-out;
}

@keyframes tarot-grid-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tarot-spread-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: linear-gradient(160deg, rgba(74, 44, 122, 0.4), rgba(26, 10, 46, 0.6));
    border: 2px solid rgba(232, 197, 71, 0.25);
    border-radius: 16px;
    color: var(--tarot-silver);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tarot-spread-card:hover {
    transform: scale(1.05) translateY(-6px);
    border-color: var(--tarot-gold);
    box-shadow: 0 12px 40px rgba(232, 197, 71, 0.25);
}

.tarot-spread-icon {
    font-size: 2rem;
    color: var(--tarot-gold);
    text-shadow: 0 0 15px var(--tarot-glow-gold);
    transition: transform 0.3s ease;
}

.tarot-spread-card:hover .tarot-spread-icon {
    transform: scale(1.2) rotate(10deg);
}

.tarot-spread-name {
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    font-size: 0.9rem;
}

.tarot-spread-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ===== ЗОНА РАСКЛАДА ===== */
.tarot-spread-zone {
    background: linear-gradient(160deg, rgba(26, 10, 46, 0.85), rgba(74, 44, 122, 0.3));
    border-radius: 24px;
    border: 1px solid rgba(232, 197, 71, 0.25);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    animation: tarot-fade-up 0.6s ease-out;
}

/* Название расклада — тот же шрифт и стиль, что «Карты Таро» в шапке */
.tarot-spread-title,
#spreadTitle.tarot-spread-title {
    font-family: 'Farang', 'Cinzel', serif !important;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--tarot-gold);
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 0 20px var(--tarot-glow-gold);
}

/* Поле количества карт — ТОЛЬКО для универсального расклада */
.tarot-spread-zone .tarot-universal-count {
    display: none !important;
}
.tarot-spread-zone[data-current-spread="universal"] .tarot-universal-count {
    display: flex !important;
}

.tarot-universal-count {
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tarot-universal-count label {
    font-family: 'Cormorant Garamond', serif;
    color: var(--tarot-silver);
}

.tarot-universal-count select {
    padding: 0.5rem 0.75rem;
    background: rgba(26, 10, 46, 0.8);
    border: 2px solid rgba(232, 197, 71, 0.5);
    border-radius: 8px;
    color: var(--tarot-gold);
    font-size: 1rem;
    cursor: pointer;
}

.tarot-table {
    position: relative;
    min-height: 280px;
    margin-bottom: 1.5rem;
}

.tarot-flying-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    perspective: 1200px;
}

/* Слоты позиций — размеры как у карточек гороскопа */
.tarot-positions-wrapper {
    margin-bottom: 1rem;
    min-height: 200px;
}

.tarot-spread-positions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
}

.tarot-position-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 50px;
}

.tarot-position-slot:only-child .tarot-position-label {
    display: none;
}

.tarot-position-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    color: var(--tarot-gold);
    text-align: center;
}

.tarot-position-card {
    width: clamp(80px, 12vw, 120px);
    height: clamp(110px, 18vw, 165px);
    min-height: 110px;
    background: linear-gradient(145deg, rgba(26, 10, 46, 0.9), rgba(74, 44, 122, 0.5));
    border: 2px solid rgba(232, 197, 71, 0.35);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    overflow: hidden;
}

.tarot-position-card:hover {
    border-color: rgba(232, 197, 71, 0.5);
    box-shadow: 0 0 20px rgba(232, 197, 71, 0.15);
}

.tarot-position-card.tarot-landing-ring-active {
    overflow: visible;
}

/* Колода — подсветка только по границам стопки */
.tarot-deck-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 0;
    padding: 0.5rem;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.tarot-deck-visual:hover .tarot-deck-stack {
    box-shadow: 0 0 0 2px rgba(232, 197, 71, 0.9), 0 0 12px rgba(232, 197, 71, 0.4);
    transform: scale(1.03);
}

.tarot-deck-visual .tarot-deck-stack {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.tarot-deck-visual.tarot-deck-drawing .tarot-deck-stack {
    animation: tarot-deck-shuffle 0.5s ease-in-out infinite, tarot-deck-pulse 0.6s ease-in-out infinite;
}

@keyframes tarot-deck-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(232, 197, 71, 0.5), 0 0 10px rgba(232, 197, 71, 0.3); }
    50% { box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.8), 0 0 20px var(--tarot-glow-gold); }
}

@keyframes tarot-deck-shuffle {
    0%, 100% { transform: rotate(-2deg) translateY(0); }
    50% { transform: rotate(3deg) translateY(-4px); }
}

.tarot-deck-stack {
    position: relative;
    width: 86px;
    height: 120px;
}

.tarot-deck-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--tarot-nebula), var(--tarot-violet));
    border: 2px solid rgba(232, 197, 71, 0.5);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.tarot-deck-card:nth-child(1) { transform: rotate(-4deg); top: 0; }
.tarot-deck-card:nth-child(2) { transform: rotate(-2deg); top: 3px; }
.tarot-deck-card:nth-child(3) { transform: rotate(0); top: 6px; }
.tarot-deck-card:nth-child(4) { transform: rotate(2deg); top: 9px; }
.tarot-deck-card:nth-child(5) { transform: rotate(4deg); top: 12px; }

.tarot-deck-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    color: var(--tarot-gold);
    text-shadow: 0 0 20px var(--tarot-glow-gold);
    z-index: 2;
}

.tarot-deck-label {
    margin-top: 0.75rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--tarot-gold);
}

/* Летающие карты */
.tarot-flying-card {
    position: absolute;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: left 0.9s cubic-bezier(0.22, 1, 0.36, 1), top 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s ease;
    z-index: 25;
    animation: tarot-fly-out 0.5s ease-out;
}

@keyframes tarot-fly-out {
    0% { transform: scale(0.85) rotateZ(-8deg); opacity: 0.9; }
    40% { transform: scale(0.98) rotateZ(2deg); opacity: 1; }
    100% { transform: scale(1) rotateZ(0deg); opacity: 1; }
}

/* Дуговой вылет: лёгкое 3D-покачивание во время полёта (применяется к .tarot-flying-card) */
@keyframes tarot-arc-fly {
    0% { transform: rotateX(5deg) rotateY(-10deg); }
    25% { transform: rotateX(-3deg) rotateY(8deg); }
    50% { transform: rotateX(6deg) rotateY(-5deg); }
    75% { transform: rotateX(-2deg) rotateY(6deg); }
    100% { transform: rotateX(0deg) rotateY(0deg); }
}

/* Вспышка при перевороте: золотой ореол */
@keyframes tarot-flip-burst {
    0% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0.8), 0 0 20px rgba(232, 197, 71, 0.4); filter: brightness(1); }
    30% { box-shadow: 0 0 0 15px rgba(232, 197, 71, 0.4), 0 0 40px var(--tarot-glow-gold); filter: brightness(1.15); }
    100% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0), 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(232, 197, 71, 0.25); filter: brightness(1); }
}

/* Кольцо золотого света при приземлении (для псевдоэлемента или .tarot-landing-ring) */
@keyframes tarot-landing-ring {
    0% { transform: scale(0.3); opacity: 1; box-shadow: 0 0 0 4px rgba(232, 197, 71, 0.9), 0 0 20px var(--tarot-glow-gold); }
    70% { opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; box-shadow: 0 0 0 8px rgba(232, 197, 71, 0.2), 0 0 40px rgba(232, 197, 71, 0.1); }
}

/* Искра: разлёт от центра */
@keyframes tarot-spark {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: var(--tarot-spark-offset, translate(0, -30px)) scale(0); opacity: 0; }
}

.tarot-flying-card .tarot-flying-card-back,
.tarot-flying-card .tarot-flying-card-front {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tarot-flying-card .tarot-flying-card-back {
    background: linear-gradient(145deg, var(--tarot-nebula), var(--tarot-violet));
    border: 2px solid var(--tarot-gold);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.tarot-flying-card .tarot-flying-card-front {
    background: linear-gradient(145deg, #faf5eb, #e8e0d5);
    color: var(--tarot-nebula);
    border: 2px solid var(--tarot-gold);
    transform: rotateY(180deg);
}

.tarot-card-img-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tarot-flying-card .tarot-flying-card-back .tarot-card-img-wrap {
    width: 100%;
    height: 100%;
}

.tarot-flying-card .tarot-flying-card-back .tarot-card-img,
.tarot-flying-card .tarot-flying-card-front .tarot-card-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Во время полёта — лёгкое 3D-покачивание по дуге (старт после fly-out 0.5s) */
.tarot-flying-card.tarot-flying-card-fly {
    animation: tarot-fly-out 0.5s ease-out, tarot-arc-fly 1.2s ease-in-out 0.5s infinite;
}

.tarot-flying-card-revealed {
    transform: perspective(1200px) rotateY(180deg) scale(1.02);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: none;
}

.tarot-flying-card-revealed .tarot-flying-card-back {
    box-shadow: none;
}

.tarot-flying-card-revealed .tarot-flying-card-front {
    transform: rotateY(0deg);
    animation: tarot-flip-burst 0.6s ease-out forwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(232, 197, 71, 0.25);
}

/* Кольцо при приземлении в слот */
.tarot-landing-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 60px;
    height: 60px;
    margin-left: -30px;
    margin-top: -30px;
    border-radius: 50%;
    pointer-events: none;
    animation: tarot-landing-ring 0.8s ease-out forwards;
    z-index: 5;
}

/* Частицы-искры при перевороте (создаются в JS) */
.tarot-spark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    margin-top: -3px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--tarot-gold-light), var(--tarot-gold));
    box-shadow: 0 0 8px var(--tarot-glow-gold);
    pointer-events: none;
    animation: tarot-spark 0.5s ease-out forwards;
    z-index: 30;
}

/* Результат карты в слоте — анимация парения, лёгкий полёт, свечение, текст */
.tarot-result-card-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.25rem;
    background: linear-gradient(145deg, rgba(250, 245, 235, 0.98), rgba(232, 224, 213, 0.98));
    border-radius: 8px;
    color: var(--tarot-nebula);
    animation: tarot-card-land 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               tarot-card-float-fly 6s ease-in-out infinite;
    will-change: transform;
}

/* Карты слегка «летают» — плавное покачивание и подъём */
@keyframes tarot-card-float-fly {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
    15% { transform: translateY(-8px) translateX(3px) rotate(1deg); }
    30% { transform: translateY(-4px) translateX(-4px) rotate(-0.8deg); }
    45% { transform: translateY(-10px) translateX(-1px) rotate(0.5deg); }
    60% { transform: translateY(-5px) translateX(4px) rotate(-0.5deg); }
    75% { transform: translateY(-9px) translateX(2px) rotate(0.7deg); }
}

/* Приземление: упругий bounce + лёгкое вдавливание (0.95 -> 1.05 -> 1) */
@keyframes tarot-card-land {
    0% { opacity: 0; transform: scale(0.6) translateY(30px) rotate(-5deg); }
    45% { opacity: 1; transform: scale(1.05) translateY(-8px) rotate(2deg); }
    70% { transform: scale(0.95) translateY(2px) rotate(-0.5deg); }
    85% { transform: scale(1.02) translateY(-2px) rotate(0.5deg); }
    100% { opacity: 1; transform: scale(1) translateY(0) rotate(0deg); }
}

.tarot-card-glow {
    animation: tarot-card-glow-pulse 2.5s ease-in-out infinite;
    box-shadow: 0 0 25px rgba(232, 197, 71, 0.4);
}

@keyframes tarot-card-glow-pulse {
    0%, 100% { box-shadow: 0 0 25px rgba(232, 197, 71, 0.4); }
    50% { box-shadow: 0 0 40px var(--tarot-glow-gold); }
}

/* Текст названия карты — пульсация, лёгкое мерцание, масштаб */
@keyframes tarot-name-glow {
    0%, 100% {
        opacity: 0.95;
        text-shadow: 0 0 4px rgba(232, 197, 71, 0.3);
        letter-spacing: 0.02em;
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 12px rgba(232, 197, 71, 0.6), 0 0 20px rgba(232, 197, 71, 0.3);
        letter-spacing: 0.04em;
    }
}

.tarot-result-card-item .tarot-card-img-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tarot-result-card-item .tarot-card-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.tarot-result-card-item .tarot-card-name {
    font-size: clamp(0.6rem, 1.2vw, 0.75rem);
    margin-top: 0.2rem;
    text-align: center;
    font-weight: 600;
    animation: tarot-name-glow 2.8s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.tarot-result-card-item:hover .tarot-card-name {
    text-shadow: 0 0 15px rgba(232, 197, 71, 0.7);
}

/* Клик по карте — приближение; карты кликабельны */
.tarot-card-zoomable {
    cursor: pointer;
}

.tarot-position-slot:nth-child(1) .tarot-result-card-item { animation-delay: 0s, 0s; }
.tarot-position-slot:nth-child(2) .tarot-result-card-item { animation-delay: 0s, 0.3s; }
.tarot-position-slot:nth-child(3) .tarot-result-card-item { animation-delay: 0s, 0.6s; }
.tarot-position-slot:nth-child(4) .tarot-result-card-item { animation-delay: 0s, 0.9s; }
.tarot-position-slot:nth-child(5) .tarot-result-card-item { animation-delay: 0s, 1.2s; }
.tarot-position-slot:nth-child(6) .tarot-result-card-item { animation-delay: 0s, 1.5s; }
.tarot-position-slot:nth-child(n+7) .tarot-result-card-item { animation-delay: 0s, 1.8s; }

/* Оверлей приближения карты: по центру экрана (fixed к viewport), клик по фону — закрыть */
.tarot-card-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tarot-card-zoom-overlay.tarot-zoom-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tarot-zoom-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 16, 0.88);
    backdrop-filter: blur(6px);
}

.tarot-zoom-card-inner {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(90vw, 400px);
    max-height: 85vh;
    padding: 1rem;
    background: linear-gradient(145deg, rgba(250, 245, 235, 0.98), rgba(232, 224, 213, 0.98));
    border-radius: 12px;
    box-shadow: 0 0 60px var(--tarot-glow-gold), 0 0 120px rgba(232, 197, 71, 0.3);
    cursor: default;
    animation: tarot-zoom-in 0.3s ease-out;
}

@keyframes tarot-zoom-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tarot-zoom-img-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(90vh - 3rem);
}

.tarot-zoom-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.tarot-zoom-name {
    margin-top: 0.75rem;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 600;
    color: var(--tarot-nebula);
    text-align: center;
    text-shadow: 0 0 12px rgba(232, 197, 71, 0.4);
}

/* Интерпретация */
.tarot-interpretation-inline {
    margin-bottom: 1.5rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(74, 44, 122, 0.4), rgba(26, 10, 46, 0.6));
    border-radius: 16px;
    border-left: 4px solid var(--tarot-gold);
    animation: tarot-interp-in 0.6s ease-out;
}

@keyframes tarot-interp-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.tarot-interpretation-text {
    color: var(--tarot-silver);
    line-height: 1.7;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-weight: 400;
    text-align: justify;
}
.tarot-interpretation-text p,
.tarot-interpretation-text li {
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-weight: 400;
    text-align: justify;
}

/* Markdown styling: **bold**, ***highlight***, *italic*, __accent__ — жёлтое/золотое как на основной */
.tarot-interpretation-text strong,
.tarot-interpretation-text .description-bold {
    color: rgba(255, 228, 100, 0.98);
    font-weight: 600;
}
.tarot-interpretation-text em,
.tarot-interpretation-text .description-italic {
    font-style: italic;
    color: rgba(232, 197, 71, 0.92);
}
.tarot-interpretation-text .description-highlight {
    font-size: 1.02em;
    font-weight: 600;
    color: rgba(255, 215, 0, 0.95);
    background: linear-gradient(180deg, transparent 70%, rgba(255, 215, 0, 0.12) 100%);
    padding: 0.02em 0.08em;
}
.tarot-interpretation-text .description-accent {
    color: rgba(255, 228, 128, 0.95);
    font-weight: 500;
    border-bottom: 1px solid rgba(232, 197, 71, 0.5);
    padding-bottom: 0.05em;
}
.tarot-interpretation-text .description-heading,
.tarot-interpretation-text h3.description-heading,
.tarot-interpretation-text h4.description-heading,
.tarot-interpretation-text h5.description-heading {
    display: block;
    position: relative;
    margin: 1.6em 0 0.65em 0;
    padding: 0.5em 0 0.5em 1.1em;
    font-size: 1.08em;
    font-weight: 600;
    font-family: 'Farang', 'Cinzel', serif !important;
    letter-spacing: 0.08em;
    color: var(--tarot-gold-light);
    text-shadow: 0 0 20px rgba(232, 197, 71, 0.3);
    border-left: 3px solid rgba(232, 197, 71, 0.6);
    background: linear-gradient(90deg, rgba(232, 197, 71, 0.08) 0%, transparent 70%);
}
.tarot-interpretation-text .description-heading::before,
.tarot-interpretation-text h3.description-heading::before,
.tarot-interpretation-text h4.description-heading::before,
.tarot-interpretation-text h5.description-heading::before {
    content: '✦';
    position: absolute;
    left: 0.15em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6em;
    color: rgba(232, 197, 71, 0.8);
    letter-spacing: 0;
}
.tarot-interpretation-text .description-heading:first-child,
.tarot-interpretation-text h3.description-heading:first-child,
.tarot-interpretation-text h4.description-heading:first-child,
.tarot-interpretation-text h5.description-heading:first-child {
    margin-top: 0.5em;
}
.tarot-interpretation-text .description-mini-heading {
    display: block;
    margin: 1.2em 0 0.4em 0;
    font-size: 1em;
    font-weight: 600;
    font-family: 'Farang', 'Cinzel', serif !important;
    color: var(--tarot-gold);
    padding-left: 0.5em;
    border-left: 2px solid rgba(232, 197, 71, 0.4);
}
.tarot-interpretation-text .description-list,
.tarot-interpretation-text ul,
.tarot-interpretation-text ol {
    margin: 0.5em 0 0.85em 0;
    padding-left: 1.4em;
}
.tarot-interpretation-text ul { list-style-type: disc; }
.tarot-interpretation-text ol { list-style-type: decimal; }
.tarot-interpretation-text li { margin-bottom: 0.35em; }

/* Tarot tokens: [КАРТА:...], [МАСТЬ:...], [ВАЖНО], [СОВЕТ], etc. */
.tarot-interpretation-text .tarot-token {
    display: inline;
    white-space: nowrap;
}
.tarot-interpretation-text .tarot-token-card {
    color: var(--tarot-gold-light);
    font-weight: 600;
    padding: 0 0.2em;
}
.tarot-interpretation-text .tarot-token-suit {
    color: var(--tarot-cyan);
    font-style: italic;
}
.tarot-interpretation-text .tarot-token-arcana {
    color: var(--tarot-magenta);
    font-weight: 500;
}
.tarot-interpretation-text .tarot-token-position {
    color: var(--tarot-gold);
    font-weight: 500;
}
.tarot-interpretation-text .tarot-token-heading,
.tarot-interpretation-text .tarot-token-heading .tarot-token-text,
.tarot-interpretation-text p .tarot-token-heading,
.tarot-interpretation-text p .tarot-token-heading .tarot-token-text {
    font-family: 'Farang', 'Cinzel', serif !important;
}
.tarot-interpretation-text .tarot-token-heading {
    display: block;
    font-size: 1.25em;
    font-weight: 600;
    color: var(--tarot-gold-light);
    margin: 1em 0 0.6em 0;
    padding-bottom: 0.3em;
    border-bottom: 1px solid rgba(232, 197, 71, 0.3);
}
.tarot-interpretation-text .tarot-token-answer {
    color: var(--tarot-gold);
    font-weight: 700;
    font-size: 1.1em;
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background: rgba(232, 197, 71, 0.15);
}
.tarot-interpretation-text .tarot-token-important {
    color: rgba(255, 200, 100, 0.95);
    font-weight: 600;
}
.tarot-interpretation-text .tarot-token-advice {
    color: var(--tarot-cyan);
    font-weight: 500;
}
.tarot-interpretation-text .tarot-token-warning {
    color: rgba(255, 180, 100, 0.95);
    font-weight: 500;
}
.tarot-interpretation-text .tarot-token-summary {
    color: var(--tarot-gold);
    font-weight: 600;
}
.tarot-interpretation-text .tarot-token-icon {
    margin-right: 0.15em;
}

/* Кнопки */
.tarot-deck-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.tarot-back-menu {
    padding: 0.9rem 1.75rem;
    border-radius: 14px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: transparent;
    border: 2px solid rgba(192, 192, 224, 0.5);
    color: var(--tarot-silver);
}

.tarot-back-menu:hover {
    background: rgba(74, 44, 122, 0.4);
    border-color: var(--tarot-gold);
    color: var(--tarot-gold);
}

/* ===== LAYOUTS ===== */
.tarot-layout-row {
    flex-direction: row;
    flex-wrap: wrap;
}

.tarot-layout-cross {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 1.5rem;
    justify-items: center;
    max-width: 480px;
    margin: 0 auto;
}

.tarot-layout-cross .tarot-position-slot:nth-child(1) { grid-column: 2; grid-row: 1; }
.tarot-layout-cross .tarot-position-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.tarot-layout-cross .tarot-position-slot:nth-child(3) { grid-column: 2; grid-row: 2; }
.tarot-layout-cross .tarot-position-slot:nth-child(4) { grid-column: 3; grid-row: 2; }
.tarot-layout-cross .tarot-position-slot:nth-child(5) { grid-column: 2; grid-row: 3; }

.tarot-layout-triangle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    justify-items: center;
    max-width: 360px;
    margin: 0 auto;
}

.tarot-layout-triangle .tarot-position-slot:nth-child(1) { grid-column: 1 / -1; }
.tarot-layout-triangle .tarot-position-slot:nth-child(2) { grid-column: 1; }
.tarot-layout-triangle .tarot-position-slot:nth-child(3) { grid-column: 2; }

.tarot-layout-heart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    justify-items: center;
    max-width: 380px;
    margin: 0 auto;
}

.tarot-layout-heart .tarot-position-slot:nth-child(1) { grid-column: 1; }
.tarot-layout-heart .tarot-position-slot:nth-child(2) { grid-column: 2; }
.tarot-layout-heart .tarot-position-slot:nth-child(3) { grid-column: 1; }
.tarot-layout-heart .tarot-position-slot:nth-child(4) { grid-column: 2; }
.tarot-layout-heart .tarot-position-slot:nth-child(5) { grid-column: 1 / -1; }

.tarot-layout-star {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 1.25rem;
    justify-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.tarot-layout-star .tarot-position-slot:nth-child(1) { grid-column: 1 / -1; }
.tarot-layout-star .tarot-position-slot:nth-child(2) { grid-column: 1; }
.tarot-layout-star .tarot-position-slot:nth-child(3) { grid-column: 2; }
.tarot-layout-star .tarot-position-slot:nth-child(4) { grid-column: 1 / -1; }
.tarot-layout-star .tarot-position-slot:nth-child(5) { grid-column: 1; }
.tarot-layout-star .tarot-position-slot:nth-child(6) { grid-column: 2; }

.tarot-layout-square {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    justify-items: center;
    max-width: 360px;
    margin: 0 auto;
}

/* Совместимость и Кельтский крест — как колесо года (сетка 3×2) */
.tarot-layout-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1rem;
    justify-items: center;
    max-width: 420px;
    margin: 0 auto;
}

.tarot-layout-grid .tarot-position-slot:nth-child(n+1):nth-child(-n+3) { grid-row: 1; }
.tarot-layout-grid .tarot-position-slot:nth-child(n+4):nth-child(-n+6) { grid-row: 2; }

.tarot-layout-choice {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.25rem;
    justify-items: center;
    max-width: 520px;
    margin: 0 auto;
}

.tarot-layout-choice .tarot-position-slot:nth-child(7) { grid-column: 1 / -1; }

.tarot-layout-wheel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 1rem;
    justify-items: center;
    max-width: 320px;
    margin: 0 auto;
}

.tarot-layout-universal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.tarot-layout-circle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

/* Уменьшить движение — для пользователей с настройкой доступности */
@media (prefers-reduced-motion: reduce) {
    .tarot-orb,
    .tarot-nebula-layer,
    .tarot-star,
    .tarot-landing-ring {
        animation: none !important;
    }
}

/* ===== АДАПТИВ — только мобиль, комп не меняется ===== */
@media (max-width: 768px) {
    .tarot-page-container {
        padding: 0.5rem 2px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .tarot-spread-grid { grid-template-columns: repeat(2, 1fr); }
    .tarot-moon { width: 50px; height: 50px; right: 20px; top: 90px; }
    .tarot-position-card {
        width: clamp(70px, 12vw, 100px);
        height: clamp(95px, 18vw, 140px);
    }
    .tarot-layout-circle { grid-template-columns: repeat(3, 1fr); }
    .tarot-header {
        padding: 1rem 0.75rem;
        border-radius: 16px;
    }
    .tarot-header::before {
        display: none;
    }
    .tarot-header h1 {
        text-shadow: none;
    }
    .tarot-interpretation-text .description-heading,
    .tarot-interpretation-text h3.description-heading,
    .tarot-interpretation-text h4.description-heading,
    .tarot-interpretation-text h5.description-heading {
        text-shadow: none;
        color: var(--tarot-gold-light) !important;
        border-left: 3px solid rgba(232, 197, 71, 0.7) !important;
        background: linear-gradient(90deg, rgba(232, 197, 71, 0.15) 0%, transparent 70%) !important;
    }
    .tarot-interpretation-text .description-highlight {
        text-shadow: none;
        color: rgba(255, 215, 0, 0.98) !important;
    }
    .tarot-interpretation-text .tarot-token-heading,
    .tarot-interpretation-text .tarot-token-heading .tarot-token-text {
        text-shadow: none;
        color: var(--tarot-gold-light) !important;
    }
    /* Списки: явно показывать маркеры на мобиле */
    .tarot-interpretation-text .description-list,
    .tarot-interpretation-text ul,
    .tarot-interpretation-text ol {
        display: block !important;
        padding-left: 1.5em !important;
        margin: 0.5em 0 0.85em 0 !important;
        list-style-position: outside !important;
    }
    .tarot-interpretation-text ul,
    .tarot-interpretation-text ul.description-list {
        list-style-type: disc !important;
    }
    .tarot-interpretation-text ol,
    .tarot-interpretation-text ol.description-list {
        list-style-type: decimal !important;
    }
    .tarot-interpretation-text li {
        display: list-item !important;
        margin-bottom: 0.4em !important;
    }
    .tarot-header h1 {
        text-shadow: none;
    }
    .tarot-header::before {
        display: none;
    }
    .tarot-card-glow {
        animation: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    .tarot-spread-card .tarot-spread-name {
        text-shadow: none;
        animation: none;
    }
    .tarot-spread-zone {
        padding: 0.5rem 0;
        max-width: 100%;
    }
    .tarot-interpretation-inline {
        padding: 0.5rem calc(0.75rem + 3px);
        max-width: 100%;
    }
    .tarot-spread-zone,
    .tarot-spread-menu {
        min-width: 0;
        overflow-x: hidden;
    }

    /* Смягчение орбов, nebula и landing-ring — меньше мерцания на мобильном GPU */
    .tarot-orb {
        opacity: 0.12;
        animation-duration: 28s;
    }
    .tarot-nebula-layer {
        animation: none;
        opacity: 0.4;
    }
    .tarot-star {
        animation-duration: 6s;
    }
    .tarot-landing-ring {
        opacity: 0.7;
    }
    .tarot-position-card.tarot-landing-ring-active .tarot-landing-ring {
        animation: tarot-landing-ring-mobile 0.8s ease-out forwards;
    }
    /* Убрать засветы кнопок на Таро */
    .tarot-page-wrapper .tarot-spread-card:hover,
    .tarot-page-wrapper .generate-btn:hover {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    }
}

@keyframes tarot-landing-ring-mobile {
    0% { transform: scale(0.3); opacity: 0.7; box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.5), 0 0 15px var(--tarot-glow-gold); }
    70% { opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; box-shadow: 0 0 0 6px rgba(232, 197, 71, 0.15), 0 0 30px rgba(232, 197, 71, 0.08); }
}

@media (max-width: 480px) {
    .tarot-page-container {
        padding: 0.5rem 0;
    }
    .tarot-header {
        padding: 0.75rem 0.5rem;
    }
    .tarot-interpretation-inline {
        padding: 0.5rem calc(0.5rem + 3px);
    }
    .tarot-spread-card { padding: 1.25rem 0.75rem; }
    .tarot-spread-icon { font-size: 2rem; }
    .tarot-layout-circle { grid-template-columns: repeat(2, 1fr); }
}
