:root {
  --red: #c83e1b;
  --red-deep: #a52502;
  --ink: #1c1c18;
  --muted: #5c534c;
  --paper: #f8f4ee;
  --card: #ffffff;
  --line: #e5dcd0;
  --ok: #1f6b45;
  --ok-bg: #eef6f1;
  --used: #3d4a66;
  --used-bg: #eef1f6;
  --expired: #8e2413;
  --expired-bg: #f8eeea;
  --wa: #1c6b45;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background: #f8f4ee;
  -webkit-font-smoothing: antialiased;
}

button,
input,
a {
  font-family: inherit;
}

.shell {
  width: min(440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
}

.mast {
  background: #1f1b18;
  color: #f4f0ea;
  text-align: center;
  padding: 28px 20px 22px;
}

.brand-logo {
  width: 88px;
  height: auto;
  margin: 0 auto 10px;
  display: block;
}

.mast-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 241, 232, 0.72);
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px 48px;
  animation: rise 0.35s ease;
}

.screen.active {
  display: flex;
}

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

.brand {
  margin: 0 0 18px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.invite-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.15rem, 8vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 14ch;
  text-wrap: balance;
  color: var(--ink);
}

.title-sm {
  font-size: clamp(1.85rem, 7vw, 2.25rem);
  max-width: 16ch;
}

.subtitle {
  margin: 0 0 28px;
  max-width: 32ch;
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
  color: var(--muted);
}

.fine {
  margin: 22px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 16px 22px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  width: 100%;
  max-width: 360px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn:focus-visible,
.field input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-deep);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-ghost {
  margin-top: 8px;
  color: var(--muted);
  background: transparent;
  letter-spacing: 0.02em;
}

.btn-whatsapp {
  background: var(--wa);
  color: #fff;
  margin-top: 8px;
}

.btn-whatsapp:hover {
  background: #155536;
}

.mark {
  width: 88px;
  height: 88px;
  margin: 2px 0 16px;
}

.mark-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

.mark-ring {
  fill: none;
  stroke: var(--red);
  stroke-width: 1;
  transform-origin: 44px 44px;
  animation: mark-spin 16s linear infinite;
}

.mark-gift {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.35;
  stroke-linejoin: round;
  stroke-linecap: round;
  transform-origin: 44px 50px;
  animation: mark-float 3.8s ease-in-out infinite;
}

.mark-bow {
  stroke: var(--red);
  transform-box: fill-box;
  transform-origin: center;
}

.box-stage {
  width: 132px;
  height: 132px;
  margin: 18px 0 22px;
  display: grid;
  place-items: center;
}

.mystery-box.mark {
  width: 120px;
  height: 120px;
  margin: 0;
}

.mark-live .mark-ring {
  stroke-dasharray: 8 10;
  animation-duration: 7s;
}

.mystery-box.open .mark-bow {
  animation: mark-lift 0.7s ease forwards;
}

.mystery-box.open .mark-gift {
  animation: mark-settle 0.7s ease forwards;
}

.sparkles {
  display: none !important;
}

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

@keyframes mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes mark-lift {
  to { transform: translateY(-5px); }
}

@keyframes mark-settle {
  to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mark-ring,
  .mark-gift,
  .mark-bow {
    animation: none;
  }
}

.anim-text {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.card-form {
  width: 100%;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field em {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: none;
}

.field input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0;
  font: inherit;
  font-size: 1.05rem;
  background: transparent;
  color: var(--ink);
}

.field input::placeholder {
  color: #b3a89c;
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.form-error {
  color: var(--red-deep);
  font-size: 0.9rem;
  margin: 0 0 14px;
}

.card-form .btn-primary {
  margin-top: 8px;
  max-width: none;
  white-space: normal;
  line-height: 1.35;
  letter-spacing: 0.01em;
  font-size: 0.92rem;
  padding-top: 14px;
  padding-bottom: 14px;
}

.condiciones {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 4px 0 14px;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.condiciones strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.condiciones input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--red);
}

.condiciones:has(input:checked) {
  color: var(--ink);
}

.win-card {
  width: 100%;
  text-align: center;
}

.win-badge {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.coupon-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: left;
  border-left: 3px solid var(--line);
  background: #fff;
}

.coupon-notice.is-valid {
  border-left-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.coupon-notice.is-invalid {
  border-left-color: var(--expired);
  background: var(--expired-bg);
  color: var(--expired);
}

.win-prize {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 6.5vw, 2.2rem);
  line-height: 1.1;
  margin: 0 0 8px;
  text-wrap: balance;
  color: var(--ink);
}

.win-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.win-img {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
}

.win-label {
  margin: 8px 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.win-code {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  margin: 0 0 18px;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.win-qr {
  width: min(220px, 64vw);
  height: auto;
  margin: 0 auto 16px;
  display: block;
  background: #fff;
  padding: 12px;
  border: 1px solid var(--line);
}

.win-expire {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.win-expire strong {
  color: var(--ink);
  font-weight: 500;
}

.win-status {
  display: inline-block;
  margin: 0 0 18px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
}

.win-status.is-ok {
  color: var(--ok);
  border-color: #c9e2d4;
  background: var(--ok-bg);
}

.win-status.is-used {
  color: var(--used);
  border-color: #d5dbe6;
  background: var(--used-bg);
}

.win-status.is-expired {
  color: var(--expired);
  border-color: #edd5ce;
  background: var(--expired-bg);
}

.win-fallback {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.store-info {
  width: 100%;
  margin: 28px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.store-name {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.store-video,
.store-address {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.store-video a,
.store-map-link a {
  color: var(--ink);
  font-weight: 500;
}

.store-map-link,
.store-video {
  margin: 0 0 8px;
}

.historia {
  margin: 4px 0 10px;
  font-size: 0.95rem;
  color: var(--muted);
}

.historia a {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.redes-iconos {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
}

.redes-iconos a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.redes-iconos svg {
  width: 20px;
  height: 20px;
  display: block;
}

.ticket-map {
  height: 180px;
  margin: 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.ticket-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.ticket-legal-title {
  margin: 8px 0 8px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: left;
  color: var(--ink);
}

.ticket-legal {
  margin: 0;
  padding-left: 18px;
  text-align: left;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.ticket-legal li + li {
  margin-top: 6px;
}

.loading-copy {
  margin-top: 16px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(246, 241, 232, 0.92);
  display: grid;
  place-content: center;
  gap: 14px;
  z-index: 50;
  text-align: center;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

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

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  border-top-color: var(--red);
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

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

@media (min-width: 768px) {
  .shell {
    min-height: calc(100dvh - 64px);
    margin: 32px auto;
    box-shadow: 0 18px 50px rgba(22, 17, 14, 0.08);
  }
}
