/* ── Game lobby (ported from syrich1.com) — prov rows: max 6 + horizontal scroll ── */
.game-lobby {
  position: relative;
  width: 100%;
  padding: 18px 12px 28px;
  background:
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.08), transparent 42%),
    radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.08), transparent 40%),
    linear-gradient(180deg, #f7f2ff 0%, #f0f0f0 100%);
}

.game-lobby__inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.game-lobby__right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  order: 1;
}

.game-lobby__right .login-panel {
  order: -1;
}

.game-lobby__cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.game-lobby__cat {
  display: block;
  line-height: 0;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.game-lobby__cat:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.05);
}

.game-lobby__cat img {
  width: 100%;
  height: auto;
  display: block;
}

.game-lobby__main {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(248px, 0.82fr);
  gap: 12px;
  align-items: stretch;
}

.game-lobby__freecredit {
  order: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.5px;
  border-radius: 20px;
  overflow: visible;
  background: linear-gradient(135deg, #ffd54a, #ff77c6, #a855f7, #7c3aed);
  background-size: 300% 300%;
  animation: fc-border-flow 12s ease infinite;
  box-shadow:
    0 14px 32px rgba(124, 58, 237, 0.24),
    0 4px 12px rgba(236, 72, 153, 0.12);
}

@keyframes fc-border-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.game-lobby__freecredit-in {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 460px;
  padding-top: 0;
  border-radius: 19px;
  overflow: visible;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(236, 72, 153, 0.22), transparent 58%),
    linear-gradient(180deg, #2a1050 0%, #170b2f 42%, #0a0416 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* หัวป้ายใน flow: ครึ่งบนลอยพ้นกรอบ ครึ่งล่างอยู่บนพื้นมืดของกล่อง */
.game-lobby__freecredit-head {
  position: relative;
  z-index: 3;
  margin: -46px 0 0;
  padding: 0 10px;
  text-align: center;
  line-height: 0;
  pointer-events: none;
}

.game-lobby__freecredit-head img {
  width: min(100%, 280px);
  height: auto;
  display: inline-block;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.game-lobby__freecredit-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 300px;
  padding: 4px 6px 30px;
}

.game-lobby__freecredit-body::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 30px;
  height: 72px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(23, 11, 47, 0.45) 35%,
    rgba(15, 6, 30, 0.88) 72%,
    #0a0416 100%
  );
}

.game-lobby__freecredit-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
  border: 0;
  background: transparent;
  color-scheme: dark;
}

/* ปุ่มคร่อมกึ่งกลางเส้นขอบล่าง — สีทองเข้าธีมเกม */
.game-lobby__freecredit-cta {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 32px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  color: #5b21b6;
  text-decoration: none;
  background: linear-gradient(180deg, #fff7ed 0%, #fbbf24 42%, #f59e0b 100%);
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 6px 20px rgba(245, 158, 11, 0.42),
    0 0 0 3px rgba(124, 58, 237, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.game-lobby__freecredit-cta i {
  font-size: 0.78rem;
  color: #6d28d9;
}

.game-lobby__freecredit-cta:hover {
  transform: translate(-50%, 50%) translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 10px 26px rgba(245, 158, 11, 0.5),
    0 0 0 3px rgba(124, 58, 237, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.game-lobby__providers {
  --prov-gap: 8px;
  --prov-cols: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.game-lobby__prov-wrap {
  position: relative;
  min-width: 0;
}

.game-lobby__prov-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: linear-gradient(90deg, transparent 0%, rgba(247, 242, 255, 0.55) 55%, #f0f0f0 100%);
}

.game-lobby__prov-wrap.is-scrollable::after {
  opacity: 1;
}

.game-lobby__prov-next {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #6d28d9;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(76, 29, 149, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.game-lobby__prov-wrap.is-scrollable .game-lobby__prov-next {
  display: inline-flex;
}

.game-lobby__prov-next:hover {
  transform: translateY(-50%) scale(1.06);
  box-shadow: 0 6px 16px rgba(76, 29, 149, 0.2);
  background: #fff;
}

.game-lobby__prov-next:active {
  transform: translateY(-50%) scale(0.96);
}

.game-lobby__prov-row {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--prov-gap);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0 2px 2px 0;
}

.game-lobby__prov-row::-webkit-scrollbar {
  display: none;
}

.game-lobby__prov-row .game-lobby__card {
  flex: 0 0 auto;
  width: calc((100% - (var(--prov-cols) - 1) * var(--prov-gap)) / var(--prov-cols));
  scroll-snap-align: start;
}

.game-lobby__card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: transparent;
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 10px 22px rgba(76, 29, 149, 0.08);
  line-height: 0;
  align-self: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.game-lobby__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(76, 29, 149, 0.16);
}

.game-lobby__card img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: bottom;
}

/* Desktop full-width — ขยาย lobby ให้เต็มจอ */
@media (min-width: 992px) {
  .game-lobby {
    padding: 22px clamp(18px, 2.8vw, 40px) 34px;
  }

  .game-lobby__main {
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: clamp(14px, 1.6vw, 22px);
    align-items: stretch;
  }

  .game-lobby__right {
    gap: 6px;
  }

  .game-lobby__cats {
    gap: clamp(10px, 1.1vw, 16px);
  }

  .game-lobby__providers {
    --prov-gap: clamp(10px, 1.1vw, 14px);
    gap: clamp(10px, 1.1vw, 14px);
  }

  .game-lobby__card {
    border-radius: clamp(14px, 0.9vw, 18px);
    box-shadow: 0 12px 26px rgba(76, 29, 149, 0.1);
  }

  .game-lobby__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(76, 29, 149, 0.18);
  }

  .game-lobby__freecredit {
    border-radius: clamp(20px, 1.4vw, 26px);
    padding: 2px;
  }

  .game-lobby__freecredit-in {
    min-height: 520px;
    border-radius: clamp(19px, 1.3vw, 24px);
  }

  .game-lobby__freecredit-head {
    margin: clamp(-84px, -6.2vw, -112px) 0 0;
    padding: 0 clamp(10px, 1.2vw, 18px);
  }

  .game-lobby__freecredit-head img {
    width: min(100%, 420px);
  }

  .game-lobby__freecredit-body {
    min-height: 400px;
    padding: 6px clamp(8px, 1vw, 14px) 38px;
  }

  .game-lobby__freecredit-body::after {
    left: clamp(6px, 0.8vw, 12px);
    right: clamp(6px, 0.8vw, 12px);
    bottom: 34px;
    height: clamp(72px, 6vw, 96px);
  }

  .game-lobby__freecredit-frame {
    min-height: 440px;
  }

  .game-lobby__freecredit-cta {
    padding: clamp(11px, 0.95vw, 15px) clamp(34px, 3.2vw, 48px);
    font-size: clamp(0.88rem, 1vw, 1.05rem);
    gap: 10px;
  }

  .game-lobby__freecredit-cta i {
    font-size: clamp(0.78rem, 0.9vw, 0.95rem);
  }
}

@media (max-width: 991px) {
  .game-lobby__inner {
    width: min(1180px, 100%);
  }

  .game-lobby__main {
    grid-template-columns: 1fr;
  }

  .game-lobby__right {
    order: -1;
  }

  .game-lobby__freecredit {
    max-width: 460px;
    margin: 20px auto 0;
    width: 100%;
  }

  .game-lobby__freecredit-frame {
    height: 560px;
  }
}

@media (max-width: 767px) {
  .game-lobby {
    padding: 14px 10px 22px;
  }

  .game-lobby__right {
    gap: 8px;
  }

  .game-lobby__cats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 0;
  }

  .game-lobby__cat:nth-child(1),
  .game-lobby__cat:nth-child(2) {
    margin-bottom: -18px;
  }

  .game-lobby__providers {
    --prov-cols: 3.5;
    gap: 6px;
    margin-right: -10px;
  }

  .game-lobby__prov-row {
    gap: 8px;
    padding: 0 10px 2px 12px;
  }

  .game-lobby__prov-row .game-lobby__card {
    width: calc((100vw - 56px) / var(--prov-cols));
  }

  .game-lobby__card {
    border-radius: 12px;
  }

  .game-lobby__freecredit {
    margin-top: 28px;
  }

  .game-lobby__freecredit-head {
    margin-top: -36px;
  }

  .game-lobby__freecredit-in {
    min-height: 500px;
  }

  .game-lobby__freecredit-frame {
    height: 500px;
  }
}

@media (max-width: 420px) {
  .game-lobby__prov-row {
    padding-left: 10px;
  }

  .game-lobby__prov-row .game-lobby__card {
    width: calc((100vw - 52px) / var(--prov-cols));
  }
}
