:root {
  --primary: #FFD200;
  --primary-hover: #D9AE00;
  --primary-light: #FFF3C4;
  --primary-dark: #D9AE00;
  --gold: #FFD200;
  --bg-main: #23272B;
  --bg-card: #2C3136;
  --bg-card-light: #3A4045;
  --text-main: #FFFFFF;
  --text-muted: #C9CDD0;
  --success: #FFD200;
  --success-bg: #3A4045;
  --danger: #EF4444;
  --danger-bg: #7F1D1D;
  --border: #3A4045;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-glow: 0 0 25px rgba(255, 210, 0, 0.35);
  --shadow-success: 0 0 25px rgba(255, 210, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Bakery Pattern */
.bg-ambient {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 0%, rgba(255, 210, 0, 0.18) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(255, 210, 0, 0.08) 0%, transparent 50%),
    var(--bg-main);
  pointer-events: none;
  z-index: 0;
}

/* App Shell */
.app-container {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  padding: 16px 20px 32px 20px;
}

/* Top App Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px 0;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFD200, #23272B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(255, 210, 0, 0.3);
  border: 1px solid rgba(254, 243, 199, 0.2);
}

.brand-info h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.brand-info .tagline {
  font-size: 0.75rem;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.vip-pill {
  background: rgba(255, 210, 0, 0.2);
  border: 1px solid rgba(255, 210, 0, 0.4);
  color: #FFD200;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Main Loyalty Card (The Wallet Card) */
.loyalty-card {
  background: linear-gradient(145deg, #2C3136, #23272B);
  border: 1.5px solid rgba(255, 210, 0, 0.35);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 20px;
}

.loyalty-card.reward-ready {
  border-color: var(--success);
  box-shadow: var(--shadow-success);
  animation: pulseCard 2s infinite ease-in-out;
}

@keyframes pulseCard {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 210, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 210, 0, 0.6);
  }
}

.card-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.program-name {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.customer-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 2px;
}

.stamps-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 12px;
  text-align: right;
}

.stamps-badge .count {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFD200;
}

.stamps-badge .total {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Stamp Slots Grid (Soporta 4, 6 u 8 sellos dinámicos) */
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.stamps-grid.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stamps-grid.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stamp-slot {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 2px dashed rgba(255, 210, 0, 0.35);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stamp-slot.stamped {
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.25), rgba(255, 210, 0, 0.15));
  border: 2px solid #FFD200;
  box-shadow: 0 4px 15px rgba(255, 210, 0, 0.3);
}

.stamp-slot.stamped .stamp-icon {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

.stamp-icon {
  font-size: 26px;
  transform: scale(0) rotate(-45deg);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.stamp-slot.stamp-final {
  border-color: rgba(255, 210, 0, 0.6);
}

.stamp-slot.stamp-final.stamped {
  background: linear-gradient(135deg, #FFD200, #D9AE00);
  border: 2px solid #FFD200;
  box-shadow: 0 4px 20px rgba(255, 210, 0, 0.5);
}

.stamp-slot .slot-number {
  position: absolute;
  bottom: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.stamp-slot.stamped .slot-number {
  color: rgba(255, 255, 255, 0.85);
}

/* Stamp Animation Keyframe */
.stamp-animating {
  animation: stampImpact 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes stampImpact {
  0% {
    transform: scale(2.8) rotate(-20deg);
    opacity: 0;
  }
  50% {
    transform: scale(0.85) rotate(5deg);
    opacity: 1;
  }
  75% {
    transform: scale(1.1) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Reward Banner within Card */
.reward-banner {
  background: rgba(35, 39, 43, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.reward-banner.unlocked {
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.2), rgba(58, 64, 69, 0.4));
  border-color: rgba(255, 210, 0, 0.4);
}

.reward-banner-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.reward-banner-photo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.reward-banner-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reward-banner-text .title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
}

.reward-banner-text .subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.reward-banner.unlocked .title {
  color: #FFD200;
}

/* Celebration Overlay */
.celebration-box {
  display: none;
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.95), rgba(4, 120, 87, 0.98));
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  margin-top: 14px;
  animation: slideUp 0.4s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.celebration-box.show {
  display: block;
}

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

.celebration-box h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.celebration-box p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Ephemeral QR Container */
.qr-container-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  margin-bottom: 20px;
}

.qr-header {
  margin-bottom: 16px;
}

.qr-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.qr-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* QR Code Box */
.qr-code-wrapper {
  background: #FFFFFF;
  padding: 14px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-width: 190px;
  min-height: 190px;
}

#qr-code {
  width: 170px !important;
  height: 170px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
}

#qr-canvas, #qr-code img, #qr-code svg {
  display: block;
  width: 170px !important;
  height: 170px !important;
  max-width: 170px !important;
  max-height: 170px !important;
  object-fit: contain;
}

/* Circular Timer Indicator */
.timer-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timer-circular {
  position: relative;
  width: 28px;
  height: 28px;
}

.timer-circular svg {
  transform: rotate(-90deg);
  width: 28px;
  height: 28px;
}

.timer-circular circle {
  fill: none;
  stroke-width: 3.5;
}

.circle-bg {
  stroke: rgba(255, 255, 255, 0.1);
}

.circle-progress {
  stroke: var(--primary);
  stroke-dasharray: 75.39; /* 2 * PI * 12 */
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timer-text span {
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Action Buttons & Links */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover, .btn-secondary:active {
  background: var(--bg-card-light);
  border-color: rgba(255, 210, 0, 0.4);
  transform: translateY(-1px);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #D9AE00, #D9AE00);
  color: #23272B;
  border: none;
}

.btn-whatsapp:hover, .btn-whatsapp:active {
  background: linear-gradient(135deg, #FFD200, #D9AE00);
  box-shadow: 0 4px 15px rgba(255, 210, 0, 0.4);
}

/* Demo Switcher Bar */
.demo-bar {
  background: rgba(35, 39, 43, 0.9);
  border: 1px solid rgba(255, 210, 0, 0.3);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 24px;
}

.demo-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #FFD200;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-pills {
  display: flex;
  gap: 8px;
}

.demo-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.demo-pill.active {
  background: var(--primary);
  color: #23272B;
  border-color: var(--gold);
}

/* Modal Bottom Sheet */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  background: #2C3136;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 24px 20px 34px 20px;
  width: 100%;
  max-width: 440px;
  border-top: 1.5px solid rgba(255, 210, 0, 0.4);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

.rule-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: #C9CDD0;
  line-height: 1.4;
}

.rule-icon {
  color: var(--gold);
  font-size: 1.1rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #2C3136;
  border: 1px solid var(--primary);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.btn-register-open {
  background: linear-gradient(135deg, #FFD200, #D9AE00);
  color: #23272B;
  border: none;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-register-open:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Modal Bottom Sheet / Drawer */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 39, 43, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active,
.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: #2C3136;
  border-top: 1.5px solid var(--border);
  border-radius: 28px 28px 0 0;
  padding: 16px 20px 36px 20px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-sheet,
.modal-overlay.show .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 42px;
  height: 5px;
  background: var(--bg-card-light);
  border-radius: 9999px;
  margin: 0 auto 16px auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.15);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.rule-item strong {
  color: var(--text-main);
}

.rule-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================== */
/* VIRAL REFERRAL & SOCIAL SHARING (Growth Loop) */
/* ============================================== */

/* Referral Welcome Pill */
.referral-welcome-banner {
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.25), rgba(255, 210, 0, 0.15));
  border: 1.5px solid #FFD200;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 15px rgba(255, 210, 0, 0.15);
}

.ref-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.ref-content {
  flex: 1;
}

.ref-content strong {
  display: block;
  font-size: 0.85rem;
  color: #FFD200;
}

.ref-content p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-ref-claim {
  background: #FFD200;
  color: #23272B;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* Viral Card in Main View */
.viral-card {
  background: linear-gradient(135deg, rgba(44, 49, 54, 0.8), rgba(255, 210, 0, 0.12));
  border: 1px solid rgba(255, 210, 0, 0.35);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.viral-card:hover {
  transform: translateY(-2px);
  border-color: #FFD200;
  box-shadow: 0 8px 25px rgba(255, 210, 0, 0.25);
}

.viral-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 210, 0, 0.25);
  color: #FFD200;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.viral-card-left h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
}

.viral-card-left p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-viral-pill {
  background: linear-gradient(135deg, #FFD200, #D9AE00);
  color: #23272B;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(255, 210, 0, 0.3);
}

/* Celebration Share Button */
.btn-celebrate-share {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(135deg, #FFD200, #FFD200);
  color: #23272B;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(255, 210, 0, 0.4);
  transition: all 0.2s ease;
}

.btn-celebrate-share:hover {
  transform: scale(1.02);
  filter: brightness(1.08);
}

/* Modal Share Sheet & Story Card Preview */
.modal-share-sheet {
  max-width: 440px;
}

.story-preview-card {
  position: relative;
  background: linear-gradient(145deg, #2C3136, #23272B);
  border: 1.5px solid rgba(255, 210, 0, 0.4);
  border-radius: 20px;
  padding: 22px 18px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
}

.story-card-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 210, 0, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.story-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.story-logo {
  font-size: 20px;
}

.story-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #FFFFFF;
}

.story-vip-tag {
  background: #FFD200;
  color: #23272B;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.story-trophy {
  margin: 10px 0;
}

.trophy-circle {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.2), rgba(255, 210, 0, 0.1));
  border: 2px solid #FFD200;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto;
  box-shadow: 0 0 25px rgba(255, 210, 0, 0.4);
  animation: pulseTrophy 2s infinite ease-in-out;
}

@keyframes pulseTrophy {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 35px rgba(255, 210, 0, 0.6); }
}

.story-preview-card h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 8px;
}

.story-preview-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.story-referral-tag {
  margin-top: 14px;
  background: rgba(255, 210, 0, 0.15);
  border: 1px dashed #FFD200;
  color: #FFD200;
  font-size: 0.76rem;
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Share Action Buttons */
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-share-channel {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: #FFFFFF;
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-appearance: none;
}

.btn-share-channel:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}

.share-channel-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.share-channel-text {
  flex: 1;
  text-align: left;
}

.share-channel-text strong {
  display: block;
  font-size: 0.88rem;
  color: #FFFFFF;
}

.share-channel-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

.btn-share-whatsapp {
  border-color: rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.1);
}

.btn-share-whatsapp:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: #25D366;
}

.btn-share-instagram {
  border-color: rgba(225, 48, 108, 0.4);
  background: rgba(225, 48, 108, 0.1);
}

.btn-share-instagram:hover {
  background: rgba(225, 48, 108, 0.2);
  border-color: #E1306C;
}

.share-badge-tag {
  background: var(--primary);
  color: #23272B;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

/* ==========================================
   PUNTOS CANJEABLES
   ========================================== */
.points-card {
  margin: 14px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.points-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.points-label {
  font-size: 0.95rem;
  font-weight: 800;
}

.points-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 4px 0 0;
}

.points-balance {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: #FFD200;
}

.points-catalog {
  display: grid;
  gap: 8px;
}

.points-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.points-item strong {
  display: block;
  font-size: 0.86rem;
}

.points-item span {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
}

.points-item button {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.78rem;
  background: #FFD200;
  color: #111;
  cursor: pointer;
}

.points-item button:disabled {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

/* Modo "solo puntos": la cartilla de sellos no aplica */
.points-only .stamps-grid,
.points-only .stamps-badge,
.points-only #reward-banner,
.points-only #smart-nudge-box,
.points-only #celebration-box {
  display: none !important;
}

/* ==========================================
   SORTEOS
   ========================================== */
.raffle-card-c {
  margin: 14px 0;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(255, 210, 0, 0.1));
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.raffle-card-c.winner {
  background: linear-gradient(135deg, rgba(255, 210, 0, 0.3), rgba(255, 210, 0, 0.2));
  border-color: rgba(255, 210, 0, 0.6);
}

.raffle-card-c h3 {
  font-size: 1.05rem;
  margin: 4px 0;
}

.raffle-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #FFD200;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.raffle-prize-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.raffle-prize-row img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}

.raffle-info {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 4px 0;
}

.raffle-consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 10px 0;
}

.raffle-join {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  background: #FFD200;
  color: #1B1E21;
  cursor: pointer;
}

.raffle-status-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 210, 0, 0.18);
  color: #FFF3C4;
}

.raffle-card-c details {
  margin-top: 8px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.7);
}

.raffle-card-c a {
  color: #FFD200;
  font-size: 0.78rem;
}

/* ---------- Aviso de comercio de demostración ---------- */
.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin-bottom: 14px; padding: 10px 14px; border-radius: 14px;
  background: repeating-linear-gradient(135deg, rgba(255, 210, 0, 0.16) 0 12px, rgba(255, 210, 0, 0.08) 12px 24px);
  border: 1.5px dashed var(--gold); font-size: 0.8rem; line-height: 1.4;
}
.demo-banner[hidden] { display: none; }
.demo-banner-tag {
  background: var(--gold); color: #23272B; font-weight: 800; letter-spacing: 0.08em;
  padding: 2px 8px; border-radius: 6px; font-size: 0.72rem;
}
.demo-banner-text { flex: 1 1 180px; color: var(--text-main); font-weight: 600; }
.demo-banner-link { color: var(--gold); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* Programa de referidos: se muestra solo si el plan lo incluye */
.viral-card[hidden] { display: none; }

/* ==========================================================================
   Identidad rekompra (Manual de Identidad v1.0)
   Tarjetas blancas sobre fondo claro, sellos circulares amarillos, carbón como base.
   El color del comercio (--merchant) queda solo como acento de su marca.
   ========================================================================== */
:root {
  --primary: var(--rk-yellow);
  --primary-hover: var(--rk-yellow-dark);
  --primary-light: var(--rk-yellow-soft);
  --primary-dark: var(--rk-yellow-dark);
  --gold: var(--rk-yellow);
  --bg-main: var(--rk-gray-100);
  --bg-card: var(--rk-white);
  --bg-card-light: var(--rk-gray-100);
  --text-main: var(--rk-ink);
  --text-muted: var(--rk-gray-500);
  --border: var(--rk-gray-200);
  --success: var(--rk-yellow-dark);
  --success-bg: var(--rk-yellow-soft);
  --font-family: var(--rk-font-body);
  --shadow-glow: var(--rk-shadow-md);
  --shadow-success: var(--rk-shadow-glow);
  --merchant: var(--rk-ink);
  --merchant-2: var(--rk-yellow);
}
body { background: var(--rk-gray-100); color: var(--rk-ink); font-family: var(--rk-font-body); }
h1, h2, h3, h4, .brand-info h1 { font-family: var(--rk-font-display); }
.bg-ambient { display: none; }

/* Logo del comercio con un anillo de su color: su marca, dentro del sistema rekompra */
.brand-logo { background: var(--rk-white); box-shadow: 0 0 0 2px var(--merchant); border: none; }

/* Sellos: siempre circulares y amarillos */
.stamp-slot { border-radius: var(--rk-radius-full); background: var(--rk-white); border: 2px dashed var(--rk-gray-300); }
.stamp-slot.stamped { background: var(--rk-yellow); border: none; box-shadow: var(--rk-shadow-glow); }
.stamp-slot.stamp-final { border-color: var(--rk-yellow); background: var(--rk-yellow-soft); }
.stamp-slot.stamp-final.stamped { background: var(--rk-yellow); }
.stamp-slot.stamped .slot-number { color: var(--rk-ink); }
.stamp-icon { filter: none; }

/* Firma de la plataforma */
.rk-signature {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px auto 8px;
  font-size: var(--rk-text-xs); color: var(--rk-gray-500); text-decoration: none;
}
.rk-signature .rk-logo { font-size: 0.95rem; color: var(--rk-ink); }

/* --- Identidad: la cartilla es la "tarjeta premium" en carbón; el resto, tarjetas blancas --- */
.loyalty-card { --text-main: var(--rk-white); --text-muted: var(--rk-gray-300); color: var(--rk-white); background: var(--rk-ink); border: none; box-shadow: var(--rk-shadow-lg); }
.loyalty-card .stamp-slot .slot-number { color: var(--rk-gray-500); }
.loyalty-card .reward-banner { background: #2C3136; }

.brand-info h1, #brand-name { color: var(--rk-ink); }
.brand-info .tagline { color: var(--rk-gray-500); }
.vip-pill { background: var(--rk-yellow); border-color: var(--rk-yellow); color: var(--rk-ink); }
.vip-pill span { color: var(--rk-ink); }
.demo-banner { color: var(--rk-ink); }
.demo-banner-text { color: var(--rk-ink); }
.demo-banner-link { color: var(--rk-ink); text-decoration: underline; }

.points-card, .qr-container-card, .raffle-card-c {
  background: var(--rk-white); color: var(--rk-ink); border: 1px solid var(--rk-gray-200);
  border-radius: var(--rk-radius-lg); box-shadow: var(--rk-shadow-sm);
}
.raffle-card-c.winner { background: var(--rk-yellow-soft); border-color: var(--rk-yellow); }
.points-sub, .points-item span, .raffle-info, .raffle-consent, .raffle-card-c details { color: var(--rk-gray-500); }
.points-balance { color: var(--rk-ink); font-family: var(--rk-font-display); }
.points-item { background: var(--rk-gray-100); }
.points-item strong { color: var(--rk-ink); }
.points-item button { color: var(--rk-ink); }
.points-item button:disabled { background: var(--rk-gray-200); color: var(--rk-gray-500); }
.raffle-tag { color: var(--rk-ink); background: var(--rk-yellow); padding: 2px 10px; border-radius: var(--rk-radius-full); }
.raffle-card-c a { color: var(--rk-ink); text-decoration: underline; }
.raffle-status-pill { background: var(--rk-yellow-soft); color: var(--rk-ink); }
.qr-header h2, #qr-header-title { color: var(--rk-ink); }
.timer-text, .timer-text span, #timer-seconds { color: var(--rk-ink); }
.rk-signature { color: var(--rk-gray-500); }
.loyalty-card .stamp-slot.stamped .slot-number { color: var(--rk-ink); }

/* --- Ajustes tras revisar la vista de visitante nuevo --- */
/* Sellos vacíos: discretos sobre la cartilla carbón (no círculos blancos que encandilan) */
.loyalty-card .stamp-slot { background: transparent; border: 2px dashed var(--rk-gray-500); }
.loyalty-card .stamp-slot .slot-number { color: var(--rk-gray-300); }
.loyalty-card .stamp-slot.stamp-final { background: rgba(255, 210, 0, 0.12); border-color: var(--rk-yellow); }
.loyalty-card .stamp-slot.stamp-final .slot-number { color: var(--rk-yellow); }
.loyalty-card .stamp-slot.stamped { background: var(--rk-yellow); border: none; }
.loyalty-card .stamp-slot.stamped .slot-number { color: var(--rk-ink); }
/* Un solo acento amarillo fuerte por pantalla: WhatsApp pasa a botón secundario */
.btn-whatsapp, .btn-whatsapp:hover, .btn-whatsapp:active {
  background: var(--rk-white); color: var(--rk-ink); border: 1px solid var(--rk-gray-200); box-shadow: var(--rk-shadow-sm);
}
.btn-secondary { background: var(--rk-white); color: var(--rk-ink); border: 1px solid var(--rk-gray-200); }
.btn-primary { font-family: var(--rk-font-display); }

/* Botón primario (no estaba definido en esta hoja): amarillo, texto carbón, radio 14 */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 14px 20px; border: none; border-radius: var(--rk-radius-md); cursor: pointer;
  background: var(--rk-yellow); color: var(--rk-ink);
  font-family: var(--rk-font-display); font-size: 1rem; font-weight: 600;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--rk-yellow-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

/* Ventanas emergentes en blanco, como el resto de la tarjeta */
.modal-overlay { background: rgba(35, 39, 43, 0.6); }
.modal-sheet { background: var(--rk-white); color: var(--rk-ink); border-top: none; box-shadow: var(--rk-shadow-lg); }
.modal-title { color: var(--rk-ink); }
.modal-close { background: var(--rk-gray-100); color: var(--rk-ink); }
.modal-handle { background: var(--rk-gray-300); }
.modal-header { border-bottom-color: var(--rk-gray-200); }
.modal-sheet label, .modal-sheet .form-label { color: var(--rk-gray-700); }
.modal-sheet a { color: var(--rk-ink); }
/* Enlaces sobre fondo claro: carbón subrayado (el amarillo sobre blanco no se lee) */
.btn-link-recover, .modal-sheet .btn-link, .modal-sheet a { color: var(--rk-ink); text-decoration: underline; }
.rule-item[hidden] { display: none; }
.rule-link { display: inline-block; margin-left: 4px; color: var(--rk-ink); font-weight: 600; text-decoration: underline; }

/* --- Privacidad: consentimiento y baja --- */
.consent-row { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; font-size: 0.78rem; line-height: 1.45; color: var(--rk-gray-700); cursor: pointer; }
.consent-row input { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--rk-ink); }
.consent-row a, .privacy-footer a { color: var(--rk-ink); font-weight: 600; text-decoration: underline; }
.privacy-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rk-gray-200); font-size: 0.8rem; }
.btn-erase-me { background: none; border: none; padding: 0; font: inherit; font-size: 0.8rem; color: #B42318; text-decoration: underline; cursor: pointer; }
.btn-erase-me[hidden] { display: none; }

/* Sorteos: participación gratuita visible y organizador */
.raffle-free { margin: 8px 0; padding: 8px 10px; border-radius: var(--rk-radius-sm); background: var(--rk-yellow-soft); font-size: 0.78rem; color: var(--rk-ink); line-height: 1.4; }
.raffle-organizer { margin-top: 10px; font-size: 0.72rem; color: var(--rk-gray-500); }
