/* MangalWishes — mobile-first styles */
:root {
  --maroon-900: #2a0509;
  --maroon-800: #3f0810;
  --maroon-700: #5a0a14;
  --crimson: #a3122a;
  --gold-100: #fff6d5;
  --gold-300: #ffe08a;
  --gold-500: #f5c542;
  --gold-700: #b8860b;
  --ink: #fff8ec;
  --muted: #f3dcc0;
  --wa: #25d366;
  --wa-dark: #128c4b;
  --radius: 18px;
  --topbar-h: 62px;
  --sticky-ad-h: 62px;
  --font-body: 'Nunito Sans', 'Noto Sans Devanagari', 'Noto Sans Gujarati', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Playfair Display', 'Noto Serif Devanagari', 'Noto Serif Gujarati', Georgia, serif;
}
html[lang='hi'], html[lang='mr'] {
  --font-body: 'Noto Sans Devanagari', 'Nunito Sans', system-ui, sans-serif;
  --font-head: 'Noto Serif Devanagari', 'Playfair Display', Georgia, serif;
}
html[lang='gu'] {
  --font-body: 'Noto Sans Gujarati', 'Nunito Sans', system-ui, sans-serif;
  --font-head: 'Noto Serif Gujarati', 'Playfair Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--maroon-800);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 196, 66, .18), transparent 60%),
    linear-gradient(180deg, rgba(42, 5, 9, .35), rgba(42, 5, 9, .75)),
    url('/assets/background.webp'),
    radial-gradient(circle at 50% 35%, #7a0e1e 0%, #3f0810 55%, #2a0509 100%);
  background-size: cover, cover, cover, cover;
  background-position: center top;
  background-attachment: scroll;
  overflow-x: hidden;
  padding-bottom: calc(var(--sticky-ad-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-height: var(--topbar-h);
  padding: 6px 10px; padding-top: calc(6px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(42, 5, 9, .96), rgba(63, 8, 16, .88));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(245, 197, 66, .35);
}
.brand { display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--gold-300); text-decoration: none; font-size: 22px; min-height: 48px; min-width: 48px; flex-shrink: 0; }
.brand-name { display: none; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.lang-switch {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(245, 197, 66, .55);
  border-radius: 999px;
  overflow-x: auto; scrollbar-width: none; max-width: 100%; min-width: 0;
}
.lang-switch::-webkit-scrollbar { display: none; }
.lang-btn {
  flex-shrink: 0;
  min-height: 48px; min-width: 48px; padding: 0 10px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--gold-100);
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  font-family: 'Noto Sans Devanagari', 'Noto Sans Gujarati', 'Nunito Sans', system-ui, sans-serif;
  transition: background .2s, color .2s;
}
.lang-btn[aria-pressed='true'] { background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: var(--maroon-900); box-shadow: 0 2px 8px rgba(245, 197, 66, .45); }
.lang-btn:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 2px; }
@media (max-width: 374px) {
  .brand { display: none; }
  .topbar { justify-content: center; padding-left: 6px; padding-right: 6px; }
  .lang-btn { padding: 0 8px; font-size: 13px; }
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 14px 28px; }
.hero { text-align: center; margin-bottom: 18px; }
.hero-year {
  display: inline-block; margin: 0 0 10px; padding: 4px 14px;
  font-size: 14px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--maroon-900); background: linear-gradient(90deg, var(--gold-500), var(--gold-300), var(--gold-500));
  border-radius: 999px;
}
.hero-from { margin: 0; font-family: var(--font-head); font-size: clamp(22px, 6.4vw, 30px); line-height: 1.35; color: var(--gold-100); text-shadow: 0 2px 12px rgba(0, 0, 0, .6); overflow-wrap: anywhere; }
.hero-from strong { color: var(--gold-300); }
.hero-to { margin: 8px 0 0; font-size: 17px; color: var(--muted); overflow-wrap: anywhere; }

.screen { animation: fadeIn .45s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Screen 1: deck ---------- */
.pick-title { margin: 6px 0 4px; text-align: center; font-family: var(--font-head); font-size: clamp(24px, 7vw, 32px); color: var(--gold-300); }
.pick-sub { margin: 0 auto 18px; max-width: 30em; text-align: center; font-size: 16px; color: var(--muted); }
.deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; perspective: 900px; }
.deck-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 48px; min-width: 48px;
  padding: 0; border: 0; background: none; color: var(--gold-100);
  animation: floaty 3.2s ease-in-out infinite;
}
.deck-card:nth-child(2) { animation-delay: .4s; }
.deck-card:nth-child(3) { animation-delay: .8s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.deck-card .card-img {
  position: relative; width: 100%; aspect-ratio: 2 / 3;
  border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #ffe08a 0 8%, #b8860b 9% 12%, #5a0a14 13% 100%);
  border: 2px solid var(--gold-500);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .25), 0 0 22px rgba(245, 197, 66, .55), 0 10px 24px rgba(0, 0, 0, .55);
  transition: transform .2s, box-shadow .2s;
}
.card-fallback-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.deck-card .card-img img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.deck-card .card-img::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 246, 213, .55) 48%, transparent 66%);
  transform: translateX(-120%); animation: shine 3.6s ease-in-out infinite;
}
.deck-card:nth-child(2) .card-img::after { animation-delay: 1.2s; }
.deck-card:nth-child(3) .card-img::after { animation-delay: 2.4s; }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.deck-card:hover .card-img, .deck-card:focus-visible .card-img { transform: translateY(-4px) scale(1.03); box-shadow: 0 0 0 2px rgba(0, 0, 0, .25), 0 0 34px rgba(255, 224, 138, .85), 0 14px 28px rgba(0, 0, 0, .6); }
.deck-card:focus-visible { outline: none; }
.deck-card:active .card-img { transform: scale(.97); }
.deck-label { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--gold-300); line-height: 1.2; }
.deck-tap { font-size: 13px; color: var(--muted); line-height: 1.2; min-height: 1.2em; }

/* ---------- Screen 2: alignment ---------- */
.screen-align { text-align: center; padding-top: 4px; }
.mandala { width: 168px; height: 168px; margin: 0 auto 10px; filter: drop-shadow(0 0 18px rgba(245, 197, 66, .6)); }
.mandala-svg { width: 100%; height: 100%; animation: spin 6s linear infinite; }
.mandala-svg .planets { transform-origin: 100px 100px; animation: spin 2.5s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.align-text { margin: 0 auto 14px; max-width: 24em; font-size: 18px; font-weight: 600; color: var(--gold-100); animation: pulse 1.25s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.progress { width: 100%; max-width: 320px; height: 10px; margin: 0 auto 18px; border-radius: 999px; background: rgba(0, 0, 0, .4); border: 1px solid rgba(245, 197, 66, .5); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--crimson), var(--gold-500), var(--gold-300)); border-radius: inherit; }
.ad-box { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 auto; max-width: 100%; }
.ad-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 248, 236, .6); }
.ad-slot { max-width: 100%; display: flex; align-items: center; justify-content: center; background: rgba(20, 2, 6, .65); border: 1px dashed rgba(245, 197, 66, .45); border-radius: 10px; overflow: hidden; }
.ad-house-interstitial {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 18px; text-align: center; width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 25%, rgba(245, 197, 66, .2), rgba(42, 5, 9, .85));
}
.ad-house-badge { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; padding: 2px 8px; border-radius: 999px; background: rgba(245, 197, 66, .2); color: var(--gold-300); border: 1px solid rgba(245, 197, 66, .4); }
.ad-house-icon { font-size: 36px; line-height: 1.1; }
.ad-house-interstitial strong { font-family: var(--font-head); font-size: 17px; color: var(--gold-100); }
.ad-house-interstitial p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.ad-house-dim { font-size: 11px; color: rgba(255, 248, 236, .45); }
.ad-house-sticky { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--gold-100); padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Screen 3: reveal ---------- */
.reveal-kicker { margin: 0 0 12px; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-300); }
.flip-stage { width: min(72vw, 300px); margin: 0 auto 20px; perspective: 1200px; }
.flip-card { position: relative; width: 100%; aspect-ratio: 2 / 3; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1); }
.flip-card.is-flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 3px solid var(--gold-500);
  box-shadow: 0 0 40px rgba(245, 197, 66, .55), 0 18px 40px rgba(0, 0, 0, .6);
}
.flip-back { background: radial-gradient(circle at 50% 45%, #ffe08a 0 8%, #b8860b 9% 12%, #5a0a14 13% 100%); }
.flip-back img, .flip-front img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.flip-front { transform: rotateY(180deg); display: flex; align-items: center; justify-content: center; }

.reading { opacity: 0; transform: translateY(14px); transition: opacity .6s .2s, transform .6s .2s; }
.reading.is-in { opacity: 1; transform: none; }
.reading-head { text-align: center; margin-bottom: 16px; }
.reading-name { margin: 0; font-family: var(--font-head); font-size: clamp(28px, 8vw, 38px); line-height: 1.2; color: var(--gold-300); text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.reading-sub { margin: 4px 0 0; font-size: 17px; font-style: italic; color: var(--muted); }
.theme-box {
  margin: 0 0 14px; padding: 16px; text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(245, 197, 66, .22), rgba(163, 18, 42, .28));
  border: 1px solid rgba(245, 197, 66, .6);
}
.theme-box .lbl { display: block; font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-300); margin-bottom: 4px; }
.theme-box p { margin: 0; font-family: var(--font-head); font-size: 20px; line-height: 1.45; color: var(--gold-100); }
.pillar {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start;
  margin: 0 0 12px; padding: 14px;
  border-radius: var(--radius);
  background: rgba(30, 3, 7, .62);
  border: 1px solid rgba(245, 197, 66, .3);
}
.pillar .ico { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; background: radial-gradient(circle, rgba(255, 224, 138, .35), rgba(184, 134, 11, .15)); border: 1px solid rgba(245, 197, 66, .5); }
.pillar h4 { margin: 0 0 2px; font-size: 17px; color: var(--gold-300); }
.pillar p { margin: 0; font-size: 17px; color: var(--ink); }
.shubh { margin: 16px 0 14px; padding: 16px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(255, 246, 213, .96), rgba(255, 224, 138, .92)); color: var(--maroon-900); border: 2px solid var(--gold-700); }
.shubh h4 { margin: 0 0 10px; text-align: center; font-family: var(--font-head); font-size: 21px; color: var(--crimson); }
.shubh dl { margin: 0; display: grid; gap: 10px; }
.shubh dt { font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #7a3b00; }
.shubh dd { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.5; }
.swatch { display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .25); }

/* Affiliate card */
.affiliate { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; margin: 0 0 22px; padding: 14px; border-radius: var(--radius); background: rgba(30, 3, 7, .7); border: 1px solid rgba(245, 197, 66, .45); }
.affiliate .aff-ico { width: 64px; height: 64px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 34px; background: radial-gradient(circle, #ffe08a, #b8860b); }
.affiliate h4 { margin: 0 0 2px; font-size: 16px; line-height: 1.4; color: var(--gold-100); }
.affiliate p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.btn-amz { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 48px; padding: 0 18px; border-radius: 12px; background: linear-gradient(180deg, #ffd814, #f7ca00); color: #111; font-weight: 700; font-size: 16px; text-decoration: none; border: 1px solid #c7a200; }
.aff-note { grid-column: 1 / -1; margin: 0; font-size: 11px; color: rgba(255, 248, 236, .55); }

/* Share box */
.share-box { margin: 0 0 18px; padding: 18px 16px; text-align: center; border-radius: var(--radius); background: linear-gradient(180deg, rgba(18, 140, 75, .25), rgba(30, 3, 7, .75)); border: 2px solid rgba(37, 211, 102, .6); }
.share-box h3 { margin: 0 0 4px; font-family: var(--font-head); font-size: 22px; color: var(--gold-100); }
.share-sub { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.share-input { width: 100%; min-height: 54px; padding: 0 16px; margin-bottom: 12px; border-radius: 14px; border: 2px solid var(--gold-500); background: #fffaf0; color: var(--maroon-900); font-size: 18px; text-align: center; }
.share-input:focus { outline: 3px solid rgba(37, 211, 102, .6); outline-offset: 1px; }
.share-input.shake { animation: shake .4s; border-color: #ff4d4d; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 62px; padding: 10px 16px; margin-bottom: 10px;
  border: 0; border-radius: 16px;
  background: linear-gradient(180deg, #2ee66f, var(--wa) 50%, var(--wa-dark));
  color: #fff; font-size: 18px; font-weight: 800; line-height: 1.3; text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  box-shadow: 0 6px 18px rgba(37, 211, 102, .45);
  animation: waPulse 1.8s ease-in-out infinite;
}
.btn-wa svg { flex-shrink: 0; }
@keyframes waPulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, .55), 0 6px 18px rgba(37, 211, 102, .45); } 50% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(37, 211, 102, 0), 0 6px 18px rgba(37, 211, 102, .45); } }
.btn-copy, .btn-again {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; min-width: 48px; padding: 0 20px; border-radius: 14px;
  background: rgba(0, 0, 0, .3); color: var(--gold-100);
  border: 1px solid rgba(245, 197, 66, .6); font-weight: 700; font-size: 16px;
}
.btn-again { display: flex; margin: 0 auto 14px; }
.disclaimer { margin: 0; text-align: center; font-size: 13px; color: rgba(255, 248, 236, .6); }

/* Sticky ad + toast */
.sticky-ad {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; align-items: center;
  min-height: var(--sticky-ad-h);
  padding: 6px 0; padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: rgba(20, 2, 5, .94); border-top: 1px solid rgba(245, 197, 66, .35);
}
.toast {
  position: fixed; left: 50%; bottom: calc(var(--sticky-ad-h) + 18px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--gold-100); color: var(--maroon-900); font-weight: 700; font-size: 16px; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Portal hub ---------- */
.hub-hero { text-align: center; padding: 18px 0 8px; }
.hub-hero h1 { margin: 6px 0 6px; font-family: 'Playfair Display', 'Noto Serif Devanagari', Georgia, serif; font-size: clamp(30px, 9vw, 44px); color: var(--gold-300); text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.hub-hero p { margin: 0 auto; max-width: 28em; color: var(--muted); font-size: 17px; }
.hub-diya { font-size: 46px; filter: drop-shadow(0 0 16px rgba(255, 196, 66, .8)); }
.hub-feature { display: block; margin: 22px 0; border-radius: 22px; overflow: hidden; text-decoration: none; color: inherit; border: 2px solid var(--gold-500); box-shadow: 0 0 30px rgba(245, 197, 66, .4), 0 16px 32px rgba(0, 0, 0, .5); background: rgba(30, 3, 7, .7); }
.hub-feature-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 16px 0; }
.hub-feature-art img { border-radius: 10px; aspect-ratio: 2 / 3; object-fit: cover; border: 1px solid var(--gold-500); }
.hub-feature-body { padding: 14px 16px 18px; text-align: center; }
.hub-feature-body h2 { margin: 0 0 4px; font-family: 'Playfair Display', 'Noto Serif Devanagari', Georgia, serif; font-size: 25px; color: var(--gold-100); }
.hub-feature-body p { margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.hub-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 26px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: var(--maroon-900); font-weight: 800; font-size: 18px; }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.hub-tile { padding: 16px 12px; text-align: center; border-radius: 16px; background: rgba(30, 3, 7, .6); border: 1px dashed rgba(245, 197, 66, .45); }
.hub-tile .em { font-size: 32px; }
.hub-tile h3 { margin: 6px 0 2px; font-size: 16px; color: var(--gold-100); }
.hub-tile span { font-size: 13px; color: rgba(243, 220, 192, .85); }
.hub-foot { text-align: center; font-size: 13px; color: rgba(255, 248, 236, .6); }

/* ---------- Larger screens ---------- */
@media (min-width: 420px) {
  .brand-name { display: inline; }
  .lang-btn { padding: 0 12px; }
}
@media (min-width: 640px) {
  .wrap { padding-top: 28px; }
  .deck { gap: 18px; }
  .deck-label { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
