/* ---------- classic ---------- */
.fx-classic .msg-text {
  font-size: clamp(2rem, 6vw, 5rem);
  color: var(--text);
  animation: fadeIn 0.8s ease both;
}

/* ---------- star wars crawl ---------- */
.fx-starwars {
  perspective: 400px;
  overflow: hidden;
  background: #000;
}
.fx-starwars::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 80% 40%, #fff, transparent),
    radial-gradient(1px 1px at 30% 70%, #fff, transparent),
    radial-gradient(1px 1px at 60% 85%, #fff, transparent),
    radial-gradient(1px 1px at 90% 15%, #fff, transparent),
    radial-gradient(1px 1px at 45% 55%, #fff, transparent);
  opacity: 0.6;
}
.fx-starwars .msg-text {
  position: absolute;
  bottom: -20%;
  color: var(--accent);
  font-size: clamp(2rem, 7vw, 6rem);
  font-weight: 700;
  transform: rotateX(55deg);
  transform-origin: 50% 100%;
  animation: crawl 30s linear forwards; /* duration overridden inline by JS to match the message's actual duration */
  text-shadow: 0 0 12px rgba(255,204,0,0.4);
}
@keyframes crawl {
  from { bottom: -20%; transform: rotateX(55deg) translateY(0); opacity: 1; }
  to   { bottom: 120%; transform: rotateX(55deg) translateY(-40%); opacity: 0.2; }
}

/* ---------- banner marquee ---------- */
.fx-banner {
  overflow: hidden;
  background: repeating-linear-gradient(45deg, #1a1c24, #1a1c24 12px, #202230 12px, #202230 24px);
}
.fx-banner .msg-text {
  position: absolute;
  white-space: nowrap;
  max-width: none;
  font-size: clamp(2.5rem, 8vw, 6rem);
  color: var(--accent-2);
  font-weight: 700;
  animation: marquee 30s linear infinite; /* duration overridden inline by JS to match the message's actual duration */
}
@keyframes marquee {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-110%); }
}

/* ---------- pulse ---------- */
.fx-pulse .msg-text {
  font-size: clamp(2rem, 6vw, 5rem);
  color: var(--accent);
  animation: pulse-beat 1.6s ease-in-out infinite, pulse-glow 1.6s ease-in-out infinite;
}
@keyframes pulse-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(255,204,0,0.25); }
  50% { text-shadow: 0 0 32px rgba(255,204,0,0.85); }
}

/* ---------- colorshift ---------- */
.fx-colorshift {
  animation: bgshift 6s ease infinite;
  background-size: 300% 300%;
}
.fx-colorshift .msg-text {
  font-size: clamp(2rem, 6vw, 5rem);
  color: #fff;
  text-shadow: 0 2px 18px rgba(0,0,0,0.4);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes bgshift {
  0%   { background: linear-gradient(120deg, #ff4d6d, #ffcc00); }
  33%  { background: linear-gradient(120deg, #4d7cff, #4dffcf); }
  66%  { background: linear-gradient(120deg, #a44dff, #ff4d9e); }
  100% { background: linear-gradient(120deg, #ff4d6d, #ffcc00); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ---------- confetti ---------- */
.fx-confetti {
  background: linear-gradient(180deg, #1a1c24, #0b0c10);
  overflow: hidden;
}
.confetti-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.confetti-fall {
  position: absolute;
  top: -8%;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation-name: confetti-drop;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--duration, 4.5s);
  animation-delay: var(--delay, 0s);
}
.confetti-fall.round { border-radius: 50%; }
@keyframes confetti-drop {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); }
  100% { transform: translateY(120vh) translateX(var(--drift, 20px)) rotate(600deg); }
}
.fx-confetti .msg-text {
  position: relative;
  z-index: 2;
  font-size: clamp(2rem, 6vw, 5rem);
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.55);
  animation: fadeIn 0.8s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= reveal layer ================= */
.reveal-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  cursor: pointer;
}

/* --- curtain --- */
.curtain { position: absolute; inset: 0; display: flex; }
.curtain-panel {
  flex: 1;
  background:
    repeating-linear-gradient(90deg, #7a0f1e 0 24px, #8f1424 24px 48px);
  box-shadow: inset -20px 0 40px rgba(0,0,0,0.4);
  transition: transform 0.9s cubic-bezier(.65,0,.35,1);
}
.curtain-panel.right { box-shadow: inset 20px 0 40px rgba(0,0,0,0.4); }
.curtain.opening .curtain-panel.left { transform: translateX(-105%); }
.curtain.opening .curtain-panel.right { transform: translateX(105%); }
.curtain-hint {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
  animation: pulse 1.6s ease-in-out infinite;
  z-index: 2;
}
.curtain.opening .curtain-hint { display: none; }

/* --- gift wrap --- */
.giftwrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0b0c10;
}
.gift-box {
  position: relative;
  width: min(60vw, 420px);
  height: min(40vh, 280px);
  background: linear-gradient(135deg, #2a63ff, #1c3fbf);
  border-radius: 8px;
  transition: transform 0.7s ease, opacity 0.7s ease;
}
.gift-lid {
  position: absolute;
  top: -14px; left: -10px; right: -10px;
  height: 34px;
  background: linear-gradient(135deg, #1c3fbf, #142c8a);
  border-radius: 6px;
  transition: transform 0.8s cubic-bezier(.65,0,.35,1), opacity 0.6s ease;
  transform-origin: 50% 0%;
}
.gift-ribbon-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 20px; margin-left: -10px; background: #ffcc00; }
.gift-ribbon-h { position: absolute; left: 0; right: 0; top: 50%; height: 20px; margin-top: -10px; background: #ffcc00; }
.gift-bow {
  position: absolute;
  top: -34px; left: 50%;
  width: 60px; height: 40px;
  margin-left: -30px;
  background: #ff4d6d;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transition: transform 0.6s ease, opacity 0.6s ease;
}
.giftwrap-hint {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: pulse 1.6s ease-in-out infinite;
}
.giftwrap.opening .gift-lid { transform: translateY(-140%) rotate(-25deg); opacity: 0; }
.giftwrap.opening .gift-bow { transform: translateY(-160%) rotate(20deg); opacity: 0; }
.giftwrap.opening .gift-box { transform: scale(1.08); }
.giftwrap.opening .gift-ribbon-v,
.giftwrap.opening .gift-ribbon-h { opacity: 0; transition: opacity 0.4s ease 0.2s; }
.giftwrap.opening .giftwrap-hint { display: none; }

/* --- tearable cloth (see cloth.js) --- */
.cloth-reveal {
  position: absolute;
  inset: 0;
  /* transparent, like .glass-reveal: tearing the canvas above it should
     show the real message immediately through the holes, not a black
     void that only clears on the final fade */
}
.cloth-hint {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
  animation: pulse 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

/* --- balloon pop --- */
.balloon-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0b0c10;
  overflow: hidden;
}
.balloon {
  --balloon-light: #ff8a9c;
  --balloon-mid: #ff4d6d;
  --balloon-dark: #d1284a;
  position: relative;
  width: min(42vw, 260px);
  height: min(52vw, 320px);
  background: radial-gradient(circle at 35% 30%, var(--balloon-light), var(--balloon-mid) 55%, var(--balloon-dark) 100%);
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  animation: balloon-bob 3s ease-in-out infinite;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.balloon-highlight {
  position: absolute;
  top: 18%;
  left: 28%;
  width: 22%;
  height: 30%;
  background: rgba(255,255,255,0.45);
  border-radius: 50%;
  filter: blur(2px);
}
.balloon-knot {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid var(--balloon-dark, #d1284a);
}
.balloon-string {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -1px;
  width: 2px;
  height: 70px;
  background: linear-gradient(#999, #666);
}
.balloon-hint {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
  animation: pulse 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes balloon-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
.balloon-reveal.popping .balloon,
.balloon-reveal.popping .balloon-knot,
.balloon-reveal.popping .balloon-string {
  transform: scale(1.15);
  opacity: 0;
}
.balloon-reveal.popping .balloon-hint { display: none; }

.confetti-piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 14px;
  margin: -7px 0 0 -4px;
  animation: confetti-fly 0.9s ease-out forwards;
}
@keyframes confetti-fly {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* --- frosted glass wipe (see glass.js) --- */
.glass-reveal {
  position: absolute;
  inset: 0;
  /* transparent, unlike the other reveal wrappers: wiping the canvas above
     it should show the real message straight away, not a black void that
     only clears on the final fade */
}
.glass-hint {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  color: #333;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
  animation: pulse 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

.reveal-layer.torn { pointer-events: none; opacity: 0; transition: opacity 0.5s ease 0.5s; }
