/* =========================================================
   MATERMGAME — หน้าแรก (ดีไซน์ v6) — ส่วนเฉพาะหน้าแรก
   ส่วนที่ใช้ร่วม (การ์ด ชิป การ์ดเกม ช่องค้นหา) อยู่ใน style.css หัวข้อ v6
   ========================================================= */
/* ---------- Hero ---------- */
.mgh-hero { padding: 2rem 0 1rem; }
.mgh-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; align-items: center; }
.mgh-intro { display: flex; flex-direction: column; min-width: 0; }
.mgh-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1.1rem;
  padding: .3rem .85rem .3rem .3rem; border-radius: 999px;
  background: rgba(139, 61, 255, .14); border: 1px solid rgba(167, 123, 255, .32); color: #e6dcff; font-size: .82rem;
}
.mgh-badge b { padding: .14rem .6rem; border-radius: 999px; background: var(--qt-grad-gold); color: #fff; font-family: var(--qt-font-head); font-size: .68rem; font-weight: 700; letter-spacing: 1.2px; }
.mgh-h1 { margin: 0 0 1rem; color: #fff; font-size: clamp(2.1rem, 4vw, 3.25rem); font-weight: 700; line-height: 1.14; letter-spacing: -.3px; }
.mgh-h1 span { display: block; padding-bottom: .06em; background: var(--qt-grad-blue-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mgh-lead { max-width: 34em; margin: 0 0 1.5rem; color: var(--qt-text-2); font-size: 1.02rem; line-height: 1.7; }

.mgh-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; color: var(--qt-muted); font-size: .85rem; }
.mgh-quick a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .75rem .25rem .28rem;
  border-radius: 999px; background: var(--mgh-card-2); border: 1px solid var(--mgh-border); color: var(--qt-text);
  transition: border-color .2s ease, background .2s ease;
}
.mgh-quick a:hover { border-color: var(--mgh-border-hi); background: rgba(139, 61, 255, .14); color: #fff; }
.mgh-quick img { width: 24px; height: 24px; border-radius: 8px; object-fit: cover; }
.mgh-trust { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin: 1.5rem 0 0; padding: 0; list-style: none; color: var(--qt-text-2); font-size: .88rem; }
.mgh-trust li { display: flex; align-items: center; gap: .45rem; }
.mgh-trust i { color: var(--qt-cyan); }

/* แบนเนอร์ */
.mgh-banner {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 24px;
  background: #120a32; border: 1px solid var(--mgh-border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(139, 61, 255, .12);
}
.mgh-banner .carousel-inner, .mgh-banner .carousel-item { height: 100%; }
.mgh-slide { position: relative; display: block; height: 100%; color: #fff; }
.mgh-slide:hover { color: #fff; }
.mgh-slide-art, .mgh-slide picture, .mgh-slide picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mgh-slide-art { transition: transform 6s ease; }
.carousel-item.active .mgh-slide-art { transform: scale(1.04); }
.mgh-slide::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(9, 5, 28, .94) 0%, rgba(9, 5, 28, .6) 32%, transparent 62%), linear-gradient(90deg, rgba(9, 5, 28, .5), transparent 55%);
}
.mgh-slide.is-image::after { display: none; }
.mgh-slide-body { position: absolute; left: 0; bottom: 0; z-index: 1; max-width: 640px; padding: 1.6rem 1.8rem 1.8rem; }
.mgh-slide-tag {
  display: inline-block; margin-bottom: .55rem; padding: .2rem .65rem; border-radius: 8px;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-family: var(--qt-font-head); font-size: .74rem; font-weight: 600;
}
.mgh-slide h2 { margin: 0 0 .35rem; font-size: clamp(1.35rem, 2.4vw, 2.05rem); font-weight: 700; line-height: 1.15; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.mgh-slide h2 span { display: block; }
.mgh-slide h2 .g { background: var(--qt-grad-blue-text); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; padding-right: .06em; }
.mgh-slide p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: 30em; margin: 0 0 .95rem; color: rgba(255, 255, 255, .82); font-size: .93rem; }
.mgh-slide .btn { padding: .45rem 1.15rem; font-size: .92rem; }
.mgh-dots { left: auto; right: 1.1rem; bottom: 1.05rem; z-index: 3; justify-content: flex-end; gap: .35rem; margin: 0; }
.mgh-dots [data-bs-target] {
  box-sizing: border-box; width: 8px; height: 8px; margin: 0; padding: 0; border: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .45); opacity: 1; transition: width .3s ease, background .3s ease;
}
.mgh-dots [data-bs-target].active { width: 24px; background: #fff; }
.mgh-arrow {
  top: 50%; bottom: auto; width: 40px; height: 40px; margin: 0 .7rem; transform: translateY(-50%);
  display: grid; place-items: center; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font-size: 1.05rem; opacity: 0; transition: opacity .25s ease, background .2s ease;
}
.mgh-banner:hover .mgh-arrow, .mgh-arrow:focus-visible { opacity: 1; }
.mgh-arrow:hover { background: rgba(255, 255, 255, .3); }
@media (hover: none) { .mgh-arrow { display: none; } }

/* เมนูลัด */
.mgh-shortcuts { display: flex; gap: .75rem; margin-top: 1.75rem; }
.mgh-sc {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem;
  border-radius: 18px; background: var(--mgh-card); border: 1px solid var(--mgh-border); color: var(--qt-text);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.mgh-sc:hover { transform: translateY(-2px); border-color: var(--mgh-border-hi); background: var(--mgh-card-2); color: var(--qt-text); }
.mgh-sc .ic {
  flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; background: var(--c); color: #fff; font-size: 1.25rem; box-shadow: 0 8px 18px -8px var(--cs);
}
.mgh-sc .tx { min-width: 0; }
.mgh-sc b { display: block; overflow: hidden; color: #fff; font-family: var(--qt-font-head); font-size: .95rem; font-weight: 600; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.mgh-sc small { display: block; overflow: hidden; color: var(--qt-muted); font-size: .76rem; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; }
.c-violet { --c: linear-gradient(135deg, #6d4dff, #a855f7); --cs: #8b5cf6; }
.c-blue { --c: linear-gradient(135deg, #3b82f6, #4361ff); --cs: #3b82f6; }
.c-amber { --c: linear-gradient(135deg, #f59e0b, #f97316); --cs: #f59e0b; }
.c-gold { --c: linear-gradient(135deg, #facc15, #eab308); --cs: #eab308; }
.c-gold .ic { color: #4a3300; }
.c-pink { --c: linear-gradient(135deg, #ec4899, #d946ef); --cs: #ec4899; }
.c-line { --c: linear-gradient(135deg, #06c755, #00a947); --cs: #06c755; }

/* ---------- Promotions ---------- */
.mgh-promos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.mgh-promo {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--mgh-radius);
  background: var(--mgh-card); border: 1px solid var(--mgh-border); color: var(--qt-text);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
a.mgh-promo:hover { transform: translateY(-3px); border-color: var(--mgh-border-hi); box-shadow: 0 16px 34px rgba(0, 0, 0, .35); color: var(--qt-text); }
.mgh-promo-img { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 8; background: #160d3d; }
.mgh-promo-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
a.mgh-promo:hover .mgh-promo-img img { transform: scale(1.04); }
.mgh-promo.is-image .mgh-promo-img { aspect-ratio: auto; height: 100%; }
.mgh-promo-body { flex: 1; display: flex; flex-direction: column; padding: 1rem 1.15rem 1.15rem; }
.mgh-promo-tag { align-self: flex-start; margin-bottom: .45rem; padding: .14rem .6rem; border-radius: 7px; background: rgba(255, 111, 216, .14); color: #ff9be4; font-size: .72rem; font-weight: 600; }
.mgh-promo .h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-bottom: .3rem; color: #fff; font-family: var(--qt-font-head); font-size: 1.1rem; font-weight: 700; line-height: 1.35; }
.mgh-promo .p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-bottom: .9rem; color: var(--qt-text-2); font-size: .86rem; line-height: 1.55; }
.mgh-promo .go { margin-top: auto; display: inline-flex; align-items: center; gap: .35rem; color: var(--qt-gold-light); font-family: var(--qt-font-head); font-weight: 600; font-size: .9rem; }
.mgh-bonus {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem;
  padding: 1.4rem; border-radius: var(--mgh-radius); color: #fff;
  background: radial-gradient(260px 200px at 100% 0%, rgba(255, 255, 255, .22), transparent 70%), linear-gradient(150deg, #4c2bd9 0%, #8b3dff 48%, #d946ef 100%);
  box-shadow: 0 18px 40px rgba(139, 61, 255, .35);
  transition: transform .25s ease;
}
.mgh-bonus:hover { transform: translateY(-3px); color: #fff; }
.mgh-bonus::after { content: ""; position: absolute; right: -40px; bottom: -40px; z-index: -1; width: 170px; height: 170px; border-radius: 50%; border: 22px solid rgba(255, 255, 255, .1); }
.mgh-bonus .coin {
  width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%;
  background: var(--qt-grad-coin); color: #6b4100; font-family: var(--qt-font-head); font-size: 1.5rem; font-weight: 700;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), 0 8px 20px rgba(0, 0, 0, .25);
}
.mgh-bonus .t { display: block; }
.mgh-bonus .lbl { display: block; margin-bottom: .2rem; color: rgba(255, 255, 255, .8); font-family: var(--qt-font-head); font-size: .8rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.mgh-bonus .h3 { display: block; margin-bottom: .35rem; font-family: var(--qt-font-head); font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.mgh-bonus .p { display: block; color: rgba(255, 255, 255, .85); font-size: .88rem; line-height: 1.55; }
.mgh-bonus .btn { margin-top: auto; background: #fff; color: #3b1585; font-weight: 600; }
.mgh-bonus:hover .btn { background: #f1e8ff; color: #3b1585; }

/* ---------- 3 steps ---------- */
.mgh-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.mgh-step { position: relative; padding: 1.5rem 1.4rem 1.45rem; border-radius: var(--mgh-radius); background: var(--mgh-card); border: 1px solid var(--mgh-border); }
.mgh-step .no { display: block; font-family: var(--qt-font-head); font-size: 2.5rem; font-weight: 700; line-height: 1; background: var(--qt-grad-blue-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mgh-step .ic { position: absolute; top: 1.4rem; right: 1.4rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(139, 61, 255, .16); color: #cdb3ff; font-size: 1.3rem; }
.mgh-step h3 { margin: 1rem 0 .35rem; color: #fff; font-size: 1.1rem; font-weight: 700; }
.mgh-step p { margin: 0; color: var(--qt-text-2); font-size: .9rem; line-height: 1.6; }
.mgh-step:not(:last-child)::after {
  content: "\f285"; position: absolute; top: 50%; right: -1.05rem; z-index: 2; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: #1a1046; border: 1px solid var(--mgh-border-hi); color: #fff; font-family: bootstrap-icons; font-size: .8rem;
}

/* ---------- Why us (bento) ---------- */
.mgh-why { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); gap: 1rem; }
.mgh-why-main {
  position: relative; isolation: isolate; overflow: hidden; grid-row: span 2;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.25rem; min-height: 300px; padding: 1.8rem;
  border-radius: 24px; border: 1px solid rgba(167, 123, 255, .3);
  background: radial-gradient(420px 280px at 100% 0%, rgba(92, 232, 255, .16), transparent 65%), linear-gradient(150deg, #2a1470 0%, #170c44 62%);
}
.mgh-why-main .big { display: block; margin-bottom: .6rem; font-family: var(--qt-font-head); font-size: clamp(3.4rem, 6.5vw, 5.2rem); font-weight: 700; line-height: .95; background: var(--qt-grad-blue-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mgh-why-main h3 { margin: 0 0 .4rem; color: #fff; font-size: 1.3rem; font-weight: 700; }
.mgh-why-main p { max-width: 22em; margin: 0; color: var(--qt-text-2); font-size: .93rem; line-height: 1.6; }
.mgh-why-main > div { max-width: 62%; }
.mgh-why-main img {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: -1; width: 48%; height: 100%; object-fit: cover; object-position: 40% 30%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 35%, #000 70%); mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 35%, #000 70%);
}
.mgh-why-item { padding: 1.3rem; border-radius: var(--mgh-radius); background: var(--mgh-card); border: 1px solid var(--mgh-border); }
.mgh-why-item .ic { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: .85rem; border-radius: 14px; font-size: 1.25rem; }
.i-green { background: rgba(62, 207, 142, .14); color: #5be3a4; }
.i-amber { background: rgba(255, 196, 77, .14); color: #ffc94d; }
.i-blue { background: rgba(67, 97, 255, .18); color: #8ea2ff; }
.mgh-why-item h3 { margin: 0 0 .3rem; color: #fff; font-size: 1.02rem; font-weight: 700; }
.mgh-why-item p { margin: 0; color: var(--qt-muted); font-size: .86rem; line-height: 1.55; }
.mgh-why-item.is-stat .num { display: block; margin-bottom: .45rem; font-family: var(--qt-font-head); font-size: 2.3rem; font-weight: 700; line-height: 1; color: var(--qt-cyan); }

/* ---------- Payment ---------- */
.mgh-paybox { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); align-items: center; gap: 1.5rem; padding: 1.6rem 1.8rem; border-radius: 24px; background: var(--mgh-card); border: 1px solid var(--mgh-border); }
.mgh-pay { display: flex; flex-wrap: wrap; gap: .55rem; }
.mgh-pay > span {
  display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .85rem .4rem .4rem;
  border-radius: 14px; background: var(--mgh-card-2); border: 1px solid var(--mgh-border);
  color: #fff; font-family: var(--qt-font-head); font-size: .86rem; font-weight: 600; white-space: nowrap;
}
.mgh-pay i {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: var(--b); color: #fff; font-style: normal; font-size: .64rem; font-weight: 700; letter-spacing: .2px;
}
.mgh-pay i.is-credit { background: var(--qt-grad-gold); font-size: .9rem; }
.mgh-pay i.is-credit b { font-weight: 400; }

/* ---------- News ---------- */
.mgh-news { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

/* ---------- Help ---------- */
.mgh-help {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.4rem; padding: 1.5rem 1.8rem;
  border-radius: 24px; border: 1px solid rgba(167, 123, 255, .3);
  background: radial-gradient(400px 200px at 0% 100%, rgba(6, 199, 85, .12), transparent 70%), linear-gradient(115deg, #1c1050 0%, #2a1470 55%, #3a1689 100%);
}
.mgh-help img { flex: 0 0 auto; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 45% 30%; border: 3px solid rgba(255, 255, 255, .18); background: #1a1046; }
.mgh-help .tx { min-width: 0; }
.mgh-help h2 { margin: 0 0 .25rem; color: #fff; font-size: 1.45rem; font-weight: 700; }
.mgh-help p { margin: 0; color: var(--qt-text-2); }
.mgh-help .acts { display: flex; flex-wrap: wrap; gap: .6rem; margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .mgh-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .mgh-banner { order: -1; aspect-ratio: 21 / 9; }
  .mgh-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .mgh-promos, .mgh-news {
    display: flex; gap: .85rem; margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5); padding: 0 calc(var(--bs-gutter-x, 1.5rem) * .5) .4rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .mgh-promos::-webkit-scrollbar, .mgh-news::-webkit-scrollbar { display: none; }
  .mgh-promos > *, .mgh-news > * { flex: 0 0 min(420px, 82%); scroll-snap-align: start; }
  .mgh-steps { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .mgh-step:not(:last-child)::after { content: "\f282"; top: auto; right: auto; bottom: -1.05rem; left: 50%; transform: translateX(-50%); }
  .mgh-why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mgh-why-main { grid-column: span 2; grid-row: auto; min-height: 0; }
  .mgh-paybox { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1.3rem; }
  .mgh-help { flex-wrap: wrap; }
  .mgh-help .acts { margin-left: 0; width: 100%; }
}
@media (max-width: 767.98px) {
  .mgh-hero { padding-top: 1rem; }
  .mgh-banner { aspect-ratio: 16 / 9; border-radius: 20px; }
  .mgh-slide-body { padding: 1rem 1.1rem 1.15rem; }
  .mgh-slide p { display: none; }
  .mgh-slide h2 { font-size: 1.25rem; }
  .mgh-dots { right: .8rem; bottom: .8rem; }
  .mgh-badge { margin-bottom: .8rem; }
  .mgh-lead { font-size: .94rem; margin-bottom: 1.1rem; }
  .mgh-trust { display: none; }
  .mgh-shortcuts { gap: .6rem; margin-top: 1.25rem; }
  .mgh-sc { flex-direction: column; justify-content: center; gap: .5rem; padding: .85rem .35rem .75rem; text-align: center; }
  .mgh-sc .ic { width: 46px; height: 46px; border-radius: 15px; }
  .mgh-sc b { font-size: .82rem; white-space: normal; }
  .mgh-sc small { display: none; }
  .mgh-help { padding: 1.3rem; text-align: center; justify-content: center; }
  .mgh-help .acts { justify-content: center; }
  .mgh-help .acts .btn { flex: 1 1 auto; }
}
@media (max-width: 575.98px) {
  .mgh-why { gap: .75rem; }
  .mgh-why-item { padding: 1rem; }
  .mgh-why-main { padding: 1.4rem; }
  .mgh-why-main > div { max-width: 72%; }
  .mgh-why-main img { width: 52%; opacity: .55; }
  .mgh-why-item .ic { width: 40px; height: 40px; margin-bottom: .65rem; }
  .mgh-pay > span { font-size: .8rem; padding-right: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mgh-slide-art, .carousel-item.active .mgh-slide-art { transition: none; transform: none; }
}
