.loyalty-page {
  --loyalty-green: var(--fp-green, #1D6B3A);
  --loyalty-orange: var(--fp-orange, #F57C00);
}

/* Hero */
.loyalty-hero {
  position: relative;
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(29, 107, 58, 0.12) 0%, rgba(245, 124, 0, 0.08) 50%, rgba(245, 243, 238, 0.9) 100%);
  border: 1px solid rgba(29, 107, 58, 0.12);
  box-shadow: 0 8px 32px rgba(29, 107, 58, 0.08);
}

.loyalty-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 107, 58, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.loyalty-hero-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: #fff;
  color: var(--loyalty-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
  box-shadow: 0 4px 16px rgba(29, 107, 58, 0.15);
  position: relative;
  z-index: 1;
}

.loyalty-hero-title {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.loyalty-hero-rule {
  font-size: 0.9375rem;
  color: rgba(0, 0, 0, 0.65);
  margin-top: 0.5rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

/* Stats */
.loyalty-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.loyalty-stat {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  text-align: center;
}

.loyalty-stat-value {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--loyalty-green);
  line-height: 1.2;
}

.loyalty-stat-label {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
  margin-top: 0.15rem;
}

/* Rule cards */
.loyalty-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .loyalty-rules {
    grid-template-columns: 1fr;
  }
}

.loyalty-rule-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.loyalty-rule-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(29, 107, 58, 0.1);
  color: var(--loyalty-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.loyalty-rule-card-title {
  font-weight: 600;
  font-size: 0.8125rem;
}

.loyalty-rule-card-desc {
  font-size: 0.6875rem;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 0.2rem;
}

/* Layout grid */
.loyalty-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .loyalty-grid {
    grid-template-columns: 1fr 340px;
    align-items: start;
  }
}

.loyalty-section-title {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loyalty-winners-panel {
  background: linear-gradient(180deg, #fff 0%, rgba(245, 243, 238, 0.5) 100%);
  border-radius: 1.25rem;
  padding: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
  .loyalty-winners-panel {
    position: sticky;
    top: 5rem;
  }
}

/* Participant list */
.loyalty-rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.loyalty-rank-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.loyalty-rank-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.loyalty-rank-item--complete {
  border-color: rgba(245, 124, 0, 0.25);
  background: linear-gradient(90deg, #fff 0%, rgba(245, 124, 0, 0.04) 100%);
}

.loyalty-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.loyalty-avatar--lg {
  width: 3rem;
  height: 3rem;
}

.loyalty-avatar--winner {
  width: 2.75rem;
  height: 2.75rem;
}

.loyalty-avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  background: rgba(29, 107, 58, 0.12);
  color: var(--loyalty-green);
}

.loyalty-rank-pos {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  background: rgba(29, 107, 58, 0.1);
  color: var(--loyalty-green);
}

.loyalty-rank-pos--top {
  background: var(--loyalty-orange);
  color: #fff;
}

.loyalty-rank-body {
  flex: 1;
  min-width: 0;
}

.loyalty-rank-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.loyalty-rank-meta {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
  margin-top: 0.15rem;
}

.loyalty-progress {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
  margin-top: 0.5rem;
}

.loyalty-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--loyalty-green);
  transition: width 0.35s ease;
}

.loyalty-progress-bar--complete {
  background: var(--loyalty-orange);
}

/* Winners */
.loyalty-winners-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.loyalty-winner-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  transition: transform 0.2s ease;
}

.loyalty-winner-card:hover {
  transform: translateY(-1px);
}

.loyalty-winner-card--gold {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(90deg, #fff 0%, rgba(245, 158, 11, 0.08) 100%);
}

.loyalty-winner-card--silver {
  border-color: rgba(148, 163, 184, 0.35);
  background: linear-gradient(90deg, #fff 0%, rgba(148, 163, 184, 0.08) 100%);
}

.loyalty-winner-card--bronze {
  border-color: rgba(180, 83, 9, 0.3);
  background: linear-gradient(90deg, #fff 0%, rgba(180, 83, 9, 0.06) 100%);
}

.loyalty-winner-medal {
  position: absolute;
  top: -0.375rem;
  left: 0.75rem;
  font-size: 0.625rem;
  font-weight: 800;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  background: var(--loyalty-orange);
  color: #fff;
}

.loyalty-winner-card--silver .loyalty-winner-medal {
  background: #94a3b8;
}

.loyalty-winner-card--bronze .loyalty-winner-medal {
  background: #b45309;
}

.loyalty-winner-body {
  flex: 1;
  min-width: 0;
}

.loyalty-winner-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(245, 124, 0, 0.12);
  color: #c2410c;
}

.loyalty-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(0, 0, 0, 0.5);
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  border: 1px dashed rgba(0, 0, 0, 0.1);
}

.loyalty-search-input {
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  font-size: 0.875rem;
  color: var(--fp-ink, #0E1F16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.loyalty-search-input:focus {
  outline: none;
  border-color: var(--loyalty-green, #1D6B3A);
  box-shadow: 0 0 0 3px rgba(29, 107, 58, 0.12);
}

.loyalty-pagination-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.loyalty-pagination-info {
  font-size: 0.8125rem;
  color: rgba(0, 0, 0, 0.55);
}

.loyalty-pagination-actions {
  display: flex;
  gap: 0.5rem;
}

.loyalty-pagination-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fp-ink, #0E1F16);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.loyalty-pagination-btn:hover:not(:disabled) {
  background: rgba(29, 107, 58, 0.08);
}

.loyalty-pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
