/* ธีม guest gold (V1WIN) — app.css (แชร์ทุกหน้า: header/footer/index/register …) */
:root {
    --gold-1: #ffe9a0;
    --gold-2: #e9c15a;
    --gold-3: #b98a2c;
    --grad-gold: linear-gradient(180deg, #fdeaa0 0%, #e6b845 48%, #c8912f 100%);
    --bg: #0d0d10;
    --panel: #17181d;
    --panel-2: #1c1d23;
    --line: #2a2b33;
    --muted: #9a9ba4;
    --ink: #f3f3f5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent
}

body {
    font-family: "Kanit", system-ui, -apple-system, "Noto Sans Thai", sans-serif;
    background: #000;
    color: var(--ink);
    -webkit-font-smoothing: antialiased
}

img {
    display: block;
    max-width: 100%
}

a {
    text-decoration: none;
    color: inherit
}

.app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background:
        radial-gradient(130% 50% at 50% 0%, rgba(233, 193, 90, .10), transparent 55%),
        linear-gradient(180deg, #161616 0%, #0d0d10 30%);
    padding-bottom: 84px;
    position: relative
}

/* ── header (โลโก้ + auth) — ติดบนตอนเลื่อน ── */
.head {
    background: linear-gradient(180deg, #2a2a30 0%, #17171b 100%);
    padding: 0 16px 16px;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 2px solid var(--gold-2);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5)
}

.logo {
    display: block;
    width: 80%;
    height: auto;
    margin: 0 auto 0px;
    filter: drop-shadow(0 4px 12px rgba(233, 193, 90, .35))
}

.auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 440px;
    margin: 0 auto
}

.btn {
    position: relative;
    overflow: hidden;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

/* แสงกวาดตอน hover */
.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 55%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
    transform: skewX(-20deg);
    transition: left .55s ease;
    pointer-events: none;
}

.btn:hover::before {
    left: 140%;
}

/* ── ปุ่มทอง 3 มิติ ── */
.btn-gold {
    background: linear-gradient(180deg, #fff3c4 0%, #f1cd63 46%, #d9a63e 100%);
    color: #3a2905;
    border: 1px solid #f7e49c;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .75),
        inset 0 -3px 6px rgba(150, 100, 10, .35),
        0 4px 0 #9c7420,
        0 8px 15px rgba(0, 0, 0, .45);
}

.btn-gold:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .9),
        inset 0 -3px 6px rgba(150, 100, 10, .3),
        0 6px 0 #9c7420,
        0 13px 24px rgba(233, 184, 69, .55);
}

.btn-gold:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 6px rgba(120, 80, 10, .5),
        0 1px 0 #9c7420,
        0 3px 8px rgba(0, 0, 0, .4);
}

/* ── ปุ่มดำ 3 มิติ ── */
.btn-dark {
    background: linear-gradient(180deg, #24262e 0%, #141519 100%);
    color: #fff;
    border: 1px solid #3a3b45;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 4px 0 #050609,
        0 8px 15px rgba(0, 0, 0, .45);
}

.btn-dark:hover {
    transform: translateY(-2px);
    border-color: var(--gold-3);
    color: var(--gold-1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 6px 0 #050609,
        0 13px 24px rgba(0, 0, 0, .5),
        0 0 0 1px rgba(233, 193, 90, .35);
}

.btn-dark:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, .6),
        0 1px 0 #050609,
        0 3px 8px rgba(0, 0, 0, .4);
}

/* ── marquee ── */
.marquee {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    overflow: hidden;
    white-space: nowrap
}

.marquee .mq-track {
    overflow: hidden;
    flex: 1
}

.marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: mq 20s linear infinite;
    font-size: 13.5px;
    color: #eaeaea
}

@keyframes mq {
    from {
        transform: translateX(0)
    }

    to {
        transform: translateX(-100%)
    }
}

.wrap {
    padding: 0 14px
}

/* ── banner / promo slider ── */
.banner {
    position: relative;
    margin: 12px 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
    border: 1px solid #3a2f12
}

.banner img {
    width: 100%;
    height: auto;
    display: block
}

.banner-track {
    display: flex;
    transition: transform .5s cubic-bezier(.4, .2, .2, 1);
    will-change: transform
}

.banner-card {
    flex: 0 0 100%;
    line-height: 0
}

.banner-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 6px
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: width .2s, background .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5)
}

.banner-dot.is-active {
    width: 18px;
    border-radius: 4px;
    background: var(--gold-1)
}

/* ── section title ── */
.sec {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
 
    font-weight: 700;
    font-size: 15px;
    color: #ffe9a8;
    letter-spacing: .3px;
    background: linear-gradient(90deg, transparent, rgba(60, 45, 10, .55), transparent);
    padding: 9px;
    border-radius: 8px
}

/* ── ข้อความวิ่งในแถบ sec (ใช้คู่กับ .sec) ── */
.sec-mq {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    padding: 9px 0;
    margin-top: 8px
}

.sec-mq span {
    display: inline-block;
    padding-left: 100%;
    animation: mq 20s linear infinite
}

/* ── jackpot ── */
.jp {
    position: relative;
    overflow: hidden;
    padding-bottom: 6px;
}

.jp-track {
    display: flex;
    gap: 8px;
    will-change: transform;
}

.jp::-webkit-scrollbar {
    display: none
}

.jp-card {
    flex: none;
    width: 90px
}

.jp-card .th {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #33343d;
    aspect-ratio: 3/4;
    background: #111
}

.jp-card .th img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.jp-card .u {
    font-size: 8.5px;
    color: var(--muted);
    margin-top: 4px;
    text-align: center
}

.jp-card .a {
    font-size: 11px;
    font-weight: 800;
    color: #ffd84d;
    text-align: center;
    margin-top: 1px
}

/* ── games ── */
.games {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 8px
}

.cats {
    display: flex;
    flex-direction: column;
    gap: 9px;
    position: sticky;
    align-self: start;
    top: calc(var(--head-h, 60px) + 6px);
    z-index: 20
}

.cat {
    position: relative;
    background: var(--panel-2);
    border: 1px solid #2a2b33;
    border-radius: 14px;
    padding: 7px 2px 9px;
    text-align: center;
    cursor: pointer;
    transition: .15s;
    /* แสงทองส่องขอบล่างจากในปุ่ม (เกาะมุมโค้ง) + เงาทองแคบใต้ปุ่ม */
    /* box-shadow:
        inset 0 -13px 16px -11px rgba(255, 216, 120, .85),
        0 4px 9px -4px rgba(233, 193, 90, .5); */
}

/* เส้นทองบางเกาะขอบล่าง (โค้งตามมุมปุ่ม) */
.cat::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 30px;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(180deg, transparent, rgba(233, 193, 90, .28));
    box-shadow: inset 0 -1.5px 0 rgba(255, 224, 140, .8);
    pointer-events: none;
    transition: .15s
}

.cat img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin: 0 auto 3px;
    filter: grayscale(.4) brightness(.85)
}

.cat .cl {
    font-size: 10px;
    color: var(--muted)
}

.cat.active {
    border-color: var(--gold-3);
    background: linear-gradient(180deg, #2a2008, #15120a);
    box-shadow: 0 0 0 1px rgba(233, 193, 90, .25) inset
}

.cat.active img {
    filter: none
}

.cat.active .cl {
    color: var(--gold-1)
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    align-content: start
}

.gcard {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #33290f;
    background: #111;
    aspect-ratio: 3/4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35)
}

.gcard img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .2s
}

.gcard:active img {
    transform: scale(.98)
}

/* ── floating contact ── */
.contact {
    position: fixed;
    bottom: 96px;
    right: calc(50% - 236px);
    z-index: 60;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--grad-gold);
    color: #3a2905;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .55)
}

.contact .ci {
    font-size: 18px;
    line-height: 1
}

@media(max-width:520px) {
    .contact {
        right: 14px
    }
}

/* ── bottom nav ── */
/* ── footer เดิม (บาร์แบน ไม่มี notch) — เก็บไว้เผื่อย้อนกลับ ──
.bnav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: 68px;
    background: linear-gradient(180deg, #1a1a1f, #0b0b0e);
    border-top: 1px solid #262730;
    padding: 8px 4px 9px
}
*/

/* ── footer ใหม่: notch เว้ากลาง + เหรียญลอย ── */
.bnav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: 68px;
    padding: 8px 4px 9px;
    background: transparent;
    border: 0;
    overflow: visible;
}

/* พื้นบาร์จริง + รอยเว้าตรงกลาง (มองทะลุเห็นพื้นหลัง) — วางไว้หลังปุ่มด้วย z-index:-1
   ต้องแยกออกมา ไม่งั้น mask จะตัดเหรียญที่ลอยทับตรงกลางหายไปด้วย */
.bnav::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #1a1a1f, #0b0b0e);
    border-top: 1px solid #262730;
    -webkit-mask: radial-gradient(22px at 50% 0, transparent 0 21px, #000 22px);
    /* ปรับความเว้าโค้งตรงกลาง */
    mask: radial-gradient(22px at 50% 0, transparent 0 41px, #000 22px);
}

.bnav a {
    color: var(--muted);
    text-align: center;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px
}

.bnav a .ni {
    font-size: 18px
}

/* ── active เดิม (แค่ตัวหนังสือทอง) — เก็บไว้เผื่อย้อนกลับ ──
.bnav a.active {
    color: var(--gold-1)
}
.bnav a.active .ni {
    filter: drop-shadow(0 0 6px rgba(233, 193, 90, .5))
}
*/

/* ── active ใหม่: กล่องไล่เฉดทอง + เส้นทองด้านบน (raised tab) ── */
.bnav a.active {
    align-self: stretch;
    justify-content: center;
    color: var(--gold-1);
    background: linear-gradient(180deg, rgba(233, 193, 90, .22) 0%, rgba(233, 193, 90, .05) 55%, transparent 100%);
    border-radius: 12px 12px 0 0;
    position: relative;
}

/* เส้นทองเรืองแสงด้านบนสุดของปุ่ม */
.bnav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 14%;
    right: 14%;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--gold-1), transparent);
    box-shadow: 0 0 8px rgba(233, 193, 90, .7);
}

.bnav a.active .ni {
    filter: drop-shadow(0 0 6px rgba(233, 193, 90, .5))
}

/* ── เหรียญกลางเดิม — เก็บไว้เผื่อย้อนกลับ ──
.bnav a.center .ni {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--grad-gold);
    color: #3a2905;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-top: -26px;
    border: 3px solid #0b0b0e;
    box-shadow: 0 6px 16px rgba(230, 184, 69, .45)
}
*/

/* ── เหรียญกลางใหม่: ลอยขึ้นไปในรอยเว้า + ขยับลอยเบาๆ ── */
.bnav a.center .ni {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    margin-top: -40px;
    background: radial-gradient(circle at 50% 34%, #ffe9a0 0%, #e9c15a 52%, #b9892f 100%);
    color: #5b3d05;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    border: 3px solid #14110a;
    box-shadow:
        0 0 0 2px rgba(233, 193, 90, .4),
        0 10px 22px rgba(0, 0, 0, .55),
        inset 0 2px 5px rgba(255, 255, 255, .55),
        inset 0 -3px 7px rgba(120, 80, 10, .4);
    position: relative;
    z-index: 3;
    animation: bnavCoinFloat 2.6s ease-in-out infinite;
}

@keyframes bnavCoinFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
    .bnav a.center .ni { animation: none; }
}

/* ── หน้าสมัครสมาชิก (register) ── */
.reg-wrap {
    padding: 18px 16px 40px;
    max-width: 440px;
    margin: 0 auto
}

.reg-card {
    background: var(--panel);
    border: 1px solid #2a2b33;
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .5)
}

.reg-title {
    text-align: center;
    font-weight: 800;
    font-size: 20px;
    color: var(--gold-1);
    margin-bottom: 4px
}

.reg-sub {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px
}

.reg-field {
    margin-bottom: 13px
}

.reg-field label {
    display: block;
    font-size: 13px;
    color: #cfd2da;
    margin-bottom: 6px;
    font-weight: 500
}

.reg-field input,
.reg-field select {
    width: 100%;
    height: 46px;
    border-radius: 11px;
    border: 1px solid #33343d;
    background: rgba(0, 0, 0, .28);
    color: #fff;
    font-size: 15px;
    padding: 0 14px;
    font-family: inherit;
    transition: .15s
}

.reg-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--gold-2) 50%), linear-gradient(135deg, var(--gold-2) 50%, transparent 50%);
    background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat
}

.reg-field select option {
    background: #17181d;
    color: #fff
}

.reg-field input:focus,
.reg-field select:focus {
    outline: 2px solid var(--gold-2);
    border-color: var(--gold-2)
}

.reg-submit {
    width: 100%;
    height: 50px;
    margin-top: 8px
}

.reg-back {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 13.5px;
    color: var(--muted)
}

.reg-back a {
    color: var(--gold-1);
    font-weight: 600
}

/* ── โหมด PC (จอกว้าง) ── */
@media(min-width:820px) {
    body {
        background: #0d0d10
    }

    .app {
        max-width: 1180px;
        padding-bottom: 96px;
        background: radial-gradient(120% 40% at 50% 0%, rgba(233, 193, 90, .10), transparent 55%),
            linear-gradient(180deg, #161616 0%, #0d0d10 22%)
    }

    .head {
        /* padding: 22px 24px 34px; */
        border-bottom-left-radius: 40px;
        border-bottom-right-radius: 40px
    }

    .logo {
        width: 400px;
        /* margin-bottom: 16px */
    }

    .auth {
        max-width: 720px;
        gap: 16px
    }

    .btn {
        height: 50px;
        font-size: 17px
    }

    .marquee {
        padding: 12px 20px
    }

    .wrap {
        padding: 0 22px
    }

    .banner {
        border-radius: 18px
    }

    .sec {
        font-size: 18px;
        margin: 22px 0 14px
    }

    .jp-card {
        width: 150px
    }

    .jp-card .a {
        font-size: 16px
    }

    .games {
        grid-template-columns: 104px 1fr;
        gap: 14px
    }

    .cat {
        padding: 12px 4px 9px
    }

    .cat img {
        width: 38px;
        height: 38px
    }

    .cat .cl {
        font-size: 12.5px
    }

    .grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 14px
    }

    /* เมนูล่าง: จอ PC ให้อยู่กลาง เป็นแท่งมน */
    /* ── เดิม (เก็บไว้เผื่อย้อนกลับ) ──
    .bnav {
        max-width: 700px;
        height: 76px;
        border: 1px solid #2a2b33;
        border-bottom: none;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px
    }
    */
    .bnav {
        max-width: 700px;
        height: 76px;
    }
    /* border/มุมมน ย้ายมาไว้ที่พื้นบาร์ (::before) เพื่อให้ notch + มุมมนอยู่ด้วยกัน */
    .bnav::before {
        border: 1px solid #2a2b33;
        border-bottom: none;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
    }

    .bnav a {
        font-size: 12.5px
    }

    .bnav a .ni {
        font-size: 20px
    }

    .contact {
        right: 32px;
        bottom: 112px;
        width: 60px;
        height: 60px;
        font-size: 11px
    }

    .contact .ci {
        font-size: 20px
    }
}

@media(min-width:1200px) {
    .grid {
        grid-template-columns: repeat(6, 1fr)
    }

    .app {
        max-width: 1280px
    }
}

/* ═══ Modal เข้าสู่ระบบ (gold modal) ═══ */
.gm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 18px
}

.gm-overlay.open {
    display: flex
}

.gm-card {
    width: 100%;
    max-width: 420px;
    position: relative;
    background: linear-gradient(180deg, #2b2c33, #1c1d22);
    border: 1px solid #3a3b45;
    border-radius: 18px;
    padding: 24px 20px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
    animation: gmIn .2s ease
}

@keyframes gmIn {
    from { opacity: 0; transform: translateY(10px) scale(.98) }
    to { opacity: 1; transform: none }
}

.gm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #cfd2da;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 9px;
    transition: .15s
}

.gm-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08)
}

.gm-logo {
    display: block;
    width: 200px;
    height: auto;
    margin: 2px auto 18px;
    filter: drop-shadow(0 4px 12px rgba(233, 193, 90, .35))
}

.gm-field {
    margin-bottom: 15px
}

.gm-field label {
    display: block;
    font-size: 14px;
    color: #e8e9ee;
    font-weight: 600;
    margin-bottom: 7px
}

.gm-field input {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    border: 1px solid #3a3b45;
    background: rgba(0, 0, 0, .3);
    color: #fff;
    font-size: 15px;
    padding: 0 15px;
    font-family: inherit;
    transition: .15s
}

.gm-field input:focus {
    outline: 2px solid var(--gold-2);
    border-color: var(--gold-2)
}

.gm-pass {
    position: relative
}

.gm-pass input {
    padding-right: 48px
}

.gm-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #9a9ba4;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px
}

.gm-eye:hover {
    color: #fff
}

.gm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2px 0 18px
}

.gm-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #cfd2da;
    cursor: pointer
}

.gm-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--gold-2)
}

.gm-forgot {
    font-size: 13.5px;
    color: var(--gold-1);
    font-weight: 600
}

.gm-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    background: #3a3b42;
    color: #8b8d96;
    transition: .15s
}

.gm-submit:not(:disabled) {
    background: var(--grad-gold);
    color: #3a2905;
    box-shadow: 0 4px 0 #9c7420, 0 8px 15px rgba(0, 0, 0, .4)
}

.gm-submit:not(:disabled):hover {
    filter: brightness(1.05);
    transform: translateY(-1px)
}

.gm-submit:disabled {
    cursor: not-allowed
}
