/* Imaginora mirror add-ons: Day/Night mode, Black & White mode, sparkles.
   Overlay + backdrop-filter technique: zero layout impact on the app beneath. */
#im-shade{
  position:fixed; inset:0; z-index:60; pointer-events:none;
  opacity:0; transition:opacity .9s ease;
}
html.im-night #im-shade{
  opacity:1;
  background:linear-gradient(180deg, rgba(7,11,38,.36) 0%, rgba(9,13,46,.44) 55%, rgba(6,9,34,.55) 100%);
  backdrop-filter:brightness(.88) saturate(1.12) contrast(1.02);
  -webkit-backdrop-filter:brightness(.88) saturate(1.12) contrast(1.02);
}
html.im-bw #im-shade{
  opacity:1;
  backdrop-filter:grayscale(1);
  -webkit-backdrop-filter:grayscale(1);
}
html.im-night.im-bw #im-shade{
  backdrop-filter:grayscale(1) brightness(.85) contrast(1.03);
  -webkit-backdrop-filter:grayscale(1) brightness(.85) contrast(1.03);
}
#im-stars{
  position:fixed; inset:0; z-index:61; pointer-events:none;
  opacity:0; transition:opacity 1.2s ease; overflow:hidden;
}
html.im-night #im-stars{ opacity:1; }
#im-stars i{
  position:absolute; border-radius:50%;
  background:#ffe9a8;
  box-shadow:0 0 6px 1px rgba(255,233,168,.85);
  animation:im-tw 2.8s ease-in-out infinite;
}
html.im-bw #im-stars i{ background:#fff; box-shadow:0 0 6px 1px rgba(255,255,255,.8); }
@keyframes im-tw{ 0%,100%{ transform:scale(.55); opacity:.35; } 50%{ transform:scale(1.15); opacity:1; } }

#im-toggles{
  position:fixed; right:14px; bottom:86px; z-index:70;
  display:flex; flex-direction:column; gap:8px;
}
@media (min-width:768px){ #im-toggles{ bottom:20px; } }
#im-toggles button{
  width:46px; height:46px; border-radius:999px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,252,245,.92); color:#123c3a;
  border:1px solid rgba(18,60,58,.25);
  box-shadow:0 6px 18px rgba(10,20,40,.22);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  transition:transform .25s ease, background .25s ease, color .25s ease;
}
#im-toggles button:hover{ transform:translateY(-2px) scale(1.05); }
#im-toggles button:focus-visible{ outline:2px solid #e8a33d; outline-offset:2px; }
#im-toggles button svg{ width:22px; height:22px; }
#im-toggles button[aria-pressed="true"]{ background:#123c3a; color:#ffd98a; border-color:#123c3a; }
#im-toggles .im-ic-sun{ display:none; }
html.im-night #im-toggles .im-ic-sun{ display:block; }
html.im-night #im-toggles .im-ic-moon{ display:none; }

.im-sparkle{
  position:absolute; border-radius:50%; pointer-events:none; z-index:5;
  background:radial-gradient(circle, #ffe9a8 0%, rgba(255,217,138,.55) 45%, rgba(255,217,138,0) 72%);
  animation:im-drift 7s ease-in-out infinite;
}
@keyframes im-drift{
  0%,100%{ transform:translateY(0) translateX(0) scale(1); opacity:.95; }
  50%{ transform:translateY(-16px) translateX(7px) scale(1.18); opacity:.55; }
}
@media (prefers-reduced-motion: reduce){
  #im-stars i, .im-sparkle{ animation:none; }
  #im-shade, #im-stars{ transition:none; }
}
