.celebration-overlay{
  position:fixed; inset:0; z-index:50;
  display:flex; align-items:center; justify-content:center;
  padding:24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background:radial-gradient(120% 120% at 50% 20%, rgba(28,33,24,0.92), rgba(6,7,5,0.97));
  backdrop-filter:blur(2px);
  --sport-color: var(--acid);
}
.celebration-overlay.hidden{ display:none !important; }

#confettiCanvas{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }

.celebration-content{
  position:relative; z-index:1; display:flex; flex-direction:column; align-items:center;
  gap:10px; text-align:center; max-width:380px;
}

.celebration-stage{
  position:relative; width:180px; height:150px; margin-bottom:6px;
  display:flex; align-items:flex-end; justify-content:center;
}
.celebration-decor{ position:absolute; inset:0; pointer-events:none; }
.celebration-hero{
  position:relative; z-index:2; font-size:56px; line-height:1; filter:drop-shadow(0 10px 18px rgba(0,0,0,0.5));
}

/* --- calcio / calcio5: goal net --- */
.celebration-overlay[data-sport="calcio"] .celebration-decor,
.celebration-overlay[data-sport="calcio5"] .celebration-decor{
  bottom:6px; left:50%; width:130px; height:78px; transform:translateX(-50%);
  border:3px solid color-mix(in srgb, var(--text) 55%, transparent);
  border-bottom:none;
  background-image:
    repeating-linear-gradient(100deg, color-mix(in srgb, var(--text) 22%, transparent) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(-100deg, color-mix(in srgb, var(--text) 22%, transparent) 0 1px, transparent 1px 12px);
}
.anim-calcio, .anim-calcio5{ animation: goal-bounce 1.4s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes goal-bounce{
  0%{ transform:translateY(-90px) scale(.8) rotate(-20deg); opacity:0; }
  38%{ transform:translateY(6px) scale(1.05) rotate(140deg); opacity:1; }
  50%{ transform:translateY(-14px) scale(.96) rotate(170deg); }
  66%{ transform:translateY(2px) scale(1) rotate(200deg); }
  78%{ transform:translateY(-6px) scale(.98) rotate(220deg); }
  100%{ transform:translateY(0) scale(1) rotate(240deg); }
}

/* --- pallavolo: net + spike arc --- */
.celebration-overlay[data-sport="pallavolo"] .celebration-decor{
  bottom:18px; left:8px; right:8px; height:64px;
  border-top:3px solid color-mix(in srgb, var(--text) 55%, transparent);
  background-image: repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 22%, transparent) 0 1px, transparent 1px 10px);
  mask-image:linear-gradient(to bottom, black, transparent 85%);
}
.celebration-overlay[data-sport="pallavolo"] .celebration-decor::before,
.celebration-overlay[data-sport="pallavolo"] .celebration-decor::after{
  content:""; position:absolute; top:0; bottom:0; width:3px;
  background:color-mix(in srgb, var(--text) 45%, transparent);
}
.celebration-overlay[data-sport="pallavolo"] .celebration-decor::before{ left:0; }
.celebration-overlay[data-sport="pallavolo"] .celebration-decor::after{ right:0; }
.anim-pallavolo{ animation: spike-arc 1.3s cubic-bezier(.3,.9,.4,1) both; }
@keyframes spike-arc{
  0%{ transform:translate(-70px,-10px) rotate(-40deg) scale(.85); opacity:0; }
  18%{ opacity:1; }
  45%{ transform:translate(-10px,-95px) rotate(60deg) scale(1.05); }
  72%{ transform:translate(30px,-10px) rotate(220deg) scale(1); }
  86%{ transform:translate(18px,-38px) rotate(260deg) scale(1); }
  100%{ transform:translate(20px,-12px) rotate(300deg) scale(1); }
}

/* --- rugby: goal posts (H) --- */
.celebration-overlay[data-sport="rugby"] .celebration-decor{
  bottom:0; left:50%; width:150px; height:130px; transform:translateX(-50%);
}
.celebration-overlay[data-sport="rugby"] .celebration-decor::before,
.celebration-overlay[data-sport="rugby"] .celebration-decor::after{
  content:""; position:absolute; bottom:0; width:5px; height:100%;
  background:color-mix(in srgb, var(--text) 55%, transparent); border-radius:3px;
}
.celebration-overlay[data-sport="rugby"] .celebration-decor::before{ left:6px; }
.celebration-overlay[data-sport="rugby"] .celebration-decor::after{ right:6px; }
.celebration-overlay[data-sport="rugby"] .celebration-stage::before{
  content:""; position:absolute; left:50%; bottom:50px; transform:translateX(-50%);
  width:126px; height:5px; background:color-mix(in srgb, var(--text) 55%, transparent);
  border-radius:3px; z-index:1;
}
.anim-rugby{ animation: try-drop 1.2s cubic-bezier(.36,1.1,.6,1) both; }
@keyframes try-drop{
  0%{ transform:translateY(-100px) rotate(0deg) scale(.85); opacity:0; }
  55%{ transform:translateY(4px) rotate(430deg) scale(1.04); opacity:1; }
  72%{ transform:translateY(-16px) rotate(470deg) scale(.98); }
  100%{ transform:translateY(0) rotate(520deg) scale(1); }
}

/* --- basket: hoop + swish --- */
.celebration-overlay[data-sport="basket"] .celebration-decor{
  top:26px; left:50%; width:100px; height:34px; transform:translateX(-50%);
  border:3px solid color-mix(in srgb, var(--text) 55%, transparent); border-radius:50%;
  background-image: repeating-linear-gradient(65deg, color-mix(in srgb, var(--text) 20%, transparent) 0 1px, transparent 1px 9px);
  mask-image:linear-gradient(to bottom, black, transparent 90%);
}
.anim-basket{ animation: hoop-swish 1.15s cubic-bezier(.4,.7,.3,1) both; }
@keyframes hoop-swish{
  0%{ transform:translateY(70px) scale(1); opacity:0; }
  15%{ opacity:1; }
  55%{ transform:translateY(-70px) scale(.92); }
  74%{ transform:translateY(-38px) scale(.8); }
  100%{ transform:translateY(58px) scale(.62); opacity:.92; }
}

.celebration-title{
  font-family:'Anton', sans-serif; font-weight:400; font-size:clamp(30px,8vw,44px);
  letter-spacing:.01em; text-transform:uppercase; margin:0; line-height:.95;
  color:var(--sport-color);
}
.celebration-sub{
  font-family:'Archivo', sans-serif; font-size:13.5px; line-height:1.55; color:var(--muted); margin:0;
}
.celebration-share{
  display:inline-flex; align-items:center; gap:8px;
  font-family:'Archivo', sans-serif; font-weight:700; font-size:13px; letter-spacing:.02em;
  color:var(--sport-color); background:transparent; border:1.5px solid var(--sport-color); border-radius:9px;
  padding:11px 22px; cursor:pointer; margin-top:6px;
  transition:background .14s ease, color .14s ease;
}
.celebration-share svg{ width:16px; height:16px; }
.celebration-share:hover{ background:var(--sport-color); color:var(--bg); }

.celebration-close{
  font-family:'Archivo', sans-serif; font-weight:700; font-size:13px; letter-spacing:.02em;
  color:var(--bg); background:var(--sport-color); border:none; border-radius:9px;
  padding:12px 28px; cursor:pointer; margin-top:8px;
}
.celebration-close:hover{ filter:brightness(0.92); }
