/* ═══════════ MILESTONE CELEBRATION THEME (only active when html has .celebrate) ═══════════ */
/* !important on purpose: the site writes its own accent colours inline on <html>, which would otherwise win */
html.celebrate {
  --bg:#0b0615 !important; --panel:#170b26 !important; --panel2:#24113a !important; --line:#5d2f73 !important;
  --text:#fff7ec !important; --muted:#dcb6d4 !important;
  --cyan:#ffd166 !important; --violet:#ff5fa2 !important; --green:#7dffc0 !important; --danger:#ff8fa3 !important;
  --cel-gold:#ffd166; --cel-pink:#ff5fa2; --cel-violet:#9b7bff; --cel-aqua:#5ef2ff; --cel-mint:#7dffc0;
}
html.celebrate ::selection { background: var(--cel-pink); color: #fff; }

/* background scenes get a party palette (static filter = cheap), plus an animated glow layer on top */
html.celebrate #horizon-bh, html.celebrate #horizon-cosmos, html.celebrate #singularity-background {
  filter: hue-rotate(95deg) saturate(1.6) brightness(1.08); }
html.celebrate .space-shade { background: radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(40,6,50,.62)); }

.cel-aurora { display: none; }
html.celebrate .cel-aurora { display: block; position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.cel-blob { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: .34; }
.cel-blob.b1 { left: -22vmax; top: -26vmax; background: radial-gradient(circle, var(--cel-pink), transparent 64%); animation: celBlobA 19s ease-in-out infinite alternate; }
.cel-blob.b2 { right: -26vmax; top: 6vmax; background: radial-gradient(circle, var(--cel-violet), transparent 64%); animation: celBlobB 23s ease-in-out infinite alternate; }
.cel-blob.b3 { left: 14vmax; bottom: -42vmax; background: radial-gradient(circle, var(--cel-gold), transparent 62%); opacity: .26; animation: celBlobC 27s ease-in-out infinite alternate; }
.cel-stars { position: absolute; inset: 0; opacity: .8; animation: celTwinkle 3.4s ease-in-out infinite alternate;
  background-image:
    radial-gradient(2px 2px at 12% 22%, #fff, transparent 60%), radial-gradient(2px 2px at 78% 14%, var(--cel-gold), transparent 60%),
    radial-gradient(1.5px 1.5px at 34% 68%, #fff, transparent 60%), radial-gradient(2px 2px at 88% 72%, var(--cel-aqua), transparent 60%),
    radial-gradient(1.5px 1.5px at 56% 36%, var(--cel-pink), transparent 60%), radial-gradient(2px 2px at 6% 84%, var(--cel-mint), transparent 60%),
    radial-gradient(1.5px 1.5px at 66% 90%, #fff, transparent 60%), radial-gradient(1.5px 1.5px at 46% 8%, #fff, transparent 60%);
  background-size: 520px 520px; }

/* topbar: rainbow edge, party glow, ticker + trophy chip */
html.celebrate .topbar { position: relative; border-bottom-color: transparent;
  background: linear-gradient(180deg, rgba(40,10,52,.92), rgba(22,6,34,.6)); }
html.celebrate .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--cel-gold), var(--cel-pink), var(--cel-violet), var(--cel-aqua), var(--cel-mint), var(--cel-gold));
  background-size: 300% 100%; box-shadow: 0 0 14px var(--cel-pink); animation: celSlide 6s linear infinite; }
html.celebrate .brand-symbol, html.celebrate .top-brand .brand-symbol { color: var(--cel-gold);
  background: radial-gradient(circle, #4a1a55, #1b0a2a); box-shadow: 0 0 22px -4px var(--cel-pink); }
html.celebrate .sidebar { background: linear-gradient(180deg, rgba(34,9,46,.85), rgba(14,5,26,.74)); border-right-color: #ffd16630; }
html.celebrate .panel-card { border-color: #ffd16638; box-shadow: 0 0 44px -24px var(--cel-pink); }
html.celebrate .home-title { filter: drop-shadow(0 0 26px rgba(255,209,102,.38)); }
html.celebrate .home-kicker::after { content: " ✦ " var(--cel-tag, ""); color: var(--cel-pink); }
html.celebrate .link-button { background: rgba(34,9,46,.62); }
html.celebrate .chip { border-color: #ffd16640; background: #1c0a2b; }

.cel-marquee { display: none; }
html.celebrate .cel-marquee { display: block; position: relative; flex: 1 1 0; min-width: 0; height: 28px; overflow: hidden; border-radius: 99px;
  border: 1px solid #ffd16644; background: linear-gradient(90deg, #ff5fa21f, #ffd16626, #9b7bff1f);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.cel-track { display: flex; align-items: center; width: max-content; height: 100%; animation: celTicker 34s linear infinite; }
.cel-track span { padding: 0 20px; white-space: nowrap; font: 700 11px var(--mono, monospace); letter-spacing: .22em; color: #fff2c9; text-shadow: 0 0 12px #ffd16688; }
html.celebrate .cel-marquee + .topbar-spacer { display: none; }
html.celebrate .cel-marquee.cel-auth { flex: none; margin: 12px 16px 0; }
html.celebrate .cel-chip { color: #2a0a1e; border-color: transparent; font-weight: 800;
  background: linear-gradient(110deg, var(--cel-gold), var(--cel-pink)); animation: celPulse 2.2s ease-in-out infinite; }
@media (max-width: 720px) {
  html.celebrate .cel-marquee:not(.cel-auth) { display: none; }
  html.celebrate .cel-marquee + .topbar-spacer { display: block; }
}

/* login terminal turns into a neon party gate */
html.celebrate .term { border-color: #ffd16677; box-shadow: 0 0 0 1px #ff5fa244, 0 0 60px -10px #ff5fa288, 0 0 120px -30px #ffd16688; }
html.celebrate .term-bar { background: #1d0b2b; border-bottom-color: #ffd16640; color: #d9a9c9; }
html.celebrate .term .auth-card input { background: #12061c; border-color: #5d2f73; color: #ffe9b8; }
html.celebrate .term .auth-card label { color: #d9a9c9; }
html.celebrate .term .primary { background: #2a1022; }
html.celebrate .term .auth-sub, html.celebrate .term .auth-switch, html.celebrate .term .auth-note { color: #c79ab9; }
html.celebrate .term h1.glitch { text-shadow: 0 0 28px #ffd16688, 0 0 60px #ff5fa266; }
html.celebrate .glitch:after { color: var(--cel-gold); }

/* floating replay button */
.cel-fab, .cel-pop, .cel-fx { display: none; }
html.celebrate .cel-fab { display: grid; position: fixed; right: 18px; bottom: 18px; z-index: 1400; width: 48px; height: 48px; place-items: center;
  border: 0; border-radius: 50%; font-size: 23px; line-height: 1; cursor: pointer; color: #2a0a1e;
  background: linear-gradient(135deg, var(--cel-gold), var(--cel-pink)); box-shadow: 0 10px 30px -8px var(--cel-pink), 0 0 0 3px #ffffff22;
  animation: celBob 2.6s ease-in-out infinite; }
html.celebrate .cel-fab:hover { transform: scale(1.12) rotate(-10deg); animation-play-state: paused; }
html.cel-open .cel-fab { display: none; }

/* fireworks + confetti layer */
html.celebrate .cel-fx { display: block; position: fixed; inset: 0; z-index: 9500; width: 100%; height: 100%; pointer-events: none; }

/* the popup */
html.celebrate .cel-pop { display: grid; position: fixed; inset: 0; z-index: 9000; place-items: center; padding: 20px; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(58,12,70,.72), rgba(6,2,14,.94));
  opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }
html.celebrate .cel-pop.open { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.cel-card { position: relative; width: min(460px, 100%); padding: 34px 28px 28px; overflow: hidden; text-align: center; border-radius: 26px;
  border: 1px solid #ffd16699; background: linear-gradient(160deg, rgba(60,16,76,.97), rgba(22,8,38,.98));
  box-shadow: 0 0 0 1px #ff5fa244, 0 30px 90px -20px #ff5fa2aa, 0 0 140px -30px #ffd166aa;
  transform: translateY(34px) scale(.78) rotate(-2.5deg); transition: transform .65s cubic-bezier(.2,1.4,.3,1); }
.cel-pop.open .cel-card { transform: none; }
.cel-rays { position: absolute; left: 50%; top: 118px; width: 680px; height: 680px; margin: -340px 0 0 -340px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,209,102,.22) 0 7deg, transparent 7deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 4%, transparent 66%); mask-image: radial-gradient(circle, #000 4%, transparent 66%);
  animation: celSpin 32s linear infinite; }
.cel-x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 32px; height: 32px; border: 1px solid #ffffff22; border-radius: 50%;
  color: #ffd9ee; background: #ffffff10; cursor: pointer; font-size: 14px; }
.cel-x:hover { background: #ffffff22; }
.cel-medal { position: relative; z-index: 1; width: 176px; height: 176px; margin: 0 auto 16px; cursor: pointer; }
.cel-ring { position: absolute; inset: 0; border-radius: 50%; animation: celSpin 6s linear infinite;
  background: conic-gradient(from 0deg, var(--cel-gold), var(--cel-pink), var(--cel-violet), var(--cel-aqua), var(--cel-mint), var(--cel-gold));
  box-shadow: 0 0 54px -6px var(--cel-pink), 0 0 100px -20px var(--cel-gold); }
.cel-core { position: absolute; inset: 9px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #5a1f70, #1a0a2c 72%); box-shadow: inset 0 0 30px #000a; animation: celPulse 2.4s ease-in-out infinite; }
.cel-num { font: 800 76px/1 "Space Grotesk", system-ui, sans-serif; letter-spacing: -.05em; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(100deg, #fff 20%, var(--cel-gold) 38%, var(--cel-pink) 60%, #fff 80%); background-size: 260% 100%;
  animation: celSlide 3.6s linear infinite; filter: drop-shadow(0 0 14px #ffd16688); }
.cel-kicker { position: relative; z-index: 1; font: 700 11px var(--mono, monospace); letter-spacing: .3em; color: var(--cel-gold); text-transform: uppercase; }
.cel-sub { position: relative; z-index: 1; margin: 8px 0 14px; font: 800 22px "Space Grotesk", system-ui, sans-serif; letter-spacing: .26em; color: #fff;
  text-shadow: 0 0 22px var(--cel-pink); }
.cel-msg { position: relative; z-index: 1; margin: 0 auto 22px; max-width: 36ch; font-size: 16px; line-height: 1.65; color: #ffeef6; white-space: pre-line; overflow-wrap: anywhere; }
.cel-btn { position: relative; z-index: 1; min-height: 48px; padding: 0 30px; border: 0; border-radius: 99px; cursor: pointer; font: 800 14px "Space Grotesk", system-ui, sans-serif; letter-spacing: .04em;
  color: #2a0a1e; background: linear-gradient(110deg, var(--cel-gold), var(--cel-pink), var(--cel-violet)); background-size: 200% 100%;
  box-shadow: 0 12px 34px -10px var(--cel-pink); transition: transform .2s, filter .2s; animation: celSlide 5s linear infinite; }
.cel-btn:hover { transform: translateY(-2px) scale(1.04); filter: brightness(1.1); }
.cel-btn:focus-visible, .cel-x:focus-visible, .cel-fab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cel-pop.open .st { animation: celUp .6s cubic-bezier(.2,.9,.3,1) both; animation-delay: calc(var(--i, 0) * .09s + .25s); }

@keyframes celSlide { to { background-position: 100% 0; } }
@keyframes celSpin { to { transform: rotate(360deg); } }
@keyframes celTicker { to { transform: translateX(-50%); } }
@keyframes celPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes celBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes celUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes celTwinkle { from { opacity: .35; } to { opacity: .95; } }
@keyframes celBlobA { to { transform: translate(18vmax, 14vmax) scale(1.15); } }
@keyframes celBlobB { to { transform: translate(-20vmax, 18vmax) scale(.9); } }
@keyframes celBlobC { to { transform: translate(16vmax, -14vmax) scale(1.2); } }
/* auto "lite" mode (added by the script on slow devices): same look, far fewer moving parts */
html.cel-lite #horizon-bh, html.cel-lite #horizon-cosmos, html.cel-lite #singularity-background { filter: none; }
html.cel-lite .cel-blob, html.cel-lite .cel-stars, html.cel-lite .cel-track, html.cel-lite .cel-rays, html.cel-lite .cel-ring, html.cel-lite .cel-core,
html.cel-lite .cel-num, html.cel-lite .cel-btn, html.cel-lite .cel-fab, html.cel-lite .cel-chip, html.cel-lite.celebrate .topbar::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cel-blob, .cel-stars, .cel-track, .cel-rays, .cel-ring, .cel-core, .cel-num, .cel-btn, .cel-fab, .cel-chip,
  html.celebrate .topbar::after, .cel-pop.open .st { animation: none !important; }
  .cel-card { transition: none; transform: none; }
}
