/* Shared loyalty card face — used in create preview, kartlar list, chat attach, etc. */

.live-card {
  --stamp-fill: #c8ff1a;
  position: relative;
  width: min(100%, 280px);
  margin-inline: auto;
  aspect-ratio: 0.74;
  padding: 28px 24px 24px;
  border-radius: 28px;
  background: #111111;
  color: #fff;
  box-shadow:
    0 24px 48px rgba(17, 17, 17, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background 280ms ease, box-shadow 200ms ease, transform 280ms ease;
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
}

/* Plastic / PVC gloss */
.live-card::before {
  content: "";
  position: absolute;
  top: -45%;
  left: -30%;
  width: 58%;
  height: 170%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.16) 45%,
    rgba(255, 255, 255, 0.02) 55%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  z-index: 4;
}

.live-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.26) 0%,
      rgba(255, 255, 255, 0.08) 16%,
      rgba(255, 255, 255, 0.02) 32%,
      transparent 48%,
      transparent 70%,
      rgba(255, 255, 255, 0.03) 84%,
      rgba(0, 0, 0, 0.16) 100%
    );
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.32),
    inset 0 -2px 8px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.live-card > * {
  position: relative;
  z-index: 1;
}

.live-card--sm {
  width: min(100%, 220px);
  aspect-ratio: 0.78;
  padding: 18px 16px 16px;
  border-radius: 22px;
}

.live-card--sm .live-card-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.live-card--sm .live-card-title {
  font-size: 15px;
}

.live-card--sm .live-card-reward {
  font-size: 12px;
  margin-bottom: 14px;
}

.live-card--attach {
  width: 100%;
  max-width: 280px;
  margin: 0;
  pointer-events: none;
  animation: none;
  transform: none !important;
}

@media (max-width: 991.98px) {
  .live-card {
    width: min(100%, 230px);
    aspect-ratio: 0.78;
    padding: 20px 18px 18px;
    border-radius: 22px;
  }

  .live-card-title {
    font-size: 16px;
  }

  .live-card--attach {
    width: 100%;
    max-width: 240px;
  }
}

.live-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.live-card-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.live-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-card-logo svg {
  width: 24px;
  height: 24px;
  color: #c8ff1a;
  stroke-width: 1.8;
}

.live-card-business {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  margin: 0;
}

.live-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 8px;
  line-height: 1.2;
}

h1.live-card-title {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  margin: inherit;
  line-height: inherit;
}

.live-card-reward {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
  margin: 0 0 20px;
  min-height: 1.4em;
}

.live-card-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: auto;
  margin-bottom: 14px;
}

.live-stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.live-stamp.is-filled {
  background: var(--stamp-fill, #c8ff1a);
  border-color: var(--stamp-fill, #c8ff1a);
  color: var(--stamp-ink, #111111);
}

.live-stamp.has-mark::after {
  display: none;
}

.live-stamp svg {
  width: 55%;
  height: 55%;
  stroke-width: 2.4;
  color: inherit;
}

.live-stamp-img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  border-radius: 50%;
}

.live-card-meta {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.02em;
  margin: 0;
}

.live-card-points {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}

.live-card-points > span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: 999px;
}

.live-card-cashback {
  width: 100%;
  margin-top: auto;
  margin-bottom: 14px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid transparent;
  text-align: center;
  box-sizing: border-box;
}

.live-card-cashback-rate {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.live-card-cashback-label {
  margin: 2px 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-card-cashback-balance {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.live-card-cashback-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.live-card-cashback-unit {
  font-size: 12px;
  font-weight: 500;
}

.live-card-cashback-hint {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.live-card--sm .live-card-cashback {
  padding: 10px 10px 8px;
  border-radius: 14px;
  margin-bottom: 10px;
}

.live-card--sm .live-card-cashback-rate {
  font-size: 22px;
}

.live-card--sm .live-card-cashback-value {
  font-size: 18px;
}

.live-card--points .live-card-reward {
  margin-bottom: 12px;
}

.live-card--points {
  aspect-ratio: auto;
  min-height: 320px;
  height: auto;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
}

.live-card--points .live-card-title {
  font-size: clamp(15px, 4.2vw, 18px);
  letter-spacing: 0.03em;
  max-width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.live-card--points .live-card-reward {
  font-size: 12px;
  margin-bottom: 10px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.live-card--points .live-card-cashback {
  flex: 0 0 auto;
}

.live-card--points .live-card-meta {
  margin-top: 2px;
}

.live-card--sm.live-card--points {
  min-height: 260px;
  padding: 16px 14px 14px;
}

@media (max-width: 991.98px) {
  .live-card--points {
    min-height: 0;
    padding: 16px 14px 14px;
  }

  .live-card--points .live-card-top {
    gap: 6px;
    margin-bottom: 10px;
  }

  .live-card--points .live-card-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .live-card--points .live-card-title {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .live-card--points .live-card-reward {
    font-size: 11px;
    margin-bottom: 8px;
    line-height: 1.35;
  }

  .live-card--points .live-card-cashback {
    padding: 10px 10px 8px;
    border-radius: 14px;
    margin-bottom: 10px;
  }

  .live-card--points .live-card-cashback-rate {
    font-size: 22px;
  }

  .live-card--points .live-card-cashback-label {
    margin: 2px 0 6px;
    font-size: 10px;
  }

  .live-card--points .live-card-cashback-balance {
    margin-bottom: 4px;
  }

  .live-card--points .live-card-cashback-value {
    font-size: 18px;
  }

  .live-card--points .live-card-cashback-unit {
    font-size: 11px;
  }

  .live-card--points .live-card-cashback-hint {
    font-size: 10px;
    line-height: 1.3;
  }

  .live-card--attach.live-card--points {
    max-width: 260px;
  }
}

/* List tile wrapping the shared face */
.loyalty-card-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--dash-line, rgba(17, 17, 17, 0.07));
  background: transparent;
  transition: background 160ms ease;
}

.loyalty-card-tile:last-child {
  border-bottom: 0;
}

.loyalty-card-tile:hover {
  background: rgba(200, 255, 26, 0.06);
}

.loyalty-card-tile-actions {
  display: inline-flex;
  gap: 6px;
}

.loyalty-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--dash-line, rgba(17, 17, 17, 0.07));
  overflow: hidden;
}

@media (min-width: 900px) {
  .loyalty-card-tile {
    border-right: 1px solid var(--dash-line, rgba(17, 17, 17, 0.07));
  }

  .loyalty-card-tile:nth-child(2n) {
    border-right: 0;
  }
}

@media (min-width: 1200px) {
  .loyalty-card-tile:nth-child(2n) {
    border-right: 1px solid var(--dash-line, rgba(17, 17, 17, 0.07));
  }

  .loyalty-card-tile:nth-child(3n) {
    border-right: 0;
  }
}
