/* माँ काली मंदिर, गंगटा — mobile first (360px), then 768px and 1024px. */

:root {
  --maroon: #5c0a0a;
  --sindoor: #9b1c1c;
  --saffron: #f26b1d;
  --gold: #e0a526;
  --cream: #fff9ef;
  --pink: #c2185b;   /* Manjusha accents — borders/decoration only */
  --green: #2e7d32;
  --yellow: #f9c80e;
  --ink: #3a1010;
  --muted: #6b4434;
  --card: #fffdf8;
  --line: #ecd9b8;
  --alt: #fbf0dc;
  --r: 16px;
  --f-body: 'Mukta', 'Nirmala UI', 'Noto Sans Devanagari', system-ui, sans-serif;
  --f-head: 'Tiro Devanagari Hindi', 'Nirmala UI', serif;
  /* Manjusha triangle band and Aripan motif, as tiny inline SVGs */
  --manjusha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='14'%3E%3Cpath d='M0 0h18L9 14z' fill='%23c2185b'/%3E%3Cpath d='M18 0h18l-9 14z' fill='%232e7d32'/%3E%3Cpath d='M36 0h18l-9 14z' fill='%23f9c80e'/%3E%3C/svg%3E");
  --aripan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cg fill='none' stroke='%23fff9ef' stroke-opacity='.08' stroke-width='1.5'%3E%3Ccircle cx='28' cy='28' r='6'/%3E%3Cpath d='M28 8q6 10 0 13q-6-3 0-13zM28 48q6-10 0-13q-6 3 0 13zM8 28q10-6 13 0q-3 6-13 0zM48 28q-10-6-13 0q3 6 13 0z'/%3E%3C/g%3E%3Cg fill='%23fff9ef' fill-opacity='.1'%3E%3Ccircle cx='0' cy='0' r='2'/%3E%3Ccircle cx='56' cy='0' r='2'/%3E%3Ccircle cx='0' cy='56' r='2'/%3E%3Ccircle cx='56' cy='56' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--f-body);
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 400; line-height: 1.3; color: var(--maroon); margin: 0 0 .6em; }
h2 { font-size: 1.6rem; display: flex; align-items: center; gap: .5rem; }
h3 { font-size: 1.25rem; margin-top: 1.2em; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
a { color: var(--sindoor); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.reading { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.lead { font-family: var(--f-head); font-size: 1.4rem; color: var(--sindoor); margin-bottom: .3em; }
.note { color: var(--sindoor); font-weight: 700; }
.lotus { width: 2.2rem; height: 1.1rem; color: var(--gold); flex: none; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--maroon); color: var(--cream); padding: 12px 16px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }
.demo-banner {
  /* hangs just below the header: covers no controls and causes no layout shift */
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
  background: linear-gradient(90deg, #f6d27a, var(--gold) 50%, #f6d27a); color: var(--maroon);
  text-align: center; font-weight: 700; font-size: .9rem; line-height: 1.4; padding: 6px 16px;
  box-shadow: 0 2px 8px rgba(92,10,10,.25);
}
.notice { max-width: 34rem; margin: 0 auto 16px; padding: 10px 14px; border-radius: 12px; background: var(--cream); color: var(--maroon); font-weight: 700; border-left: 5px solid var(--gold); text-align: left; }

/* ---------- Buttons ---------- */
.btn {
  flex-wrap: wrap;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; padding: 8px 20px; border-radius: 999px;
  border: 2px solid var(--sindoor); background: var(--card); color: var(--sindoor);
  font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--maroon); }
.btn.big { width: 100%; font-size: 1.15rem; min-height: 56px; background: var(--sindoor); color: var(--cream); }
.btn.big.gold { background: var(--gold); border-color: var(--gold); color: var(--maroon); }
.btn.wide { width: 100%; }
.btn.small { min-height: 48px; padding: 4px 14px; font-size: .95rem; }
.btn.ghost { background: transparent; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chips.scroll {
  flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  margin-inline: -16px; padding: 2px 16px 4px;
}
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; scroll-snap-align: start; }
/* More chips hidden to the right: fade that edge so people see they can scroll */
.chips.scroll.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.chip {
  min-height: 48px; padding: 6px 16px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--card); color: var(--maroon); font-weight: 700;
  transition: background-color .25s, color .25s, border-color .25s;
}
.chip[aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: var(--cream); }
.badge {
  display: inline-block; font-size: .875rem; font-weight: 700; line-height: 1.4;
  padding: 2px 10px; border-radius: 999px; background: var(--maroon); color: var(--cream); white-space: nowrap;
}
.badge.now { background: var(--sindoor); }
.badge.soft { background: var(--alt); color: var(--maroon); border: 1px solid var(--gold); margin-left: .5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.card.aripan { background: var(--card) radial-gradient(circle, rgba(224,165,38,.12) 1.5px, transparent 2px) 0 0 / 18px 18px; }

/* ---------- Header + nav ---------- */
.topbar { position: relative; z-index: 35; background: var(--maroon); color: var(--cream); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 48px; color: var(--cream); text-decoration: none; font-family: var(--f-head); font-size: 1.05rem; line-height: 1.25; }
.brand img { border-radius: 8px; flex: none; }
.tools { position: relative; flex: none; }
.tools-toggle { display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.tools-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; min-width: 220px;
  flex-direction: column; gap: 12px; padding: 12px; border-radius: var(--r);
  background: var(--maroon); border: 2px solid var(--gold); box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.tools.open .tools-panel { display: flex; }
.fs { display: flex; gap: 8px; }
.fs .tool { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.langs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.langs .chip { flex: 1; background: transparent; color: var(--cream); border-color: rgba(255,249,239,.35); padding: 4px 12px; }
.langs .chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--maroon); }
.tool { min-width: 48px; min-height: 48px; border-radius: 12px; border: 1px solid rgba(255,249,239,.35); background: transparent; color: var(--cream); font-weight: 700; cursor: pointer; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(var(--n, 5), 1fr);
  background: var(--maroon); border-top: 3px solid var(--gold);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--cream); text-decoration: none; font-size: .875rem; font-weight: 700;
}
.nav svg { width: 22px; height: 22px; color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; contain: paint;
  background: var(--aripan), radial-gradient(ellipse at 50% 20%, #7a1515, var(--maroon) 70%);
  color: var(--cream); padding: 28px 0 32px; text-align: center;
}
/* The demo strip hangs over the hero; push Maa's photo below it (strip wraps to 2 lines on small phones) */
body.demo .hero { padding-top: 64px; }
.hero-in { position: relative; z-index: 1; display: grid; gap: 24px; justify-items: center; }
.arch {
  position: relative; margin: 12px 0 0; width: min(70vw, 320px);
  padding: 8px; border-radius: 999px 999px 18px 18px;
  background: linear-gradient(160deg, #f6d27a, var(--gold) 45%, #b47c12);
  box-shadow: 0 0 0 3px var(--maroon), 0 0 0 5px var(--gold);
  isolation: isolate;
}
.arch img { border-radius: 999px 999px 12px 12px; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--maroon); }
/* Diya glow behind Maa: opacity + transform only (cheap on the GPU) */
.arch::before {
  content: ''; position: absolute; inset: -22%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242,107,29,.6), rgba(224,165,38,.28) 55%, transparent 76%);
  animation: breathe 5s ease-in-out infinite; will-change: transform, opacity;
}
@keyframes breathe { 0%, 100% { opacity: .55; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.05); } }
.hero h1 { color: var(--cream); font-size: 2rem; margin-bottom: .2em; }
.hero .sub { color: #f3dcc0; margin-bottom: 1rem; }
.jai { font-family: var(--f-head); font-size: 1.2rem; margin: 0 0 .2em; color: var(--gold); }
.jai.big { font-size: 2rem; }
.shimmer {
  background: linear-gradient(100deg, var(--gold) 40%, #fff1c2 50%, var(--gold) 60%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0 0; } }
.verse {
  margin: 0 auto 12px; padding: 14px 16px; max-width: 34rem;
  border: 1px solid rgba(224,165,38,.6); border-radius: var(--r); background: rgba(0,0,0,.18);
}
.verse p { font-family: var(--f-head); font-size: 1.12rem; line-height: 1.8; color: #ffe9b0; margin: 0; }
.verse footer { font-size: .875rem; color: #f3dcc0; margin-top: 6px; }
.meaning { max-width: 34rem; margin: 0 auto 18px; color: #f8e8d4; }
.hero-text { display: flex; flex-direction: column; }
.countdown { width: 100%; max-width: 26rem; margin: 0 auto; }
.cd-title { font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.cd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-grid div { text-align: center; background: rgba(0,0,0,.25); border: 1px solid rgba(224,165,38,.5); border-radius: 12px; padding: 8px 4px; }
.cd-grid b { display: block; font-size: 1.8rem; line-height: 1.2; color: var(--cream); font-variant-numeric: tabular-nums; }
.cd-grid span { font-size: .875rem; color: #f3dcc0; }
.cd-when { margin-top: 10px; color: #f3dcc0; }
.live-card { background: var(--cream); color: var(--ink); border-radius: var(--r); padding: 16px; max-width: 30rem; margin: 0 auto 20px; border: 3px solid var(--gold); }
.live-title { font-family: var(--f-head); font-size: 1.3rem; color: var(--sindoor); display: flex; justify-content: center; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sindoor); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .5; } }
.ended { font-family: var(--f-head); font-size: 1.4rem; color: var(--gold); }
.hero-update {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; text-align: left;
  max-width: 26rem; width: 100%; margin: 16px auto 0; padding: 10px 12px; border-radius: 12px;
  background: var(--cream); color: var(--ink); text-decoration: none; border-left: 5px solid var(--gold);
}
.hero-update .badge { grid-row: 1 / span 2; }
.hero-update time { font-size: .875rem; color: var(--muted); }

/* Marigold petals — max 8, transform/opacity only */
.petals i {
  position: absolute; top: -20px; width: 14px; height: 10px; border-radius: 0 70% 0 70%;
  background: radial-gradient(circle at 30% 30%, #ffd23f, var(--saffron));
  opacity: .8; will-change: transform; animation: fall 16s linear infinite;
}
.petals { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.petals i:nth-child(1) { left: 1%;  animation-delay: -1s; }
.petals i:nth-child(2) { left: 4%;  animation-delay: -9s;  animation-duration: 19s; }
.petals i:nth-child(3) { left: 7%;  animation-delay: -5s;  animation-duration: 14s; }
.petals i:nth-child(4) { left: 10%; animation-delay: -13s; animation-duration: 18s; }
.petals i:nth-child(5) { left: 87%; animation-delay: -3s;  animation-duration: 15s; }
.petals i:nth-child(6) { left: 90%; animation-delay: -11s; animation-duration: 20s; }
.petals i:nth-child(7) { left: 93%; animation-delay: -7s;  animation-duration: 17s; }
.petals i:nth-child(8) { left: 96%; animation-delay: -15s; animation-duration: 21s; }
@keyframes fall {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(-12px, 1400px, 0) rotate(600deg); }
}

.band { height: 14px; background: var(--manjusha) repeat-x; }

/* ---------- Sections ---------- */
.section { padding: 40px 0; scroll-margin-top: 48px; }
.section.alt { background: var(--alt); }
.reveal { transition: opacity .7s ease, transform .7s ease; }
.reveal.pre { opacity: 0; transform: translateY(18px); }
.two, .three { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

/* Abhi */
.updates { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.update { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 12px; padding: 12px 14px; }
.update.pinned { border-left-color: var(--sindoor); background: #fff4ec; }
.update p { margin: 4px 0; font-size: 1.1rem; }
.update time { font-size: .875rem; color: var(--muted); }

/* Schedule */
.schedule { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.schedule li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.schedule .when { grid-column: 1; font-weight: 700; color: var(--sindoor); font-size: .95rem; }
.schedule .what { grid-column: 1; font-size: 1.1rem; }
.schedule .badge { grid-column: 2; grid-row: 1 / span 2; }
.schedule li.is-now { border: 2px solid var(--sindoor); background: #fff1e6; box-shadow: 0 2px 12px rgba(155,28,28,.15); }
.schedule li.is-next { border: 2px solid var(--gold); }
.day-col:not(.active), .day-h { display: none; }
.day-col.anim li { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

/* Bhasan + guide */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; }
.facts dt { font-weight: 700; color: var(--maroon); }
.facts dd { margin: 0; }
.safety { border-color: var(--gold); border-left: 5px solid var(--sindoor); }
.safety ul { margin: 0; padding-left: 1.2rem; }
.safety li { margin-bottom: 6px; }
.map { display: grid; gap: 10px; align-content: start; }
.facade {
  width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--r); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px;
  background: var(--aripan), var(--maroon); color: var(--cream); font-weight: 700; font-size: 1.05rem;
}
.facade-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--gold); position: relative; }
.facade-icon.yt::after { content: ''; position: absolute; left: 24px; top: 18px; border: 12px solid transparent; border-left: 18px solid var(--maroon); border-right: 0; }
/* Map placeholder: a gold location pin instead of a play button */
.facade-icon.pin { background: none; border-radius: 0; }
.facade-icon.pin::after { content: ''; position: absolute; left: 12px; top: 4px; width: 36px; height: 36px; border-radius: 50% 50% 50% 0; background: var(--gold); transform: rotate(-45deg); }
.facade-icon.pin::before { content: ''; position: absolute; left: 24px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--maroon); z-index: 1; }
.map iframe, .video iframe { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--r); }
.map .facade, .map iframe { aspect-ratio: 16 / 9; }
.video iframe, .video .facade { aspect-ratio: 16 / 9; }
.map .facade.optional { display: none; }

/* Bhajan: Vidyapati card, village rows, song cards (1 / 2 / 3 per row) */
.vidyapati h3 { margin-top: 0; }
.facade.compact { aspect-ratio: auto; width: auto; min-height: 64px; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 8px 22px 8px 8px; border-radius: 999px; margin-bottom: 12px; }
.facade.compact .facade-icon { width: 48px; height: 48px; flex: none; }
.facade.compact .facade-icon.yt::after { left: 18px; top: 13px; border-width: 11px; border-left-width: 16px; }
.vidyapati iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; margin-bottom: 12px; }
.lyrics-box summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--sindoor); }
.video-cards { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.video-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.video-card .facade, .video-card iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 0; }
.facade.has-thumb { position: relative; padding: 0; overflow: hidden; }
.facade-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.facade.has-thumb .facade-icon { position: relative; z-index: 1; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.vc-title { margin: 12px 14px 2px; font-weight: 700; }
.vc-singer { margin: 0 14px 14px; color: var(--muted); }
.yt-btn { margin-top: 4px; }

/* Smriti */
.gallery { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.thumb { display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--line); }
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.then-now { display: grid; gap: 20px; }
.tn { margin: 0 auto; width: 100%; max-width: 720px; }
.tn-box { position: relative; border-radius: var(--r); overflow: hidden; }
.tn-box img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tn-then { position: absolute; inset: 0; height: 100%; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.tn-box::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1px; background: var(--gold); }
.tn-label { position: absolute; top: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-weight: 700; font-size: .875rem; }
.tn-l { left: 8px; } .tn-r { right: 8px; }
.tn input { width: 100%; min-height: 48px; accent-color: var(--sindoor); }
.tn figcaption { color: var(--muted); }

/* Lightbox */
.lightbox { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #0d0303; color: #fff; touch-action: pan-y; }
.lightbox::backdrop { background: rgba(0,0,0,.9); }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 80dvh; object-fit: contain; }
.lightbox p { padding: 10px 70px; text-align: center; margin: 0; }
.lb-btn { position: absolute; width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.lb-close { top: 12px; right: 12px; font-size: 1.4rem; }
.lb-prev { left: 8px; bottom: 12px; } .lb-next { right: 8px; bottom: 12px; }

/* Kathas */
.prose p { font-size: 1.1rem; }
.kathas { display: grid; gap: 12px; }
.katha { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.katha summary {
  min-height: 56px; padding: 12px 44px 12px 16px; cursor: pointer; list-style: none; position: relative;
  font-family: var(--f-head); font-size: 1.2rem; color: var(--maroon);
}
.katha summary::-webkit-details-marker { display: none; }
.katha summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--sindoor); }
.katha[open] summary::after { content: '−'; }
.katha[open] summary { border-bottom: 1px dashed var(--line); }
.katha > p, .katha > .track { margin: 12px 16px; }
.source { font-size: .9rem; color: var(--muted); }

/* Audio tracks */
.tracks { display: grid; gap: 10px; }
.track { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; }
.track-body { flex: 1; min-width: 0; }
.track-title { margin: 0; font-weight: 700; }
.track .muted { margin: 0; font-size: .9rem; }
.seek { width: 100%; min-height: 48px; accent-color: var(--sindoor); }
.play { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--sindoor); position: relative; cursor: pointer; }
.play::before { content: ''; position: absolute; left: 22px; top: 17px; border: 11px solid transparent; border-left: 16px solid var(--cream); border-right: 0; }
.play.playing::before { left: 19px; top: 18px; width: 6px; height: 20px; border: 0; background: var(--cream); box-shadow: 12px 0 0 var(--cream); }
.track.off .play { background: var(--line); }
.track.off .play::before { border-left-color: var(--muted); }
.lyrics { white-space: pre-line; font-family: var(--f-head); font-size: 1.1rem; line-height: 1.9; }

/* Bhakti */
.mantra-text { font-family: var(--f-head); font-size: clamp(14px, 4.4vw, 1.25rem); line-height: 1.8; color: var(--sindoor); }
.mline { display: block; white-space: nowrap; }
.mala {
  --p: 0; display: grid; place-content: center; width: min(72vw, 260px); aspect-ratio: 1; margin: 8px auto 12px; border-radius: 50%;
  border: 0; cursor: pointer; color: var(--maroon); position: relative; isolation: isolate;
  background: conic-gradient(var(--saffron) calc(var(--p) * 360deg), var(--line) 0);
  touch-action: manipulation; user-select: none;
}
.mala::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--card); z-index: -1; }
.mala:active { transform: scale(.97); }
.mala #mala-n { font-size: 3.5rem; font-weight: 700; line-height: 1; }
.mala small { color: var(--muted); }
.mala-tap { font-size: .875rem; color: var(--sindoor); margin-top: 4px; }
.diya { position: relative; width: 140px; height: 120px; margin: 8px auto 16px; }
.diya .bowl { position: absolute; left: 20px; right: 20px; bottom: 10px; height: 40px; border-radius: 0 0 70px 70px; background: linear-gradient(#c8641e, #8a3b0b); }
.diya .bowl::before { content: ''; position: absolute; left: -6px; right: -6px; top: -6px; height: 12px; border-radius: 50%; background: #a84c12; }
.diya .flame {
  position: absolute; left: 58px; bottom: 60px; width: 24px; height: 40px; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 70%, #fff7c2, #ffd23f 40%, var(--saffron) 75%); transform-origin: 50% 100%;
  transform: scale(0); opacity: 0; transition: transform .6s ease, opacity .6s ease;
}
.diya .wick { position: absolute; left: 68px; bottom: 50px; width: 4px; height: 14px; border-radius: 2px; background: #3a1d0a; z-index: 1; }
.diya .glow { position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,210,63,.55), transparent); opacity: 0; transition: opacity .8s; }
.diya.lit .flame { transform: scale(1); opacity: 1; animation: flicker 2.4s ease-in-out .6s infinite; }
.diya.lit .glow { opacity: 1; }
@keyframes flicker { 50% { transform: scale(.94, 1.06) rotate(-2deg); } }

/* Photo with Maa */
.btn.file { position: relative; overflow: hidden; margin: 4px 0 16px; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.file:focus-within { outline: 3px solid var(--saffron); outline-offset: 2px; }
.field { display: grid; gap: 4px; font-weight: 700; color: var(--maroon); max-width: 26rem; }
.field input { min-height: 48px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 400; color: var(--ink); }
.photo-maker .field { max-width: none; margin-bottom: 12px; }
.photo-maker #photo-share { margin: 16px 0 10px; }
#photo-canvas { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; border-radius: 12px; box-shadow: 0 6px 24px rgba(92,10,10,.2); background: var(--maroon); }

/* Daan */
.daan { display: grid; gap: 12px; text-align: left; margin-top: 16px; }
.daan-link {
  display: inline-flex; align-items: center; gap: 8px; align-self: center; min-height: 48px; margin-top: 14px; padding: 0 20px;
  border: 2px solid var(--gold); border-radius: 999px; color: var(--gold); font-weight: 700; text-decoration: none;
}
.daan-link svg { width: 20px; height: 20px; }
/* Darshan info: help first, then travel, nearby, map (phones); help | map, then full-width card grids (wider) */
.guide { display: grid; column-gap: 32px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "help" "travel" "nearby" "map"; }
.guide-help { grid-area: help; } .guide-travel { grid-area: travel; } .guide-nearby { grid-area: nearby; } .guide-map { grid-area: map; }
.guide-help > .btn.emergency { margin-top: 0; }
.qr { margin: 0 auto; border: 6px solid #fff; border-radius: 12px; box-shadow: 0 0 0 3px var(--gold); width: 280px; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.copy-label { font-weight: 700; color: var(--maroon); }
.copy-row code { flex: 1; min-width: 10ch; font-size: 1.05rem; word-break: break-all; }

/* Contacts */
.btn.emergency { width: 100%; background: var(--sindoor); color: #fff; font-size: 1.15rem; min-height: 56px; }
.contacts, .place-cards { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.contacts li { display: flex; flex-direction: column; align-items: stretch; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.btn.call { width: 100%; background: var(--green); border-color: var(--green); color: #fff; }
.btn.call.off { background: var(--line); border-color: var(--line); color: var(--muted); cursor: default; }
.place-cards li { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.place-cards a { min-height: 48px; display: inline-flex; align-items: center; font-weight: 700; }

/* Now playing */
.now-playing {
  position: fixed; left: 8px; right: 8px; z-index: 29; bottom: calc(68px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px; border-radius: 999px;
  background: var(--cream); color: var(--maroon); border: 2px solid var(--gold); box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.np-icon { color: var(--sindoor); font-size: 1.2rem; }
.np-title { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-btn { flex: none; min-width: 48px; min-height: 48px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--sindoor); color: var(--cream); font-weight: 700; cursor: pointer; }
body.has-np { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }

/* Footer */
.footer { background: var(--maroon); color: var(--cream); text-align: center; padding: 28px 16px 32px; display: grid; gap: 12px; justify-items: center; }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 0; font-size: 1.125rem; }
  .topbar { position: sticky; top: 0; z-index: 30; }
  .nav { position: static; display: flex; gap: 2px; background: none; border: 0; padding: 0; }
  .nav a { flex-direction: row; min-height: 48px; padding: 0 10px; font-size: 1rem; border-radius: 10px; }
  .nav a:hover { background: rgba(255,249,239,.1); }
  .section { scroll-margin-top: 72px; padding: 56px 0; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
  .map .facade, .map iframe { aspect-ratio: 4 / 3; }
  .map .facade.optional { display: flex; }
  .video-cards, .place-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "help map" "travel travel" "nearby nearby"; align-items: start; }
  .photo-maker { max-width: 520px; }
  .now-playing { left: auto; right: 16px; bottom: 16px; max-width: 420px; }
  body.has-np { padding-bottom: 80px; }
  h2 { font-size: 2rem; }
}
@media (min-width: 1024px) {
  .hero { padding: 48px 0; text-align: left; }
  .hero-in { grid-template-columns: 360px 1fr; gap: 56px; align-items: center; justify-items: start; }
  .arch { width: 100%; }
  .verse, .meaning, .countdown, .live-card, .hero-update { margin-left: 0; }
  .daan-link { align-self: flex-start; }
  .live-title { justify-content: flex-start; }
  .hero h1 { font-size: 2.8rem; }
  .three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
  #bhakti .three { align-items: stretch; }
  .mantra-text { font-size: min(1.125rem, 1.6vw); } /* narrow card: keep each half-verse on one line */
  #bhakti .three > .card { margin-bottom: 0; }
  .video-cards, .place-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Photo with Maa: controls left, preview right with share + download under it */
  .photo-maker { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: repeat(5, auto) 1fr; column-gap: 48px; align-items: start; }
  .photo-maker > * { grid-column: 1; }
  .photo-maker > #photo-modes { grid-row: 1; } .photo-maker > .field { grid-row: 2; } .photo-maker > #photo-file-wrap { grid-row: 3; }
  .photo-maker > #photo-msg { grid-row: 4; } .photo-maker > .muted { grid-row: 5; }
  .photo-maker > #photo-canvas { grid-column: 2; grid-row: 1 / 7; }
  .photo-maker > #photo-share { grid-column: 2; grid-row: 7; } .photo-maker > #photo-dl { grid-column: 2; grid-row: 8; }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  /* Language + size inline; all three puja days side by side */
  #day-tabs { display: none; }
  .days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .day-col, .day-col:not(.active) { display: block; }
  .day-h { display: block; margin-top: 0; }
}
/* Phones held sideways: keep Maa's photo within the short screen */
@media (orientation: landscape) and (max-height: 500px) {
  .arch { width: min(38vw, 240px); }
  /* Short screen: a slimmer one-row bottom nav leaves more room for content */
  .nav a { min-height: 48px; flex-direction: row; gap: 6px; }
  body { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .now-playing { bottom: calc(56px + env(safe-area-inset-bottom)); }
  body.has-np { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
}
/* Below 1024px the topbar holds brand + tools; nav sits there from 768px only if it fits */
@media (min-width: 768px) and (max-width: 1023px) {
  .topbar-in { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; justify-content: center; }
  .section { scroll-margin-top: 120px; }
}

/* ---------- Reduced motion: switch off everything non-essential ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petals { display: none; }
  .reveal.pre { opacity: 1; transform: none; }
  .shimmer { color: var(--gold); background: none; }
}
