/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #d4a017;
  --gold-dark: #b8860b;
  --amber-800: #92400e;
  --amber-900: #78350f;
  --yellow-300: #fde047;
  --bg-start: #fef3c7;
  --bg-mid: #fde68a;
  --bg-end: #fcd34d;
  --white: #ffffff;
  --text: #78350f;
  --shadow: 0 10px 40px rgba(146, 64, 14, 0.15);
  --radius: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
}

/* ===== Layout ===== */
.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  position: relative;
}

/* ===== Language Toggle ===== */
.lang-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--amber-900);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition);
  z-index: 10;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: scale(1.05);
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 16px;
}

.header h1 {
  font-size: clamp(2.8rem, 8vw, 3.8rem);
  font-weight: 800;
  color: var(--amber-800);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(146, 64, 14, 0.1);
}

.header p {
  font-size: 1.15rem;
  color: var(--amber-900);
  opacity: 0.9;
}

/* ===== Cards ===== */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: var(--transition);
}

/* ===== Image Container ===== */
.image-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 24px;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  aspect-ratio: 1;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease;
}

.overlay-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(255, 215, 0, 0.15) 70%, rgba(255, 200, 50, 0.35) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.overlay-glow.active {
  opacity: 1;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Floating Mantras - covers most of the card */
.mantra-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
  border-radius: var(--radius);
}

.mantra {
  position: absolute;
  color: rgba(255, 245, 200, 0.9);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(255, 215, 100, 0.7), 0 0 3px rgba(0,0,0,0.5);
  white-space: nowrap;
  opacity: 0;
  animation: float-up 6.2s ease-out forwards;
  user-select: none;
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.85);
  }
  12% {
    opacity: 0.95;
  }
  65% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateY(-380px) scale(1.1);
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .mantra {
    animation: none;
    opacity: 0;
  }
  .overlay-glow.active {
    animation: none;
  }
}

#bless-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ===== Status ===== */
.status {
  text-align: center;
  min-height: 28px;
  margin-bottom: 16px;
}

.status p {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--amber-800);
}

/* ===== Buttons ===== */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-width: 140px;
}

.btn-primary {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  box-shadow: 0 4px 15px rgba(180, 83, 9, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(180, 83, 9, 0.45);
}

.btn-secondary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.35);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--amber-800);
  color: var(--amber-800);
}

.btn-outline:hover {
  background: rgba(146, 64, 14, 0.08);
  transform: translateY(-1px);
}

.btn-kofi {
  background: #ff5e5b;
  color: white;
  width: 100%;
  max-width: 320px;
  padding: 16px 24px;
  font-size: 1.1rem;
  box-shadow: 0 4px 18px rgba(255, 94, 91, 0.35);
  margin: 0 auto;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-kofi:hover {
  background: #e04e4b;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255, 94, 91, 0.45);
  color: white;
}

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

/* ===== Donation Card ===== */
.donation-card {
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

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

.success-header {
  margin-bottom: 24px;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: sparkle 1.5s ease infinite;
}

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

.success-header h2 {
  font-size: 2.4rem;
  color: var(--amber-800);
  margin-bottom: 8px;
}

.success-header p {
  font-size: 1.1rem;
  color: var(--amber-900);
  max-width: 360px;
  margin: 0 auto;
  opacity: 0.9;
}

.blessed-preview {
  width: 180px;
  height: 180px;
  margin: 0 auto 28px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border: 3px solid rgba(212, 160, 23, 0.5);
}

.blessed-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Donation Section */
.donation-section {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.donation-section h3 {
  font-size: 1.3rem;
  color: var(--amber-800);
  margin-bottom: 8px;
}

.donation-section > p {
  font-size: 0.98rem;
  color: var(--amber-900);
  opacity: 0.85;
  margin-bottom: 20px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.secondary-donations {
  margin-top: 18px;
  text-align: center;
}

.or-text {
  font-size: 0.9rem;
  color: var(--amber-900);
  opacity: 0.6;
  margin-bottom: 8px;
}

.secondary-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.secondary-link {
  color: var(--amber-800);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.secondary-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.divider {
  color: var(--amber-900);
  opacity: 0.4;
}

.donate-note {
  font-size: 0.85rem;
  color: var(--amber-900);
  opacity: 0.7;
  margin-top: 16px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.95rem;
  color: var(--amber-900);
  opacity: 0.75;
}

/* ===== Utility ===== */
.hidden {
  display: none !important;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(146, 64, 14, 0.25);
  border-top-color: var(--amber-800);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 480px) {
  .card {
    padding: 20px 16px;
  }

  .header h1 {
    font-size: 2.5rem;
  }

  .btn {
    padding: 12px 22px;
    font-size: 1rem;
  }
}
