body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #000;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100dvh;
  width: 100vw;
}

.container {
  position: relative;
  width: 375px;
  height: 667px;
  overflow: hidden;
  border-radius: 32px;
  background: #111 url('uploads/latest_selfie.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scaleX(-1);
  -webkit-transform: scaleX(-1);
  -moz-transform: scaleY(-1);
  -o-transform: scaleY(-1);
}

.flipped {
  transform: scaleX(-1);
  -webkit-transform: scaleX(-1);
  -moz-transform: scaleY(-1);
  -o-transform: scaleY(-1);
}

.flash-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 101%;
  height: 101%;
  background-color: white;
  opacity: 0.8;
  animation: flash 1s ease-out forwards;
}

@keyframes flash {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

video, canvas, #captured-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 101%;
  height: 101%;
  object-fit: cover;
}

canvas, #captured-image {
  display: none;
}

.capture-upload-button {
  position: absolute;
  bottom: 48px;
  width: 64px;
  height: 64px;
  background-color: #fff;
  color: #000;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  justify-content: center;
  align-items: center;
  display: flex;
}

.capture-upload-button:hover:not(:disabled) {
  transform: scale(1.2);
  transition: transform 0.3s ease;
}

.capture-upload-button:disabled {
  cursor: not-allowed;
}

.click-pop:active {
    animation: pop 1s ease-in-out;
}

@keyframes pop {
    0% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

.tooltip-container {
  position: fixed;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
}

.info-button {
  width: 32px;
  height: 32px;
  color: #afafaf;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.tooltip {
  display: none;
  position: absolute;
  top: 32px;
  right: 0;
  color: #afafaf;
  padding: 8px 8px;
  border-radius: 4px;
  text-align: right;
  font-size: 11px;
  width: 140px;
  animation: fadeIn 0.5s ease;
}

.tooltip-container:hover .tooltip,
.tooltip-container:focus-within .tooltip {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Container for confetti particles */
#confetti-container {
  position: absolute;
  top: 220px;
  left: 0;
  width: 100%; /* Full viewport width */
  height: 100%; /* Full viewport height */
  pointer-events: none; /* Allow clicks to pass through */
  z-index: 9998; /* Ensure it's above other content, but behind the button */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0; /* Start invisible */
  transition: opacity 0.5s ease;
}

/* Confetti particles styling */
.confetti {
  position: absolute;
  width: 4px;
  height: 10px;
  background-color: #afe614; /* Default color */
  opacity: 1;
  animation: confetti-fall 1s;
}

/* Animation for confetti particles */
@keyframes confetti-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--translateX), var(--translateY)) rotate(var(--rotateDeg));
    opacity: 0;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 2dvh;
    overflow:hidden;
    align-items: start;
  }
  .container {
    width: 95vw;
    height: 95dvh;
  }
  .info-button, .tooltip {
    color: #fff;
  }
  .capture-upload-button {
  position: fixed;
  }
  .tooltip-container {
  position: fixed;
  top: 20px;
  right: 20px;
  }
  @keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
  }