/* ===== TAROT PHASES - DESIGN MÍSTICO PROFISSIONAL ===== */

/* Container Principal */
.phase-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0c0c1e 0%, #1a1a2e 25%, #16213e 50%, #0f3460 100%);
    padding: 140px 20px 60px 20px;
    position: relative;
    overflow: hidden;
}

/* Efeitos de Fundo */
.phase-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(241, 196, 15, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.08) 0%, transparent 50%);
    animation: backgroundPulse 10s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.7;
    }
}

/* Header */
.phase-header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

.phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(241, 196, 15, 0.15);
    border: 1px solid rgba(241, 196, 15, 0.3);
    color: #f1c40f;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.phase-title {
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #f1c40f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.phase-subtitle {
    color: #cbd5e1;
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* Deck de Cartas */
.cards-deck {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 60px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    perspective: 1500px;
}

/* Carta Individual */
.tarot-card {
    width: 140px;
    height: 210px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    perspective: 1500px;
    position: relative;
}

.tarot-card:hover:not(.dimmed):not(.selected) {
    transform: translateY(-20px) scale(1.08);
    z-index: 10;
}

/* Inner Card - Flip Container */
.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    position: relative;
}

.tarot-card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Faces da Carta */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Verso da Carta */
.card-back {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid rgba(241, 196, 15, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-back::before {
    content: '🌙';
    font-size: 3rem;
    filter: drop-shadow(0 0 15px rgba(241, 196, 15, 0.6));
    animation: cardBackGlow 3s ease-in-out infinite;
}

@keyframes cardBackGlow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.card-back::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(241, 196, 15, 0.2);
    border-radius: 14px;
}

/* Frente da Carta */
.card-front {
    transform: rotateY(180deg);
    border: 2px solid rgba(241, 196, 15, 0.4);
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

/* Carta Selecionada */
.tarot-card.selected {
    animation: cardSelected 0.6s ease-out;
}

.tarot-card.selected .card-face {
    border: 3px solid #f1c40f;
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.9), 0 15px 50px rgba(0, 0, 0, 0.7);
}

@keyframes cardSelected {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Carta Esmaecida */
.tarot-card.dimmed {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(80%);
}

/* Caixa de Contador */
.counter-box {
    background: rgba(241, 196, 15, 0.08);
    border: 2px solid rgba(241, 196, 15, 0.3);
    border-radius: 24px;
    padding: 35px;
    text-align: center;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.counter-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(241, 196, 15, 0.1) 0%, transparent 70%);
    animation: counterGlow 8s ease-in-out infinite;
}

@keyframes counterGlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(10%, 10%) scale(1.1);
    }
}

.counter-text {
    color: #f1c40f;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.counter-number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #f1c40f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

/* Progress Bar */
.counter-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.counter-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #f39c12);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.6);
}

/* Botões */
.phase-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-phase {
    padding: 20px 60px;
    border: none;
    border-radius: 999px;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #1a1a2e;
    box-shadow: 0 8px 30px rgba(241, 196, 15, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: inherit;
}

.btn-phase::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-phase:hover:not(:disabled)::before {
    width: 400px;
    height: 400px;
}

.btn-phase:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(241, 196, 15, 0.6);
}

.btn-phase:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(60%);
}

.btn-phase:active:not(:disabled) {
    transform: scale(0.96);
}

/* Botão Secundário */
.btn-phase-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(241, 196, 15, 0.4);
    color: #f1c40f;
    backdrop-filter: blur(10px);
}

.btn-phase-secondary:hover:not(:disabled) {
    background: rgba(241, 196, 15, 0.15);
    border-color: #f1c40f;
}

/* Animação de Entrada */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efeito de Brilho nas Cartas */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

.tarot-card.sparkling::after {
    content: '✨';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    animation: sparkle 1.5s ease-in-out infinite;
    pointer-events: none;
}

/* Mensagem de Instrução */
.instruction-message {
    text-align: center;
    color: #cbd5e1;
    font-size: 1.1rem;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsivo */
@media (max-width: 1024px) {
    .tarot-card {
        width: 120px;
        height: 180px;
    }

    .cards-deck {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .phase-container {
        padding: 120px 15px 40px 15px;
    }

    .tarot-card {
        width: 100px;
        height: 150px;
    }

    .cards-deck {
        gap: 15px;
    }

    .counter-box {
        padding: 25px;
    }

    .btn-phase {
        padding: 16px 40px;
        width: 100%;
        font-size: 1rem;
    }

    .phase-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tarot-card {
        width: 85px;
        height: 128px;
    }

    .cards-deck {
        gap: 12px;
    }

    .card-back::before {
        font-size: 2rem;
    }
}
