:root {
    --primary-color: #d4af37; /* Gold */
    --accent-color: #4facfe; /* Dreamy blue */
    --text-light: #f5f5f5;
    --text-dim: #cccccc;
    --bg-dark: #070708;
    --glass-bg: rgba(15, 15, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Background Layers */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.scene-backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.scene-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: var(--bg-zoom, cover);
    background-position: var(--bg-x, center) var(--bg-y, center);
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    filter: brightness(0.65);
}

.scene-bg.active {
    opacity: 1;
    animation: kenburns 30s infinite alternate ease-in-out;
}

.scene-bg.no-animation {
    animation: none !important;
}

@keyframes kenburns {
    0% {
        transform: scale(1.02) translate(0, 0);
    }
    100% {
        transform: scale(1.12) translate(-1%, -1%);
    }
}

/* Dark Vignette Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(5, 5, 8, 0.8) 100%),
                linear-gradient(to bottom, rgba(5, 5, 8, 0.4) 0%, transparent 20%, transparent 80%, rgba(5, 5, 8, 0.7) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Header & Back Link */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: auto;
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.song-title {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.2rem;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.6rem 1.2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    border-radius: 4px;
}

.back-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(-3px);
}

/* Lyrics Overlay (Center Screen) */
.lyrics-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
    z-index: 5;
    pointer-events: none;
}

.lyric-wrapper {
    min-height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* .lyric-line {
    font-size: 2.2rem;
    line-height: 1.4;
    font-weight: 400;
    color: var(--text-light);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    max-width: 800px;
    font-family: var(--font-body);
} */

.lyric-line {
    font-size: 5.2rem;
    /* line-height: 0.4; */
    font-weight: 400;
    color: var(--text-light);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    /* max-width: 800px; */
    font-family: var(--font-body);
    bottom: 1.8em;
}

.lyric-line.active {
    opacity: 1;
    transform: translateY(0);
}

.lyric-line.exit {
    opacity: 0;
    transform: translateY(-20px);
}

/* Play/Pause Large Overlay (Before start) */
.intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 8, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 1s ease-in-out;
}

.intro-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.intro-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(15px);
    max-width: 500px;
    margin: 1rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.intro-card h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.intro-card p {
    color: var(--text-dim);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.5;
}

.play-large-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.8rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.play-large-btn:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.5);
}

.play-large-btn svg {
    margin-left: 5px; /* Offset for play triangle alignment */
    fill: currentColor;
    width: 32px;
    height: 32px;
}

/* Bottom Player Controls */
.controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 5% 2.5rem;
    z-index: 10;
    background: linear-gradient(to top, rgba(5, 5, 8, 0.9) 0%, rgba(5, 5, 8, 0.5) 60%, transparent 100%);
}

.controls-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.2rem 2rem;
    border-radius: 8px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
}

.progress-container {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    border-radius: 3px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    right: -6px;
    top: -3px;
    width: 12px;
    height: 12px;
    background: var(--text-light);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s ease;
}

.progress-container:hover .progress-handle {
    transform: scale(1.3);
}

.buttons-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.play-pause-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.play-pause-btn:hover {
    border-color: var(--primary-color);
    background: rgba(212, 175, 55, 0.1);
}

.play-pause-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.music-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.music-toggle-btn.muted {
    color: rgba(255, 255, 255, 0.3);
}

.scene-indicator {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* Quick guide / hint */
.guide-hint {
    position: absolute;
    bottom: 1.2rem;
    right: 5%;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 4;
}

/* Web Audio Synth Visual Feedback */
.audio-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.25;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 0 5%;
}

.visualizer-bar {
    width: 10px;
    height: 5px;
    background: var(--accent-color);
    border-radius: 3px 3px 0 0;
    transition: height 0.1s ease;
}

/* Animations and Responsive adaptations */
@media (max-width: 768px) {
    .lyric-line {
        font-size: 1.5rem;
        padding: 0 1.5rem;
    }

    .song-title {
        display: none;
    }

    .controls-card {
        padding: 1rem;
    }
}

/* Framing Panel UI */
.framing-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.6rem 1.2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    border-radius: 4px;
    cursor: pointer;
}

.framing-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.framing-panel {
    position: absolute;
    top: 0;
    right: -380px; /* Start hidden */
    width: 360px;
    height: 100%;
    background: rgba(10, 10, 15, 0.92);
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    z-index: 100;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    color: var(--text-light);
}

.framing-panel.open {
    right: 0;
}

.framing-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.framing-panel-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
}

.close-panel-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-panel-btn:hover {
    color: var(--text-light);
}

.scene-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.scene-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font-body);
    transition: all 0.2s;
    text-align: center;
}

.scene-tab-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}

.scene-tab-btn.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
}

.control-group label span {
    color: var(--primary-color);
    font-family: monospace;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    outline: none;
    border: none;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin: 0.5rem 0;
}

.checkbox-group input {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.panel-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.panel-btn-primary {
    background: var(--primary-color);
    color: var(--bg-dark);
    border-color: var(--primary-color);
    font-weight: bold;
}

.panel-btn-primary:hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

.panel-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.panel-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.css-export-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.css-export-title {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.css-code-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 0.75rem;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--primary-color);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 150px;
    overflow-y: auto;
}


#bg-scene-1 {
    background-size: 150%;
    background-position: 18% 50%;
}

#bg-scene-2 {
    background-position: 50% 86%;
}

#bg-scene-3 {
    background-position: 50% 15%;
}

#bg-scene-6 {
    background-position: 50% 89%;
}