*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


* {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  outline: none;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 100%;
  line-height: 1.5;
}

*:active,
*:focus {
  outline: none !important;
  box-shadow: none !important;
}

body {
  font-family: Arial, sans-serif;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100svh;
  aspect-ratio: 9 / 16;
  max-width: 100%;
}


body {
  height: 100%;
  width: 100%;
  display: flex;
  justify-self: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  background-color: #000;
}

.step1,
.step1-wrapper,
.result,
.result-wrapper,
.camera-wrapper,
.btns-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.btns-wrapper {
  position: absolute;
  bottom: 30%;
  left: 28%;
}

.step1,
.result {
  width: 100%;
  height: 100%;
}

.result-frame {
  position: absolute;
  width: 70%;
  top: 4%;
}

.result-frame.pic {
  position: absolute;
  width: 65%;
  top: 1%;
}

.step1-btn {
  position: absolute;
  bottom: 13%;
  width: 38%;
  height: 25%;
  z-index: 999;
}

.share {
  position: absolute;
  width: 24%;
  height: 12%;
  bottom: 8%;
  right : 10%

}

.download {
  position: absolute;
  width: 24%;
  height: 12%;
  bottom: 8%;
}

.retake {
  position: absolute;
  width: 24%;
  height: 12%;
  bottom: 8%;
  left : 10%
}

.toggle-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  height: 50px;
  width: 100%;
}

.toggle-button {
  margin-right: -5px;
  background: transparent;
  border: none;
  color: white;
  font-weight: bold;
  font-size: 10px;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.indicator {
  position: absolute;
  width: 58px;
  height: 22px;
  border-radius: 20px;
  border: 2px solid white;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateX(35px);
  background: transparent;
  transition: transform 0.3s ease;
  z-index: 1;
}

.camera-controls {
  position: absolute;
  bottom: 23%;
  left: 0;
  width: 100%;
  height: 8%;
  /* background-color: rgba(0, 0, 0, 0.2); */
  display: flex;
  align-items: center;
  justify-content: center;
}

.capture-btn {
  width: 12%;
  position: absolute;
  align-self: center;
}

.switch-btn {
  width: 8.5%;
  position: absolute;
  right: 33%;
}

.recording-btn {
  width: 12%;
  position: absolute;
  align-self: center;
}

.result-pic {
  position: absolute;
  width: 60%;
  z-index: 2;
  top: 12%;
  border: 1px solid #fff;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2); /* X偏移 Y偏移 模糊 顏色 */
  /* box-shadow: 0 0 10px 8px rgba(44, 179, 180, 1); */
}

.result-video {
  position: absolute;
  width: 60%;
  z-index: 2;
  top: 12%;
  border: 1px solid #fff;
  /* box-shadow: 0 0 10px 8px rgba(44, 179, 180, 1);
   */

  box-shadow: 0 8px 16px rgba(0,0,0,0.2); /* X偏移 Y偏移 模糊 顏色 */
}

.loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  /* 黑色透明背景 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #ffffff33;
  border-top: 6px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}


.hidden {
  display: none;
}

.mirror {
  transform: scaleX(-1);
}


@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
