:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  background: #1b0d1b;
  color: #ffe8f1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-block-size: 100svh;
  display: grid;
  place-items: center;
}

.voucher { inline-size: min(100%, 150svh); }

.canvas {
  position: relative;
  container-type: inline-size;
}

.artwork {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#code,
.download-button {
  position: absolute;
  inset-inline-start: var(--left);
  inset-block-start: var(--center);
  transform: translateY(-50%);
  inline-size: var(--width);
  block-size: max(var(--height), 24px);
  border: 0;
  margin: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

#code {
  --left: 34.44%;
  --center: 52.54%;
  --width: 31.05%;
  --height: 6.64%;
  border-radius: 1.25cqw;
  padding: 0 1.43cqw;
  color: #311427;
  font: 700 clamp(16px, 2.08cqw, 32px)/1 system-ui, sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
}

#code::placeholder { color: transparent; }

#code:focus,
#code:not(:placeholder-shown) {
  background: #fff0eb;
  box-shadow: inset 0 0 0 max(1px, .15cqw) #aa8c8e;
}

#code:focus::placeholder { color: #856a73; }

.download-button {
  --left: 34.24%;
  --center: 62.695%;
  --width: 31.51%;
  --height: 7.23%;
  border-radius: 2.2cqw;
  cursor: pointer;
}

.download-button:hover { background: #fff2; }
.download-button:disabled { background: #34142866; cursor: wait; }
:focus-visible { outline: 3px solid #ce648e; outline-offset: 3px; }

.feedback {
  color: #ffe8f1;
  text-align: center;
  padding-inline: 1rem;
  overflow-wrap: anywhere;
}

#status:empty { margin: 0; }
#retry { color: inherit; display: inline-block; margin: 0 0 1rem; }
#retry[hidden] { display: none; }

