/* ============================================================
   TAROT READING TOOL — Tarot With Lavanya Theme
   Palette: Deep Teal, Gold, Warm Cream, Deep Purple, Soft Rose
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --trt-teal: #4b7878;
    --trt-teal-deep: #2f5252;
    --trt-teal-light: #6a9e9e;
    --trt-gold: #F9C74F;
    --trt-gold-dark: #e0a800;
    --trt-gold-glow: rgba(249, 199, 79, 0.40);
    --trt-cream: #fcfcf4;
    --trt-cream-warm: #f5f0e6;
    --trt-purple: #3a1d6e;
    --trt-purple-soft: #5a3d8a;
    --trt-rose: #d4a5a5;
    --trt-rose-muted: #b8918f;
    --trt-bg: var(--trt-cream);
    --trt-bg-card: rgba(75, 120, 120, 0.08);
    --trt-text: #2a2a2a;
    --trt-text-muted: #6b6b6b;
    --trt-glass: rgba(75, 120, 120, 0.06);
    --trt-glass-border: rgba(75, 120, 120, 0.18);
    --trt-radius: 16px;
    --trt-radius-sm: 10px;
    --trt-font-display: 'Cinzel Decorative', 'Cinzel', 'Playfair Display', Georgia, serif;
    --trt-font-heading: 'Cinzel', 'Playfair Display', Georgia, serif;
    --trt-font-body: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
    --trt-transition: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* --- Container --- */
.trt-container {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    background: var(--trt-cream);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(75, 120, 120, 0.10) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(58, 29, 110, 0.08) 0%, transparent 50%);
    color: var(--trt-text);
    font-family: var(--trt-font-body);
    font-size: 18px;
    line-height: 1.6;
    overflow: hidden;
    min-height: 520px;
    border-radius: var(--trt-radius);
    border: 1px solid rgba(75, 120, 120, 0.12);
}

/* --- Ambient Particles --- */
.trt-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.trt-particles::before,
.trt-particles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: trt-float 8s ease-in-out infinite;
}
.trt-particles::before {
    width: 4px; height: 4px;
    background: var(--trt-gold);
    opacity: 0.25;
    top: 15%; left: 10%;
    animation-delay: 0s;
    box-shadow:
        120px 40px 0 rgba(249,199,79,0.12),
        300px -20px 0 rgba(249,199,79,0.15),
        500px 60px 0 rgba(249,199,79,0.08),
        700px 30px 0 rgba(249,199,79,0.14),
        80px 300px 0 rgba(249,199,79,0.10),
        400px 350px 0 rgba(249,199,79,0.18),
        620px 280px 0 rgba(249,199,79,0.06);
}
.trt-particles::after {
    width: 3px; height: 3px;
    background: var(--trt-rose);
    opacity: 0.20;
    top: 60%; right: 15%;
    animation-delay: -4s;
    box-shadow:
        -100px -60px 0 rgba(212,165,165,0.12),
        -250px 30px 0 rgba(212,165,165,0.15),
        -450px -40px 0 rgba(212,165,165,0.08),
        -600px 50px 0 rgba(212,165,165,0.14);
}
@keyframes trt-float {
    0%, 100% { transform: translateY(0) translateX(0); }
    33% { transform: translateY(-18px) translateX(8px); }
    66% { transform: translateY(12px) translateX(-6px); }
}

/* --- Steps --- */
.trt-step {
    position: relative;
    z-index: 1;
    display: none;
    text-align: center;
    animation: trt-fadeUp 0.6s ease both;
}
.trt-step.trt-active {
    display: block;
}
@keyframes trt-fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Typography --- */
.trt-title {
    font-family: var(--trt-font-display);
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 700;
    color: var(--trt-teal-deep);
    margin: 0 0 12px;
    letter-spacing: 0.04em;
    text-shadow: none;
}
.trt-subtitle {
    font-family: var(--trt-font-body);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--trt-text-muted);
    margin: 0 0 28px;
    font-style: italic;
}
.trt-intro-glyph {
    font-size: 3rem;
    color: var(--trt-teal);
    opacity: 0.6;
    margin-bottom: 16px;
    animation: trt-glyph-pulse 3s ease-in-out infinite;
}
@keyframes trt-glyph-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.08); }
}
.trt-intro-desc {
    max-width: 480px;
    margin: 0 auto 36px;
    color: var(--trt-text-muted);
    font-size: 1rem;
}

/* --- Buttons --- */
.trt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-family: var(--trt-font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--trt-transition);
    text-decoration: none;
    line-height: 1.2;
}
.trt-btn--gold {
    background: linear-gradient(135deg, var(--trt-gold), var(--trt-gold-dark));
    color: #2a1a00;
    box-shadow: 0 4px 20px rgba(249, 199, 79, 0.35);
}
.trt-btn--gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(249, 199, 79, 0.45);
}
.trt-btn--gold:active {
    transform: translateY(0);
}
.trt-btn--outline {
    background: transparent;
    color: var(--trt-teal);
    border: 1.5px solid var(--trt-teal);
}
.trt-btn--outline:hover {
    background: rgba(75, 120, 120, 0.08);
}
.trt-btn--disabled,
.trt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Input --- */
.trt-input-wrap {
    max-width: 480px;
    margin: 0 auto 32px;
}
.trt-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid var(--trt-glass-border);
    border-radius: var(--trt-radius-sm);
    color: var(--trt-text);
    font-family: var(--trt-font-body);
    font-size: 1.05rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}
.trt-input::placeholder {
    color: var(--trt-text-muted);
    opacity: 0.7;
}
.trt-input:focus {
    border-color: var(--trt-gold);
    box-shadow: 0 0 0 3px rgba(249, 199, 79, 0.18);
}

/* ============================================================
   STEP 3: CARD SELECTION — Fan Layout
   ============================================================ */
.trt-select-count {
    font-family: var(--trt-font-heading);
    font-size: 0.95rem;
    color: var(--trt-text-muted);
    margin-bottom: 28px;
    letter-spacing: 0.05em;
}
.trt-select-count span {
    color: var(--trt-teal);
    font-weight: 700;
    font-size: 1.1rem;
}

.trt-card-fan {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0;
    margin: 0 auto 36px;
    padding: 20px 0 40px;
    position: relative;
    min-height: 260px;
}

/* Individual facedown card */
.trt-pick-card {
    width: 100px;
    height: 156px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    flex-shrink: 0;
    /* Card back — teal + purple gradient */
    background:
        linear-gradient(135deg, var(--trt-teal-deep), var(--trt-purple) 70%, var(--trt-teal-deep));
    border: 2px solid rgba(249, 199, 79, 0.22);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.trt-pick-card::before {
    content: '✦';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--trt-gold);
    opacity: 0.35;
    transition: opacity 0.3s;
}
.trt-pick-card::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(249, 199, 79, 0.12);
    border-radius: 7px;
    pointer-events: none;
}
.trt-pick-card:hover {
    transform: translateY(-18px) scale(1.06) !important;
    box-shadow: 0 12px 36px rgba(249, 199, 79, 0.30), 0 0 48px rgba(75, 120, 120, 0.12);
    border-color: var(--trt-gold);
    z-index: 10;
}
.trt-pick-card:hover::before {
    opacity: 0.7;
}

/* Selected state */
.trt-pick-card.trt-selected {
    border-color: var(--trt-gold);
    box-shadow: 0 0 24px rgba(249, 199, 79, 0.35), inset 0 0 18px rgba(249, 199, 79, 0.08);
    transform: translateY(-24px) scale(1.08) !important;
    z-index: 11;
}
.trt-pick-card.trt-selected::before {
    content: '★';
    opacity: 0.9;
    color: var(--trt-gold);
}

/* Disabled (already have 3) */
.trt-pick-card.trt-pick-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ============================================================
   STEP 4: SHUFFLE ANIMATION
   ============================================================ */
.trt-step--shuffle {
    display: none;
    padding-top: 60px;
}
.trt-shuffle-anim {
    margin-bottom: 32px;
}
.trt-shuffle-cards {
    position: relative;
    width: 120px;
    height: 170px;
    margin: 0 auto;
}
.trt-shuffle-card {
    position: absolute;
    width: 100px;
    height: 150px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--trt-teal-deep), var(--trt-purple));
    border: 2px solid rgba(249, 199, 79, 0.25);
    box-shadow: 0 4px 20px rgba(0,0,0,0.20);
}
.trt-sc-1 {
    top: 0; left: 10px;
    animation: trt-shuffle1 1.2s ease-in-out infinite;
}
.trt-sc-2 {
    top: 5px; left: 5px;
    animation: trt-shuffle2 1.2s ease-in-out infinite 0.15s;
}
.trt-sc-3 {
    top: 10px; left: 0;
    animation: trt-shuffle3 1.2s ease-in-out infinite 0.3s;
}
@keyframes trt-shuffle1 {
    0%, 100% { transform: rotate(-5deg) translateX(0); }
    50% { transform: rotate(8deg) translateX(30px); }
}
@keyframes trt-shuffle2 {
    0%, 100% { transform: rotate(2deg) translateX(0); }
    50% { transform: rotate(-6deg) translateX(-25px); }
}
@keyframes trt-shuffle3 {
    0%, 100% { transform: rotate(5deg) translateX(0); }
    50% { transform: rotate(-3deg) translateX(20px); }
}

.trt-shuffle-msg {
    font-family: var(--trt-font-heading);
    font-size: 1.1rem;
    color: var(--trt-teal-deep);
    letter-spacing: 0.08em;
    animation: trt-pulse-text 2s ease-in-out infinite;
}
@keyframes trt-pulse-text {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.trt-shuffle-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.trt-shuffle-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--trt-teal);
    opacity: 0.3;
    animation: trt-dot-bounce 1.4s ease-in-out infinite;
}
.trt-shuffle-dots span:nth-child(2) { animation-delay: 0.2s; }
.trt-shuffle-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes trt-dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* ============================================================
   STEP 5: RESULTS
   ============================================================ */
.trt-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 36px 0;
}

/* Individual result card with flip */
.trt-result-card {
    perspective: 800px;
}
.trt-result-card-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotateY(180deg);
}
.trt-result-card-inner.trt-flipped {
    transform: rotateY(0);
}

/* Card faces */
.trt-result-front,
.trt-result-back {
    backface-visibility: hidden;
    border-radius: var(--trt-radius);
}
.trt-result-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--trt-teal-deep), var(--trt-purple));
    border: 2px solid rgba(249, 199, 79, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--trt-gold);
    opacity: 0.4;
}
.trt-result-front {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid var(--trt-glass-border);
    padding: 24px 16px 28px;
    text-align: center;
    box-shadow: 0 2px 20px rgba(75, 120, 120, 0.08);
}

/* Position label */
.trt-position-label {
    font-family: var(--trt-font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--trt-teal);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.trt-position-label::before,
.trt-position-label::after {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--trt-teal);
    opacity: 0.35;
}

/* Card image area */
.trt-card-img-wrap {
    width: 100%;
    max-width: 155px;
    margin: 0 auto 16px;
    aspect-ratio: 2 / 3.4;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--trt-teal-deep), var(--trt-purple));
    border: 1px solid rgba(249, 199, 79, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.trt-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}
/* Reversed indicator */
.trt-card-img-wrap.trt-reversed {
    transform: rotate(180deg);
}
.trt-card-numeral {
    font-family: var(--trt-font-display);
    font-size: 2.8rem;
    color: var(--trt-gold);
    opacity: 0.55;
}

/* Card name */
.trt-card-name {
    font-family: var(--trt-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--trt-teal-deep);
    margin-bottom: 4px;
}
.trt-card-orientation {
    font-family: var(--trt-font-body);
    font-size: 0.85rem;
    color: var(--trt-rose-muted);
    font-style: italic;
    margin-bottom: 12px;
}
.trt-card-keywords {
    font-size: 0.8rem;
    color: var(--trt-text-muted);
    margin-bottom: 14px;
    line-height: 1.4;
}
.trt-card-meaning {
    font-size: 0.95rem;
    color: var(--trt-text);
    line-height: 1.6;
    text-align: left;
}
.trt-card-meaning strong {
    color: var(--trt-teal);
    font-family: var(--trt-font-heading);
    font-weight: 600;
}

/* --- Combined Summary --- */
.trt-summary {
    background: rgba(75, 120, 120, 0.05);
    border: 1px solid var(--trt-glass-border);
    border-radius: var(--trt-radius);
    padding: 28px 24px;
    margin: 12px 0 36px;
    text-align: left;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.trt-summary h3 {
    font-family: var(--trt-font-heading);
    color: var(--trt-teal-deep);
    font-size: 1.15rem;
    margin: 0 0 14px;
    text-align: center;
}
.trt-summary p {
    margin: 0 0 12px;
    color: var(--trt-text);
    font-size: 1rem;
    line-height: 1.7;
}
.trt-summary p:last-child { margin-bottom: 0; }

/* --- CTA Block --- */
.trt-cta-block {
    text-align: center;
    margin: 32px 0;
}
.trt-cta-text {
    font-family: var(--trt-font-heading);
    font-size: 1rem;
    color: var(--trt-text-muted);
    margin-bottom: 16px;
}

/* --- SEO Content --- */
.trt-seo-content {
    margin-top: 48px;
    text-align: left;
    border-top: 1px solid var(--trt-glass-border);
    padding-top: 32px;
}
.trt-seo-content h3 {
    font-family: var(--trt-font-heading);
    color: var(--trt-teal-deep);
    font-size: 1.1rem;
    margin: 28px 0 10px;
}
.trt-seo-content h3:first-child { margin-top: 0; }
.trt-seo-content p {
    color: var(--trt-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 12px;
}

/* ============================================================
   RESPONSIVENESS
   ============================================================ */
@media (max-width: 768px) {
    .trt-container {
        padding: 32px 16px 48px;
    }
    .trt-results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
    }
    .trt-pick-card {
        width: 72px;
        height: 112px;
    }
    .trt-pick-card::before {
        font-size: 1.4rem;
    }
    .trt-card-fan {
        min-height: 180px;
        padding: 10px 0 30px;
    }
}
@media (max-width: 480px) {
    .trt-pick-card {
        width: 58px;
        height: 90px;
        border-radius: 7px;
    }
    .trt-card-fan {
        min-height: 150px;
    }
    .trt-btn {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
}
