/* --- 1. HERO SECTION & 3D BUTTONS --- */
.text-glow {
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

/* SURREAL-3D-BUTTON */
.surreal-3d-btn {
    transform-style: preserve-3d;
    background: linear-gradient(-45deg, #1e293b, var(--accent-color), #1e293b, var(--neon-color));
    background-size: 400% 400%;
    animation: holo-shimmer 8s ease infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    padding: 0.75rem 0.25rem;
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
}

.surreal-3d-btn:hover {
    box-shadow: 0 20px 45px rgba(0, 242, 255, 0.3), 0 0 20px var(--neon-color);
    transform: translateY(-5px);
}

.inner-content {
    transform: translateZ(40px);
}

/* --- 2. GRID & CARD BEHAVIOR --- */
.glass-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--btn-radius);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.action-card:hover {
    transform: translateY(-8px);
    border-color: var(--neon-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 255, 0.2);
    background: rgba(30, 41, 59, 0.8);
}

/* --- 3. ICON BADGE & HOLOGRAM EFFECTS --- */
.card-icon-badge {
    position: relative;
    margin-bottom: 1.5rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-color);
    font-size: 3rem;
    z-index: 20;
    opacity: 0.6;
    transition: all 0.4s ease;
}

.card-icon-badge i {
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%);
     display: flex;
     align-items: center;
     justify-content: center;
}

.action-card:hover .card-icon-badge {
    opacity: 1;
    animation: icon-hologram 4s linear infinite;
}

/* --- 4. FEATURED CARD & METALLIC BEZEL --- */
.featured-card {
    position: relative;
    overflow: hidden;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: #0f172a;
    background-size: cover;
    background-position: center;
}

.metallic-bezel {
    position: relative;
    /*border: 2px solid solid var(--neon-color);*/
    border: none;
    border-radius: 2rem;
    overflow: hidden;
    background-image: linear-gradient(to bottom, #1e293b, #0f172a), 
                      linear-gradient(135deg, #ffffff50 0%, #334155 40%, #ffffff50 50%, #1e293b 70%, #ffffff50 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2), inset 0 0 10px rgba(0, 242, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metallic-bezel::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 2px solid rgba(0, 242, 255, 0.3);
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    z-index: 50; /* Ensures it sits ABOVE the background image */
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 242, 255, 0.1);
}
.featured-card:hover.metallic-bezel {
    border-color: #fff;
    box-shadow: 0 0 30px var(--neon-color);
    animation: neon-glow-pulse 1.5s infinite;
    transform: translateY(-2px);
}
/* Hover State: Combines all your logic into a single high-performance trigger */
.featured-card:hover.metallic-bezel::after {
    border-color: #ffffff;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.4), 0 0 30px var(--neon-color);
}
.featured-card:hover .neon-text-sync {
    color: #00f2ff;
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.8);
}
.featured-card:hover {
    transform: translateY(-5px);
}
/* Brighten bezel on hover */
.featured-card:hover::after {
    border-color: #ffffff;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.4), 
                0 0 30px var(--neon-color);
}
/* --- 5. NAVIGATION --- */
#nav-menu button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nav-text-color);
    font-family: var(--nav-font);
    transition: all 0.3s ease;
}

#nav-menu button:hover {
    color: var(--nav-hover-color);
    filter: drop-shadow(0 0 5px var(--nav-hover-color));
}

#hero-title span {
    font-weight: inherit;
}

/* --- 6. ANIMATIONS --- */
@keyframes holo-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes icon-hologram {
    0% { transform: translate(-50%, -50%) rotate(0deg); filter: drop-shadow(0 0 2px var(--neon-color)); }
    50% { filter: drop-shadow(0 0 8px var(--neon-color)); }
    100% { transform: translate(-50%, -50%) rotate(360deg); filter: drop-shadow(0 0 2px var(--neon-color)); }
}

@keyframes neon-glow-pulse {
    0% { box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 5px rgba(0, 242, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 255, 0.6); }
    100% { box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 5px rgba(0, 242, 255, 0.2); }
}

.animate-fadeIn {
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
/* Update the block at the very end of your file */
/* Add to the bottom of showroom_styles.css */

#auth-hud { 
    display: none; /* Default state: Hidden */
    position: fixed; 
    inset: 0; 
    height: 100vh; 
    width: 100vw; 
    background: rgba(0, 0, 0, 0.96); 
    z-index: 9999; 
    backdrop-filter: blur(12px); 
    align-items: center; /* Vertical Center */
    justify-content: center; /* Horizontal Center */
} 

#auth-hud.active {
    display: flex; /* Force show when JS adds class */
}

#auth-hud .metallic-bezel {
    transform: none;
    min-height: unset;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5), 0 0 30px var(--neon-color);
}

/* Ensure the glow border follows the new auto-height */
#auth-hud .metallic-bezel::after {
    height: 100%;
    width: 100%;
    position: absolute;
    inset: 0;
}
#auth-hud h2 {
    font-family: var(--nav-font);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    color: #ffffff;
}

#auth-hud p {
   font-family: var(--nav-font); /* Using system font variable */
   font-size: 30px;
   font-weight: bold;
   letter-spacing: 0.2em;
   color: #94a3b8;
}
/* --- REALMS SPECIFIC CLASSES --- */
/* --- THE HERO LAYOUT & PARTICLE CANVAS --- */

/* Parent container holding the entire hero content block */
.realms-hero-container {
    min-height: 50vh; /* Viewport height for cinematic spacing */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #050505;
    background-color: #050505; /* Fallback background */
    /* move up by 0.5 inch */
    transform: translateY(-2.25rem);
}

/* --- THE MASSIVE, CENTERED TYPOGRAPHY --- */

/* The primary headline: massive, bold, uppercase, centered, with cyan glow */
.realms-hero-title {
    font-size: 6rem; /* Huge default size (96px) */
    font-weight: 900; /* Extra black weight */
    text-transform: uppercase;
    text-align: center;
    letter-spacing: -0.05em; /* Tracking-tighter */
    line-height: 1.0; /* Tight leading */
    
/* THE METALLIC REFLECTION ENGINE */
    background: linear-gradient(to bottom, #ffffff 20%, #b4c6ef 45%, #00f2ff 50%, #ffffff 55%, #7892b5 85%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* ANTI-ALIASING FIX FOR TEXT-SHADOW WITH GRADIENTS */
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 12px rgba(0, 242, 255, 0.5))
            drop-shadow(0 0 30px rgba(0, 242, 255, 0.2));
    will-change: filter;
}

/* Special text class for color accents within the title */
.realms-hero-accent {
    color: var(--accent-color); /* Dynamically pulled from settings/ui_settings */
}

/* The subtle sub-headline and descriptions */
.realms-hero-subtitle {
    font-size: 1.25rem; /* Text-xl (20px) */
    color: #ffffff; /* Slate-400 */
    font-weight: 600; /* Font-light */
    letter-spacing: 0.1em; /* Wide tracking */
    margin-top: 1.5rem; /* Spacing below the massive title */
    max-w-2xl; /* Paragraph width constraint */
    text-align: center;
    line-height: 1.8;
    padding: 0 0.5rem ;
}

/* --- THE HOLOGRAPHIC PRIMARY BUTTON ENGINE --- */

/* Outer capsule shape with 3D perspective for hover effects */
.realms-surreal-3d-btn {
    position: relative;
    padding: 1rem 4rem; /* Wide and clean padding */
    border-radius: 1rem; /* Beveled corner style */
    text-transform: uppercase;
    font-weight: 700;
    font-size: 1.5rem; /* Text-lg (18px) */
    letter-spacing: 0.3em;
    color: #ffffff;
    cursor: pointer;
    overflow: hidden; /* Important for inner glow animations */
    perspective: 1000px; /* Essential for 3D hover 'tilt' effects */
    
    /* COMPLEX BACKGROUND STYLING:
       Combines an internal gradient base, subtle hardware grid lines, and 
       the characteristic glowing borders (box-shadow).
    */
    background: linear-gradient(135deg, rgba(16, 23, 31, 0.9) 0%, rgba(5, 5, 5, 0.95) 100%);
    border: 1px solid rgba(0, 242, 255, 0.2); /* Faint baseline cyan border */
    
    /* THE PRIMARY BOX SHADOW GLOWS: (Inner and Outer Cyan rings) */
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.6), /* Persistent Outer Glow */
                inset 0 0 15px rgba(0, 242, 255, 0.3); /* Soft Inner Glow */
                
    transition: all 0.3s ease-out; /* Smooth hover transition */
}

/* HOVER EFFECTS: Highlights, Tilt, and Icon Animation triggers */

.realms-surreal-3d-btn:hover {
    transform: translateY(-3px) rotateX(2deg); /* Subtle 3D 'tilt' effect */
    border-color: rgba(0, 242, 255, 0.8); /* Intensified border */
    background: linear-gradient(135deg, rgba(20, 28, 38, 0.95) 0%, rgba(5, 5, 5, 1) 100%);
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.9), /* Intense Outer Glow */
                inset 0 0 20px rgba(0, 242, 255, 0.5); /* Soft Inner Glow */
}

/* --- ICON HANDLING (The power-off and chip detail icons) --- */

/* Center the text and icons within the button using flexbox alignment rules */
.realms-surreal-3d-btn .realms-inner-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem; /* Gap-3 spacing */
}

/* Define the visual style for the persistent cyan icon details */
.realms-surreal-3d-btn i {
    color: var(--neon-color); /* Blue/Cyan (0, 242, 255) */
    filter: drop-shadow(0 0 5px rgba(0, 242, 255, 0.8)); /* Soft icon glow */
    opacity: 0.7; /* Subtly dimmed until hover */
    transition: all 0.5s ease;
}

/* Specific microchip icon on the right (needs rotation animation) */
.realms-surreal-3d-btn .fa-microchip {
    /* Persistent drop-shadow is defined in 'surreal-3d-btn i' */
}

/* Trigger specific icon animations (scale/rotate) when the button is hovered */
.realms-surreal-3d-btn:hover i {
    opacity: 1.0;
    transform: scale(1.1); /* fa-power-off on left slightly scales up */
}

.realms-surreal-3d-btn:hover .fa-microchip {
    transform: rotate(180deg) scale(1.1); /* Microchip on right rotates 180deg */
}

/* THE DESCRIPTION SUB-HEADING UNDER THE BUTTON */
.realms-hero-cta-secondary {
    font-size: 1rem; /* Text-xs (12px) */
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.3em; /* Wide tracking */
    color: #ffffff; /* Slate-500 */
    margin-top: 1rem;
    transition: color 0.3s ease;
}

.realms-hero-cta-secondary:hover {
    color: #00ffff; /*Slate-400 */
}

/* --- 3. BACKGROUND EFFECTS & MOTION DEPTH --- */
#realms-bg-canvas {
    mix-blend-mode: screen;
    will-change: transform;
    background: radial-gradient(circle at 50% 50%, #0b1329 0%, #050508 100%);
}

/* --- AUTH SYSTEM SPECIFIC CLASSES --- */

.auth-trigger-btn {
    /* Layout & Structure */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 10px 24px;
    
    /* Shape & Reset */
    border-radius: 20px;
    background: transparent;
    border-width: 1px;
    border-style: solid;
    cursor: pointer;
    
    /* Animation Core */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    visibility: visible;
    opacity: 1;
    
    /* Text Baseline */
    text-decoration: none;
    line-height: 1;
}

.hud-bezel-fixed {
    position: relative;
    transform: none; /* REMOVE the -50% translations */
    margin: auto; 
    min-height: unset;
    width: 550px;
    padding: 4rem;
}
#provider-list {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    width: 100% ;
    gap: 1rem ;
}

/* Ensure FontAwesome icons inside the HUD are forced to the neon color */
#provider-list i {
    color: var(--neon-color);
}

/* Isolated Abort Button Style */
.hud-abort-btn-unique {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    font-size: 30 px;
    font-weight: bold;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.hud-abort-btn-unique:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
    letter-spacing: 0.4em;
}
/* --- NAVIGATION BRANDING FIXES --- */
#nav-logo.logo-container {
    min-width: 320px; /* Gives the logo wrapper enough space to breathe */
    flex-shrink: 0;   /* Prevents flexbox from squeezing it */
    white-space: nowrap; /* Forces text to stay on one single line */
}

/* --- MENU ITEM CORRECTIONS --- */
#nav-menu a {
    text-decoration: none; /* Strips out the default underline */
    font-size: 15px;
    font-weight: 700;       /* Makes the font presence thicker */
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

#nav-menu a:hover {
    text-decoration: none;
    color: #ffffff;
    text-shadow: 0 0 10px var(--neon-color, #00f2ff),
                 0 0 20px var(--neon-color, #00f2ff); /* Kinetic neon glow */
}

/* --- HARDWARE PARTICLE LAYER SYNC & TRANSPARENCY --- */
#realms-bg-canvas {
    display: block;
    /* Seamless dreamscape background blend fading cleanly into #050505 */
    background: radial-gradient(circle at 50% 50%, #0d172a 0%, #050505 75%);
    z-index: 0;
}

.realms-hero-container {
    position: relative;
    z-index: 10; /* Forces buttons/text to stack cleanly above the canvas */
    transform: translateY(-2.25rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}
/* --- HERO SEGMENT SEPARATION AND COCKPIT DEPTH --- */
.realms-hero-subtitle-wrapper {
    margin-bottom: 0.5rem ; /* Widened extensively to prevent line fighting */
    display: block ;
    position: relative ;
    z-index: 20 ;
}

.realms-hero-btn-row {
    margin-top: 0.5rem ; /* Gives the 3D action button its own layout perimeter */
    margin-bottom: 1rem;
    display: flex ;
    justify-content: center ;
    align-items: center ;
    position: relative ;
    z-index: 30 ;
}
/* --- FIXED ROOT ANCHORS: FORCE FULL VIEWPORT RE-PAINT ON LOAD --- */
html.realms-page-root,
html.realms-page-root body {
    background: #050505 ;
    background-color: #050505 ;
    min-height: 100vh ; /* Forces the document container to fill the window frame instantly before scripts load */
    height: 100% ;
}

/* --- COMPLETE LAYER TRANSPARENCY STREAM FOR NEW REALMS ONLY --- */
html.realms-page-root main,
html.realms-page-root section,
html.realms-page-root footer,
html.realms-page-root #hero-container,
html.realms-page-root #showcase-grid,
html.realms-page-root #visual-flow-container,
html.realms-page-root #trending-sparks-grid,
html.realms-page-root #templates-grid,
html.realms-page-root #action-grid,
html.realms-page-root [id$="-container"],
html.realms-page-root [id*="-grid"],
html.realms-page-root .max-w-7xl,
html.realms-page-root .mx-auto {
    background: transparent ;
    background-color: transparent ;
    border: none ; /* Wipes out any native horizontal partition lines from the structural templates */
    border-color: transparent ;
    box-shadow: none ;
}
/* --- SPECIFIC HERO BLOCK OVERRIDE --- */
html.realms-page-root [class*="realms-hero-container"] {
    background: transparent ;
    background-color: transparent ;
}

/* --- EXPLICIT CANVAS RENDERING ENGINE FIX --- */
#realms-bg-canvas {
    display: block ;
    visibility: visible ;
    opacity: 1 ;
    position: fixed ;
    top: 0 ;
    left: 0 ;
    width: 100vw ;
    height: 100vh ;
    z-index: -1 ;
    background: radial-gradient(circle at 50% 40%, #0c182e 0%, #050505 85%) ;
}

/* --- SECTION CONTENT BLOCKS SURFACE CONTRAST --- */
html.realms-page-root .featured-card, 
html.realms-page-root .glass-card, 
html.realms-page-root footer {
    background: rgba(15, 23, 42, 0.65) ;
    backdrop-filter: blur(var(--card-blur, 15px)) ;
    -webkit-backdrop-filter: blur(var(--card-blur, 15px)) ;
    border: 1px solid rgba(255, 255, 255, 0.05) ;
}

/* Inline styles fallback for immediate testing or direct inject */
@keyframes dash {
  to {
    stroke-dashoffset: -160;
  }
}
.animate-dash {
  animation: dash 3s linear infinite;
}

@keyframes floatBubble {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-110px) scale(1.05);
    opacity: 0;
  }
}
.animate-float-bubble {
  animation: floatBubble 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
#heartbeat-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    /* Changed from top margin 0 to a negative value to close up the gap above */
    margin: -40px auto 12px auto;
}
.realm-immersive-panel-container {
    min-height: 640px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    border-radius: 16px;
    padding: 16px;
    overflow: hidden;
    transition: all 0.5s ease;
    background-color: rgba(2, 6, 23, 0.9);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.realm-visual-display-canvas-frame {
    width: 100%;
    min-height: 480px;
    flex: 1 1 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Custom utility classes to maximize canvas usage and introduce decorative headers */
.p-minimal {
    padding: 0px ;
}

.metallic-text-header {
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 25%, #94a3b8 45%, #ffffff 55%, #64748b 70%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
}
/* --- 9. TRENDING SPARKS TICKER ENGINE --- */
html.realms-page-root section:has(#trending-sparks-grid) {
    width: 100%;
    overflow: hidden;
    position: relative;
    /* Clean vignette mask layer window on both boundaries */
    mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.marquee-track {
    display: flex ;
    width: max-content ;
    min-width: max-content ;
    flex-shrink: 0 ;
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    animation: scrollMarqueeRightToLeft 180s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

/* Prevent cards from collapsing inside the marquee flex container */
.ticker-card-wrapper {
    flex-shrink: 0;
}

.ticker-spark-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 240px;
    aspect-ratio: 4 / 3;
    height: auto;
    background-color: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 12px;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure background image scales dynamically inside 16:9 standard ratio */
.ticker-spark-card[style*="background-image"] {
    background-size: contain ;
    background-position: center ;
    background-repeat: no-repeat ;
}

.ticker-spark-card:hover {
    transform: translateY(-4px);
    border-color: var(--neon-color, #00f2ff);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 
                0 0 20px var(--neon-color, #00f2ff), 
                inset 0 0 10px var(--neon-color, #00f2ff);
}

@keyframes scrollMarqueeRightToLeft {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}
