/* Base Reset */
body, html { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    height: 100%; 
    background: #000; 
    overflow: hidden; 
    color: #00FF00; 
    font-family: 'Courier New', Courier, monospace; 
}

/* The Main Hero UI */
#mainUI {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    text-align: center;
    transition: opacity 0.4s ease-in-out;
    max-height: 90vh;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
    width: 90%;
    max-width: 500px;
}

#captureBtn {
    background: rgba(0, 20, 0, 0.6);
    color: #00FF41;
    font-family: inherit;
    font-size: 1.2rem;
    letter-spacing: 2px;
    padding: 16px 28px;
    border: 2px solid #00FF41;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    transition: all 0.2s ease;
    width: 100%;
}

#captureBtn:hover {
    background: #00FF41;
    color: #000;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.6);
}

/* Controls Container */
#controls {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.control-group label {
    font-size: 0.8rem;
    color: #008f11;
    white-space: nowrap;
}

/* Floating Overlay Bar (Bottom Center) */
#floatingOverlay {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 350;
    display: flex;
    gap: 12px;
}

.overlay-btn {
    background: rgba(0, 0, 0, 0.85);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 10px 18px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rec-btn {
    color: #ff4444;
    border: 1px solid #ff4444;
}

.rec-btn:hover {
    background: #ff4444;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
}

.stop-btn {
    color: #ffaa00;
    border: 1px solid #ffaa00;
}

.stop-btn:hover {
    background: #ffaa00;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
}

/* Pulsing red dot applied ONLY when recording actively starts */
.rec-active {
    animation: pulse-red 1.2s infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.snap-btn {
    color: #00ffff;
    border: 1px solid #00ffff;
}

.snap-btn:hover {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

/* The Matrix Display */
#viewCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; 
    height: 100vh;
    image-rendering: -moz-crisp-edges;
    image-rendering: pixelated;
    will-change: transform;
    transform: translateZ(0); 
}

#fpsCounter { 
    position: absolute; 
    bottom: 8px; 
    right: 8px; 
    z-index: 300;
    background: #000;
    color: #00FF00; 
    padding: 2px 8px;
    border: 1px solid #004400;
    font-size: 0.7rem;
    opacity: 0.8;
    pointer-events: none;
    contain: paint; 
    min-width: 120px;
    text-align: center;
}

/* Form Controls */
input, select { 
    background: #111; 
    border: 1px solid #008f11; 
    color: #00FF41; 
    padding: 4px; 
    outline: none;
    font-family: inherit;
    font-size: 0.75rem;
    max-width: 180px;
}

/* Utility classes */
.hidden { display: none !important; }

/* Node Embed Mode */
body.iframe-mode #viewCanvas { display: none !important; }

body.iframe-mode #mainUI {
    top: 0; left: 0;
    transform: none;
    width: 100%; height: 100%;
    max-height: 100vh;
    padding: 8px;
    display: block !important;
    opacity: 1 !important;
    background: #000;
}

body.iframe-mode #standalone-hero { display: none !important; }

#nodeSyncBtn {
    display: none;
    background: #002200;
    color: #00FF41;
    border: 1px solid #00FF41;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

#nodeSyncBtn:hover {
    background: #00FF41;
    color: #000;
}

body.iframe-mode #nodeSyncBtn { display: block; }