#fridge-effects {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

#fridge-effects > span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#fridge-effects .fridge-miss {
  width: clamp(42px, 3.8vw, 62px);
  aspect-ratio: 1;
}

#fridge-effects .fridge-miss i {
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255, 250, 227, .91);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(18, 34, 29, .71), 0 1px 5px rgba(23, 35, 27, .38);
  opacity: 0;
  animation: fridge-miss-wave 900ms cubic-bezier(.12,.67,.26,1) both;
}

#fridge-effects .fridge-miss i + i {
  inset: 7px;
  border-color: rgba(222, 240, 229, .84);
  animation-duration: 720ms;
  animation-delay: 100ms;
}

@keyframes fridge-miss-wave {
  0% { opacity: .84; transform: scale(.18); }
  32% { opacity: .85; }
  73% { opacity: .45; }
  100% { opacity: 0; transform: scale(1); }
}

#fridge-effects .fridge-clue {
  width: clamp(57px, 4.7vw, 79px);
  aspect-ratio: 1;
  animation: fridge-clue-appear 3.2s ease-in-out both;
}

#fridge-effects .fridge-clue::before,
#fridge-effects .fridge-clue::after,
#fridge-effects .fridge-clue i {
  content: "";
  position: absolute;
  pointer-events: none;
}

#fridge-effects .fridge-clue::before {
  inset: 11% 9% 8%;
  background: radial-gradient(ellipse at center, rgba(23, 50, 43, .34), transparent 69%);
}

#fridge-effects .fridge-clue i {
  inset: 26% 18% 41% 15%;
  border-radius: 50%;
  transform: rotate(-26deg);
  background: radial-gradient(ellipse at 54% 71%, transparent 44%, rgba(223, 247, 238, .8) 58%, rgba(224, 248, 236, .35) 64%, transparent 78%);
  filter: blur(.9px) drop-shadow(0 1px 1px rgba(25, 51, 44, .65));
  mask-image: linear-gradient(100deg, transparent, #000 28%, #000 66%, transparent 96%);
  animation: fridge-clue-drift 3.2s ease-in-out both;
}

#fridge-effects .fridge-clue i + i {
  inset: 44% 22% 27% 29%;
  transform: rotate(144deg);
  background: radial-gradient(ellipse at 54% 72%, transparent 41%, rgba(238, 255, 248, .93) 57%, rgba(201, 232, 222, .42) 64%, transparent 80%);
  animation-name: fridge-clue-return;
}

#fridge-effects .fridge-clue::after {
  left: 45%;
  top: 47%;
  width: 10%;
  height: 6%;
  transform: rotate(-25deg);
  border-radius: 50%;
  background: rgba(235, 255, 247, .94);
  box-shadow: 0 0 5px 2px rgba(218, 248, 237, .63), 0 1px 3px rgba(27, 48, 38, .66);
}

@keyframes fridge-clue-appear {
  0%, 100% { opacity: 0; }
  16% { opacity: .92; }
  42% { opacity: .72; }
  67% { opacity: 1; }
  83% { opacity: .83; }
}

@keyframes fridge-clue-drift {
  from { transform: translate(1px, 5px) rotate(-20deg) scale(.84); }
  60% { transform: translate(-1px, -1px) rotate(-29deg) scale(1.04); }
  to { transform: translate(-2px, -5px) rotate(-34deg) scale(1.12); }
}

@keyframes fridge-clue-return {
  from { transform: translate(-1px, 3px) rotate(144deg) scale(.87); }
  60% { transform: translate(2px, 0) rotate(150deg) scale(1.04); }
  to { transform: translate(4px, -3px) rotate(157deg) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  #fridge-effects .fridge-miss i,
  #fridge-effects .fridge-clue,
  #fridge-effects .fridge-clue i {
    animation: none;
  }

  #fridge-effects .fridge-miss i {
    opacity: .86;
    transform: scale(.7);
  }

  #fridge-effects .fridge-miss i + i {
    transform: scale(.54);
  }
}

/* The first invitation shares the actual probe's hotspot in both photographs. */
.fridge-mark .entry-flag {
  display: none;
}

.fridge-mark.is-entry-target {
  width: 44px;
  height: 44px;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.fridge-mark.is-entry-target > span {
  width: 32px;
  height: 32px;
  color: transparent;
  background: transparent;
  border: 1.5px solid #fff2cc;
  box-shadow: 0 0 0 1px #21382ac9, inset 0 0 0 1px #21382a80;
}

.fridge-mark.is-entry-target > span::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid #fff0bf;
  border-radius: 50%;
  animation: probe-invitation 3.4s ease-out 2 both;
}

.fridge-mark.is-entry-target .entry-flag {
  position: absolute;
  left: calc(50% + 17px);
  bottom: calc(50% + 15px);
  display: block;
  padding: 6px 11px;
  border: 1px solid #ffe9b995;
  border-radius: 99px;
  background: #203b31;
  box-shadow: 0 1px 7px #14241c45;
  color: #fff3d5;
  white-space: nowrap;
  font: 550 13px/1.1 var(--sans);
}

.fridge-mark.is-entry-target .entry-flag::before {
  content: "";
  position: absolute;
  bottom: 3px;
  left: -8px;
  width: 9px;
  height: 1px;
  transform-origin: right center;
  transform: rotate(-38deg);
  background: #fff2cc;
  box-shadow: 0 1px #223a2b90;
}

.fridge-mark.is-entry-target:is(:hover, :focus-visible) .entry-flag {
  background: #fff0c9;
  color: #213a2d;
}

@keyframes probe-invitation {
  0% { transform: scale(.9); opacity: .7; }
  50%, 100% { transform: scale(1.65); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fridge-mark.is-entry-target > span::before { display: none; }
}


/* Match the wide markers on the narrower artwork without shrinking the tap targets. */
@media (max-aspect-ratio: 1/1) {
  #fridge-marks {
    container-type: size;
  }

  .fridge-mark {
    --dot-size: clamp(20px, 5cqw, 27px);
    --radius: calc(var(--dot-size) / 2);
    --target-x: clamp(22px, var(--pin-x), calc(100cqw - 22px));
    --target-y: clamp(22px, var(--pin-y), calc(100cqh - 22px));
    left: var(--target-x);
    top: var(--target-y);
    width: 44px;
    height: 44px;
  }

  .fridge-mark.is-entry-target {
    --dot-size: clamp(23px, 6cqw, 32px);
  }

  .fridge-mark > span {
    position: relative;
    left: calc(clamp(var(--radius), var(--pin-x), 100cqw - var(--radius)) - var(--target-x));
    top: calc(clamp(var(--radius), var(--pin-y), 100cqh - var(--radius)) - var(--target-y));
    font-size: clamp(11px, 2.6cqw, 13px);
  }

  .fridge-mark > span, .fridge-mark.is-entry-target > span {
    width: var(--dot-size);
    height: var(--dot-size);
  }

  .fridge-mark:not(.is-entry-target) > span {
    box-shadow: 0 0 0 1px #21362ea0, 0 1px 3px #22342888;
  }

  .fridge-mark.is-entry-target .entry-flag {
    left: calc(50% + var(--radius) + 2px);
    bottom: calc(50% + var(--radius));
    padding: 5px 8px;
    font-size: clamp(12px, 3cqw, 13px);
  }
}
