:root {
  --ink: #1f2d25;
  --muted: #657369;
  --cream: #edf2e9;
  --paper: #f8faf5;
  --green: #4f725c;
  --orange: #78947b;
  --line: #c8d3c6;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family:
    "Noto Sans",
    Helvetica,
    Arial,
    sans-serif;
}
body {
  min-height: 100dvh;
}
header {
  height: 76px;
  display: flex;
  align-items: center;
  padding: 0 max(22px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
h1 {
  font-size: 15px;
  margin: 0;
  letter-spacing: 0.02em;
}
header p {
  font-size: 11px;
  margin: 2px 0 0;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.screen {
  display: none;
  max-width: 560px;
  margin: auto;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
}
.screen.active {
  display: block;
}
.intro {
  padding: 3vh 0 28px;
}
.eyebrow,
.step span {
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 800;
  color: var(--orange);
}
h2 {
  font-size: clamp(42px, 12vw, 64px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  margin: 12px 0 18px;
}
.intro p,
.result p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 430px;
}
.photo-picker {
  height: 220px;
  border: 1.5px dashed #91a393;
  border-radius: 4px;
  background: rgba(248, 250, 245, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-picker input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.picker-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 30px;
  font-weight: 200;
  margin-bottom: 14px;
}
.photo-picker strong {
  font-size: 20px;
  font-weight: 500;
}
.photo-picker small {
  margin-top: 6px;
  color: var(--muted);
}
.step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.step strong {
  font-size: 18px;
  font-weight: 500;
}
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3/2;
  background: #161815;
  overflow: hidden;
  border-radius: 4px;
  touch-action: none;
  box-shadow: 0 12px 30px #263b2d20;
}
.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 7px 11px;
  background: #111a;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: none;
  transition: opacity 0.3s;
}
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
}
.controls input {
  min-width: 0;
  flex: 1;
  accent-color: var(--green);
}
button {
  font: inherit;
  border: 0;
  cursor: pointer;
}
.round {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  font-size: 21px;
  color: var(--ink);
}
.rotate {
  margin-left: 4px;
}
.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.primary,
.secondary {
  height: 54px;
  border-radius: 4px;
  font-weight: 750;
}
.primary {
  flex: 1;
  background: var(--green);
  color: #fff;
  padding: 0 22px;
}
.primary:disabled {
  opacity: 0.55;
}
.secondary {
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
}
.paper {
  margin: 12px 0 28px;
}
.paper img {
  display: block;
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  border: 0;
}
.summary {
  border-top: 1px solid var(--line);
}
.summary div {
  display: flex;
  justify-content: space-between;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.summary span {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 800;
}
.notice {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 18px;
}
.result {
  text-align: center;
  padding-top: 9vh;
}
.check {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 25px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 37px;
}
.result h2 {
  margin-top: 14px;
}
.result p {
  margin: 0 auto 35px;
}
.result .primary {
  width: 100%;
  max-width: 360px;
}
.loading {
  position: relative;
  color: transparent !important;
}
.loading:after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #fff6;
  border-top-color: #fff;
  border-radius: 50%;
  left: calc(50% - 10px);
  top: calc(50% - 10px);
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#toast {
  position: fixed;
  z-index: 5;
  left: 20px;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: 500px;
  margin: auto;
  background: #7b3028;
  color: #fff;
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 8px 30px #0003;
  transform: translateY(calc(100% + 40px + env(safe-area-inset-bottom)));
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.25s,
    opacity 0.2s,
    visibility 0s linear 0.25s;
}
#toast.show {
  transform: none;
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}
@media (min-width: 700px) {
  header {
    padding-left: calc((100% - 560px) / 2);
  }
  .screen {
    padding-top: 42px;
  }
}
