/* -----------------------------------------------------------
   1. FORCE THE CONTAINER (ID Selector is King)
----------------------------------------------------------- */
#sanctum-card-grid {
    display: grid !important;
    border: none !important;
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto 40px auto !important;
    
    /* Reset Elementor Interference */
    flex-direction: row !important;
    box-sizing: border-box !important;
}

/* -----------------------------------------------------------
   2. SPREAD SELECTOR GRAPHICS
----------------------------------------------------------- */
/* -----------------------------------------------------------
   2. SPREAD SELECTOR GRAPHICS
----------------------------------------------------------- */
.sanctum-spread-selector-grid {
    display: flex;
    flex-direction: row; /* Force Horizontal */
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; /* Wrap only if screen is tiny */
    margin-bottom: 25px;
    width: 100%;
}

.sanctum-spread-option {
    background: transparent; /* Transparent container */
    border: 1px solid transparent; 
    border-radius: 8px;
    padding: 5px;
    width: 110px; /* Much Smaller */
    cursor: pointer !important; /* Force Cursor */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
}

.sanctum-spread-option:hover {
    transform: translateY(-5px);
}

.sanctum-spread-option.active .spread-image-wrapper {
    box-shadow: 0 0 15px #d4af37, 0 0 5px #d4af37 inset; /* Gold Glow */
    border-color: #d4af37;
}

/* Image Wrapper */
.spread-image-wrapper {
    width: 100%;
    height: 110px; /* Square */
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 2px solid #333; /* Default Border */
    transition: all 0.3s ease;
}

.spread-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* KEY TRICK: Mix-Blend-Mode Screen makes black transparent */
    mix-blend-mode: screen; 
    transition: transform 0.5s ease;
}

.sanctum-spread-option:hover .spread-image-wrapper {
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.sanctum-spread-option:hover .spread-image-wrapper img {
    transform: scale(1.1);
}

.spread-name {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-align: center;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.sanctum-spread-option:hover .spread-name,
.sanctum-spread-option.active .spread-name {
    color: #d4af37;
}


/* -----------------------------------------------------------
   3. CELTIC CROSS LAYOUT (No Media Query - Force Desktop)
----------------------------------------------------------- */
#sanctum-card-grid.spread-layout-cross_complex {
    /* 5 Columns: Left | Center | Right | Gap | Staff */
    grid-template-columns: 100px 100px 100px 50px 100px !important;
    grid-template-rows: 150px 150px 150px 150px !important;
    gap: 15px !important;
    justify-content: center !important;
}

/* -----------------------------------------------------------
   4. CARD POSITIONING (The Map)
----------------------------------------------------------- */
/* Center Stack */
.spread-layout-cross_complex .card-position-0 { grid-column: 2; grid-row: 2; z-index: 10; }
.spread-layout-cross_complex .card-position-1 { 
    grid-column: 2; 
    grid-row: 2; 
    z-index: 20; 
    transform: rotate(90deg); 
    transform-origin: center center;
}

/* The Cross Arms */
.spread-layout-cross_complex .card-position-2 { grid-column: 2; grid-row: 3; } /* Bottom */
.spread-layout-cross_complex .card-position-3 { grid-column: 1; grid-row: 2; } /* Left */
.spread-layout-cross_complex .card-position-4 { grid-column: 2; grid-row: 1; } /* Top */
.spread-layout-cross_complex .card-position-5 { grid-column: 3; grid-row: 2; } /* Right */

/* The Staff (Right Side) */
.spread-layout-cross_complex .card-position-6 { grid-column: 5; grid-row: 4; } /* Bottom */
.spread-layout-cross_complex .card-position-7 { grid-column: 5; grid-row: 3; }
.spread-layout-cross_complex .card-position-8 { grid-column: 5; grid-row: 2; }
.spread-layout-cross_complex .card-position-9 { grid-column: 5; grid-row: 1; } /* Top */


/* -----------------------------------------------------------
   5. OTHER LAYOUTS (Linear & Arch)
----------------------------------------------------------- */

/* Linear (3 Card) */
#sanctum-card-grid.spread-layout-linear {
    display: flex !important;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    min-height: 200px;
}

/* Horseshoe (Arch) */
#sanctum-card-grid.spread-layout-arch {
    display: flex !important;
    justify-content: center;
    align-items: flex-end;
    height: 350px;
    gap: 10px;
}
/* Arch Offsets */
.spread-layout-arch .card-position-0, .spread-layout-arch .card-position-6 { margin-bottom: 0px; }
.spread-layout-arch .card-position-1, .spread-layout-arch .card-position-5 { margin-bottom: 40px; }
.spread-layout-arch .card-position-2, .spread-layout-arch .card-position-4 { margin-bottom: 80px; }
.spread-layout-arch .card-position-3 { margin-bottom: 120px; }


/* -----------------------------------------------------------
   6. IMAGE RESET & CARD SIZE CONSISTENCY
   CRITICAL: Match the Celtic Cross size (100x150) everywhere
----------------------------------------------------------- */
#sanctum-card-grid .sanctum-card-slot {
    /* Standard Size for ALL spreads */
    width: 100px !important;
    height: 150px !important;
    min-height: 150px;
    position: relative; 
    flex-shrink: 0; /* Don't shrink in flex containers */
}

#sanctum-card-grid img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 6px;
}

/* -----------------------------------------------------------
   7. NUMBER BADGES
----------------------------------------------------------- */
.card-number-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    font-size: 12px;
    background: #d4af37;
    color: #000;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    font-family: serif;
}

/* -----------------------------------------------------------
   8. THE LEGEND (Text List Below)
----------------------------------------------------------- */
#sanctum-reading-results {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reading-result-item {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-left: 3px solid #d4af37;
    border-radius: 0 10px 10px 0;
}

.result-number {
    font-size: 2em;
    font-weight: bold;
    color: #d4af37;
    opacity: 0.5;
    min-width: 30px;
}

.result-content h4 {
    margin: 0 0 10px 0;
    color: #fff;
    font-family: 'Cinzel', serif;
}

.result-content p {
    margin: 0;
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.6;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    #sanctum-card-grid.spread-layout-cross_complex {
        /* On mobile, we might need to stack or scale down */
        transform: scale(0.6);
        transform-origin: top center;
        margin-bottom: -150px !important; /* Counteract empty space from scale */
    }
}

/* -----------------------------------------------------------
   9. FLOATING SHARD PILL (Member Portal Trigger)
----------------------------------------------------------- */
.sanctum-shard-pill {
    position: fixed !important;
    bottom: 300px !important; 
    right: 0 !important; /* Align to edge */
    transform: translateX(calc(100% - 40px)); /* Move off-screen, leaving 40px visible */
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #d4af37;
    border-radius: 50px 0 0 50px; /* Round left side only */
    padding: 8px 16px 8px 25px; /* Extra left padding */
    cursor: pointer !important; /* Force pointer on hover */
    z-index: 2147483647 !important; /* Max Z-Index to be above everything */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncy slide */
    backdrop-filter: blur(5px);
    display: flex !important;
    align-items: center;
    width: auto !important;
    height: auto !important;
}

/* Hover: Slide out full display */
.sanctum-shard-pill:hover {
    transform: translateX(0); /* Slide fully into view */
    background: rgba(20, 20, 20, 0.95);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.shard-pill-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    color: #d4af37;
}

/* Forms */
.sanctum-form-group {
    margin-bottom: 15px;
}

.sanctum-form-group label {
    display: block;
    margin-bottom: 5px;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
}

.sanctum-form-group input {
    width: 100%;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Avatar Upload UI */
.sanctum-avatar-upload-group {
    text-align: center;
    margin-bottom: 20px;
}

.sanctum-avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 10px auto;
    overflow: hidden;
    border: 2px solid #d4af37;
    background: #000;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.sanctum-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#sanctum_avatar_input {
    display: none; /* Hide unsightly default input */
}

.sanctum-file-label {
    display: inline-block;
    padding: 8px 16px;
    background: #111;
    color: #d4af37;
    border: 1px solid #d4af37;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.sanctum-file-label:hover {
    background: #d4af37;
    color: #000;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* ... skipped footer ... */

/* ... skipped link ... */

/* ... skipped badges ... */

/* -----------------------------------------------------------
   10. MEMBER PORTAL MODAL (Restored)
----------------------------------------------------------- */
.sanctum-portal-modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.sanctum-portal-inner {
    background: #111;
    border: 2px solid #d4af37;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.sanctum-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
}
.sanctum-close-btn:hover { color: #fff; }

.portal-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.portal-header h3 {
    color: #d4af37;
    margin: 0 0 10px 0;
    font-family: 'Cinzel', serif;
}

.portal-balance {
    font-size: 14px;
    color: #aaa;
}

.portal-balance .sc-val {
    color: #fff;
    font-weight: bold;
    font-size: 18px;
}

.portal-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sanctum-tab-btn {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.sanctum-tab-btn.active, .sanctum-tab-btn:hover {
    background: #7F4B6B; /* Plum */
    border-color: #7F4B6B;
    color: #fff;
}

.sanctum-tab-pane {
    display: none;
}

.sanctum-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Hide Legacy Counter */
#sanctum-shard-floater {
    display: none !important;
}

/* -----------------------------------------------------------
   12. GAMIFICATION CLAIM BUTTON
----------------------------------------------------------- */
#sanctum-claim-btn {
    position: fixed;
    bottom: 100px; /* Above the footer/portal pill */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #d4af37, #f1c40f);
    color: #000;
    padding: 15px 30px;
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 16px;
    border: none;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 0 40px rgba(212, 175, 55, 0.3) inset;
    cursor: pointer;
    z-index: 9990; /* Below modal, above content */
    display: none; /* Hidden by default */
    animation: float 3s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

#sanctum-claim-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.8), 0 0 50px rgba(212, 175, 55, 0.4) inset;
}

#sanctum-claim-btn.claimed {
    background: #4caf50; /* Green success */
    color: #fff;
    cursor: default;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
}

@keyframes float {
    0% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-10px); }
    100% { transform: translateX(-50%) translateY(0px); }
}

/* -----------------------------------------------------------
   13. GUEST CTA (Tarot Page)
----------------------------------------------------------- */
.sanctum-guest-cta {
    margin-top: 30px;
    margin-bottom: 40px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(20, 0, 20, 0.9), rgba(0, 0, 0, 0.95));
    border: 1px solid #7F4B6B;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Decorative Borders */
.sanctum-guest-cta::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    pointer-events: none;
}

.sanctum-cta-content h3 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #d4af37;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.sanctum-cta-content p {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #ccc;
    max-width: 600px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

.sanctum-cta-content strong {
    color: #fff;
}

.sanctum-cta-content em {
    color: #9B59B6; /* Amethyst for Shards */
    font-style: normal;
    font-weight: bold;
}

.sanctum-cta-btn {
    display: inline-block;
    background: #7F4B6B;
    color: #fff;
    padding: 15px 35px;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.sanctum-cta-btn:hover {
    background: #d4af37;
    color: #000;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}
/* -----------------------------------------------------------
   14. SANCTUM REGISTRATION FORM
----------------------------------------------------------- */
.sanctum-registration-wrapper {
    background: #0a0a0a;
    border: 1px solid #7F4B6B;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

/* Gold Glow Effect */
.sanctum-registration-wrapper::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
}

.sanctum-reg-title {
    text-align: center;
    color: #D4AF37;
    font-family: 'Cinzel', serif;
    font-size: 2em;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

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

.sanctum-form-group label {
    display: block;
    color: #ccc;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sanctum-form-group input[type="text"],
.sanctum-form-group input[type="email"],
.sanctum-form-group input[type="password"] {
    width: 100%;
    background: #151515;
    border: 1px solid #333;
    padding: 12px 15px;
    color: #fff;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Fix sizing issues */
}

.sanctum-form-group input:focus {
    border-color: #D4AF37;
    outline: none;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    background: #1a1a1a;
}

/* Membership Tiers */
.sanctum-tiers {
    margin-top: 30px;
    border-top: 1px solid #333;
    padding-top: 20px;
}

.sanctum-tier-option {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.sanctum-tier-option:hover {
    border-color: #555;
    background: #111;
}

.sanctum-tier-option input[type="radio"] {
    margin-top: 5px;
    accent-color: #D4AF37;
}

.sanctum-tier-option label {
    cursor: pointer;
    margin: 0;
}

.tier-name {
    display: block;
    color: #D4AF37;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.tier-desc {
    display: block;
    color: #888;
    font-size: 0.85em;
    text-transform: none;
    line-height: 1.4;
}

/* Submit Button */
.sanctum-btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #7F4B6B, #5a354c);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.sanctum-btn-submit:hover {
    background: #D4AF37;
    color: #000;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.sanctum-btn-submit:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

/* Messages */
.sanctum-form-messages {
    margin-bottom: 20px;
    min-height: 20px;
    font-size: 0.9em;
    text-align: center;
}

.sanctum-form-messages.success {
    color: #4caf50;
    border: 1px solid #4caf50;
    padding: 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
}

.sanctum-form-messages.error {
    color: #ff5252;
    border: 1px solid #ff5252;
    padding: 10px;
    background: rgba(255, 82, 82, 0.1);
    border-radius: 4px;
}
