:root {
  --accent: hsl(30 95% 60%);
  --gold: #ffd27a;
  --text: #fff6e6;
  --dim: #ead8b8;
  --rx: 0deg; --ry: 0deg; --px: 0px; --py: 0px;
  --serif: 'Tiro Devanagari Hindi', 'Noto Serif Devanagari', 'Nirmala UI', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #0a0710; color: var(--text); overscroll-behavior: none;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; touch-action: manipulation; }
body.no-art { background: radial-gradient(ellipse at 50% 35%, #3a1a10 0%, #150a12 55%, #07040a 100%); }
a { color: inherit; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Painting ---------- */
.stage { position: fixed; inset: -3%; z-index: 0; transform: translate3d(var(--px), var(--py), 0); will-change: transform; }
.bg { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; overflow: hidden; }
.bg.on { opacity: 1; }
.pic {
  position: absolute; left: 50%; top: 38%;
  width: max(100%, 152vh); width: max(100%, 152dvh);
  height: auto; max-width: none;
  transform: translate(calc(-50% + var(--dx0, 0px)), -38%) scale(1.06);
  will-change: transform;
}
.bg.on .pic { animation: drift 24s ease-in-out infinite alternate; }
.bg.entering { animation: enter 1.4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes drift {
  from { transform: translate(calc(-50% + var(--dx0, 0px)), -38%) scale(1.06); }
  to   { transform: translate(calc(-50% + var(--dx1, 0px)), -38%) scale(1.14); }
}
@keyframes enter { from { transform: scale(1.2); } to { transform: scale(1); } }
@media (hover: hover) and (pointer: fine) {
  @keyframes enter { from { transform: scale(1.2); filter: blur(14px) brightness(1.5); } to { transform: scale(1); filter: none; } }
}

#embers { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.scrim { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(8,4,10,.95) 0%, rgba(8,4,10,.62) 32%, rgba(8,4,10,0) 62%), linear-gradient(to bottom, rgba(8,4,10,.5) 0%, transparent 20%); }
body[data-mode="hero"] .scrim, body[data-mode="end"] .scrim {
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(8,4,10,.68), rgba(8,4,10,.34) 70%, rgba(8,4,10,.68)); }
body.no-art .scrim { background: radial-gradient(ellipse 70% 55% at 50% 40%, rgba(255,150,60,.16), transparent 70%); }
.flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 45%, var(--accent), transparent 65%); }
.flash.go { animation: flash 1s ease-out; }
@keyframes flash { from { opacity: .45; } to { opacity: 0; } }

/* ---------- Panels ---------- */
.panel { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .55s ease, visibility 0s .55s; }
.panel.active { opacity: 1; visibility: visible; transition: opacity .8s ease .2s; }
.panel.active a, .panel.active button { pointer-events: auto; }
.hero-panel, .end-panel { justify-content: center; text-align: center; padding: 0 1.5rem; }
.eyebrow { letter-spacing: .3em; font-size: .78rem; color: var(--gold); margin-bottom: 1.1rem; text-shadow: 0 2px 12px #000; }
.title { font-family: 'Cinzel', var(--serif); font-size: clamp(2.5rem, 12vw, 6rem); font-weight: 700; line-height: 1.15;
  background: linear-gradient(180deg, #fff6e0 0%, #ffcf85 55%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,.6)); }
.title span { display: inline-block; }
.title.small { font-size: clamp(2rem, 9vw, 4.2rem); }
.subtitle { margin-top: .9rem; color: var(--dim); font-weight: 300; letter-spacing: .04em; font-size: clamp(.9rem, 3.4vw, 1.15rem); text-shadow: 0 2px 12px #000; }
.om-mark { font-size: 3.2rem; color: var(--gold); text-shadow: 0 0 40px var(--accent); }
.begin { display: inline-block; margin-top: 2rem; padding: .9rem 2rem; min-height: 44px; font: 500 .82rem 'Poppins', sans-serif; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text); background: rgba(255,255,255,.1); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 999px;
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .25s, box-shadow .25s; }
.begin:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 50px color-mix(in srgb, var(--accent) 60%, transparent); }

/* ---------- Verse card ---------- */
.verse-panel { justify-content: flex-end; padding: 0 12px max(14px, calc(env(safe-area-inset-bottom) + 10px)); perspective: 1100px; }
.card { position: relative; width: min(900px, 100%); max-height: 62vh; max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  padding: clamp(1rem, 2.4vh, 1.9rem) clamp(1.1rem, 3vw, 2.4rem); text-align: center;
  background: linear-gradient(160deg, rgba(20,10,20,.6), rgba(10,5,14,.78)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 22px;
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 20px 80px rgba(0,0,0,.55), 0 0 60px color-mix(in srgb, var(--accent) 20%, transparent), inset 0 1px 0 rgba(255,255,255,.12);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: border-color 1s, box-shadow 1s; }
.card::-webkit-scrollbar { display: none; }
.chip { display: inline-block; font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); padding: .28rem .85rem; margin-bottom: .7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 999px; }
.more-btn { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--dim); cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); }
.more-btn[aria-expanded="true"] { background: var(--accent); color: #200; border-color: transparent; }
.hi { font-family: var(--serif); font-size: clamp(1.2rem, min(5.4vw, 4.4vh), 2.2rem); line-height: 1.65; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.rule { width: 56px; height: 1px; margin: .7rem auto; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.en { font-size: clamp(.86rem, min(3.7vw, 2.5vh), 1.08rem); line-height: 1.6; font-weight: 300; color: var(--dim); font-style: italic; max-width: 720px; margin: 0 auto; }
.more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s ease; }
.more-in { overflow: hidden; min-height: 0; }
.card.open .more { grid-template-rows: 1fr; }
.tr { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed rgba(255,255,255,.2); font-size: clamp(.86rem, 3.5vw, 1rem); line-height: 1.6; color: var(--gold); }
.note { margin: .7rem auto 0; max-width: 720px; font-size: clamp(.8rem, 3.3vw, .92rem); line-height: 1.6; font-weight: 300; color: var(--dim); }
.ln { display: block; }
.w { display: inline-block; opacity: 0; transform: translateY(calc(var(--dy, 1) * .5em)); transition: opacity .6s ease, transform .7s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i) * 40ms + 250ms); }
.en .w { transform: translateY(.3em); transition-delay: calc(var(--i) * 12ms + 800ms); }
.in .w { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .w { filter: blur(8px); transition-property: opacity, transform, filter; } .in .w { filter: none; } }
.chip, .rule { transition: opacity .5s ease .2s; }
.card:not(.in) .chip, .card:not(.in) .rule { opacity: 0; }
body.no-art .verse-panel { justify-content: center; }
body.no-art .card { max-height: 54vh; max-height: 54dvh; }

/* ---------- HUD ---------- */
.rail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 6; display: none; flex-direction: column; gap: 3px; }
.rail i { display: block; width: 3px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.28); cursor: pointer; transition: all .35s; position: relative; }
.rail i::before { content: ''; position: absolute; inset: -3px -8px; }
.rail i:hover { background: rgba(255,255,255,.7); }
.rail i.on { height: 22px; width: 4px; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
@media (min-width: 900px) and (hover: hover) { .rail { display: flex; } }

.hud { position: fixed; left: 0; right: 0; top: 0; z-index: 6; display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top)) 14px 0; pointer-events: none; }
.counter { font-family: 'Cinzel', serif; letter-spacing: .1em; color: var(--dim); text-shadow: 0 2px 10px #000; }
.counter b { font-size: 1.4rem; color: var(--gold); }
.hud-btns { display: flex; gap: 8px; pointer-events: auto; }
.hud-btns > * { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); font-size: 1rem; cursor: pointer; line-height: 1;
  background: rgba(20,10,20,.45); border: 1px solid rgba(255,255,255,.22); transition: background .25s, transform .25s, border-color .25s; }
.hud-btns > *:hover { background: rgba(255,255,255,.18); border-color: var(--accent); }
.hud-btns .active { background: var(--accent); color: #200; }
.hint { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--dim); text-shadow: 0 2px 10px #000; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .6s; }
body[data-mode="hero"] .hint { opacity: .9; }
.hint-arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(2px); } 50% { transform: translateY(-5px); } }


/* ---------- Music pill (play / pause) ---------- */
.music-pill { position: fixed; z-index: 7; left: 14px; top: max(62px, calc(env(safe-area-inset-top) + 54px)); display: inline-flex; align-items: center; gap: .55rem;
  height: 42px; padding: 0 1rem 0 .8rem; border-radius: 999px; cursor: pointer; font: 500 .8rem 'Poppins', system-ui, sans-serif; letter-spacing: .02em; color: var(--text);
  background: linear-gradient(135deg, rgba(40,20,20,.82), rgba(14,8,16,.85)); border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 22px color-mix(in srgb, var(--accent) 35%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .25s, transform .25s; }
.music-pill:hover { transform: translateY(-1px); background: rgba(60,30,25,.9); }
.music-pill.attn { animation: pillPulse 2.4s ease-in-out infinite; }
@keyframes pillPulse { 0%,100% { box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 0 9px transparent, 0 0 30px color-mix(in srgb, var(--accent) 55%, transparent); } }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq i { width: 3px; height: 35%; border-radius: 2px; background: var(--accent); }
.eq i:nth-child(2) { animation-delay: .25s; } .eq i:nth-child(3) { animation-delay: .5s; }
.music-pill.attn .eq i, .music-pill.playing .eq i { animation: eqBar 1s ease-in-out infinite; }
@keyframes eqBar { 0%,100% { height: 30%; } 50% { height: 100%; } }
.music-dot { width: 8px; height: 8px; margin-left: .1rem; border-radius: 50%; background: #1ed760; box-shadow: 0 0 8px #1ed760; display: none; }
.music-pill.playing .music-dot { display: block; animation: dotPulse 1.8s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.7); } }
.begin.ghost { display: block; margin: .8rem auto 0; background: transparent; box-shadow: none; border-color: rgba(255,255,255,.35); padding: .7rem 1.6rem; }
@media (prefers-reduced-motion: reduce) { .music-pill.attn, .eq i, .music-pill.playing .music-dot { animation: none !important; } .eq i { height: 70%; } }


/* ---------- Hero text links, share button, toast ---------- */
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; margin-top: 1.1rem; font-size: .78rem; letter-spacing: .06em; }
.hero-links a { color: var(--dim); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.28); padding-bottom: 1px; text-shadow: 0 2px 8px #000; }
.hero-links a:hover { color: #fff; border-color: var(--accent); }
.share-btn { position: absolute; top: 10px; left: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--dim); cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); }
.share-btn:hover { border-color: var(--accent); color: #fff; }
.toast { position: fixed; left: 50%; bottom: max(96px, calc(env(safe-area-inset-bottom) + 90px)); transform: translate(-50%, 16px); z-index: 30; padding: .6rem 1.1rem; border-radius: 999px;
  background: rgba(20,10,20,.94); border: 1px solid var(--accent); color: var(--text); font-size: .85rem; opacity: 0; transition: opacity .35s, transform .35s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sheet (all verses / about) ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; overflow-y: auto; overscroll-behavior: contain; background: rgba(10,6,14,.96);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s; -webkit-overflow-scrolling: touch; }
.sheet.open { opacity: 1; visibility: visible; transition: opacity .35s; }
.sheet-in { max-width: 760px; margin: 0 auto; padding: 4.5rem 1.25rem 4rem; line-height: 1.7; color: var(--dim); font-weight: 300; }
.sheet-x { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; color: var(--text); cursor: pointer; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); }
.sheet h2 { font-family: 'Cinzel', serif; font-size: 1.35rem; color: var(--gold); margin: 2rem 0 .8rem; font-weight: 700; }
.sheet h3 { font-size: 1rem; color: var(--text); margin: 1.3rem 0 .3rem; font-weight: 500; }
.sheet p { margin-bottom: .8rem; }
.sheet a { color: var(--gold); }
.verse-list { list-style: none; display: grid; gap: .3rem; }
.verse-list a { display: block; padding: .55rem .8rem; border-radius: 10px; background: rgba(255,255,255,.05); color: var(--dim); min-height: 44px; }
.verse-list a:hover { background: rgba(255,255,255,.12); }
.verse-list b { color: var(--accent); font-weight: 500; margin-right: .5rem; }
.full { list-style: none; }
.full li { padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.full h3 { margin: 0 0 .4rem; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.full p[lang="hi"] { font-family: var(--serif); font-size: 1.25rem; color: var(--text); line-height: 1.7; margin: 0 0 .3rem; }
.full .tr { margin: 0 0 .3rem; padding: 0; border: 0; font-size: .95rem; }
.full p[lang="en"] { font-style: italic; margin: 0; }



/* ---------- Portrait screens: show the whole painting, blurred copy fills the rest ---------- */
.fill { display: none; }
@media (max-aspect-ratio: 1/1) {
  .fill { display: block; position: absolute; inset: -4%; background-size: cover; background-position: center; filter: blur(8px) brightness(.62) saturate(1.25); }
  .pic { width: 100%; left: 50%; top: 37%; transform: translate(-50%, -50%) scale(1.02);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 7%, #000 93%, transparent 100%); }
  .bg.on .pic { animation: driftP 24s ease-in-out infinite alternate; }
  body[data-mode="hero"] .pic, body[data-mode="end"] .pic { top: 31%; }
  .hero-panel, .end-panel { justify-content: flex-end; padding-bottom: max(13vh, calc(env(safe-area-inset-bottom) + 90px)); }
}
@keyframes driftP {
  from { transform: translate(-50%, -50%) scale(1.02); }
  to   { transform: translate(-50%, -50%) scale(1.1); }
}

/* ---------- Swipe cue (first doha) ---------- */
.swipe-cue { position: fixed; left: 50%; bottom: max(2.5vh, calc(env(safe-area-inset-bottom) + 14px)); transform: translateX(-50%); z-index: 5; pointer-events: none;
  text-align: center; opacity: 0; transition: opacity .6s ease; }
.swipe-cue.show { opacity: 1; }
.swipe-cue p { margin-top: .45rem; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); text-shadow: 0 2px 10px #000; }
.cue-track { position: relative; width: 56px; height: 92px; margin: 0 auto; }
.cue-chev { position: absolute; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-left: 3px solid var(--accent); border-top: 3px solid var(--accent);
  transform: rotate(45deg); opacity: 0; filter: drop-shadow(0 0 8px var(--accent)); }
.cue-chev:nth-child(1) { top: 0; } .cue-chev:nth-child(2) { top: 17px; } .cue-chev:nth-child(3) { top: 34px; }
.cue-finger { position: absolute; left: 50%; bottom: 0; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.95), color-mix(in srgb, var(--accent) 70%, #fff) 55%, var(--accent));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 28px var(--accent); opacity: 0; }
.swipe-cue.show .cue-finger { animation: cueFinger 2.2s cubic-bezier(.45,.05,.3,1) infinite; }
.swipe-cue.show .cue-chev { animation: cueChev 2.2s ease-in-out infinite; }
.swipe-cue.show .cue-chev:nth-child(3) { animation-delay: .15s; }
.swipe-cue.show .cue-chev:nth-child(2) { animation-delay: .35s; }
.swipe-cue.show .cue-chev:nth-child(1) { animation-delay: .55s; }
@keyframes cueFinger {
  0%   { opacity: 0; transform: translateY(10px) scale(.7); }
  12%  { opacity: 1; transform: translateY(0) scale(1); }
  20%  { transform: translateY(0) scale(.88); }
  72%  { opacity: 1; transform: translateY(-56px) scale(.88); }
  100% { opacity: 0; transform: translateY(-68px) scale(.8); }
}
@keyframes cueChev { 0%, 15% { opacity: 0; } 45% { opacity: .95; } 80%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .swipe-cue.show .cue-finger { animation: none; opacity: .9; transform: translateY(-40px); }
  .swipe-cue.show .cue-chev { animation: none; opacity: .8; }
}

body[data-mode="hero"] #homeBtn { display: none; }
@media (max-width: 360px) { .hud-btns > * { width: 36px; height: 36px; font-size: .9rem; } .hud-btns { gap: 4px; } }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .card { border-radius: 18px; backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(160deg, rgba(20,10,20,.82), rgba(10,5,14,.9)); }
  .flash { display: none; }
  .hud-btns > * { width: 42px; height: 42px; }
  .hud-btns { gap: 6px; }
}
@media (max-height: 520px) {
  .card { max-height: 74dvh; padding: .6rem 1rem; }
  .chip { margin-bottom: .3rem; }
  .hi { font-size: 1.05rem; line-height: 1.45; } .en { font-size: .78rem; } .rule { margin: .4rem auto; }
}
@media (prefers-reduced-motion: reduce) {
  .bg.on .pic, .bg.entering, .flash.go, .hint-arrow { animation: none; }
  .w { transition: opacity .3s; filter: none; transform: none; }
}
