html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #fff;
}

body {
  color: #8B0000;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
  height: 100vh;
  width: 100vw;
}

h1 {
  margin-top: 18px;
  margin-bottom: 10px;
  font-size: 1.5rem;
  color: #8B0000;
  letter-spacing: 1px;
  font-weight: 700;
}

.photo-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Portrait aspect ratio: 3:4 */
  width: 70vw;
  max-width: 370px;
  aspect-ratio: 3/4;
  min-width: 220px;
  min-height: 300px;
  margin: 0 auto 0 auto;
  background: #fff;
  border-radius: 18px;
  border: 3px solid #8B0000;
  box-shadow: 0 4px 24px rgba(139,0,0,0.12);
  overflow: hidden;
}

video, canvas, #photo {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: none;
}

video {
  display: block;
}

#photo {
  display: none;
}

.controls {
  width: 100vw;
  display: none;
  flex-direction: row;
  justify-content: center;
  margin-top: 18px;
  gap: 12px;
}

button {
  margin: 0 8px;
  padding: 14px 28px;
  font-size: 1.1rem;
  border: none;
  border-radius: 24px;
  background: linear-gradient(90deg, #8B0000 80%, #b22222 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(139,0,0,0.08);
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
}

button:active {
  background: #b22222;
  transform: scale(0.97);
}

#uploadBtn {
  background: linear-gradient(90deg, #b22222 80%, #8B0000 100%);
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.2rem;
    margin-top: 10px;
  }
  .photo-container {
    width: 90vw;
    max-width: 98vw;
    aspect-ratio: 3/4;
    min-width: 180px;
    min-height: 240px;
    max-height: 80vh;
  }
  video, canvas, #photo {
    border-radius: 18px;
  }
  button {
    font-size: 1rem;
    padding: 12px 18px;
  }
}

@media (orientation: landscape) {
  .photo-container {
    width: 60vw;
    max-width: 80vw;
    aspect-ratio: 4/3;
    min-width: 180px;
    min-height: 140px;
    max-height: 70vh;
  }
}