:root {
    --bg-color: #0d0d0f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --font-heading: system-ui, -apple-system, sans-serif;
}

body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg-color); font-family: var(--font-heading); }
#canvas-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }

#loading-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #0d0d0f; z-index: 100;
    display: flex; justify-content: center; align-items: center;
    color: white; font-weight: bold; letter-spacing: 1px;
    transition: opacity 0.5s;
}

#ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
.hidden { opacity: 0 !important; pointer-events: none; }

#title-card {
    position: absolute; top: 40%; left: 10%; transform: translateY(-50%);
    color: var(--text-primary); transition: opacity 1s, transform 1s;
}
#title-card h1 { font-size: 4rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1; text-transform: uppercase; }
#title-card h2 { font-size: 1.5rem; font-weight: 400; color: var(--text-secondary); margin-top: 1rem; }

#legend-pill {
    position: absolute; top: 2rem; left: 2rem;
    background: rgba(42, 42, 53, 0.8); backdrop-filter: blur(10px);
    padding: 0.75rem 1.25rem; border-radius: 99px;
    display: flex; gap: 1rem; border: 1px solid rgba(255,255,255,0.1);
    transition: opacity 0.5s;
}
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; }

#chapter-box {
    position: absolute; bottom: 12%; left: 5%;
    color: var(--text-primary); transition: opacity 0.5s;
}
.chapter-line { width: 40px; height: 4px; background: currentColor; margin-bottom: 0.5rem; }
#chapter-title { font-size: 3rem; margin: 0; font-weight: 800; }
#chapter-desc { font-size: 1rem; color: var(--text-secondary); margin: 0.25rem 0 0 0; }

#vox-card {
    position: absolute; width: 280px;
    background: rgba(13, 13, 15, 0.9); border: 1px solid rgba(255,255,255,0.2);
    padding: 1.5rem; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    color: var(--text-primary); top: 30%; right: 10%;
    transition: opacity 0.5s;
}
.leader-line { position: absolute; top: 100%; left: 50%; width: 2px; height: 40px; background: rgba(255,255,255,0.5); }
#vox-bullets { padding-left: 1.2rem; margin: 0; font-size: 0.9rem; line-height: 1.5; color: #e0e0e0; }

#end-frame {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; color: var(--text-primary);
}
#end-frame h1 { font-size: 3.5rem; margin-bottom: 1rem; }

#controls-bottom {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 2rem; box-sizing: border-box;
    display: flex; justify-content: space-between; align-items: end;
    pointer-events: none;
}

#timeline-container {
    flex-grow: 1; height: 4px; background: rgba(255,255,255,0.1);
    margin-right: 2rem; border-radius: 2px; overflow: hidden;
}
#timeline-bar {
    width: 0%; height: 100%; background: var(--text-primary);
}

button {
    background: var(--text-primary); color: var(--bg-color); border: none;
    padding: 0.8rem 1.5rem; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; pointer-events: auto;
}
#btn-skip { background: transparent; color: var(--text-secondary); border: 1px solid var(--text-secondary); }
#btn-skip:hover { color: white; border-color: white; }

#tooltip {
    position: absolute; background: rgba(0,0,0,0.8); color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px; pointer-events: none; transform: translate(-50%, -100%); margin-top: -10px;
}

@media (max-width: 768px) {
    #title-card h1 { font-size: 2.5rem; }
    #legend-pill { display: none; }
}
