* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a0f;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
}

#webgl-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

#ascii-frame {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0a0a0f;
    overflow: hidden;
    box-sizing: border-box;
    /* Width and height set by JavaScript - NEVER change via CSS */
    /* Flexbox centers ASCII content that extends beyond frame edges */
    display: flex;
    align-items: center;
    justify-content: center;
}

#ascii-output {
    font-family: 'Courier New', 'Monaco', monospace;
    white-space: pre;
    line-height: 1;
    letter-spacing: 0;
    color: #ffffff;
    text-align: center;
    /* ASCII content extends beyond frame edges (grid is 40% larger) */
    /* Frame's overflow: hidden clips the excess, hiding any dimension changes */
    width: auto;
    height: auto;
}

video {
    display: none;
}

canvas {
    display: none;
}

canvas#webgl-canvas {
    display: block;
}

.hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    z-index: 10;
    pointer-events: none;
}

.loading {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #ffffff;
    text-align: center;
}

.mode-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.mode-indicator.visible {
    opacity: 1;
}

.record-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #ff4444;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.record-indicator.recording {
    opacity: 1;
}

.record-dot {
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.upload-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.image-mode .upload-btn {
    background: rgba(100, 200, 100, 0.3);
    border-color: rgba(100, 200, 100, 0.6);
}

.gesture-indicator {
    position: fixed;
    bottom: 30px;
    left: 30px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.75);
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 50;
    max-width: 300px;
    text-align: left;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.gesture-indicator.active {
    color: rgba(100, 255, 100, 0.95);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(100, 255, 100, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

