/* SalamGames shared delight layer — brief, accessible, performance-bounded effects. */
:root {
  --sg-delight-pink: #ec4899;
  --sg-delight-purple: #7c3aed;
  --sg-delight-sky: #0284c7;
  --sg-delight-gold: #f59e0b;
  --sg-delight-mint: #059669;
}

.sg-skip-link {
  position: fixed;
  top: max(.5rem, env(safe-area-inset-top));
  left: .75rem;
  z-index: 10050;
  transform: translateY(-180%);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: .65rem 1rem;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #4c1d95;
  box-shadow: 0 5px 0 #2e1065;
  font: 900 .9rem/1 Nunito, system-ui, sans-serif;
  text-decoration: none;
}
.sg-skip-link:focus { transform: translateY(0); }

.sg-delight-layer {
  position: fixed;
  inset: 0;
  z-index: 9998;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.sg-delight-particle {
  --sg-x: 0px;
  --sg-y: -50px;
  --sg-r: 120deg;
  --sg-color: var(--sg-delight-gold);
  position: fixed;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px;
  border-radius: 3px;
  background: var(--sg-color);
  box-shadow: 0 0 0 2px rgba(255,255,255,.8), 0 4px 10px rgba(76,29,149,.18);
  animation: sg-delight-burst .78s cubic-bezier(.18,.72,.2,1) forwards;
  will-change: transform, opacity;
}
.sg-delight-particle[data-shape="star"] {
  width: 14px;
  height: 14px;
  margin: -7px;
  border-radius: 0;
  clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%);
}
.sg-delight-particle[data-shape="dot"] { border-radius: 50%; }

.sg-shooting-star {
  position: fixed;
  left: -15vw;
  top: var(--sg-comet-top, 18vh);
  width: 70px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.9) 68%, #fde047);
  filter: drop-shadow(0 0 7px rgba(250,204,21,.85));
  transform: rotate(-12deg);
  animation: sg-comet 1.15s ease-in forwards;
}
.sg-shooting-star::after {
  content: "✦";
  position: absolute;
  right: -5px;
  top: -9px;
  color: #facc15;
  font-size: 20px;
}

.sg-delight-wiggle { animation: sg-friendly-wiggle .75s cubic-bezier(.2,.8,.2,1); }

.sg-sparkle-control,
.sg-surprise-control {
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.sg-sparkle-control {
  margin-top: .75rem;
  padding: .55rem .9rem;
  color: #4c1d95;
  background: rgba(255,255,255,.94);
  box-shadow: 0 4px 0 rgba(46,16,101,.28);
}
.sg-surprise-control {
  margin-left: auto;
  padding: .55rem .9rem;
  color: #075985;
  background: #fff;
  border-color: #bae6fd;
  box-shadow: 0 4px 0 #bae6fd;
}
.sg-sparkle-control:hover,
.sg-surprise-control:hover { transform: translateY(-2px) rotate(-1deg); }
.sg-sparkle-control:active,
.sg-surprise-control:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(46,16,101,.2); }

.sg-surprise-result {
  display: none;
  align-items: center;
  gap: .75rem;
  margin: -.25rem 0 1rem;
  padding: .8rem 1rem;
  border: 3px solid #c4b5fd;
  border-radius: 1.25rem;
  background: linear-gradient(135deg,#fff 0%,#f5f3ff 60%,#ecfeff 100%);
  box-shadow: 0 5px 0 rgba(109,40,217,.12);
  color: #312e81;
  font-weight: 850;
}
.sg-surprise-result[data-open="true"] { display: flex; animation: sg-surprise-pop .34s cubic-bezier(.2,.9,.25,1.25); }
.sg-surprise-result strong { color: #5b21b6; }
.sg-surprise-result a {
  margin-left: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: .55rem .9rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg,#7c3aed,#db2777);
  box-shadow: 0 4px 0 #581c87;
  font-weight: 900;
  text-decoration: none;
}

@keyframes sg-delight-burst {
  0% { opacity: 0; transform: translate3d(0,0,0) scale(.35) rotate(0); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--sg-x),var(--sg-y),0) scale(.9) rotate(var(--sg-r)); }
}
@keyframes sg-comet {
  0% { opacity: 0; transform: translate3d(0,0,0) rotate(-12deg) scale(.7); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(130vw,24vh,0) rotate(-12deg) scale(1); }
}
@keyframes sg-friendly-wiggle {
  0%,100% { transform: translate3d(0,0,0) rotate(0) scale(1); }
  30% { transform: translate3d(0,-5px,0) rotate(-4deg) scale(1.07); }
  60% { transform: translate3d(0,-2px,0) rotate(4deg) scale(1.04); }
}
@keyframes sg-surprise-pop {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 420px) {
  .sg-surprise-control { width: 100%; margin-left: 0; padding-inline: .7rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font-size: .78rem; white-space: nowrap; }
  .sg-surprise-result { margin-top: 0; align-items: flex-start; flex-wrap: wrap; font-size: .82rem; }
  .sg-surprise-result a { width: 100%; justify-content: center; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-delight-layer { display: none !important; }
  .sg-delight-wiggle,
  .sg-surprise-result[data-open="true"] { animation: none !important; }
  .sg-sparkle-control,
  .sg-surprise-control { transition: none !important; }
}
