/**
 * Y888 Rewrite — Marquees
 * Fresh CSS for the announcement bar (.y888-marquee) and the winner
 * marquee section (winner-marquee). Rewritten from scratch using
 * reference values measured from the compiled theme CSS.
 *
 * Tokens only. No hashed class names.
 * RTL overrides preserved via [dir="rtl"].
 */

/* ============================================================
 * 1. Announcement bar (.y888-marquee)
 * The pill-shaped notice strip under the hero slider:
 * [icon] [scrolling announcement text] [message icon]
 * ============================================================ */

.y888-marquee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 0.5rem;
  margin: 0 var(--y888-space-md);
  padding: 0 0 0 var(--y888-space-xs);
  border-radius: 0.5rem;
  font-size: var(--y888-font-size-md);
  font-family: var(--y888-font-family);
  color: var(--y888-text);
  background: var(--y888-bg-card);
  box-shadow: 0 0.03rem 0.09rem rgba(0, 0, 0, 0);
  overflow: hidden;
  box-sizing: border-box;
}

[dir="rtl"] .y888-marquee {
  padding: 0 var(--y888-space-xs) 0 0;
}

/* Links inside announcements use the brand color */
.y888-marquee a,
.y888-marquee a:visited {
  color: var(--y888-primary);
}

/* Left announcement icon (megaphone) — matches index.html .left-icon class */
.y888-marquee__icon,
.y888-marquee .left-icon {
  width: 0.36rem;
  height: 0.36rem;
  flex-shrink: 0;
  margin-right: var(--y888-space-sm);
  object-fit: contain;
}

/* Right icon (envelope) — reference shows it BIGGER */
.y888-marquee-right,
.y888-marquee .right-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-left: 0.08rem;
}
.y888-marquee-right img,
.y888-marquee .right-icon img {
  width: 0.44rem;
  height: 0.44rem;
  object-fit: contain;
}

[dir="rtl"] .y888-marquee__icon {
  margin-right: 0;
  margin-left: var(--y888-space-sm);
}

/* Swiper viewport: the scrolling text window */
.y888-marquee__swiper {
  display: inline-block;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  height: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
}

/* Scrolling text content */
.y888-marquee__content {
  min-width: 100%;
  line-height: 0.35rem;
  padding-right: var(--y888-space-xs);
  font-size: var(--y888-font-size-md);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

[dir="rtl"] .y888-marquee__content {
  padding-right: 0;
  padding-left: var(--y888-space-xs);
}

.y888-marquee__content p {
  display: inline-block;
  margin: 0 var(--y888-space-xs) 0 0;
}

[dir="rtl"] .y888-marquee__content p {
  margin: 0 0 0 var(--y888-space-xs);
}

.y888-marquee__content br {
  display: contents;
}

.y888-marquee__content div,
.y888-marquee__content p,
.y888-marquee__content strong,
.y888-marquee__content span {
  font-size: var(--y888-font-size-md);
}

.y888-marquee__content img {
  width: auto;
  height: var(--y888-font-size-md);
  vertical-align: baseline;
}

/* Right message icon */
.y888-marquee__right {
  width: 0.6rem;
  flex-shrink: 0;
  margin-left: var(--y888-space-sm);
  cursor: pointer;
}

[dir="rtl"] .y888-marquee__right {
  margin-left: 0;
  margin-right: var(--y888-space-sm);
}

.y888-marquee__right img {
  width: 0.52rem;
  height: auto;
  display: block;
}

/* Retry / loading state fills the bar */
.y888-marquee__retry {
  display: flex;
  align-items: center;
  width: 100%;
  margin-left: var(--y888-space-lg);
}

[dir="rtl"] .y888-marquee__retry {
  margin-left: 0;
  margin-right: var(--y888-space-lg);
}

/* CSS-only horizontal scroll fallback (used when JS swiper is absent) */
@keyframes y888-marquee-text-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.y888-marquee__content--css-scroll {
  display: inline-block;
  width: max-content;
  animation: y888-marquee-text-scroll 18s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .y888-marquee__content--css-scroll {
    animation: none;
  }
}

/* ============================================================
 * 2. Winner marquee section (winner-marquee)
 * "GRAND PRIZE RECORD" — 2-row grid carousel, both rows scroll
 * left continuously. Cards interleave column-flow:
 * card 1 -> row 1, card 2 -> row 2, card 3 -> row 1, ...
 * Reference config: d:2 (2 rows), 73s linear infinite loop.
 * ============================================================ */

winner-marquee {
  display: block;
  width: 100%;
  padding: 0 var(--y888-space-md);
  overflow: hidden;
  box-sizing: border-box;
}

.y888-winner {
  width: 100%;
  overflow: hidden;
}

/* Section title */
.y888-winner__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--y888-space-sm);
  margin: 0 var(--y888-space-sm);
  text-align: center;
  color: var(--y888-text);
  font-family: var(--y888-font-family);
  font-size: 0.3rem;
  font-weight: var(--y888-font-weight);
}

.y888-winner__title img {
  width: 1.5rem;
  height: 0.35rem;
  object-fit: contain;
}

/* Viewport masks the scrolling track */
.y888-winner__viewport {
  overflow: hidden;
  margin-top: var(--y888-space-md);
}

/* Scrolling track: 2-row grid, column flow, seamless -50% loop.
   Content is duplicated once in the DOM for the seamless loop. */
.y888-winner__track {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  column-gap: var(--y888-space-md);
  row-gap: var(--y888-space-md);
  width: max-content;
  animation: y888-winner-scroll 73s linear infinite;
}

@keyframes y888-winner-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .y888-winner__track {
    animation: none;
  }
}

/* Winner card */
.y888-winner-card {
  width: 2.74rem;
  display: flex;
  align-items: center;
  padding: var(--y888-space-sm);
  border-radius: var(--y888-radius-md);
  border: 0.01rem solid var(--y888-border);
  background-color: var(--y888-bg-card);
  box-sizing: border-box;
  cursor: pointer;
  font-family: var(--y888-font-family);
}

/* Game thumbnail */
.y888-winner-card__thumb {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.08rem;
  flex-shrink: 0;
  object-fit: cover;
}

/* Text column */
.y888-winner-card__body {
  flex: 1;
  min-width: 0;
  margin-left: 0.12rem;
  text-align: left;
}

[dir="rtl"] .y888-winner-card__body {
  margin-left: 0;
  margin-right: 0.12rem;
  text-align: right;
}

/* "Congrats 7***31" line */
.y888-winner-card__user {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--y888-font-size-sm);
  font-weight: var(--y888-font-weight);
  line-height: 1.4;
  color: var(--y888-text);
}

.y888-winner-card__congrats {
  color: var(--y888-success);
}

/* "won ৳12,500 in Aviator" line */
.y888-winner-card__prize {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--y888-font-size-sm);
  font-weight: var(--y888-font-weight);
  line-height: 1.4;
  color: var(--y888-text-muted);
}

.y888-winner-card__amount {
  color: var(--y888-warning);
  font-weight: 700;
}

/* Fix: prevent marquee track overflow */
.y888-marquee__swiper,
.y888-winner-viewport {
  overflow: hidden;
}

/* Fix: winner-marquee component overflow (actual class names) */
.winner-marquee,
.winner-marquee__viewport {
  overflow: hidden;
  max-width: 100%;
}

/* ============================================================
 * Marquee text scroll — seamless left scroll (reference behavior)
 * ============================================================ */
.y888-marquee .seamless-scroll-inner {
  display: flex;
  align-items: center;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.y888-marquee .seamless-main-scroller {
  display: inline-flex;
  width: max-content;
  animation: y888-marquee-text-scroll 18s linear infinite;
  will-change: transform;
}
.y888-marquee .y888-placeholder {
  display: none;
}
.y888-marquee .y888-marquee-content {
  white-space: nowrap;
  font-size: 0.22rem;
  padding-right: 2rem;
}

/* Marquee middle swiper: take available space but not all */
.y888-marquee .ui-swipe.swiper {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
