:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111;
  color: #f6f1e7;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 30% 10%, rgba(245, 197, 24, 0.18), transparent 28rem),
    #111;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.scanner {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  text-align: center;
  justify-items: center;
}

.mark {
  width: 86px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f5c518;
  color: #111;
  font-weight: 900;
  letter-spacing: 0;
  font-size: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 12vw, 54px);
  line-height: 0.95;
  letter-spacing: 0;
}

.camera-button {
  width: min(100%, 320px);
  min-height: 72px;
  border: 0;
  border-radius: 8px;
  background: #f5c518;
  color: #111;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

.camera-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.camera-button:active {
  transform: translateY(1px);
}

.status {
  min-height: 44px;
  margin: 0;
  color: #cfc8ba;
  line-height: 1.45;
  font-size: 16px;
}

.progress {
  width: min(100%, 320px);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(246, 241, 231, 0.14);
}

.progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #f5c518;
  animation: progress-scan 1.05s ease-in-out infinite;
}

.preview {
  width: min(100%, 420px);
  max-height: min(48vh, 360px);
  overflow: hidden;
  border-radius: 8px;
  background: #1c1c1c;
}

.preview img {
  width: 100%;
  height: 100%;
  max-height: min(48vh, 360px);
  object-fit: contain;
  display: block;
}

@media (orientation: landscape) and (max-height: 520px) {
  .app {
    align-items: start;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .scanner {
    gap: 12px;
  }

  h1 {
    font-size: 34px;
  }

  .camera-button {
    min-height: 56px;
    font-size: 20px;
  }

  .status {
    min-height: 28px;
    font-size: 14px;
  }

  .preview {
    width: min(100%, 520px);
    max-height: 44vh;
  }

  .preview img {
    max-height: 44vh;
  }
}

.result {
  width: min(100%, 320px);
  display: grid;
  gap: 8px;
  padding-top: 6px;
}

.rating {
  color: #f5c518;
  font-size: clamp(64px, 22vw, 94px);
  line-height: 0.9;
  font-weight: 950;
  letter-spacing: 0;
}

.movie-title {
  color: #f6f1e7;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
}

.imdb-link {
  justify-self: center;
  width: 52px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #f5c518;
  color: #111;
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

@keyframes progress-scan {
  0% {
    transform: translateX(-105%);
  }

  50% {
    transform: translateX(85%);
  }

  100% {
    transform: translateX(245%);
  }
}
