:root {
  --bg-primary: #f0f4ff;
  --bg-secondary: #e8eeff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(0, 159, 232, 0.12);
  --border-active: rgba(0, 159, 232, 0.4);

  --text-primary: #1b232c;
  --text-secondary: #0a7cc4;
  --text-muted: #7c8a99;

  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --gold-dark: #d97706;
  --gold-glow: rgba(245, 158, 11, 0.12);

  --blue: #009FE8;
  --blue-light: #60a5fa;
  --blue-glow: rgba(0, 159, 232, 0.12);
  --green: #10b981;
  --green-light: #34d399;
  --green-glow: rgba(16, 185, 129, 0.12);
  --red: #ef4444;
  --purple: #00bff0;
  --purple-glow: rgba(0, 159, 232, 0.12);
  --pink: #00d4ff;
  --pink-glow: rgba(0, 212, 255, 0.12);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.12);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 159, 232, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 159, 232, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 159, 232, 0.12);
  --shadow-gold: 0 4px 24px rgba(245, 158, 11, 0.2);

  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Poppins', system-ui, sans-serif;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Language Switcher (P1·i18n) ===== */
.lang-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10000;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
  background: var(--blue);
  color: #fff;
}
[dir="rtl"] .lang-switcher { right: auto; left: 12px; }

/* ===== P2 · LAMIPAK result-page components ===== */
.hero-mascot {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin: 0 auto 2px;
  filter: drop-shadow(0 6px 14px rgba(0, 159, 232, 0.3));
}
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 159, 232, 0.12);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
}
.powered-by svg { flex: none; }

/* Trace timeline */
.trace-timeline { display: flex; flex-direction: column; margin-top: 4px; }
.trace-step { position: relative; display: flex; gap: 12px; padding-bottom: 18px; }
.trace-step::before {
  content: '';
  position: absolute;
  left: 6px; top: 16px; bottom: -2px;
  width: 2px;
  background: var(--border-color);
}
.trace-step:last-child::before { display: none; }
.trace-dot {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  margin-top: 3px;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 159, 232, 0.15);
}
.trace-step.current .trace-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}
.trace-info { display: flex; flex-direction: column; gap: 2px; }
.trace-title { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); }
.trace-meta { font-size: 0.74rem; color: var(--text-muted); }

/* Brand video */
.brand-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: #0a2230;
  display: block;
  object-fit: cover;
}

/* Sustainability */
.sustain-lead { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.sustain-badges { display: flex; gap: 10px; }
.sustain-badge {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  background: var(--green-glow);
  text-align: center;
}
.sustain-num { font-size: 1.05rem; font-weight: 800; color: var(--green); line-height: 1; }
.sustain-cap { font-size: 0.66rem; color: var(--text-muted); }

/* RTL: mirror timeline rail */
[dir="rtl"] .trace-step::before { left: auto; right: 6px; }

/* Reward header + compliance (P3·Task 6) */
.reward-header { text-align: center; }
.reward-eyebrow { font-size: 0.8rem; font-weight: 700; color: var(--gold-dark); letter-spacing: 0.02em; margin-bottom: 2px; }
.reward-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 6px; }
.aml-note {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: rgba(0, 159, 232, 0.1);
  border-radius: var(--radius-full);
}
.compliance-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 159, 232, 0.06);
  border: 1px solid var(--border-color);
}
.compliance-note p { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.5; }
.compliance-ur {
  margin-top: 8px;
  font-family: 'Noto Nastaliq Urdu', serif;
  text-align: right;
  line-height: 2;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 10% 10%, rgba(0, 212, 255, 0.12) 0%, transparent 40%),
    radial-gradient(ellipse at 90% 20%, rgba(0, 159, 232, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(0, 159, 232, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 20% 60%, rgba(16, 185, 129, 0.06) 0%, transparent 30%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
}

.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.view.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  position: relative;
}

.view.exit-left {
  opacity: 0;
  transform: translateX(-30px);
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::after {
  opacity: 1;
}

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

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #009FE8, #0086cc);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 159, 232, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(0, 159, 232, 0.45);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.btn-gold:hover {
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 10px 16px;
}

.btn-ghost:hover {
  color: var(--purple);
  background: var(--purple-glow);
}

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 30, 45, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-container {
  position: relative;
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 159, 232, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 159, 232, 0.08);
  border: none;
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.modal-header {
  text-align: center;
  padding: 32px 24px 20px;
  background: linear-gradient(180deg, rgba(0, 159, 232, 0.06) 0%, transparent 100%);
}

.modal-header .shield-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #009FE8, #00bff0);
  border: none;
  border-radius: var(--radius-xl);
  color: white;
  animation: float 3s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(0, 159, 232, 0.3);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.modal-header .brand-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #009FE8, #00bff0, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.modal-header .brand-subtitle {
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.modal-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
}

/* Privacy Notice Title */
.privacy-notice-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-desc {
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.auth-desc-sm {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.auth-desc-sm a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.auth-desc-sm a:hover {
  text-decoration: underline;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-actions .btn {
  padding: 12px 20px;
  font-size: 14px;
}

.auth-footer-links {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.auth-footer-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.auth-footer-links a:hover {
  color: var(--purple);
}

.auth-footer-links .divider {
  margin: 0 8px;
  opacity: 0.3;
}

/* Preference Center */
.pref-header {
  padding-bottom: 12px;
}

.pref-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body .cookie-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-body .cookie-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-body .cookie-option:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(0, 159, 232, 0.1);
}

.modal-body .cookie-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition);
}

.modal-body .cookie-option input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #009FE8, #0086cc);
  border-color: transparent;
}

.modal-body .cookie-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.modal-body .cookie-option input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-body .cookie-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-body .cookie-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body .cookie-desc {
  font-size: 11px;
  color: #94a3b8;
}

.modal-body .cookie-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-body .cookie-badge.required {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #dc2626;
}

/* ====== RESULT VIEW ====== */
.result-container {
  padding-bottom: 32px;
}

.result-footer-links {
  text-align: center;
  padding: 24px 20px;
  font-size: 12px;
  color: #94a3b8;
}

.result-footer-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.result-footer-links a:hover {
  color: var(--purple);
}

.result-footer-links .divider {
  margin: 0 8px;
  opacity: 0.3;
}

.result-hero {
  position: relative;
  padding: 60px 20px 40px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(0, 159, 232, 0.08) 50%,
    transparent 100%);
}

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

.verified-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border: none;
  border-radius: 50%;
  color: white;
  animation: pulse-green 2s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15), 0 0 0 12px rgba(16, 185, 129, 0.05); }
}

.result-hero .result-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.result-brand {
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.result-subtitle {
  color: #94a3b8;
  font-size: 13px;
}

.result-stats {
  display: flex;
  align-items: center;
  margin: 0 20px 24px;
  padding: 16px;
}

.stat-item {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value.first-scan {
  color: var(--green);
  font-size: 16px;
}

.stat-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-color);
}

.result-tabs {
  display: flex;
  gap: 4px;
  margin: 0 20px 16px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn.active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 159, 232, 0.1);
}

.tab-content {
  display: none;
  padding: 0 20px;
}

.tab-content.active {
  display: block;
}

.product-card {
  margin-bottom: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 13px;
  color: #94a3b8;
}

.info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
}

.claim-section {
  padding: 0 20px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.claim-card {
  text-align: center;
  padding: 28px 20px;
  border-color: rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(249, 115, 22, 0.04));
}

.claim-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border-radius: 50%;
  color: white;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.claim-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.claim-card p {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 20px;
}

.claim-disclaimer {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  margin-top: 12px;
  margin-bottom: 0;
}

.claim-disclaimer-warning {
  color: #ef4444;
}

.claim-disclaimer-warning a {
  color: #009FE8;
  text-decoration: underline;
  font-weight: 500;
}

.claim-disclaimer-warning a:hover {
  color: #2563eb;
}

/* ====== GAME VIEW ====== */
.game-container {
  padding: 20px;
  min-height: 100vh;
}

.game-header {
  text-align: center;
  margin-bottom: 24px;
}

.game-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.game-header p {
  color: #94a3b8;
  font-size: 13px;
}

.game-progress {
  margin-bottom: 20px;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 159, 232, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #009FE8, #00bff0, #00d4ff);
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.progress-text {
  font-size: 12px;
  color: #94a3b8;
  display: block;
  text-align: right;
}

.game-question {
  padding: 28px 20px;
}

.question-number {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #00bff0, #3bcdf5);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0, 159, 232, 0.3);
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 24px;
}

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

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.option-btn:hover {
  background: white;
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(0, 159, 232, 0.1);
}

.option-btn .option-letter {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 159, 232, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--transition);
}

.option-btn .option-text {
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
}

.option-btn.selected {
  border-color: var(--blue);
  background: rgba(0, 159, 232, 0.08);
}

.option-btn.selected .option-letter {
  background: linear-gradient(135deg, #009FE8, #0086cc);
  color: white;
}

.option-btn.correct {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.1);
  pointer-events: none;
}

.option-btn.correct .option-letter {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: white;
}

.option-btn.wrong {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
  pointer-events: none;
}

.option-btn.wrong .option-letter {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
}

.option-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Game Result */
.game-result {
  text-align: center;
  padding: 20px 0;
}

.result-animation {
  margin-bottom: 24px;
}

.result-circle {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border: none;
  border-radius: 50%;
  color: white;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.game-result .result-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.game-result .result-subtitle {
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 20px;
}

.reward-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 20px;
  border-color: rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(249, 115, 22, 0.04));
}

.reward-label {
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.reward-amount {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====== REWARD VIEW ====== */
.reward-container {
  padding: 20px;
  min-height: 100vh;
}

.reward-header {
  text-align: center;
  padding: 32px 0 28px;
  position: relative;
}

.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-in-out infinite;
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(200px) rotate(720deg); opacity: 0; }
}

.reward-amount-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.reward-amount-display .currency {
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
}

.reward-amount-display .amount {
  font-size: 52px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #f97316, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.reward-linked {
  font-size: 13px;
  color: #94a3b8;
}

.reward-linked strong {
  color: var(--text-primary);
}

.select-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 4px;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.payment-option {
  display: flex;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.payment-option:hover {
  background: white;
  border-color: var(--blue);
  box-shadow: 0 2px 12px rgba(0, 159, 232, 0.1);
}

.payment-option.selected {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.15);
}

.payment-logo {
  flex: 1;
  display: flex;
  align-items: center;
}

.payment-logo span {
  font-size: 16px;
  font-weight: 700;
}

.payment-logo.jazzcash span { color: #dc2626; }
.payment-logo.easypaisa span { color: #16a34a; }
.payment-logo.raast span { color: #2563eb; }

.payment-check {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  color: transparent;
  transition: all var(--transition);
}

.payment-option.selected .payment-check {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border-color: transparent;
  color: white;
}

.wallet-input {
  margin-bottom: 16px;
}

.wallet-input .name-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.wallet-input .name-row .input-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.wallet-input .name-row .input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  white-space: nowrap;
}

.wallet-input .name-row .input-group .input-wrapper {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.wallet-input .name-row .input-group .input-wrapper:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
  background: white;
}

.wallet-input .name-row .input-group .input-wrapper input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
}

.wallet-input .name-row .input-group .input-wrapper input::placeholder {
  color: #cbd5e1;
}

.wallet-input .input-group {
  margin-bottom: 14px;
}

.wallet-input .input-group:last-child {
  margin-bottom: 0;
}

.wallet-input label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wallet-input .input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.wallet-input .input-wrapper:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
  background: white;
}

.wallet-input .input-wrapper svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.wallet-input .input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
}

.wallet-input .input-wrapper input::placeholder {
  color: #cbd5e1;
}

.wallet-input .input-hint {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
}

.claim-btn {
  margin-bottom: 16px;
}

.disclaimer {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.6;
  padding: 0 12px;
}

/* ====== SUCCESS VIEW ====== */
.success-container {
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.success-animation {
  position: relative;
  margin-bottom: 32px;
}

.success-circle {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border: none;
  border-radius: 50%;
  color: white;
  animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.3);
}

.success-particles {
  position: absolute;
  inset: -20px;
  pointer-events: none;
}

.success-container h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.success-desc {
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 300px;
}

.success-details {
  width: 100%;
  padding: 16px;
  margin-bottom: 20px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row span:first-child {
  font-size: 13px;
  color: #94a3b8;
}

.detail-row span:last-child {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}

.success-note {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 24px;
}

/* Back button (shared) */
.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 24px;
}

.back-btn:hover {
  background: white;
  color: var(--blue);
  border-color: var(--blue);
}

.brand-logo-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #009FE8, #00bff0);
  border: none;
  border-radius: 50%;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 159, 232, 0.3);
}

.brand-logo-circle.small {
  width: 44px;
  height: 44px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 159, 232, 0.15);
  border-radius: 2px;
}

/* Selection */
::selection {
  background: rgba(0, 159, 232, 0.2);
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 360px) {
  .reward-amount-display .amount {
    font-size: 42px;
  }
}

/* ====== First-screen redesign: product-forward hero + brand film + scroll cue ====== */
.result-hero { padding: 26px 20px 14px; }
.hero-bg {
  background: radial-gradient(125% 80% at 50% 0%, rgba(0,159,232,0.20) 0%, rgba(16,185,129,0.10) 40%, transparent 74%);
}
.hero-orbs span {
  position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none;
  background: radial-gradient(circle at 30% 30%, #afe4ff, #009FE8);
}
.hero-orbs span:nth-child(1){ width:56px; height:56px; top:24px; left:22px; opacity:.30; }
.hero-orbs span:nth-child(2){ width:24px; height:24px; top:96px; right:34px; opacity:.45; }
.hero-orbs span:nth-child(3){ width:12px; height:12px; top:172px; left:52px; opacity:.55; }
.hero-badge-pill {
  display:inline-flex; align-items:center; gap:6px; padding:6px 14px;
  border-radius:var(--radius-full); background:linear-gradient(135deg,#10b981,#06b6d4);
  color:#fff; font-size:.8rem; font-weight:700; box-shadow:0 6px 18px rgba(16,185,129,.35);
}
.hero-product { position:relative; width:fit-content; margin:14px auto 4px; }
.hero-carton {
  position:relative; z-index:1; display:block; height:200px; width:auto;
  filter:drop-shadow(0 18px 26px rgba(0,80,140,.30)); animation:carton-float 4.2s ease-in-out infinite;
}
@keyframes carton-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-9px)} }
.hero-glow {
  position:absolute; z-index:0; left:50%; bottom:2px; transform:translateX(-50%);
  width:150px; height:26px; border-radius:50%;
  background:radial-gradient(ellipse, rgba(0,159,232,.40), transparent 70%);
  filter:blur(5px); animation:glow-pulse 4.2s ease-in-out infinite;
}
@keyframes glow-pulse { 0%,100%{transform:translateX(-50%) scale(1); opacity:.8} 50%{transform:translateX(-50%) scale(.85); opacity:.55} }
.result-hero .result-brand { font-size:1.08rem; font-weight:800; color:var(--text-primary); margin-top:8px; }
.result-hero .result-subtitle { color:var(--text-muted); }
.scroll-cue {
  display:flex; flex-direction:column; align-items:center; gap:1px; margin-top:14px;
  color:var(--blue); font-size:.72rem; font-weight:600; animation:cue-bounce 1.8s ease-in-out infinite;
}
@keyframes cue-bounce { 0%,100%{transform:translateY(0); opacity:.65} 50%{transform:translateY(5px); opacity:1} }
.brand-film {
  position:relative; margin:2px 20px 22px; border-radius:var(--radius-lg);
  overflow:hidden; aspect-ratio:16/9; cursor:pointer; background:#0a2230; box-shadow:var(--shadow-md);
}
.brand-film-video { width:100%; height:100%; object-fit:cover; display:block; }
.brand-film-cover {
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:12px; color:#fff;
  background: #0a78c8 url('../asset/play_bg.png') center/cover no-repeat;
}
.brand-film-cover::after {
  content:''; position:absolute; inset:0; opacity:.18;
  background:radial-gradient(circle at 80% 20%, #fff, transparent 40%);
}
.play-btn {
  position:relative; z-index:1; width:58px; height:58px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; color:#fff;
  background:rgba(255,255,255,.22); box-shadow:0 0 0 8px rgba(255,255,255,.12);
  animation:pulse-white 2.2s ease-in-out infinite;
}
@keyframes pulse-white { 0%,100%{box-shadow:0 0 0 8px rgba(255,255,255,.12)} 50%{box-shadow:0 0 0 15px rgba(255,255,255,.04)} }
.play-btn svg { margin-left:3px; }
.bf-label { position:relative; z-index:1; text-align:center; }
.bf-title { display:block; font-weight:700; font-size:.95rem; }
.bf-sub { display:block; font-size:.72rem; opacity:.88; margin-top:2px; }
[dir="rtl"] .play-btn svg { margin-left:0; margin-right:3px; transform:scaleX(-1); }

/* ===================== Result page — UI mockup pixel rebuild ===================== */
/* Wider canvas to match the mockup's horizontal layout; flow views stay phone-narrow */
#app { max-width: 760px; }
.reward-container, .success-container { max-width: 470px; margin-left: auto; margin-right: auto; }
body { background: linear-gradient(180deg, #dceffb 0%, #e9f5fd 26%, #f5fbfe 60%, #ffffff 100%); }
body::before { opacity: 0.55; }
.lang-switcher { position: fixed; top: 12px; right: max(12px, calc(50vw - 360px)); }
[dir="rtl"] .lang-switcher { right: auto; left: max(12px, calc(50vw - 360px)); }

/* Top bar */
.result-topbar { display: flex; align-items: center; padding: 16px 20px 4px; min-height: 46px; }
.verified-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px;
  border-radius: var(--radius-full); background: linear-gradient(135deg, #10b981, #07b389);
  color: #fff; font-size: 0.95rem; font-weight: 700; box-shadow: 0 10px 22px rgba(16,185,129,0.3);
}

/* Hero scene */
.result-hero { padding: 6px 20px 16px; }
.hero-scene { position: relative; height: 300px; display: flex; align-items: flex-end; justify-content: center; }
.hero-podium {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 300px; height: 98px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.92), rgba(190,228,250,0.45) 55%, rgba(190,228,250,0) 76%);
  box-shadow: 0 18px 42px rgba(0,120,190,0.18);
}
.hero-podium::before, .hero-podium::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  border-radius: 50%; border: 1.5px solid rgba(0,159,232,0.16);
}
.hero-podium::before { width: 232px; height: 72px; }
.hero-podium::after { width: 300px; height: 94px; border-color: rgba(0,159,232,0.09); }
.hero-carton {
  position: relative; z-index: 2; height: 232px; width: auto; display: block; margin-bottom: 30px;
  filter: drop-shadow(0 22px 26px rgba(0,80,140,0.28)); animation: carton-float 4.2s ease-in-out infinite;
}
.hero-bubbles span {
  position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.6);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(175,225,255,0.35));
}
.hero-bubbles span:nth-child(1){ width:26px; height:26px; left:13%; top:34%; }
.hero-bubbles span:nth-child(2){ width:14px; height:14px; left:23%; top:60%; }
.hero-bubbles span:nth-child(3){ width:18px; height:18px; right:15%; top:26%; }
.hero-bubbles span:nth-child(4){ width:10px; height:10px; right:23%; top:54%; }
.hero-bubbles span:nth-child(5){ width:8px;  height:8px;  left:50%; top:12%; }

/* Asset placeholder slots (UI to replace) */
.asset-slot {
  position: absolute; border: 1.5px dashed rgba(0,159,232,0.4); border-radius: 12px;
  background: rgba(0,159,232,0.05); display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; color: var(--text-muted); text-align: center; line-height: 1.2; z-index: 3;
}
.asset-slot::after { content: attr(data-asset); padding: 3px; }
.leaf-slot { width: 80px; height: 60px; top: 46%; }
.leaf-left { left: 0; }
.leaf-right { right: 0; }
.seal-slot { width: 92px; height: 92px; border-radius: 50%; top: 28%; right: 3%; border-color: rgba(0,159,232,0.5); }
.seal-slot::after { content: ''; padding: 0; }
.seal-text { font-size: 0.74rem; font-weight: 800; color: var(--blue); letter-spacing: 0.02em; }

.result-hero .result-brand { font-size: 1.6rem; font-weight: 800; margin-top: 8px; }
.result-hero .result-subtitle { font-size: 0.95rem; color: var(--text-secondary); }
.stat-value.first-scan { color: var(--green); }

/* Cashback card (horizontal) */
.cashback-card {
  margin: 6px 20px 22px; padding: 20px 22px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff4e6 0%, #fff9f0 60%, #fffdf8 100%);
  border: 1px solid rgba(245,158,11,0.18); box-shadow: 0 10px 30px rgba(245,158,11,0.10);
}
.cashback-row { display: flex; align-items: center; gap: 16px; }
.cashback-icon {
  flex: none; width: 58px; height: 58px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 8px 18px rgba(245,158,11,0.35);
}
.cashback-text { flex: 1; min-width: 0; }
.cashback-text h3 { font-size: 1.12rem; font-weight: 800; color: var(--text-primary); }
.cashback-text p { font-size: 0.84rem; color: var(--text-muted); margin-top: 3px; }
.cashback-btn { flex: none; width: auto; padding: 13px 22px; white-space: nowrap; }
.cashback-card .claim-disclaimer { text-align: center; margin-top: 14px; font-size: 0.78rem; color: var(--text-muted); }

/* Trace section (4 horizontal step cards) */
.trace-section { margin: 0 20px 22px; padding: 20px; }
.trace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.trace-head-left { display: flex; align-items: center; gap: 10px; }
.trace-head-icon { color: var(--green); display: inline-flex; }
.trace-head-text { display: flex; flex-direction: column; }
.trace-head-text h3 { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.trace-head-sub { font-size: 0.74rem; color: var(--text-muted); }
.synced-pill {
  flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px;
  border-radius: var(--radius-full); background: rgba(0,159,232,0.1); color: var(--blue);
  font-size: 0.72rem; font-weight: 600;
}
.trace-steps { display: flex; align-items: stretch; gap: 4px; }
.trace-step-card {
  flex: 1; padding: 16px 12px; border-radius: var(--radius-md); text-align: center;
  background: linear-gradient(180deg, rgba(0,159,232,0.05), rgba(0,159,232,0.02)); border: 1px solid var(--border-color);
}
.ts-icon {
  width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; color: var(--blue);
  display: flex; align-items: center; justify-content: center; background: #fff; box-shadow: 0 4px 12px rgba(0,159,232,0.15);
}
.trace-step-card h4 { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.trace-step-card p { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; }
.ts-arrow { display: flex; align-items: center; color: var(--text-muted); font-size: 1.3rem; opacity: 0.45; }

/* Brand film leaf placeholder */
.brand-film-cover .film-leaf { display: none; }

/* Guarantee section (3 features) */
.guarantee-section { margin: 8px 20px; }
.guar-title { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); }
.guar-sub { font-size: 0.82rem; color: var(--text-muted); margin: 3px 0 16px; }
.guarantee-grid { display: flex; gap: 12px; }
.guar-card {
  flex: 1; padding: 18px 14px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.7); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm);
}
.guar-icon {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 10px; color: var(--blue);
  display: flex; align-items: center; justify-content: center; background: rgba(0,159,232,0.1);
}
.guar-card h4 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.guar-card p { font-size: 0.74rem; color: var(--text-muted); line-height: 1.55; }

/* Footer */
.result-footer { text-align: center; padding: 26px 24px 38px; }
.result-footer p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; }

/* Responsive: stack on real phones */
@media (max-width: 600px) {
  .cashback-row { flex-wrap: wrap; }
  .cashback-text { flex: 1 1 58%; }
  .cashback-btn { width: 100%; margin-top: 12px; }
  .trace-steps { flex-direction: column; }
  .ts-arrow { transform: rotate(90deg); align-self: center; }
  .trace-step-card { display: flex; align-items: center; gap: 12px; text-align: left; }
  .ts-icon { margin: 0; flex: none; }
  .guarantee-grid { flex-direction: column; }
  .hero-scene { height: 264px; }
  .hero-carton { height: 200px; }
  .hero-podium { width: 260px; }
  .result-hero .result-brand { font-size: 1.35rem; }
}

/* RTL mirroring for new sections */
[dir="rtl"] .ts-arrow { transform: scaleX(-1); }
[dir="rtl"] .leaf-left { left: auto; right: 0; }
[dir="rtl"] .leaf-right { right: auto; left: 0; }
[dir="rtl"] .seal-slot { right: auto; left: 3%; }
@media (max-width: 600px) { [dir="rtl"] .ts-arrow { transform: rotate(90deg); } }

/* === UI-provided hero composite (replaces placeholder scene) === */
.result-hero { padding: 6px 20px 12px; }
.hero-scene { height: auto; min-height: 0; display: block; padding: 4px 0 0; }
.hero-image { display: block; width: 100%; max-width: 430px; height: auto; margin: 0 auto; }
.result-hero .result-brand { margin-top: 4px; }

/* === Match img.png: narrow mobile column + compact grids (4-tile trace, 3-col guarantee) === */
#app { max-width: 430px; }
.lang-switcher { right: max(12px, calc(50vw - 203px)); }
[dir="rtl"] .lang-switcher { right: auto; left: max(12px, calc(50vw - 203px)); }
.result-hero { padding: 4px 16px 10px; }
.hero-image { max-width: 100%; }
.result-stats { margin: 4px 16px 14px; }
.cashback-card { margin: 0 16px 16px; padding: 16px; }
.trace-section { margin: 0 16px 16px; padding: 16px 14px; }
.brand-film { margin: 0 16px 16px; }
.guarantee-section { margin: 6px 16px 4px; }
.result-footer { padding: 22px 20px 32px; }

/* Traceability: 4 compact tiles in one row, no arrows */
.ts-arrow { display: none; }
.trace-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; align-items: stretch; }
.trace-step-card { padding: 11px 6px; text-align: center; }
.ts-icon { width: 38px; height: 38px; margin: 0 auto 7px; }
.ts-icon svg { width: 18px; height: 18px; }
.trace-step-card h4 { font-size: 0.7rem; line-height: 1.25; margin-bottom: 4px; }
.trace-step-card p { font-size: 0.58rem; line-height: 1.4; }

/* Guarantee: 3 columns on mobile too */
.guarantee-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.guar-card { padding: 14px 10px; }
.guar-icon { width: 38px; height: 38px; }
.guar-card h4 { font-size: 0.8rem; }
.guar-card p { font-size: 0.64rem; line-height: 1.45; }

/* Keep grids multi-col on phones (override earlier stacking); cashback stays inline */
@media (max-width: 600px) {
  .trace-steps { grid-template-columns: repeat(4, 1fr); }
  .trace-step-card { display: block; text-align: center; }
  .ts-icon { margin: 0 auto 7px; }
  .guarantee-grid { grid-template-columns: repeat(3, 1fr); }
  .cashback-row { flex-wrap: nowrap; }
  .cashback-btn { width: auto; margin-top: 0; padding: 11px 16px; }
  .cashback-text h3 { font-size: 1rem; }
  .cashback-text p { font-size: 0.72rem; }
  .hero-image { max-width: 100%; }
}

/* Multilingual: shrink compact-tile text for longer scripts to avoid overflow */
[lang="en"] .trace-step-card h4, [lang="ur"] .trace-step-card h4 { font-size: 0.62rem; }
[lang="en"] .trace-step-card p, [lang="ur"] .trace-step-card p { font-size: 0.54rem; }

/* Cashback: inline for short scripts (zh); button drops to full-width row for longer (en/ur) */
.cashback-row { flex-wrap: wrap; }
.cashback-icon { width: 52px; height: 52px; }
.cashback-text { flex: 1 1 150px; }
[lang="en"] .cashback-btn, [lang="ur"] .cashback-btn { flex: 1 1 100%; width: 100%; margin-top: 12px; justify-content: center; }

/* === Hero compaction to match high-res design (carton ~26% width, tighter top) === */
.result-hero { padding: 0 16px 6px; }
.hero-image { max-width: 320px; }
@media (max-width: 600px) { .hero-image { max-width: 300px; } }
.result-hero .result-brand { margin-top: 6px; font-size: 1.5rem; }
.result-hero .result-subtitle { margin-top: 2px; }
.powered-by { margin-top: 8px; }
.scroll-cue { margin-top: 10px; margin-bottom: 2px; }

/* === Fix: traceability arrows back (flex row); cashback inline for zh, stacked for en/ur === */
.trace-steps { display: flex; flex-direction: row; align-items: stretch; gap: 3px; }
.trace-step-card { flex: 1 1 0; min-width: 0; }
.ts-arrow { display: flex; align-items: center; justify-content: center; color: #b9c6d2; font-size: 1rem; opacity: 1; flex: 0 0 auto; padding: 0 1px; }
[dir="rtl"] .ts-arrow { transform: scaleX(-1); }
@media (max-width: 600px) {
  .trace-steps { display: flex; flex-direction: row; }
  .trace-step-card { display: block; }
  .ts-arrow { display: flex; transform: none; }
  [dir="rtl"] .ts-arrow { transform: scaleX(-1); }
}

.cashback-row { flex-wrap: nowrap; }
.cashback-text { flex: 1 1 auto; }
[lang="en"] .cashback-row, [lang="ur"] .cashback-row { flex-wrap: wrap; }
[lang="en"] .cashback-btn, [lang="ur"] .cashback-btn { flex: 1 1 100%; width: 100%; margin-top: 12px; justify-content: center; }
@media (max-width: 600px) {
  .cashback-row { flex-wrap: nowrap; }
  [lang="en"] .cashback-row, [lang="ur"] .cashback-row { flex-wrap: wrap; }
}

/* === Hero: full-bleed + cover-crop to match design's wide-short hero (square asset) === */
.result-hero { padding: 0 0 8px; }
.hero-scene { width: 100%; max-width: 100%; margin: 0; height: 286px; overflow: hidden; }
.hero-image, .result-hero .hero-image { width: 100%; max-width: 100%; height: 100%; object-fit: cover; object-position: 50% 34%; }
@media (max-width: 600px) { .hero-image { max-width: 100%; } }
.result-hero .result-brand { margin-top: 8px; }

/* === Match design density (measured from 5e06): shorter video + hero + tighter sections === */
.hero-scene { height: 250px; }
.brand-film { aspect-ratio: 2051 / 767; margin: 0 16px 14px; }   /* = play_bg, wide-short (~149px) */
.scroll-cue { margin-top: 8px; margin-bottom: 0; }
.result-stats { margin: 2px 16px 12px; padding: 13px 12px; }
.cashback-card { margin: 0 16px 14px; padding: 14px 16px; }
.cashback-card .claim-disclaimer { margin-top: 10px; }
.trace-section { margin: 0 16px 14px; padding: 14px 12px; }
.trace-head { margin-bottom: 12px; }
.guarantee-section { margin: 4px 16px; }
.guar-card { padding: 13px 10px; }
.result-footer { padding: 18px 20px 26px; }

/* Final density tightening to match design proportions */
.result-topbar { padding: 9px 16px 0; min-height: 0; }
.verified-pill { padding: 7px 14px; font-size: 0.9rem; }

/* Hero: show FULL product, NO crop/compression (square asset => taller than design mock) */
.hero-scene { height: auto; overflow: visible; }
.hero-image, .result-hero .hero-image { width: 55%; max-width: 55%; height: auto; object-fit: contain; margin: 0 auto; display: block; }
.result-hero { padding: 2px 16px 6px; }
.result-stats { margin: 0 16px 10px; padding: 12px; }
.cashback-card { margin: 0 16px 12px; }
.trace-section { margin: 0 16px 12px; }
.brand-film { margin: 0 16px 12px; }
.guarantee-section { margin: 2px 16px; }

/* === Traceability icons: per-reference colors (1 green / 2-3 blue / 4 deep blue) + tinted circles === */
.ts-icon { background: #e9f4fb; box-shadow: none; }
.trace-step-card:nth-child(1) .ts-icon { color: #34b06b; background: #e7f6ec; }
.trace-step-card:nth-child(3) .ts-icon { color: #009fe8; background: #e3f3fd; }
.trace-step-card:nth-child(5) .ts-icon { color: #12a3d6; background: #e1f4fb; }
.trace-step-card:nth-child(7) .ts-icon { color: #2069b3; background: #e7eef8; }
.trace-head-icon { color: #34b06b; background: #e7f6ec; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.trace-head-icon svg { width: 16px; height: 16px; }
.guar-card:nth-child(3) .guar-icon { color: #34b06b; background: #e7f6ec; }

/* === 收一收: zh 溯源标题单行 + 收紧间距(让影片露出)+ 返现对齐 === */
[lang="zh"] .trace-step-card h4 { white-space: nowrap; }
.result-hero { padding: 0 16px 2px; }
.result-hero .result-brand { margin-top: 4px; }
.result-hero .result-subtitle { margin-top: 1px; }
.powered-by { margin-top: 6px; }
.scroll-cue { margin-top: 6px; margin-bottom: 0; }
.result-stats { margin: 0 16px 9px; padding: 11px; }
.cashback-card { margin: 0 16px 10px; padding: 13px 16px; }
.cashback-card .claim-disclaimer { margin-top: 8px; }
.trace-section { margin: 0 16px 10px; padding: 12px; }
.trace-head { margin-bottom: 10px; }
.cashback-row { align-items: center; }
.cashback-text h3 { margin-bottom: 2px; }

/* tighten more so the film play area peeks into first screen */
.result-hero .result-brand { margin-top: 2px; }
.powered-by { margin-top: 4px; }
.scroll-cue { margin-top: 4px; }
.result-stats { margin: 0 16px 7px; padding: 10px; }
.cashback-card { margin: 0 16px 8px; padding: 12px 16px; }
.cashback-card .claim-disclaimer { margin-top: 7px; }
.trace-section { margin: 0 16px 8px; padding: 11px 12px; }
.trace-head { margin-bottom: 8px; }
.trace-step-card { padding: 9px 6px; }

/* === 验真返现卡:对齐设计稿(描述单行 + 间距/对齐) === */
.cashback-row { gap: 10px; align-items: center; }
.cashback-icon { width: 52px; height: 52px; }
.cashback-text h3 { font-size: 1.05rem; }
.cashback-text p { font-size: 0.72rem; line-height: 1.4; }
[lang="zh"] .cashback-text p { white-space: nowrap; }
.cashback-icon { width: 48px; height: 48px; }
.cashback-icon svg { width: 23px; height: 23px; }
.cashback-row { gap: 9px; }
.cashback-btn { padding: 8px 11px; white-space: nowrap; font-size: 0.8rem; gap: 3px; }
.cashback-btn svg { width: 13px; height: 13px; }
.cashback-text p { font-size: 0.62rem; line-height: 1.45; }
.cashback-card .claim-disclaimer { text-align: center; }

/* ===================== 对齐 UI 效果图 img.png:首屏字号 + 品牌影片排版 ===================== */
/* 首屏字号:标题/副标题/统计值收小到设计稿测量值(标题~21px、统计值~18px) */
.result-hero .result-brand { font-size: 21px; }
.result-hero .result-subtitle { font-size: 14px; }
.stat-value { font-size: 18px; }
.stat-value.first-scan { font-size: 18px; }
.stat-label { font-size: 10px; }

/* 品牌影片:由「竖排居中」改为设计稿的「横向条」——播放键居左、文案居右左对齐;
   卡片收为宽扁条(叶片已烘焙在 play_bg.png 背景图右侧,随 cover 裁切) */
.brand-film { aspect-ratio: 358 / 83; }
.brand-film-cover {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  padding: 0 22px;
}
.play-btn {
  width: 52px; height: 52px; flex: none;
  background: rgba(255,255,255,.15);
  border: 1.6px solid rgba(255,255,255,.55);
  box-shadow: none;
  animation: none;
}
.bf-label { text-align: left; }
.bf-title { font-size: 1rem; }     /* 16px,加粗(沿用 700) */
.bf-sub { font-size: 0.8rem; }     /* ~12.8px */
/* 影片卡内部恒为 LTR:播放键恒居左、叶片(背景图固定在右)恒在右,
   避免 RTL(乌尔都语)下 flex 翻转把播放键压到叶片上;播放三角恢复指向右。 */
.brand-film-cover { direction: ltr; }
.brand-film-cover .play-btn svg { transform: none; margin-left: 3px; margin-right: 0; }

/* ===================== 品牌影片:点击弹出灯箱放大播放 ===================== */
.film-modal {
  position: fixed; inset: 0; z-index: 11000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.film-modal.active { opacity: 1; pointer-events: auto; }
.film-modal-backdrop {
  position: absolute; inset: 0; background: rgba(6,20,32,.84);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.film-modal-body { position: relative; z-index: 1; width: 100%; max-width: 760px; }
.film-modal-video {
  width: 100%; aspect-ratio: 16 / 9; max-height: 82vh; display: block;
  background: #000; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.55);
  transform: scale(.95); transition: transform .28s cubic-bezier(.34,1.56,.64,1);
}
.film-modal.active .film-modal-video { transform: scale(1); }
.film-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s ease, transform .2s ease;
}
.film-modal-close:hover { background: rgba(255,255,255,.30); transform: scale(1.06); }
[dir="rtl"] .film-modal-close { right: auto; left: 16px; }

/* ===================== 首屏背景:换用 ui-top-background-clean.png(水波/气泡/茶叶场景) ===================== */
/* 铺在内容列 #app 顶部:满列宽、不重复、顶部对齐;随 430 列居中,跨屏不变形。
   兜底色 #cbe5f9 = 图片底边色,图片到下方纯色无缝衔接(不留接缝)。 */
#app {
  background: #cbe5f9 url('../asset/ui-top-background-clean.png') center top / 100% auto no-repeat;
}
