:root {
    --primary: #F7D51D; /* SpongeBob Yellow */
    --secondary: #FF69B4; /* Patrick Pink */
    --ocean: #1ca3ec;
    --glass: rgba(0, 40, 80, 0.7);
    --border: rgba(255, 255, 255, 0.3);
    --font-stack: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
}

body {
    margin: 0;
    overflow: hidden;
    background: radial-gradient(circle at center, #2b6cb0 0%, #031b4e 100%);
    font-family: var(--font-stack);
    color: white;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#input-video {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

/* UI Overlay */
#ui-layer {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.panel {
    background: var(--glass);
    backdrop-filter: blur(8px);
    padding: 20px;
    border-radius: 20px;
    border: 3px solid var(--border);
    pointer-events: auto;
    width: 280px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.panel:hover {
    transform: scale(1.02);
}

h2 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: var(--primary);
    text-shadow: 2px 2px 0px #000;
    text-align: center;
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

button {
    background: rgba(255,255,255,0.1);
    border: 2px solid var(--border);
    color: #fff;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-stack);
    font-weight: bold;
    font-size: 14px;
}

button:hover {
    background: var(--ocean);
    transform: translateY(-2px);
}

button.active {
    background: var(--primary);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 10px var(--primary);
}

.instruction {
    font-size: 13px;
    color: #ddd;
    line-height: 1.4;
    margin-top: 10px;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 8px;
}

.key-gesture {
    color: var(--primary);
    font-weight: bold;
}

#status {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: var(--primary);
    color: #000;
    padding: 10px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    font-family: var(--font-stack);
}

#camera-preview {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 160px;
    height: 120px;
    z-index: 10;
    border-radius: 15px;
    border: 4px solid var(--border);
    background: #000;
    overflow: hidden;
    transform: scaleX(-1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

#camera-preview canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: var(--primary);
    text-shadow: 2px 2px 4px #000;
}

/* Floating bubbles animation for background */
.bg-bubble {
    position: absolute;
    bottom: -50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
    z-index: 0;
    pointer-events: none;
}
@keyframes rise {
    0% { bottom: -50px; transform: translateX(0); }
    50% { transform: translateX(50px); }
    100% { bottom: 110%; transform: translateX(-50px); }
}