.fb-announcement-slot {
  position: sticky;
  inset-block-start: 0;
  z-index: 7;
  pointer-events: none;
}

/* Keep the reading position stable as the delayed message appears. */
.fb-announcement-pending .fb-announcement {
  visibility: hidden;
}

.fb-announcement-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fb-announcement {
  --fb-accent: #ffce6b;
  position: relative;
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  color: #f7f5f0;
  font: 650 14px/1.28 'Exo 2', system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
}

.fb-announcement-bar {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 38px;
  padding: 3px 44px;
  background: linear-gradient(100deg, #211e18, #352918 49%, #211d16);
  border-block: 1px solid #67522c;
  border-block-end-color: #bb9045;
  pointer-events: auto;
}

.fb-announcement-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.fb-announcement-icon {
  flex: none;
  display: block;
  width: 36px;
  color: var(--fb-accent);
}

.fb-announcement-icon svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.fb-announcement-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.fb-announcement-cta {
  display: inline-block;
  margin-inline-start: 6px;
  padding-block: 4px;
  color: var(--fb-accent);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.fb-announcement-cta:hover {
  color: #fff;
}

.fb-announcement-close {
  display: grid;
  position: absolute;
  inset-inline-end: 4px;
  inset-block: 0;
  place-items: center;
  width: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d6d3cc;
  font: 400 21px/1 system-ui, sans-serif;
  cursor: pointer;
}

.fb-announcement-close:hover {
  color: #fff;
  background: #ffffff12;
}

.fb-announcement-close:focus-visible,
.fb-announcement-cta:focus-visible {
  outline: 2px solid var(--fb-accent);
  outline-offset: -1px;
}

.fb-announcement[data-format="achievement"] {
  --fb-accent: #d6baff;
  padding: 4px 8px;
}

.fb-announcement[data-format="achievement"] .fb-announcement-bar {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  border: 1px solid #77658c;
  border-radius: 7px;
  background: linear-gradient(110deg, #2a2634, #201e25);
  box-shadow: 0 2px 7px #0005;
}

.fb-announcement[data-format="achievement"] .fb-announcement-cta {
  padding: 2px 7px 3px;
  border: 1px solid #a58bc4;
  border-radius: 4px;
  text-decoration: none;
}

.fb-announcement[data-format="achievement"] .fb-announcement-cta:hover {
  background: #483652;
}

.fb-announcement[data-format="radio"] {
  --fb-accent: #ff9487;
}

.fb-announcement[data-format="radio"] .fb-announcement-bar {
  background: #1b1d1f;
  border-block-color: #414144;
}

/* Use the actual banner width, including inside the local phone preview. */
@container (max-width: 500px) {
  .fb-announcement-bar {
    padding: 4px 34px;
  }
  .fb-announcement-body {
    gap: 6px;
    font-size: 13px;
  }
  .fb-announcement-icon {
    width: 27px;
  }
  .fb-announcement-close {
    width: 32px;
    inset-inline-end: 0;
  }
  .fb-announcement-cta {
    margin-inline-start: 2px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .fb-announcement-enter .fb-announcement-bar {
    animation: fb-announcement-arrive 260ms ease-out both;
  }
  .fb-announcement-enter .fb-sparkle {
    transform-origin: center;
    animation: fb-announcement-shine 700ms ease-out both;
  }
  .fb-announcement-enter .fb-medal {
    animation: fb-announcement-hop 530ms ease-out both;
  }
  .fb-announcement-enter .fb-confetti {
    transform-origin: center;
    animation: fb-announcement-confetti 610ms ease-out both;
  }
  .fb-announcement-enter .fb-wave {
    animation: fb-announcement-wave 350ms ease-out both;
  }
  .fb-announcement-enter .fb-wave:nth-last-child(2) { animation-delay: 110ms; }
  .fb-announcement-enter .fb-wave:last-child { animation-delay: 220ms; }
}

@keyframes fb-announcement-arrive {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}
@keyframes fb-announcement-shine {
  0% { opacity: 0; transform: scale(.65); }
  55% { opacity: 1; transform: scale(1.15); }
  100% { opacity: .9; transform: none; }
}
@keyframes fb-announcement-hop {
  0%, 100% { transform: none; }
  42% { transform: translateY(-3px); }
  70% { transform: translateY(1px); }
}
@keyframes fb-announcement-confetti {
  0%, 20% { opacity: 0; transform: scale(.6); }
  70% { opacity: 1; transform: scale(1.14); }
  100% { opacity: 1; transform: none; }
}
@keyframes fb-announcement-wave {
  from { opacity: 0; }
  to { opacity: 1; }
}
