/* หน้าจอคอม (กว้าง 1024px ขึ้นไป): เนื้อหาเต็มความกว้าง ส่วนมือถือใช้สไตล์เดิมทั้งหมด */
.hd-play,
.hd-links,
.lh-bg-left-dt,
.lh-bg-right-dt,
.mh-rank-name,
.mhm-box-icon { display: none; }

@media (min-width: 1024px) {
    /* ปลดความกว้างแบบมือถือ */
    html .landing-page > .container {
        max-width: none !important;
        box-shadow: none !important;
    }
    html body.member-home #app > .container {
        max-width: none;
    }
    html body.member-home #app > .container > .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        box-shadow: none;
    }
    html .sf-container {
        max-width: none;
    }
    html .sf-container > .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Header: ทรงเฉียงเดิมแบบเต็มจอ โลโก้ → อันดับ → ยอดเงิน/เพชร → หน้าหลัก แจ้งเตือน เมนู */
    html .member-header {
        width: auto;
    }
    html .member-header,
    html .landing-header {
        --lh-row-h: 70px;
    }
    html .lh-bg-left,
    html .lh-bg-right {
        display: none;
    }
    html .lh-bg-left-dt,
    html .lh-bg-right-dt {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        display: block;
        height: 100%;
        pointer-events: none;
    }
    html .lh-bg-left-dt {
        width: 101%;
    }
    html .lh-bg-right-dt {
        width: 100%;
    }
    html .lh-marquee {
        left: calc((100% - max(20%, 250px)) * 0.2606);
    }
    html .mh-economy {
        left: calc(var(--lh-logo) + clamp(56px, 7vw, 110px));
        right: 8%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
    }
    html .mh-rank {
        order: -1;
        flex: 1 1 380px;
        min-width: 190px;
        max-width: 380px;
        gap: 10px;
    }
    html .mh-rank img {
        flex: 0 0 38px;
        width: 38px;
        height: 42px;
    }
    html .mh-rank-info {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        column-gap: 10px;
        row-gap: 4px;
        padding-right: 0;
    }
    html .mh-rank-name {
        display: block;
        grid-column: 1 / -1;
        color: var(--ta-f5b53c,#f5b53c);
        font-size: 22px;
        font-weight: 500;
        line-height: 1.1;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }
    html .mh-rank-bar {
        grid-row: 2;
        grid-column: 1;
        height: 10px;
    }
    html .mh-rank-text {
        grid-row: 2;
        grid-column: 2;
        font-size: 14px;
    }
    html .mh-pills {
        display: flex;
        flex: 0 0 auto;
        gap: 16px;
        width: auto;
    }
    html .mh-pill {
        width: auto;
        min-width: clamp(150px, 15vw, 240px);
        height: 44px;
        gap: 8px;
        padding: 4px 6px 4px 5px;
    }
    html .mh-pill .mh-ico {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
    }
    html .mh-pill .mh-num {
        flex: 1 0 auto;
        overflow: visible;
        font-size: 20px;
        font-weight: 500;
    }
    html .mh-pill .mh-plus {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
    }
    html .mh-sparkles .one {
        width: 12px;
        height: 12px;
    }
    html .mh-sparkles .two {
        width: 10px;
        height: 10px;
    }
    html .lh-left {
        flex: 1 1 0;
        min-width: 0;
    }
    html .lh-right {
        flex: 0 0 max(20%, 250px);
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 16px;
        padding-right: 18px;
    }
    html .hd-links {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 14px;
    }
    html .hd-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 0;
        border: 0;
        background: none;
        color: var(--tf-ffffff,#ffffff) !important;
        font-family: 'Kanit', sans-serif;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.1;
        text-decoration: none !important;
        text-shadow: 0 1px 2px rgba(0,0,0,0.6);
        cursor: pointer;
    }
    html .hd-link span {
        white-space: nowrap;
    }
    html .hd-link img {
        width: 32px;
        height: 30px;
        object-fit: contain;
    }
    html .hd-link:hover img {
        transform: translateY(-1px);
    }
    html .lh-menu-btn {
        flex: 0 0 56px;
        width: 56px;
        padding: 0;
    }
    html .lh-actions {
        right: 3%;
        justify-content: flex-end;
        gap: 14px;
    }
    html .lh-btn {
        flex: 0 0 auto;
        width: clamp(170px, 19vw, 300px);
        max-width: none;
        height: 44px;
        padding: 0 16px;
        border-radius: 12px;
        font-size: 16px;
    }
    html .lh-drawer-overlay .lh-drawer {
        top: var(--lh-row-h, 70px);
        right: 0;
    }
    html .lh-drawer-overlay .lh-drawer.member-drawer::after {
        flex-basis: 0;
    }
    html .lh-marquee-label {
        padding: 0 10px 0 16px;
    }
    html .hd-link:focus-visible,
    html .hd-play:focus-visible {
        outline: 2px solid var(--ta-ffe794,#ffe794);
        outline-offset: 2px;
    }

    /* ปุ่มเล่นเกมลอยขวา (แทนเมนูลอยด้านล่าง) */
    html .hd-play {
        position: fixed;
        top: 150px;
        right: 18px;
        z-index: 999;
        display: block;
        width: 84px;
        height: 84px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: none;
        text-decoration: none !important;
        cursor: pointer;
    }
    html .hd-play-bg img {
        display: block;
        width: 100%;
        height: 100%;
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.55));
    }
    html .hd-play-joy {
        position: absolute;
        top: 13%;
        left: 18%;
        width: 64%;
        height: auto;
        animation: hdHiThere 3.2s ease-in-out infinite;
    }
    html .hd-play-text {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 15%;
        color: var(--ta-ffe69a,#ffe69a);
        font-family: 'Kanit', sans-serif;
        font-size: 13px;
        font-weight: 500;
        line-height: 1;
        text-align: center;
        text-shadow: 0 1px 2px rgba(0,0,0,0.8);
        animation: hdBlink 1.4s ease-in-out infinite;
    }
    html .hd-play:hover .hd-play-bg img {
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.55)) brightness(1.15);
    }

    /* แบนเนอร์ภาพเดียวเต็มความกว้าง */
    html .lb-banner {
        aspect-ratio: 4.8 / 1;
        max-height: 380px;
    }
    html .lb-banner.has-banner {
        aspect-ratio: auto;
        max-height: none;
    }

    /* เกมใหม่ / กำลังแตก / โปรด ซ้าย 40% + ประเภทเกมหลายคอลัมน์ขวา 60% */
    html .lc-nav {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 22px;
        padding: 14px 16px 0;
    }
    html .lc-nav .lc-features {
        grid-template-columns: repeat(3, clamp(132px, 11.5vw, 200px));
        padding: 0;
        gap: 4px;
    }
    html .lc-nav .lc-feature {
        height: auto;
        aspect-ratio: 1.2 / 1;
    }
    html .lc-nav .lc-cats {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px 12px;
        padding: 0;
        overflow: visible;
    }
    html .lc-nav .lc-cat {
        width: 100%;
        min-width: 0;
    }

    /* แถวเกม: หลายใบขนาดเล็ก เลื่อนด้วยแถบเลื่อนได้ */
    html .game-content {
        padding-left: 16px;
        padding-right: 16px;
    }
    html .lc-rail,
    html .lc-rail-4 {
        grid-auto-columns: calc((100% - 7 * 12px) / 8);
        gap: 12px;
        padding-bottom: 10px;
        scrollbar-width: thin;
        scrollbar-color: rgba(var(--ta-ffd66b-rgb,255,214,107),0.55) transparent;
    }
    html .lc-rail::-webkit-scrollbar {
        display: block;
        height: 6px;
    }
    html .lc-rail::-webkit-scrollbar-thumb {
        border-radius: 3px;
        background: rgba(var(--ta-ffd66b-rgb,255,214,107),0.55);
    }
    html .pv-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 18px 14px;
    }
    html .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 20px 14px;
    }

    /* หน้าหลักสมาชิก: คอลัมน์กลางจอ / แถวบน อันดับ + ยอดเงิน + แนะนำเพื่อน + คืนยอดเสีย / เมนู 5 คอลัมน์ */
    html div.member-home {
        max-width: 1260px;
        margin: 14px auto 0;
        padding: 0 0 24px;
    }
    html div.member-home .wrap-menu-top {
        display: grid;
        grid-template-columns: minmax(0, 30fr) minmax(0, 70fr);
        align-items: stretch;
        gap: 14px;
    }
    html div.member-home .box-ranking-home {
        min-width: 0;
    }
    html div.member-home .box-ranking-home .bg-container {
        height: 100%;
        min-height: 150px;
        gap: 14px;
        padding: 14px 20px 14px 12px;
    }
    html div.member-home .mhm-rank-img {
        flex: 0 0 96px;
    }
    html div.member-home .mhm-rank-img img {
        width: 96px;
        height: 90px;
    }
    html div.member-home .mhm-user {
        font-size: 22px;
    }
    html div.member-home .mhm-rank-name {
        font-size: 15px;
    }
    html div.member-home .b-info-ranking small {
        margin-top: 8px;
        font-size: 14px;
    }
    html div.member-home .mhm-bar {
        height: 10px;
        margin-top: 6px;
    }
    html div.member-home .box-transaction {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        margin-top: 0;
    }
    html div.member-home .mhm-side {
        display: contents;
    }
    html div.member-home .box-deposit-withdraw {
        order: 1;
        min-height: 150px;
        padding: 16px 20px;
    }
    html div.member-home .box-affiliate {
        order: 2;
    }
    html div.member-home .box-cashback {
        order: 3;
    }
    html div.member-home :is(.box-cashback, .box-affiliate) {
        min-height: 150px;
        padding: 16px 20px 16px 28px;
    }
    html div.member-home .mhm-row {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 2px;
        height: auto;
    }
    html div.member-home .box-text {
        flex: none;
        position: relative;
        z-index: 1;
        text-align: left;
    }
    html div.member-home .box-text .mhm-label,
    html div.member-home .box-deposit-withdraw .mhm-label {
        font-size: 17px;
    }
    html div.member-home .box-text .text-number,
    html div.member-home .box-deposit-withdraw .text-number {
        margin-top: 2px;
        font-size: clamp(22px, 2vw, 28px);
    }
    html div.member-home :is(.box-cashback, .box-affiliate) .mhm-claim {
        position: relative;
        z-index: 1;
        width: clamp(120px, 11vw, 150px);
        height: 40px;
        margin: 10px 0 0;
        font-size: 15px;
    }
    html div.member-home .box-deposit-withdraw .group-button {
        width: calc(100% - 20px);
        max-width: 300px;
        gap: 8px;
        margin-top: 12px;
    }
    html div.member-home .box-deposit-withdraw .group-button button {
        height: 40px;
        font-size: 15px;
    }
    html div.member-home .decal-transaction-mb {
        top: 12px;
        right: 22px;
        width: 88px;
        height: 88px;
        transform: none;
    }
    html div.member-home .mhm-box-icon {
        position: absolute;
        top: 50%;
        right: 16px;
        display: block;
        width: clamp(64px, 6.5vw, 96px);
        height: clamp(64px, 6.5vw, 96px);
        object-fit: contain;
        transform: translateY(-50%);
        pointer-events: none;
    }
    html div.member-home .mhm-top10 {
        width: 100%;
        max-width: 640px;
        margin: 4px auto 12px;
    }
    html div.member-home .layout-menu-home {
        margin-top: 20px;
    }
    html div.member-home .layout-menu-10 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 18px 16px;
    }
    html div.member-home .item-menu-home {
        grid-column: auto;
        height: clamp(88px, 7vw, 120px);
    }
    html div.member-home .item-menu-home > :is(a, .mhm-off) {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 0 10px 0 42%;
    }
    html div.member-home .item-menu-home img,
    html div.member-home .item-menu-home .mhm-ph {
        top: 50%;
        left: 3%;
        width: 38%;
        height: 118%;
        transform: translateY(-50%);
    }
    html div.member-home .item-menu-home span {
        font-size: clamp(16px, 1.2vw, 20px);
    }

    /* เมนูลอยด้านล่างใช้เฉพาะมือถือ */
    html .fb-nav {
        display: none !important;
    }
    html.has-fb {
        --fb-space: 0px;
    }
    html .member-lobby.is-sub .game-content {
        padding-bottom: 32px;
    }
}
/* popup ทั้งหมดบนจอคอม: ยืดความกว้าง ขนาดตัวหนังสือ/ปุ่มคงเดิม */
@media (min-width: 1024px) {
    html .pf-modal,
    html .rk-modal,
    html .dp-modal {
        width: min(540px, calc(100vw - 40px));
    }
    html .auth-modal {
        width: min(550px, calc(100vw - 40px));
    }
    html #popupModal .modal-dialog {
        width: min(480px, calc(100vw - 40px));
    }
    html .swal2-container .swal2-popup {
        width: min(460px, calc(100vw - 40px)) !important;
    }
    html .auth-inner {
        padding: 30px 30px 36px;
    }
    html .auth-inner .auth-logo {
        max-width: 190px;
    }
    html .auth-inner .auth-title {
        margin: 16px 0 32px;
    }
    html .auth-inner .auth-field {
        margin-bottom: 22px;
    }
    html .auth-inner .auth-field input,
    html .auth-inner .reg-row input,
    html .auth-inner .reg-row button,
    html .auth-inner .reg-input,
    html .auth-inner .reg-ch-btn {
        height: 46px;
    }
    html .auth-inner .auth-actions {
        gap: 16px;
        margin-top: 32px;
    }
    html .auth-inner .auth-actions > * {
        min-height: 46px;
    }
    html .auth-inner .reg-steps {
        margin-bottom: 36px;
    }
    html .auth-inner .reg-accept {
        margin-top: 28px;
    }
    html .auth-inner .reg-login,
    html .auth-inner .auth-help {
        margin-top: 36px;
    }
    html .auth-inner .reg-bank-actions button {
        height: 44px;
    }
    html .pf-inner {
        padding: 24px 22px 24px;
    }
    html .rk-inner {
        padding: 20px 18px;
    }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    html .mh-pill .mh-num {
        font-size: 17px;
    }
    html .mh-pills {
        gap: 10px;
    }
    html div.member-home .mhm-rank-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    html div.member-home .mhm-user {
        max-width: 100%;
        font-size: 18px;
    }
    html div.member-home .mhm-rank-img {
        flex-basis: 72px;
    }
    html div.member-home .mhm-rank-img img {
        width: 72px;
        height: 68px;
    }
    html div.member-home .decal-transaction-mb {
        top: 8px;
        right: 12px;
        width: 60px;
        height: 60px;
    }
}
@media (min-width: 1600px) {
    html .lc-rail,
    html .lc-rail-4 {
        grid-auto-columns: calc((100% - 9 * 12px) / 10);
    }
}
@keyframes hdHiThere {
    0%, 62%, 100% { transform: rotate(0) scale(1); }
    68% { transform: rotate(-12deg) scale(1.1); }
    74% { transform: rotate(10deg) scale(1.1); }
    80% { transform: rotate(-8deg) scale(1.05); }
    86% { transform: rotate(5deg); }
    92% { transform: rotate(0) scale(1); }
}
@keyframes hdBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
    html .hd-play-joy, html .hd-play-text { animation: none; }
}
