
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  .camcontainer {
    width: 50%;              /* ADJUST: Container width (100% fills parent div) */
    max-width: 600px;         /* ADJUST: Maximum width of camera (change to your preference) */
    margin: 0 auto;           /* Centers the container */
    position: relative;
    aspect-ratio: 16/9;       /* Maintains video proportions */
    background: #000;         /* Background color behind video */
    border: 3px solid #333;   /* ADJUST: Border thickness and color */
    border-radius: 8px;       /* ADJUST: Rounded corners (0 for sharp corners) */
    overflow: hidden;         /* Keeps video inside rounded corners */
  }
  
  video {
    width: 100%;              /* Fill container width */
    height: 100%;             /* Fill container height */
    object-fit: contain;      /* ADJUST: 'contain' = fit inside, 'cover' = fill/crop */
    display: block;
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.1s ease;
  }
  
  video.activecam {
    opacity: 1;
    z-index: 2;
  }
  
  video.inactivecam {
    opacity: 0;
    z-index: 1;
  }
  
  .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 10;
  }
  
  .spinner.show {
    display: block;
  }
  
  @keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
  }
