/* =========================================================
   H Affiliate UI Pack (v1.2.6)
   Popup + Telegram Button + Footer Bonus Bar + Win Notifications
   ========================================================= */

/* -------------------------
   Popup
-------------------------- */
.haui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .75);
  z-index: 9998;
}

.haui-center-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  max-width: calc(100% - 40px);
  background: #ffffff;
  border: 2px solid #ffd700;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
  z-index: 9999;
  overflow: hidden;
}

.haui-center-popup-content {
  position: relative;
}

.haui-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  border: none;
  background: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.haui-popup-img {
  width: 101%;
  height: auto;
  display: block;
}

.haui-popup-inner {
  background: #fff;
}

.haui-popup-inner p {
  margin: 20px;
  text-align: center;
  text-transform: uppercase;
}

.haui-big {
  font-weight: 700;
  font-size: 36px;
  line-height: 36px;
  color: #111;
}

.haui-big span {
  color: #51cf58;
  font-weight: 900;
  font-size: 64px;
  line-height: 64px;
}

.haui-btn {
  display: block;
  margin: 0 20px;
  width: calc(100% - 40px);
  text-align: center;
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
}

.haui-btn:hover {
  opacity: .9;
}

.haui-small {
  font-weight: 700;
  font-size: 16px;
  line-height: 16px;
  color: #111;
  opacity: .6;
  margin: 16px;
}

@media (max-width: 767px) {
  .haui-big {
    font-size: 24px;
    line-height: 24px;
  }

  .haui-big span {
    font-size: 36px;
    line-height: 36px;
  }

  .haui-small {
    font-size: 12px;
    line-height: 12px;
  }
}

/* -------------------------
   Footer Bonus Bar (fixed bottom)
-------------------------- */
.haui-fixed-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 10px 10px;
  background: #0b0b0b;
  color: #ffffff;
  z-index: 9995;
  transform-origin: bottom;
  transition: transform .2s linear, opacity .2s linear;
}

.haui-fixed-bottom.haui-hidden {
  transform: rotateX(90deg);
  opacity: 0;
  pointer-events: none;
}

.haui-fixed-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.haui-fixed-logo img {
  width: 120px;
  height: auto;
  display: block;
}

.haui-fixed-text {
  margin: 0;
  flex: 1;
  font: 800 18px/22px Arial, sans-serif;
  text-transform: uppercase;
}

.haui-fixed-btn {
  display: inline-block;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffd700;
  color: #111;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.haui-fixed-btn:hover {
  opacity: .92;
}

.haui-fixed-close {
  position: absolute;
  top: -6px;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 215, 0, .95);
  color: #111;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.haui-fixed-close:hover {
  opacity: .9;
}

@media (max-width: 768px) {
  .haui-fixed-inner {
    flex-wrap: wrap;
  }

  .haui-fixed-logo img {
    width: 92px;
  }

  .haui-fixed-text {
    font-size: 14px;
    line-height: 18px;
  }
}

/* -------------------------
   Floating Telegram Button
-------------------------- */
.floating-btn {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9997;
  text-decoration: none;
  cursor: pointer;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floating-pulse 2s ease-in-out infinite;
}

@keyframes floating-pulse {

  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }

  50% {
    transform: translateY(-50%) scale(1.12);
  }
}

.floating-btn__text {
  position: absolute;
  width: 65%;
  height: 65%;
  animation: rotate-text 10s linear infinite;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-btn__text img {
  width: 100%;
  height: 100%;
}

.haui-tg-fallback-text {
  font: 900 16px/16px Arial, sans-serif;
  letter-spacing: 2px;
  color: #ffffff;
  background: rgba(0, 0, 0, .6);
  padding: 10px 12px;
  border-radius: 999px;
}

.floating-btn__icon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-btn__outer {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: box-shadow 0.3s ease;
}

.floating-btn__middle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.floating-btn__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  overflow: hidden;
}

.floating-btn img {
  display: block;
  border-radius: 50%;
}

@keyframes rotate-text {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(-360deg);
  }
}

.floating-btn:hover {
  animation-play-state: paused;
  transform: translateY(-50%) scale(1.1);
}

.floating-btn:hover .floating-btn__text {
  animation-play-state: paused;
}

.floating-btn:hover .floating-btn__outer {
  box-shadow: 0 0 26px 8px rgba(255, 215, 0, .65);
}

.haui-tg-fallback-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #229ED9;
  position: relative;
}

.haui-tg-fallback-icon:before {
  content: "";
  position: absolute;
  inset: 10px 12px 12px 10px;
  background: #fff;
  clip-path: polygon(0 50%, 100% 0, 72% 100%);
  transform: rotate(-12deg);
}

@media (min-width: 1500px) {
  .floating-btn {
    right: max(20px, calc((100vw - 1440px) / 2 - 130px));
  }
}

@media (max-width: 768px) {
  .floating-btn {
    right: -6px;
    width: 140px;
    height: 140px;
    top: 40%;
  }

  .floating-btn__text {
    width: 50%;
    height: 50%;
  }

  .floating-btn__inner {
    width: 35px;
    height: 35px;
  }

}

/* -------------------------
   Win Notifications
-------------------------- */
#win-notifications-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9996;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.win-notification {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.1);
  min-width: 280px;
  max-width: 350px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  animation: hauiSlideIn 0.4s ease forwards;
}

.win-notification.haui-hiding {
  animation: hauiSlideOut 0.3s ease forwards;
}

@keyframes hauiSlideIn {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes hauiSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0);
  }

  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

.win-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-decoration: none;
  cursor: pointer;
}

.win-link:hover .win-text {
  color: #ffd700;
}

.win-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 215, 0, 0.5);
  flex-shrink: 0;
}

.win-content {
  flex: 1;
  min-width: 0;
}

.win-text {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}

.win-name {
  color: #ffd700;
  font-weight: 600;
}

.win-amount {
  color: #00ff88;
  font-weight: 700;
}

.win-game {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.win-close:hover {
  color: #fff;
}

@media (max-width: 768px) {
  #win-notifications-container {
    top: auto;
    bottom: 110px;
    right: 10px;
    left: 10px;
  }

  .win-notification {
    min-width: auto;
    max-width: none;
    width: 100%;
  }

  .win-avatar {
    width: 40px;
    height: 40px;
  }

  .win-text {
    font-size: 13px;
  }

  .win-game {
    font-size: 11px;
  }
}

/* -------------------------
   Shared mobile hide
-------------------------- */
.haui-hide-mobile {
  display: block;
}

@media (max-width: 768px) {
  .haui-hide-mobile {
    display: none !important;
  }
}