/* Coupon ticket design (2026-12-07) — shop coupon cards become real
   ticket stubs: perforated tear line, semicircular notches, a big
   discount stub, barcode + serial. Used by rewards.html (#spend
   service-coupon grid) and coupons.html (get / achievement grids).
   Purely visual: purchase / claim logic is untouched. */
.cpn-ticket {
  --stubw: 94px;
  position: relative;
  display: flex;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 215, 0, 0.08), rgba(138, 43, 226, 0.10) 52%, rgba(255, 255, 255, 0.03));
}
/* semicircular notches punched at the perforation, top and bottom */
.cpn-ticket::before,
.cpn-ticket::after {
  content: "";
  position: absolute;
  left: var(--stubw);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #05081a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}
.cpn-ticket::before { top: -11px; }
.cpn-ticket::after { bottom: -11px; }

/* --- the stub (left tear-off part) --- */
.ct-stub {
  flex: 0 0 var(--stubw);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px 12px;
  text-align: center;
  color: #241a02;
  background: linear-gradient(165deg, #ffe45e 0%, #ffd700 42%, #f0a51a 78%, #dd8a06 100%);
  border-right: 2px dashed rgba(36, 26, 2, 0.42);
}
.ct-stub.cb {
  color: #f3eaff;
  background: linear-gradient(165deg, #7b2ff7 0%, #5b21b6 58%, #3b1478 100%);
  border-right-color: rgba(255, 255, 255, 0.42);
}
.ct-stub.credit {
  color: #ffd700;
  background: linear-gradient(165deg, #2b2160 0%, #1a1440 60%, #100c2c 100%);
  border-right-color: rgba(255, 215, 0, 0.45);
}
.ct-brand {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  opacity: 0.78;
}
.ct-off {
  margin-top: 8px;
  font-size: 2.05rem;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ct-off small { font-size: 1.02rem; font-weight: 900; }
.ct-label {
  margin-top: 3px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ct-barcode {
  margin-top: auto;
  width: 72%;
  height: 26px;
  opacity: 0.55;
  background: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 4px,
    currentColor 4px 7px, transparent 7px 9px,
    currentColor 9px 10px, transparent 10px 14px,
    currentColor 14px 17px, transparent 17px 19px,
    currentColor 19px 20px, transparent 20px 23px);
}
.ct-serial {
  margin-top: 6px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0.8;
  white-space: nowrap;
}

/* --- the main part --- */
.ct-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 16px;
}
.ct-main .rw-spend-img {
  aspect-ratio: 16 / 7;
  margin-bottom: 10px;
}
.ct-main h3 { overflow-wrap: break-word; }
.ct-main .rw-sub { margin-bottom: 10px; }
.ct-main .rw-limit { margin: 0 0 10px; }
.ct-main .btn { margin-top: auto; width: 100%; }

@media (max-width: 480px) {
  .cpn-ticket { --stubw: 84px; }
  .ct-off { font-size: 1.8rem; }
  .ct-off small { font-size: 0.92rem; }
  .ct-main { padding: 12px 12px 14px; }
}
