:root {
  /* Paleta BELÚ: rojo del logo + crema + dorado */
  --guinda: #d22e1d; /* rojo principal del logo */
  --guinda-2: #8f1f14; /* rojo profundo */
  --guinda-soft: #e2776c; /* rojo suave */
  --dorado: #d6a43a;
  --dorado-2: #b8892c;
  --dorado-soft: #f0e0b8;
  --rojo: #d22e1d;
  --carbon: #252525;
  --crema: #faf5ea;
  --crema-2: #f3ead8;
  --white: #ffffff;
  --danger: #d62828;
  --ok: #2a9d8f;
  --wa: #25d366;
  --shadow: 0 18px 40px rgba(150, 30, 18, 0.2);
  --radius: 22px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--carbon);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(214, 164, 58, 0.18), transparent 60%),
    linear-gradient(170deg, var(--crema) 0%, #fbf6ec 45%, var(--crema-2) 100%);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: -20% auto auto -10%;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 164, 58, 0.22), transparent 70%);
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(18vw, 12vh); }
}

.shell {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px 20px 40px;
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeUp 0.45s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Logo BELÚ */
.brand-logo {
  width: min(150px, 44vw);
  height: auto;
  margin: 0 auto 10px;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(210, 46, 29, 0.18));
}

.brand-logo-sm {
  width: min(104px, 30vw);
  margin-bottom: 6px;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4.2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 6px 0 2px;
  color: var(--guinda);
  text-shadow: 0 2px 0 rgba(210, 46, 29, 0.1);
}

.invite-eyebrow {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  letter-spacing: 0.18em;
  margin: 2px 0 10px;
  color: var(--dorado-2);
  font-weight: 600;
}

.win-fallback {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: #7a6a55;
  text-align: center;
}

.coupon-notice {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}

.coupon-notice.is-valid {
  background: #e7f6ec;
  color: #145c32;
  border: 2px solid #2a9d8f;
}

.coupon-notice.is-invalid {
  background: #fdecea;
  color: var(--guinda-2);
  border: 2px solid var(--rojo);
}

.store-info {
  margin: 18px 0 4px;
  padding: 14px 12px 10px;
  border-top: 2px solid var(--dorado);
  background: var(--crema);
  border-radius: 0 0 14px 14px;
  color: var(--carbon);
}

.store-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--guinda);
  letter-spacing: 0.1em;
  margin: 0 0 6px;
}

.store-video {
  margin: 0 0 4px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.store-video a {
  color: var(--guinda-soft);
  font-weight: 800;
  text-decoration: underline;
}

.store-address {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--guinda);
}

.hero-emoji {
  font-size: 4.2rem;
  line-height: 1;
  margin: 12px 0;
  animation: bounce 1.6s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6.5vw, 2.15rem);
  line-height: 1.15;
  margin: 8px 0;
  text-wrap: balance;
  color: var(--guinda);
}

.title-sm {
  font-size: clamp(1.45rem, 5.5vw, 1.85rem);
}

.subtitle {
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.45;
  max-width: 32ch;
  color: #6b5b49;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 18px 28px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 360px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, var(--guinda-soft), var(--guinda) 55%, var(--guinda-2));
  color: #fff;
  box-shadow: 0 10px 0 #741910, var(--shadow);
}

.btn-pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.btn-secondary {
  background: rgba(210, 46, 29, 0.08);
  color: var(--guinda);
  border: 2px solid rgba(210, 46, 29, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--guinda);
  margin-top: 10px;
  font-size: 1rem;
  box-shadow: none;
}

.btn-whatsapp {
  background: linear-gradient(180deg, #3be07a, var(--wa));
  color: #053b1d;
  box-shadow: 0 8px 0 #128c3d, var(--shadow);
  margin-top: 8px;
}

/* Animación caja */
.box-stage {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 40px 0 24px;
}

.mystery-box {
  width: 140px;
  height: 120px;
  margin: 40px auto 0;
  position: relative;
  transform-origin: center bottom;
  animation: shake 0.4s ease-in-out infinite;
}

.mystery-box.open {
  animation: none;
}

.box-lid {
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(180deg, #e6c25e, var(--dorado));
  border-radius: 8px 8px 2px 2px;
  transform-origin: left center;
  transition: transform 0.6s ease;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.mystery-box.open .box-lid {
  transform: rotate(-110deg) translateY(-8px);
}

.box-body {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--guinda-soft), var(--guinda));
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 3rem;
  color: #fff;
  box-shadow: var(--shadow);
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sparkles::before,
.sparkles::after {
  content: "✨";
  position: absolute;
  font-size: 2rem;
  animation: pop 0.8s ease forwards;
}

.sparkles::before { left: 10%; top: 10%; }
.sparkles::after { right: 8%; top: 20%; animation-delay: 0.1s; }

@keyframes shake {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.4) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(-20px); }
}

.anim-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--guinda);
}

/* Formulario */
.card-form {
  width: 100%;
  background: var(--white);
  color: var(--carbon);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(214, 164, 58, 0.55);
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 0.92rem;
}

.field input {
  border: 2px solid #e4d9c3;
  border-radius: 14px;
  padding: 14px 14px;
  font: inherit;
  font-size: 1.05rem;
  background: #fff;
  color: var(--carbon);
}

.field input:focus {
  outline: none;
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(214, 164, 58, 0.3);
}

.form-error {
  color: var(--danger);
  font-weight: 700;
  margin: 0 0 12px;
}

.hint {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: #7a6a55;
  text-align: center;
}

.card-form .btn-primary {
  margin-top: 4px;
  max-width: none;
}

/* Ganador */
.win-card {
  width: 100%;
  background: var(--white);
  color: var(--carbon);
  border-radius: 28px;
  padding: 24px 18px 20px;
  box-shadow: var(--shadow);
  border: 3px solid var(--dorado);
  animation: winIn 0.55s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes winIn {
  from { opacity: 0; transform: scale(0.9) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.win-badge {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--dorado-2);
}

.win-prize {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  margin: 0 0 6px;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--guinda);
}

.win-desc {
  margin: 0 0 12px;
  color: #7a6a55;
  font-size: 0.95rem;
}

.win-img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
  border-radius: 12px;
}

.win-label {
  margin: 8px 0 2px;
  font-size: 0.9rem;
  color: #7a6a55;
  font-weight: 700;
}

.win-code {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  background: var(--crema);
  border: 2px dashed var(--dorado);
  border-radius: 14px;
  padding: 10px;
  color: var(--guinda);
}

.win-qr {
  width: min(240px, 70vw);
  height: auto;
  margin: 0 auto 12px;
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  border: 2px solid var(--dorado);
}

.win-expire {
  margin: 0 0 6px;
  font-size: 1rem;
}

.win-status {
  margin: 0 0 16px;
  font-weight: 800;
  font-size: 0.95rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 245, 234, 0.9);
  display: grid;
  place-content: center;
  gap: 12px;
  z-index: 50;
  text-align: center;
  backdrop-filter: blur(4px);
  color: var(--guinda);
}

.loading-overlay[hidden] {
  display: none !important;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(210, 46, 29, 0.2);
  border-top-color: var(--dorado);
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 768px) {
  .shell {
    padding-top: 48px;
  }
}
