body {
    margin: 0;
    padding: 0;
    background-color: #000;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    color: #00ff00;
}

#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8; /* Increased opacity for better visibility */
    z-index: 1;
    transform: scaleX(-1); /* Mirror the webcam */
}

#output_canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background: rgba(0, 20, 0, 0.8);
    padding: 20px;
    border: 1px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #003300;
    border-top: 4px solid #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Instructions Tooltip */
#instructions-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#info-icon {
    width: 30px;
    height: 30px;
    border: 2px solid #00ff00;
    border-radius: 50%;
    color: #00ff00;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

#info-icon:hover {
    background: #00ff00;
    color: #000;
}

#instructions-panel {
    display: none; /* Hidden by default */
    margin-top: 10px;
    background: rgba(0, 20, 0, 0.9);
    border: 1px solid #00ff00;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    width: 200px;
    text-align: right;
}

#instructions-container:hover #instructions-panel {
    display: block;
}

#instructions-panel h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    border-bottom: 1px solid #004400;
    padding-bottom: 5px;
}

#instructions-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#instructions-panel li {
    font-size: 12px;
    margin-bottom: 5px;
    color: #ccffcc;
}
