/* The magnet snap in the kiss scene (js/magnetsnap.js; 2026-11-15, the owner — the kiss meter's idea with two open
   magnets in place of the split heart). NOTHING here is yellow and nothing fills up: the magnets lean at each other
   across a field of pink arcs, every tap is a heartbeat that yanks them closer and throws hearts out of the gap,
   the nearer they come the harder they tremble, and at 100 % they SLAM together into one closed ring with a white
   shockwave before the whole thing fades.
   The two magnets are ONE small SVG drawn in js/magnetsnap.js (no picture at all): each pole ends in HALF of an
   EMPTY heart, and the right magnet is the same drawing mirrored — so the halves close into two whole hollow hearts
   when the pair snaps (the owner, 2026-11-15: «يجب ان يكون القلب فارغا و ليس نصف قلب ممتلئ»).
   The size is driven by the phone's own width (the owner, 2026-11-15: it was far too small on a phone).
   Every rule is scoped to .ms-stage / .ms-box / .sk-ms / .kiss-scene.ms-on — the scene's own layout never moves. */

/* the split heart steps aside while the magnets are up (the same slot, so nothing jumps) */
.kiss-scene.ms-on .kheart { display: none; }

.ms-stage { position: relative; margin-top: calc(4 * var(--u)); pointer-events: none;
  --ms-gap: 1;            /* 1: wide open  →  0: stuck together */
  --ms-p: 0;              /* 0 → 1: how far along the meter is (the field's strength) */
  --ms-beat: 1150ms;      /* the heartbeat, faster the closer they come */
  --ms-w: min(86vw, calc(250 * var(--u)));
  --ms-m: calc(var(--ms-w) * .38);   /* one magnet */
  --ms-t: calc(var(--ms-w) * .12);   /* how far out each one starts */
  width: var(--ms-w); height: calc(var(--ms-m) * .92); }
.ms-stage.mine { pointer-events: auto; cursor: pointer; touch-action: manipulation; }

/* ── the two magnets ── */
.ms-stage .ms-mag { position: absolute; top: 50%; left: 50%; width: var(--ms-m); height: calc(var(--ms-m) * 1.154);
  filter: drop-shadow(0 calc(2 * var(--u)) calc(5 * var(--u)) rgba(90, 0, 45, .55));
  transition: translate .3s cubic-bezier(.25, 1.4, .45, 1);
  animation: msBeat var(--ms-beat) ease-in-out infinite; }
/* the position is `translate` and the beat/tremble is `transform`, so the two never fight each other */
.ms-stage .ms-mag svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ms-stage .ms-l { margin: calc(var(--ms-m) * -.577) 0 0 calc(var(--ms-m) * -1); translate: calc(var(--ms-gap) * var(--ms-t) * -1) 0; }
.ms-stage .ms-r { margin: calc(var(--ms-m) * -.577) 0 0 0; translate: calc(var(--ms-gap) * var(--ms-t)) 0; scale: -1 1; }
@keyframes msBeat { 0%, 100% { transform: scale(1); filter: drop-shadow(0 calc(2 * var(--u)) calc(5 * var(--u)) rgba(90, 0, 45, .55)); }
  40% { transform: scale(1.045); filter: drop-shadow(0 0 calc(10 * var(--u)) rgba(255, 85, 160, .95)); } }

/* a tap: both are yanked inward for a moment */
.ms-stage.hit .ms-mag { animation: msYank .22s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes msYank { 45% { transform: scale(1.1); } }

/* the last stretch: they tremble, unable to resist */
.ms-stage.near .ms-mag { animation: msBeat var(--ms-beat) ease-in-out infinite, msShiver .07s linear infinite alternate; }
@keyframes msShiver { from { margin-top: calc(var(--ms-m) / -2 - 1px); } to { margin-top: calc(var(--ms-m) / -2 + 1px); } }

/* ── the field between the open poles: arcs that thicken as the meter climbs ── */
.ms-stage .ms-field { position: absolute; top: 50%; left: 50%; width: calc(var(--ms-t) * 2 + var(--ms-m) * .3); height: calc(var(--ms-m) * .8);
  transform: translate(-50%, -50%); pointer-events: none; opacity: calc(.25 + var(--ms-p) * .75); }
.ms-stage .ms-field svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ms-stage .ms-field path { fill: none; stroke: rgba(255, 130, 185, .95); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 5 9;
  filter: drop-shadow(0 0 3px rgba(255, 70, 150, .9)); animation: msFlow 1s linear infinite; }
@keyframes msFlow { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }
.ms-stage.hit .ms-field path { stroke: #fff; stroke-width: 3; animation-duration: .25s; }
.ms-stage.snapped .ms-field { opacity: 0; transition: opacity .3s; }

/* ── they met: one closed ring, glowing pink (never yellow) ── */
.ms-stage.snapped .ms-mag { animation: msStuck .55s ease-in-out infinite alternate; }
@keyframes msStuck { from { filter: drop-shadow(0 0 calc(7 * var(--u)) rgba(255, 70, 150, .9)) brightness(1.04); }
  to { filter: drop-shadow(0 0 calc(18 * var(--u)) rgba(255, 70, 150, 1)) drop-shadow(0 0 calc(6 * var(--u)) #fff) brightness(1.15); } }
.ms-stage.gone { animation: msGone .7s ease-in forwards; }
@keyframes msGone { to { opacity: 0; transform: scale(.74); } }

/* ── the pulses, the shockwave and the hearts ── */
.ms-stage .ms-fx { position: absolute; inset: 0; pointer-events: none; overflow: visible; display: block; }
.ms-fx .ms-ring { position: absolute; top: 50%; left: 50%; width: calc(var(--ms-m) * .3); height: calc(var(--ms-m) * .3);
  margin: calc(var(--ms-m) * -.15) 0 0 calc(var(--ms-m) * -.15);
  border-radius: 50%; border: 2px solid rgba(255, 115, 175, .95); box-shadow: 0 0 10px rgba(255, 70, 150, .8);
  animation: msRing .6s ease-out forwards; }
/* a pulse leaves the open pole it belongs to, wherever that pole is just now */
.ms-fx .ms-lr { translate: calc(var(--ms-gap) * var(--ms-t) * -1 - var(--ms-m) * .1) 0; }
.ms-fx .ms-rr { translate: calc(var(--ms-gap) * var(--ms-t) + var(--ms-m) * .1) 0; }
.ms-fx .ms-big { border-color: #fff; border-width: 3px; box-shadow: 0 0 24px rgba(255, 60, 150, 1), inset 0 0 14px rgba(255, 150, 200, .9);
  animation: msRingBig .95s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes msRing { from { transform: scale(.4); opacity: .95; } to { transform: scale(3.2); opacity: 0; } }
@keyframes msRingBig { from { transform: scale(.3); opacity: 1; } to { transform: scale(7); opacity: 0; } }
.ms-fx .ms-heart { position: absolute; bottom: 40%; left: 50%; font-style: normal; line-height: 1; pointer-events: none;
  font-size: calc(var(--ms-m) * .3); --ms-dx: 0px; animation: msHeart .85s ease-out forwards; }
@keyframes msHeart { from { transform: translate(-50%, 0) scale(.5); opacity: 0; }
  22% { opacity: 1; } to { transform: translate(calc(-50% + var(--ms-dx)), calc(var(--ms-m) * -1)) scale(1.3); opacity: 0; } }

/* the words under the magnets */
.ms-box { display: flex; align-items: center; justify-content: center; gap: calc(6 * var(--u)); flex-wrap: wrap; margin-top: calc(2 * var(--u));
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); font-size: max(13px, calc(14 * var(--u))); }
.ms-pct { font-size: max(18px, calc(22 * var(--u))); color: #ff9ec4; }
.ms-label { font-weight: 800; }
.ms-prize { display: inline-flex; }

/* the pair's line in the table chat */
.sk-event.sk-ms { background: linear-gradient(135deg, #fff0f6, #ffd3e6 60%, #ffb3d4); border-color: #ff5ea0; box-shadow: 0 3px 10px rgba(150, 10, 70, .22), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.sk-ms .sk-text b { color: #8d0f46; }
.ms-each { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: #8d0f46; }

@media (prefers-reduced-motion: reduce) {
  .ms-stage .ms-mag, .ms-stage.snapped .ms-mag, .ms-stage.hit .ms-mag, .ms-stage.near .ms-mag, .ms-stage .ms-field path { animation: none; }
}
