/* Offers & promotions overlay layer (offers_plan.md §5).
   Base layout for every promotional effect; theme packs (themes/*.css) only
   recolor/decorate on top of these rules. Everything is scoped under
   .ftg-promo / .ftg-promo-<id> so nothing can leak into the ordinary site
   skin, and colors come from the skin variables (--m-*) with fallbacks so
   both day and night skins stay coherent. When no promotion is active the
   server never emits this stylesheet at all. */

/* -- diagonal corner ribbon (public pages) --------------------------------
   Rendered only when the hero banner is NOT active (the hero supersedes it —
   two overlapping announcements hurt readability). Band sized so a typical
   banner text fits without ellipsis. */
.ftg-promo-ribbon {
  position: fixed;
  top: 24px;
  left: -40px;
  z-index: 1200;
  transform: rotate(-45deg);
  background: var(--promo-accent, #c0392b);
  color: var(--promo-on-accent, #fff);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 5px 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  white-space: nowrap;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}
.ftg-promo-ribbon span { display: inline; }

/* -- full-width hero banner strip (public pages) --------------------------- */
.ftg-promo-hero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 20px;
  background: var(--promo-band, linear-gradient(90deg, #b03a2e, #d4ac0d));
  color: var(--promo-on-band, #fff);
  border-bottom: 2px solid var(--promo-accent, #c0392b);
}
.ftg-promo-hero-img {
  height: 44px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
}
.ftg-promo-hero-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.ftg-promo-hero-title {
  font-weight: 800;
  font-size: 15px;
}
.ftg-promo-hero-cta {
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  color: inherit;
  width: fit-content;
}
.ftg-promo-hero-badge {
  font-size: 16px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .18);
  border: 1.5px solid rgba(255, 255, 255, .5);
  white-space: nowrap;
}

/* -- logged-in shell notice banner ---------------------------------------- */
.ftg-promo-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 16px;
  border: 1.5px solid var(--promo-accent, #c0392b);
  border-radius: 10px;
  background: var(--promo-band, #fdf2e9);
  color: var(--promo-on-band, #6e2c00);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--m-border, #e5e7eb);
}
.ftg-promo-notice-img { height: 30px; width: auto; border-radius: 6px; }
.ftg-promo-notice-txt { flex: 1; min-width: 0; }
.ftg-promo-notice-badge {
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--promo-accent, #c0392b);
  color: var(--promo-on-accent, #fff);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.ftg-promo-notice-cta {
  text-decoration: underline;
  color: inherit;
  white-space: nowrap;
}
.ftg-promo-notice-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  opacity: .7;
}
.ftg-promo-notice-close:hover { opacity: 1; background: rgba(0, 0, 0, .08); }

/* -- mascot hat: themed glyph over the brand toad (anchored in the header) -- */
.ftg-promo-hat {
  position: absolute;
  top: -14px;
  left: 10px;
  z-index: 5;
  font-size: 20px;
  line-height: 1;
  transform: rotate(-14deg);
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}

/* -- falling particles (CSS-only, no JS) -----------------------------------
   The container is clipped to --ftg-promo-end (percent of the viewport
   height), so glyphs visually disappear at that line; the fall keyframe
   travels just past it. Modality classes: vertical/oblique/casual share the
   fall keyframe (the per-glyph --ftg-promo-drift decides the trajectory),
   accumulate runs a one-shot pile animation (ease-in, fill forwards) that
   rests each glyph at --ftg-promo-rest px above the bottom of the window. */
.ftg-promo-particles {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--ftg-promo-end, 100) * 1vh);
  z-index: 1199;
  overflow: hidden;
  pointer-events: none;
}
.ftg-promo-particles span {
  position: absolute;
  top: -6vh;
  font-size: 16px;
  opacity: .8;
  /* Duration / delay / size / opacity / drift are randomized per glyph by
     the server render model (seeded per promotion) so the fall never reads
     as regular columns. Negative delays start every glyph mid-fall on
     first paint (no empty-screen warm-up). */
  animation: ftg-promo-fall 9s linear infinite;
}
@keyframes ftg-promo-fall {
  from { transform: translateY(-6vh) translateX(0) rotate(0deg); }
  to { transform: translateY(calc(var(--ftg-promo-end, 100) * 1.08vh)) translateX(var(--ftg-promo-drift, 0px)) rotate(360deg); }
}
@keyframes ftg-promo-pile {
  from { transform: translateY(-6vh) translateX(0) rotate(0deg); }
  to {
    transform: translateY(calc(var(--ftg-promo-end, 100) * 1vh - var(--ftg-promo-rest, 24px)))
               translateX(var(--ftg-promo-drift, 0px)) rotate(80deg);
  }
}
.ftg-promo-particles--accumulate span {
  animation-name: ftg-promo-pile;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-timing-function: ease-in;
}
@media (prefers-reduced-motion: reduce) {
  .ftg-promo-particles { display: none; }
}

/* -- pricing-grid promo price (crossed-out original) ----------------------- */
.hp-price-old {
  text-decoration: line-through;
  opacity: .55;
  font-weight: 600;
}
.hp-price-promo-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--promo-accent, #c0392b);
  color: var(--promo-on-accent, #fff);
  vertical-align: middle;
}
