/* =========================================================
   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, 0.75);
  z-index: 9998;
}

.haui-center-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54em;
  max-width: calc(100% - 40px);
  background: var(--color-light);
  border: 2px solid var(--color-accent);
  border-radius: 16px;
  z-index: 9999;
  overflow: hidden;
}

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

.haui-close-btn {
  position: absolute;
  top: 0.25em;
  right: 0.25em;
  border: none;
  padding: 0;
  background: none;
  font-size: 2.25em;
  line-height: 1;
  cursor: pointer;
  color: var(--color-main);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

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

.haui-popup-inner {
  padding: 2em 1.25em;
}

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

.haui-big {
  font-weight: 600;
  font-size: 2em;
  line-height: 1.2;
  color: var(--color-main);
}

.haui-big span {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 2em;
  line-height: 1.2;
}

.haui-popup-inner .btn-theme {
  width: 100%;
  text-align: center;
  font-size: 1.25em;
  margin: 0em 0 1.6em 0;
}

.haui-small {
  font-weight: 700;
  font-size: 1em;
  line-height: 1.1;
  color: var(--color-main);
  opacity: 0.6;
  margin: 16px;
}

@media only screen and (max-width: 479px) {
  .haui-big {
    font-size: 1.5em;
  }
  .haui-popup-inner .btn-theme {
    margin-bottom: 1em;
  }
  .haui-small {
    font-size: 0.85em;
  }
}

/* -------------------------
   Footer Bonus Bar (fixed bottom)
-------------------------- */
.haui-fixed-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1em var(--padding-global--padding-global);
  background: var(--color-accent);
  color: #ffffff;
  z-index: 9995;
  transform-origin: bottom;
  transition:
    transform 0.2s linear,
    opacity 0.2s linear;
}

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

.haui-fixed-inner {
  max-width: 90rem;
  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-size: 1.25em;
  text-transform: uppercase;
  color: var(--color-main);
}

.haui-fixed-btn {
  background: var(--color-main);
  color: var(--color-light);
  padding: 0.75em 1.5em;
  border-radius: var(--border-radius--medium);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  line-height: 1.25;
}

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

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

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

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

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

@media only screen and (max-width: 479px) {
  .haui-fixed-text {
    font-size: 0.85em;
    line-height: 1.15;
  }
}

/* -------------------------
   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, 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 var(--color-accent);
}

.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 only screen and (max-width: 991px) {
  .floating-btn {
    right: 0;
    width: 140px;
    height: 140px;
    top: 60%;
  }

  .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: var(--button-gradient);
  border: 1px solid var(--color-main);
  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: var(--color-main);
}

.win-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-main);
  flex-shrink: 0;
}

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

.win-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-light);
  line-height: 1.3;
  margin-bottom: 4px;
}

.win-name {
  color: var(--color-main);
  font-weight: 600;
}

.win-amount {
  color: var(--color-main-mid);
  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: var(--color-main-mid);
}

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

  .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;
  }
}
