.sb9-root {
  --sb9-c1: #0a4560;
  --sb9-c2: #1790bf;
  --sb9-bottom: 22vh;
  font-family: inherit;
}

/* ---------- overlay ---------- */
.sb9-ov {
  position: fixed;
  z-index: 99998;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  opacity: 0;
  transition: opacity .45s ease;
  will-change: transform, opacity;
}
.sb9-ov.sb9-in { opacity: 1; }

.sb9-full {
  inset: 0;
  touch-action: none;
  overscroll-behavior: contain;
}

/* হোমপেজ ছাড়া অন্য পেজে: নিচ থেকে ওঠা সংক্ষিপ্ত কার্ড */
.sb9-card {
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 40vh;
  max-height: 50vh;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;
}
.sb9-card.sb9-in { transform: none; }

.sb9-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sb9-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.sb9-content { width: 100%; max-width: 480px; }

.sb9-logo {
  display: block;
  width: auto;
  height: auto;
  width: clamp(140px, 40vw, 220px);
  max-width: 100%;
  max-height: 30vh;
  object-fit: contain;
  margin: 0 auto 14px;
}
.sb9-logo.sb9-badge {
  box-sizing: border-box;
  width: clamp(150px, 42vw, 220px);
  height: clamp(150px, 42vw, 220px);
  padding: 2%;
  margin-bottom: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .22), 0 10px 30px rgba(0, 30, 50, .35);
}

.sb9-title {
  margin: 0 0 10px;
  text-shadow: 0 1px 8px rgba(0, 30, 50, .35);
  color: #fff;
  font-size: clamp(20px, 5.2vw, 34px);
  font-weight: 700;
  line-height: 1.35;
}
.sb9-sub {
  margin: 0;
  color: #e3f4fb;
  font-size: clamp(14px, 3.6vw, 18px);
  line-height: 1.5;
  opacity: 1;
}
.sb9-msg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 50vh;
  margin: 0 auto;
}

/* ---------- confetti canvas ---------- */
.sb9-canvas {
  position: fixed;
  inset: 0;
  z-index: 100000;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- minimized icon ---------- */
.sb9-icon {
  position: fixed;
  z-index: 99990;
  bottom: 22vh;
  bottom: var(--sb9-bottom, 22vh);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  padding: 5px;
  box-sizing: border-box;
  border: 2px solid var(--sb9-c2);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  color: var(--sb9-c1);
  overflow: visible;
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: opacity .3s ease, transform .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.sb9-right { right: 10px; right: calc(10px + env(safe-area-inset-right, 0px)); }
.sb9-left  { left: 10px;  left: calc(10px + env(safe-area-inset-left, 0px)); }

.sb9-icon.sb9-hidden {
  opacity: 0;
  transform: scale(.6);
  pointer-events: none;
}
.sb9-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.sb9-icon:focus-visible { outline: 3px solid #ffd54f; outline-offset: 2px; }

.sb9-icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid var(--sb9-c2);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.sb9-icon.sb9-pulse::after { animation: sb9ring 1.1s ease-out 3; }
.sb9-icon.sb9-pulse { animation: sb9wob 1.1s ease-in-out 3; }
.sb9-icon.sb9-pop { animation: sb9pop .5s ease; }

@keyframes sb9ring {
  0%   { transform: scale(1);   opacity: .85; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes sb9wob {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}
@keyframes sb9pop {
  0%   { transform: scale(.5); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .sb9-ov, .sb9-card, .sb9-icon { transition: none !important; }
  .sb9-icon.sb9-pulse, .sb9-icon.sb9-pulse::after, .sb9-icon.sb9-pop { animation: none !important; }
}

@media print {
  .sb9-root { display: none !important; }
}
