:root {
    --bg-color: #05050a;
    --gold: #ffd700;
    --blue: #00f2ff;
    --text-color: #e0e0e0;
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.7);
    --glow-amber: 0 0 20px rgba(255, 140, 0, 0.6);
    --font-fantasy: 'Cinzel', serif;
    --font-body: 'Almendra', serif;
}

body, html {
    margin: 0; padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    height: 100vh; width: 100vw;
    overflow: hidden;
}

#gateway-container {
    display: flex;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, #0a0a2e 0%, #05050a 100%);
    position: relative;
    z-index: 2;
}

/* Wings */
.wing {
    flex: 1; padding: 40px;
    background: rgba(10, 10, 25, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    overflow: hidden; /* Changed from overflow-y: auto */
    z-index: 10;
    position: relative;
}

.scroll-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.scroll-up {
    animation: scrollUp 30s linear infinite;
}

.scroll-down {
    animation: scrollDown 30s linear infinite;
}

/* Pause on hover so people can read */
.wing:hover .scroll-up,
.wing:hover .scroll-down {
    animation-play-state: paused;
}

@keyframes scrollUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@keyframes scrollDown {
    0% { transform: translateY(-50%); }
    100% { transform: translateY(0); }
}

.scroll-content {
    display: flex;
    flex-direction: column;
}

.wing-left { border-right: 2px solid var(--gold); }
.wing-right { border-left: 2px solid var(--gold); }

.info-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px; margin-bottom: 20px;
    border-left: 3px solid var(--gold);
    transition: 0.3s;
}
.info-card:hover { transform: translateX(10px); background: rgba(255,215,0,0.05); }

/* Center Portal */
#portal-area {
    flex: 2;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

.portal-wrapper {
    text-align: center;
    width: 100%; max-width: 500px;
    z-index: 20;
    /* Apply the slow breathing to the container */
    animation: portal-breath 8s infinite ease-in-out;
}

.portal-svg {
    width: 100%;
    max-width: 450px;
    height: auto;
    aspect-ratio: 2 / 3;
    filter: drop-shadow(0 0 20px var(--glow-gold));
    animation: heart-pulse 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
    /* Allow lightning to draw outside the SVG box */
    overflow: visible !important;
}

/* Breathing Animation: Deep, slow cycle */
@keyframes portal-breath {
    0%, 100% { 
        transform: scale(0.9); 
        filter: brightness(0.8);
    }
    50% { 
        transform: scale(1.1); 
        filter: brightness(1.2);
    }
}

/* Heartbeat Animation: Quick, rhythmic spikes */
@keyframes heart-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px var(--gold)); }
    5% { transform: scale(1.07); filter: drop-shadow(0 0 35px var(--gold)); }
    10% { transform: scale(1); }
    15% { transform: scale(1.1); filter: drop-shadow(0 0 45px var(--gold)); }
    25% { transform: scale(1); }
}

/* Lightning Effect - Smoother and Thinner */
.bolt {
    opacity: 0;
    stroke-width: 1px; /* Thinner lines */
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

/* Individual delays and durations for more natural variety */
.bolt-1 { animation: strike 5s infinite 0.2s; }
.bolt-2 { animation: strike 7s infinite 1.5s; }
.bolt-3 { animation: strike 6s infinite 0.8s; }
.bolt-4 { animation: strike 4s infinite 2.2s; }
.bolt-5 { animation: strike 5.5s infinite 1.2s; }
.bolt-6 { animation: strike 6.5s infinite 0.5s; }

@keyframes strike {
    0% { opacity: 0; stroke-dashoffset: 1000; }
    /* Fast growth */
    2% { opacity: 1; stroke-dashoffset: 0; }
    /* Flickering effect */
    3% { opacity: 0.3; }
    4% { opacity: 1; }
    5% { opacity: 0.2; }
    7% { opacity: 0.8; }
    10% { opacity: 0; stroke-dashoffset: -1000; }
    100% { opacity: 0; stroke-dashoffset: -1000; }
}

.portal-name {
    font-family: var(--font-fantasy);
    color: var(--gold);
    font-size: 2rem;
    text-shadow: var(--glow-gold);
    margin-top: 20px;
}

/* Buttons */
#orbital-nav {
    position: absolute; width: 100%; height: 100%;
    pointer-events: none; top: 0; left: 0;
    z-index: 100; /* Ensure buttons are above everything else */
}

.nav-button {
    position: absolute; pointer-events: auto;
    padding: 15px 20px; /* Increased padding */
    min-width: 100px; /* Ensure a minimum size */
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--gold);
    color: var(--gold);
    border-radius: 5px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    font-family: var(--font-fantasy);
    text-transform: uppercase;
    font-size: 0.8rem;
    box-shadow: var(--glow-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Larger hit area for easier clicking */
.nav-button::after {
    content: '';
    position: absolute;
    top: -15px; left: -15px; right: -15px; bottom: -15px;
}

.nav-button:hover { 
    background: var(--gold); 
    color: #000; 
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 101;
}

@media (max-width: 1200px) { .wing { display: none; } }
