:root {
  color-scheme: light dark;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #020617;
  color: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(140% 140% at 20% -10%, rgba(56, 189, 248, 0.22), rgba(2, 6, 23, 0.95));
}

.wrap {
  width: min(520px, 100%);
}

.card {
  background: rgba(4, 7, 17, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 26px;
  padding: clamp(2rem, 4vw, 2.6rem);
  display: grid;
  gap: 1.6rem;
  text-align: center;
  box-shadow: 0 28px 72px rgba(2, 6, 23, 0.5);
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  color: #7dd3fc;
  font-weight: 650;
}

h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  line-height: 1.35;
}

.stage {
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.qr-wrapper {
  position: relative;
  width: clamp(240px, 70vw, 360px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.qr-image {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.qr-image.is-visible {
  opacity: 1;
}

.qr-animation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.qr-animation.is-hidden {
  display: none;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.replay {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.replay:hover,
.replay:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(59, 130, 246, 0.25);
}

.note {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5f5;
  line-height: 1.6;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back:hover,
.back:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(56, 189, 248, 0.25);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  body {
    padding: 2rem 1.1rem;
  }

  .foot {
    flex-direction: column;
    align-items: stretch;
  }

  .back {
    justify-content: center;
  }
}
