body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    position: relative;
    width: 100%;
    max-width: 177.78vh; /* 16/9 = 1.7778. Limits width so height doesn't overflow viewport */
    height: 56.25vw; /* 9/16 = 0.5625. Sets height based on width */
    max-height: 100vh;
    
    /* Ensure it doesn't exceed viewport dimensions while keeping aspect ratio */
    aspect-ratio: 16 / 9;
    
    /* If aspect-ratio is supported, height/width calculations above are fallbacks or constraints */
    /* We want it to be as big as possible within the viewport */
    width: auto;
    height: auto;
    
    /* Logic to fit in viewport: */
    /* If screen is wider than 16:9, height = 100vh, width = 100vh * 16/9 */
    /* If screen is taller than 16:9, width = 100vw, height = 100vw * 9/16 */
    
    /* Let's use a cleaner approach with aspect-ratio */
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    
    /* This alone doesn't force 16:9. We need the container to BE 16:9 */
}

/* Better approach for fixed aspect ratio container centered in viewport */
.container {
    position: relative;
    width: 100vw;
    height: 56.25vw; /* 100 * 9/16 */
    max-height: 100vh;
    max-width: 177.78vh; /* 100 * 16/9 */
    
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}

.input_video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror the video */
    z-index: 0;
    visibility: hidden; /* Hidden from view, but still active for MediaPipe/Texture */
}

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

.debug_canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 0 5px;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px; /* Pill shape */
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Inter', sans-serif;
}

button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.shortcut {
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    opacity: 0.8;
}

.header {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    z-index: 20; /* Above canvas and debug controls */
    pointer-events: none; /* Let clicks pass through */
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Optional: make it circular */
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

h1.title {
    font-family: 'Inter', sans-serif; /* Assuming system font or imported */
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8); /* Red glow for theme */
    margin: 0;
}

.github-link {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
}

.github-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

.personal-link {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 20;
    opacity: 0.7;
    font-family: sans-serif;
    color: #fff;
    font-weight: bold;
    transition: opacity 0.3s, transform 0.3s;
}
.personal-link:hover {
    opacity: 1;
    transform: scale(1.1);
}