/* Mobile-First Tarot Reader Styles */
/* Disable mobile tap highlight everywhere */
* {
  -webkit-tap-highlight-color: transparent;
}

img,
button,
.selection-card,
.deck,
.card-back,
.card-slot {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* iOS: removes the long-press callout menu ("Save Image") */
img, .card-image, .card-back, .selection-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.card-image { pointer-events: none; }
.card-image-wrapper { pointer-events: auto; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
     background:
    radial-gradient(
      circle at center,
      rgba(0,0,0,0.0) 0%,
      rgba(0,0,0,0.35) 70%,
      rgba(0,0,0,0.6) 100%
    ),
    url('./images/046ad49e-2f2f-4897-a376-7ed628bd78de.webp') center / cover no-repeat;
    min-height: 100vh;
    overflow-x: hidden;
    
}

/* Disable legacy reading DOM during focus mode */
body.focus-active .reading-text {
    display: none !important;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    animation: fadeIn 0.8s ease-out;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #a78bfa, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 0.95rem;
    color: #a0a0c0;
    font-weight: 400;
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 20px;
    overflow: hidden;
}

/* Focus stage container - anchor to top on mobile */
.focus-stage {
    justify-content: flex-start !important;
    align-items: center;
    padding-top: 12px;
}

body.focus-active .main {
    justify-content: flex-start !important;
}

/* Mobile Focus Overlay - Fixed position, above all table cards */
@media (max-width: 480px) {
    :root {
        --focus-btn-h: 64px;
        --focus-btn-gap: 12px;
    }
    
    body.focus-active {
        overflow: hidden;
    }
    
.table-focus {
    position: absolute;
    inset: 0;
    padding-top: 12px;
    padding-bottom: calc(var(--focus-btn-h) + var(--focus-btn-gap));
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}
    
    .table-focus-card {
        transform: scale(0.6);
        margin: 0;
        margin-bottom: 1px !important;
    }

    .table-focus-text {
        margin-top: 0 !important;
        text-align: center;
        flex: 1;
        width: 100%;
        max-width: 300px;
        padding: 0;
        overflow-y: auto;
    }
    
    .table-focus-text > *:last-child {
        margin-bottom: 0 !important;
    }

    .table-focus-text * {
        margin-top: 0;
        margin-bottom: 0;
    }

    .table-focus-text .card-name {
        margin-top: 4px;
        margin-bottom: 2px;
    }

    .table-focus-text .card-meaning {
        margin-bottom: 4px;
        line-height: 1.35;
    }

    .table-focus-text .position-label {
        margin-top: 2px;
        padding-bottom: 6px;
    }
    
    body.focus-active .focus-stage,
    body.focus-active .table-focus {
        transform: none !important;
    }

    .table-focus .continue-btn {
        position: fixed;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 50%;
        width: calc(100% - 32px);
        max-width: 320px;

        transform: translateX(-50%) !important;
        transition: none !important;
        animation: none !important;
    }

    .focus-spacer {
    display: none;
}
}

/* Card Area - Hidden in focus mode */
.card-area {
    display: none;
}

/* Card Area - Visible when showing table */
.card-area.visible {
    display: block;
}

/* Table Focus Container - Mobile only, displayed between table cards */
.table-focus {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 16px 0;
    z-index: 5;
}

/* Mobile-only spacing fixes - override for non-overlay cases */
@media (max-width: 480px) {
    .table-focus {
        gap: 0 !important;
        margin: 0 !important;
    }

    .table-focus-card {
        margin-bottom: -4px !important; /* pulls text closer to scaled card */
    }

    .table-focus-text {
        margin-top: -6px !important;    /* main fix */
        padding-top: 0 !important;
        gap: 6px !important;
    }

    .table-focus-text .card-name {
        margin-top: 0 !important;
        margin-bottom: 2px !important;
    }
}

/* Mobile focus card - reduced size, in normal flow */
.table-focus-card {
    transform: scale(0.65);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 0;
}

.table-focus-card .card-back {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 3/5;
    background: transparent;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.table-focus-card .card-back::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: none;
    border-radius: 12px;
}

.table-focus-card .card-back .card-symbol {
    font-size: 4rem;
    animation: pulse 2s infinite;
    transform: scale(1);
}

.table-focus-card .card-back .card-symbol img.card-image {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
}

.card-back-wrapper {
    display: none;
}

.table-focus-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    font-size: 0.9rem;
    margin-top: 8px;
}

.table-focus-text .card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.table-focus-text .card-meaning {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e0e0e0;
    max-width: 100%;
    margin-bottom: 12px;
    display: block;
}

.table-focus-text .position-label {
    font-size: 0.85rem;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(167, 139, 250, 0.3);
}

.card-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    width: 100%;
    align-items: center;
}

.card-slot {
    width: 100%;
    max-width: 140px;
    position: relative;
    perspective: 1000px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* Current card - fully centered and visible */
.card-slot.current {
    transform: scale(1);
    opacity: 1;
    z-index: 10;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-slot.current .card-back-wrapper {
    margin-bottom: 0;
    width: 100%;
    max-width: 320px;
}

/* Previous revealed cards - show icon in table */
.card-slot.revealed:not(.current) {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Revealed Card */
.card-revealed {
    animation: cardReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Card Content Panel (Text below card) */
.card-content-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
    max-height: 30vh;
    width: 100%;
    max-width: 320px;
}

.card-content-panel .card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.card-content-panel .card-meaning {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0e0e0;
    max-width: 100%;
    margin-bottom: 12px;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.card-content-panel .position-label {
    font-size: 0.85rem;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(167, 139, 250, 0.3);
    flex-shrink: 0;
}

/* Reading Text */
.reading-text {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.8s ease-out 0.3s both;
}

.reading-text.hidden {
    display: none;
}

/* Hide header during reading */
.header.hidden {
    display: none;
}

/* Final Reflection */
.final-reflection {
    display: none;
    animation: fadeIn 0.8s ease-out;
}

.final-reflection.visible {
    display: block;
    padding: 0 20px 48px; /* ⬅ MUCH tighter */
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

/* Completed state - cards fade into background */
.card-row.completed .card-slot {
    transform: scale(0.7) translateY(-12px);
    opacity: 0.3;
    max-width: 80px;
    height: 120px;
}

.card-row.completed .card-slot.current {
    transform: scale(0.8) translateY(-30px);
    opacity: 0.5;
    max-width: 100px;
    height: 140px;
}

.final-reflection h2 {
    font-size: 1.4rem;
    letter-spacing: 3px;
    color: #a78bfa;
    margin-bottom: 28px;
    text-transform: uppercase;
}

.final-reflection h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    margin: 14px auto 0;
    background: rgba(167, 139, 250, 0.5);
}

.reflection-content {
    max-width: 360px;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #e0e0e0;
}

.reflection-content p {
    margin-bottom: 14px;
}

.final-reflection::after {
    content: '';
    display: block;
    height: 40px;
}

.card-row.completed {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.card-row.completed .card-slot {
    transform: scale(0.7) translateY(-12px);
}

/* Continue Button */
.continue-btn {
    display: none;
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

/* Deck Container (Shuffle Intro) */
.deck-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    min-height: auto;
    animation: fadeIn 0.8s ease-out;
}

.deck-container.hidden {
    display: none;
}

.deck {
    position: relative;
    width: min(78vw, 320px);
    aspect-ratio: 3 / 5;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.deck.shuffling {
    animation: shuffle 0.8s ease-in-out;
}

.deck.fading-out {
    transition: opacity 0.6s ease, transform 0.6s ease;
    opacity: 0;
    transform: translateY(-50px) scale(0.8);
}

.card-back {
    width: 100%;
    height: 100%;
    
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-back::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: none;
    border-radius: 12px;
}

.card-symbol {
    font-size: 12rem;
    opacity: 0.95;
    animation: pulse 2s infinite;
    transform: scale(1);
}

.card-symbol img.card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Deck intro card image */
.deck .card-back .card-symbol img.card-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Card Back Wrapper (reusable card style for reading) */
.card-back-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 320px;
}

.card-back-wrapper .card-back {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 3/5;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card-back-wrapper .card-back::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: none;
    border-radius: 12px;
}

.card-back-wrapper .card-symbol {
    font-size: 5.5rem;
    animation: pulse 2s infinite;
    transform: scale(1);
}

.card-back-wrapper .card-symbol img.card-image {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
}

/* Start Button */
.start-btn {
    padding: 16px 48px;
    background: linear-gradient(45deg, #a78bfa, #c4b5fd);
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.4);
    animation: fadeIn 0.8s ease-out 0.3s both;
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px rgba(167, 139, 250, 0.6);
}

.start-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.start-btn.hidden {
    display: none;
}

/* Continue Button */
.continue-btn {
    display: none;
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: fadeIn 0.6s ease-out;
    flex-shrink: 0;
    margin-top: 12px;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.continue-btn.hidden {
    display: none;
}

.continue-btn.visible {
    display: block;
}

/* Back to Home Button */
.back-home-btn {
    display: none;
    margin: 24px auto 0;
    padding: 14px 32px;
    background: linear-gradient(45deg, #a78bfa, #c4b5fd);
    color: #1a1a2e;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
    animation: fadeIn 0.8s ease-out 0.5s both;
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(167, 139, 250, 0.5);
}

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

.back-home-btn.hidden {
    display: none;
}

.back-home-btn.visible {
    display: block;
}

/* Card Content Panel (Text below card) - DEPRECATED, use .focus-text instead */
.card-content-panel {
    display: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 16px 0;
    opacity: 0.6;
    font-size: 0.8rem;
    color: #a0a0c0;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 32px;
    border-radius: 24px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 16px;
}

.modal-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-primary {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    border: none;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.modal-btn-secondary {
    background: transparent;
    color: #a0a0c0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Form Modal Overlay */
.form-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.form-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.form-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 32px;
    border-radius: 24px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-modal-overlay.visible .form-modal-content {
    transform: scale(1);
}

.form-modal-content h2 {
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 16px;
}

.form-modal-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #a0a0c0;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardReveal {
    0% {
        transform: rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: rotateY(0);
        opacity: 1;
    }
}

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

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

/* Responsive adjustments */
@media (max-width: 360px) {
    .title {
        font-size: 1.6rem;
    }
    
    .card-area {
        min-height: 240px;
    }
    
    .card-back, .card-front {
        height: 360px;
    }
}

/* Mobile opening screen adjustments */
@media (max-width: 480px) {
    .deck-container {
        gap: 32px;
        min-height: auto;
    }
    
    .deck {
        width: min(80vw, 280px);
        aspect-ratio: 5 / 5;
    }
    
    .start-btn {
        padding: 14px 40px;
        font-size: 1rem;
    }
    
    .table-focus-card {
        transform: scale(0.6);
        margin: 0;
    }
    
    .table-focus-text {
        margin-top: 6px;
    }
    
    .table-focus-text .card-name {
        margin-top: 6px;
        margin-bottom: 4px;
    }

    .table-focus-text .card-meaning {
        margin-bottom: 6px;
        line-height: 1.4;
    }

    .table-focus-text .position-label {
        margin-top: 4px;
    }
    
    .table-focus .continue-btn {
        position: fixed;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 320px;
        z-index: 200;
    }
}

/* Focus card fade out animation */
@keyframes focusCardOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Icon animation from focus to table */
@keyframes iconToTable {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    60% {
        transform: translate(
            calc(var(--tx) * 0.7),
            calc(var(--ty) * 0.6 - 12px)
        ) scale(0.7);
    }

    100% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) scale(0.6);
    }
}



@keyframes tableSettle {
    0% {
        transform: scale(1);
    }
    60% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

.card-slot.revealed .card-back-icon {
    animation: tableSettle 0.25s ease-out;
}

.card-slot.revealed .card-back-icon {
    
    transition: box-shadow 0.3s ease;
}



/* Icon in table slot */
.card-slot .card-back-icon {
    width: 100%;
    max-width: 80px;
    aspect-ratio: 3/5;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-slot .card-back-icon .card-symbol {
    font-size: 3rem;
    animation: pulse 2s infinite;
}

/* Focus card fade out class */
.focus-card-out {
    animation: focusCardOut 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Icon animation class */
.icon-animating {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    animation: iconToTable 0.55s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}

/* Table slot revealed state */
.card-slot.revealed {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-slot.revealed .card-back-icon {
    transform: scale(1);
    opacity: 1;
}


/* If the tarot art is an <img class="card-image">, this will force it to fit */
img.card-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;   /* or cover */
  object-position: center !important;
  transform: none !important;
  animation: none !important;
}

.table-focus-card .card-back {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 2 / 3;

  border-radius: 20px;
  overflow: hidden;

  display: block;
  position: relative;
}

body.final-active .main {
    gap: 0 !important;
}

body.final-active .card-row {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    height: auto !important;
}

body.final-active .card-row.completed .card-slot {
    transform: scale(0.7);
    opacity: 0.35;
}

body.final-active .main {
    padding-bottom: 0 !important;
}

.final-reflection.visible {
    margin-top: 6px;
}

/* 🔑 REMOVE DEFAULT HEADING GAP INSIDE FINAL REFLECTION */
.reflection-content h2 {
    margin-top: 0 !important;
}

/* ==================== Card Selection Stage ==================== */

.card-selection-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: auto;
    animation: fadeIn 0.8s ease-out;
}

.card-selection-container.hidden {
    display: none !important;
}

.card-selection-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 16px 0;
}

.selection-card {
    width: min(22vw, 100px);
    aspect-ratio: 3/5;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    overflow: hidden;
}

.selection-card::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.selection-card:hover {
    transform: translateY(-8px) scale(1.05);
}

.selection-card:active {
    transform: scale(0.95);
}

.selection-card.selected {
    border: 2px solid #a78bfa;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
    transform: translateY(-12px);
}

.selection-card.selected::before {
    border: none;
}

.selection-card .card-back {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.selection-card .card-back .card-symbol {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

.selection-card .card-back .card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.selection-instruction {
    font-size: 1rem;
    color: #a0a0c0;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

/* Responsive adjustments for card selection */
@media (max-width: 480px) {
    .card-selection-row {
        gap: 8px;
        padding: 12px 0;
    }
    
    .selection-card {
        width: min(28vw, 90px);
        aspect-ratio: 3/5;
        border-radius: 12px;
    }
    
    .selection-card .card-back .card-symbol {
        font-size: 2rem;
    }
}

@media (max-width: 360px) {
    .card-selection-row {
        gap: 6px;
    }
    
    .selection-card {
        width: min(30vw, 80px);
    }
    
    .selection-card .card-back .card-symbol {
        font-size: 1.8rem;
    }
}

/* ========================================
   User Info Form Styles
   ======================================== */
.user-info-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.form-content {
    width: 100%;
    max-width: 420px;
    padding: 32px;
}

.form-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #a78bfa;
    text-align: center;
    margin-bottom: 16px;
    background: linear-gradient(45deg, #a78bfa, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
}

.form-subtitle {
    font-size: 0.9rem;
    color: #a0a0c0;
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid rgba(167, 139, 250, 0.3);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #a78bfa;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Reveal Button */
.reveal-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #a78bfa, #c4b5fd);
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
}

.reveal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(167, 139, 250, 0.4);
}

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

/* Form Disclaimer */
.form-disclaimer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.form-disclaimer p {
    font-size: 0.85rem;
    color: #a0a0c0;
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: center;
}

.secure-text {
    font-size: 0.8rem;
    color: #a78bfa;
    text-align: center;
    margin-top: 8px;
    font-weight: 600;
}

/* Hidden state */
.user-info-form.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .form-content {
        padding: 24px;
    }
    
    .form-title {
        font-size: 1.4rem;
    }
    
    .form-subtitle {
        font-size: 0.85rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .reveal-btn {
        padding: 14px;
        font-size: 1rem;
    }
}

@media (max-width: 360px) {
    .form-content {
        padding: 20px;
    }
    
    .form-title {
        font-size: 1.2rem;
    }
    
    .form-subtitle {
        font-size: 0.8rem;
    }
}

.dob-group {
  display: flex;
  gap: 10px;
}

.dob-group input {
  height: 48px;              /* match your other inputs */
  text-align: center;
  font-size: 16px;
}

/* Size proportions */
#dobMonth,
#dobDay {
  width: 70px;
}

#dobYear {
  flex: 1;                   /* fills remaining space */
}


.primary-desire-group label {
  display: grid !important;
  grid-template-columns: 20px 1fr;
  align-items: center;
  column-gap: 12px;
}

.primary-desire-group input[type="radio"] {
  margin: 0 !important;
}

.primary-desire-group span {
  margin: 0 !important;
}

.email-optin label {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  column-gap: 12px;
  cursor: pointer;
}

.email-optin input[type="checkbox"] {
  margin: 0;
}

.email-optin span {
  font-size: 14px;
  color: #bfaaff;
  line-height: 1.3;
}

.terms-consent label {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  column-gap: 12px;
  cursor: pointer;
}

.terms-consent input[type="checkbox"] {
  margin: 0;
}

.terms-consent span {
  font-size: 13px;
  color: #bfaaff;
  line-height: 1.4;
}

.terms-consent a {
  color: #e6d9ff;
  text-decoration: underline;
}
