:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --accent-color: #03dac6;
    --error-color: #cf6679;
    --button-off: #333333;
    --button-on: #bb86fc;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* Prevent scrolling */
}

header {
    background-color: #1f1f1f;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 100;
}

h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    /* Aspect ratio preservation is handled by JS resizing or simplified CSS */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hide the raw video element, we only show the canvas */
.input_video {
    display: none;
}

.output_canvas {
    width: 100%;
    height: auto;
    max-height: 80vh; /* Leave room for controls */
    object-fit: contain;
    background-color: #000;
    border-radius: 8px;
}

#loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    font-size: 1.2rem;
    pointer-events: none;
}

#error-message {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--error-color);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
}

.controls {
    padding: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 100;
}

button {
    background-color: var(--button-off);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: background-color 0.3s, transform 0.1s;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    transform: scale(0.95);
}

button.on {
    background-color: var(--button-on);
    color: #000;
    font-weight: bold;
}
