/* Shared gift-card renderer — ported 1:1 from the original gift_cards.html. */
.gc-card {
  --gc-gold-light: #f9f0d0;
  --gc-gold: #d4af37;
  --gc-gold-dark: #b8941f;
  --gc-emerald: #1a6b52;
  --gc-emerald-deep: #0f4a38;
  --gc-emerald-light: #2a8a6a;
  --gc-text-light: #f5f5f7;
  --gc-text-muted: #7a9b8e;

  position: relative;
  width: 440px;
  height: 275px;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 auto;
  color: var(--gc-text-light);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  transform: scale(var(--gc-scale, 1));
  transform-origin: top left;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(212, 175, 55, 0.12);
}
.gc-card * { box-sizing: border-box; }
.gc-card:hover {
  transform: translateY(-10px) scale(calc(var(--gc-scale, 1) * 1.02));
  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1.5px rgba(212, 175, 55, 0.35),
    0 0 50px rgba(26, 107, 82, 0.15);
}

/* Card background — velvet emerald */
.gc-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(42, 138, 106, 0.12), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(15, 74, 56, 0.5), transparent 50%),
    linear-gradient(135deg, #0d3a2c 0%, #061712 45%, #0a2e22 100%);
}

/* Velvet texture overlay */
.gc-velvet {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.5) 0, rgba(255,255,255,0.5) 0.5px, transparent 0.5px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.5) 0, rgba(255,255,255,0.5) 0.5px, transparent 0.5px, transparent 3px);
  pointer-events: none;
}

/* Gold foil border */
.gc-border {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1.5px;
  background: linear-gradient(135deg,
    rgba(212, 175, 55, 0.55) 0%,
    rgba(249, 240, 208, 0.25) 15%,
    rgba(212, 175, 55, 0.1) 35%,
    rgba(184, 148, 31, 0.15) 55%,
    rgba(212, 175, 55, 0.3) 75%,
    rgba(247, 231, 193, 0.45) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Inner gold frame */
.gc-inner {
  position: absolute;
  top: 8px; right: 8px; bottom: 8px; left: 8px;
  border: 0.5px solid rgba(212, 175, 55, 0.2);
  border-radius: 14px;
  pointer-events: none;
  z-index: 1;
}

/* Shimmer animation overlay */
.gc-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.03),
    rgba(255, 240, 200, 0.05),
    transparent
  );
  animation: gc-shimmer 7s infinite ease-in-out;
  pointer-events: none;
}
@keyframes gc-shimmer {
  0% { left: -100%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

/* Card content */
.gc-content {
  position: relative;
  z-index: 2;
  padding: 22px 26px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top section */
.gc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.gc-brand { display: flex; align-items: center; gap: 10px; }
.gc-logo {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 50%, var(--gc-emerald), var(--gc-emerald-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(15, 74, 56, 0.5), 0 0 0 0.5px rgba(212, 175, 55, 0.15);
}
.gc-logo svg { width: 48px; height: 48px; overflow: visible; }
.gc-brand-text { display: flex; flex-direction: column; gap: 1px; }
.gc-name {
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gc-text-light);
  letter-spacing: 2px;
}
.gc-sub {
  font-size: 8px;
  color: var(--gc-text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

/* VIP badge */
.gc-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--gc-gold-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(184, 148, 31, 0.04));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Platform icon */
.gc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.gc-icon svg { width: 14px; height: 14px; display: block; fill: currentColor; }
.gc-icon.android svg { width: 18px; height: 18px; }

/* Platform tag under code */
.gc-platform-tag {
  font-size: 8px;
  color: var(--gc-text-muted);
  letter-spacing: 1.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

/* Middle: Code */
.gc-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.gc-label-cn {
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  font-size: 10px;
  color: var(--gc-text-muted);
  letter-spacing: 3px;
  margin-bottom: 2px;
}
.gc-code {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 2.5px;
  background: linear-gradient(135deg, var(--gc-gold-light) 0%, var(--gc-gold) 50%, var(--gc-gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  user-select: all;
  cursor: text;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.gc-code:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.2));
}

/* Bottom section */
.gc-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.gc-qr-area { display: flex; flex-direction: column; gap: 4px; }
.gc-qr {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: #fff;
  padding: 3px;
}
.gc-qr img { width: 100%; height: 100%; border-radius: 4px; display: block; }
.gc-qr-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 8px;
  line-height: 1.3;
  color: #6b7280;
}
.gc-scan { font-size: 8px; color: var(--gc-text-muted); letter-spacing: 1px; }
.gc-redeem {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  min-width: 0;
  cursor: pointer;
}
.gc-redeem-label {
  font-size: 9px;
  color: var(--gc-text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gc-link {
  display: block;
  width: 100%;
  max-width: 250px;
  font-size: 8px;
  color: rgba(212, 175, 55, 0.7);
  word-break: break-all;
  line-height: 1.4;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
  user-select: all;
}
.gc-link:hover { color: rgba(249, 240, 208, 0.9); }

/* Decorative pattern */
.gc-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image:
    repeating-linear-gradient(45deg, var(--gc-gold) 0, var(--gc-gold) 0.5px, transparent 0.5px, transparent 24px),
    repeating-linear-gradient(-45deg, var(--gc-gold) 0, var(--gc-gold) 0.5px, transparent 0.5px, transparent 24px);
  pointer-events: none;
}

/* Corner decoration */
.gc-corner {
  position: absolute;
  width: 70px;
  height: 70px;
  pointer-events: none;
  opacity: 0.12;
}
.gc-corner.tr {
  top: 0;
  right: 0;
  background: radial-gradient(circle at top right, var(--gc-gold), transparent 65%);
}
.gc-corner.bl {
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at bottom left, var(--gc-emerald-light), transparent 65%);
}

/* Lightbulb watermark */
.gc-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  opacity: 0.015;
  pointer-events: none;
  z-index: 0;
}
.gc-watermark svg { width: 100%; height: 100%; }

/* Card copy overlay */
.gc-copy-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(184, 148, 31, 0.08));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 12px;
  padding: 10px 24px;
  color: var(--gc-gold-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}
.gc-card:hover .gc-copy-btn { opacity: 1; pointer-events: auto; }
.gc-copy-btn:active { transform: translate(-50%, -50%) scale(0.95); }

/* Top-right share / download buttons */
.gc-share-btn,
.gc-download-btn {
  position: absolute;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gc-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s ease;
  z-index: 20;
}
.gc-share-btn { right: 42px; }
.gc-download-btn { right: 8px; }
.gc-card:hover .gc-share-btn,
.gc-card:hover .gc-download-btn { opacity: 1; }
.gc-share-btn:hover,
.gc-download-btn:hover { background: rgba(212, 175, 55, 0.3); }
.gc-share-btn svg,
.gc-download-btn svg { width: 13px; height: 13px; display: block; }
.gc-share-btn.is-hidden { display: none; }

/* Wrapper used to fit the fixed 440x275 card into a responsive column. */
.gc-fit {
  position: relative;
  width: 100%;
}

/* Capture mode: same pixels as the original download, no hover/shimmer/action layers. */
.gc-card.gc-capturing {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}
.gc-card.gc-capturing .gc-shimmer,
.gc-card.gc-capturing .gc-copy-btn,
.gc-card.gc-capturing .gc-share-btn,
.gc-card.gc-capturing .gc-download-btn {
  display: none !important;
}

@media print {
  .gc-card {
    transform: none !important;
    box-shadow: none !important;
    border-radius: 0;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .gc-card:last-child { page-break-after: auto; break-after: auto; }
  .gc-shimmer,
  .gc-copy-btn,
  .gc-share-btn,
  .gc-download-btn { display: none !important; }
}
