:root {
  color-scheme: light dark;
  --ink: #291459;
  --muted: #725b83;
  --paper: #fffaf2;
  --white: #fff;
  --line: #d5c1d5;
  --lilac: #ddc6ec;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.65;
}
a {
  color: inherit;
  text-underline-offset: 5px;
}
header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: auto;
  padding: 24px;
}
header > a:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}
header > a:last-child {
  font-size: 14px;
}
main {
  max-width: 1080px;
  padding: 24px;
  margin: auto;
}
h1 {
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.04em;
  margin: 0 0 24px;
}
h2 {
  font-size: 28px;
  line-height: 1.2;
}
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 32px;
  padding: 20px 0 40px;
}
.hero-art {
  max-width: 100%;
  height: auto;
}
.lead {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.4;
}
.personalize {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  border-block: 1px solid var(--line);
  padding-block: 36px;
}
label {
  display: block;
  font-weight: 700;
  margin: 12px 0;
}
input,
textarea,
select {
  display: block;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  padding: 12px;
  min-height: 48px;
  margin-top: 6px;
}
textarea {
  resize: vertical;
}
.names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
button {
  font: inherit;
  font-weight: 700;
  color: #291459;
  background: #ddc6ec;
  border: 2px solid #a67c9e;
  border-radius: 32px;
  padding: 14px 24px;
  min-height: 48px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #754d98;
  outline-offset: 4px;
}
.fine {
  font-size: 14px;
  color: var(--muted);
}
.accept {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}
.accept input {
  width: 22px;
  min-height: 22px;
  flex-shrink: 0;
}
.card {
  max-width: 640px;
  margin: 36px auto;
  padding: 32px;
  text-align: center;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 28px;
  overflow-wrap: anywhere;
}
.card img {
  max-width: 55%;
  height: auto;
}
.card .brand {
  font-size: 20px;
  font-weight: 800;
}
.card .brand span {
  color: #9b6bb2;
}
#card-message {
  white-space: pre-line;
  font-size: 21px;
}
#card-code {
  font-family: monospace;
  letter-spacing: 0.05em;
  font-size: 19px;
}
#watermark {
  font-size: 14px;
  color: var(--muted);
}
.redeem-url {
  font-size: 13px;
}
#print {
  display: block;
  margin: 20px auto;
}
.help {
  margin: 44px 0 16px;
  max-width: 650px;
}
footer {
  border-top: 1px solid var(--line);
  font-size: 14px;
  flex-wrap: wrap;
}
[hidden] {
  display: none !important;
}
#status {
  color: var(--muted);
}
@media (max-width: 640px) {
  header {
    padding: 16px;
    align-items: flex-start;
  }
  header > a:first-child {
    font-size: 20px;
  }
  header img {
    width: 34px;
    height: 34px;
  }
  header > a:last-child {
    max-width: 130px;
    text-align: end;
    font-size: 13px;
  }
  main {
    padding: 20px;
  }
  .hero {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 24px;
  }
  .hero-art {
    width: 230px;
    order: -1;
  }
  .personalize {
    display: block;
    padding-block: 20px;
  }
  .names {
    display: block;
  }
  .card {
    padding: 22px 18px;
  }
  .card h2 {
    font-size: 24px;
  }
  footer {
    padding: 20px;
  }
  .help h2 {
    font-size: 25px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4eafa;
    --muted: #cdbedb;
    --paper: #221a31;
    --white: #30243e;
    --line: #755d85;
  }
  .hero-art,
  .card img {
    filter: none;
  }
}
@page {
  size: A4 portrait;
  margin: 16mm;
}
@media print {
  body {
    background: #fff;
    color: #291459;
  }
  header,
  .hero,
  .personalize,
  .help,
  footer,
  #print {
    display: none !important;
  }
  main {
    padding: 0;
  }
  .card {
    display: block !important;
    margin: 0 auto;
    max-width: 170mm;
    min-height: 220mm;
    border-color: #b48bae;
    background: #fff;
    color: #291459;
    break-inside: avoid;
  }
  .card .fine,
  #watermark {
    color: #725b83;
  }
  .card img {
    width: 65mm;
  }
  .card h2 {
    font-size: 28px;
  }
  #card-message {
    font-size: 22px;
  }
}
@media print {
  .card {
    padding: 10mm;
  }
  .card img {
    width: 50mm;
  }
  .card h2 {
    font-size: 24px;
  }
  .card p {
    margin: 12px 0;
    line-height: 1.4;
  }
  #card-message {
    font-size: 18px;
    line-height: 1.5;
  }
  #card-code {
    font-size: 16px;
  }
  .card .fine {
    font-size: 12px;
  }
}
