/* --- Core Layout --- */
body { 
    margin: 0; 
    overflow: hidden; 
    background-color: #000; 
    font-family: 'Cinzel', serif; 
    user-select: none;
}

/* --- Top Header UI --- */
#ui { 
    position: absolute; 
    top: 5%; 
    width: 100%; 
    text-align: center; 
    color: #fff; 
    pointer-events: none; 
    z-index: 10; 
}

h1 { 
    font-size: 2.5rem; 
    margin: 0; 
    letter-spacing: 12px; 
    font-weight: 900; 
    background: linear-gradient(to bottom, #fdf5e6, #d4af37); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

#technique-name { 
    font-size: 1rem; 
    color: #d4af37; 
    margin-top: 10px; 
    font-weight: bold; 
    letter-spacing: 5px; 
    text-transform: uppercase; 
    transition: all 0.5s ease; /* Smooth text color transition */
}

/* --- Mana Meter (Right Side) --- */
#mana-container {
    position: absolute; 
    top: 25%; 
    right: 5%; 
    width: 12px; 
    height: 300px;
    border: 1px solid rgba(212, 175, 55, 0.4); 
    background: rgba(20, 20, 20, 0.8); 
    border-radius: 20px; 
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

#mana-fill {
    position: absolute; 
    bottom: 0; 
    width: 100%; 
    height: 20%; /* Controlled by main.js */
    background: linear-gradient(to top, #d4af37, #fff);
    box-shadow: 0 0 20px #d4af37; 
    transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy mana effect */
}

/* --- Video Feedback (Bottom Left) --- */
#video-container {
    position: absolute; 
    bottom: 5%; 
    left: 5%; 
    transform: scaleX(-1); /* Mirror the video for natural movement */
    width: 240px; 
    height: 320px; 
    border: 1px solid rgba(212, 175, 55, 0.3);
    z-index: 20; 
    background: #050505; 
    border-radius: 120px 120px 20px 20px; /* "Tombstone" Frieren shape */
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0.5; 
    filter: sepia(0.4) brightness(1.2); /* Aesthetic anime filter */
}

#output_canvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
}

/* --- WebGL Canvas --- */
canvas:not(#output_canvas) {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* Sits behind UI but above background */
}