:root {
    --burgundy-bg: #1a0a0a;
    --card-burgundy: #1a0a0a;
    --gold-bright: #d4af37;
    --gold-muted: #8a6d3b;
    --gold-glow: rgba(212, 175, 55, 0.33);
    --card-bg: rgba(34, 16, 16, 0.6);
}

/* --- View Profile Floating Glow & Spread --- */
.view-profile {
    position: absolute;
    bottom: 25px;
    right: 25px;
    font-size: 0.75rem;
    color: var(--gold-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    z-index: 5;
    /* Transition for all properties to ensure smooth spreading */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.view-profile:hover {
    color: var(--gold-bright);
    
    /* 1. The Spreading Effect */
    letter-spacing: 4px; 
    
    /* 2. The Glowing Effect */
    text-shadow: 0 0 8px var(--gold-glow), 
                 0 0 15px rgba(212, 175, 55, 0.2);
    
    /* 3. Slight Shift to make it feel "active" */
    transform: translateX(-5px);
}

/* Arrow Specific Animation */
.view-profile::after {
    content: '→';
    display: inline-block;
    transition: transform 0.4s ease;
}

.view-profile:hover::after {
    transform: translateX(8px); /* Arrow moves out as text spreads */
    color: var(--gold-bright);
}

/* Optional: Subtle underline that grows from the center */
.view-profile::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--gold-bright);
    transition: all 0.4s ease;
    box-shadow: 0 0 5px var(--gold-bright);
}

.view-profile:hover::before {
    width: 100%;
    left: 0;
}

/* ================= BASE ================= */
body {
    background-color: var(--burgundy-bg);
    color: var(--gold-bright);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 25px 15px; /* was 40px */
}

/* ✅ WRAPPER (YOU WERE MISSING CONTROL HERE) */
.sanctum-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* ================= HEADER ================= */
.collection-header {
    text-align: center;
    padding: 40px 10px;
}
.glow-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    letter-spacing: 4px;
    margin: 0;
    text-transform: uppercase;
    color: #2a1a1a;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        #f4e8d1 0%,
        #d4af37 10%,
        transparent 70%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.2));
    transition: filter 0.3s ease;
}

.collection-header:hover .glow-text {
    filter: drop-shadow(0 0 20px var(--gold-glow));
}

/* Header Styles */
.breadcrumb a {
    color: var(--gold-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.3s;
}

.classification {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--gold-muted);
    opacity: 0.5;
    display: block;
    margin-bottom: 10px;
}

/* THE ORNAMENTAL DIVIDER */
.header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
}

.line {
    height: 1px;
    width: 60px;
    background: linear-gradient(to var(--dir, right), transparent, var(--gold-muted));
}
.left { --dir: right; }
.right { --dir: left; }

.crest-mini {
    color: var(--gold-bright);
    font-size: 1.2rem;
    text-shadow: 0 0 10px var(--gold-glow);
}

.tagline {
    font-style: italic;
    color: var(--gold-muted);
    font-size: 1.1rem;
}

.gold-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold-muted), transparent);
    width: 60%;
    margin: 30px auto;
}

/* Tab Menu */
.tab-menu {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
}

.tab-btn {
    background: rgba(212, 175, 55, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--gold-muted);
    padding: 8px 25px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.tab-btn.active {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.05);
}


/* ================= GRID (FIXED) ================= */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* ✅ FIXED */
    gap: 70px 40px;

    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;

    overflow: visible;
}

/* ================= CARD ================= */
.char-card-container {
    width: 80%;
    max-width: 280px;
    height: 360px;

    perspective: 1600px;
    margin: 0 auto;
}

/* Hover stacking fix */
.char-card-container:hover {
    z-index: 10;
}

/* ================= FLIP ================= */
.char-card-flipper {
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease;
    transform-style: preserve-3d;
}

.char-card-container:hover .char-card-flipper {
    transform: rotateY(180deg) translateY(-10px);
}


/* ================= CARD FACE ================= */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;

    backface-visibility: hidden;
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 6px;

    padding: 25px;
    background: var(--card-burgundy);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
z-index: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

/* BACK */
.card-back {
    transform: rotateY(180deg);
}


.member-status {
    position: absolute;
    top: 20px;
    font-size: 0.6rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-muted);
}

.gold-line {
    width: 50px;
    height: 1px;
    background: var(--gold-bright);
    margin: 15px 0;
}

.card-id {
    position: absolute;
    bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    opacity: 0.5;
}

/* --- BACK FACE STYLING --- */
.card-back {
    transform: rotateY(180deg); /* Starts already flipped away */
    background: radial-gradient(circle at center, #261616, #1a0a0a);
    border-color: var(--gold-bright);
}

.back-header {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 4px;
    color: var(--gold-bright);
    text-shadow: 0 0 10px var(--gold-glow);
}

.quote {
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0d5c5;
    margin: 30px 0;
    text-align: center;
}

.card-back .gold-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}

/* Glow Effect on Hover */
.char-card-container:hover .card-face {
    box-shadow: 0 0 30px var(--gold-glow);
    border-color: var(--gold-bright);
}

/* 1. The Portrait Container */
.card-portrait {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    
    /* THE ELITE FADE EFFECT */
  
    filter: grayscale(100%) contrast(1.2); /* Makes it look like an old print */
    mix-blend-mode: luminosity; /* Blends the image into the burgundy color */
    z-index: 0;
    transition: opacity 0.5s ease;
}

/* 2. The Dark Overlay (Ensures text is readable) */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        rgba(26, 10, 10, 0.4) 0%, 
        rgba(26, 10, 10, 0.9) 100%);
    z-index: 1;
}

/* 3. Ensure Content Sits on Top */
.card-front .member-status,
.card-front .crest-container,
.card-front .char-info,
.card-front .card-id {
    position: relative;
    z-index: 2; /* Keeps text above the portrait and overlay */
}

/* 4. Subtle Interaction */
.char-card-container:hover .card-portrait {
    opacity: 0.25; /* Image brightens slightly when 'handled' */
    filter: grayscale(100%) contrast(1.4);
}

.char-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
}

.sub-text {
    color: var(--gold-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}





/* Footer */
.archive-footer {
    text-align: center;
    margin-top: 80px;
    color: var(--gold-muted);
}


/* Header Styles */
.breadcrumb {
    margin-bottom: 12px;
}

.glow-link {
    color: var(--gold-muted);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
}

.glow-link:hover {
    color: var(--gold-bright);
    text-shadow: 0 0 10px var(--gold-glow), 0 0 20px rgba(212, 175, 55, 0.2);
    transform: translateX(-5px); /* Subtle slide effect */
}

/* 2. Enhanced Tab Buttons with Hover Glow */
.tab-menu {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 40px 0;
}

.tab-btn {
    background: rgba(212, 175, 55, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--gold-muted);
    padding: 12px 35px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

/* The Active State */
.tab-btn.active {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}

/* Hover Effect for Non-Active Tabs */
.tab-btn:not(.active):hover {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.08);
    box-shadow: 0 0 15px var(--gold-glow); /* Outer glowing border */
    transform: translateY(-2px);
}

/* Icon Subtle Animation */
.tab-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.tab-btn:hover .tab-icon {
    transform: scale(1.2);
}

/* Decorative Gold Shine on Hover */
.tab-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: 0.5s;
}

.tab-btn:hover::after {
    left: 100%;
}

/* 1. Target the Upcoming Slot specifically */
.upcoming-slot .card-face {
    background: #0a0505; /* Blacker than burgundy */
    border: 1px dashed var(--gold-muted); /* Dashed border for 'In Progress' */
    filter: grayscale(1);
    opacity: 0.8;
}

/* 2. Static Noise Effect */
.static-noise {
    background: url('https://www.transparenttextures.com');
    opacity: 0.1;
    animation: noise-move 0.2s infinite;
}

@keyframes noise-move {
    0% { background-position: 0 0; }
    100% { background-position: 10px 10px; }
}

/* 3. The Redacted Bar */
.redact-bar {
    width: 140px;
    height: 20px;
    background: #d4af37;
    margin: 10px auto;
    position: relative;
    overflow: hidden;
}

.redact-bar::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: scan 2s infinite;
}

@keyframes scan {
    100% { left: 100%; }
}

/* 4. Large Lock Icon */
.lock-icon-large {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--gold-muted);
    opacity: 0.5;
}

/* 5. Glitch Hover Effect */
.upcoming-slot:hover .card-face {
    filter: grayscale(0);
    opacity: 1;
    border-color: #d4183d; /* Red border for 'Access Denied' */
    box-shadow: 0 0 20px rgba(212, 24, 61, 0.3);
}

.upcoming-slot:hover .glitch-text {
    animation: glitch 0.3s infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* 6. Loading Bar on Back */
.loading-bar-container {
    width: 80%;
    height: 2px;
    background: rgba(212, 175, 55, 0.1);
    margin-top: 20px;
}

.loading-bar {
    width: 45%; /* Progress level */
    height: 100%;
    background: var(--gold-bright);
    box-shadow: 0 0 10px var(--gold-bright);
}

/* 1. Top Status Bar */
.security-header {
    position: absolute;
    top: 15px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 2px;
}

.status-indicator {
    color: #00ff00; /* Green for 'Active System' */
    text-shadow: 0 0 5px #00ff00;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* 2. Access Granted Banner */
.access-banner {
    margin-bottom: 20px;
    text-align: center;
}

.access-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.8rem;
    color: var(--gold-bright);
    letter-spacing: 5px;
    text-shadow: 0 0 15px var(--gold-glow);
    margin: 5px 0;
}

.banner-line {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--gold-muted), transparent);
}

/* 3. Clearance Stamp */
.clearance-stamp {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    border: 1px solid var(--gold-muted);
    padding: 2px 8px;
    color: var(--gold-muted);
    opacity: 0.6;
}

/* 4. Triggering the 'Decryption' on Flip */
.char-card-container:hover .status-text {
    animation: changeText 0.8s forwards;
}

@keyframes changeText {
    0% { content: "DECRYPTING..."; }
    100% { color: var(--gold-bright); }
}

/* 1. The Recessed Gallery Background */
.gallery-design {
    background: radial-gradient(circle at center, #1e0d0d, #0d0505) !important;
    padding: 30px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 2. The Gilded Frame Inner */
.gallery-frame {
    position: relative;
    width: 100%;
    height: 80%;
    border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
}

.gallery-inner {
    text-align: center;
    z-index: 2;
}

/* 3. Typography */
.heritage-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--gold-muted);
    margin-bottom: 15px;
    display: block;
}

.legacy-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--gold-bright);
    margin: 0;
    text-shadow: 0 0 15px var(--gold-glow);
}

.patron-quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #e0d5c5;
    line-height: 1.6;
    margin-top: 25px;
    opacity: 0.8;
}

/* 4. Frame Accents (The L-Brackets) */
.frame-accent {
    position: absolute;
    width: 5px;
    height: 2px;
    border: 1px solid var(--gold-bright);
}
.tl { top: -5px; left: -5px; border-right: none; border-bottom: none; }
.tr { top: -5px; right: -5px; border-left: none; border-bottom: none; }
.bl { bottom: -5px; left: -5px; border-right: none; border-top: none; }
.br { bottom: -5px; right: -5px; border-left: none; border-top: none; }

/* 5. The Provenance Seal */
.provenance-seal {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
}

.seal-inner {
    width: 30px;
    height: 30px;
    border: 1px solid var(--gold-muted);
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-muted);
}

.seal-text {
  padding: 6px;
    font-size: 0.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 50px;
}

.gallery-label {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #f4e8d1;
    display: inline-flex; /* Changed to inline-flex so it doesn't take 100% width */
    align-items: center;
    gap: 15px;
    opacity: 0; /* Hidden until JS triggers */
    transition: opacity 0.5s ease;
}

/* The Stars */
.gallery-label::before,
.gallery-label::after {
    content: "✧";
    color: #d4af37;
    font-size: 0.8rem;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
    opacity: 0;
    transition: opacity 1s ease 0.5s; /* Delay stars slightly after text starts */
}

/* When the JS triggers the reveal */
.gallery-label.reveal-active {
    opacity: 1;
}

.gallery-label.reveal-active::before,
.gallery-label.reveal-active::after {
    opacity: 1;
}

/* ================= MOBILE & TABLET RESPONSIVE ================= */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .sanctum-wrapper {
        max-height: none;
        overflow-y: visible;
    }
    
    .character-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        padding: 0 10px;
    }
    
    .char-card-container {
        max-width: 220px;
        height: 280px;
    }
    
    .glow-text {
        font-size: 2rem;
        letter-spacing: 3px;
    }
    
    .tab-btn {
        padding: 6px 18px;
        font-size: 0.7rem;
    }
    
    .collection-header {
        padding: 15px 10px;
    }
}

@media (max-width: 650px) {
    body {
        overflow-x: hidden;
        padding: 8px 5px;
    }

    .character-grid {
        display: flex;
        overflow-x: auto;
        gap: 75px;
        height: 350px;
        padding: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        margin: 15px auto;
    }

    .character-grid::-webkit-scrollbar {
        display: none;
    }

    .char-card-container {
        flex: 0 0 70%;
        min-width: 70%;
        max-width: 70%;
        scroll-snap-align: center;
        height: 280px;
        
    }

    .glow-text {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    
    .tab-menu {
        gap: 8px;
        margin: 15px 0 20px;
    }
    
    .tab-btn {
        padding: 5px 12px;
        font-size: 0.65rem;
    }
    
    .tagline {
        font-size: 0.7rem;
    }
}

/* SMALL PHONES */
@media (max-width: 480px) {
    .char-card-container {
        flex: 0 0 85%;
        min-width: 85%;
        height: 260px;
    }
    
    .glow-text {
        font-size: 1.3rem;
    }
    
    .classification {
        font-size: 0.55rem;
        letter-spacing: 2px;
    }
    
    .breadcrumb a {
        font-size: 0.6rem;
    }
    
    .char-info h3 {
        font-size: 1.2rem;
    }
    
    .sub-text {
        font-size: 0.6rem;
    }
    
    .member-status {
        font-size: 0.5rem;
        top: 10px;
    }
    
    .card-id {
        font-size: 0.5rem;
        bottom: 10px;
    }
    
    .quote {
        font-size: 0.7rem;
        margin: 12px 0;
    }
    
    .back-header {
        font-size: 0.7rem;
    }
    
    .legacy-title {
        font-size: 1.2rem;
    }
    
    .patron-quote {
        font-size: 0.7rem;
    }
    
    .archive-footer {
        margin-top: 20px;
        font-size: 0.6rem;
    }
}