/* ============================================
   Ledian Spa - Premium Member Card
   ============================================ */

:root {
  --gold: #B8965A;
  --gold-light: #D4B87A;
  --gold-dark: #8A6F3E;
  --silver: #A8B4C0;
  --silver-light: #C8D4E0;
  --diamond-gold: #C9A84C;
  --bg: #0a0a0f;
  --card-bg: #141420;
  --card-border: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);
  --line-green: #06C755;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Loading Screen
   ============================================ */

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loading-logo {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--gold);
}

.spinner {
  width: 40px;
  height: 40px;
  position: relative;
}

.spinner-ring {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(184, 150, 90, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ============================================
   Consent Screen
   ============================================ */

.consent-container {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.consent-logo {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 8px;
}

.consent-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 6px;
  color: var(--text-dim);
  margin-bottom: 32px;
  text-transform: uppercase;
}

.consent-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.consent-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-icon {
  color: var(--gold);
  flex-shrink: 0;
  display: flex;
}

.feature-item span {
  font-size: 13px;
  color: var(--text-dim);
}

.consent-box {
  text-align: left;
  margin-bottom: 20px;
}

.consent-box label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s;
}

.consent-box label:active {
  border-color: rgba(184, 150, 90, 0.3);
}

.consent-box input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.consent-box input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--gold);
  border-color: var(--gold);
}

.consent-box input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 6px;
  height: 10px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-label {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

.consent-label a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-ghost {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  margin-top: 8px;
  transition: color 0.2s;
}

.btn-ghost:active {
  color: var(--text-dim);
}

.btn-checkin {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: var(--line-green);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 24px rgba(6, 199, 85, 0.3);
}

.btn-checkin:active {
  transform: scale(0.97);
}

.btn-checkin:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkin-icon {
  flex-shrink: 0;
}

/* ============================================
   Profile Screen
   ============================================ */

.profile-container {
  width: 100%;
  max-width: 380px;
}

.profile-header {
  text-align: center;
  margin-bottom: 36px;
}

.profile-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.profile-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 28px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 12px;
}

.radio-group {
  display: flex;
  gap: 8px;
}

.radio-btn {
  flex: 1;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.radio-btn.selected {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  font-weight: 600;
}

.radio-btn:active {
  transform: scale(0.97);
}

/* ============================================
   Card Screen
   ============================================ */

#card-screen {
  justify-content: flex-start;
  padding-top: 16px;
  padding-bottom: 40px;
}

.card-screen-inner {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* User header */
.user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-name {
  font-size: 15px;
  font-weight: 600;
}

.user-total {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   The Member Card
   ============================================ */

.member-card {
  position: relative;
  border-radius: 20px;
  padding: 28px 24px;
  overflow: hidden;
  transition: all 0.5s ease;
}

.card-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.card-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.card-content {
  position: relative;
  z-index: 1;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.card-logo {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
}

.card-rank {
  display: flex;
  align-items: center;
}

.rank-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid;
}

.card-bottom {
  text-align: center;
  margin-top: 24px;
}

.point-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.point-current {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font-serif);
}

.point-separator {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
  margin: 0 2px;
}

.point-max {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
}

.next-reward {
  font-size: 13px;
  margin-top: 8px;
  letter-spacing: 0.3px;
}

/* ============================================
   Stamp Grid
   ============================================ */

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.35s ease;
  position: relative;
}

.stamp-number {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.4;
}

.stamp-fill {
  display: none;
}

.stamp.filled .stamp-fill {
  display: block;
}

.stamp.filled .stamp-number {
  display: none;
}

.stamp.filled {
  animation: stampPop 0.4s ease-out;
}

@keyframes stampPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* Stamp SVG - the checkmark/star inside filled stamps */
.stamp-fill svg {
  width: 18px;
  height: 18px;
}

/* 10th stamp (reward) */
.stamp.reward-stamp {
  position: relative;
}

.stamp.reward-stamp .stamp-number {
  opacity: 0.6;
}

/* ============================================
   Rank: Regular (0-29)
   ============================================ */

.rank-regular {
  background: linear-gradient(145deg, #161628 0%, #1a1a32 50%, #141426 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.rank-regular .card-logo {
  color: rgba(255, 255, 255, 0.85);
}

.rank-regular .rank-label {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.rank-regular .stamp {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
}

.rank-regular .stamp.filled {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
}

.rank-regular .stamp.reward-stamp {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
}

.rank-regular .point-current {
  color: #fff;
}

.rank-regular .next-reward {
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Rank: Gold (30-99)
   ============================================ */

.rank-gold {
  background: linear-gradient(145deg, #1a1610 0%, #1e1a12 40%, #181408 100%);
  border: 1px solid rgba(184, 150, 90, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(184, 150, 90, 0.06);
}

.rank-gold .card-shine {
  background: radial-gradient(ellipse at 30% 20%, rgba(184, 150, 90, 0.08) 0%, transparent 60%);
  opacity: 1;
}

.rank-gold .card-logo {
  color: var(--gold-light);
}

.rank-gold .rank-label {
  color: var(--gold);
  border-color: rgba(184, 150, 90, 0.35);
  background: rgba(184, 150, 90, 0.1);
}

.rank-gold .stamp {
  background: rgba(184, 150, 90, 0.05);
  border: 1.5px solid rgba(184, 150, 90, 0.15);
}

.rank-gold .stamp .stamp-number {
  color: rgba(184, 150, 90, 0.35);
}

.rank-gold .stamp.filled {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-color: var(--gold);
  color: #0a0a0f;
  box-shadow: 0 2px 8px rgba(184, 150, 90, 0.3);
}

.rank-gold .stamp.reward-stamp {
  border-style: dashed;
  border-color: rgba(184, 150, 90, 0.3);
}

.rank-gold .stamp.reward-stamp .stamp-number {
  color: var(--gold);
}

.rank-gold .point-current {
  color: var(--gold-light);
}

.rank-gold .next-reward {
  color: rgba(184, 150, 90, 0.5);
}

/* ============================================
   Rank: Platinum (100-199)
   ============================================ */

.rank-platinum {
  background: linear-gradient(145deg, #12141a 0%, #181c24 40%, #10121a 100%);
  border: 1px solid rgba(168, 180, 192, 0.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(168, 180, 192, 0.05);
}

.rank-platinum .card-shine {
  background: linear-gradient(
    135deg,
    transparent 20%,
    rgba(200, 212, 224, 0.06) 40%,
    rgba(200, 212, 224, 0.1) 50%,
    rgba(200, 212, 224, 0.06) 60%,
    transparent 80%
  );
  opacity: 1;
  animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-30%) translateY(-30%) rotate(25deg); }
  50% { transform: translateX(10%) translateY(10%) rotate(25deg); }
}

.rank-platinum .card-logo {
  color: var(--silver-light);
}

.rank-platinum .rank-label {
  color: var(--silver-light);
  border-color: rgba(168, 180, 192, 0.35);
  background: rgba(168, 180, 192, 0.1);
}

.rank-platinum .stamp {
  background: rgba(168, 180, 192, 0.04);
  border: 1.5px solid rgba(168, 180, 192, 0.15);
}

.rank-platinum .stamp .stamp-number {
  color: rgba(168, 180, 192, 0.35);
}

.rank-platinum .stamp.filled {
  background: linear-gradient(135deg, #7A8A9A, var(--silver-light));
  border-color: var(--silver);
  color: #0a0a0f;
  box-shadow: 0 2px 8px rgba(168, 180, 192, 0.25);
}

.rank-platinum .stamp.reward-stamp {
  border-style: dashed;
  border-color: rgba(168, 180, 192, 0.3);
}

.rank-platinum .stamp.reward-stamp .stamp-number {
  color: var(--silver);
}

.rank-platinum .point-current {
  color: var(--silver-light);
}

.rank-platinum .next-reward {
  color: rgba(168, 180, 192, 0.5);
}

/* ============================================
   Rank: Diamond (200+)
   ============================================ */

.rank-diamond {
  background: linear-gradient(145deg, #0e0e0e 0%, #151515 40%, #0a0a0a 100%);
  border: 1px solid rgba(201, 168, 76, 0.25);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(201, 168, 76, 0.08),
    inset 0 1px 0 rgba(201, 168, 76, 0.15);
}

.rank-diamond .card-shine {
  background: linear-gradient(
    135deg,
    transparent 20%,
    rgba(201, 168, 76, 0.05) 35%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(201, 168, 76, 0.05) 65%,
    transparent 80%
  );
  opacity: 1;
  animation: shimmer 3.5s ease-in-out infinite;
}

.rank-diamond .card-pattern {
  opacity: 0.04;
  background-image:
    linear-gradient(60deg, transparent 47%, rgba(201, 168, 76, 1) 49%, rgba(201, 168, 76, 1) 51%, transparent 53%),
    linear-gradient(-60deg, transparent 47%, rgba(201, 168, 76, 1) 49%, rgba(201, 168, 76, 1) 51%, transparent 53%);
  background-size: 30px 52px;
}

.rank-diamond .card-logo {
  color: var(--diamond-gold);
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.rank-diamond .rank-label {
  color: var(--diamond-gold);
  border-color: rgba(201, 168, 76, 0.4);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
}

.rank-diamond .stamp {
  background: rgba(201, 168, 76, 0.04);
  border: 1.5px solid rgba(201, 168, 76, 0.15);
}

.rank-diamond .stamp .stamp-number {
  color: rgba(201, 168, 76, 0.3);
}

.rank-diamond .stamp.filled {
  background: linear-gradient(135deg, #8A6F2E, var(--diamond-gold));
  border-color: var(--diamond-gold);
  color: #0a0a0a;
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.35);
}

.rank-diamond .stamp.reward-stamp {
  border-style: dashed;
  border-color: rgba(201, 168, 76, 0.35);
}

.rank-diamond .stamp.reward-stamp .stamp-number {
  color: var(--diamond-gold);
}

.rank-diamond .point-current {
  color: var(--diamond-gold);
  text-shadow: 0 0 16px rgba(201, 168, 76, 0.3);
}

.rank-diamond .next-reward {
  color: rgba(201, 168, 76, 0.5);
}

/* ============================================
   Check-in Section
   ============================================ */

.checkin-section {
  width: 100%;
}

.checkin-store {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

/* ============================================
   History Section
   ============================================ */

.history-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--card-border);
}

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

.history-header h3 {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.history-count {
  font-size: 11px;
  color: var(--text-muted);
}

.history-list {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.history-item:last-child {
  border-bottom: none;
}

.history-date {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.history-store {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}

.empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

/* ============================================
   Check-in Done Screen
   ============================================ */

.done-container {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.done-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--line-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: popIn 0.5s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.done-check {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawCheck 0.5s ease-out 0.3s forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.done-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.done-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Cycle complete banner */
.cycle-banner {
  margin-bottom: 24px;
}

.cycle-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(184, 150, 90, 0.15), rgba(184, 150, 90, 0.05));
  border: 1px solid rgba(184, 150, 90, 0.25);
  border-radius: 14px;
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 600;
  animation: bannerGlow 2s ease-in-out infinite alternate;
}

@keyframes bannerGlow {
  from { box-shadow: 0 0 20px rgba(184, 150, 90, 0.1); }
  to { box-shadow: 0 0 30px rgba(184, 150, 90, 0.2); }
}

/* ============================================
   Error Screen
   ============================================ */

.error-container {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.error-icon {
  color: #FF6B6B;
  margin-bottom: 20px;
}

.error-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ============================================
   Celebration Overlay
   ============================================ */

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease;
}

.celebration-card {
  text-align: center;
  padding: 40px 32px;
  background: var(--card-bg);
  border: 1px solid rgba(184, 150, 90, 0.3);
  border-radius: 24px;
  max-width: 320px;
  width: 90%;
  animation: popIn 0.5s ease-out;
}

.celebration-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.celebration-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.celebration-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 24px;
}

.celebration-dismiss {
  padding: 12px 32px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* ============================================
   Rank-up animation
   ============================================ */

.rank-up-flash {
  animation: rankUpFlash 0.8s ease-out;
}

@keyframes rankUpFlash {
  0% { filter: brightness(1); }
  30% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

/* ============================================
   Utilities & Responsive
   ============================================ */

@media (max-width: 360px) {
  .stamp-grid {
    gap: 8px;
  }

  .member-card {
    padding: 24px 20px;
  }

  .point-current {
    font-size: 40px;
  }
}

/* ====== Rewards Section ====== */
.rewards-section {
  margin-top: 24px;
  padding-bottom: 40px;
}

.rewards-title {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Free ticket reward card */
.reward-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.reward-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(184, 150, 90, 0.1);
  border: 1px solid rgba(184, 150, 90, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

.reward-info { flex: 1; }
.reward-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.reward-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.reward-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reward-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.reward-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 3px;
  transition: width 0.6s ease;
}
.reward-progress-text {
  font-size: 12px;
  color: var(--text-dim);
  min-width: 36px;
  text-align: right;
}

/* Rank list */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  transition: background 0.2s;
}

.rank-item.current {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rank-item-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-badge-regular { color: #6a7a9a; background: rgba(106, 122, 154, 0.15); }
.rank-badge-gold { color: var(--gold); background: rgba(184, 150, 90, 0.15); }
.rank-badge-platinum { color: var(--silver); background: rgba(168, 180, 192, 0.15); }
.rank-badge-diamond { color: var(--diamond-gold); background: rgba(201, 168, 76, 0.15); }

.rank-item-info { flex: 1; }
.rank-item-name {
  font-size: 14px;
  font-weight: 600;
}
.rank-item-condition {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.rank-item-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.rank-item-status.achieved {
  background: rgba(184, 150, 90, 0.15);
  color: var(--gold);
}
.rank-item-status.current-rank {
  background: var(--gold);
  color: #0a0a0f;
  font-weight: 700;
}
.rank-item-status.locked {
  color: var(--text-muted);
}

/* Rank benefits */
.rank-benefits {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
}

.benefits-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dim);
}

.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.benefit-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(184, 150, 90, 0.1);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefit-text {
  color: var(--text-dim);
}

/* ============================================
   Coupons Section
   ============================================ */

.coupons-section {
  margin-top: 24px;
}

.coupons-title {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 12px;
}

.coupons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coupon-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  transition: all 0.2s;
}

.coupon-unused {
  background: linear-gradient(135deg, rgba(184, 150, 90, 0.12), rgba(184, 150, 90, 0.04));
  border: 1px solid rgba(184, 150, 90, 0.2);
}

.coupon-used {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0.5;
}

.coupon-card-left {
  flex-shrink: 0;
}

.coupon-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coupon-icon-ticket {
  background: rgba(184, 150, 90, 0.15);
  color: var(--gold);
}

.coupon-icon-star {
  background: rgba(184, 150, 90, 0.15);
  color: var(--gold-light);
}

.coupon-icon-diamond {
  background: rgba(201, 168, 76, 0.15);
  color: var(--diamond-gold);
}

.coupon-icon-used {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.coupon-card-center {
  flex: 1;
  min-width: 0;
}

.coupon-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coupon-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.coupon-card-right {
  flex-shrink: 0;
}

.btn-coupon-show {
  padding: 8px 16px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-coupon-show:active {
  opacity: 0.7;
}

.coupon-used-badge {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

/* ============================================
   Coupon Modal
   ============================================ */

.coupon-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.coupon-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.2s ease;
}

.coupon-modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  padding: 32px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  animation: slideUp 0.3s ease;
}

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

.coupon-modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.coupon-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(184, 150, 90, 0.1);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.coupon-modal-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.coupon-modal-warning {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================
   Slide to Confirm
   ============================================ */

.slider-track {
  position: relative;
  width: 100%;
  height: 56px;
  background: rgba(184, 150, 90, 0.1);
  border: 1px solid rgba(184, 150, 90, 0.2);
  border-radius: 28px;
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.slider-thumb {
  position: absolute;
  left: 2px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 2;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(184, 150, 90, 0.3);
}

.slider-thumb:active {
  cursor: grabbing;
}

.slider-label {
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 1;
}

.slider-track.confirmed {
  background: rgba(6, 199, 85, 0.15);
  border-color: rgba(6, 199, 85, 0.3);
}

.slider-track.confirmed .slider-thumb {
  background: var(--line-green);
}

.slider-track.confirmed .slider-label {
  color: var(--line-green);
}

.btn-coupon-cancel {
  width: 100%;
  padding: 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--text-dim);
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* ============================================
   Coupon Proof Screen (Anti-fraud)
   ============================================ */

.coupon-proof {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.proof-bg-anim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(6, 199, 85, 0.08) 0%,
    rgba(184, 150, 90, 0.06) 25%,
    rgba(6, 199, 85, 0.04) 50%,
    rgba(184, 150, 90, 0.08) 75%,
    rgba(6, 199, 85, 0.06) 100%
  );
  background-size: 400% 400%;
  animation: proofGradient 6s ease infinite;
}

@keyframes proofGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.proof-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 32px;
  width: 90%;
  max-width: 340px;
}

.proof-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--line-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: popIn 0.5s ease-out;
}

.proof-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--line-green);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.proof-coupon-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
}

.proof-divider {
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 auto 24px;
}

.proof-user {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.proof-time-container {
  position: relative;
  display: inline-block;
  margin-bottom: 32px;
}

.proof-time {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--line-green);
  text-shadow: 0 0 20px rgba(6, 199, 85, 0.3);
}

.proof-time-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  border-radius: 12px;
  border: 1px solid rgba(6, 199, 85, 0.2);
  animation: proofPulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes proofPulse {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.proof-notice {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-proof-close {
  padding: 12px 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--text-dim);
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* ============================================
   Rank Up Celebration
   ============================================ */

.rankup-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  animation: fadeIn 0.3s ease;
  overflow: hidden;
}

.rankup-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: currentColor;
  animation: particleBurst 1.2s ease-out forwards;
  animation-delay: inherit;
  opacity: 0;
}

@keyframes particleBurst {
  0% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--distance) * -1));
    opacity: 0;
  }
}

.rankup-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 28px;
  max-width: 340px;
  width: 90%;
}

.rankup-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  animation: fadeIn 0.3s ease 0.3s both;
}

.rankup-badge {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: rankBadgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

.rankup-badge svg {
  width: 44px;
  height: 44px;
}

@keyframes rankBadgePop {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.rankup-label {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 6px;
  font-weight: 600;
  margin-bottom: 8px;
  animation: fadeIn 0.4s ease 0.5s both;
}

.rankup-rank {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
  animation: fadeIn 0.4s ease 0.6s both;
}

.rankup-message {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 28px;
  animation: fadeIn 0.4s ease 0.7s both;
}

.rankup-benefits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.rankup-benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  animation: benefitSlideIn 0.4s ease both;
}

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

.rankup-benefit-check {
  flex-shrink: 0;
  font-size: 12px;
}

.btn-rankup-dismiss {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  animation: fadeIn 0.4s ease 1.2s both;
}

/* Skip animation */
.rankup-skip,
.rankup-skip * {
  animation-duration: 0.01s !important;
  animation-delay: 0s !important;
}

/* --- Gold Rank Up --- */
.rankup-gold {
  color: var(--gold);
}

.rankup-gold .rankup-badge {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: var(--bg);
  box-shadow: 0 0 40px rgba(184, 150, 90, 0.3);
}

.rankup-gold .particle {
  color: var(--gold);
}

.rankup-gold .rankup-label {
  color: var(--gold);
}

.rankup-gold .rankup-rank {
  color: var(--gold-light);
  text-shadow: 0 0 20px rgba(184, 150, 90, 0.4);
}

.rankup-gold .rankup-benefit-item {
  background: rgba(184, 150, 90, 0.1);
  border: 1px solid rgba(184, 150, 90, 0.15);
  color: var(--gold-light);
}

.rankup-gold .rankup-benefit-check {
  color: var(--gold);
}

.rankup-gold .btn-rankup-dismiss {
  background: var(--gold);
  color: var(--bg);
}

/* --- Platinum Rank Up --- */
.rankup-platinum {
  color: var(--silver);
}

.rankup-platinum .rankup-badge {
  background: linear-gradient(135deg, #7A8A9A, var(--silver-light));
  color: var(--bg);
  box-shadow: 0 0 40px rgba(168, 180, 192, 0.3);
}

.rankup-platinum .particle {
  color: var(--silver-light);
}

.rankup-platinum .rankup-label {
  color: var(--silver);
}

.rankup-platinum .rankup-rank {
  color: var(--silver-light);
  text-shadow: 0 0 20px rgba(168, 180, 192, 0.4);
}

.rankup-platinum .rankup-benefit-item {
  background: rgba(168, 180, 192, 0.08);
  border: 1px solid rgba(168, 180, 192, 0.15);
  color: var(--silver-light);
}

.rankup-platinum .rankup-benefit-check {
  color: var(--silver);
}

.rankup-platinum .btn-rankup-dismiss {
  background: var(--silver);
  color: var(--bg);
}

/* --- Diamond Rank Up --- */
.rankup-diamond {
  color: var(--diamond-gold);
}

.rankup-diamond .rankup-badge {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  color: var(--diamond-gold);
  box-shadow: 0 0 60px rgba(201, 168, 76, 0.3);
  border: 2px solid rgba(201, 168, 76, 0.4);
}

.rankup-diamond .particle {
  color: var(--diamond-gold);
}

.rankup-diamond .rankup-label {
  color: var(--diamond-gold);
}

.rankup-diamond .rankup-rank {
  color: var(--diamond-gold);
  text-shadow: 0 0 30px rgba(201, 168, 76, 0.5);
}

.rankup-diamond .rankup-benefit-item {
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: var(--diamond-gold);
}

.rankup-diamond .rankup-benefit-check {
  color: var(--diamond-gold);
}

.rankup-diamond .btn-rankup-dismiss {
  background: linear-gradient(135deg, var(--gold-dark), var(--diamond-gold));
  color: var(--bg);
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .rankup-overlay *,
  .rankup-overlay *::before,
  .rankup-overlay *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #card-screen {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}
