#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2100;
}

.fx-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  z-index: 2600;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(var(--fx-p, 0));
  background: linear-gradient(90deg, var(--fx-a), #fff, var(--fx-a));
  box-shadow: 0 0 12px var(--fx-a), 0 0 26px rgba(var(--fx-a-rgb), .7);
}

.fx-companion {
  position: fixed;
  top: 0; left: 0;
  z-index: 1990;
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
  filter: drop-shadow(0 0 10px rgba(var(--fx-a-rgb), .95)) drop-shadow(0 0 26px rgba(var(--fx-a-rgb), .6));
  will-change: transform;
}
.fx-live .fx-companion { opacity: 1; }
.fx-companion svg { width: 100%; height: 100%; overflow: visible; }
.fx-companion .wing-flap { transform-box: fill-box; transform-origin: 100% 60%; animation: fx-flap .22s ease-in-out infinite; }
.fx-companion .wing-flap.left { transform-origin: 0% 60%; }
.fx-companion .star-pulse { transform-box: fill-box; transform-origin: center; animation: fx-twinkle 1s ease-in-out infinite; }
@keyframes fx-flap { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.5); } }

.fx-controls {
  position: fixed;
  right: 1rem; bottom: 1rem;
  z-index: 1900;
  display: flex;
  gap: .55rem;
}
.fx-btn {
  position: relative;
  width: 2.7rem; height: 2.7rem;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  color: #fff;
  background: var(--fx-panel);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--fx-line);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, color .25s ease;
}
.fx-btn svg { width: 1.2rem; height: 1.2rem; }
.fx-btn:hover { transform: translateY(-2px); border-color: var(--fx-a); box-shadow: var(--fx-glow); }
.fx-btn[aria-pressed="true"] { color: var(--fx-a-soft); border-color: var(--fx-a); box-shadow: var(--fx-glow); }
.fx-btn .off-line { opacity: 0; transition: opacity .2s ease; }
.fx-btn[aria-pressed="false"] .off-line { opacity: 1; }
.fx-btn .eq { display: none; }
.fx-btn[data-fx-btn="sound"][aria-pressed="true"] .eq { display: block; }
.fx-btn[data-fx-btn="sound"][aria-pressed="true"] .spk { display: none; }
.fx-eq { display: flex; align-items: flex-end; gap: 2px; height: 1rem; }
.fx-eq i { width: 3px; background: currentColor; border-radius: 2px; animation: fx-eq 1s ease-in-out infinite; }
.fx-eq i:nth-child(2) { animation-delay: -.3s; }
.fx-eq i:nth-child(3) { animation-delay: -.6s; }
.fx-eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes fx-eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* ---------- Intro ---------- */
.fx-intro {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(var(--fx-a-rgb), .22), transparent 55%), var(--fx-void);
  animation: fx-intro-out .9s ease 1.7s forwards;
}
.no-intro .fx-intro, .fx-off .fx-intro { display: none; }
.fx-intro__ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 190px; height: 190px;
  margin: -95px 0 0 -95px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, var(--fx-a) 85%, #fff 100%);
  -webkit-mask: radial-gradient(circle, transparent 66%, #000 68%);
  mask: radial-gradient(circle, transparent 66%, #000 68%);
  filter: drop-shadow(0 0 14px var(--fx-a));
  animation: fx-spin 1.1s linear infinite, fx-ring-in .6s ease both;
}
.fx-intro__ring.r2 { width: 250px; height: 250px; margin: -125px 0 0 -125px; opacity: .45; animation-duration: 1.9s, .6s; animation-direction: reverse, normal; }
.fx-intro__name {
  position: relative;
  max-width: 80vw;
  text-align: center;
  font-family: var(--fx-display);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px #fff, 0 0 26px var(--fx-a), 0 0 60px var(--fx-a);
  animation: fx-name-in 1.1s cubic-bezier(.2, .9, .2, 1) .15s both;
}
@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-ring-in { from { opacity: 0; transform: scale(.6); } }
@keyframes fx-name-in { from { opacity: 0; letter-spacing: .5em; filter: blur(10px); } to { opacity: 1; letter-spacing: .06em; filter: blur(0); } }
@keyframes fx-intro-out { to { opacity: 0; visibility: hidden; transform: scale(1.06); } }

.fairy-coupon {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  perspective: 1200px;
}
.fairy-coupon.is-open { display: flex; }
.fairy-coupon__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(var(--fx-a-rgb), .24), rgba(3, 1, 6, .9) 70%);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity .4s ease;
}
.fairy-coupon.is-visible .fairy-coupon__backdrop { opacity: 1; }

.fairy-coupon__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 2.3rem 1.8rem 1.5rem;
  text-align: center;
  color: #fff;
  border-radius: 1.6rem;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(var(--fx-a-rgb), .3), transparent 70%),
    linear-gradient(170deg, #1b0828 0%, #0a030f 60%, #06020a 100%);
  box-shadow: 0 0 0 1px rgba(var(--fx-a-rgb), .55), 0 0 56px rgba(var(--fx-a-rgb), .45), 0 30px 80px rgba(0, 0, 0, .7);
  transform: translateY(26px) scale(.9) rotateX(10deg);
  opacity: 0;
  transition: transform .6s cubic-bezier(.2, 1.25, .3, 1), opacity .4s ease;
  overflow: hidden;
}
.fairy-coupon.is-visible .fairy-coupon__card {
  transform: rotateX(var(--tx2, 0deg)) rotateY(var(--ty2, 0deg));
  opacity: 1;
}
.fairy-coupon.is-tilting .fairy-coupon__card { transition: transform .12s ease-out, opacity .4s ease; }
.fairy-coupon__card::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--fx-ang, 0deg), var(--fx-a), #fff, var(--fx-b), var(--fx-a), #fff, var(--fx-a));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: fx-border-spin 6s linear infinite;
  pointer-events: none;
}
.fairy-coupon__card::after {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  pointer-events: none;
  background: conic-gradient(from 180deg at 50% 0%, transparent 0 30%, rgba(255, 255, 255, .12) 36%, transparent 42% 58%, rgba(255, 255, 255, .1) 64%, transparent 70%);
  animation: fx-ray 9s ease-in-out infinite alternate;
  opacity: .8;
}
@keyframes fx-ray { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }

.fairy-coupon__close {
  position: absolute;
  top: .8rem; right: .8rem;
  z-index: 3;
  width: 2.2rem; height: 2.2rem;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  font-size: 1.1rem; line-height: 1;
  cursor: pointer;
  transition: all .25s ease;
}
.fairy-coupon__close:hover { background: var(--fx-a); box-shadow: var(--fx-glow); transform: rotate(90deg); }

.fairy-coupon__icon {
  position: relative;
  z-index: 1;
  width: 96px; height: 96px;
  margin: 0 auto .5rem;
  filter: drop-shadow(0 0 14px rgba(var(--fx-a-rgb), .9));
  animation: fx-float-sm 3.6s ease-in-out infinite;
}
.fairy-coupon__icon svg { width: 100%; height: 100%; overflow: visible; }
.fairy-coupon__icon .wing-flap { transform-box: fill-box; transform-origin: 100% 60%; animation: fx-flap-slow 1.6s ease-in-out infinite; }
.fairy-coupon__icon .wing-flap.left { transform-origin: 0% 60%; }
.fairy-coupon__icon .star-pulse { transform-box: fill-box; transform-origin: center; animation: fx-twinkle 1.6s ease-in-out infinite; }
@keyframes fx-float-sm { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }

.fairy-coupon__title {
  position: relative;
  z-index: 1;
  margin: 0 0 .5rem;
  font-family: var(--fx-display);
  font-size: 1.6rem; font-weight: 700; line-height: 1.25;
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, .7), 0 0 22px rgba(var(--fx-a-rgb), .9), 0 0 48px rgba(var(--fx-a-rgb), .55);
}
.fairy-coupon__text { position: relative; z-index: 1; margin: 0 auto 1.3rem; max-width: 320px; color: var(--fx-mist); font-size: .96rem; line-height: 1.55; }

.fairy-coupon__ticket {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .85rem .9rem .85rem 1.3rem;
  margin-bottom: .9rem;
  border: 2px dashed rgba(var(--fx-a-rgb), .8);
  border-radius: 1rem;
  background: rgba(var(--fx-a-rgb), .08);
  box-shadow: inset 0 0 22px rgba(var(--fx-a-rgb), .15), 0 0 20px rgba(var(--fx-a-rgb), .25);
}
.fairy-coupon__ticket::before, .fairy-coupon__ticket::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px; height: 16px;
  background: #0a030f;
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 2px rgba(var(--fx-a-rgb), .8);
}
.fairy-coupon__ticket::before { left: -9px; }
.fairy-coupon__ticket::after { right: -9px; }

.fairy-coupon__code {
  display: inline-flex;
  font-family: 'Lexend', ui-monospace, monospace;
  font-size: 1.9rem; font-weight: 600; letter-spacing: .12em;
  color: #fff;
  text-shadow: 0 0 6px #fff, 0 0 18px var(--fx-a), 0 0 36px var(--fx-a);
  user-select: all;
}
.fairy-coupon__code span { display: inline-block; opacity: 0; transform: translateY(14px) scale(.6); filter: blur(6px); }
.fairy-coupon.is-visible .fairy-coupon__code span {
  opacity: 1; transform: none; filter: blur(0);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, 1.4, .4, 1), filter .5s ease;
  transition-delay: calc(.35s + var(--i) * .07s);
}
.fairy-coupon__copy { white-space: nowrap; padding: .5rem 1.2rem; }
.fairy-coupon__copy.is-copied { background: linear-gradient(135deg, #fff, var(--fx-a-soft)); color: #2a0820; }
.fairy-coupon__hint { position: relative; z-index: 1; font-size: .82rem; color: rgba(243, 217, 255, .6); margin-bottom: .5rem; }
.fairy-coupon__skip {
  position: relative; z-index: 1;
  background: none; border: 0; padding: .3rem .6rem;
  color: rgba(243, 217, 255, .55); font-size: .84rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.fairy-coupon__skip:hover { color: #fff; }

.fairy-coupon__sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fairy-coupon__sparkles i {
  position: absolute;
  color: #fff;
  font-style: normal;
  text-shadow: 0 0 8px var(--fx-a), 0 0 18px var(--fx-a);
  animation: fx-twinkle 2.4s ease-in-out infinite;
}
.fairy-coupon__sparkles i:nth-child(1) { left: 8%;  top: 14%; font-size: 14px; }
.fairy-coupon__sparkles i:nth-child(2) { left: 88%; top: 20%; font-size: 18px; animation-delay: -.7s; }
.fairy-coupon__sparkles i:nth-child(3) { left: 14%; top: 70%; font-size: 12px; animation-delay: -1.2s; }
.fairy-coupon__sparkles i:nth-child(4) { left: 92%; top: 66%; font-size: 15px; animation-delay: -1.8s; }
.fairy-coupon__sparkles i:nth-child(5) { left: 50%; top: 4%;  font-size: 11px; animation-delay: -.3s; }
.fairy-coupon__sparkles i:nth-child(6) { left: 72%; top: 92%; font-size: 13px; animation-delay: -1.5s; }

.fairy-coupon-pill {
  position: fixed;
  left: 1rem; bottom: 1rem;
  z-index: 1900;
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem .55rem .8rem;
  color: #fff;
  font-weight: 600; font-size: .86rem; letter-spacing: .06em;
  background: linear-gradient(135deg, var(--fx-a), var(--fx-a-deep));
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(var(--fx-a-rgb), .75), 0 8px 24px rgba(0, 0, 0, .5);
  cursor: pointer;
  animation: fx-pill-bob 3.4s ease-in-out infinite;
}
.fairy-coupon-pill.is-shown { display: inline-flex; }
.fairy-coupon-pill:hover { box-shadow: var(--fx-glow-hi); }
.fairy-coupon-pill .spark { text-shadow: 0 0 8px #fff; }
@keyframes fx-pill-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (max-width: 480px) {
  .fairy-coupon__title { font-size: 1.3rem; }
  .fairy-coupon__code { font-size: 1.5rem; }
  .fairy-coupon__ticket { flex-direction: column; padding: 1rem; }
  .fairy-coupon__copy { width: 100%; }
}


.fx-intro { pointer-events:none; animation:fx-intro-out .65s ease 1s forwards; }
.fx-intro__name {display:grid;justify-items:center;gap:.24rem;color:var(--ink);text-shadow:none}
.fx-intro__name img {width:73px;height:73px;object-fit:contain}
.fx-intro__name small {font:500 .84rem/1.2 var(--bs-font-sans-serif);color:var(--muted)}
.fx-companion img,.fairy-coupon__icon img {width:100%;height:100%;object-fit:contain}
.fx-btn,.fx-btn[aria-pressed="true"] {background:var(--white);color:var(--ink);border-color:var(--line)}
.fairy-coupon__card {color:var(--ink);background:var(--white);max-height:calc(100dvh - 2rem);overflow:auto}
.fairy-coupon__title,.fairy-coupon__code {color:var(--ink);text-shadow:none;text-transform:none}
.fairy-coupon__text,.fairy-coupon__hint,.fairy-coupon__skip,.fairy-coupon__skip:hover {color:var(--muted)}
.fairy-coupon__close,.fairy-coupon__close:hover {color:var(--ink);background:var(--sage)}
.fairy-coupon__ticket {background:var(--sage);box-shadow:none}
.fairy-coupon__ticket::before,.fairy-coupon__ticket::after {background:var(--white)}
.fairy-coupon-pill {animation:none;background:var(--cl-accent);box-shadow:var(--fx-glow)}
.fx-off #fx-canvas,.fx-off .fx-companion,.fx-off .fx-intro {display:none}
.fx-off .fairy-coupon__code span {animation:none!important;opacity:1;transform:none;filter:none}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
  #fx-canvas,.fx-companion,.fx-intro {display:none!important}
  .fairy-coupon__code span {opacity:1;transform:none;filter:none}
}
