/* The Diwali game's scenes (docs/diwali-game/DIRECTORS-SCRIPT.md), on core.css. Built on the tree game's styles
   (tree.css): the same stage, panel and board, in Diwali's colours (magenta, marigold, night indigo). The art is ours
   (public/christmas/img/dw-*, made in Google Flow); the fairy lights, flames, names, sparks and petals are drawn by
   diwali.js. */

/* ── the palette (docs/diwali-game/ART-DIRECTION.md) over core.css's ───────────────────────────────────────── */
body.xm-diwali { --night: #2E1F5E; --night2: #3D2A78; --night-deep: #1B1440; --red: #D6246E; --red-d: #A3154F; --gold: #FFC83D; --gold-d: #C98A12;
  --marigold: #FF9F1C; --flame: #FFB547; --magenta: #D6246E; --teal: #1F6F78; }
.xm-diwali .xm-btn { background: linear-gradient(180deg, #F0508C 0%, var(--red) 55%, #B81A55 100%); box-shadow: 0 6px 0 var(--red-d), 0 12px 22px rgba(0,0,0,.28); }
.xm-diwali .xm-btn:active { box-shadow: 0 2px 0 var(--red-d), 0 4px 10px rgba(0,0,0,.25); }
/* the second colour: saffron-orange, as the marigolds */
.xm-diwali .xm-btn.is-green { background: linear-gradient(180deg, #FFB547 0%, #F28C28 55%, #E0731A 100%); box-shadow: 0 6px 0 #B0560E, 0 12px 22px rgba(0,0,0,.28); text-shadow: 0 2px 0 rgba(120,50,0,.35); }
.xm-diwali .xm-btn.is-gold { background: linear-gradient(180deg, #FFE07A 0%, var(--gold) 55%, #F2AE1A 100%); box-shadow: 0 6px 0 var(--gold-d), 0 12px 22px rgba(0,0,0,.28); }
.xm-diwali .xm-play .xm-btn.is-ghost { background: #FFFDF8; color: var(--ink); border-color: var(--outline); box-shadow: 0 4px 0 rgba(60,30,20,.22); }

/* ── the cast ───────────────────────────────────────────────────────────────────────────────────────────────── */
.xm-char { position: relative; flex: none; transform-origin: 50% 100%; }
.xm-char img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0,0,0,.28)); -webkit-user-drag: none; user-select: none; }
.xm-char img.is-art { object-position: 50% 100%; transform-origin: 50% 100%; animation: xm-breathe 2.8s ease-in-out infinite; }
.xm-char.is-mirrored { scale: -1 1; }
@keyframes xm-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.018, .982); } }
/* the picked card's character twirls: the lehenga flares, the kurta swishes */
.xm-char.is-twirl { animation: xm-twirl .7s cubic-bezier(.3,.7,.4,1); }
@keyframes xm-twirl { from { transform: perspective(500px) rotateY(0); } to { transform: perspective(500px) rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .xm-char img.is-art, .xm-mouse, .xm-char.is-twirl { animation: none; } }
.xm-art { display: block; max-width: none; -webkit-user-drag: none; user-select: none; }
/* a picture with its animated sticker over it (diwali.js livePic): the still holds the place */
.xm-live { position: relative; display: block; }
.xm-live-still { display: block; width: 100%; height: auto; }
.xm-live-anim { position: absolute; max-width: none; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.xm-live.is-playing .xm-live-still { visibility: hidden; }
.xm-mouse { display: block; height: auto; filter: drop-shadow(0 5px 5px rgba(0,0,0,.3)); transform-origin: 50% 100%; animation: xm-breathe 2.2s ease-in-out infinite; }
.xm-say.is-mouse { background: #FFF3E0; } .xm-say.is-mouse::after { background: #FFF3E0; }
.xm-say.is-puppy { font-family: var(--title); font-size: 18px; }

/* ── the creator's screens: a painted scene on top, the cream panel below (as the friend's stage) ───────────── */
.xm-scene.is-staged { padding: 0; gap: 0; }
.xm-scene.is-staged, .xm-scene.is-result, .xm-scene.is-reveal { background: #FBE7C6; }
.xm-play .xm-actions .xm-btn { font-size: clamp(16px, 4.8vw, 19px); }
.xm-play.is-page { display: flex; flex-direction: column; gap: 14px; padding-top: 26px; }
.xm-play .xm-sub, .xm-play .xm-small { color: #6B5A4E; }
.xm-play .xm-label, .xm-play .xm-h2 { color: var(--ink); }
.xm-play .xm-step { background: #fff; border-color: #F1E2C8; color: #6B5A4E; box-shadow: 0 3px 0 #EEDCBC; }
.xm-play .xm-step strong { color: var(--ink); }
.xm-play .xm-chip { border-color: #E3CFAD; background: #fff; color: var(--ink); }
.xm-play .xm-who-card { background: #fff; border-color: #F1E2C8; color: var(--ink); box-shadow: 0 4px 0 #EEDCBC; }
.xm-play .xm-who-card.is-picked { background: #FFF1D6; border-color: var(--gold); }
.xm-play .xm-input { border: 3px solid #EBD9BA; }
.xm-play .xm-error { color: var(--red-d); }
.xm-play.is-page .xm-error:empty { min-height: 0; margin-top: -14px; }
.xm-scene.is-staged > .xm-play.is-page { flex: 1 0 auto; }
.xm-hero { position: relative; flex: none; height: 58vh; height: 58dvh; min-height: 380px; overflow: hidden; background: #1B1440; }
.xm-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.xm-hero-glow { position: absolute; left: 50%; top: 52%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,190,110,.45), rgba(255,190,110,0) 62%); animation: xm-star 2.6s ease-in-out infinite alternate; }
/* the poster: tall, the picture drifting slowly closer (a film's opening shot); a dark band behind the title */
.xm-hero.is-poster { height: 74vh; height: 74dvh; min-height: 470px; }
.xm-hero-poster { position: absolute; inset: 0; overflow: hidden; }
.xm-hero.is-poster .xm-hero-bg { object-position: 50% 30%; transform-origin: 50% 45%; animation: xm-pushin 16s cubic-bezier(.3,0,.4,1) forwards; }
@keyframes xm-pushin { from { transform: scale(1.12); } to { transform: scale(1); } }
.xm-hero-vignette { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(20,12,48,.78) 0, rgba(20,12,48,.35) 26%, rgba(20,12,48,0) 42%, rgba(20,12,48,0) 80%, rgba(251,231,198,.9) 100%),
    radial-gradient(130% 90% at 50% 55%, transparent 55%, rgba(10,6,30,.45) 100%); }
@media (prefers-reduced-motion: reduce) { .xm-hero.is-poster .xm-hero-bg { animation: none; } }
.xm-hero-top { position: absolute; z-index: 10; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); }
.xm-hero-top .xm-site:not(.is-logo) { padding: 5px 11px; border-radius: 99px; background: rgba(28,20,44,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.xm-hero .xm-landing-title { position: absolute; z-index: 9;   /* above the fireworks */ left: 16px; right: 16px; top: calc(58px + env(safe-area-inset-top)); margin: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.xm-hero .xm-logo-top { font-size: clamp(17px, 5.6vw, 24px); max-width: 100%; }
.xm-hero .xm-logo-main { font-size: clamp(34px, 11.4vw, 52px); max-width: 100%; }
.xm-hero-host { position: absolute !important; z-index: 4; right: 6%; bottom: 34px; }
.xm-hero-diya { position: absolute; z-index: 3; left: 9%; bottom: 40px; width: 16%; height: auto; filter: drop-shadow(0 0 14px rgba(255,190,90,.75)); animation: xm-flicker 1.6s ease-in-out infinite alternate; }
.xm-landing-title { margin-top: 10px; }
.xm-landing-title .xm-logo-main { padding-top: 24px; }   /* room for the string of lights over a line that wraps (Hindi, Tamil) */
/* the string of fairy lights over the big line: a fixed size (it grew with a long line — Tamil, Hindi — and covered it) */
.xm-title-lights { position: absolute; left: 50%; top: -4px; width: min(88%, 250px); height: auto; transform: translateX(-50%); overflow: visible; }
.xm-steps { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.xm-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.12);
  font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--soft); }
.xm-step strong { color: #fff; }
.xm-step-n { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--red);
  color: #fff; font: 800 16px/1 var(--title); box-shadow: 0 3px 0 var(--red-d); }
@keyframes xm-flicker { from { filter: drop-shadow(0 0 10px rgba(255,190,90,.6)); } to { filter: drop-shadow(0 0 18px rgba(255,190,90,.95)); } }
/* the cream panel's top edge: a string of marigolds (drawn, no picture) */
.xm-play-edge { position: absolute; left: 10px; right: 10px; top: -7px; height: 14px; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #FFC83D 0 3px, #FF9F1C 3.5px 5.5px, #D9700C 6px 6.6px, transparent 7px) 0 0 / 15px 14px repeat-x;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }

/* the lights (steps and title): dark until their string switches on, then they glow and twinkle */
.xm-bulb { fill: #4E4A5E; stroke: #2A2233; stroke-width: 1; transition: fill .35s; }
.xm-glow { opacity: 0; transition: opacity .45s; }
.is-on .xm-bulb, .is-on.xm-bulb { fill: var(--c); }
.is-on .xm-glow { opacity: .6; animation: xm-bulb 1.6s ease-in-out infinite alternate; }
@keyframes xm-bulb { from { opacity: .3; } to { opacity: .75; } }
.xm-lite .is-on .xm-glow { animation: none; opacity: .55; }
.xm-bulb.is-fizzle { animation: xm-fizzle .9s ease-out; }
@keyframes xm-fizzle { 0% { fill: #fff; } 20% { fill: #FFD34D; } 35% { fill: #4E4A5E; } 50% { fill: #FFF3B0; } 100% { fill: #4E4A5E; } }

/* ── 1.2 the name on the diya: the low table, the tray of diyas, the Mouse with his brush ────────────────────── */
.is-staged .xm-nametable { position: relative; flex: none; height: 330px; overflow: hidden; background: #4A2A1C; }
.xm-nametable-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
.xm-nametable-diya { position: absolute; z-index: 2; left: 50%; bottom: calc(12% + 26px);   /* clear of the panel's edge */ transform: translateX(-50%); }
.xm-nametable .xm-diya.is-big { --dw: min(150px, 40vw); }
.xm-table-mouse { position: absolute; z-index: 3; right: 6%; bottom: 10%; width: min(96px, 24vw); }
.xm-nametable .xm-say { z-index: 7; }
.xm-who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.xm-who-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 10px; border: 3px solid rgba(255,255,255,.2); border-radius: 20px;
  background: rgba(255,255,255,.08); color: #fff; font: 800 18px/1 var(--title); cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.xm-who-card .xm-char { margin: 8px 0 8px; }
.xm-who-card > span { position: relative; }
.xm-who-card.is-picked { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,200,61,.3), 0 10px 24px rgba(0,0,0,.2); }
.xm-who-card:active { transform: scale(.97); }

/* ── 1.3 the mood ─────────────────────────────────────────────────────────────────────────────────────────── */
.xm-moodhost { position: relative; height: 150px; display: flex; justify-content: center; align-items: flex-end; overflow: hidden; }
.is-staged .xm-moodhost { flex: none; height: clamp(300px, 42vh, 340px); }
.xm-moodhost-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.is-staged .xm-moodhost .xm-char { margin-bottom: 30px; }
.xm-moods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xm-mood { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 64px; padding: 6px 10px 6px 6px; border: 3px solid #F1E2C8; border-radius: 16px; background: var(--paper);
  color: var(--ink); font: 800 15px/1.2 'Nunito', sans-serif; text-align: left; cursor: pointer; box-shadow: 0 4px 0 #EEDCBC; transition: transform .15s, box-shadow .15s; }
.xm-mood > span { min-width: 0; overflow-wrap: normal; hyphens: manual; }
.xm-mood-pic { flex: none; width: 52px; height: 52px; object-fit: contain; }
.xm-mood:nth-child(odd) { rotate: -1.2deg; } .xm-mood:nth-child(even) { rotate: 1deg; }
.xm-mood.is-picked { position: relative; background: #FFF1C2; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 6px 0 var(--gold-d); }
.xm-mood.is-picked::after { content: '🪔'; position: absolute; top: -13px; left: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold);
  border: 2.5px solid var(--outline); font-size: 15px; line-height: 25px; text-align: center; }
/* narrow phones: the picture above the words, so a word never breaks */
@media (max-width: 374px) {
  .xm-mood { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 6px; text-align: center; font-size: 14px; }
  .xm-mood-pic { width: 56px; height: 56px; }
}
.xm-chips { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.xm-chip { min-height: 42px; padding: 0 16px; border: 2px solid rgba(255,255,255,.35); border-radius: 99px; background: rgba(255,255,255,.08); color: #fff;
  font: 800 15px/1 'Nunito', sans-serif; cursor: pointer; white-space: nowrap; }
.xm-chip.is-red { background: var(--red); border-color: var(--red); color: #fff; }

/* ── the camera on the steps (one tall layer: TILT = translateY, WIDE = scale) ─────────────────────────────── */
.xm-cam { position: relative; flex: none; height: clamp(230px, 43vh, 400px); border-radius: 22px; overflow: hidden; background: #1B1440;
  border: 3px solid rgba(255,255,255,.22); box-shadow: 0 14px 30px rgba(0,0,0,.35); isolation: isolate; }
.xm-shot { position: absolute; inset: 0; transform-origin: 50% 62%; }
.xm-cam-backdrop { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); object-fit: cover; filter: blur(8px) brightness(.5) saturate(.9); }
.xm-layer { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 320 / 573; transform-origin: 50% 0; container-type: inline-size;
  transition: transform .95s cubic-bezier(.45,0,.2,1); will-change: transform; }
/* the steps: the house picture, the SVG of fairy lights and the lantern's glow (all in 320 × 573 units) */
.xm-steps-art { position: absolute; aspect-ratio: 320 / 573; overflow: hidden; pointer-events: none; }
.xm-layer > .xm-steps-art { inset: 0; width: 100%; height: 100%; }
.xm-steps-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.xm-steps-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the lit house over the dark one: shown from --lit-top to --lit-bottom (diwali.js litBand), the edges soft, the light
   rolling up (or down) the house as the steps light */
@property --lit-top { syntax: '<percentage>'; inherits: false; initial-value: 110%; }
@property --lit-bottom { syntax: '<percentage>'; inherits: false; initial-value: 110%; }
.xm-steps-lit { --lit-top: 110%; --lit-bottom: 110%;
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--lit-top) - 6%), #000 var(--lit-top), #000 var(--lit-bottom), transparent calc(var(--lit-bottom) + 6%));
  mask-image: linear-gradient(to bottom, transparent calc(var(--lit-top) - 6%), #000 var(--lit-top), #000 var(--lit-bottom), transparent calc(var(--lit-bottom) + 6%));
  transition: --lit-top 1.3s cubic-bezier(.3,0,.2,1), --lit-bottom 1.3s cubic-bezier(.3,0,.2,1); }
/* a wrong answer: every lamp gutters for a moment, then burns again */
.xm-steps-lit.is-flicker { animation: xm-gutter 1s ease-out; }
@keyframes xm-gutter { 0% { opacity: 1; } 15% { opacity: .25; } 30% { opacity: .85; } 45% { opacity: .35; } 100% { opacity: 1; } }
/* a step catching: a warm flare runs across it */
/* the little flame that climbs the path in the lights film, lighting each step's diya as it passes */
.xm-ember { position: absolute; z-index: 9; width: calc(var(--cq, 1cqw) * 5); aspect-ratio: 1; border-radius: 50%; translate: -50% -50%; pointer-events: none;
  background: radial-gradient(circle, #FFFDF0 0 18%, #FFE07A 34%, rgba(255,170,60,.85) 52%, rgba(255,140,40,0) 72%);
  box-shadow: 0 0 calc(var(--cq, 1cqw) * 4) calc(var(--cq, 1cqw) * 2) rgba(255,190,90,.75);
  transition-property: left, top; transition-timing-function: cubic-bezier(.45,0,.55,1); animation: xm-ember .32s ease-in-out infinite alternate; }
.xm-ember.is-out { opacity: 0; scale: 2.4; transition: opacity .45s, scale .45s; }
@keyframes xm-ember { to { scale: 1.25; filter: brightness(1.2); } }
.xm-step-flare { position: absolute; z-index: 2; width: 92%; height: 0; padding-bottom: 22%; transform: translate(-50%, -78%); pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,214,120,.8), rgba(255,170,60,.4) 45%, rgba(255,140,40,0)); mix-blend-mode: screen;
  animation: xm-flare 1.3s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes xm-flare { 0% { opacity: 0; scale: .15 .5; } 22% { opacity: 1; scale: 1 1; } 100% { opacity: 0; scale: 1.25 .8; } }
.xm-dimmer { opacity: 0; transition: opacity .8s; pointer-events: none; }
.xm-cam.is-dim .xm-dimmer { opacity: .62; }
/* the last question: the film's black bars close in for the tension, and open again after */
.xm-cam::before, .xm-cam::after { content: ''; position: absolute; z-index: 9; left: 0; right: 0; height: 9%; background: #000; pointer-events: none;
  transition: transform .7s cubic-bezier(.3,0,.2,1); }
.xm-cam::before { top: 0; transform: translateY(-100%); }
.xm-cam::after { bottom: 0; transform: translateY(100%); }
.xm-cam.is-letterbox::before, .xm-cam.is-letterbox::after { transform: none; }
/* a step catching: warm light washes over the shot */
.xm-cam-warm { position: absolute; z-index: 7; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(90% 70% at 50% 60%, rgba(255,200,110,.55), rgba(255,150,60,.15) 60%, rgba(255,150,60,0)); animation: xm-warm 1.1s ease-out forwards; }
/* the perfect 10: a golden flash that settles into a warm gold haze */
.xm-cam-gold { position: absolute; z-index: 7; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(80% 60% at 50% 40%, rgba(255,226,140,.9), rgba(255,190,80,.3) 55%, rgba(255,190,80,0)); animation: xm-gold 2.4s ease-out forwards; }
@keyframes xm-gold { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: .25; } }
@keyframes xm-warm { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.xm-star-glow { opacity: .15; transition: opacity .8s; transform-box: fill-box; transform-origin: center; mix-blend-mode: screen; }
.is-star .xm-star-glow { opacity: 1; animation: xm-star 2.4s ease-in-out infinite alternate; }
@keyframes xm-star { from { transform: scale(.9); } to { transform: scale(1.12); } }
/* the basket of unlit diyas by the gate (a diya in it peeks over the rim) and the street dog: both stand on their point */
.xm-box-front { position: absolute; z-index: 5; display: block; width: 24%; height: auto; translate: -50% -100%; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.35)); }
.xm-dog { position: absolute; z-index: 4; display: block; width: calc(var(--cq, 1cqw) * 22 * var(--anim-w, 1)); height: auto; translate: -50% -100%; pointer-events: none;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.35)); transition: left .7s cubic-bezier(.3,1,.4,1), top .7s cubic-bezier(.3,1,.4,1), width .3s; }
.xm-dog.is-window { z-index: 2; width: calc(var(--cq, 1cqw) * 15 * var(--anim-w, 1)); }
/* asleep in the garden among the marigold pots (no character ever stands there); beside a diya on the bottom step */
.xm-dog.is-garden { z-index: 1; width: calc(var(--cq, 1cqw) * 15 * var(--anim-w, 1)); }
.xm-dog.is-beside { width: calc(var(--cq, 1cqw) * 16 * var(--anim-w, 1)); }
/* the creator's decorations stand on their step */
.xm-deco { position: absolute; z-index: 2; width: calc(var(--cq, 1cqw) * 10 * var(--depth, 1)); height: auto;
  /* stood on its point by a translate (not a transform): its pop-in animation then plays right where it stands, it never
     appears off its spot and jumps there */
  translate: -50% -100%; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
/* the akash kandil hangs from the ceiling on a cord: the cord's top at its point, swaying gently from there */
.xm-deco.is-lantern { translate: -50% 0; transform-origin: 50% 0; padding-top: calc(var(--cq, 1cqw) * 4);
  background: linear-gradient(#3B2A26, #3B2A26) 50% 0 / max(1px, calc(var(--cq, 1cqw) * .35)) calc(var(--cq, 1cqw) * 4.6) no-repeat;
  filter: drop-shadow(0 0 calc(var(--cq, 1cqw) * 2.4) rgba(255,120,170,.55)) drop-shadow(0 2px 2px rgba(0,0,0,.4));
  animation: xm-sway 3.2s ease-in-out infinite alternate; }
@keyframes xm-sway { from { rotate: -4deg; } to { rotate: 4deg; } }
@media (prefers-reduced-motion: reduce) { .xm-deco.is-lantern { animation: none; } }
/* the rangoli lies flat on its step: a full circle seen in perspective */
/* the doorstep rangoli lies flat on the top step's thin tread (seen almost edge-on): wide, very flat, centred on its
   point, so none of it climbs up the door */
.xm-deco.is-rangoli { z-index: 1; width: calc(var(--cq, 1cqw) * 15); translate: -50% -50%; scale: 1 .2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
/* an empty saucer waiting for a friend: a "?" tag over it */
.xm-hook { position: absolute; z-index: 2; translate: -50% -130%; }
.xm-hook i { display: block; min-width: calc(var(--cq, 1cqw) * 5.2); padding: calc(var(--cq, 1cqw) * .4) var(--cq, 1cqw); border-radius: calc(var(--cq, 1cqw) * 1.2);
  background: var(--paper); border: calc(var(--cq, 1cqw) * .5) solid var(--outline);
  color: var(--red-d); font: 800 calc(var(--cq, 1cqw) * 3.6)/1 var(--title); font-style: normal; text-align: center; }

/* ── the friend's stage: the steps fill the screen, the answers on a cream panel, the cast standing on its edge ── */
.xm-scene.is-climb { height: auto; min-height: 100vh; min-height: 100dvh; padding: 0; gap: 0; }
.xm-small.is-dark, .xm-link.is-dark { color: #7A665A; }
.xm-cam.is-stage { border: 0; border-radius: 0; box-shadow: none; --mouse-h: 110px; }
.is-climb .xm-cam.is-stage { flex: 1 0 auto; height: auto; min-height: clamp(210px, 38vh, 340px); min-height: clamp(210px, 38dvh, 340px); }
/* the toran of progress: a marigold string across the top edge; its ten little lamps light up as the diya climbs */
/* (the picture's top band only, small and repeated: one long marigold row with its mango leaves) */
.xm-toran { position: absolute; z-index: 10; left: 0; right: 0; top: calc(-3px + env(safe-area-inset-top)); height: 32px; pointer-events: none;
  background: url('../img/dw-prop-toran-1x.webp') 0 0 / auto 104px repeat-x, url('../img/dw-prop-toran-1x.webp') 104px 1px / auto 104px repeat-x;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); transition: opacity .5s, translate .5s; }
.xm-cam.is-wide .xm-toran { opacity: 0; translate: 0 -60%; }
.xm-toran-pic { display: none; }
.xm-toran-lamps { position: absolute; left: 9%; right: 9%; top: 27px; display: flex; justify-content: space-between; }
.xm-toran-lamps i { width: 11px; height: 14px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: rgba(40,26,30,.7); border: 1.5px solid rgba(59,42,38,.8);
  transition: background .4s, box-shadow .4s; }
.xm-toran-lamps i.is-on { background: radial-gradient(circle at 50% 70%, #FFF8D6 0, #FFD34D 40%, #FF8A2E 100%); border-color: #FFE07A;
  box-shadow: 0 0 10px 4px rgba(255,190,90,.85), 0 0 22px 8px rgba(255,160,60,.45); animation: xm-twinkle 1.4s ease-in-out infinite alternate; }
@keyframes xm-twinkle { from { opacity: .8; } to { opacity: 1; } }
.xm-cam-mouse { position: absolute !important; z-index: 6; left: 6px; bottom: 2px; }
.is-stage .xm-cam-mouse { bottom: 30px; left: 6px; }
.xm-cam-host { position: absolute !important; z-index: 6; right: 4px; bottom: 2px; }
.is-stage .xm-cam-host { bottom: 28px; right: 4px; }
.xm-cam .xm-say { z-index: 11; }
/* the answer panel: warm paper, marigolds along its edge, a marigold tag with the question number */
.xm-play { position: relative; z-index: 12; flex: none; margin-top: -30px; padding: 30px 14px calc(16px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
  background: radial-gradient(120% 60% at 50% 0, #FFFDF7 0, #FFF4E2 60%, #FBE7C6 100%); color: var(--ink); box-shadow: 0 -10px 26px rgba(0,0,0,.32);
  transition: transform .55s cubic-bezier(.2,1.2,.4,1), margin-top .55s; }
.xm-play.is-hidden { position: absolute; left: 0; right: 0; bottom: 0; transform: translateY(calc(100% + 40px)); }
.xm-scene.is-climb > .xm-play.is-hidden { position: absolute; }
/* the result: the same stage, the ending on a big tag over the steps, the score and next steps on the panel */
.xm-scene.is-result { padding: 0; gap: 0; }
.is-result .xm-cam.is-stage { flex: none; height: 64vh; height: 64dvh; min-height: 380px; }
/* the reveal: the stage fills the phone; the panel slides up after the film */
.xm-scene.is-reveal { padding: 0; gap: 0; }
.is-reveal .xm-cam.is-stage { flex: none; height: 82vh; height: 82dvh; min-height: 460px; }
.is-reveal .xm-play.is-hidden { position: relative; transform: translateY(40px); pointer-events: none; }
.is-reveal .xm-play > :not(.xm-play-edge) { transition: opacity .4s .15s; }
.is-reveal .xm-play.is-hidden > :not(.xm-play-edge) { opacity: 0; }
.is-reveal .xm-play { transition: transform .6s cubic-bezier(.2,1.2,.4,1), opacity .4s; }
.xm-share-block { display: flex; flex-direction: column; gap: 10px; }
.xm-share-block .xm-sub { color: #6B5A4E; }
.xm-share-block .xm-family { min-height: 52px; font-size: 17px; }
.is-result-panel .xm-board-heading, .is-result-panel .xm-small { color: #6B5A4E; }
.is-reveal-cast .xm-cam-host { scale: .8; transform-origin: 100% 100%; right: 0; }
.is-reveal-cast .xm-cam-mouse { scale: .8; transform-origin: 0 100%; left: 0; }
.is-swap .xm-cam-host { right: auto; left: 4px; }
.is-swap .xm-cam-mouse { left: auto; right: 6px; }
.is-result-panel { margin-top: -30px; padding-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.xm-endcard-text { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.xm-endcard-line { margin: 0; font: 700 15px/1.35 'Nunito', sans-serif; color: #6B5A4E; }
.xm-endcard-line.is-laddoo { font-weight: 800; color: var(--red-d); }
.is-result-panel .xm-endcard-score { color: var(--ink); }
.is-result-panel .xm-name { color: var(--red-d); }
/* the intro: the house at dusk, before the camera pushes in through the gate */
.xm-outside { position: absolute; inset: 0; z-index: 20; overflow: hidden; transform-origin: 50% 66%; background: #1B1440; }
.xm-outside-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.xm-outside-glow { position: absolute; left: 50%; top: 58%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,190,110,.5), rgba(255,190,110,0) 65%); animation: xm-star 2.4s ease-in-out infinite alternate; }
/* the marigold tag (the question number, the titles): magenta silk with a gold edge and a marigold at each end */
.xm-ribbon { position: absolute; left: 50%; top: -24px; z-index: 2; min-width: 52%; max-width: 280px; padding: 9px 26px; translate: -50% 0;   /* (not transform: its entrance animates that) */ border-radius: 14px;
  background: linear-gradient(180deg, #F0508C, #C21C5E); border: 3px solid var(--gold); box-shadow: 0 0 0 2px var(--outline), 0 5px 8px rgba(0,0,0,.28); }
.xm-ribbon::before, .xm-ribbon::after { content: ''; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: radial-gradient(circle, #FFE07A 0 22%, #FFB020 24% 60%, #E86F0C 62% 74%, transparent 76%); }
.xm-ribbon::before { left: 4px; } .xm-ribbon::after { right: 4px; }
.xm-play > .xm-ribbon { position: relative; left: auto; top: auto; translate: none; margin: -52px auto 0; width: max-content; }
.xm-ribbon-text { display: block; overflow: hidden; color: #fff; white-space: nowrap; text-align: center;
  font: 800 15px/1.1 var(--title); letter-spacing: 1px; text-transform: uppercase; text-shadow: 0 2px 0 rgba(90,10,40,.6); }
.xm-ribbon.is-title { top: calc(16px + env(safe-area-inset-top)); width: min(88%, calc(100% - 104px)); max-width: 400px;   /* clear of the sound button */ height: 66px; padding: 6px 30px; z-index: 11; }
.xm-ribbon.is-title .xm-ribbon-text { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; font-size: clamp(15px, 4.6vw, 21px);
  letter-spacing: .5px; text-transform: none; white-space: normal; line-height: 1.05; }
.xm-play .xm-qbox { gap: 12px; padding-top: 6px; }
.xm-play .xm-name { color: var(--red-d); }
.xm-play .xm-q { padding: 2px 4px 0; text-align: center; }
.xm-play .xm-opt { border-color: #fff; box-shadow: 0 6px 0 #E6D3B4, 0 10px 18px rgba(120,80,30,.16); }
/* a small marigold pinned on each answer card */
.xm-play .xm-opt::before { content: ''; position: absolute; z-index: 1; left: -8px; top: -8px; width: 24px; height: 24px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, #FFE07A 0 18%, #FFB020 20% 56%, #E86F0C 58% 72%, transparent 74%); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.xm-opt img.xm-ans-pic { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.xm-flash { position: absolute; inset: 0; z-index: 30; background: #fff; pointer-events: none; animation: xm-flash .7s ease-out forwards; }
@keyframes xm-flash { from { opacity: .95; } to { opacity: 0; } }

/* ── the diyas (a name painted on clay, a painted flame on its wick; on the steps they're sized by the steps' width) ── */
/* each diya stands on its point (its foot); the flame grows with --lit (0 = unlit … 1 = every step) */
.xm-diya { --dw: calc(var(--cq, 1cqw) * 15); --lit: 0; position: absolute; z-index: 3; width: var(--dw); display: flex; flex-direction: column; align-items: center;
  /* (the offset that stands it on its point is a translate, and it grows from its foot: a bigger diya — on the rangoli,
     in the spotlight — still stands exactly on its spot, and an entrance animation never shifts it) */
  translate: -50% -100%; transform-origin: 50% 100%; transition: left .85s cubic-bezier(.34,1.25,.5,1), top .85s cubic-bezier(.34,1.25,.5,1), scale .4s, opacity .3s, filter .5s; }
.xm-diya-flame { position: relative; z-index: 2; display: flex; justify-content: center; align-items: flex-end;
  /* the painted flame (dw-prop-flame, 226 × 480) stands on the wick: its foot on the wick's tip (3.9% down the bowl) */
  height: calc(var(--dw) * (.2 + .36 * var(--lit))); aspect-ratio: 226 / 480;
  margin-bottom: calc(var(--dw) * (-.027 - .08 * (.2 + .36 * var(--lit))));
  transform-origin: 50% 100%; transition: height .5s, margin .5s, opacity .3s, scale .4s; }
.xm-diya-flame i { display: block; width: 100%; height: 100%; background: url('../img/dw-prop-flame-1x.webp') 50% 100% / contain no-repeat;
  filter: drop-shadow(0 0 calc(var(--dw) * .05) rgba(255,190,80,.9)); transform-origin: 50% 95%; animation: xm-flame 1.1s ease-in-out infinite alternate; }
@keyframes xm-flame { from { transform: scale(1, 1) rotate(-2.5deg); } to { transform: scale(.93, 1.07) rotate(2.5deg); } }
/* its warm light on everything around it (brighter as it climbs) */
.xm-diya-glow { position: absolute; z-index: 0; left: 50%; top: 0; width: calc(var(--dw) * 1.7); aspect-ratio: 1; transform: translate(-50%, -32%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,200,110,.75), rgba(255,170,70,.25) 40%, rgba(255,170,70,0) 66%); opacity: calc(.25 + .75 * var(--lit)); transition: opacity .5s; }
.xm-diya.is-unlit .xm-diya-flame { opacity: 0; scale: .2; }
.xm-diya.is-unlit .xm-diya-glow { opacity: 0; }
/* the name on the clay, across the bowl */
.xm-diya-body { position: relative; z-index: 1; width: 100%; aspect-ratio: 480 / 337; container-type: inline-size; }
.xm-diya-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.xm-diya.is-unlit .xm-diya-pic { filter: brightness(.82) saturate(.85) drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.xm-diya-name { position: absolute; left: 14%; right: 14%; top: 64%;   /* the bowl's plain front band */ transform: translateY(-50%); overflow: hidden; color: var(--paint, #FFE07A); text-align: center; white-space: nowrap;
  font: 800 calc(var(--cq, 1cqw) * 30 * var(--fs)) / 1 var(--title);
  /* a 3D sticker: the colour inside a white border, a thin dark rim round the border, lifted off the clay by a shadow */
  -webkit-text-stroke: max(2px, calc(var(--cq, 1cqw) * 7 * var(--fs))) #FFFDF6; paint-order: stroke fill;
  filter: drop-shadow(0 0 max(.6px, calc(var(--cq, 1cqw) * .6)) #5A2410) drop-shadow(0 max(1px, calc(var(--cq, 1cqw) * 1.6)) max(1px, calc(var(--cq, 1cqw) * 1.4)) rgba(40,12,4,.55)); }
.xm-diya-name.is-paint { animation: xm-paint .35s ease-out; }
/* the name drawn on the bowl's curve (diwali.js curvedName) is what shows; the plain text stays for readers */
.xm-diya-name { color: transparent; -webkit-text-stroke: 0; filter: none; }
.xm-diya-curve { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 0 .6px #3A1608) drop-shadow(0 0 .6px #3A1608) drop-shadow(0 1.5px 1.5px rgba(40,12,4,.55)); }
.xm-diya-curve text { font-family: var(--title); font-weight: 800; fill: var(--paint, #E8336E); stroke: #FFFDF6;
  stroke-linejoin: round; paint-order: stroke fill; letter-spacing: .01em; }
.xm-diya.is-blank .xm-diya-curve { opacity: .6; }
@keyframes xm-paint { from { filter: brightness(1.8); transform: translateY(-50%) scale(1.12); } }
.xm-diya.is-mono .xm-diya-name { font-size: calc(var(--cq, 1cqw) * 40 * var(--fs)); letter-spacing: -.02em; }
.xm-diya.is-big .xm-diya-name, .xm-diya.is-wrap .xm-diya-name { white-space: normal; line-height: .95; overflow-wrap: normal; word-break: keep-all; }
.xm-diya.is-blank .xm-diya-name { opacity: .6; }
/* a monogram diya (long names): the full name on a tag below its foot */
.xm-diya-tag { position: absolute; z-index: 3; left: 50%; top: 100%; transform: translate(-50%, 3px); max-width: calc(var(--cq, 1cqw) * 38);
  padding: calc(var(--cq, 1cqw) * .5) calc(var(--cq, 1cqw) * 1.8); border-radius: calc(var(--cq, 1cqw) * 1.2);
  background: #FFF8EC; border: calc(var(--cq, 1cqw) * .45) solid var(--outline); color: var(--ink); font: 800 calc(var(--cq, 1cqw) * 3.9)/1.15 var(--title);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 calc(var(--cq, 1cqw) * .6) var(--cq, 1cqw) rgba(0,0,0,.3); pointer-events: none; }
/* it lands: a little bounce, the flame leaps */
.xm-diya.is-landed .xm-diya-body { animation: xm-land .6s cubic-bezier(.3,1.6,.5,1); }
.xm-diya.is-landed .xm-diya-flame { animation: xm-leap .7s ease-out; }
@keyframes xm-land { 0% { transform: translateY(-14%) scale(1.04, .94); } 40% { transform: translateY(0) scale(.96, 1.06); } 100% { transform: none; } }
@keyframes xm-leap { 30% { scale: 1.45; } 100% { scale: 1; } }
/* a wrong answer: the flame shrinks for a moment */
.xm-diya.is-dip .xm-diya-flame { animation: xm-dip 1s ease-out; }
@keyframes xm-dip { 25% { scale: .45; } 60% { scale: .7; } 100% { scale: 1; } }
/* the name diya catches its flame */
.xm-diya.is-catch .xm-diya-flame { animation: xm-leap .8s ease-out; }
/* the friend's own diya: the hero, big enough for a whole name, with a warm halo */
.xm-diya.is-friend { --dw: calc(var(--cq, 1cqw) * 20); z-index: 4; }
.xm-diya.is-friend .xm-diya-pic { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px rgba(255,236,170,.8)); }
.xm-diya.is-back { --dw: calc(var(--cq, 1cqw) * 11); z-index: 2; opacity: .9; }
/* a small diya on a ledge of the house (a full house): no name, just its light */
.xm-diya.is-back.is-ledge { --dw: calc(var(--cq, 1cqw) * 5.2); opacity: 1; }
.xm-diya.is-ledge .xm-diya-curve, .xm-diya.is-ledge .xm-diya-tag { display: none; }
.xm-diya.is-gold .xm-diya-curve text { fill: #7A1F00; stroke: #FFF4C8; }
/* a named diya lining the path: sized by how far down the steps it stands */
.xm-diya.is-line { --dw: calc(var(--cq, 1cqw) * 13 * var(--depth, 1)); }
.xm-diya.is-back.is-crowd { --dw: calc(var(--cq, 1cqw) * 9.5 * var(--depth, 1)); opacity: 1; }
.xm-diya.is-rival { --dw: calc(var(--cq, 1cqw) * 10); opacity: .8; }
/* a perfect 10: a golden diya, burning at full */
.xm-diya.is-gold .xm-diya-pic { filter: sepia(.6) saturate(2.4) hue-rotate(-8deg) brightness(1.25) drop-shadow(0 0 12px rgba(255,211,77,.95)); }
/* the door diya's crown, worn at a tilt on the bowl's rim */
/* the door diya's marigold ring: drawn in the bowl's units, its back half behind the clay, its front half before it */
.xm-marigolds { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(80,20,0,.45)); }
.xm-marigolds.is-front { z-index: 4; }
.xm-diya.is-hook .xm-diya-pic { z-index: 1; }
.xm-diya.is-hook .xm-diya-curve { z-index: 2; }
.xm-diya.is-landed .xm-marigolds, .xm-diya.is-hook .xm-marigolds { animation: xm-ring .7s cubic-bezier(.3,1.5,.5,1) both; }
.xm-diya.is-untagged .xm-diya-tag { display: none; }
.xm-diya.is-boxed:not(.is-spot) .xm-diya-tag { display: none; }   /* in the basket the tag would poke out of the weave */
.xm-diya.is-you .xm-diya-pic { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 12px rgba(255,255,255,.85)); }
/* the spotlight on the friend's own diya: the others fall into the dark, theirs grows and glows */
.xm-layer.is-spotlight .xm-diya:not(.is-you) { filter: brightness(.38) saturate(.6); }
.xm-diya.is-you.is-spot { scale: 1.35; z-index: 8; opacity: 1; filter: none; }
.xm-diya.is-you.is-spot.is-peek { translate: -80% -140%; }
.xm-diya.is-you.is-spot .xm-diya-glow { animation: xm-spot 1s ease-in-out infinite alternate; }
.xm-diya.is-you.is-spot.is-untagged .xm-diya-tag { display: block; }
@keyframes xm-spot { from { opacity: .7; scale: 1; } to { opacity: 1; scale: 1.25; } }
.xm-diya.is-front { scale: 1.25; }
/* the creator's ring of marigold petals around it (on the rangoli) */
.xm-diya.is-ringed::before { content: ''; position: absolute; z-index: 0; left: -22%; right: -22%; bottom: -12%; height: 46%; border-radius: 50%;
  border: max(2px, calc(var(--dw) * .07)) dotted #FF9F1C; box-shadow: 0 0 8px rgba(255,159,28,.6); animation: xm-ring .6s cubic-bezier(.3,1.5,.5,1); }
@keyframes xm-ring { from { scale: .3; opacity: 0; } }
.xm-diya.is-peek { translate: -50% -130%; transition: translate .5s cubic-bezier(.3,1.4,.5,1); }
.xm-diya[role="button"] { cursor: pointer; }
/* outside the steps: a big diya (the name table, the invitation) and the answers sheet's */
.xm-diya.is-big, .xm-diya.is-sheet { position: relative; translate: none; z-index: 1; }
.xm-diya.is-big { --dw: 128px; }
.xm-diya.is-sheet { --dw: 64px; flex: none; }
.xm-ballrow { display: flex; justify-content: center; margin-top: 14px; }

/* ── fireworks, petals, the sky's greeting ────────────────────────────────────────────────────────────────── */
/* the canvas every rocket and burst is drawn on (diwali.js sky) */
.xm-sky { position: absolute; z-index: 8; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.xm-bloom { position: absolute; z-index: 9; width: 0; height: 0; pointer-events: none; }
.xm-bloom i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px 2px var(--c); }
.xm-bloom.is-still::before { content: ''; position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 70%); opacity: .55; }
.xm-petals { position: absolute; inset: 0; z-index: 9; overflow: hidden; pointer-events: none; }
.xm-petals i { position: absolute; top: -16px; width: 11px; height: 8px; border-radius: 60% 40% 60% 40%; box-shadow: inset -1px -1px 0 rgba(160,60,0,.35);
  animation: xm-petal linear forwards; }
/* (a transform, not `top`: the petals fall without a layout every frame) */
@keyframes xm-petal { to { transform: translate(var(--drift, 20px), var(--fall, 900px)) rotate(var(--spin, 180deg)); } }
.xm-sky-greeting { position: absolute; z-index: 9; left: 6%; right: 6%; top: calc(98px + env(safe-area-inset-top)); text-align: center; pointer-events: none; opacity: 0;
  transition: opacity .9s, transform .9s cubic-bezier(.3,1.3,.5,1); transform: scale(.9); }
.xm-sky-greeting.is-on { opacity: 1; transform: none; }

/* ── 3.5 the climax: over the whole phone, letterboxed; the street lights up, rockets, the two of them, the greeting ── */
.xm-climax { position: fixed; z-index: 50; top: 0; bottom: 0; left: 50%; width: min(100%, 480px); transform: translateX(-50%); overflow: hidden;
  background: #070618; opacity: 0; transition: opacity .6s; }
.xm-climax.is-in { opacity: 1; }
.xm-climax.is-done { opacity: 0; pointer-events: none; }
.xm-climax-film { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity .55s .35s; }   /* the house goes dark first, then the street */
.xm-climax.is-in .xm-climax-film { opacity: 1; }
/* the slow pull-back: the street seen close at first, the whole lane by the end */
.xm-climax-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; transform: scale(1.22); transform-origin: 50% 78%;
  transition: transform 7.5s cubic-bezier(.25,0,.2,1); }
.xm-climax.is-in .xm-climax-bg { transform: scale(1); }
/* the wave of light rolls out from the rangoli, up the lane and over the houses */
@property --wave { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.xm-climax-bg.is-lit { --wave: 0%; transition: transform 7.5s cubic-bezier(.25,0,.2,1), --wave 2.4s cubic-bezier(.45,0,.25,1);
  -webkit-mask-image: radial-gradient(160% 120% at 50% 88%, #000 calc(var(--wave) - 14%), transparent var(--wave));
  mask-image: radial-gradient(160% 120% at 50% 88%, #000 calc(var(--wave) - 14%), transparent var(--wave)); }
.xm-climax.is-lit .xm-climax-bg.is-lit { --wave: 118%; }
.xm-climax-wave { position: absolute; z-index: 2; left: 50%; top: 86%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255,246,210,.95), rgba(255,190,90,.5) 40%, rgba(255,160,60,0) 70%); mix-blend-mode: screen; }
.xm-climax.is-lit .xm-climax-wave { animation: xm-wave 2.2s cubic-bezier(.45,0,.25,1) forwards; }
@keyframes xm-wave { 0% { opacity: .9; scale: 1; } 50% { opacity: .35; } 100% { opacity: 0; scale: 40; } }
/* the letterbox: two black bars slide in, and out again at the end */
.xm-climax-bar { position: absolute; z-index: 9; left: 0; right: 0; height: 8%; background: #000; transition: transform .8s cubic-bezier(.3,0,.2,1); }
.xm-climax-bar.is-top { top: 0; transform: translateY(-100%); }
.xm-climax-bar.is-bottom { bottom: 0; transform: translateY(100%); }
.xm-climax.is-in .xm-climax-bar { transform: none; }
.xm-climax.is-done .xm-climax-bar { transform: translateY(-100%); }
.xm-climax.is-done .xm-climax-bar.is-bottom { transform: translateY(100%); }
.xm-climax-cast { position: absolute; z-index: 4; left: 0; right: 0; bottom: 9%; display: flex; justify-content: center; align-items: flex-end;
  opacity: 0; transform: translateY(60px) scale(.85); transition: opacity .7s, transform 1s cubic-bezier(.3,1.3,.5,1); }
.xm-climax.is-cast .xm-climax-cast { opacity: 1; transform: none; }
.xm-climax-pair { width: min(76%, 340px); height: auto; filter: drop-shadow(0 0 22px rgba(255,200,110,.7)); }
.xm-climax-mouse { width: min(19%, 88px); height: auto; margin-left: -6%; animation: none; }
.xm-climax-greeting { position: absolute; z-index: 10; left: 5%; right: 5%; top: 13%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .3s; }
.xm-climax.is-greet .xm-climax-greeting { opacity: 1; }

/* ── the Diwali wish, a film's title card (the climax, the creator's sky): gold letters rising word by word, the name on
   its own line in glowing pink-gold, ornament lines with a lit diya, a light sweep, a signature with a gold flourish ── */
.xm-wish { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; isolation: isolate; }
.xm-wish::before { content: ''; position: absolute; z-index: -1; inset: -16% -10% -10%; border-radius: 50%; opacity: 0; transition: opacity .9s;
  background: radial-gradient(ellipse at 50% 50%, rgba(16,6,38,.68) 0%, rgba(16,6,38,.42) 42%, rgba(16,6,38,0) 72%); }   /* reads over any burst */
.xm-wish.is-on::before { opacity: 1; }
.xm-wish-lines { display: flex; flex-direction: column; align-items: center; }
.xm-wish-line { display: flex; flex-wrap: wrap; justify-content: center; column-gap: .22em; font: 800 clamp(30px, 9.6vw, 48px)/1.04 var(--title); letter-spacing: .005em; }
.xm-wish-line.is-name { font-size: clamp(40px, 13vw, 64px); line-height: 1.02; margin: .04em 0; }
.xm-wish.is-long .xm-wish-line { font-size: clamp(22px, 7vw, 34px); line-height: 1.1; }
.xm-wish.is-long .xm-wish-line.is-name { font-size: clamp(30px, 9.4vw, 46px); }
.xm-wish-w { display: inline-block; padding: 0 .02em;
  background: linear-gradient(100deg, #E9A21C 0%, #FFE38A 26%, #FFFBEA 44%, #FFE38A 56%, #F2AE24 78%, #C46F08 100%) 100% 0 / 280% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #6A3105) drop-shadow(0 0 1px #6A3105) drop-shadow(0 0 12px rgba(255,184,70,.8));
  opacity: 0; transform: translateY(.5em) scale(.72); transition: opacity .45s, transform .75s cubic-bezier(.2,1.55,.4,1); transition-delay: calc(var(--i) * 110ms); }
.xm-wish-line.is-name .xm-wish-w {
  background-image: linear-gradient(100deg, #E8357C 0%, #FF9CC6 26%, #FFF3F8 44%, #FF9CC6 56%, #F0468A 78%, #B8175A 100%);
  filter: drop-shadow(0 2px 0 #560A28) drop-shadow(0 0 1px #560A28) drop-shadow(0 0 16px rgba(255,92,160,.75)) drop-shadow(0 0 30px rgba(255,200,90,.45));
  transform: translateY(.15em) scale(1.7); }
.xm-wish-w.is-emoji { background: none; color: initial; -webkit-background-clip: border-box; background-clip: border-box; filter: drop-shadow(0 0 10px rgba(255,190,80,.9)); }
.xm-wish.is-on .xm-wish-w { opacity: 1; transform: none; animation: xm-wish-sweep 3.6s ease-in-out calc(var(--n) * 110ms + 700ms) infinite; }
/* the creator's sky title stays up behind the share panel: three sweeps, then still (a gold sweep repaints the words
   every frame); a low-end phone keeps the crowd of small diyas' flames still too */
.xm-sky-greeting .xm-wish.is-on .xm-wish-w { animation-iteration-count: 3; }
.xm-lite .xm-wish.is-on .xm-wish-w { animation-iteration-count: 1; }
.xm-lite .xm-diya.is-back .xm-diya-flame i, .xm-lite .xm-diya.is-crowd .xm-diya-flame i, .xm-lite .xm-diya.is-ledge .xm-diya-flame i { animation: none; }
.xm-lite .xm-diya.is-ledge .xm-diya-glow, .xm-lite .xm-diya.is-crowd .xm-diya-glow { animation: none; }
.xm-wish.is-on .xm-wish-w.is-emoji { animation: none; }
@keyframes xm-wish-sweep { 0% { background-position: 100% 0; } 45%, 100% { background-position: 0 0; } }
/* the ornament lines: gold rules opening out from a little lit diya (above) and a gem (below) */
.xm-wish-orn { display: flex; align-items: center; justify-content: center; width: min(78%, 300px); height: 34px; opacity: 0; transform: scaleX(.15);
  transition: opacity .6s, transform 1s cubic-bezier(.3,1.2,.4,1); }
.xm-wish-orn::before, .xm-wish-orn::after { content: ''; flex: 1; height: 2px; border-radius: 2px; box-shadow: 0 0 8px rgba(255,200,80,.85);
  background: linear-gradient(90deg, rgba(255,211,77,0), #FFC83D 60%, #FFF3B0); }
.xm-wish-orn::after { background: linear-gradient(270deg, rgba(255,211,77,0), #FFC83D 60%, #FFF3B0); }
.xm-wish-orn.is-low { height: 16px; width: min(56%, 220px); margin-top: 4px; transition-delay: calc(var(--n) * 110ms + 200ms); }
.xm-wish.is-on .xm-wish-orn { opacity: 1; transform: none; }
.xm-wish-lamp { position: relative; flex: none; width: 40px; height: 34px; margin: 0 8px; }
.xm-wish-bowl { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; }
.xm-wish-flame { position: absolute; left: 50%; bottom: 46%; width: 15px; height: auto; margin-left: -7.5px; transform-origin: 50% 100%;
  animation: xm-flame .5s ease-in-out infinite alternate; filter: drop-shadow(0 0 8px rgba(255,190,90,.95)); }
.xm-wish-gem { flex: none; width: 9px; height: 9px; margin: 0 8px; rotate: 45deg; background: linear-gradient(135deg, #FFF3B0, #F2AE1A); box-shadow: 0 0 10px rgba(255,200,80,.9); }
/* signed by hand, a gold flourish drawn under the name */
.xm-wish-from { position: relative; margin-top: 6px; padding-bottom: 12px; font: 700 clamp(20px, 6.2vw, 28px)/1.15 var(--hand); color: #FFF6E2;
  text-shadow: 0 0 10px rgba(255,190,90,.75), 0 2px 6px rgba(0,0,0,.65); opacity: 0; transform: translateY(8px);
  transition: opacity .7s, transform .7s; transition-delay: calc(var(--n) * 110ms + 500ms); }
.xm-wish.is-on .xm-wish-from { opacity: 1; transform: none; }
.xm-wish-swash { position: absolute; left: 50%; bottom: 0; width: 120%; max-width: 170px; height: 14px; translate: -50% 0; overflow: visible; }
.xm-wish-swash path { fill: none; stroke: #FFC83D; stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(255,200,80,.9));
  stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset 1.1s ease-out; transition-delay: calc(var(--n) * 110ms + 900ms); }
.xm-wish.is-on .xm-wish-swash path { stroke-dashoffset: 0; }
/* in the creator's sky: a little smaller, under the title ribbon */
.xm-sky-greeting .xm-wish-line { font-size: clamp(26px, 8.4vw, 40px); }
.xm-sky-greeting .xm-wish-line.is-name { font-size: clamp(34px, 11vw, 54px); }

/* ── questions ─────────────────────────────────────────────────────────────────────────────────────────────── */
.xm-qbox { display: flex; flex-direction: column; gap: 12px; }
.xm-q { font: 800 clamp(18px, 5.2vw, 21px)/1.25 var(--title); text-wrap: balance; }
/* minmax(0, …): a long word (Tamil "நடுத்தரமானவை") can't widen its column off the screen; fitText shrinks it */
.xm-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xm-opts.is-many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xm-opt { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 10px; border: 3px solid #fff; border-radius: 18px; background: #fff; color: var(--ink);
  cursor: pointer; text-align: center; box-shadow: 0 5px 0 #C9BFAF, 0 10px 18px rgba(0,0,0,.2); transition: transform .18s, box-shadow .18s, border-color .2s; }
.xm-opt img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #F1EADF; }
.xm-opts.is-many .xm-opt img { aspect-ratio: 1; }
@media (max-height: 760px) { .xm-opts.is-grid .xm-opt img { aspect-ratio: 16 / 10; } }
.xm-opt-text { font: 800 15px/1.2 'Nunito', sans-serif; overflow-wrap: anywhere; }
.xm-opts.is-many .xm-opt-text, .xm-play .xm-opts.is-many .xm-opt-text { font-size: 13px; }
.xm-opt:active { transform: translateY(3px); box-shadow: 0 2px 0 #C9BFAF; }
.xm-opt.is-picked { transform: translateY(-6px) scale(1.03); border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255,200,61,.75); }
.xm-opt.is-right { border-color: #3FA66B; box-shadow: 0 0 0 4px #3FA66B, 0 0 26px rgba(63,166,107,.8); }
.xm-opt.is-right::after, .xm-opt.is-answer::after, .xm-opt.is-wrong::after { position: absolute; top: -12px; right: -10px; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #fff; color: #fff; font: 800 20px/1 system-ui, sans-serif; box-shadow: 0 3px 8px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center; box-sizing: border-box; }   /* the mark dead centre in its circle */
.xm-opt.is-right::after, .xm-opt.is-answer::after { content: '✓'; background: #3FA66B; }
.xm-opt.is-wrong { border-color: #E8423F; box-shadow: 0 0 0 4px #E8423F; animation: xm-shake .4s; transform: none; }
.xm-opt.is-wrong::after { content: '✗'; background: #E8423F; }
.xm-opt.is-answer { border-color: #3FA66B; animation: xm-answer .9s ease-in-out 2; }
@keyframes xm-answer { 50% { box-shadow: 0 0 0 4px #3FA66B, 0 0 30px rgba(63,166,107,.9); } }
.xm-saving { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }

/* ── the creator's Diwali, the board ───────────────────────────────────────────────────────────────────────── */
.xm-board-heading { margin-top: 12px; }
.xm-board { display: flex; flex-direction: column; gap: 8px; }
.xm-empty { padding: 8px 12px; }
.xm-row-friend { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 8px 10px; border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.xm-row-friend.is-you { box-shadow: 0 0 0 3px var(--gold), 0 4px 0 rgba(0,0,0,.18); }
.xm-rank { flex: none; width: 24px; text-align: center; font: 800 16px/1 var(--title); color: var(--muted); }
/* a small lit diya, as on the steps */
.xm-mini-diya { position: relative; flex: none; width: 32px; height: 30px; background: url('../img/dw-prop-diya-1x.webp') 50% 100% / 100% auto no-repeat; }
/* its painted flame on the wick (the bowl, 22.5 px tall, sits at the bottom: the wick's tip 8.4 px down) */
.xm-mini-diya::before { content: ''; position: absolute; left: 50%; top: -8px; width: 8px; height: 17px; margin-left: -4px;
  background: url('../img/dw-prop-flame-1x.webp') 50% 100% / contain no-repeat; filter: drop-shadow(0 0 2px rgba(255,190,80,.9));
  animation: xm-flame 1.1s ease-in-out infinite alternate; transform-origin: 50% 95%; }
.xm-mini-diya.is-unlit::before { display: none; }
.xm-mini-diya.is-gold { filter: sepia(.6) saturate(2.4) brightness(1.2); }
.xm-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xm-row-main strong { font: 800 17px/1.3 var(--title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xm-zone { align-self: flex-start; padding: 3px 8px; border-radius: 99px; font: 800 12px/1.1 'Nunito', sans-serif; color: #fff; background: #8D7A6B; white-space: nowrap; }
.xm-row-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xm-row-meta .xm-score { font-size: 15px; }
.xm-row-friend.is-tap { cursor: pointer; transition: transform .12s; }
.xm-row-friend.is-tap:active { transform: scale(.98); }
.xm-row-go { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #FFE7A0;
  color: var(--ink); font: 800 22px/1 var(--title); }
@media (max-width: 374px) {
  .xm-row-friend { padding: 8px 6px 8px 8px; gap: 6px; }
  .xm-rank { width: 16px; font-size: 14px; }
  .xm-mini-diya { width: 26px; height: 26px; }
  .xm-row-go { width: 26px; height: 26px; font-size: 19px; }
  .xm-row-remove { width: 24px; }
}
.xm-zone.is-top { background: #C98A12; } .xm-zone.is-front { background: var(--magenta); } .xm-zone.is-bottom { background: var(--teal); }
.xm-zone.is-hook { background: #A3154F; }
.xm-score { flex: none; font: 800 17px/1 var(--title); color: var(--red-d); }
.xm-row-remove { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font: 800 22px/1 var(--title); cursor: pointer; }
.xm-row-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; font-weight: 800;
  background: #FFF1D6; border: 2px solid #F1D9AE; color: var(--ink); box-shadow: 0 3px 0 #EEDCBC; }
.xm-row-confirm span { flex: 1 1 100%; }
.xm-row { display: flex; gap: 10px; }
.xm-row > .xm-btn { flex: 1; font-size: 18px; min-height: 52px; }
.xm-delete { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.xm-delete .xm-link, .xm-play .xm-delete .xm-link { color: #8A7466; font-size: 14px; }
.xm-delete .xm-row { align-self: stretch; }
.xm-delete .xm-row > .xm-btn { flex: 1 1 0; min-width: 0; padding-inline: 10px; font-size: 16px; }

/* the answers sheet (the creator only), the language drawer */
.xm-sheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(16,10,36,.6); }
.xm-sheet-panel { width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
  background: var(--paper); color: var(--ink); }
.xm-sheet-panel::before { content: ''; display: block; width: 44px; height: 5px; margin: -6px auto 12px; border-radius: 3px; background: #DCCFB8; }
.xm-sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.xm-sheet-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.xm-sheet-head .xm-h2 { font-size: clamp(19px, 5.6vw, 24px); overflow-wrap: anywhere; }
.xm-sheet-head .xm-name { white-space: normal; }
.xm-sheet .xm-name { color: var(--red-d); }
.xm-sheet-close { flex: none; align-self: flex-start; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #EFE6D6; color: var(--ink); font: 800 24px/1 var(--title); cursor: pointer; }
.xm-langfield { display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; margin: 0; padding: 0 6px 0 14px; border-radius: 18px;
  background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 rgba(35,34,43,.3); color: var(--ink); cursor: pointer; text-align: start;
  font: 800 17px/1.1 var(--title); -webkit-tap-highlight-color: transparent; }
.xm-langfield:active { translate: 0 2px; box-shadow: 0 1px 0 rgba(35,34,43,.3); }
.xm-langfield:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.xm-langfield-globe { flex: none; font-size: 22px; line-height: 1; }
/* a line tall enough for नेपाली and தமிழ் (the ellipsis needs the clipping box) */
.xm-langfield b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.6; padding-top: 1px; }
.xm-langfield-arrow { flex: none; position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--red); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.xm-langfield-arrow::after { content: ''; position: absolute; left: 50%; top: 44%; width: 9px; height: 9px; border: solid #fff; border-width: 0 3px 3px 0; border-radius: 1px;
  translate: -50% -50%; rotate: 45deg; }
.xm-sheet-panel.is-langs .xm-sheet-head { align-items: center; }
.xm-langlist { display: flex; flex-direction: column; }
.xm-langlist a { display: block; padding: 13px 12px; border-bottom: 1px solid #EFE6D6; border-radius: 12px; text-align: center; text-decoration: none; color: var(--ink);
  font: 800 18px/1.25 var(--title); }
.xm-langlist a:last-child { border-bottom: 0; }
.xm-langlist a:active, .xm-langlist a:focus-visible { background: #F4EEE3; outline: none; }
.xm-langlist a.is-now { background: #FFE1EC; color: var(--red-d); }
.xm-langlist a.is-now::after { content: ' ✓'; }
.xm-answers { display: flex; flex-direction: column; gap: 14px; }
.xm-answer { padding: 12px 12px 14px; border-radius: 20px; background: #fff; border: 2px solid #F1E2C8; box-shadow: 0 4px 0 #EEDCBC, 0 8px 16px rgba(120,80,30,.1);
  display: flex; flex-direction: column; gap: 12px; }
.xm-answer-q { display: flex; align-items: flex-start; gap: 9px; font: 800 16px/1.25 var(--title); }
.xm-answer-q > span:last-child { min-width: 0; padding-top: 2px; }
.xm-answer-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--ink); text-align: center; font: 800 14px/26px var(--title);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.xm-answer-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.xm-pick { position: relative; margin: 0; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.xm-pick-pic { aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #F4EEE3; border: 3px solid #fff;
  box-shadow: 0 0 0 2.5px var(--pick), 0 5px 12px rgba(120,80,30,.16); }
.xm-pick-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xm-pick.is-right { --pick: #3FA66B; } .xm-pick.is-wrong { --pick: #E8423F; }
.xm-pick.is-wrong .xm-pick-pic img { filter: saturate(.75); }
.xm-pick-mark { position: absolute; top: -8px; inset-inline-end: -8px; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #fff; background: var(--pick);
  color: #fff; font: 800 16px/1 system-ui, sans-serif; box-shadow: 0 3px 8px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.xm-pick figcaption { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.xm-pick-text { font-weight: 800; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.xm-answer-who { max-width: 100%; padding: 3px 9px; border-radius: 99px; background: #F4EEE3; font-size: 12px; font-weight: 800; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.xm-pick.is-right .xm-answer-who { background: #E3F4EA; color: #23704A; }
.xm-answer.is-right { border-color: #BFE5CD; background: linear-gradient(180deg, #fff 60%, #F1FAF4); }
.xm-match { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; align-self: center; }
.xm-match-who { display: flex; flex-wrap: wrap; gap: 5px; }
.xm-match .xm-answer-who { background: #E3F4EA; color: #23704A; }
.xm-match .xm-pick-text { font-size: 15px; }
.xm-dots.xm-center { justify-content: center; padding: 14px 0; }

/* ── 2.1 the invitation: a Diwali card tied with a mithai-box ribbon ──────────────────────────────────────── */
.xm-hero.is-invite { height: auto; min-height: 0; padding: calc(64px + env(safe-area-inset-top)) 14px 34px; }
.xm-hero.is-invite .xm-envelope { position: relative; z-index: 3; }
.xm-hero.is-invite .xm-hero-glow { top: 38%; }
.is-invite .xm-play .xm-ballrow { margin-top: -40px; position: relative; z-index: 3; }
.is-invite .xm-play .xm-label { color: var(--ink); }
.xm-envelope { position: relative; padding: 0 12px 74px; overflow: hidden; border-radius: 0 0 18px 18px; }
.xm-envelope-back { position: absolute; left: 0; right: 0; bottom: 0; height: 130px; border-radius: 14px; background: linear-gradient(#B81A55, #8A1240); border: 3px solid #3B2A26; }
.xm-envelope-front { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 92px; border-radius: 0 0 14px 14px; background: linear-gradient(#F0508C, #D6246E);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); border: 3px solid #3B2A26; }
/* the gold ribbon across the box and its bow (the seal) */
.xm-envelope-front::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; margin-left: -9px; background: linear-gradient(90deg, #C98A12, #FFE07A, #C98A12); }
.xm-envelope-seal { position: absolute; z-index: 3; left: 50%; bottom: 30px; width: 50px; height: 50px; margin-left: -25px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE7A0, #C98A12); border: 3px solid #3B2A26; transition: transform .4s cubic-bezier(.5,-0.6,.7,1), opacity .4s; }
.xm-envelope-seal::after { content: '🪔'; position: absolute; inset: 0; font-size: 22px; line-height: 44px; text-align: center; }
.xm-xcard { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 14px 18px; border-radius: 18px;
  background: var(--paper); color: var(--ink); border: 3px solid var(--gold); box-shadow: 0 8px 20px rgba(0,0,0,.25); transition: transform .9s cubic-bezier(.2,1.1,.3,1); }
.xm-xcard .xm-h2 { font-size: 24px; }
.xm-xcard .xm-name { color: var(--red-d); }
.xm-envelope.is-sealed .xm-xcard { transform: translateY(72%); }
.xm-envelope.is-open .xm-envelope-seal { transform: scale(0) rotate(120deg); opacity: 0; }
.xm-polaroid { padding: 8px 8px 0; background: #fff; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.25); rotate: -3deg; text-align: center; }
.xm-polaroid-pic { position: relative; width: 190px; height: 128px; overflow: hidden; border-radius: 3px; background: #2E1F5E; }
.xm-polaroid-pic .xm-room-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
.xm-polaroid-host { position: absolute !important; right: 8px; bottom: 0; }
.xm-polaroid-name { display: block; padding: 6px 4px 8px; font: 800 17px/1 var(--hand); color: var(--ink); }
.xm-sticker { padding: 7px 14px; border-radius: 12px; background: var(--gold); color: var(--ink); font: 800 15px/1.25 'Nunito', sans-serif; text-align: center;
  rotate: 2deg; border: 2.5px solid var(--outline); box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.xm-proof { margin: 8px 0 0; font: 800 14px/1.3 'Nunito', sans-serif; color: var(--ink); text-align: center; text-wrap: balance; }
.xm-proof-line { display: block; }

/* ── the result's badges and buttons ───────────────────────────────────────────────────────────────────────── */
.xm-endcard-score { margin: 0; font: 800 18px/1.35 'Nunito', sans-serif; text-align: center; }
.xm-perfect { padding: 6px 14px; border-radius: 99px; background: var(--gold); color: var(--ink); font: 800 16px/1 var(--title); box-shadow: 0 0 18px rgba(255,200,61,.8); }
.xm-perfect.is-hook { background: var(--red); color: #fff; box-shadow: 0 0 18px rgba(214,36,110,.55); }
.xm-comeback { margin: 4px 0 -4px; font: 800 16px/1.3 'Nunito', sans-serif; color: var(--ink); text-align: center; text-wrap: balance; }
.xm-actions { display: flex; flex-direction: column; gap: 12px; }
.xm-actions > .xm-btn.is-ghost { margin-top: 2px; }

/* ── a Diwali switched off: the Mouse by a dark door ─────────────────────────────────────────────────────── */
.xm-closed-scene { position: relative; height: clamp(260px, 46vh, 360px); margin-top: 20px; overflow: hidden; border-radius: 18px; container-type: inline-size; }
.xm-closed-steps { position: absolute; left: 0; top: 0; width: 100%; height: auto; aspect-ratio: 320 / 573; filter: brightness(.5) saturate(.6); }
.xm-closed-mouse { position: absolute; z-index: 2; right: 8%; bottom: 0; width: 88px; animation: none; }
.is-closed .xm-btn { font-size: clamp(15px, 4.8vw, 19px); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .xm-layer, .xm-diya, .xm-dog { transition: none; }
  .xm-diya-flame i, .xm-mini-diya::before, .xm-hero-diya, .xm-diya.is-landed .xm-diya-body, .xm-diya.is-landed .xm-diya-flame { animation: none !important; }
  .is-on .xm-glow, .is-star .xm-star-glow { animation: none; }
  .xm-diya.is-you.is-spot .xm-diya-glow { animation: none; opacity: 1; }
  .xm-climax-bg, .xm-climax-bg.is-lit, .xm-climax-bar, .xm-wish-w, .xm-wish-orn, .xm-wish-from, .xm-wish-swash path { transition: none; }
  .xm-wish-w, .xm-wish-flame { animation: none !important; }
  .xm-climax-wave { display: none; }
  .xm-steps-lit { transition: none; }
  .xm-steps-lit.is-flicker { animation: none; }
  .xm-step-flare { display: none; }
}

/* the moving poster: the clip fades in over the still once it plays */
.xm-hero-film { opacity: 0; transition: opacity .8s; }
.xm-hero-poster.is-playing .xm-hero-film { opacity: 1; }
