body {
    margin: 0;
    background: #111;
    color: white;
    font-family: Arial;
    overflow: hidden;
}

#scrollBox {
    width: 600px;
    height: 100vh;
    margin: auto;
    z-index: 1000;
    position: relative;
}

#hostBox, 
#joinBox {
    width: 500px;
    margin: 50px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#mainCanvas {
    width: 100%;
    height: auto;
    border: none;
    border-radius: 8px;
}

input,
button,
#cameraSelect  {
    padding: 12px;
    border: none;
    border-radius: 8px;
    box-sizing: border-box;
}

button {
    background: #2196f3;
    color: white;
    cursor: pointer;
}

#cameraSelect  {
    width: 100%;
    padding-right: 45px;
    cursor: pointer;
    appearance: none;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: "▼";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    font-size: 12px;
}

label {
    display: block;
    font-size: 14px;
    color: #ddd;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    accent-color: #2196f3;
}

#chromaColor {
  width: 100%;
  height: 45px;
  padding: 4px;
  border: none;
  border-radius: 10px;
  background: #222;
  cursor: pointer;
}

#chromaThreshold,
#chromaSmoothness {
    width: 100%;
    margin-top: 6px;
    appearance: none;
    height: 8px;
    border-radius: 999px;
    background: #333;
    outline: none;
}

.chroma-group,
.crop-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid #2c2c2c;
  margin-top: 10px;
}

.crop-group input {
    margin-left: 8px;
}

#scene {
    position: fixed;
    width: 100vw;
    height: 100vh;
    inset: 0;
    overflow: hidden;
    background: #111;
}

#scene .image-box {
    position: absolute;
    user-select: none;
    touch-action: none;
    transform-origin: center center;
    cursor: move;
}

#scene .image-box img {
    display: none;
}

#scene .image-box canvas {
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
}

#scene .video-box {
    position: absolute;  
    width: 600px;
    height: auto;
    user-select: none;
    touch-action: none;
    transform-origin: center center;
    cursor: move;
}

#scene .video-box video {
    display: none;
}

#scene .video-box canvas {
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
}

#scene .video-box:active {
    z-index: 999;
}

#menuPopup {
    position: fixed;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);

    z-index: 9999;
}

#menuPopup.show {
    display: flex;
}

.popup-card {
    width: 380px;
    max-width: 90vw;

    background: #1b1b1b;
    border: 1px solid #333;
    border-radius: 20px;

    padding: 24px;

    box-shadow:
        0 20px 50px rgba(0,0,0,.5),
        0 0 0 1px rgba(255,255,255,.03);

    display: flex;
    flex-direction: column;
    gap: 18px;

    animation: popupIn .2s ease;
}

.popup-card h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.popup-card button {
    margin-top: 8px;
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: scale(.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
