:root {
  --pink: #EC4899;
  --pink-2: #DB2777;
  --pink-soft: #F9A8D4;
  --blue: #2563EB;
  --sky: #38BDF8;
  --yellow: #FACC15;
  --green: #22C55E;
  --bg: #0F172A;
  --muted: #201A32;
  --card: rgba(255, 255, 255, .05);
  --fg: #FFFFFF;
  --fg-dim: #C7BDD6;
  --border: rgba(255, 255, 255, .10);
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --shadow: 0 18px 40px rgba(6, 8, 20, .55), inset 0 1px 0 rgba(255, 255, 255, .10);
  --ar: 'Baloo Bhaijaan 2', 'Baloo 2', system-ui, sans-serif;
  --lat: 'Baloo 2', 'Comic Neue', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(900px 620px at 88% -8%, rgba(236, 72, 153, .30), transparent 62%),
    radial-gradient(760px 560px at 8% 8%, rgba(37, 99, 235, .28), transparent 60%),
    radial-gradient(700px 700px at 50% 120%, rgba(56, 189, 248, .16), transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: var(--ar);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1200px, 94vw); margin: 0 auto; }

/* ---------- navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(15, 23, 42, .72);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 14px; padding: 12px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .dot {
  width: 44px; height: 44px; border-radius: 15px; flex: 0 0 44px;
  background: linear-gradient(150deg, var(--pink), var(--blue));
  display: grid; place-items: center; box-shadow: var(--shadow);
  font-size: 22px;
}
.brand h1 { font-size: clamp(17px, 2.4vw, 22px); margin: 0; line-height: 1.2; }
.brand span { display: block; font-family: var(--lat); font-size: 12px; color: var(--fg-dim); letter-spacing: .06em; }
.nav .spacer { flex: 1 1 40px; }
.chip {
  font-family: var(--lat); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
  background: var(--card); color: var(--fg-dim); white-space: nowrap;
}
.chip.b { border-color: rgba(236, 72, 153, .5); color: var(--pink-soft); }

/* ---------- hero ---------- */
.hero { padding: 40px 0 8px; }
.hero h2 { font-size: clamp(30px, 6vw, 58px); margin: 0 0 6px; line-height: 1.15; }
.hero h2 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--yellow), var(--pink), var(--sky));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--fg-dim); margin: 6px 0 0; max-width: 70ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.meta-row .chip { font-size: 13px; padding: 9px 16px; }

/* ---------- player ---------- */
.player { margin: 26px 0 10px; }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--r-lg); overflow: hidden;
  background: #0B1020;
  box-shadow: var(--shadow);
  border: 3px solid rgba(255, 255, 255, .12);
}
.stage-inner { position: absolute; inset: 0; }
.stage-inner svg { width: 100%; height: 100%; display: block; }
.stage.paused * { animation-play-state: paused !important; }

.hud { position: absolute; inset: 0; pointer-events: none; }
.hud .tl {
  position: absolute; top: 14px; right: 16px;
  background: rgba(11, 16, 32, .62); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px;
  font-size: clamp(13px, 1.6vw, 17px); font-weight: 700;
}
.hud .tr {
  position: absolute; top: 14px; left: 16px; font-family: var(--lat);
  background: rgba(11, 16, 32, .62); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
  font-size: clamp(11px, 1.4vw, 14px); color: var(--fg-dim);
  direction: ltr; letter-spacing: .04em;
}
#lyrics-overlay {
  position: absolute; left: 0; right: 0; bottom: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0 5%;
}
.lyric-line {
  font-size: clamp(18px, 4.2vw, 46px); font-weight: 800; line-height: 1.35;
  text-align: center; color: rgba(255, 255, 255, .55);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 10px 24px rgba(0, 0, 0, .5);
  transition: all .25s ease; transform: scale(.94);
}
.lyric-line.active {
  color: #fff; transform: scale(1);
  text-shadow: 0 3px 0 rgba(219, 39, 119, .55), 0 10px 30px rgba(0, 0, 0, .6);
}
.no-lyric {
  font-size: clamp(14px, 2.2vw, 24px); color: rgba(255, 255, 255, .85); font-weight: 600;
  background: rgba(11, 16, 32, .55); border-radius: 999px; padding: 8px 22px;
  backdrop-filter: blur(6px);
}

/* ---------- controls ---------- */
.controls {
  margin-top: 14px; padding: 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--ar); font-size: 15px; font-weight: 700; color: var(--fg);
  background: linear-gradient(150deg, rgba(236, 72, 153, .95), rgba(219, 39, 119, .95));
  border: none; border-radius: 999px; padding: 12px 22px;
  box-shadow: 0 8px 20px rgba(236, 72, 153, .34), inset 0 2px 0 rgba(255, 255, 255, .28);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(236, 72, 153, .42); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.ghost {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--border);
  box-shadow: none; color: var(--fg-dim); font-weight: 600;
}
.btn.ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn.on {
  background: linear-gradient(150deg, rgba(37, 99, 235, .95), rgba(56, 189, 248, .9));
  color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
}
.btn svg { width: 18px; height: 18px; }
.tc { font-family: var(--lat); font-variant-numeric: tabular-nums; font-size: 16px; color: var(--fg-dim); min-width: 96px; text-align: center; }

.timeline { position: relative; margin-top: 6px; padding: 4px 0 22px; }
.track { position: relative; height: 14px; border-radius: 999px; background: rgba(255, 255, 255, .09); overflow: hidden; }
#progress-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, var(--sky), var(--pink), var(--yellow));
  border-radius: 999px;
}
#playhead {
  position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(236, 72, 153, .35);
}
#scrub {
  position: absolute; inset: 0 0 18px; width: 100%; height: 22px; opacity: 0;
  cursor: pointer; margin: 0;
}
.seg-labels { display: flex; margin-top: 6px; font-family: var(--lat); font-size: 11px; color: var(--fg-dim); }
.seg-labels span { text-align: center; border-left: 1px solid var(--border); overflow: hidden; white-space: nowrap; }
.seg-labels span:last-child { border-left: none; }

/* ---------- scene strip ---------- */
.scene-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-top: 20px;
}
.scene-card {
  cursor: pointer; text-align: right; color: var(--fg);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; font-family: var(--ar);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}
.scene-card:hover { transform: translateY(-4px); border-color: rgba(236, 72, 153, .55); background: rgba(236, 72, 153, .09); }
.sc-id {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--pink), var(--blue));
  font-family: var(--lat); font-size: 13px; font-weight: 700;
}
.sc-time { font-family: var(--lat); font-size: 11.5px; color: var(--fg-dim); letter-spacing: .05em; }
.sc-name { font-size: 15px; font-weight: 700; }
.sc-en { font-family: var(--lat); font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .08em; }
.sc-line { font-size: 12.5px; color: var(--pink-soft); margin-top: 4px; line-height: 1.5; }

/* ---------- sections ---------- */
section { padding: 34px 0 6px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.sec-head h3 { font-size: clamp(22px, 3.4vw, 32px); margin: 0; }
.sec-head span { font-family: var(--lat); color: var(--fg-dim); font-size: 13px; letter-spacing: .09em; text-transform: uppercase; }
.note { color: var(--fg-dim); margin: 0 0 18px; max-width: 82ch; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

/* music spec */
.spec-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.spec-row:last-child { border-bottom: none; }
.spec-row b { font-family: var(--lat); font-size: 12px; letter-spacing: .06em; color: var(--pink-soft); min-width: 128px; text-transform: uppercase; }
.spec-row span { font-size: 14.5px; color: var(--fg); }

/* lyric sheet */
.ls-row { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.ls-sec { font-family: var(--lat); font-size: 11.5px; letter-spacing: .12em; color: var(--yellow); margin: 10px 0 2px; }
.ls-ar { font-size: clamp(17px, 2.6vw, 24px); font-weight: 700; }
.ls-tr { font-family: var(--lat); font-size: 13px; color: var(--sky); direction: ltr; text-align: right; }
.ls-en { font-family: var(--lat); font-size: 13px; color: var(--fg-dim); direction: ltr; text-align: right; }

/* ---------- prompt pack ---------- */
.prompt-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.prompt-card {
  background: linear-gradient(160deg, rgba(37, 99, 235, .14), rgba(236, 72, 153, .10));
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px;
  transition: transform .22s ease, border-color .22s ease;
}
.prompt-card:hover { transform: translateY(-3px); border-color: rgba(56, 189, 248, .45); }
.prompt-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.prompt-card h4 { margin: 0; font-size: 15.5px; flex: 1; }
.p-num {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); font-family: var(--lat); font-size: 12px; font-weight: 700;
}
.prompt-card p {
  margin: 0; font-family: var(--lat); font-size: 13.5px; line-height: 1.72;
  color: var(--fg-dim); text-align: left;
}
.copy-btn {
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .08); color: var(--fg); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 13px; font-family: var(--ar); font-size: 12.5px;
  transition: background .2s ease, transform .2s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, .18); transform: translateY(-2px); }
.copy-btn svg { width: 14px; height: 14px; }

/* ---------- director panel ---------- */
.dir-row { padding: 11px 0; border-bottom: 1px dashed var(--border); }
.dir-row:last-child { border-bottom: none; }
.dir-key { font-family: var(--lat); font-size: 11.5px; letter-spacing: .1em; color: var(--yellow); text-transform: uppercase; }
.dir-row p { margin: 4px 0 0; font-size: 15px; }
.dir-row p.en { font-family: var(--lat); font-size: 12.5px; color: var(--fg-dim); direction: ltr; text-align: right; }
#director-panel { display: none; }
body.director #director-panel { display: block; }

/* ---------- footer + toast ---------- */
footer { margin: 40px 0 60px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--fg-dim); font-size: 14px; }
footer b { color: var(--fg); }
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 24px);
  background: linear-gradient(150deg, var(--pink), var(--pink-2));
  color: #fff; font-weight: 700; padding: 13px 26px; border-radius: 999px;
  box-shadow: 0 16px 34px rgba(219, 39, 119, .45);
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 80;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- svg animation ---------- */
.stage-svg g { transform-origin: 0px 0px; }
.stage-svg .conf, .stage-svg .drop, .stage-svg .star, .stage-svg .flower {
  transform-box: fill-box; transform-origin: 50% 50%;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wheel { animation: spin .6s linear infinite; }
@keyframes kidbob { from { transform: translateY(0) } to { transform: translateY(-8px) } }
.kid { animation: kidbob .4s ease-in-out infinite alternate; }
@keyframes doorUp { from { transform: translateY(0) } to { transform: translateY(-460px) } }
.garage-door { animation: doorUp 3.1s cubic-bezier(.6, .04, .22, 1) .5s both; }
@keyframes rollOut { from { transform: translateX(0) } to { transform: translateX(70px) } }
.roll-out { animation: rollOut 1.4s ease-out 3.3s both; }
@keyframes ringOut {
  0% { transform: scale(.25); opacity: 0 }
  20% { opacity: .95 }
  100% { transform: scale(2.5); opacity: 0 }
}
.ring, .pulse { animation: ringOut 2.2s ease-out infinite; }
@keyframes zoomA {
  0% { transform: translate(770px, 466px) scale(.26); opacity: .55 }
  55% { transform: translate(540px, 620px) scale(.74); opacity: 1 }
  100% { transform: translate(360px, 733px) scale(1.25) }
}
@keyframes zoomB {
  0% { transform: translate(812px, 470px) scale(.24); opacity: .55 }
  55% { transform: translate(806px, 626px) scale(.76); opacity: 1 }
  100% { transform: translate(800px, 745px) scale(1.3) }
}
@keyframes zoomC {
  0% { transform: translate(856px, 474px) scale(.24); opacity: .55 }
  55% { transform: translate(1050px, 616px) scale(.72); opacity: 1 }
  100% { transform: translate(1256px, 725px) scale(1.22) }
}
.zA { animation: zoomA 4.9s ease-in both; }
.zB { animation: zoomB 4.9s ease-in both; }
.zC { animation: zoomC 4.9s ease-in both; }
@keyframes sweepR {
  0% { transform: translate(-520px, 772px) }
  100% { transform: translate(2120px, 772px) }
}
.sweep-r { animation: sweepR 7.2s linear both; }
@keyframes enterR {
  0% { transform: translate(2180px, 754px) }
  100% { transform: translate(-580px, 754px) }
}
.enter-r { animation: enterR 6.4s 6.4s linear both; }
@keyframes dashMove { to { transform: translateX(-190px) } }
.dash { animation: dashMove .9s linear infinite; }

@keyframes confFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0 }
  12% { opacity: 1 }
  100% { transform: translateY(1000px) rotate(560deg); opacity: .85 }
}
.conf { animation: confFall 2.6s linear infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
.spark, .star { animation: twinkle 1.1s ease-in-out infinite; }
@keyframes dance {
  from { transform: translateY(0) rotate(-4deg) }
  to { transform: translateY(-18px) rotate(4deg) }
}
.dance { animation: dance .86s ease-in-out infinite alternate; }
@keyframes orbit8 {
  from { transform: translate(800px, 640px) rotate(0deg) }
  to { transform: translate(800px, 640px) rotate(360deg) }
}
.orbit { animation: orbit8 8s linear infinite; }
@keyframes orbitCounter {
  from { transform: rotate(0deg) }
  to { transform: rotate(-360deg) }
}
.upright { animation: orbitCounter 8s linear infinite; }
@keyframes parkedBob { from { transform: translateY(0) } to { transform: translateY(-9px) } }
.parked { animation: parkedBob .7s ease-in-out infinite alternate; }
@keyframes heartFloat {
  0% { transform: translateY(0) scale(.6); opacity: 0 }
  25% { opacity: 1 }
  100% { transform: translateY(-170px) scale(1.15); opacity: 0 }
}
.heart { animation: heartFloat 2.4s ease-out infinite; }
@keyframes fadeOut { 0% { opacity: 0 } 100% { opacity: 1 } }
.fadeout { animation: fadeOut 2.2s ease-in 2.4s both; }
@keyframes lampRed { 0%, 49% { opacity: 1 } 50%, 100% { opacity: .18 } }
@keyframes lampBlue { 0%, 49% { opacity: .18 } 50%, 100% { opacity: 1 } }
.lamp-red { animation: lampRed .5s steps(1, end) infinite; }
.lamp-blue, .lamp-blue-flash { animation: lampBlue .5s steps(1, end) infinite; }
@keyframes dropOut {
  0% { transform: translate(0, 0) scale(.4); opacity: 0 }
  20% { opacity: 1 }
  100% { transform: translate(150px, 130px) scale(1); opacity: 0 }
}
.drop { animation: dropOut 1.5s ease-out infinite; }
@keyframes flowerPulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
.flowers .flower, .flowers circle { animation: flowerPulse 1.6s ease-in-out infinite; }
@keyframes bandPulse { 0%, 100% { opacity: .3 } 50% { opacity: .6 } }
.rainbow-band { animation: bandPulse 2.4s ease-in-out infinite; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .scene-strip { grid-template-columns: repeat(2, 1fr); }
  .prompt-list { grid-template-columns: 1fr; }
  .hud .tr { display: none; }
}
@media (max-width: 560px) {
  .scene-strip { grid-template-columns: 1fr; }
  .controls { padding: 12px; gap: 10px; }
  .btn { padding: 11px 16px; font-size: 14px; }
  .tc { min-width: 78px; font-size: 14px; }
  .hero { padding: 26px 0 4px; }
  .tc { order: 3; }
}
@media print {
  .nav, .controls, .stage, #toast { display: none !important; }
  body { background: #fff; color: #111; }
}

@media (prefers-reduced-motion: reduce) {
  .conf, .star, .spark { animation: none; opacity: .8; }
  .btn, .scene-card, .prompt-card { transition: none; }
}
