/* ===== Theme ===== */
:root {
  --saffron: #e0782b;
  --gold: #d9a441;
  --gold-light: #f3d38a;
  --maroon: #5a1414;
  --maroon-deep: #2a0808;
  --peacock: #1f5f7a;
  --cream: #fbf3e4;
  --paper: #f6ead2;
  --ink: #2a1a10;
  --ink-soft: #5c4636;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(42, 8, 8, .18);
  --font-dev: "Yatra One", serif;
  --font-head: "Cinzel", serif;
  --font-body: "Lora", Georgia, serif;
  --font-shloka: "Tiro Devanagari Sanskrit", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
.hidden { display: none !important; }

/* ===== Nav ===== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: linear-gradient(to bottom, rgba(42, 8, 8, .85), rgba(42, 8, 8, 0));
  color: var(--gold-light);
}
.nav a { text-decoration: none; }
.nav .brand { font-family: var(--font-dev); font-size: 1.4rem; }
.nav .links { display: flex; gap: 20px; font-family: var(--font-head); font-size: .9rem; letter-spacing: .05em; }
.nav .links a:hover { color: #fff; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; cursor: pointer; border: 0;
  font-family: var(--font-head); font-size: 1rem; letter-spacing: .06em;
  padding: 12px 28px; border-radius: 999px;
  background: var(--maroon); color: var(--gold-light);
  box-shadow: 0 4px 0 #2a0808; transition: transform .15s, box-shadow .15s, background .2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #2a0808; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #2a0808; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--maroon-deep); box-shadow: 0 4px 0 #8a6420; }
.btn-ghost { background: transparent; color: var(--maroon); box-shadow: inset 0 0 0 2px var(--maroon); }

/* ===== Home: intro ===== */
.intro {
  position: relative; min-height: 100vh;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(ellipse at 50% 60%, #8a2a12 0%, var(--maroon-deep) 70%);
  color: var(--gold-light); overflow: hidden; padding: 80px 16px;
}
.intro .mandala {
  position: absolute; width: min(900px, 140vw); aspect-ratio: 1;
  left: 50%; top: 50%; translate: -50% -50%;
  opacity: .14; animation: rotate 120s linear infinite;
}
.intro-content { position: relative; z-index: 2; max-width: 760px; }
.intro .om { font-family: var(--font-dev); font-size: 3.2rem; color: var(--gold); }
.intro h1 { font-family: var(--font-dev); font-size: clamp(3rem, 10vw, 6.5rem); line-height: 1.1; color: var(--gold-light); text-shadow: 0 0 40px rgba(255, 190, 80, .45); }
.intro .sub { font-family: var(--font-head); letter-spacing: .3em; font-size: clamp(.9rem, 2.4vw, 1.2rem); margin: 8px 0 24px; }
.intro p.lead { font-size: 1.15rem; color: #f1dcc0; margin-bottom: 34px; }
.scroll-hint { position: absolute; bottom: 24px; left: 50%; translate: -50% 0; font-size: .8rem; letter-spacing: .3em; opacity: .7; animation: bob 2s ease-in-out infinite; }
.intro .sparks circle { animation: rise 8s linear infinite; }

/* ===== Section headings ===== */
.section { padding: 90px 16px; max-width: 1150px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 50px; }
.section-head .dev { font-family: var(--font-dev); color: var(--saffron); font-size: 1.6rem; }
.section-head h2 { font-family: var(--font-head); font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--maroon); }
.section-head p { color: var(--ink-soft); max-width: 620px; margin: 10px auto 0; }
.divider { width: 160px; height: 14px; margin: 14px auto 0; background:
  radial-gradient(circle, var(--gold) 4px, transparent 5px) center/14px 14px no-repeat,
  linear-gradient(var(--gold), var(--gold)) center/100% 2px no-repeat; }

/* ===== Progress ===== */
.progress-wrap { max-width: 520px; margin: 0 auto 40px; text-align: center; }
.progress-bar { height: 12px; background: #ead8b8; border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--saffron), var(--gold)); transition: width 1s ease; }
.progress-label { font-family: var(--font-head); font-size: .9rem; margin-top: 8px; color: var(--ink-soft); }
.toggle { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; font-size: .9rem; color: var(--ink-soft); cursor: pointer; }

/* ===== Parva map (winding path) ===== */
.map { position: relative; }
.map-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 28px; }
.parva-card {
  position: relative; display: block; text-decoration: none;
  background: var(--paper); border-radius: var(--radius); padding: 22px 20px 20px;
  box-shadow: var(--shadow); border: 2px solid transparent;
  transition: transform .25s, border-color .25s;
  overflow: hidden;
}
.parva-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: linear-gradient(90deg, var(--saffron), var(--gold), var(--peacock));
}
.parva-card:hover { transform: translateY(-6px) rotate(-.4deg); border-color: var(--gold); }
.parva-card .num {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--maroon); color: var(--gold-light); font-family: var(--font-head); font-weight: 700;
  margin-bottom: 10px;
}
.parva-card .dev { font-family: var(--font-dev); font-size: 1.5rem; color: var(--saffron); line-height: 1.2; }
.parva-card h3 { font-family: var(--font-head); font-size: 1.15rem; color: var(--maroon); }
.parva-card .meaning { font-size: .9rem; color: var(--ink-soft); font-style: italic; }
.parva-card .tag { font-size: .92rem; margin-top: 8px; }
.parva-card .badge { position: absolute; top: 16px; right: 16px; font-size: 1.3rem; }
.parva-card.done .num { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--maroon-deep); }
.parva-card.next { border-color: var(--saffron); animation: glow 2.2s ease-in-out infinite; }
.parva-card.locked { filter: grayscale(.9); opacity: .55; cursor: not-allowed; }
.parva-card.locked:hover { transform: none; border-color: transparent; }

/* ===== Characters strip (home) ===== */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px; }
.char { text-align: center; }
.medallion {
  width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #4a1a12, var(--maroon-deep));
  color: var(--gold-light); font-family: var(--font-dev); font-size: 1.9rem;
  border: 4px solid var(--c, var(--gold));
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--gold), var(--shadow);
  transition: transform .3s;
}
.char:hover .medallion { transform: scale(1.08) rotate(-4deg); }
.char h4 { font-family: var(--font-head); color: var(--maroon); font-size: 1rem; }
.char p { font-size: .82rem; color: var(--ink-soft); line-height: 1.4; }

/* ===== Footer ===== */
footer { background: var(--maroon-deep); color: #d9c3a3; text-align: center; padding: 40px 16px; font-size: .9rem; }
footer .dev { font-family: var(--font-dev); color: var(--gold); font-size: 1.4rem; }

/* ===== Parva page: hero ===== */
.hero { position: relative; height: 100vh; min-height: 520px; overflow: hidden; background: var(--maroon-deep); }
.hero svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-text {
  position: absolute; inset: auto 0 0 0; z-index: 2; text-align: center; color: #fff;
  padding: 120px 16px 70px; background: linear-gradient(to top, rgba(20, 5, 3, .85), transparent);
}
.hero-text .count { font-family: var(--font-head); letter-spacing: .35em; font-size: .85rem; color: var(--gold-light); }
.hero-text h1 { font-family: var(--font-head); font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 1.1; text-shadow: 0 4px 20px rgba(0, 0, 0, .5); }
.hero-text .meaning { font-style: italic; font-size: 1.2rem; color: var(--gold-light); }
.hero-text .tagline { max-width: 640px; margin: 10px auto 0; color: #f1e2cc; }
.scene-dev { font-family: var(--font-dev); font-size: 120px; fill: rgba(255, 255, 255, .08); }

/* ===== Parva page: story scenes ===== */
.story { max-width: 820px; margin: 0 auto; padding: 80px 16px; position: relative; }
.story::before { content: ""; position: absolute; left: 39px; top: 100px; bottom: 100px; width: 3px; background: linear-gradient(var(--gold), var(--saffron)); opacity: .5; }
.scene { position: relative; display: grid; grid-template-columns: 50px 1fr; gap: 24px; margin-bottom: 56px; }
.scene .dot {
  width: 50px; height: 50px; border-radius: 50%; background: var(--maroon); color: var(--gold-light);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700;
  box-shadow: 0 0 0 6px var(--cream), 0 0 0 8px var(--gold); z-index: 1;
}
.scene .card { background: var(--paper); padding: 24px 26px; border-radius: var(--radius); box-shadow: var(--shadow); border-left: 5px solid var(--saffron); }
.scene h3 { font-family: var(--font-head); color: var(--maroon); font-size: 1.3rem; margin-bottom: 6px; }

/* ===== Parva page: blocks ===== */
.block { max-width: 900px; margin: 0 auto; padding: 60px 16px; }
.block-title { font-family: var(--font-head); color: var(--maroon); font-size: 1.6rem; text-align: center; margin-bottom: 28px; }
.lesson {
  background: linear-gradient(135deg, var(--maroon), #7a2414); color: #f6e6cc;
  border-radius: 20px; padding: 40px 34px; text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.lesson .label { font-family: var(--font-dev); color: var(--gold); font-size: 1.4rem; }
.lesson h3 { font-family: var(--font-head); font-size: 1.7rem; color: var(--gold-light); margin: 6px 0 10px; }
.lesson .lotus { position: absolute; right: -40px; bottom: -40px; font-size: 10rem; opacity: .08; }

.shloka { text-align: center; padding: 40px 24px; border-radius: 20px; background: var(--paper); border: 2px dashed var(--gold); }
.shloka .dev { font-family: var(--font-shloka); font-size: clamp(1.3rem, 3.4vw, 1.9rem); color: var(--maroon); white-space: pre-line; line-height: 1.8; }
.shloka .iast { font-style: italic; color: var(--ink-soft); white-space: pre-line; margin: 14px 0; }
.shloka .meaning { font-size: 1.1rem; }
.shloka .source { margin-top: 10px; font-family: var(--font-head); font-size: .85rem; color: var(--saffron); letter-spacing: .1em; }

/* ===== Quiz ===== */
.quiz { background: var(--paper); border-radius: 20px; padding: 34px 28px; box-shadow: var(--shadow); }
.q { margin-bottom: 26px; }
.q h4 { font-size: 1.1rem; margin-bottom: 10px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  font: inherit; text-align: left; cursor: pointer; padding: 12px 16px; border-radius: 10px;
  background: #fff; border: 2px solid #e6d3b0; transition: border-color .2s, background .2s, transform .1s;
}
.opt:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.opt.correct { background: #e3f3df; border-color: #4f9a4a; }
.opt.wrong { background: #f8e0dc; border-color: #c0392b; animation: shake .35s; }
.opt:disabled { cursor: default; }
.explain { font-size: .92rem; color: var(--ink-soft); margin-top: 8px; font-style: italic; }
.quiz-result { text-align: center; margin-top: 10px; }
.quiz-result h3 { font-family: var(--font-head); color: var(--maroon); font-size: 1.5rem; }

.pager { display: flex; justify-content: space-between; gap: 16px; max-width: 900px; margin: 0 auto; padding: 20px 16px 80px; flex-wrap: wrap; }

/* ===== Sabha dice game ===== */
.dice-game { text-align: center; background: radial-gradient(ellipse at center, #5a1a10, var(--maroon-deep)); color: #f6e6cc; border-radius: 20px; padding: 40px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.dice-board { display: flex; justify-content: center; gap: 30px; margin-bottom: 20px; }
.die { width: 90px; height: 90px; border-radius: 16px; background: #f6ead2; color: var(--maroon-deep); display: grid; place-items: center; font-size: 4.4rem; line-height: 1; box-shadow: 0 8px 0 #b89a6a, 0 14px 30px rgba(0, 0, 0, .4); }
.die.rolling { animation: roll .25s linear infinite; }
.dice-status { min-height: 3.4em; max-width: 600px; margin: 0 auto 16px; font-size: 1.05rem; }
.stakes { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.stakes li { background: rgba(255, 255, 255, .1); border: 1px solid var(--gold); color: var(--gold-light); padding: 4px 12px; border-radius: 99px; font-size: .9rem; animation: pop .35s ease-out; text-decoration: line-through; }
.garment { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: hidden; margin-top: 20px; mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.garment span { display: block; height: 14px; border-radius: 3px; animation: unfurl .6s ease-out both; transform-origin: left; }

/* ===== Reveal (GSAP enhances; no GSAP = visible) ===== */
.js-gsap .reveal { opacity: 0; transform: translateY(40px); }

/* ===== SVG animations ===== */
.twinkle { animation: twinkle 2.5s ease-in-out infinite; }
.pulse { animation: pulse 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.flicker { animation: flicker .18s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
.drift { animation: drift 60s linear infinite; }
.sway { animation: sway 4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.wave-flag { animation: flagwave 1.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: left center; }
.spin { animation: rotate 1.2s linear infinite; transform-box: fill-box; transform-origin: center; }
.fly-right { animation: flyR 2s linear infinite; }
.fly-left { animation: flyL 2s linear infinite; }
.rise { animation: rise 7s linear infinite; }
.bob { animation: bob 3s ease-in-out infinite; }
.wave { animation: wavex 4s ease-in-out infinite alternate; }
.rays { animation: rotate 80s linear infinite; transform-origin: 600px 220px; }
.glide { animation: glide 14s linear infinite; }
.walk { animation: walk 30s linear infinite; }
.sink { animation: sink 12s ease-in infinite; }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .18; } 50% { transform: scale(1.15); opacity: .3; } }
@keyframes flicker { from { transform: scaleY(1) scaleX(1); } to { transform: scaleY(1.15) scaleX(.9); } }
@keyframes drift { from { transform: translateX(-200px); } to { transform: translateX(200px); } }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes flagwave { from { transform: skewY(-6deg) scaleX(1); } to { transform: skewY(6deg) scaleX(.9); } }
@keyframes flyR { from { transform: translateX(-100px); } to { transform: translateX(1300px); } }
@keyframes flyL { from { transform: translateX(1300px) scaleX(-1); } to { transform: translateX(-100px) scaleX(-1); } }
@keyframes rise { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(-520px); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes wavex { from { transform: translateX(-60px); } to { transform: translateX(0); } }
@keyframes glide { from { transform: translateX(-200px) translateY(0); } 50% { transform: translateX(700px) translateY(40px); } to { transform: translateX(1400px) translateY(0); } }
@keyframes walk { from { transform: translateX(-200px); } to { transform: translateX(1100px); } }
@keyframes sink { 0% { transform: translateY(0); } 80%, 100% { transform: translateY(260px); } }
@keyframes glow { 0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(224, 120, 43, .5); } 50% { box-shadow: var(--shadow), 0 0 0 10px rgba(224, 120, 43, 0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes roll { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-14px); } 100% { transform: rotate(360deg) translateY(0); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes unfurl { from { transform: scaleX(0); } to { transform: scaleX(1); } }


/* ===== Nav tools ===== */
.nav-tools { display: flex; gap: 8px; align-items: center; }
.nav-btn {
  font: inherit; font-family: var(--font-head); font-size: .9rem; cursor: pointer;
  background: rgba(243, 211, 138, .15); color: var(--gold-light);
  border: 1px solid rgba(243, 211, 138, .5); border-radius: 999px; padding: 6px 14px;
  transition: background .2s;
}
.nav-btn span { font-family: var(--font-dev); }
.nav-btn.icon { padding: 6px 10px; font-size: 1.05rem; }
.nav-btn:hover { background: rgba(243, 211, 138, .3); }

/* ===== Clickable characters ===== */
button.char { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 10px 6px; border-radius: var(--radius); transition: background .2s; }
button.char:hover { background: rgba(217, 164, 65, .12); }
button.char:focus-visible { outline: 2px solid var(--saffron); }
.char-cta { display: inline-block; margin-top: 4px; font-size: .75rem; font-family: var(--font-head); color: var(--saffron); opacity: 0; transition: opacity .2s; }
button.char:hover .char-cta, button.char:focus-visible .char-cta { opacity: 1; }
.char-link {
  font: inherit; color: var(--maroon); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer;
  border-bottom: 2px dotted var(--saffron);
}
.char-link:hover { color: var(--saffron); }
.block-sub { text-align: center; color: var(--ink-soft); margin: -16px 0 24px; }
.dev-sm { display: block; font-family: var(--font-dev); color: var(--saffron); font-size: 1.1rem; }

/* ===== Character popup ===== */
.char-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.char-modal[hidden] { display: none; }
.char-backdrop { position: absolute; inset: 0; background: rgba(20, 5, 3, .75); backdrop-filter: blur(4px); }
.char-panel {
  position: relative; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--cream); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.char-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%;
  border: 0; cursor: pointer; background: rgba(42, 8, 8, .7); color: var(--gold-light); font-size: 1rem;
}
.char-stage {
  position: relative; height: 340px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--c) 45%, #3b0d0d), var(--maroon-deep) 75%);
  border-radius: 22px 22px 0 0;
}
.char-stage::after { content: ""; position: absolute; inset: auto 0 0 0; height: 60px; background: linear-gradient(transparent, rgba(0, 0, 0, .3)); }
.char-stage .figure { height: 320px; width: auto; position: relative; z-index: 1; }
.char-title { text-align: center; padding: 18px 20px 4px; }
.char-title .dev { font-family: var(--font-dev); color: var(--saffron); font-size: 1.6rem; line-height: 1.2; }
.char-title h2 { font-family: var(--font-head); color: var(--maroon); font-size: 2rem; }
.char-title p { color: var(--ink-soft); font-style: italic; }
.char-info { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; padding: 20px 28px; }
.char-info h3, .char-parvas h3 { font-family: var(--font-head); color: var(--maroon); font-size: 1.1rem; margin-bottom: 12px; }
.char-info h3 span { font-family: var(--font-dev); color: var(--saffron); margin-right: 6px; }
.qualities { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.qualities li { background: var(--paper); border: 1px solid var(--gold); border-radius: 999px; padding: 6px 14px; font-size: .92rem; }
.qualities li::before { content: "✦ "; color: var(--saffron); }
.achievements { list-style: none; counter-reset: a; display: grid; gap: 10px; }
.achievements li { counter-increment: a; position: relative; padding: 10px 12px 10px 48px; background: var(--paper); border-radius: 12px; font-size: .95rem; line-height: 1.5; }
.achievements li::before {
  content: counter(a); position: absolute; left: 10px; top: 50%; translate: 0 -50%;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--maroon); color: var(--gold-light); font-family: var(--font-head); font-size: .85rem;
}
.char-parvas { padding: 0 28px 28px; }
.char-parvas a { display: inline-block; margin: 0 6px 6px 0; padding: 4px 12px; border-radius: 999px; background: var(--maroon); color: var(--gold-light); text-decoration: none; font-size: .85rem; }
.char-parvas a:hover { background: var(--saffron); }

/* Figure animations */
.fig-glow { animation: pulse 3.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fig-ring { animation: rotate 18s linear infinite; transform-box: fill-box; transform-origin: center; }
.fig-body { animation: bob 4s ease-in-out infinite; }
.fig-upper { animation: breathe 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.fig-blink { animation: blink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
.fig-item { animation: itemglow 2.5s ease-in-out infinite; }
.fig-feather { animation: sway 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 20% 100%; }
.fig-note { animation: note 2.4s ease-out infinite; }
.fig-note.d2 { animation-delay: 1.2s; }
.fig-gem, .fig-shine { animation: gem 1.8s ease-in-out infinite; }
.dice-bounce { animation: bob 1s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.015) translateY(-1px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes itemglow { 0%, 100% { filter: drop-shadow(0 0 0 transparent); } 50% { filter: drop-shadow(0 0 6px var(--aura)); } }
@keyframes note { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(18px, -40px); opacity: 0; } }
@keyframes gem { 0%, 100% { filter: drop-shadow(0 0 2px #fff); } 50% { filter: drop-shadow(0 0 10px #9fe8ff); } }

/* ===== Verses (Gita & shlokas) ===== */
.verses { display: grid; gap: 22px; }
.verse {
  position: relative; background: var(--paper); border-radius: 18px; padding: 26px 26px 22px;
  border: 1px solid #e6d3b0; box-shadow: var(--shadow); border-top: 5px solid var(--saffron);
}
.verse-ref { font-family: var(--font-head); color: var(--saffron); letter-spacing: .08em; font-size: .85rem; margin-bottom: 12px; text-transform: uppercase; }
.verse-row { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; padding: 10px 0; border-bottom: 1px dashed #e0cba4; }
.verse-row:last-of-type { border-bottom: 0; }
.verse-row .tag { font-family: var(--font-head); font-size: .75rem; color: var(--ink-soft); padding-top: 6px; letter-spacing: .05em; }
.verse-row .easy, .verse-row .iast { grid-column: 2; }
.verse .dev { font-family: var(--font-shloka); font-size: clamp(1.15rem, 2.8vw, 1.5rem); color: var(--maroon); white-space: pre-line; line-height: 1.8; }
.verse .easy { font-weight: 600; white-space: pre-line; }
.verse .iast { font-style: italic; color: var(--ink-soft); white-space: pre-line; font-size: .9rem; }
.verse .meaning { font-size: 1.05rem; }
.verse .why { margin-top: 10px; padding: 10px 14px; background: rgba(224, 120, 43, .1); border-left: 3px solid var(--saffron); border-radius: 8px; font-size: .95rem; }
.listen {
  position: absolute; top: 18px; right: 18px; cursor: pointer; font: inherit; font-size: .85rem;
  background: var(--maroon); color: var(--gold-light); border: 0; border-radius: 999px; padding: 6px 14px;
}
.listen:hover { background: var(--saffron); }

/* Gita chapters (accordion) */
.gita-ch { background: #fff8ec; border: 1px solid #e6d3b0; border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.gita-ch summary { list-style: none; cursor: pointer; display: flex; gap: 14px; align-items: center; padding: 12px 16px; }
.gita-ch summary::-webkit-details-marker { display: none; }
.gita-ch summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--saffron); transition: transform .2s; }
.gita-ch[open] summary::after { transform: rotate(45deg); }
.gita-ch .n { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--maroon); color: var(--gold-light); font-family: var(--font-head); }
.gita-ch .t { display: flex; flex-direction: column; line-height: 1.35; }
.gita-ch .t .dev { font-family: var(--font-dev); color: var(--saffron); }
.gita-ch .t small { color: var(--ink-soft); }
.gita-ch .sum { padding: 0 18px 12px; }
.gita-ch .verse { margin: 0 12px 14px; box-shadow: none; }
.gita-ch .verse.reveal { opacity: 1 !important; transform: none !important; }

/* Gita drawer */
.gita-drawer { position: fixed; inset: 0; z-index: 190; pointer-events: none; }
.gita-backdrop { position: absolute; inset: 0; background: rgba(20, 5, 3, .6); opacity: 0; transition: opacity .3s; }
.gita-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100%); overflow-y: auto;
  background: var(--cream); padding: 24px 18px 40px; transform: translateX(100%); transition: transform .4s ease;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .4);
}
.gita-drawer.open { pointer-events: auto; }
.gita-drawer.open .gita-backdrop { opacity: 1; }
.gita-drawer.open .gita-panel { transform: none; }
.gita-head { text-align: center; margin: 10px 0 20px; }
.gita-head .dev { font-family: var(--font-dev); color: var(--saffron); font-size: 1.6rem; }
.gita-head h2 { font-family: var(--font-head); color: var(--maroon); }
.gita-head p { color: var(--ink-soft); font-size: .9rem; }

/* ===== Voiceover, subtitles, toast ===== */
.vo-btn { margin-top: 18px; }
.subtitles {
  position: fixed; left: 50%; bottom: 28px; translate: -50% 20px; z-index: 180; width: min(860px, calc(100% - 32px));
  text-align: center; pointer-events: none; opacity: 0; transition: opacity .4s, translate .4s;
}
.subtitles.on { opacity: 1; translate: -50% 0; }
.subtitles span {
  display: inline; background: rgba(10, 3, 2, .82); color: #fff6e0; padding: 6px 12px; line-height: 2;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem); border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  text-shadow: 0 1px 2px #000;
}
.subtitles b { font-family: var(--font-dev); color: var(--gold-light); font-weight: 400; font-size: 1.4em; }
.toast {
  position: fixed; top: 76px; left: 50%; translate: -50% -20px; z-index: 300; width: min(520px, calc(100% - 32px));
  background: var(--maroon-deep); color: #f6e6cc; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--gold);
  box-shadow: var(--shadow); font-size: .92rem; opacity: 0; transition: opacity .3s, translate .3s;
}
.toast.on { opacity: 1; translate: -50% 0; }

@media (max-width: 600px) {
  .char-info { grid-template-columns: 1fr; padding: 16px; }
  .char-parvas { padding: 0 16px 20px; }
  .char-stage { height: 280px; }
  .char-stage .figure { height: 260px; }
  .verse { padding: 22px 16px 18px; }
  .verse-row { grid-template-columns: 1fr; }
  .verse-row .easy, .verse-row .iast { grid-column: 1; }
  .verse-row .tag { padding-top: 0; }
  .listen { position: static; margin-top: 12px; }
  .nav-btn span { display: none; }
}


/* ===== Story player ===== */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 170;
  background: linear-gradient(180deg, rgba(42, 8, 8, .96), rgba(20, 4, 3, .98));
  color: var(--gold-light); border-top: 1px solid rgba(243, 211, 138, .35);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .45); backdrop-filter: blur(8px);
}
.player[hidden] { display: none; }
.player-seek { position: relative; height: 18px; margin-top: -9px; }
.player-seek input {
  -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; margin: 0; display: block;
}
.player-seek input::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--saffron), var(--gold) var(--p, 0%), rgba(243, 211, 138, .2) var(--p, 0%));
}
.player-seek input::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(243, 211, 138, .2); }
.player-seek input::-moz-range-progress { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--saffron), var(--gold)); }
.player-seek input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: var(--gold-light); border: 3px solid var(--saffron); box-shadow: 0 0 12px rgba(255, 190, 80, .8);
}
.player-seek input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold-light); border: 3px solid var(--saffron); }
.player-seek:hover input::-webkit-slider-runnable-track { height: 8px; }
.seek-tip {
  position: absolute; bottom: 22px; translate: -50% 0; padding: 2px 8px; border-radius: 6px; font-size: .75rem;
  background: var(--gold-light); color: var(--maroon-deep); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.player-seek:hover .seek-tip { opacity: 1; }
.player-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 8px 18px 12px; }
.player-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.player-info .dev { font-family: var(--font-dev); font-size: 1.15rem; }
.player-info small { opacity: .7; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-ctrls { display: flex; align-items: center; gap: 14px; }
.player-ctrls button, .player-extra button {
  position: relative; cursor: pointer; border: 0; background: none; color: var(--gold-light); border-radius: 50%;
  display: grid; place-items: center; transition: background .2s, transform .1s;
}
.player-ctrls button { width: 44px; height: 44px; }
.player-ctrls button:hover, .player-extra button:hover { background: rgba(243, 211, 138, .15); }
.player-ctrls button:active { transform: scale(.92); }
.player-ctrls svg { width: 26px; height: 26px; fill: currentColor; }
.player-ctrls button b { position: absolute; font-size: .55rem; top: 50%; left: 50%; translate: -50% -38%; font-family: var(--font-head); }
.player-ctrls .big { width: 58px; height: 58px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--maroon-deep); box-shadow: 0 0 20px rgba(255, 190, 80, .45); }
.player-ctrls .big:hover { background: linear-gradient(135deg, #fff1c8, var(--gold-light)); }
.player-ctrls .big svg { width: 30px; height: 30px; }
.player .i-pause, .player.playing .i-play { display: none; }
.player.playing .i-pause { display: block; }
.player-time { font-size: .8rem; opacity: .85; font-variant-numeric: tabular-nums; }
.player-time .sep { margin: 0 4px; opacity: .5; }
.player-extra { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.player-extra button { min-width: 40px; height: 34px; border-radius: 17px; font-family: var(--font-head); font-size: .8rem; padding: 0 10px; }
.player-extra #pCC[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
body.player-open { padding-bottom: 96px; }
body.player-open .subtitles { bottom: 118px; }

.upnext { position: absolute; left: 50%; bottom: calc(100% + 16px); translate: -50% 0; width: min(440px, calc(100vw - 32px)); }
.upnext[hidden] { display: none; }
.upnext-card {
  background: var(--maroon-deep); border: 1px solid var(--gold); border-radius: 18px; padding: 22px; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: pop .4s ease-out;
}
.upnext-card small { letter-spacing: .25em; font-family: var(--font-head); opacity: .8; }
.upnext-card h3 { font-family: var(--font-dev); font-weight: 400; font-size: 1.5rem; margin: 6px 0; color: var(--gold-light); }
.upnext-card .tease { color: #f1dcc0; font-size: 1.05rem; margin-bottom: 14px; }
.upnext-card p { margin-bottom: 12px; }
.upnext-card .btn { margin: 4px; }
.upnext-card .btn-ghost { color: var(--gold-light); box-shadow: inset 0 0 0 2px var(--gold); }
.upnext-ring { height: 4px; background: rgba(243, 211, 138, .2); border-radius: 2px; overflow: hidden; margin-bottom: 14px; }
.upnext-ring span { display: block; height: 100%; background: var(--gold); animation: countdown var(--d) linear forwards; }
@keyframes countdown { from { width: 100%; } to { width: 0; } }
.vo-len { font-size: .78rem; opacity: .75; margin-left: 6px; font-family: var(--font-body); }
.link-btn { font: inherit; background: none; border: 0; color: var(--gold-light); text-decoration: underline; cursor: pointer; padding: 0; }
.toast code { background: rgba(255, 255, 255, .1); padding: 1px 5px; border-radius: 4px; }

/* ===== 3D character stage ===== */
.char-stage { perspective: 900px; height: 380px; }
.stage3d {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  animation: stageFloat 7s ease-in-out infinite;
}
.stage3d.live { animation: none; transition: transform .12s ease-out; }
.stage3d .layer { position: absolute; inset: 0; display: grid; place-items: center; }
.stage3d .halo { transform: translateZ(-60px) scale(1.1); background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--c) 70%, transparent) 0%, transparent 55%); filter: blur(10px); animation: pulse 4s ease-in-out infinite; }
.stage3d .hero-art { transform: translateZ(40px); }
.stage3d .hero-art .figure { height: 340px; width: auto; filter: drop-shadow(0 20px 25px rgba(0, 0, 0, .55)); }
.stage3d .hero-art.is-image img {
  height: 370px; width: auto; max-width: 92%; object-fit: contain;
  filter: drop-shadow(0 25px 35px rgba(0, 0, 0, .65)) drop-shadow(0 0 30px color-mix(in srgb, var(--c) 40%, transparent));
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent);
}
.stage3d .embers { transform: translateZ(90px); pointer-events: none; overflow: hidden; }
.embers i, .hero-embers i {
  position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%;
  background: #ffcf6b; box-shadow: 0 0 8px 2px rgba(255, 170, 60, .8); animation: ember 6s linear infinite;
}
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(30px, -420px); opacity: 0; } }
@keyframes stageFloat { 0%, 100% { transform: rotateY(-4deg) rotateX(1deg); } 50% { transform: rotateY(4deg) rotateX(-1deg); } }
.medallion.has-img { padding: 0; overflow: hidden; }
.medallion.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }

/* ===== Cinematic hero image ===== */
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kenburns 30s ease-in-out infinite alternate; }
.hero.has-img svg { display: none; }
.hero.has-img::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(10, 2, 1, .6)); pointer-events: none; }
.hero-embers { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
@keyframes kenburns { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.18) translate(-2%, -2%); } }

/* ===== Full Gita drawer ===== */
.gita-search { position: sticky; top: -24px; z-index: 2; background: var(--cream); padding: 8px 0 12px; }
.gita-search input {
  width: 100%; font: inherit; padding: 12px 18px; border-radius: 999px; border: 2px solid #e6d3b0; background: #fff; outline: none;
}
.gita-search input:focus { border-color: var(--saffron); }
.gita-verses { padding: 0 10px 10px; display: grid; gap: 14px; }
.gita-verses .loading, .gita-count { color: var(--ink-soft); text-align: center; padding: 10px; }
.gita-results { display: grid; gap: 14px; }
.verse.full { box-shadow: none; padding: 20px 18px 16px; }
.verse.full .verse-row { grid-template-columns: 100px 1fr; }
.verse .meaning.hi { font-family: "Tiro Devanagari Sanskrit", serif; font-size: 1.02rem; }
.verse.flash { animation: flash 2s ease; }
@keyframes flash { 0%, 100% { box-shadow: none; } 20%, 60% { box-shadow: 0 0 0 4px var(--saffron); } }
.read-all { display: block; margin: 0 auto 16px; }
.gita-credit { font-size: .78rem; color: var(--ink-soft); text-align: center; margin-top: 18px; }

@media (max-width: 700px) {
  .player-row { gap: 6px; padding: 6px 10px 10px; }
  .player-info .dev, .player-info small { display: none; }
  .player-ctrls { gap: 4px; }
  .player-extra { gap: 2px; }
  .player-extra button { min-width: 32px; padding: 0 6px; }
  .char-stage { height: 320px; }
  .stage3d .hero-art .figure { height: 290px; }
  .stage3d .hero-art.is-image img { height: 310px; }
  .verse.full .verse-row { grid-template-columns: 1fr; }
}


/* ===== Mini-games: shared ===== */
.game-shell { max-width: 720px; margin: 0 auto; }
.game-stage { position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); background: var(--maroon-deep); color: #f6e6cc; }
.game-stage canvas { display: block; margin: 0 auto; touch-action: none; }
.game-overlay {
  position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(42, 8, 8, .78), rgba(10, 2, 1, .92)); backdrop-filter: blur(3px);
}
.game-card { max-width: 460px; text-align: center; color: #f6e6cc; }
.game-card .dev { font-family: var(--font-dev); color: var(--gold); font-size: 1.8rem; line-height: 1.2; }
.game-card h3 { font-family: var(--font-head); color: var(--gold-light); font-size: clamp(1.3rem, 3.4vw, 1.8rem); margin: 4px 0 10px; }
.game-card p { margin-bottom: 10px; }
.game-note { font-size: .95rem; background: rgba(255, 255, 255, .06); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 8px; text-align: left; }
.game-actions { margin-top: 14px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.game-actions .btn-ghost, .game-card .btn-ghost { color: var(--gold-light); box-shadow: inset 0 0 0 2px var(--gold); }
.game-stars { font-size: 2rem; color: var(--gold); letter-spacing: 6px; text-shadow: 0 0 14px rgba(255, 200, 80, .6); }
.game-stars span { color: rgba(255, 255, 255, .18); text-shadow: none; }
.game-help { text-align: center; color: var(--ink-soft); font-size: .9rem; margin-top: 10px; }
.cv-hud {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none;
  font-family: var(--font-head); font-size: .8rem;
}
.cv-hud > span { background: rgba(10, 2, 1, .65); border: 1px solid rgba(243, 211, 138, .4); padding: 4px 10px; border-radius: 999px; color: var(--gold-light); }
.cv-hud .cv-phase { font-family: var(--font-dev); font-size: .95rem; }
.cv-hud .cv-phase.escape { background: rgba(140, 20, 10, .8); border-color: #ff8a65; animation: pulse 1s infinite; }
.cv-hud .cv-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.cv-hud i, .ar-arrows i { font-style: normal; color: var(--gold); margin: 0 1px; font-size: 1rem; }
.cv-hud i.lost, .ar-arrows i.lost { opacity: .2; }
.cv-banner {
  position: absolute; left: 50%; top: 18%; translate: -50% 0; z-index: 6; text-align: center; pointer-events: none;
  opacity: 0; transform: scale(.8); transition: opacity .35s, transform .35s; width: 90%;
}
.cv-banner.on { opacity: 1; transform: scale(1); }
.cv-banner b { display: block; font-family: var(--font-dev); font-weight: 400; font-size: clamp(1.8rem, 6vw, 3rem); color: var(--gold-light); text-shadow: 0 0 20px rgba(255, 160, 60, .9), 0 3px 6px #000; }
.cv-banner span { display: inline-block; background: rgba(10, 2, 1, .7); padding: 4px 12px; border-radius: 8px; color: #fff3d6; }
.cv-flash { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.cv-flash.on { animation: redflash .5s ease-out; }
@keyframes redflash { from { box-shadow: inset 0 0 120px 40px rgba(220, 30, 20, .75); } to { box-shadow: inset 0 0 0 0 rgba(220, 30, 20, 0); } }
.game-pad { display: flex; justify-content: center; gap: 10px; margin-top: 12px; user-select: none; -webkit-user-select: none; }
.game-pad button {
  min-width: 58px; height: 54px; border-radius: 14px; border: 0; cursor: pointer; font-size: 1.3rem; touch-action: none;
  background: linear-gradient(180deg, var(--maroon), #3a0c08); color: var(--gold-light); box-shadow: 0 4px 0 #1a0402;
}
.game-pad button.wide { min-width: 96px; font-size: 1.05rem; }
.game-pad button small { font-size: .7rem; font-family: var(--font-head); display: block; opacity: .8; }
.game-pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a0402; }
@media (hover: hover) and (pointer: fine) { .cv-game .game-pad { opacity: .85; } }
.ar-stage canvas { cursor: crosshair; }
.ar-msg { margin-left: auto; }

/* Yaksha */
.yk-game { min-height: 520px; display: grid; grid-template-rows: auto 1fr; transition: background 2s; background: linear-gradient(180deg, #0a1a2a, #1a2a3a 60%, #0a1a10); }
.yk-game.yk-dawn { background: linear-gradient(180deg, #f3b46b, #c8642b 50%, #2a4a2a); }
.yk-game.yk-storm { animation: storm .8s; }
@keyframes storm { 0%, 100% { filter: none; } 10%, 30% { filter: brightness(2.5) saturate(.3); } 20% { filter: brightness(.6); } }
.yk-scene { position: relative; height: 230px; overflow: hidden; }
.yk-moon { position: absolute; top: 18px; right: 40px; width: 50px; height: 50px; border-radius: 50%; background: #f2f0d8; box-shadow: 0 0 40px #f2f0d8; }
.yk-crane { position: absolute; top: 34px; left: 50%; translate: -50% 0; width: 90px; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(160, 220, 255, .8)); }
.yk-lake { position: absolute; left: 8%; right: 8%; bottom: 14px; height: 70px; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #4a8aaa, #0f2a3a); box-shadow: inset 0 0 30px rgba(0, 0, 0, .5); }
.yk-brothers { position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: space-around; padding: 0 6%; }
.yk-bro { width: 70px; text-align: center; font-size: .7rem; color: #cfd8e0; transition: transform 1.2s cubic-bezier(.3, 1.6, .5, 1), filter 1.2s; transform: rotate(-82deg) translateX(-18px); filter: grayscale(1) brightness(.55); }
.yk-bro .figure { width: 64px; height: auto; }
.yk-bro.alive { transform: none; filter: drop-shadow(0 0 12px #ffd36b); }
.yk-orbs i { position: absolute; bottom: 60px; width: 12px; height: 12px; border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 16px 6px rgba(255, 220, 120, .7); animation: orbrise 3s ease-out forwards; }
@keyframes orbrise { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(-80px); opacity: 1; } }
.yk-panel { background: var(--cream); color: var(--ink); padding: 18px 20px 20px; }
.yk-top { display: flex; justify-content: space-between; font-family: var(--font-head); font-size: .85rem; color: var(--ink-soft); }
.yk-chances i { font-style: normal; margin-left: 4px; }
.yk-chances i.lost { filter: grayscale(1); opacity: .3; }
.yk-timer { height: 6px; background: #ead8b8; border-radius: 3px; overflow: hidden; margin: 8px 0 12px; }
.yk-timer span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #c0392b, var(--saffron), var(--gold)); }
.yk-q { font-family: var(--font-head); color: var(--maroon); font-size: 1.25rem; margin-bottom: 12px; }
.yk-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yk-why { margin-top: 10px; font-style: italic; color: var(--ink-soft); min-height: 1.6em; }
.yk-choose { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.yk-reply { font-size: .95rem; min-height: 3em; }

/* Disguise memory */
.dg-game { padding: 16px; background: radial-gradient(ellipse at top, #5a1a10, var(--maroon-deep)); }
.dg-top { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.dg-meter { flex: 1; min-width: 180px; font-family: var(--font-head); font-size: .8rem; color: var(--gold-light); }
.dg-meter div { height: 10px; background: rgba(255, 255, 255, .12); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.dg-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #c0392b); transition: width .4s; }
.dg-meter.hot div { animation: pulse 1s infinite; }
.dg-stats { display: flex; gap: 12px; font-family: var(--font-head); font-size: .85rem; color: var(--gold-light); }
.dg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; perspective: 900px; }
.dg-card { position: relative; aspect-ratio: 3 / 4; min-height: 0; border: 0; padding: 0; background: none; cursor: pointer; }
.dg-inner { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.4, .5, 1); }
.dg-card.open .dg-inner { transform: rotateY(180deg); }
.dg-back, .dg-front { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dg-back { background: repeating-linear-gradient(45deg, #7a2414 0 10px, #5a1a10 10px 20px); border: 2px solid var(--gold); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .25); }
.dg-back span { font-family: var(--font-dev); color: var(--gold); font-size: 2rem; }
.dg-front { transform: rotateY(180deg); background: var(--paper); color: var(--ink); border: 2px solid var(--gold); padding: 6px; text-align: center; line-height: 1.2; }
.dg-front.is-alias { background: #fff3dc; }
.dg-front b { font-family: var(--font-head); color: var(--maroon); font-size: .85rem; }
.dg-front small { font-size: .65rem; color: var(--ink-soft); margin-top: 2px; }
.dg-front { overflow: hidden; }
.dg-art { flex: 1; min-height: 0; width: 100%; display: flex; justify-content: center; }
.dg-art .figure { height: 100%; width: 100%; max-height: 100%; }
.dg-icon { font-size: 2.4rem; margin-bottom: 6px; }
.dg-card.matched .dg-front { border-color: #4f9a4a; box-shadow: 0 0 16px rgba(120, 220, 120, .6); }
.dg-reveal { text-align: center; margin-top: 12px; min-height: 1.6em; color: #f6e6cc; }

/* Game cards (home + game page) */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.game-card-link {
  position: relative; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: #f6e6cc; overflow: hidden;
  padding: 22px 20px 18px; border-radius: 18px; background: linear-gradient(160deg, #6a1e12, var(--maroon-deep));
  border: 1px solid rgba(243, 211, 138, .3); box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
}
.game-card-link::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 90, .25), transparent 70%); }
.game-card-link:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(42, 8, 8, .35); }
.gc-icon { font-size: 2.4rem; }
.gc-dev { font-family: var(--font-dev); color: var(--gold); font-size: 1.2rem; }
.game-card-link b { font-family: var(--font-head); color: var(--gold-light); font-size: 1.05rem; }
.gc-blurb { font-size: .88rem; opacity: .85; flex: 1; }
.gc-parva { font-size: .75rem; font-family: var(--font-head); opacity: .65; margin-top: 6px; }
.gc-play { align-self: flex-start; margin-top: 8px; padding: 5px 14px; border-radius: 999px; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--maroon-deep); font-family: var(--font-head); font-size: .85rem; }
.game-page-head { text-align: center; padding: 110px 16px 10px; max-width: 760px; margin: 0 auto; }
.game-page-head .dev { font-family: var(--font-dev); color: var(--saffron); font-size: 1.8rem; }
.game-page-head h1 { font-family: var(--font-head); color: var(--maroon); font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; }
.game-page-head p { color: var(--ink-soft); margin: 8px 0 12px; }
.game-story-link { color: var(--saffron); font-family: var(--font-head); font-size: .9rem; }
.game-page .nav { background: linear-gradient(to bottom, rgba(42, 8, 8, .95), rgba(42, 8, 8, .7)); }
.game-block { max-width: 780px; }

@media (max-width: 600px) {
  .dg-grid { gap: 6px; }
  .dg-front b { font-size: .7rem; }
  .dg-front small { display: none; }
  .yk-opts { grid-template-columns: 1fr; }
  .yk-bro { width: 54px; }
  .yk-bro .figure { width: 50px; }
  .game-pad button { min-width: 50px; }
  .game-pad button.wide { min-width: 80px; }
}


/* ===== Amrit Vachan ===== */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.quote-card {
  position: relative; display: flex; flex-direction: column; padding: 28px 24px 18px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(170deg, #fffaf0, var(--paper)); border: 1px solid #e6d3b0; box-shadow: var(--shadow);
}
.quote-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--saffron), var(--gold), var(--peacock)); }
.qc-mark { position: absolute; top: -18px; right: 14px; font-family: Georgia, serif; font-size: 7rem; color: rgba(224, 120, 43, .12); line-height: 1; pointer-events: none; }
.qc-dev { font-family: var(--font-shloka); color: var(--maroon); font-size: 1.25rem; line-height: 1.75; white-space: pre-line; }
.qc-iast { font-style: italic; color: var(--ink-soft); font-size: .85rem; white-space: pre-line; margin: 6px 0 10px; }
.qc-en { font-size: 1.12rem; line-height: 1.6; font-weight: 600; color: var(--ink); }
.qc-essence { display: inline-block; font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font-head); color: var(--saffron); border: 1px solid var(--saffron); border-radius: 999px; padding: 1px 8px; margin-right: 8px; vertical-align: middle; font-weight: 400; }
.qc-context { font-size: .9rem; color: var(--ink-soft); margin-top: 8px; flex: 1; }
.qc-note { display: block; font-size: .8rem; margin-top: 4px; color: #8a6a4a; }
.qc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e0cba4; }
.qc-speaker { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; min-width: 0; }
.qc-speaker b { display: block; font-family: var(--font-head); color: var(--maroon); font-size: .9rem; }
.qc-speaker small { display: block; font-size: .72rem; color: var(--ink-soft); line-height: 1.3; }
.medallion.mini { width: 40px; height: 40px; margin: 0; font-size: 1rem; border-width: 2px; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--gold); flex: none; }
.qc-actions { display: flex; gap: 6px; flex: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e0cba4; background: #fff; cursor: pointer; font-size: 1rem; display: grid; place-items: center; transition: background .2s; }
.icon-btn:hover { background: var(--paper); }
.quote-card .mala-btn span { display: none; }
.quote-card .mala-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
.quote-card.feature { max-width: 760px; margin: 0 auto 30px; text-align: center; padding: 40px 34px 22px; background: linear-gradient(160deg, var(--maroon), #3a0c08); color: #f6e6cc; border-color: var(--gold); }
.quote-card.feature .qc-dev { color: var(--gold-light); font-size: clamp(1.4rem, 3.6vw, 2rem); }
.quote-card.feature .qc-iast, .quote-card.feature .qc-context, .quote-card.feature .qc-speaker small { color: #e6cfa8; }
.quote-card.feature .qc-en { color: #fff3d6; font-size: 1.25rem; }
.quote-card.feature .qc-mark { color: rgba(243, 211, 138, .15); }
.quote-card.feature .qc-foot { border-color: rgba(243, 211, 138, .3); }
.quote-card.feature .qc-speaker b { color: var(--gold-light); }
.today-label { text-align: center; font-family: var(--font-head); letter-spacing: .2em; color: var(--saffron); font-size: .85rem; margin-bottom: 12px; }
.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 24px; }
.chip { font: inherit; font-size: .88rem; cursor: pointer; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--maroon); transition: background .2s; }
.chip:hover { background: rgba(217, 164, 65, .15); }
.chip.on { background: var(--maroon); color: var(--gold-light); border-color: var(--maroon); }

/* ===== My Mala ===== */
.mala-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .85rem; cursor: pointer;
  border: 1px solid var(--gold); background: transparent; color: var(--maroon); border-radius: 999px; padding: 5px 14px;
  transition: background .2s, color .2s, transform .2s; filter: grayscale(.6);
}
.mala-btn:hover { background: rgba(217, 164, 65, .15); filter: none; }
.mala-btn.on { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--maroon-deep); border-color: var(--gold); filter: none; }
.mala-btn.pop { animation: beadpop .5s ease; }
@keyframes beadpop { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-8deg); } 100% { transform: scale(1); } }
.verse-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.verse .verse-actions .listen { position: static; }
.nav-btn .mala-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--saffron); color: #fff; font-size: .7rem; font-family: var(--font-body); }
.nav-btn .mala-count[hidden] { display: none; }
.gita-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--paper); padding: 5px; border-radius: 999px; }
.gita-tabs button { flex: 1; font: inherit; font-size: .88rem; cursor: pointer; border: 0; border-radius: 999px; padding: 9px 10px; background: transparent; color: var(--maroon); }
.gita-tabs button.on { background: var(--maroon); color: var(--gold-light); }
.gita-tabs .mala-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--saffron); color: #fff; font-size: .7rem; padding: 0 5px; }
.gita-tabs .mala-count[hidden] { display: none; }
.mala-list { display: grid; gap: 14px; }
.mala-list .quote-card { box-shadow: none; }
.mala-empty { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.mala-beads { font-size: 3.4rem; animation: bob 3s ease-in-out infinite; }
.mala-empty h3 { font-family: var(--font-head); color: var(--maroon); margin: 8px 0; }

@media (max-width: 600px) {
  .quote-grid { grid-template-columns: 1fr; }
  .quote-card.feature { padding: 32px 20px 18px; }
  .verse .verse-actions .listen { margin-top: 0; }
  .gita-tabs button { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) { .map-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .nav .links { display: none; }
  .hero { height: 78vh; min-height: 460px; }
  .map-grid { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
  .story::before { left: 31px; }
  .scene { grid-template-columns: 34px 1fr; gap: 14px; }
  .scene .dot { width: 34px; height: 34px; font-size: .85rem; }
  .die { width: 70px; height: 70px; font-size: 3.4rem; }
}
