/* ceremony.css — champion podium overlay. */

.ceremony-overlay {
  position: fixed;
  inset: 0;
  z-index: 10500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 26, 0.92);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.ceremony-overlay.show { opacity: 1; pointer-events: auto; }

.cm-inner { text-align: center; padding: 1.5rem; max-width: 560px; width: 100%; }

/* --- champion-lifting scene with looping confetti behind --- */
.cm-trophy-scene {
  position: relative;
  width: 260px;
  height: 240px;
  margin: 0 auto 0.3rem;
  opacity: 0;
  transform: translateY(-24px) scale(0.6);
  transition: transform 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) 0.15s, opacity 0.4s ease 0.15s;
}
.ceremony-overlay.show .cm-trophy-scene { opacity: 1; transform: translateY(0) scale(1); }

/* looping confetti layer (behind the figure) */
.cm-confetti { position: absolute; inset: -10px 0 0 0; overflow: hidden; z-index: 1; pointer-events: none; }
.cm-conf {
  position: absolute;
  top: -14px;
  display: block;
  opacity: 0;
  animation-name: cmConfFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes cmConfFall {
  0% { top: -14px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 240px; opacity: 0; }
}

/* the champion figure */
.cm-champ-figure {
  position: relative;
  z-index: 2;
  width: 190px;
  height: 205px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}
.cm-fill-body { fill: url(#cmBody); }
.cm-fill-skin { fill: #f0c9a0; }
.cm-fill-gold { fill: url(#cmGold); }
.cm-arm { fill: none; stroke: #f0c9a0; stroke-width: 9; stroke-linecap: round; }
.cm-shine { fill: none; stroke: rgba(255,255,255,0.85); stroke-width: 3; stroke-linecap: round; }

/* whole figure bobs up and down */
.cm-figure { transform-origin: 100px 200px; animation: cmBob 1.6s ease-in-out infinite; }
@keyframes cmBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
/* arms + trophy pump the cup overhead on the same loop */
.cm-arms { transform-origin: 100px 100px; animation: cmPump 1.6s ease-in-out infinite; }
@keyframes cmPump {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-10px) scaleY(1.04); }
}
/* the cup gets a little glint pulse */
.cm-lift { animation: cmGlint 1.6s ease-in-out infinite; transform-origin: 100px 40px; }
@keyframes cmGlint {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6)); }
  50% { filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.95)); }
}

@media (prefers-reduced-motion: reduce) {
  .cm-figure, .cm-arms, .cm-lift, .cm-conf { animation: none; }
  .cm-conf { opacity: 0.9; }
}

@media (max-width: 480px) {
  .cm-trophy-scene { width: 220px; height: 210px; }
  .cm-champ-figure { width: 160px; height: 175px; }
}

.cm-title {
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 6px;
  color: var(--text-accent);
  font-size: 1.1rem;
  margin: 0.5rem 0 0.2rem;
}

.cm-champ {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-neon);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: scale(0.7);
  transition: transform 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) 0.45s, opacity 0.4s ease 0.45s;
}
.ceremony-overlay.show .cm-champ { opacity: 1; transform: scale(1); }

.cm-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.6rem;
}

.cm-col { flex: 1; max-width: 150px; }
.cm-empty { max-width: 150px; }

.cm-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.cm-block {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border-radius: 8px 8px 0 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #0a0e27;
  padding-top: 0.4rem;
  height: 0;
  transition: height 0.7s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.cm-first  .cm-block { background: linear-gradient(180deg, #ffd700, #b8860b); }
.cm-second .cm-block { background: linear-gradient(180deg, #d9e2ec, #8fa3b8); }
.cm-third  .cm-block { background: linear-gradient(180deg, #e0a35c, #9c6423); }

.ceremony-overlay.show .cm-first  .cm-block { height: 150px; transition-delay: 0.7s; }
.ceremony-overlay.show .cm-second .cm-block { height: 105px; transition-delay: 1.0s; }
.ceremony-overlay.show .cm-third  .cm-block { height: 75px;  transition-delay: 1.25s; }

.ceremony-overlay.show .cm-first  .cm-name { opacity: 1; transform: none; transition-delay: 1.1s; }
.ceremony-overlay.show .cm-second .cm-name { opacity: 1; transform: none; transition-delay: 1.35s; }
.ceremony-overlay.show .cm-third  .cm-name { opacity: 1; transform: none; transition-delay: 1.55s; }

.cm-close { min-width: 120px; }
