* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #000;
  color: white;
  overflow: hidden;
}

#startScreen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 1s ease;
  pointer-events: none;
}

#startScreen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#startScreen.fade-out {
  opacity: 0;
}

#startScreen.hidden {
  display: none;
}

.app {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* LEFT SIDE CAMERA */
.camera-section {
  width: 50%;
  height: 100vh;
  background: black;
  padding: 0;
  margin: 0;
}

.camera-box {
  position: relative;
  width: 100%;
  height: 100%;
  background: black;
  overflow: hidden;
}

/* CAMERA CANVAS */
video,
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#webcam {
  display: none;
}

#canvas {
  transform: none;
}

/* SMALL CAMERA CAPTION */
.camera-label {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  display: flex;
  gap: 10px;
  align-items: center;
}

#statusText {
  margin: 0;
  font-size: 15px;
  opacity: 0.9;
  max-width: 360px;
}

#statusDot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ff4e4e;
  box-shadow: 0 0 14px #ff4e4e;
  flex-shrink: 0;
}

/* RIGHT SIDE IMAGE AREA */
.reaction-section {
  width: 50%;
  height: 100vh;
  background: #111;
  padding: 0;
  margin: 0;
}

.reaction-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: black;
  overflow: hidden;
}

#reactionImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* INSTRUCTION IMAGE */
#instructionOverlay {
  position: absolute;
  inset: 0;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instructions-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .camera-section,
  .reaction-section {
    width: 100%;
    height: 100vh;
  }
}