@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=UnifrakturMaguntia&family=Special+Elite&display=swap');

:root {
    /* @tweakable Background color */
    --bg-color: #f0e6d2; /* Parchment-like */
    /* @tweakable Main text color */
    --text-color: #333;
    /* @tweakable First accent color (pinkish) */
    --accent-color-1: #ff3366; /* Absurd pink */
    /* @tweakable Second accent color (blueish) */
    --accent-color-2: #33ccff; /* Contrasting blue */
    /* @tweakable Border color */
    --border-color: #5a4a3a; /* Dark brown */

    /* Animation tweakable values (controlled from JS) */
    /* @tweakable Duration of the text flash effect in seconds */
    --text-flash-duration: 0.8s;
    /* @tweakable Initial scale factor for text flash */
    --text-flash-initial-scale: 3;
    /* @tweakable Final scale factor for text flash */
    --text-flash-final-scale: 2;
    /* @tweakable Initial rotation for text flash (degrees) */
    --text-flash-initial-rotation: -10deg;
    /* @tweakable Final rotation for text flash (degrees) */
    --text-flash-final-rotation: 10deg;
    /* @tweakable Duration of the title card animation in seconds */
    --title-card-duration: 2.5s;
    /* @tweakable Initial Z-depth for title card (CSS length) */
    --title-card-initial-z: 200px;
    /* @tweakable Initial Y-rotation for title card (degrees) */
    --title-card-initial-rotation: 30deg;
    /* @tweakable Duration of the visual flash effect in seconds */
    --visual-flash-duration: 2s;
    /* @tweakable Maximum scale during visual flash */
    --visual-flash-max-scale: 1.1;
    /* @tweakable Maximum brightness during visual flash */
    --visual-flash-max-brightness: 1.5;
    /* @tweakable Maximum contrast during visual flash */
    --visual-flash-max-contrast: 1.5;
    /* @tweakable Max rotation for SVG wobble (degrees) */
    --svg-wobble-rotation: 5deg;
    /* @tweakable Min scale for SVG wobble */
    --svg-wobble-scale-min: 0.9;
    /* @tweakable Max scale for SVG wobble */
    --svg-wobble-scale-max: 1.1;
    /* @tweakable Duration of the end card fade in seconds */
    --end-card-duration: 2s;
    /* @tweakable Duration for AI/Abstract image fade in/out */
    --image-transition-duration: 0.8s;
    /* @tweakable Default trailer duration in seconds */
    --tweak-trailer-duration-default: 20;

    /* Audio normalization tweakable values */
    /* @tweakable Base max gain (volume) for individual sounds */
    --tweak-max-gain-base: 0.12;
    /* @tweakable Volume variation factor (0-1, lower = more consistent) */
    --tweak-volume-variation: 0.3;
    /* @tweakable Minimum relative volume (0-1) */
    --tweak-min-volume-factor: 0.7;
    /* @tweakable Background music volume multiplier */
    --tweak-music-volume-base: 0.08;

    /* Word visualization tweakable values */
    /* @tweakable Grid columns for word placement */
    --tweak-word-viz-grid-cols: 5;
    /* @tweakable Grid rows for word placement */
    --tweak-word-viz-grid-rows: 5;
    /* @tweakable Minimum font size for words (rem) */
    --tweak-word-viz-min-font-size: 0.8;
    /* @tweakable Maximum font size for words (rem) */
    --tweak-word-viz-max-font-size: 2.0;
    /* @tweakable Position jitter within grid cell (%) */
    --tweak-word-viz-position-jitter: 10;
    /* @tweakable Probability of accent color 1 */
    --tweak-word-viz-color1-prob: 0.4;
    /* @tweakable Probability of accent color 2 */
    --tweak-word-viz-color2-prob: 0.3;
    /* @tweakable Max words to display */
    --tweak-word-viz-max-words: 15;
    /* @tweakable Min animation duration (seconds) */
    --tweak-word-viz-min-anim-duration: 4;
    /* @tweakable Max animation duration (seconds) */
    --tweak-word-viz-max-anim-duration: 10;
    /* @tweakable Max drift X (px) */
    --tweak-word-viz-max-drift-x: 20;
    /* @tweakable Max drift Y (px) */
    --tweak-word-viz-max-drift-y: 20;
}

body {
    font-family: 'Courier Prime', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    border-bottom: 3px dashed var(--border-color);
    margin-bottom: 30px;
    position: relative;
    display: flex; /* Use flexbox for layout */
    justify-content: space-between; /* Space out content and controls */
    align-items: center; /* Align items vertically */
    background: repeating-linear-gradient(
        45deg,
        #f0e6d2,
        #f0e6d2 10px,
        #e6dbc9 10px,
        #e6dbc9 20px
    );
}

.header-content {
    flex-grow: 1; /* Allow content to take up space */
    text-align: center; /* Center the title and subtitle */
    margin-right: 70px; /* Add margin to balance controls */
}

.controls {
    display: flex;
    align-items: center;
    position: absolute; /* Position controls absolutely */
    top: 15px;
    right: 15px; /* Align controls to the right */
}

.volume-control {
    display: flex;
    align-items: center;
    position: fixed; /* Position volume absolutely within header */
    top: 15px;
    left: 15px; /* Position volume control to the left */
    z-index: 2000; /* Ensure it's above most other elements */
}

.volume-control label {
    font-size: 1.5rem;
    margin-right: 8px;
    cursor: default; /* Make label non-interactive */
    user-select: none; /* Prevent text selection */
}

.volume-control input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 80px; /* Adjust width as needed */
    height: 8px;
    background: var(--border-color);
    outline: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color-2);
    border: 2px solid var(--bg-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-color-2);
    border: 2px solid var(--bg-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.volume-control input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--accent-color-1);
}

.volume-control input[type="range"]:hover::-moz-range-thumb {
    background: var(--accent-color-1);
}

header h1 {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 3.5rem;
    margin: 0;
    color: var(--accent-color-1);
    text-shadow: 2px 2px var(--accent-color-2);
    animation: flicker 1.5s infinite alternate;
}

header .subtitle {
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    margin-top: 5px;
    color: var(--text-color);
    text-align: center;
    font-style: italic;
}

header .subtitle a {
    color: var(--accent-color-2);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    font-weight: bold;
}

header .subtitle a:hover {
    color: var(--accent-color-1);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    text-decoration: underline;
}

#toggle-tweaks-button,
#regenerate-button {
    font-family: 'Special Elite', cursive;
    font-size: 1.8rem; /* Adjusted size */
    background-color: var(--accent-color-2);
    color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 45px; /* Adjusted size */
    height: 45px; /* Adjusted size */
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.3);
    margin-left: 15px; /* Spacing between buttons */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Remove default padding */
}

#toggle-tweaks-button:hover,
#regenerate-button:hover {
    transform: rotate(360deg) scale(1.1);
    background-color: var(--accent-color-1);
}
#toggle-tweaks-button.active {
    background-color: var(--accent-color-1);
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.4);
}

#toggle-tweaks-button:active,
#regenerate-button:active {
    transform: scale(0.9);
}

#cinema-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px; /* Increased gap */
    padding: 20px;
    perspective: 1000px; /* For 3D effects */
    width: 90%;
    max-width: 1200px;
}

/* Tweaks Panel Styles */
#tweaks-panel {
    width: 90%;
    max-width: 500px;
    background-color: rgba(240, 230, 210, 0.9); /* Semi-transparent parchment */
    border: 3px dashed var(--accent-color-2);
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out, visibility 0.5s ease-out, padding 0.5s ease-out;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    box-sizing: border-box;
}

#tweaks-panel:not(.hidden) {
    max-height: 600px; /* Adjust as needed */
    opacity: 1;
    visibility: visible;
    padding: 15px 20px;
}

#tweaks-panel h2 {
    font-family: 'Special Elite', cursive;
    text-align: center;
    color: var(--accent-color-1);
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 1px 1px var(--accent-color-2);
}

.tweak-control {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.tweak-control label {
    flex-basis: 150px; /* Adjust as needed */
    flex-shrink: 0;
    margin-right: 10px;
    font-weight: bold;
}

.tweak-control input[type="range"],
.tweak-control input[type="number"] {
    flex-grow: 1;
    margin-right: 10px;
    cursor: pointer;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 3px;
}
.tweak-control input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    height: 6px;
    background: var(--border-color);
    outline: none;
    border-radius: 3px;
}
.tweak-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color-1);
    border: 2px solid var(--bg-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}
.tweak-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent-color-1);
    border: 2px solid var(--bg-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}
.tweak-control input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--accent-color-2);
}
.tweak-control input[type="range"]:hover::-moz-range-thumb {
    background: var(--accent-color-2);
}

.tweak-control input[type="number"] {
    width: 60px; /* Fixed width for number input */
    text-align: right;
    flex-grow: 0; /* Don't let it grow */
}

.tweak-control span {
    font-weight: bold;
    min-width: 35px; /* Ensure space for value */
    text-align: right;
    color: var(--accent-color-2);
}

.movie-poster {
    background-color: #fff;
    border: 5px solid var(--border-color);
    padding: 15px;
    width: 250px; /* Slightly larger posters */
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
    position: relative; /* Needed for absolute positioning of details */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.5s ease; /* Bouncy transition */
    cursor: pointer;
    overflow: hidden; /* Hide overflowing details initially */
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d; /* For 3D effects */
    animation: drift 10s infinite linear alternate;
}

.movie-poster:nth-child(odd) {
    animation-duration: 12s;
    transform: rotate(-2deg);
}
.movie-poster:nth-child(even) {
    animation-duration: 8s;
    transform: rotate(3deg);
}

.movie-poster:hover {
    transform: scale(1.08) rotate(0deg) translateZ(30px); /* Lift and straighten on hover */
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
    z-index: 10; /* Bring to front */
}

.poster-visual {
    width: 100%;
    height: 200px;
    background-color: #eee;
    border: 1px dashed var(--accent-color-2);
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.poster-visual svg {
    width: 80%;
    height: 80%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    transform-origin: center center;
    animation: svgWobble 5s infinite ease-in-out alternate;
}
.poster-visual svg * { /* Apply fill/stroke to SVG elements */
     fill: none;
     stroke: var(--text-color);
     stroke-width: 2;
     transition: transform 0.3s ease, fill 0.3s ease, stroke 0.3s ease;
 }

.movie-poster:hover .poster-visual svg {
    animation-play-state: paused; /* Pause wobble on hover */
}
.movie-poster:hover .poster-visual svg *:nth-child(odd) {
    fill: var(--accent-color-1);
    stroke: var(--accent-color-1);
     transform: rotate(15deg) scale(1.1);
}
.movie-poster:hover .poster-visual svg *:nth-child(even) {
    fill: var(--accent-color-2);
    stroke: var(--accent-color-2);
     transform: rotate(-10deg) scale(0.9) translateX(5px);
}

.movie-title {
    font-family: 'Special Elite', cursive;
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.movie-poster:hover .movie-title {
    color: var(--accent-color-1);
    text-shadow: 1px 1px var(--accent-color-2);
}

.play-trailer-button {
    font-family: 'Special Elite', cursive;
    background-color: var(--accent-color-1);
    color: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 8px 15px;
    margin-top: 15px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.2);
}

.play-trailer-button:hover {
    background-color: var(--accent-color-2);
    transform: scale(1.05);
}
.play-trailer-button:active {
    transform: scale(0.95);
}

.movie-details {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 230, 210, 0.95); /* Semi-transparent parchment */
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: rotateY(90deg) translateZ(50px); /* Start flipped */
    transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Flip transition */
    transform-origin: left center;
    font-size: 0.9rem;
    overflow-y: auto;
    z-index: 5; /* Above poster content but below hovered poster */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.movie-poster.flipped .movie-details {
    opacity: 1;
    visibility: visible;
    transform: rotateY(0deg) translateZ(0px); /* Flip into view */
}

.movie-synopsis {
    font-family: 'Courier Prime', monospace;
    line-height: 1.5;
}

#trailer-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Dark overlay */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#trailer-player.hidden {
    opacity: 0;
    visibility: hidden;
}

#trailer-content {
    width: 80%;
    height: 70%;
    max-width: 800px;
    max-height: 600px;
    background-color: var(--bg-color);
    border: 5px dashed var(--accent-color-1);
    position: relative;
    overflow: hidden; /* Clip content */
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 500px; /* For potential 3D effects in scenes */
}

.trailer-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.2;
  pointer-events: none;
}

.trailer-scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  padding: 20px;
  transition: opacity var(--image-transition-duration), transform var(--image-transition-duration);
}

.trailer-scene.end-card {
  z-index: 10;
}

.trailer-scene.loading-scene {
    font-family: 'Special Elite', cursive;
    font-size: 2rem;
    color: var(--accent-color-1);
    background-color: var(--bg-color);
    z-index: 10;
    animation: textFlash 1s infinite alternate;
}

.trailer-scene.text-flash {
    font-family: 'Special Elite', cursive;
    font-size: 4rem;
    color: var(--accent-color-2);
    text-shadow: 3px 3px var(--accent-color-1);
    animation: textFlash var(--text-flash-duration) linear forwards;
}

.trailer-scene.title-card {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 3rem;
    color: var(--text-color);
    line-height: 1.2;
    animation: titleCardZoom var(--title-card-duration) cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.trailer-scene.visual-flash {
    animation: visualFlashEffect var(--visual-flash-duration) ease-in-out forwards;
}
.trailer-scene.visual-flash svg {
    width: 90%;
    height: 90%;
    animation: intenseSvgWobble 1s infinite ease-in-out alternate;
}
.trailer-scene.visual-flash svg * {
    stroke-width: 4; 
    animation: colorCycle 0.5s infinite linear;
}

.trailer-scene.end-card {
    background-color: var(--accent-color-1);
    color: var(--bg-color);
    font-family: 'Courier Prime', monospace;
    font-size: 2.5rem;
    font-weight: bold;
    animation: fadeInOut var(--end-card-duration) ease-in-out forwards; 
}

.trailer-scene.ai-image {
    animation: fadeInOut var(--image-transition-duration) ease-in-out forwards;
    overflow: hidden;
}

.ai-generated-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 3px solid var(--accent-color-1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    animation: aiImageEffect 4s infinite alternate ease-in-out;
    transition: transform 0.5s ease-in-out, filter 0.5s ease-in-out;
}

.trailer-scene.abstract-image {
    animation: fadeInOut var(--image-transition-duration) ease-in-out forwards;
}

.abstract-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.text-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.text-image-container h1 {
    font-family: 'Special Elite', cursive;
    color: var(--accent-color-1);
    text-shadow: 3px 3px var(--accent-color-2);
    text-align: center;
    z-index: 2;
    animation: textImagePulse 3s infinite alternate ease-in-out;
}

.text-decorator {
    position: absolute;
    border-radius: 50%;
    background-color: var(--accent-color-2);
    opacity: 0.3;
    z-index: 1;
    animation: decoratorFloat 4s infinite alternate ease-in-out;
}

.melting-style h1 {
    animation: meltingText 4s infinite alternate;
    filter: blur(1px);
}

.explosive-style h1 {
    animation: explosiveText 2s infinite alternate;
    color: var(--accent-color-2);
    text-shadow: 3px 3px var(--accent-color-1);
}

.silent-style h1 {
    animation: silentText 6s infinite alternate;
    color: var(--text-color);
    filter: grayscale(70%);
}

#close-trailer {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-color-1);
    color: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001; /* Above content */
    transition: transform 0.3s, background-color 0.3s;
}

#close-trailer:hover {
    background-color: var(--accent-color-2);
    transform: rotate(90deg) scale(1.1);
}

/* Word visualization styles */
.word-visualization {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.visualization-word {
    display: inline-block;
    position: absolute;
    padding: 5px;
    transform-origin: center center;
    z-index: 1; /* Ensure words are above background */
    white-space: nowrap;
    font-family: 'Special Elite', cursive;
    user-select: none;
    transform: translate(-50%, -50%);
}

/* Word animations */
@keyframes wordFloat {
    0% { transform: translate(-50%, -50%) rotate(var(--start-rotation, -5deg)) scale(var(--start-scale, 1)); }
    50% { transform: translate(calc(-50% + var(--drift-x, 10) * 1px), calc(-50% + var(--drift-y, -15) * 1px)) 
          rotate(calc(var(--start-rotation, -5deg) * -0.5)) scale(calc(var(--start-scale, 1) * 1.1)); }
    100% { transform: translate(calc(-50% + var(--drift-x, 10) * -0.5px), calc(-50% + var(--drift-y, -15) * -0.8px)) 
           rotate(var(--end-rotation, 5deg)) scale(var(--end-scale, 0.9)); }
}

@keyframes meltingWord {
    0% { transform: translate(-50%, -50%) rotate(-3deg) scale(1); filter: blur(0px); }
    50% { transform: translate(-50%, -40%) rotate(0deg) scale(1.1); filter: blur(1px); }
    100% { transform: translate(-50%, -30%) rotate(2deg) scale(0.95); filter: blur(2px); }
}

@keyframes explodingWord {
    0% { transform: translate(-50%, -50%) scale(0.8) rotate(-2deg); filter: brightness(1); }
    50% { transform: translate(-50%, -50%) scale(1.3) rotate(0deg); filter: brightness(1.5) contrast(1.2); }
    100% { transform: translate(-50%, -50%) scale(1.1) rotate(3deg); filter: brightness(1.2); }
}

.trailer-scene.word-visualization {
    animation: fadeInOut 2s ease-in-out forwards;
}

/* Additional trailer scene styles for varied templates */

/* Glitchy style scenes (for experimental template) */
.trailer-scene.glitchy-style {
    animation: glitchEffect 0.5s infinite steps(2);
    filter: saturate(150%) hue-rotate(5deg);
}

.trailer-scene.glitchy-style h1,
.trailer-scene.glitchy-style text,
.trailer-scene.glitchy-style .text-image-container h1 {
    text-shadow: 3px 0 var(--accent-color-2), -3px 0 var(--accent-color-1);
    animation: textGlitch 0.3s infinite alternate;
}

.trailer-scene.glitchy-style svg * {
    animation: svgGlitch 0.2s infinite alternate;
}

/* Dreamlike style scenes (for surreal template) */
.trailer-scene.dreamlike-style {
    filter: blur(1px) brightness(1.1);
    animation: dreamPulse 4s infinite alternate ease-in-out;
}

.trailer-scene.dreamlike-style h1,
.trailer-scene.dreamlike-style text {
    filter: blur(1px);
    animation: floatingText 6s infinite alternate ease-in-out;
}

/* Immersive style scenes (for sensory template) */
.trailer-scene.immersive-style {
    animation: immersiveScale 4s infinite alternate ease-in-out;
}

.trailer-scene.immersive-style .abstract-image-container svg * {
    animation: slowRotate 8s infinite linear;
}

/* Text-heavy style scenes (for narrative template) */
.trailer-scene.textual-style h1 {
    font-size: 120%;
    line-height: 1.4;
    text-align: left;
    padding: 0 10%;
}

.trailer-scene.textual-style .text-image-container {
    justify-content: flex-start;
    align-items: flex-start;
    padding: 15% 10%;
}

/* Animations */
@keyframes flicker {
    0%, 100% { opacity: 1; transform: skewX(0deg); }
    50% { opacity: 0.8; transform: skewX(2deg); }
}

@keyframes svgWobble {
    0% { transform: rotate(-2deg) scale(1); }
    100% { transform: rotate(2deg) scale(1.02); }
}

@keyframes drift {
     0% { transform: translateY(0px) rotate(-2deg); }
     50% { transform: translateY(-10px) rotate(0deg); }
     100% { transform: translateY(0px) rotate(3deg); }
 }

@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.95); }
    10% { opacity: 1; transform: scale(1); }
    90% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.95); }
}

@keyframes textFlash {
    0% { opacity: 0; transform: scale(var(--text-flash-initial-scale)) rotate(var(--text-flash-initial-rotation)); }
    30% { opacity: 1; transform: scale(1) rotate(var(--text-flash-final-rotation)); }
    70% { opacity: 1; transform: scale(1) rotate(var(--text-flash-initial-rotation)); }
    100% { opacity: 0; transform: scale(var(--text-flash-final-scale)) rotate(var(--text-flash-final-rotation)); }
}

@keyframes titleCardZoom {
    0% { opacity: 0; transform: translateZ(var(--title-card-initial-z)) rotateY(var(--title-card-initial-rotation)); }
    20% { opacity: 1; transform: translateZ(100px) rotateY(15deg); }
    80% { opacity: 1; transform: translateZ(0) rotateY(0deg); }
    100% { opacity: 0; transform: translateZ(-50px) rotateY(-10deg); }
}

@keyframes visualFlashEffect {
    0% { opacity: 0; filter: brightness(0.5) contrast(2); }
    10% { opacity: 1; filter: brightness(1) contrast(1); }
    50% { transform: scale(var(--visual-flash-max-scale)); filter: brightness(var(--visual-flash-max-brightness)) contrast(var(--visual-flash-max-contrast));}
    90% { opacity: 1; filter: brightness(1) contrast(1); }
    100% { opacity: 0; filter: brightness(0.5) contrast(2); }
}

@keyframes intenseSvgWobble {
    0% { transform: rotate(-var(--svg-wobble-rotation)) scale(var(--svg-wobble-scale-min)); }
    50% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(var(--svg-wobble-rotation)) scale(var(--svg-wobble-scale-max)); }
}

@keyframes colorCycle {
    0% { stroke: var(--accent-color-1); fill: none;}
    33% { stroke: var(--accent-color-2); fill: rgba(255, 51, 102, 0.3);}
    66% { stroke: var(--border-color); fill: rgba(51, 204, 255, 0.3);}
    100% { stroke: var(--text-color); fill: none;}
}

@keyframes abstractShape {
    0% { transform: scale(1) rotate(0deg); opacity: 0.5; }
    100% { transform: scale(1.2) rotate(10deg); opacity: 0.8; }
}

@keyframes aiImageEffect {
    0% { filter: brightness(1) contrast(1); }
    50% { filter: brightness(1.1) contrast(1.1) saturate(1.1); }
    100% { filter: brightness(1) contrast(1); }
}

@keyframes textImagePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes decoratorFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(20px, -15px) rotate(20deg); }
}

@keyframes meltingText {
    0% { transform: scale(1); filter: blur(1px); }
    100% { transform: scale(1.05) translateY(10px); filter: blur(3px); }
}

@keyframes explosiveText {
    0% { transform: scale(0.95); text-shadow: 2px 2px var(--accent-color-1); }
    50% { transform: scale(1.1); text-shadow: 4px 4px var(--accent-color-1), -2px -2px var(--accent-color-2); }
    100% { transform: scale(1); text-shadow: 3px 3px var(--accent-color-1); }
}

@keyframes silentText {
    0% { opacity: 0.7; filter: grayscale(70%); }
    100% { opacity: 1; filter: grayscale(30%); }
}

@keyframes glitchEffect {
    0% { transform: translateX(0); filter: brightness(1) contrast(1); }
    25% { transform: translateX(-5px); filter: brightness(1.2) contrast(1.3); }
    50% { transform: translateX(3px); filter: brightness(0.9) contrast(1.1); }
    75% { transform: translateX(-2px); filter: brightness(1.1) contrast(0.9); }
    100% { transform: translateX(0); filter: brightness(1) contrast(1); }
}

@keyframes textGlitch {
    0% { transform: skewX(0deg); }
    20% { transform: skewX(10deg); }
    40% { transform: skewX(-15deg); }
    60% { transform: skewX(15deg); }
    80% { transform: skewX(-5deg); }
    100% { transform: skewX(0deg); }
}

@keyframes svgGlitch {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(2deg); }
    75% { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes dreamPulse {
    0% { opacity: 0.8; filter: blur(1px) brightness(1.0); }
    50% { opacity: 1; filter: blur(1.5px) brightness(1.2); }
    100% { opacity: 0.9; filter: blur(0.5px) brightness(1.1); }
}

@keyframes floatingText {
    0% { transform: translateY(0) rotate(0deg); filter: blur(1px); }
    50% { transform: translateY(-15px) rotate(1deg); filter: blur(2px); }
    100% { transform: translateY(5px) rotate(-1deg); filter: blur(1.5px); }
}

@keyframes immersiveScale {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

@keyframes slowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
     0% { transform: translate(0, 0) rotate(0deg); }
     25% { transform: translate(20px, 50px) rotate(45deg); }
     50% { transform: translate(-30px, -20px) rotate(-30deg); }
     75% { transform: translate(10px, -60px) rotate(90deg); }
     100% { transform: translate(0, 0) rotate(0deg); }
}

body::before, body::after {
    content: '';
    position: fixed; 
    width: 50px;
    height: 50px;
    background-color: var(--accent-color-1);
    border-radius: 50%;
    opacity: 0.3;
    z-index: -1;
    animation: float 20s infinite linear alternate;
}

body::after {
    width: 80px;
    height: 30px;
    background-color: var(--accent-color-2);
    border-radius: 0;
    right: 5%;
    bottom: 15%;
    animation-duration: 25s;
    animation-delay: -5s;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%); 
}
body::before {
     left: 10%;
     top: 20%;
}

/* Add hidden class utility */
.hidden {
    display: none; /* Simple hide, use specific overrides if needed */
}