.ms-celebration {
  --green: #06271d;
  --green2: #0b4936;
  --gold: #d8ad55;
  --cream: #fff5db;
  --wood: #d8b77f;
  --ms-celebration-radius: var(--ms-celebration-board-radius, clamp(18px, 2.2vw, 30px));
  --ms-celebration-inner-radius: max(0px, calc(var(--ms-celebration-radius) - 5px));
  --ms-celebration-pill-radius: clamp(16px, 2vw, 24px);
  position: absolute;
  inset: 0;
  z-index: 46;
  overflow: hidden;
  border-radius: var(--ms-celebration-radius);
  clip-path: inset(0 round var(--ms-celebration-radius));
  pointer-events: none;
  isolation: isolate;
}

.ms-celebration canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.ms-celebration__fx-back {
  z-index: 1;
}

.ms-celebration__fx-front {
  z-index: 5;
}

.ms-celebration__stage-wash {
  position: absolute;
  inset: -5%;
  z-index: 2;
  background:
    radial-gradient(
      ellipse at center,
      rgba(0, 20, 14, .3) 0,
      rgba(0, 18, 12, .7) 68%,
      rgba(0, 7, 5, .92) 100%
    );
  opacity: 0;
  animation: msCelebrationWash 500ms forwards;
}

.ms-celebration__frame-glow {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 2px solid rgba(255, 216, 120, .7);
  box-shadow:
    inset 0 0 24px rgba(255, 205, 91, .28),
    0 0 20px rgba(15, 106, 80, .55);
  opacity: 0;
  animation: msCelebrationFrame 2s 200ms ease-in-out infinite alternate;
}

.ms-celebration__tile-aura {
  position: absolute;
  z-index: 3;
  left: 25%;
  right: 25%;
  bottom: 36%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 227, 160, 0.3), transparent 70%);
  filter: blur(8px);
  animation: msCelebrationAura 1.6s ease-in-out infinite alternate;
}

.ms-celebration__crown {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 227, 160, 0.7);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 20px rgba(242, 193, 92, 0.45),
    inset 0 0 25px rgba(22, 128, 95, 0.35);
  animation: msCelebrationCrown 3.4s ease-out both;
}

.ms-celebration--double-master .ms-celebration__crown {
  width: 43%;
  border-width: 2px;
}

.ms-celebration__message {
  position: absolute;
  inset: 7%;
  z-index: 3;
  display: grid;
  place-content: center;
  text-align: center;
  text-shadow:
    0 3px 14px #00150f,
    0 0 26px #073326;
}

.ms-celebration__message::before,
.ms-celebration__message::after {
  content: "";
  display: block;
  height: 1px;
  width: min(340px, 65vw);
  margin: 9px auto;
  background:
    linear-gradient(
      90deg,
      transparent,
      #f3d67e,
      transparent
    );
  animation: msCelebrationLine 900ms 500ms both;
}

.ms-celebration__message::before,
.ms-celebration__message::after {
  height: 2px;
  box-shadow: 0 0 9px #f2c15c;
}

.ms-celebration__duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(4px, 0.8vw, 7px);
}

.ms-celebration__person {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 10px);
  max-width: min(92%, 620px);
}

.ms-celebration__avatar {
  display: grid;
  place-items: center;
  width: clamp(38px, 7vw, 68px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #e3c46d;
  background:
    radial-gradient(circle at 35% 25%, #3b755f, #08251c 70%);
  box-shadow:
    0 0 0 4px #08281fcc,
    0 0 25px #f0cf7055;
  color: #fff4dc;
  font: 700 clamp(11px, 2vw, 18px) Arial;
  overflow: hidden;
}

.ms-celebration__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}

.ms-celebration__avatar--fallback {
  overflow: visible;
}

.ms-celebration__name {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: Georgia, serif;
  font-size: clamp(16px, 4vw, 40px);
  line-height: .95;
  color: #fff5db;
}

.ms-celebration__verb {
  color: #fff0c9;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(14px, 2vw, 22px);
  font-style: italic;
  letter-spacing: 0.03em;
  text-shadow:
    0 1px 8px rgba(0, 20, 14, 0.9),
    0 0 14px rgba(245, 211, 132, 0.34);
}

.ms-celebration__context {
  width: max-content;
  max-width: min(92%, 560px);
  margin: clamp(7px, 1.1vw, 11px) auto clamp(3px, 0.65vw, 6px);
  padding: clamp(3px, 0.55vw, 6px) clamp(8px, 1.2vw, 14px);
  border: 1px solid rgba(255, 226, 156, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 238, 184, 0.14), rgba(255, 255, 255, 0) 55%),
    rgba(7, 36, 27, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 212, 0.12),
    0 8px 18px rgba(0, 18, 13, 0.2);
  color: #fff3c9;
  font: 900 clamp(10px, 1.62vw, 16px) Arial, sans-serif;
  letter-spacing: 0.095em;
  text-transform: uppercase;
  text-shadow:
    0 1px 8px rgba(0, 20, 14, 0.96),
    0 0 14px rgba(244, 214, 130, 0.34);
  white-space: normal;
}

.ms-celebration__reaction {
  color: #f7dd83;
  font-family: Georgia, serif;
  font-size: clamp(25px, 5.2vw, 62px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  text-shadow:
    0 2px #7a511d,
    0 0 18px rgba(247, 216, 115, 0.47),
    0 0 40px rgba(7, 136, 94, 0.33);
}

.ms-celebration__message--master {
  inset: 7%;
}

.ms-celebration__message--master::before,
.ms-celebration__message--master::after {
  display: block;
}

.ms-celebration__master-player {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
}

.ms-celebration__master-kicker {
  font: 700 clamp(8px, 1.2vw, 12px) Arial;
  letter-spacing: .28em;
  color: #f0dfaa;
}

.ms-celebration__master-title {
  font-family: Georgia, serif;
  font-size: clamp(29px, 7vw, 74px);
  line-height: .9;
  color: #fff2c7;
  letter-spacing: .04em;
  margin: 9px 0;
  text-shadow:
    0 2px #7a511d,
    0 0 18px #f7d87377,
    0 0 40px #07885e55;
  filter: drop-shadow(0 0 15px rgba(242, 193, 92, .5));
}

.ms-celebration--double-master .ms-celebration__master-title {
  color: #ffe184;
  text-shadow:
    0 2px #704814,
    0 0 18px #ffd35a99,
    0 0 44px #07855f88;
}

.ms-celebration__master-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  font: 700 clamp(8px, 1.2vw, 11px) Arial;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #eee0b7;
}

@media (min-width: 761px) and (min-height: 451px) {
  .ms-celebration--master .ms-celebration__master-title {
    font-size: clamp(29px, 4.6vw, 50px);
    white-space: nowrap;
  }
}

.ms-celebration__supporters {
  margin: clamp(8px, 1.4vw, 15px) auto 0;
  max-width: min(88%, 420px);
  padding: clamp(6px, 1vw, 10px) clamp(8px, 1.4vw, 14px);
  border: 1px solid rgba(255, 226, 156, 0.22);
  border-radius: var(--ms-celebration-pill-radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 239, 186, 0.1), rgba(255, 255, 255, 0) 42%),
    rgba(6, 34, 25, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 212, 0.11),
    inset 0 -1px 0 rgba(0, 18, 13, 0.32),
    0 10px 24px rgba(0, 18, 13, 0.22);
}

.ms-celebration__supporters[hidden] {
  display: none;
}

.ms-celebration__supporters-title {
  margin: 0 0 5px;
  color: rgba(255, 240, 201, 0.82);
  font: 750 clamp(8px, 1.05vw, 11px) Arial, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ms-celebration__supporter-list {
  display: flex;
  justify-content: center;
  gap: clamp(7px, 1vw, 12px);
  flex-wrap: wrap;
}

.ms-celebration__supporter {
  min-width: clamp(54px, 8vw, 74px);
  max-width: 96px;
  display: grid;
  justify-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  animation: msCelebrationSupporterIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--ms-supporter-index, 0) * 70ms);
}

.ms-celebration__supporter .ms-celebration__avatar {
  width: clamp(28px, 3.5vw, 38px);
  border-width: 1px;
  box-shadow:
    0 0 0 2px rgba(6, 35, 27, 0.9),
    0 0 0 4px rgba(224, 190, 103, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 6px 13px rgba(0, 17, 12, 0.34);
  font-size: clamp(8px, 1.15vw, 11px);
}

.ms-celebration__supporter-name {
  width: 100%;
  color: #fff5dc;
  font: 800 clamp(8px, 1.05vw, 11px) Arial, sans-serif;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-celebration__supporter-label {
  max-width: 100%;
  color: rgba(255, 226, 156, 0.88);
  font: 750 clamp(7px, 0.9vw, 9px) Arial, sans-serif;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-celebration__enter {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  animation: msCelebrationReveal 650ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.ms-celebration__d1 {
  animation-delay: 400ms;
}

.ms-celebration__d2 {
  animation-delay: 680ms;
}

.ms-celebration__d3 {
  animation-delay: 920ms;
}

.ms-celebration__d4 {
  animation-delay: 780ms;
}

.ms-celebration__d5 {
  animation-delay: 1180ms;
}

.ms-celebration--exit {
  animation: msCelebrationOut 900ms both;
}

.ms-celebration--reduced canvas {
  display: none;
}

.ms-celebration--reduced .ms-celebration__stage-wash {
  opacity: 1;
}

.ms-celebration--reduced .ms-celebration__frame-glow {
  opacity: 0.7;
  animation: none;
}

@keyframes msCelebrationWash {
  to {
    opacity: 1;
  }
}

@keyframes msCelebrationFrame {
  to {
    opacity: 0.95;
    box-shadow:
      inset 0 0 34px rgba(255, 205, 91, 0.38),
      0 0 28px rgba(15, 106, 80, 0.7);
  }
}

@keyframes msCelebrationAura {
  to {
    opacity: 0.45;
    transform: scale(1.1);
  }
}

@keyframes msCelebrationCrown {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.2);
  }
}

@keyframes msCelebrationLine {
  from {
    transform: scaleX(0);
  }
}

@keyframes msCelebrationReveal {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes msCelebrationSupporterIn {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes msCelebrationOut {
  to {
    opacity: 0;
    transform: scale(1.02);
    filter: blur(2px);
  }
}

@media (max-width: 760px) {
  .ms-celebration__message {
    inset: 4%;
  }

  .ms-celebration__crown {
    width: 48%;
  }

  .ms-celebration__avatar {
    width: 38px;
  }

  .ms-celebration__name {
    font-size: clamp(14px, 5vw, 25px);
  }

  .ms-celebration__reaction {
    font-size: clamp(23px, 7.2vw, 34px);
  }

  .ms-celebration__verb {
    font-size: clamp(13px, 4vw, 19px);
  }

  .ms-celebration__context {
    max-width: 96%;
    font-size: clamp(10px, 3vw, 12px);
    letter-spacing: 0.07em;
  }

  .ms-celebration__supporters {
    max-width: 96%;
    border-radius: 18px;
  }

  .ms-celebration__supporter {
    min-width: 56px;
    max-width: 76px;
  }
}

@media (max-height: 450px) and (orientation: landscape) {
  .ms-celebration__message {
    inset: 2% 4%;
  }

  .ms-celebration__message::before,
  .ms-celebration__message::after {
    margin: 3px auto;
  }

  .ms-celebration__avatar {
    width: 33px;
  }

  .ms-celebration__name {
    font-size: clamp(14px, 5vw, 25px);
  }

  .ms-celebration__reaction {
    font-size: clamp(21px, 5.3vw, 32px);
  }

  .ms-celebration__master-title,
  .ms-celebration--double-master .ms-celebration__master-title {
    font-size: clamp(25px, 7vw, 45px);
  }

  .ms-celebration__supporters {
    margin-top: 5px;
    padding: 5px 8px;
  }

  .ms-celebration__context {
    max-width: 96%;
    margin-top: 4px;
    margin-bottom: 2px;
    padding: 3px 7px;
    font-size: clamp(9px, 2.4vw, 11px);
    line-height: 1.08;
  }

  .ms-celebration__supporters-title {
    margin-bottom: 3px;
  }

  .ms-celebration__supporter .ms-celebration__avatar {
    width: 24px;
  }

  .ms-celebration__crown {
    width: 25%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ms-celebration * {
    animation-duration: 800ms !important;
    animation-iteration-count: 1 !important;
  }

  .ms-celebration__frame-glow {
    opacity: 0.6;
  }
}
