* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Be Vietnam Pro", sans-serif;
  background: #000;
  color: #ffffff;
}

#app {
  position: relative;
  height: 100vh;
  min-height: 840px;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.logo {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.logo img {
  width: 222px;
  height: auto;
}

.hero-text {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
  width: 100%;
  color: #e8f4ff;
}

.hero-text.small {
  top: 12%;
  width: 82%;
}

.hero-text .brand {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 4px;
}

.hero-text .title {
  font-size: 28px;
  font-weight: 700;
  text-transform: none;
}

.hero-text .subtitle {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  font-style: italic;
  line-height: 1.4;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.hero-text .subtitle2 {
  margin-top: 35px;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  font-style: italic;
  line-height: 1.4;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.hero-text p {
  margin: 5px 0 0;
  font-size: 11px;
  font-style: italic;
  line-height: 1.4;
  opacity: 0.9;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.image-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.image-button img {
  width: 200px;
  height: auto;
}

#screen-start #btn-start {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
}

.actions {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 680px;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.actions-row {
  flex-direction: row;
}

.actions-row .image-button img {
  width: 180px;
}

.btn-home {
  position: absolute;
  top: 750px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.btn-home img {
  width: 70px;
  height: auto;
}

.actions label {
  cursor: pointer;
}

.actions input[type="file"] {
  display: none;
}

.slider {
  position: absolute;
  top: 210px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 330px;
  height: 455px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-track {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  position: relative;
  z-index: 4;
}

.slider-track::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.slide {
  scroll-snap-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide img {
  width: 70%;
  height: auto;
  object-fit: cover;
  clip-path: polygon(
    0% 4%,
    7% 0%,
    100% 0%,
    100% 96%,
    92% 100%,
    0% 100%
  );
}

.frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}

.slider-dots {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 4;
}

.slider-dots .dot {
  width: 10px;
  height: 14px;
  border-radius: 50%;
  background: #044ec1;
  border: 1px solid #FFF;
  cursor: pointer;
}

.slider-dots .dot.is-active {
  background: #ffffff;
}

.loading-content {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 72%;
}

.loading-ring {
  --progress: 0deg;
  width: 180px;
  aspect-ratio: 1 / 1;
  background: url("images/loading-1.webp") center/contain no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/loading-2.webp") center/contain no-repeat;
  z-index: 0;
  -webkit-mask: conic-gradient(#000 0deg, #000 var(--progress), transparent var(--progress));
  mask: conic-gradient(#000 0deg, #000 var(--progress), transparent var(--progress));
  transition: mask 0.4s ease, -webkit-mask 0.4s ease;
}

.loading-percent {
  position: relative;
  z-index: 1;
  font-size: 42px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}


.result-board {
  position: absolute;
  top: 210px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 85%;
  max-width: 330px;
  height: 54%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-board .slide {
  position: relative;
  z-index: 3;
}

.result-image {
  position: relative;
  display: block;
  width: 70%;
  height: auto;
  object-fit: cover;
  z-index: 1;
  clip-path: polygon(
    0% 4%,
    8% 0%,
    100% 0%,
    100% 96%,
    92% 100%,
    0% 100%
  );
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: min(90vw, 380px);
  background: #0e0f12;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#camera-video,
#camera-canvas {
  width: 100%;
  border-radius: 12px;
  background: #111;
}

#camera-canvas {
  display: none;
}

.modal-actions {
  display: flex;
}

.modal-actions .image-button img {
  width: 170px;
}

.bottom-button {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hint {
  position: absolute;
  top: 770px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: #e0f2ff;
  z-index: 2;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  font-style: italic;
  width: 90%;
}

.hint.hint1 {
  top: 84%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.toast.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes pulse {
  0% {
    transform: scale(0.98);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(0.98);
  }
}

@media (min-width: 440px) {
  #app {
    min-height: 950px;
  }
}