:root {
  --bg-1: 32 10 16;
  --bg-2: 10 6 9;
  --panel: 32 28 34;
  --panel-line: 255 255 255;
  --red: 214 44 58;
  --red-deep: 168 30 42;
  --cream: 250 246 236;
  --ink: 22 19 17;
  --muted: 176 166 158;

  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: radial-gradient(ellipse at top, rgb(var(--bg-1)), rgb(var(--bg-2)) 70%);
  color: rgb(var(--cream));
  font-family: 'DM Mono', ui-monospace, monospace;
}

.page {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.page-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(var(--red));
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.page-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.page-lede {
  font-size: 0.82rem;
  color: rgb(var(--muted));
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.machine {
  background: rgb(var(--panel));
  border: 1px solid rgb(var(--panel-line) / 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 24px 50px -24px rgb(0 0 0 / 0.7);
  margin-bottom: 1.75rem;
}

.machine-field {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.seed-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: rgb(var(--cream));
  background: rgb(0 0 0 / 0.35);
  border: 1px solid rgb(var(--panel-line) / 0.1);
  border-radius: 8px;
  outline: none;
  transition: border-color 200ms ease;
}

.seed-input:focus {
  border-color: rgb(var(--red) / 0.6);
}

.seed-input::placeholder {
  color: rgb(var(--muted) / 0.6);
}

.dice-btn {
  flex-shrink: 0;
  width: 2.6rem;
  font-size: 1.1rem;
  background: rgb(var(--panel-line) / 0.06);
  border: 1px solid rgb(var(--panel-line) / 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 150ms var(--ease-out-quad),
    background-color 200ms ease;
}

.dice-btn:hover {
  background: rgb(var(--panel-line) / 0.12);
}

.dice-btn:active {
  transform: scale(0.92) rotate(-8deg);
}

.lever-btn {
  position: relative;
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 3rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(180deg, rgb(var(--red)), rgb(var(--red-deep)));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgb(var(--red) / 0.6);
  transition: transform 150ms var(--ease-out-quad);
}

.lever-knob {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: rgb(var(--cream));
  box-shadow: inset 0 -2px 3px rgb(0 0 0 / 0.25);
}

.lever-btn:active {
  transform: scale(0.98);
}

.strip-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.strip {
  position: relative;
  width: 190px;
  padding: 1.1rem 1.6rem;
  background: rgb(var(--cream));
  border-radius: 6px;
  box-shadow: 0 26px 50px -20px rgb(0 0 0 / 0.55);
  transform: rotate(-1.2deg);
}

.strip::before,
.strip::after {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 10px;
  background-image: radial-gradient(
    circle,
    rgb(var(--bg-2)) 2.5px,
    transparent 2.5px
  );
  background-size: 10px 16px;
  background-repeat: repeat-y;
}

.strip::before {
  left: 0.35rem;
}

.strip::after {
  right: 0.35rem;
}

.frame {
  opacity: 0;
  transform: translateY(10px);
}

.frame.is-revealed {
  animation: frame-in 380ms var(--ease-out-expo) both;
}

@keyframes frame-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .frame.is-revealed {
    animation: frame-fade 200ms ease both;
  }

  @keyframes frame-fade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

.frame:not(:last-child) {
  margin-bottom: 0.85rem;
}

.frame-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgb(var(--ink));
  border-radius: 4px;
  object-fit: contain;
}

.frame-label {
  margin-top: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: rgb(var(--ink) / 0.55);
}

.download-btn {
  padding: 0.7rem 1.4rem;
  font-family: inherit;
  font-size: 0.8rem;
  color: rgb(var(--cream));
  background: none;
  border: 1.5px solid rgb(var(--panel-line) / 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition:
    border-color 200ms ease,
    color 200ms ease,
    transform 150ms var(--ease-out-quad);
}

.download-btn:not(:disabled):hover {
  border-color: rgb(var(--red));
  color: rgb(var(--red));
}

.download-btn:not(:disabled):active {
  transform: scale(0.97);
}

.download-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
