.demo-frame {
  position: relative;
  padding: 0.8125rem;
  border-radius: 1.375rem;
  border: 2px dashed rgba(var(--brand-rgb), 0.4);
  background: rgba(var(--brand-rgb), 0.04);
}

.demo-frame__label {
  position: absolute;
  top: 0;
  left: 1.25rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-rgb), 0.55);
  background: #0b0b0d;
  color: var(--brand-light);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.demo-frame__label svg {
  width: 0.8125rem;
  height: 0.8125rem;
}

.demo {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 27rem;
  padding: 1rem 1.125rem 0.875rem;
  border-radius: 1rem;
  background: #0e0f13;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.demo__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

.demo__title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: #ffffff;
}

.demo__counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-light);
  font-variant-numeric: tabular-nums;
}

.demo__body {
  position: relative;
  flex: 1;
  margin-top: 0.875rem;
}

.demo__scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}

.demo__scene.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- cena 1: escolha dos jogos ---------- */

.demo__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
  align-items: start;
}

/* Os cards do tutorial são os mesmos da loja, apenas sem clique. */
.demo__game {
  position: relative;
  min-width: 0;
  transition: transform 0.25s ease;
}

.demo__game .pkg-card {
  pointer-events: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.demo__game.is-picked {
  transform: translateY(-3px);
}

.demo__game.is-picked .pkg-card {
  border-color: #35d399;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), 0 0 0 1px #35d399;
}

.demo__game-check {
  position: absolute;
  top: -0.3125rem;
  right: -0.3125rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 999px;
  background: #35d399;
  color: #05261a;
  border: 2px solid #0e0f13;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.demo__game.is-picked .demo__game-check {
  opacity: 1;
  transform: scale(1);
}

.demo__game-check svg {
  width: 0.75rem;
  height: 0.75rem;
}

.demo__total {
  margin-top: auto;
  padding-top: 0.625rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgb(var(--muted-foreground));
}

.demo__total strong {
  font-size: 1.125rem;
  font-weight: 800;
  color: #35d399;
  font-variant-numeric: tabular-nums;
}

/* ---------- cena 2: checkout ---------- */

.demo__field + .demo__field {
  margin-top: 0.875rem;
}

.demo__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--muted-foreground));
  margin-bottom: 0.375rem;
}

.demo__input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.625rem;
  padding: 0 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8125rem;
  color: #ffffff;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.demo__input.is-focused {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.16);
}

.demo__input svg {
  width: 0.9375rem;
  height: 0.9375rem;
  color: rgb(var(--muted-foreground));
  flex-shrink: 0;
}

.demo__caret {
  width: 1px;
  height: 1rem;
  background: var(--brand);
  opacity: 0;
}

.demo__input.is-focused .demo__caret {
  opacity: 1;
  animation: demo-caret 1s steps(1) infinite;
}

@keyframes demo-caret {
  50% {
    opacity: 0;
  }
}

.demo__pay {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(var(--brand-rgb), 0.35);
  background: rgba(var(--brand-rgb), 0.08);
}

.demo__pay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(var(--brand-rgb), 0.2);
  color: var(--brand-light);
  flex-shrink: 0;
}

.demo__pay-badge svg {
  width: 1rem;
  height: 1rem;
}

.demo__pay-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffffff;
}

.demo__pay-hint {
  font-size: 0.6875rem;
  color: rgb(var(--muted-foreground));
}

.demo__pay-radio {
  margin-left: auto;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 4px solid var(--brand);
  background: #ffffff;
  flex-shrink: 0;
}

.demo__summary {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.625rem 0;
  font-size: 0.75rem;
  color: rgb(var(--muted-foreground));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.demo__summary strong {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.demo__confirm {
  flex-shrink: 0;
  height: 2.625rem;
  border-radius: 0.625rem;
  border: none;
  background: var(--brand);
  color: #111;
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: default;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.demo__confirm.is-pressed {
  background: var(--brand-dark);
  transform: scale(0.97);
}

/* ---------- cena 3: aprovado ---------- */

.demo__approved {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
}

.demo__approved-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  background: rgba(53, 211, 153, 0.14);
  border: 1px solid rgba(53, 211, 153, 0.5);
  color: #35d399;
  margin-bottom: 0.375rem;
}

.demo__scene.is-active .demo__approved-ring {
  animation: demo-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes demo-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.demo__approved-ring svg {
  width: 2rem;
  height: 2rem;
}

.demo__approved-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
}

.demo__approved-text {
  font-size: 0.8125rem;
  color: rgb(var(--muted-foreground));
}

/* ---------- cena 4: entrega da key ---------- */

.demo__delivery {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.demo__delivery-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(53, 211, 153, 0.45);
  background: rgba(53, 211, 153, 0.1);
  color: #35d399;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo__delivery-dot {
  width: 0.3125rem;
  height: 0.3125rem;
  border-radius: 999px;
  background: #35d399;
}

.demo__delivery-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.demo__key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 0.6875rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--dialog-blue, var(--brand));
  background: rgba(16, 16, 18, 0.85);
}

.demo__key-code {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo__key-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #18181b;
  transition: transform 0.15s ease;
}

.demo__key-copy.is-pressed {
  transform: scale(0.9);
}

.demo__key-copy svg {
  width: 0.875rem;
  height: 0.875rem;
}

.demo__delivery-note {
  font-size: 0.75rem;
  color: rgb(var(--muted-foreground));
  transition: color 0.25s ease;
}

.demo__delivery-note.is-done {
  color: #35d399;
  font-weight: 700;
}

.demo__delivery-caption {
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

/* ---------- rodapé e cursor ---------- */

.demo__dots {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.875rem;
}

.demo__dot {
  width: 1rem;
  height: 0.1875rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background-color 0.3s ease, width 0.3s ease;
}

.demo__dot.is-active {
  width: 1.75rem;
  background: var(--brand);
}

.demo__cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  width: 1.125rem;
  height: 1.125rem;
  margin: -0.25rem 0 0 -0.25rem;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.demo__cursor.is-visible {
  opacity: 1;
}

.demo__cursor svg {
  width: 100%;
  height: 100%;
}

.demo__cursor::after {
  content: '';
  position: absolute;
  top: 0.0625rem;
  left: 0.0625rem;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.6875rem 0 0 -0.6875rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--brand-rgb), 0.8);
  opacity: 0;
}

.demo__cursor.is-clicking::after {
  animation: demo-ripple 0.45s ease-out;
}

@keyframes demo-ripple {
  0% {
    opacity: 0.9;
    transform: scale(0.3);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@media (max-width: 640px) {
  .demo-frame {
    padding: 0.625rem;
  }

  .demo {
    height: 22rem;
    padding: 0.875rem 0.9375rem 0.75rem;
  }

  .demo__grid {
    gap: 0.375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo__cursor {
    display: none;
  }

  .demo__scene,
  .demo__game-art,
  .demo__game-check {
    transition: none;
  }
}
