/* =========================================================
   Bhavana & Mallanagoud — Wedding Invitation
   ========================================================= */

@font-face {
  font-family: "Candlescript";
  src: url("../assets/fonts/Candlescript.otf") format("opentype");
  font-display: block;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
}

body {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #22130a 0%, #0c0705 58%, #030201 100%);
}

img, video, canvas { -webkit-user-drag: none; user-select: none; }

/* ---------------- the 9:16 stage ---------------- */
#frame {
  position: relative;
  width: min(100vw, calc(100vh * 9 / 16));
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  isolation: isolate;
  font-size: 16px;               /* overwritten from JS: frameWidth / 24 */
  color: #fff;
  --drop: 0 .09em .16em rgba(0, 0, 0, .5);   /* soft drop shadow under all text */
}

/* desktop: a soft golden edge so the portrait card feels like a card, not a web page */
@media (min-aspect-ratio: 10/16) {
  #frame {
    box-shadow:
      0 0 0 1px rgba(214, 172, 86, .16),
      0 30px 90px rgba(0, 0, 0, .75),
      0 0 140px rgba(200, 140, 40, .07);
  }
}

/* ---------------- media layer ---------------- */
#media {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: calc(100vh * 9 / 16);   /* overwritten from JS */
  transform: translateX(-50%);
  z-index: 1;
  --pd: 160px;                   /* date-patch diameter, from JS */
}

#media > img,
#media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

#door { z-index: 1; transition: opacity .5s linear; }
#door.hide { opacity: 0; }

#media > video {
  opacity: 0;
  transition-property: opacity;
  transition-timing-function: linear;
  transition-duration: .4s;
  background: transparent;
}
#media > video.show { opacity: 1; }

/* never show any native video chrome */
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-play-button,
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-overlay-play-button,
video::-webkit-media-controls-timeline,
video::-webkit-media-controls-current-time-display {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
}

/* ---------------- date patch (golden disc on mandala centre) ---------------- */
#datePatch {
  position: absolute;
  left: 50%;
  top: 47.03%;
  width: var(--pd);
  height: var(--pd);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(.55);
  transition: opacity 1s ease, transform 1.4s cubic-bezier(.2, .9, .25, 1.12), visibility 0s linear 1.4s;
}
#datePatch.on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 1s ease, transform 1.4s cubic-bezier(.2, .9, .25, 1.12);
}
#datePatch.out {
  opacity: 0;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1.04);
  transition: opacity .8s ease, transform .8s ease;
}

#datePatch .halo {
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 130, .55) 0%, rgba(255, 196, 90, .28) 46%, rgba(255, 190, 80, 0) 70%);
  animation: haloPulse 3.4s ease-in-out infinite;
}

#datePatch .disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 33% 27%, rgba(255, 255, 242, .95) 0%, rgba(255, 246, 205, .55) 11%, rgba(255, 240, 190, 0) 30%),
    radial-gradient(circle at 50% 50%, #fae392 0%, #f0cb62 26%, #dcaa3e 50%, #c28c27 68%, #a8731b 78%, #e9c56c 87%, #fff2bd 92%, #9c6a16 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 246, 205, .95),
    inset 0 0 0 4px rgba(150, 98, 18, .55),
    inset 0 -9px 18px rgba(110, 64, 4, .45),
    inset 0 9px 16px rgba(255, 255, 236, .55),
    0 0 14px rgba(255, 214, 120, .8),
    0 0 34px rgba(255, 190, 80, .45);
}
#datePatch .sweep {
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 0deg,
    rgba(255, 255, 240, 0) 0deg, rgba(255, 255, 240, .55) 34deg, rgba(255, 255, 240, 0) 68deg,
    rgba(255, 255, 240, 0) 180deg, rgba(255, 255, 240, .32) 214deg, rgba(255, 255, 240, 0) 248deg);
  animation: spin 7s linear infinite;
}
#datePatch .band {
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: -60%;
  width: 34%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .8), rgba(255, 255, 255, 0));
  transform: skewX(-18deg);
  animation: band 3.8s ease-in-out 1.2s infinite;
}
#datePatch .glints b {
  position: absolute;
  width: 18%;
  height: 18%;
  margin: -9% 0 0 -9%;
  background:
    radial-gradient(circle, #fff 0%, rgba(255, 240, 190, .9) 10%, rgba(255, 220, 140, 0) 34%),
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, 0) 100%) center / 100% 2px no-repeat,
    linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, 0) 100%) center / 2px 100% no-repeat;
  opacity: 0;
  animation: glint 3.2s ease-in-out infinite;
}
#datePatch .glints b:nth-child(1) { left: 14%; top: 22%; animation-delay: .4s; }
#datePatch .glints b:nth-child(2) { left: 86%; top: 34%; animation-delay: 1.3s; }
#datePatch .glints b:nth-child(3) { left: 78%; top: 84%; animation-delay: 2.1s; }
#datePatch .glints b:nth-child(4) { left: 20%; top: 80%; animation-delay: 2.8s; }

#datePatch .dtext {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #120a01;
  font-family: "Times New Roman", Times, Tinos, "Liberation Serif", serif;
  -webkit-text-stroke: .022em #120a01;
  text-shadow: 0 1px 0 rgba(255, 248, 214, .7);
  opacity: 0;
  filter: blur(5px);
  transform: scale(.9);
  transition: opacity 1.1s ease .55s, filter 1.1s ease .55s, transform 1.1s ease .55s;
}
#datePatch.on .dtext { opacity: 1; filter: blur(0); transform: none; }
#datePatch .day  { font-size: calc(var(--pd) * .105); letter-spacing: .08em; line-height: 1.1; }
#datePatch .date { font-size: calc(var(--pd) * .148); letter-spacing: .01em; line-height: 1.15; margin-top: .06em; }

/* ---------------- colour overlay ---------------- */
#tint {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.3s ease;
}
#tint.on  { opacity: 1; }
#tint.out { opacity: 0; transition-duration: .95s; }
#tint[data-t="maroon"]  { background: rgba(96, 10, 30, .5); }
#tint[data-t="mustard"] { background: rgba(219, 164, 16, .5); }
#tint[data-t="magenta"] { background: rgba(178, 22, 124, .5); }
#tint[data-t="peach"]   { background: rgba(255, 166, 124, .5); }
#tint[data-t="ivory"]   { background: rgba(236, 214, 158, .5); }
#tint[data-t="pink"]    { background: linear-gradient(165deg, rgba(255, 182, 210, .5) 0%, rgba(255, 246, 250, .5) 48%, rgba(255, 176, 204, .5) 100%); }

/* ---------------- text screens ---------------- */
#screens { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  --shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 2px 12px rgba(0, 0, 0, .35);
}
.screen.on  { opacity: 1; visibility: visible; transition: opacity .5s ease; }
.screen.out {
  opacity: 0;
  visibility: visible;
  transform: translateY(-1.4%) scale(.985);
  filter: blur(3px);
  transition: opacity .9s ease, transform .9s ease, filter .9s ease;
}

.scrim {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 74%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(ellipse at center, var(--scrim, rgba(40, 0, 12, .3)) 0%, transparent 68%);
}

.block {
  position: relative;
  width: 100%;
  padding: 0 4%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* every revealable line: sized to its text so the particle front follows the glyphs */
.ln {
  display: block;
  width: max-content;
  max-width: 100%;
  padding: .1em .5em;
  -webkit-mask-image: linear-gradient(90deg, #000 -40%, transparent 0%);
          mask-image: linear-gradient(90deg, #000 -40%, transparent 0%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}
.ln.done { -webkit-mask-image: none; mask-image: none; }

/* ---------------- type ---------------- */
.serif {
  font-family: "Times New Roman", Times, Tinos, "Liberation Serif", serif;
  font-weight: 400;
  -webkit-text-stroke: .03em currentColor;        /* semi-bold weight on Times */
  color: #fff;
  text-shadow: var(--drop), var(--shadow);
}

.script {
  font-family: "Candlescript", "Times New Roman", serif;
  font-weight: 400;
  -webkit-text-stroke: 0;
  display: inline-block;
  line-height: 1.12;
  padding: .26em .42em .12em;                     /* room for the long swashes */
  white-space: nowrap;
}

.white-script {
  color: #fff;
  text-shadow: var(--drop), var(--shadow), 0 0 18px rgba(255, 236, 190, .35);
}

/* realistic 3D gold with a travelling shine */
.gold {
  color: #e7c05a;
  background-image:
    linear-gradient(105deg, rgba(255, 255, 255, 0) 43%, rgba(255, 255, 255, .92) 50%, rgba(255, 255, 255, 0) 57%),
    linear-gradient(180deg, #fffbe2 0%, #f9e192 17%, #ebc057 33%, #c88f25 48%, #9a6413 55%, #d4a33c 67%, #f6da88 81%, #fff4c6 89%, #b9862a 100%);
  background-size: 300% 100%, 100% 100%;
  background-position: 120% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter:
    drop-shadow(0 1px 0 #8c5f12)
    drop-shadow(0 1.4px 0 #5e3d08)
    drop-shadow(0 3px 5px rgba(0, 0, 0, .55));
  animation: goldShine 5s ease-in-out infinite;
}
.gold.deep {
  background-image:
    linear-gradient(105deg, rgba(255, 255, 255, 0) 43%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0) 57%),
    linear-gradient(180deg, #fff1b5 0%, #eac462 15%, #c98f2a 32%, #8e580d 48%, #6b3f07 55%, #b27a22 67%, #e3b85a 80%, #f8e2a0 89%, #8a5a12 100%);
  filter:
    drop-shadow(0 1px 0 #4a2b03)
    drop-shadow(0 1.6px 0 #351e02)
    drop-shadow(0 0 7px rgba(255, 244, 210, .45))
    drop-shadow(0 3px 6px rgba(40, 18, 0, .5));
}
/* bride & groom names: brighter, more readable gold over the maroon overlay */
#s-couple .name .gold {
  background-image:
    linear-gradient(105deg, rgba(255, 255, 255, 0) 43%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, 0) 57%),
    linear-gradient(180deg, #fffef4 0%, #fff3c2 16%, #ffe27a 32%, #f9cd4a 47%, #eebb38 55%, #fbd660 67%, #fff0a6 80%, #fffbe2 89%, #f0c552 100%);
  filter:
    drop-shadow(0 1px 0 #8a5c0e)
    drop-shadow(0 1.4px 0 #5a3906)
    drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
}
.serif.gold { font-weight: 700; -webkit-text-stroke: 0; }

/* ---------------- layout per element ---------------- */
.name .script     { font-size: 2.9em; }
.ln.name          { padding: 0 .2em; margin: -.12em 0; }
.parents          { font-size: .98em; letter-spacing: .02em; line-height: 1.4; }
.weds {
  display: flex;
  align-items: center;
  gap: .55em;
  font-size: 1.32em;
  font-style: italic;
  letter-spacing: .1em;
  margin: .55em 0 .1em;
}
.weds i {
  display: block;
  width: 2.3em;
  height: 1px;
  background: linear-gradient(90deg, rgba(243, 210, 122, 0), #f3d27a);
}
.weds i:last-child { background: linear-gradient(90deg, #f3d27a, rgba(243, 210, 122, 0)); }
#s-couple .ln.name:first-child { margin-bottom: -.05em; }
#s-couple .parents:last-child  { margin-top: -.05em; }

.title .script    { font-size: 3.7em; }
.ln.title         { padding: 0 .2em; margin: -.15em 0 -.1em; }
.title-caps {
  font-size: 3.3em;
  letter-spacing: .24em;
  padding-left: .74em;                            /* balances the trailing tracking */
  line-height: 1.15;
  -webkit-text-stroke-width: .022em;
}
.info             { font-size: 1.24em; line-height: 1.45; letter-spacing: .02em; }
.info.small       { font-size: 1.08em; }
.info.big         { font-size: 1.62em; }
.info.date-big    { font-size: 1.75em; letter-spacing: .06em; margin-top: .1em; }
.info.msg         { font-size: 1.16em; font-style: italic; }
.info .serif.gold { font-size: 1.32em; letter-spacing: .06em; display: inline-block; padding: .05em .2em; }

/* ornament divider */
.orn {
  display: flex;
  align-items: center;
  gap: .5em;
  margin: .45em 0 .35em;
  padding: .2em .5em;
}
.orn i {
  display: block;
  width: 3.4em;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 232, 175, 0), rgba(255, 232, 175, .95));
}
.orn i:last-child { background: linear-gradient(90deg, rgba(255, 232, 175, .95), rgba(255, 232, 175, 0)); }
.orn b {
  display: block;
  width: .42em;
  height: .42em;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff5cf, #e6b84e 55%, #a8731a);
  box-shadow: 0 0 6px rgba(255, 220, 140, .8);
}

/* ---------------- themes ---------------- */
.theme-couple  { --scrim: rgba(45, 0, 14, .32); }
.theme-haldi   { --scrim: rgba(105, 55, 0, .3);  --shadow: 0 1px 2px rgba(92, 46, 0, .75), 0 2px 12px rgba(92, 46, 0, .5); }
.theme-mehndi  { --scrim: rgba(70, 0, 46, .3);   --shadow: 0 1px 2px rgba(60, 0, 40, .7),  0 2px 12px rgba(60, 0, 40, .45); }
.theme-sangeet { --scrim: rgba(110, 38, 16, .3); --shadow: 0 1px 2px rgba(100, 34, 10, .75), 0 2px 12px rgba(100, 34, 10, .5); }
.theme-baarat  { --scrim: rgba(62, 28, 0, .44); }
.theme-baarat .orn i { background: linear-gradient(90deg, rgba(120, 72, 10, 0), rgba(150, 95, 18, .95)); }
.theme-baarat .orn i:last-child { background: linear-gradient(90deg, rgba(150, 95, 18, .95), rgba(120, 72, 10, 0)); }
.theme-venue   { --scrim: rgba(150, 30, 80, .26); --shadow: 0 1px 2px rgba(140, 26, 76, .75), 0 2px 12px rgba(140, 26, 76, .5); }
.theme-save    { --shadow: 0 1px 0 rgba(255, 255, 255, .7); --drop: 0 .09em .18em rgba(90, 10, 40, .3); }
.theme-save .block { transform: none; }
.theme-save .title .script { font-size: 3.15em; }
.theme-save .serif { color: #6f1532; }
.theme-save .orn i { background: linear-gradient(90deg, rgba(176, 70, 107, 0), rgba(176, 70, 107, .9)); }
.theme-save .orn i:last-child { background: linear-gradient(90deg, rgba(176, 70, 107, .9), rgba(176, 70, 107, 0)); }
.theme-save .orn b { background: linear-gradient(135deg, #ffd1df, #d9668c 55%, #8e2448); box-shadow: 0 0 6px rgba(255, 160, 190, .7); }

/* ---------------- door screen ---------------- */
#s-door { align-items: flex-end; }
#s-door .door-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(28, 10, 2, .5) 0%, rgba(28, 10, 2, .3) 42%, rgba(28, 10, 2, 0) 100%);
}
.door-copy {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: calc(6.5% + env(safe-area-inset-bottom, 0px));
}
.door-copy > * { opacity: 0; }
#s-door.on .door-copy > * { animation: fadeUp 1.1s cubic-bezier(.2, .8, .2, 1) both; }
#s-door.on .door-copy > :nth-child(1) { animation-delay: .25s; }
#s-door.on .door-copy > :nth-child(2) { animation-delay: .45s; }
#s-door.on .door-copy > :nth-child(3) { animation-delay: .7s; }

.knock { position: relative; width: 2.3em; height: 2.3em; margin-bottom: .35em; }
.knock span {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(255, 222, 150, .9);
  border-radius: 50%;
  animation: ripple 2.6s ease-out infinite;
}
.knock span:nth-child(2) { animation-delay: .85s; }
.knock span:nth-child(3) { animation-delay: 1.7s; }
.knock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: .5em;
  height: .5em;
  margin: -.25em 0 0 -.25em;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe39a 45%, rgba(255, 200, 90, 0) 75%);
  box-shadow: 0 0 10px rgba(255, 214, 120, .9);
}
.door-cta {
  font-size: 1.28em;
  letter-spacing: .14em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7), 0 2px 12px rgba(0, 0, 0, .45);
}
#s-door.on .door-cta { animation: fadeUp 1.1s cubic-bezier(.2, .8, .2, 1) .45s both, breathe 2.6s ease-in-out 1.6s infinite; }
.door-title .script { font-size: 2.3em; }

/* ---------------- tap prompt ---------------- */
#hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(5.2% + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .7s ease;
  font-size: 1.06em;
  letter-spacing: .17em;
  --shadow: 0 1px 2px rgba(0, 0, 0, .75), 0 0 14px rgba(0, 0, 0, .45);
}
#hint.on  { opacity: 1; }
#hint.out { opacity: 0; transition-duration: .35s; }
#hint span { display: inline-block; animation: pop 1.9s ease-in-out infinite; }
#hint span::before,
#hint span::after {
  content: "";
  display: inline-block;
  width: .32em;
  height: .32em;
  margin: 0 .75em .16em;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff5cf, #e6b84e 60%, #a8731a);
  vertical-align: middle;
  box-shadow: 0 0 5px rgba(255, 214, 120, .9);
}
#hint.dark { color: #6f1532; --shadow: 0 1px 0 rgba(255, 255, 255, .8), 0 0 10px rgba(255, 255, 255, .55); }
#hint.dark span::before,
#hint.dark span::after { background: linear-gradient(135deg, #ffd1df, #d9668c 55%, #8e2448); box-shadow: none; }

/* ---------------- canvases ---------------- */
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
#fx       { z-index: 4; }
#feathers { z-index: 6; }
#ambient  { z-index: 8; }

/* ---------------- end screen ---------------- */
#blackout {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s ease, visibility 0s linear 1.5s;
}
#blackout.on { opacity: 1; visibility: visible; transition: opacity 1.5s ease; }

/* "Tap to Restart" in the centre; credit at the bottom centre (fades in first) */
#blackout .credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(15% + env(safe-area-inset-bottom, 0px));
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;   /* Helvetica on iPhone/Mac, Arial look-alike elsewhere */
  font-weight: 400;
  -webkit-text-stroke: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35em;
  text-align: center;
  color: #f2d899;
  -webkit-text-stroke-color: #f2d899;
  text-shadow: 0 0 14px rgba(255, 205, 110, .35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
#blackout.on .credit { opacity: 1; transform: none; transition-delay: .6s; }
#blackout .credit .by  { font-size: 1em; font-style: italic; letter-spacing: .12em; opacity: .85; }
#blackout .credit .who { font-size: 1.3em; letter-spacing: .04em; }
#blackout .restart {
  color: #f2d899;
  font-size: 1.36em;
  letter-spacing: .22em;
  padding-left: .22em;
  -webkit-text-stroke-color: #f2d899;
  text-shadow: 0 0 14px rgba(255, 205, 110, .45);
  opacity: 0;
  transition: opacity 1s ease;
}
#blackout.ready .restart { opacity: 1; animation: pop 1.9s ease-in-out infinite; }

/* ---------------- load curtain ---------------- */
#curtain {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: #000;
  pointer-events: none;
  transition: opacity 1.1s ease;
}
#curtain.gone { opacity: 0; }
/* tiny golden diamond, only shows if the first load is slow (mobile data) */
#curtain::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  background: linear-gradient(135deg, #fff5cf, #e6b84e 55%, #a8731a);
  box-shadow: 0 0 14px rgba(255, 210, 120, .75);
  opacity: 0;
  transform: rotate(45deg);
  animation: loaderIn .5s ease .8s forwards, loaderPulse 1.4s ease-in-out .8s infinite;
}
@keyframes loaderIn    { to { opacity: .9; } }
@keyframes loaderPulse {
  0%, 100% { transform: rotate(45deg) scale(.8); }
  50%      { transform: rotate(45deg) scale(1.15); }
}

/* ---------------- sound toggle ---------------- */
#sound {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 10;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 236, 196, .26);
  background: rgba(20, 10, 4, .2);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  outline: none;
  transition: opacity .8s ease;
}
#sound.show { opacity: .55; pointer-events: auto; }
#sound.show:hover { opacity: .85; }
#sound svg { width: 17px; height: 17px; display: block; }
#sound .f { fill: rgba(255, 245, 222, .95); }
#sound .w { fill: none; stroke: rgba(255, 245, 222, .95); stroke-width: 1.6; stroke-linecap: round; }
#sound .ic-off { display: none; }
#sound.muted .ic-on { display: none; }
#sound.muted .ic-off { display: block; }

/* ---------------- keyframes ---------------- */
@keyframes goldShine {
  0%        { background-position: 120% 0, 0 0; }
  55%, 100% { background-position: -20% 0, 0 0; }
}
@keyframes pop {
  0%, 100% { transform: scale(1);    opacity: .8; }
  50%      { transform: scale(1.09); opacity: 1; }
}
@keyframes breathe {
  0%, 100% { opacity: .82; letter-spacing: .14em; }
  50%      { opacity: 1;   letter-spacing: .19em; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none;            filter: blur(0); }
}
@keyframes ripple {
  0%   { transform: scale(.32); opacity: .95; }
  100% { transform: scale(1.65); opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes band {
  0%        { left: -60%; }
  55%, 100% { left: 130%; }
}
@keyframes glint {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  45%      { opacity: 1; transform: scale(1) rotate(45deg); }
}
@keyframes haloPulse {
  0%, 100% { opacity: .75; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}
