/**
 * Yalla Game static shell — v2 (cache-busted filename).
 * Companion to js/yalla-main-v2.js; keep lightweight.
 */
:root {
  --yalla-asset-version: 4;
}

html {
  scroll-behavior: smooth;
}

/* ── Mobile hub tabbar (glass, 4 slots) — Home · Highlights · Fields · Profile ── */
@media (max-width: 767px) {
  body:has(nav.yalla-hub-tabbar) {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

nav.yalla-hub-tabbar {
  display: none;
}

@media (max-width: 767px) {
  nav.yalla-hub-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    gap: 4px;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem 1rem 0 0;
    background: rgba(21, 18, 26, 0.55);
    -webkit-backdrop-filter: blur(16px) saturate(1.35);
    backdrop-filter: blur(16px) saturate(1.35);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  }

  .yalla-hub-tabbar__item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(203, 195, 215, 0.88);
    font-family: "Lexend", system-ui, sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    -webkit-tap-highlight-color: transparent;
  }

  .yalla-hub-tabbar__item:active {
    transform: translateY(1px);
  }

  .yalla-hub-tabbar__icon.material-symbols-outlined {
    font-size: 22px;
    line-height: 1;
  }

  .yalla-hub-tabbar__item--active,
  .yalla-hub-tabbar__item[aria-current="page"] {
    color: #f5f3ff;
    background: rgba(167, 139, 250, 0.14);
  }

  .yalla-hub-tabbar__item--active .material-symbols-outlined,
  .yalla-hub-tabbar__item[aria-current="page"] .material-symbols-outlined {
    font-variation-settings: "FILL" 1;
  }

  .yalla-hub-tabbar__label {
    letter-spacing: 0.02em;
  }
}

/* ── Hero Banner (Swiper) ─────────────────────────────────────────────────── */

/* Outer wrapper: full-width, stacks swiper + bottom bar */
.yalla-hero-banner {
  position: relative;
  overflow: hidden;
}

/* Swiper container — سطح المكتب: نفس السلوك السابق */
.yalla-hero-swiper {
  width: 100%;
  height: 92dvh;
  min-height: 520px;
  max-height: 820px;
}

/* Each slide — يملأ ارتفاع السوايبر (كل العناصر داخله مطلقة) */
.yalla-hero-slide {
  position: relative;
  display: block;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

/* Background image */
.yalla-hero-slide__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 8s ease;
  will-change: transform;
  filter: brightness(1.14) saturate(1.06);
}
.swiper-slide-active .yalla-hero-slide__bg {
  transform: scale(1.05);
}

/* Full-bleed overlay: removed heavy black wash — photo stays bright */
.yalla-hero-slide__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: transparent;
}

/*
 * تباين أسفل الشريحة بعرض كامل — يمنع «خط» عمودي كان يظهر عند حافة صندوق النص
 * (تدرج كان على .yalla-hero-slide__content بعرض max 56rem)
 */
.yalla-hero-slide::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(50%, 18rem);
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(10, 8, 16, 0.26) 0%,
    rgba(10, 8, 16, 0.07) 50%,
    transparent 100%
  );
}

/*
 * نص الهيرو: مطلق أسفل الشريحة + بداية السطر (يسار LTR / يمين RTL)
 * يضمن عدم توسيط الصندوق حتى لو Tailwind أو Swiper غيّر تدفق الـ flex
 */
.yalla-hero-slide__content {
  position: absolute;
  z-index: 3;
  left: 0;
  right: auto;
  bottom: 0;
  width: min(100%, 56rem);
  max-width: 56rem;
  margin: 0;
  padding-block: clamp(1rem, 3.5vh, 1.75rem) clamp(1.75rem, 7vh, 4rem);
  padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: start;
  box-sizing: border-box;
  background: transparent;
}

@media (min-width: 768px) {
  .yalla-hero-slide__content {
    padding-block: clamp(1.25rem, 4vh, 2rem) clamp(2rem, 8vh, 4.5rem);
    padding-inline: max(1.5rem, env(safe-area-inset-left, 0px)) max(1.5rem, env(safe-area-inset-right, 0px));
    width: min(100%, 56rem);
  }
}

/* صندوق النص على اليسار الفعلي؛ في RTL محاذاة العناصر لليسار = flex-end على المحور الأفقي */
html[dir="rtl"] .yalla-hero-slide__content {
  align-items: flex-end;
}
html[dir="rtl"] .yalla-hero-slide__actions {
  justify-content: flex-end;
}

/* ── هاتف فقط (<768px): بانر مضغوط، cover، بدون تداخل مع الهيدر الثابت — الكمبيوتر بدون تغيير */
@media (max-width: 767px) {
  /* مسافة تحت الهيدر fixed (yallagame: header ~py-4 + شعار) */
  .yalla-hero-banner {
    margin-top: calc(4.25rem + env(safe-area-inset-top, 0px));
    padding-inline: 0;
  }

  /* شريط البحث تحت السلايدر: يظهر من 768px فما فوق فقط — الموبايل: بانر ثم Quick Search */
  .yalla-hero-banner > .yalla-hero-bottom {
    display: none !important;
  }

  /* ارتفاع ثابت للموبايل — بدون max/min/aspect-ratio */
  .yalla-hero-swiper.swiper,
  .yalla-hero-swiper {
    width: 100% !important;
    height: 450px !important;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 0 0 0.75rem 0.75rem;
  }

  .yalla-hero-swiper .swiper-wrapper {
    height: 450px !important;
  }

  .yalla-hero-swiper .yalla-hero-slide,
  .yalla-hero-slide {
    height: 450px !important;
  }

  .yalla-hero-slide__bg {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    background-color: #07060b;
  }

  .swiper-slide-active .yalla-hero-slide__bg {
    transform: none;
  }

  .yalla-hero-slide__content {
    padding-block: 0.35rem 2.5rem;
    padding-inline: max(0.65rem, env(safe-area-inset-left, 0px)) max(0.65rem, env(safe-area-inset-right, 0px));
    padding-bottom: calc(2.25rem + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: none;
    gap: 0.35rem;
  }

  .yalla-hero-slide::after {
    height: min(65%, 9.5rem);
    background: linear-gradient(
      to top,
      rgba(10, 8, 16, 0.9) 0%,
      rgba(10, 8, 16, 0.48) 50%,
      transparent 100%
    );
  }

  .yalla-hero-slide__badge {
    font-size: 0.55rem !important;
    padding: 0.15rem 0.45rem !important;
    gap: 0.2rem;
  }

  .yalla-hero-slide__badge .material-symbols-outlined {
    font-size: 0.75rem !important;
  }

  .yalla-hero-slide__title {
    font-size: clamp(1.05rem, 4.5vw, 1.35rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  }

  .yalla-hero-slide__desc {
    font-size: 0.65rem !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
  }

  .yalla-hero-slide__btn {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.65rem !important;
    border-radius: 0.5rem !important;
  }

  .yalla-hero-slide__actions {
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  /* نقاط السوايبر: فوق النص بقليل، واضحة */
  .yalla-hero-pagination.swiper-pagination-horizontal,
  .yalla-hero-pagination {
    bottom: 0.45rem !important;
    z-index: 5 !important;
    padding: 0 0.25rem;
    pointer-events: auto;
  }

  .yalla-hero-pagination .swiper-pagination-bullet {
    width: 6px !important;
    height: 6px !important;
    margin: 0 3px !important;
  }

  .yalla-hero-pagination .swiper-pagination-bullet-active {
    width: 18px !important;
    height: 6px !important;
  }
}

/* Badge pill */
.yalla-hero-slide__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4b5fd;
  width: fit-content;
}

/* Title */
.yalla-hero-slide__title {
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #f5f3ff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
  margin: 0;
}

/* Description */
.yalla-hero-slide__desc {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(203, 195, 215, 0.85);
  max-width: 40rem;
  margin: 0;
}

@media (min-width: 768px) {
  .yalla-hero-slide__desc {
    font-size: 1.125rem;
  }
}

/* CTA buttons row — محاذاة بداية السطر (يسار LTR / يمين RTL) */
.yalla-hero-slide__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.yalla-hero-slide__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: filter 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.yalla-hero-slide__btn:active { transform: scale(0.97); }

.yalla-hero-slide__btn--primary {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45);
}
.yalla-hero-slide__btn--primary:hover { filter: brightness(1.12); }

.yalla-hero-slide__btn--outline {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: #f5f3ff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.yalla-hero-slide__btn--outline:hover { background: rgba(255,255,255,0.14); }

/* Pagination dots */
.yalla-hero-pagination {
  bottom: 1rem !important;
}
.yalla-hero-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.45);
  opacity: 1;
  transition: width 0.3s, background 0.3s;
}
.yalla-hero-pagination .swiper-pagination-bullet-active {
  width: 24px;
  border-radius: 4px;
  background: #a78bfa;
}

/* Navigation arrows */
.yalla-hero-nav {
  color: #a78bfa !important;
  --swiper-navigation-size: 1.5rem;
}
.yalla-hero-nav::after { font-weight: 900 !important; }

@media (max-width: 639px) {
  .yalla-hero-nav { display: none !important; }
}

/* Bottom bar: search bar only */
.yalla-hero-bottom {
  background: var(--yalla-bg, #0a0810);
  padding: 1.25rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.yalla-hero-search {
  padding: 0.5rem;
  border-radius: 1rem;
}

/* Quick Search — category icon row (replaces legacy matchmaking CTA block) */
.yalla-qc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.yalla-qc-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f5f3ff;
}

@media (min-width: 768px) {
  .yalla-qc-title {
    font-size: 1.25rem;
  }
}

.yalla-qc-seeall {
  font-size: 0.875rem;
  font-weight: 600;
  color: #c4b5fd;
  text-decoration: none;
  white-space: nowrap;
}

.yalla-qc-seeall:hover {
  color: #e9d5ff;
}

/* Quick Search row — horizontal scroll always, no visible scrollbar, no wrapping ever */
.yalla-qc-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 1rem 1.25rem;
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  padding-bottom: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.yalla-qc-row::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.yalla-qc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 4.25rem;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.yalla-qc-item:active {
  transform: scale(0.97);
}

.yalla-qc-icon {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.yalla-qc-item:hover .yalla-qc-icon {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.35);
  transform: translateY(-2px);
}

.yalla-qc-icon .material-symbols-outlined {
  font-size: 1.75rem;
  line-height: 1;
  color: #c4b5fd;
}

.yalla-qc-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(245, 243, 255, 0.92);
  text-align: center;
  line-height: 1.2;
}

/* Auth cards strip (shown only to guests) */
.yalla-hero-auth-cards {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1.5rem;
  max-width: 48rem;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 640px) {
  .yalla-hero-auth-cards { grid-template-columns: 1fr 1fr; }
}

/* ── Trending Venues: outer row shell (LTR/RTL) ── */
#yalla-trending-venues-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ── Trending Venues Carousel - Mobile adjustments ── */
@media (max-width: 767px) {
  #trending-venues-carousel {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 1.5rem; /* px-6 from parent div */
    scroll-padding-right: 1.5rem; /* px-6 from parent div */
  }

  /* RTL (e.g. yallagame.ar.html): same horizontal “swipe sideways” feel as English */
  html[dir="rtl"] #trending-venues-carousel {
    direction: ltr;
  }

  html[dir="rtl"] #trending-venues-carousel > .carousel-item {
    direction: rtl;
  }

  #trending-venues-carousel > .carousel-item {
    scroll-snap-align: start;
    width: 90%; /* Adjust as needed */
  }

  /* Hide scrollbar for a cleaner look */
  #trending-venues-carousel::-webkit-scrollbar {
    display: none;
  }
  #trending-venues-carousel {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
}

/* ── Arenas page: mobile venue grid (arenas.html #bento-grid) — desktop/tablet unchanged above 767px ── */
@media (max-width: 767px) {
  #bento-grid.bento-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: minmax(200px, auto) !important;
    gap: 10px !important;
    align-items: stretch;
  }

  /* Undo featured / bento spans so two cards fit per row (Tailwind col/row span) */
  #bento-grid.bento-grid > .bento-card {
    grid-column: span 1 / span 1 !important;
    grid-row: span 1 / span 1 !important;
    min-height: 200px;
    border-radius: 1rem !important;
  }

  #bento-grid.bento-grid > .bento-card > img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  #bento-grid.bento-grid > .bento-card .absolute.bottom-0 {
    padding: 0.5rem 0.45rem !important;
  }

  #bento-grid.bento-grid > .bento-card h3 {
    font-size: 0.8125rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.15rem !important;
  }

  #bento-grid.bento-grid > .bento-card p.text-sm,
  #bento-grid.bento-grid > .bento-card .font-label.text-sm {
    font-size: 0.65rem !important;
    line-height: 1.25 !important;
  }

  #bento-grid.bento-grid > .bento-card p.text-xl,
  #bento-grid.bento-grid > .bento-card p.text-2xl {
    font-size: 0.8125rem !important;
    line-height: 1.2 !important;
  }

  #bento-grid.bento-grid > .bento-card p.text-xs {
    font-size: 0.6rem !important;
  }

  #bento-grid.bento-grid > .bento-card .material-symbols-outlined {
    font-size: 14px !important;
  }

  #bento-grid.bento-grid > .bento-card button.open-field-btn {
    padding: 0.3rem 0.45rem !important;
    font-size: 10px !important;
    margin-top: 0.25rem !important;
    border-radius: 0.5rem !important;
  }

  /* Featured (first) card: stack title block + price so nothing collides */
  #bento-grid.bento-grid > .bento-card:first-child .absolute.bottom-0 > .flex.justify-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.35rem;
  }

  #bento-grid.bento-grid > .bento-card:first-child .text-right {
    text-align: left !important;
    margin-left: 0 !important;
    width: 100%;
  }

  #bento-grid.bento-grid > .bento-card:first-child .uppercase.tracking-wider {
    font-size: 0.55rem !important;
    padding: 0.1rem 0.35rem !important;
    margin-bottom: 0.2rem !important;
  }
}

/* ── Top Highlights: horizontal strip (LTR + RTL) — do not collapse when JS paints cards ── */
#yalla-home-highlights-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-height: 13.5rem;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

#yalla-home-highlights-row > article {
  flex: 0 0 auto;
}

#yalla-home-highlights-row .yalla-home-highlight-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

#yalla-home-highlights-row::-webkit-scrollbar {
  height: 6px;
}

#yalla-home-highlights-row::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

/* Hero — final pass: soften bottom veil on every breakpoint without editing existing @media blocks */
.yalla-hero-slide::after {
  background: linear-gradient(
    to top,
    rgba(10, 8, 16, 0.28) 0%,
    rgba(10, 8, 16, 0.085) 52%,
    transparent 100%
  ) !important;
}
.yalla-hero-slide__overlay {
  background: transparent !important;
}
