:root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --accent-color: #ff0055;
    /* Glitch neon pink */
    --accent-secondary: #00ffcc;
    /* Glitch neon cyan */
    --heading-font: 'Arial Black', sans-serif;
    --body-font: 'Courier New', Courier, monospace;
    --spacing-unit: 1.5rem;
    --border-color: #333;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    line-height: 1.6;
    margin: 0;
    padding: 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #222;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

/* Typography & Titles */
h1,
h2,
h3 {
    font-family: var(--heading-font);
    text-transform: uppercase;
    letter-spacing: 2px;
}

header {
    text-align: center;
    margin-bottom: 4rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 2rem;
}

.title-main {
    font-size: 4rem;
    line-height: 1;
    margin: 0;
    position: relative;
    color: var(--text-color);
    text-shadow: 2px 2px var(--accent-color), -2px -2px var(--accent-secondary);
    animation: glitch 2s infinite;
}

.subtitle {
    font-size: 1.2rem;
    font-style: italic;
    color: #888;
    margin-top: 0.5rem;
}

.metadata {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #aaa;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.metadata span {
    margin: 0 1rem;
    display: inline-block;
}

/* Scene Headers */
.scene-header {
    background: #333;
    color: #fff;
    padding: 0.5rem 1rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--accent-color);
    font-weight: bold;
}

/* Script Elements */
.action-block {
    margin-bottom: 1.5rem;
}

.visual {
    font-weight: bold;
    color: #ffd700;
    /* Gold for visual cues */
    display: block;
    margin-bottom: 0.5rem;
}

.visual-image {
    display: block;
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 1rem 0;
    border: 1px solid #444;
    opacity: 0.8;
    background-color: #000;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.visual-image:hover {
    opacity: 1;
}

.image-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
}

.image-row .visual-image {
    width: 48%;
    /* Slightly less than 50% to account for gap */
    margin: 0;
    /* Override default margin */
}

/* Explanation / Meta Block */
.explanation-block {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent-secondary);
    padding: 1rem;
    margin: 1.5rem 0;
    font-family: sans-serif;
    font-size: 0.9rem;
    color: #ccc;
}

.explanation-title {
    font-weight: bold;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    display: block;
    text-transform: uppercase;
}

/* Lightbox Styles */
#lightbox {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#lightbox.active {
    opacity: 1;
    visibility: visible;
}

#lightbox img,
#lightbox video {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    border: 2px solid #333;
    display: none;
    /* Hidden by default, toggled via JS */
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.audio {
    font-weight: bold;
    color: #00ced1;
    /* Cyan for audio cues */
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.dialogue-block {
    margin: 1.5rem auto;
    width: 60%;
    text-align: center;
}

.character {
    font-weight: bold;
    display: block;
    margin-bottom: 0.2rem;
}

.parenthetical {
    font-style: italic;
    font-size: 0.9em;
    display: block;
    margin-bottom: 0.2rem;
    color: #bbb;
}

.speech {
    display: block;
}

.transition {
    text-align: right;
    font-weight: bold;
    margin: 2rem 0;
    text-decoration: underline;
    color: #888;
}

/* Lists within script (e.g., montage) */
.script-list {
    list-style-type: none;
    padding-left: 1rem;
    border-left: 2px solid #444;
    margin: 1rem 0;
}

.script-list li {
    margin-bottom: 1rem;
}

/* Glitch Animation */
@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)
    }
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .title-main {
        font-size: 2.5rem;
    }

    .dialogue-block {
        width: 100%;
        text-align: left;
        padding-left: 1rem;
        border-left: 3px solid #444;
    }
}