/* The magnet on the table (js/magnet.js; 2026-11-14, the owner — Cupid's shape with the magnet: the charger taps two
   players, love pulses travel between them and two magnet halves snap together in the middle; everyone in the bond
   taps the joined magnet to fill it). The magnet itself sits over the bottle in the bow's place (one prop there at a
   time: the whip, Cupid's bow, the magnet, the snowballs) with "Magnet" + its price, «ⓘ» for the odds and "?" for
   how to play. The table's own layout never moves: the bonds are drawn in the effects layer.

   NOTE: the mini-games list (minigames.js) uses mg-body / mg-odds / mg-help as well, so EVERY rule here must be
   scoped to .magnet-prop, .mg-joint or another class of this game's own — an unscoped .mg-body put the magnet
   picture inside that list and broke it (2026-11-14). */

/* ── the magnet beside the bottle ── */
.magnet-prop { position: absolute; left: 50%; bottom: calc(100% - 30 * var(--u)); z-index: 5; width: calc(80 * var(--u)); height: calc(70 * var(--u)); transform: translateX(-50%); pointer-events: none; }
.bottle-wrap:has(.magnet-prop) .rent-name { margin-bottom: calc(26 * var(--u)); }
.magnet-prop .mg-body { position: absolute; inset: 0; background: url("../img/magnet/magnet.webp") center / contain no-repeat; filter: drop-shadow(0 calc(2 * var(--u)) calc(3 * var(--u)) rgba(0, 20, 60, .5)); transform-origin: 50% 80%; }
.magnet-prop.born .mg-body { animation: mgBorn .8s ease-out; }
@keyframes mgBorn { from { transform: scale(.7) rotate(-12deg); } 60% { transform: scale(1.14) rotate(6deg); } to { transform: none; } }
.magnet-prop.lifted .mg-body { animation: mgHum 1.1s ease-in-out infinite alternate; }
@keyframes mgHum { from { filter: drop-shadow(0 calc(2 * var(--u)) calc(3 * var(--u)) rgba(0, 20, 60, .5)); } to { filter: drop-shadow(0 0 calc(10 * var(--u)) rgba(90, 190, 255, .95)) drop-shadow(0 0 calc(4 * var(--u)) #fff); } }

/* the lines of force (one small svg, kept; only the dash flows and the whole thing breathes) */
.magnet-prop .mg-lines, .mg-joint .mg-lines { position: absolute; left: 50%; top: 50%; width: calc(132 * var(--u)); height: calc(132 * var(--u));
  margin: calc(-66 * var(--u)) 0 0 calc(-66 * var(--u)); opacity: 0; pointer-events: none; transition: opacity .35s; }
.magnet-prop .mg-lines svg, .mg-joint .mg-lines svg { width: 100%; height: 100%; overflow: visible; display: block; }
.magnet-prop .mg-lines path, .mg-joint .mg-lines path { fill: none; stroke: rgba(150, 220, 255, .85); stroke-width: .9; stroke-linecap: round; stroke-dasharray: 3 6;
  filter: drop-shadow(0 0 calc(1.5 * var(--u)) rgba(90, 190, 255, .9)); }
.magnet-prop.lifted .mg-lines { opacity: .95; animation: mgBreathe 2.2s ease-in-out infinite alternate; }
.magnet-prop.lifted .mg-lines path { animation: mgFlow 1.1s linear infinite; }
@keyframes mgFlow { from { stroke-dashoffset: 18; } to { stroke-dashoffset: 0; } }
@keyframes mgBreathe { from { transform: scale(.9); } to { transform: scale(1.06); } }

.magnet-prop .sp-take.mg-take { bottom: calc(-17 * var(--u)); background: linear-gradient(180deg, #6fc6ff, #1565c0); border-color: #dff0ff; box-shadow: 0 calc(3 * var(--u)) calc(8 * var(--u)) rgba(0, 30, 80, .5), inset 0 calc(1 * var(--u)) 0 rgba(255, 255, 255, .45); text-shadow: 0 1px 1px rgba(0, 20, 60, .5); }
.magnet-prop .mg-help, .magnet-prop .mg-odds.odds-btn { position: absolute; top: calc(-4 * var(--u)); width: calc(16 * var(--u)); height: calc(16 * var(--u)); padding: 0; pointer-events: auto; cursor: pointer;
  border: 0; border-radius: 50%; background: rgba(10, 40, 80, .82); color: #cfe9ff; font-size: calc(11 * var(--u)); line-height: 1; display: grid; place-items: center; }
.magnet-prop .mg-help { inset-inline-end: calc(-6 * var(--u)); }
.magnet-prop .mg-odds.odds-btn { inset-inline-start: calc(-6 * var(--u)); }

/* ── aiming: the two the charger picks ── */
.ring-box.magnet-aim .seat.mg-target .seat-photo { outline: calc(2.5 * var(--u)) solid #7fd0ff; outline-offset: calc(2 * var(--u)); animation: mgTarget 1s ease-in-out infinite alternate; cursor: pointer; }
@keyframes mgTarget { from { box-shadow: 0 0 calc(4 * var(--u)) rgba(120, 205, 255, .6); } to { box-shadow: 0 0 calc(16 * var(--u)) rgba(120, 205, 255, .95); } }
.ring-box.magnet-aim .seat.mg-first .seat-photo { outline-color: #ffd166; box-shadow: 0 0 calc(16 * var(--u)) #ffd166; }
.mg-aim-hint { pointer-events: auto; }

/* ── the bond between the two: the love pulses in the thread's place ── */
.magnet-bonds { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: visible; }
.mg-bond .mg-beat { animation: mgBeat 1.1s ease-in-out infinite; opacity: .25; }
@keyframes mgBeat { 0%, 100% { opacity: .2; transform: scale(.7); } 45% { opacity: 1; transform: scale(1.35); } }
.mg-bond text { transform-box: fill-box; transform-origin: 50% 50%; }

/* ── the joined magnet in the middle: two halves that snap together, and the meter ── */
.mg-joint { position: absolute; z-index: 7; width: calc(54 * var(--u)); height: calc(54 * var(--u)); margin: calc(-27 * var(--u)) 0 0 calc(-27 * var(--u));
  pointer-events: none; --mg-pct: 0; }
.mg-joint.mine { pointer-events: auto; cursor: pointer; touch-action: manipulation; }
.mg-joint .mg-filings { position: absolute; left: 50%; top: 50%; width: calc(100 * var(--u)); height: calc(100 * var(--u)); margin: calc(-50 * var(--u)) 0 0 calc(-50 * var(--u)); pointer-events: none; }
.mg-joint .mg-lines { opacity: .9; animation: mgBreathe 2.2s ease-in-out infinite alternate; }
.mg-joint .mg-lines path { animation: mgFlow 1.1s linear infinite; }
.mg-joint.hit .mg-lines path { animation-duration: .3s; stroke: #e8f8ff; stroke-width: 1.5; }
/* the meter: how full it is, all around them */
.mg-joint .mg-ring-meter { position: absolute; inset: calc(-5 * var(--u)); border-radius: 50%;
  background: conic-gradient(#ff4d6d 0deg, #ffd24a calc(var(--mg-pct) * 1.8deg), rgba(255, 255, 255, .13) calc(var(--mg-pct) * 3.6deg), rgba(255, 255, 255, .13) 360deg);
  mask: radial-gradient(circle, transparent calc(50% - 4.5 * var(--u)), #000 calc(50% - 4 * var(--u)));
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 4.5 * var(--u)), #000 calc(50% - 4 * var(--u))); }
.mg-joint .mg-pct { position: absolute; left: 50%; bottom: calc(-16 * var(--u)); transform: translateX(-50%); z-index: 2; pointer-events: none;
  padding: 0 calc(5 * var(--u)); border-radius: calc(8 * var(--u)); background: rgba(10, 40, 80, .86); color: #eaf6ff;
  font-size: calc(11 * var(--u)); font-weight: 800; line-height: calc(16 * var(--u)); }
/* the two halves (no picture: the colours are the magnet's own — red north, white south, a steel band) */
.mg-joint .mg-h { position: absolute; top: calc(12 * var(--u)); width: calc(15 * var(--u)); height: calc(30 * var(--u)); z-index: 1;
  box-shadow: 0 calc(2 * var(--u)) calc(4 * var(--u)) rgba(0, 20, 60, .5), inset 0 0 calc(3 * var(--u)) rgba(255, 255, 255, .5); }
.mg-joint .mg-hl { left: calc(12 * var(--u)); border-radius: calc(7 * var(--u)) 0 0 calc(7 * var(--u));
  background: linear-gradient(180deg, #ff6b7f, #c62828 55%, #8e1b1b); transform: translateX(calc(-46 * var(--u))); transition: transform .6s cubic-bezier(.3, 1.6, .4, 1); }
.mg-joint .mg-hr { right: calc(12 * var(--u)); border-radius: 0 calc(7 * var(--u)) calc(7 * var(--u)) 0;
  background: linear-gradient(180deg, #ffffff, #d7e6f5 55%, #9fb5c9); transform: translateX(calc(46 * var(--u))); transition: transform .6s cubic-bezier(.3, 1.6, .4, 1); }
.mg-joint.snapped .mg-h { transform: none; }
.mg-joint.hit { animation: mgJointHit .18s ease-out; }
@keyframes mgJointHit { 50% { transform: scale(1.16); } to { transform: none; } }
.mg-joint.full .mg-h { filter: drop-shadow(0 0 calc(6 * var(--u)) #ffd166) brightness(1.12); }
.mg-joint.full .mg-pct { background: linear-gradient(180deg, #ffd166, #e08900); color: #3a2200; }
.mg-joint.closing { animation: mgJointGo .4s ease-in forwards; }
@keyframes mgJointGo { to { opacity: 0; transform: scale(.6); } }

/* iron filings: tiny needles standing along the field, each shivering in place */
.magnet-prop .mg-fil, .mg-joint .mg-fil { position: absolute; left: 50%; top: 50%; width: calc(var(--w, 7) * var(--u)); height: calc(2 * var(--u)); border-radius: calc(1 * var(--u));
  background: linear-gradient(90deg, rgba(255, 255, 255, .98), rgba(120, 205, 255, .45)); box-shadow: 0 0 calc(3 * var(--u)) rgba(120, 205, 255, .8);
  transform-origin: 0 50%; transform: rotate(var(--a, 0deg)) translateX(calc(var(--r, 30) * var(--u)));
  animation: mgFil 1.3s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes mgFil { from { opacity: .4; transform: rotate(var(--a, 0deg)) translateX(calc(var(--r, 30) * var(--u))) scaleX(.7); }
  to { opacity: 1; transform: rotate(var(--a, 0deg)) translateX(calc((var(--r, 30) - 4) * var(--u))) scaleX(1.2); } }
.mg-joint.hit .mg-fil { animation-duration: .22s; }

/* ── the seats in the field: leaning in, shivering, springing back ── */
.seat.mg-pulled { transform: translate(var(--mg-dx, 0), var(--mg-dy, 0)) rotate(var(--mg-tilt, 0deg)); transition: transform .35s cubic-bezier(.2, 1.3, .4, 1); }
.seat.mg-back { transform: none; transition: transform .5s cubic-bezier(.25, 1.7, .4, 1); }
.seat.mg-pulled .seat-photo { outline: calc(2 * var(--u)) solid rgba(120, 205, 255, .9); outline-offset: calc(2 * var(--u)); box-shadow: 0 0 calc(14 * var(--u)) rgba(90, 190, 255, .8);
  filter: saturate(.8) contrast(1.1) brightness(1.05); animation: mgShiver .09s linear infinite alternate; }
@keyframes mgShiver { from { transform: translate(calc(var(--mg-shake, 1px) * -1), 0); } to { transform: translate(var(--mg-shake, 1px), calc(var(--mg-shake, 1px) * .4)); } }
.seat.mg-stuck .seat-photo { outline-color: #ffd166; box-shadow: 0 0 calc(18 * var(--u)) #ffd166, 0 0 calc(5 * var(--u)) #fff; filter: saturate(1.1) brightness(1.08); }

/* ── a tap's wave, the filings it tears off, the hearts ── */
.mg-wave { position: absolute; z-index: 6; pointer-events: none; border-radius: 50%; transform: translate(-50%, -50%);
  border: calc(2 * var(--u)) solid rgba(130, 210, 255, .95); box-shadow: 0 0 calc(10 * var(--u)) rgba(90, 190, 255, .7); }
.mg-wave2 { border-width: calc(1.2 * var(--u)); border-color: rgba(220, 245, 255, .8); box-shadow: 0 0 calc(6 * var(--u)) rgba(150, 220, 255, .6); }
.mg-spark { position: absolute; z-index: 7; pointer-events: none; height: calc(1.8 * var(--u)); border-radius: calc(1 * var(--u));
  background: linear-gradient(90deg, #fff, rgba(140, 215, 255, .5)); box-shadow: 0 0 calc(4 * var(--u)) rgba(120, 205, 255, .8); }
.mg-pop { position: absolute; z-index: 8; pointer-events: none; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  .magnet-prop .mg-lines, .magnet-prop .mg-lines path, .mg-joint .mg-lines, .mg-joint .mg-lines path,
  .magnet-prop .mg-fil, .mg-joint .mg-fil, .mg-bond .mg-beat, .seat.mg-pulled .seat-photo,
  .ring-box.magnet-aim .seat.mg-target .seat-photo { animation: none; }
  .mg-bond .mg-beat { opacity: .9; }
}

/* the pair's card in the table chat */
.sk-event.sk-magnet { background: linear-gradient(135deg, #eef7ff, #cfe6ff 60%, #a9d2ff); border-color: #4c9ffe; box-shadow: 0 3px 10px rgba(10, 60, 140, .25), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.sk-magnet .sk-text b { color: #0d3f7a; }
.sk-magnet .sk-bag img { width: 32px; height: 32px; display: block; }

/* how to play */
.dialog.magnet-guide { max-width: 360px; text-align: center; background: linear-gradient(180deg, #f3f9ff, #dceeff); border: 2px solid #86c2f5; }
.magnet-guide .cg-bow { width: 84px; height: 84px; object-fit: contain; margin: 0 auto 6px; display: block; }
