:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #170f16;
  color: #fff4ed;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-block-size: 100svh;
  margin: 0;
  padding: clamp(.75rem, 3.5vw, 4rem);
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 5%, #442522, transparent 60%);
}

main {
  inline-size: min(100%, 36rem);
  padding: clamp(.875rem, 4vw, 2.25rem);
  container-type: inline-size;
  text-align: center;
  border: 1px solid #60413e;
  border-radius: 1.45rem;
  background: #281b22;
  box-shadow: 0 1.25rem 4rem #100a10a0;
}

.brand {
  margin: 0 0 .85rem;
  font-size: .825rem;
  font-weight: 750;
  letter-spacing: .18em;
  color: #ffbb8d;
}

.offer, .details, #notice { line-height: 1.55; color: #dfc6c5; }
.offer {
  margin: 0 0 1.25rem;
  font-size: clamp(.5rem, 3.5cqi, 1.0625rem);
  white-space: nowrap;
}
.offer strong { color: #fff4ed; }

.balance {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: .35rem .75rem;
  padding: .85rem 0 1.1rem;
  border-top: 1px solid #60413e;
  color: #dfc6c5;
}

.balance output { color: #ffbb8d; font-weight: 750; font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.balance span { font-size: .8rem; }
button, input { font: inherit; }
button {
  min-block-size: 2.75rem;
  border: 0;
  border-radius: .75rem;
  padding: .55rem 1rem;
  background: #ffbb8d;
  color: #27161d;
  font-weight: 750;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #ffd0b1; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #ffecdc; outline-offset: 4px; }
#generate { min-inline-size: min(100%, 10rem); }
#unlock { max-inline-size: 19rem; margin: 0 auto .9rem; }
#unlock label { display: block; margin-block-end: .4rem; color: #dfc6c5; font-size: .85rem; }
.unlock-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.unlock-controls input {
  min-inline-size: 0;
  padding: .6rem;
  border: 1px solid #805c53;
  border-radius: .75rem;
  background: #1a1118;
  color: #fff4ed;
}
.code-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.code-panel label { grid-column: 1 / -1; font-size: .875rem; color: #dfc6c5; }
.code-panel input {
  min-inline-size: 0;
  border: 1px solid #805c53;
  border-radius: .75rem;
  background: #1a1118;
  color: #fff4ed;
  padding: .65rem .45rem;
  font: 700 clamp(.78rem, 3.6vw, 1rem) ui-monospace, monospace;
  text-align: center;
}
.details { max-inline-size: 43ch; margin: 1.1rem auto 0; font-size: .8rem; }
.store-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  max-inline-size: 19rem;
  margin: 1.25rem auto 0;
}
.store-links a {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .55rem;
  padding: .65rem .5rem;
  border: 1px solid #60413e;
  border-radius: .85rem;
  background: #21151b;
  color: #ffbb8d;
  font-size: .85rem;
  font-weight: 700;
}
.store-links a:hover { border-color: #ffbb8d; background: #36232a; }
.store-links img {
  display: block;
  inline-size: min(100%, 6.75rem);
  block-size: auto;
}
#notice { margin: .75rem 0 0; font-size: .9rem; }
#notice:empty { display: none; }

/* Match the Moon Boots flight animation on the Cosmo Steps home page. */
.moon-cursor {
  position: fixed;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  z-index: 9999;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  contain: layout style;
  --boot-scale: 1;
}
.moon-cursor.is-visible { visibility: visible; opacity: 1; }
.moon-flight {
  position: absolute;
  left: -14px;
  top: -17.5px;
  display: flex;
  align-items: center;
  transform-origin: 14px 17.5px;
  animation: moon-flight-bob 3.926991s ease-in-out infinite paused;
  filter: drop-shadow(0 2px 2px #10091070);
}
.moon-flight img {
  width: 28px;
  height: 35px;
  flex: none;
  transform: rotate(62deg);
  animation: moon-flight-rock 3.141593s ease-in-out infinite paused;
}
.moon-cursor.is-visible .moon-flight,
.moon-cursor.is-visible .moon-flight img { animation-play-state: running; }
.moon-cursor.is-link { --boot-scale: 1.08; }
.moon-cursor.is-pressed { --boot-scale: .9; }
@keyframes moon-flight-bob {
  0%, 100% { transform: translateY(-3px) scale(var(--boot-scale)); }
  50% { transform: translateY(3px) scale(var(--boot-scale)); }
}
@keyframes moon-flight-rock {
  0%, 100% { transform: rotate(57deg); }
  50% { transform: rotate(67deg); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html.moon-cursor-ready, html.moon-cursor-ready * { cursor: none !important; }
}
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce), print {
  .moon-cursor { display: none; }
}
