/* ================================================================
   WELCOME BONUS BANNER — палитра под fairspincasinohu.com
   (#212132 фон сайта, #ebbe7d акценты)
   ================================================================ */

:root {
  --wb-bg: #1e1e2e;
  --wb-bg-gradient: linear-gradient(135deg, #212132 0%, #272d47 55%, #331554 100%);
  --wb-accent: #ebbe7d;
  --wb-label-color: #ebbe7d;
  --wb-title-color: #ffffff;
  --wb-subtitle-color: #c4c4d4;
  --wb-cta-bg: #fabd79;
  --wb-cta-bg-hover: #ffd49a;
  --wb-cta-color: #ffffff;
  --wb-close-color: #ffffff;
  --wb-close-hover: #ebbe7d;
  --wb-shadow: 0 -4px 32px rgba(0, 0, 0, 0.45);
  --wb-anim-speed: 0.5s;
  /* сдвиг кнопки «наверх» над баннером */
  --wb-scrolltop-lift: 118px;
}

.wb-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1005;
  background: var(--wb-bg-gradient);
  box-shadow: var(--wb-shadow);
  border-top: 2px solid var(--wb-accent);
  padding: 12px 44px 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform var(--wb-anim-speed) cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity var(--wb-anim-speed) ease;
}

.wb-banner.wb-visible {
  transform: translateY(0);
  opacity: 1;
}

.wb-banner.wb-hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.wb-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
}

/* На широких экранах три блока в одну линию с CTA (display:contents у .wb-top) */
.wb-top {
  display: contents;
}

.wb-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(235, 190, 125, 0.45));
  animation: wb-pulse 2s ease-in-out infinite;
}

@keyframes wb-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.wb-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.wb-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wb-label-color);
}

.wb-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--wb-title-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-subtitle {
  font-size: 0.74rem;
  color: var(--wb-subtitle-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-cta {
  display: inline-block;
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 6px;
  background: var(--wb-cta-bg);
  color: var(--wb-cta-color);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.wb-cta:hover {
  background: var(--wb-cta-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.wb-cta:active {
  transform: translateY(0);
}

.wb-cta:focus-visible {
  outline: 2px solid var(--wb-accent);
  outline-offset: 3px;
}

.wb-close {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wb-close-color);
  font-size: 1rem;
  line-height: 1;
  padding: 8px;
  z-index: 2;
  transition: color 0.15s, transform 0.15s;
}

.wb-close:hover {
  color: var(--wb-close-hover);
  transform: translateY(-50%) rotate(90deg);
}

.wb-close:focus-visible {
  outline: 2px solid var(--wb-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wb-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-right: 28px;
  gap: 2px;
}

.wb-countdown-ring {
  position: relative;
  width: 40px;
  height: 40px;
}

.wb-countdown-ring svg {
  transform: rotate(-90deg);
}

.wb-countdown-ring circle.track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 3;
}

.wb-countdown-ring circle.progress {
  fill: none;
  stroke: var(--wb-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.wb-countdown-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.wb-countdown-label {
  font-size: 0.55rem;
  color: var(--wb-subtitle-color);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Попап casino-popup (z-index: 1100) остаётся поверх баннера */
body.wb-banner-visible .scrolltop.js-scrolltop {
  bottom: calc(var(--wb-scrolltop-lift) + env(safe-area-inset-bottom, 0px));
}

/* 361px–549px: верх — иконка + 3 строки + таймер в одном ряду; низ — CTA 95% + крестик 5% */
@media (min-width: 361px) and (max-width: 549px) {
  .wb-banner {
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .wb-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 10px;
    box-sizing: border-box;
  }

  .wb-inner {
    flex-wrap: wrap;
    align-items: stretch;
    align-content: flex-start;
    gap: 10px 0;
  }

  .wb-icon {
    font-size: clamp(1.85rem, 6.2vw, 2.45rem);
    align-self: center;
  }

  .wb-text {
    flex: 1 1 0;
    min-width: 0;
  }

  .wb-label {
    font-size: 0.6rem;
  }

  .wb-title {
    font-size: 0.88rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .wb-subtitle {
    font-size: 0.7rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .wb-countdown {
    margin-right: 0;
    align-self: center;
    justify-content: center;
  }

  .wb-countdown-ring {
    width: 52px;
    height: 52px;
  }

  .wb-countdown-ring svg {
    width: 52px;
    height: 52px;
  }

  .wb-countdown-num {
    font-size: 0.88rem;
  }

  .wb-countdown-label {
    font-size: 0.58rem;
  }

  .wb-cta {
    flex: 0 0 95%;
    width: 95%;
    max-width: 95%;
    box-sizing: border-box;
    text-align: center;
    padding: 10px 12px;
    white-space: normal;
  }

  .wb-close {
    position: static;
    transform: none;
    flex: 0 0 5%;
    width: 5%;
    max-width: 5%;
    min-width: 0;
    padding: 8px 2px;
    box-sizing: border-box;
    align-self: center;
  }

  .wb-close:hover {
    transform: rotate(90deg);
  }

  :root {
    --wb-scrolltop-lift: 148px;
  }
}

@media (min-width: 550px) {
  .wb-top {
    display: contents;
  }

  .wb-inner {
    flex-wrap: nowrap;
  }

  /* DOM после .wb-top: иконка, текст, таймер, CTA, крестик — в ряд как раньше: CTA до таймера */
  .wb-icon {
    order: 1;
  }

  .wb-text {
    order: 2;
  }

  .wb-cta {
    order: 3;
  }

  .wb-countdown {
    order: 4;
  }

  .wb-close {
    order: 5;
  }
}

/* Узкий мобильный: без таймера — приоритет тексту и CTA */
@media (max-width: 360px) {
  .wb-banner {
    padding: 8px 36px 8px 10px;
  }

  .wb-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .wb-countdown {
    display: none;
  }

  .wb-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .wb-cta {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    text-align: center;
    padding: 10px 12px;
    box-sizing: border-box;
  }

  .wb-close {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    flex: none;
    width: auto;
    max-width: none;
    margin-left: 0;
  }

  .wb-close:hover {
    transform: translateY(-50%) rotate(90deg);
  }

  :root {
    --wb-scrolltop-lift: 108px;
  }
}
