:root {
    --background-gradient: linear-gradient(178deg, #ffffFF 10%, #3333ff);
    --gray: #34495e;
    --darkgray: #2c3e50;
}

select {
    /* Reset Select */
    appearance: none;
    outline: 10px red;
    border: 0;
    box-shadow: none;
    /* Personalize */
    flex: 1;
    padding: 0 1em;
    color: #fff;
    background-color: var(--darkgray);
    background-image: none;
    cursor: pointer;
}

/* Custom Select wrapper */
.select {
    position: relative;
    display: flex;
    width: 60%;
    height: 2.5em;
    border-radius: .25em;
    overflow: hidden;
}

/* Arrow */
.select::after {
    content: '\25BC';
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.5em;
    background-color: #34495e;
    transition: .25s all ease;
    pointer-events: none;
}

.down_note {
    display: flex;
    justify-content: center;

}

.modal-header {
    background-color: #00579f;
    /* สีพื้นหลังเวลา */
    border-top-left-radius: 10px;
    /* การโค้งมนในมุมบนซ้าย */
    border-top-right-radius: 10px;
    /* การโค้งมนในมุมบนขวา */
}

.modal-content {
    /* background-color: rgb(3, 83, 174); */
    background-color: #334;
    /* สีพื้นหลังเข้ม */
    border-radius: 15px;
    /* การโค้งมน */
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.5);
    /* เงาของ modal */
    color: #fff;
    /* สีตัวหนังสือ */
    font-size: 14px;
    /* ขนาดตัวอักษรใน modal */
}

.modal-body {
    display: '';
    justify-content: center;
    align-items: center;
    min-height: 300px;

}

.modal-footer {
    display: '';
    color: #06f93d;
    /* สีตัวหนังสือ */
    font-size: 12px;

}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
}

body {
    background-color: black;
}

/* .text-primary {
        color: #007bff;
    } */

.select select {
    width: 60%;
    /* กำหนดความกว้างเท่ากับ container */
    border-radius: 8px;
    /* กำหนดความโค้งมนในมุม */
    padding: 8px;
    /* กำหนดระยะห่างของเนื้อหาภายใน select */
    background-color: #333;
    /* สีพื้นหลังเข้ม */
    color: #fff;
    /* สีตัวหนังสือ */
}

/* CSS */
.table {
    background-color: #454545;
    /* สีพื้นหลังเข้ม */
    color: #fff;
    /* สีตัวหนังสือ */
    font-size: 12px;
    /* ขนาดตัวอักษรในตาราง */
}

.table>:not(caption)>*>* {
    background-color: #454545;
}

.table th {
    /* color: #4496ef; */
    color: #fff;
    /* สีตัวหนังสือส่วนหัวตาราง */
    background-color: #444;
    /* สีพื้นหลังส่วนหัวและท้ายตารางเข้มข้น */
    text-align: center;
}

.table td {
    color: #b5b5b5;
    text-align: center;
    /* จัดกึ่งกลางข้อความในเซลล์ตาราง */
    vertical-align: middle;
    /* จัดกึ่งกลางตัวหนังสือในเซลล์ตาราง */
    /* border-radius: 5px; */
    /* การโค้งมนในมุมของเซลล์ */
    padding: 6px;
    /* ระยะห่างภายในเซลล์ */
}

.table thead th,
.table tfoot th {
    background-color: #333;
    /* สีพื้นหลังส่วนหัวและท้ายตารางเข้มข้น */
}

.description p {
    margin: 5px 0;
}

.w3-white,
.w3-hover-white:hover {
    color: #9b9d9e !important;
    background-color: #141414 !important;
}

.img-thumbnail {
    /* padding: 0.25em; */
    background-color: #222;
    border: var(--bs-border-width) solid #555;
    border-radius: var(--bs-border-radius);
    max-width: 100%;
    height: auto;
}

body {
    background-color: black;
}
.small-dot {
    height: 6px;
    width: 6px;
    background-color: #555;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* ============================================================
   ธีมดำโมเดิร์น (หน้าแรก / การ์ดสินค้า / แถบเมนู)
   ============================================================ */
:root {
    --ag-bg: #070a10;
    --ag-surface: #11151d;
    --ag-surface-2: #171c26;
    --ag-line: rgba(255, 255, 255, .08);
    --ag-text: #e8edf5;
    --ag-muted: #97a2b4;
    --ag-accent: #4f8cff;
    --ag-accent-2: #22d3ee;
    --ag-ok: #2fbf71;
    --ag-warn: #ffb020;
    --ag-danger: #ff5a6a;
}

body {
    background: var(--ag-bg);
    color: var(--ag-text);
    font-family: "Segoe UI", "Noto Sans Thai", "Kanit", system-ui, sans-serif;
}

/* พื้นหลังเรืองแสงจางๆ ด้านบนของหน้า */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(700px 380px at 18% -8%, rgba(79, 140, 255, .16), transparent 70%),
        radial-gradient(620px 340px at 84% -4%, rgba(34, 211, 238, .12), transparent 70%);
}

/* ---------- แถบเมนูด้านบน ---------- */
.navbar.bg-dark {
    background: rgba(10, 13, 20, .82) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ag-line);
}

.navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: .5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.navbar .nav-link {
    color: var(--ag-muted) !important;
    border-radius: 10px;
    padding: 8px 12px !important;
    transition: color .18s, background .18s;
}

.navbar .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .06);
}

.ag-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
}

.ag-lang a {
    color: #9aa3b2;
    text-decoration: none;
}

.ag-lang a.is-on,
.ag-lang a:hover {
    color: #fff;
}

.ag-lang span {
    color: #667085;
}

.navbar .dropdown-menu {
    background: var(--ag-surface-2);
    border: 1px solid var(--ag-line);
    border-radius: 12px;
    padding: 6px;
}

.navbar .dropdown-item {
    color: var(--ag-muted);
    border-radius: 8px;
}

.navbar .dropdown-item:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

/* ---------- ส่วนหัวหน้าแรก ---------- */
.w3-black {
    background: transparent !important;
}

.ag-hero {
    text-align: center;
    padding: 30px 16px 8px;
}

.ag-hero h2 {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0 0 10px;
    background: linear-gradient(90deg, #fff 20%, var(--ag-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ag-hero h2 i,
.card.bg-dark h2 i,
.card.bg-dark h3 i,
.card.bg-dark h4 i {
    -webkit-text-fill-color: var(--ag-accent-2);
    background: none;
}

.ag-hero p {
    color: var(--ag-muted);
    font-size: 15px;
    margin: 0;
}

.ag-point {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 176, 32, .1);
    border: 1px solid rgba(255, 176, 32, .28);
    color: #ffd479;
    font-weight: 600;
}

/* ---------- การ์ดสินค้า ---------- */
/* ขยายพื้นที่เนื้อหาให้พอสำหรับ 3 การ์ดต่อแถว (ค่าเดิมของ w3-content จำกัดไว้ 980px) */
.w3-content {
    max-width: 1240px !important;
}

@media (min-width: 1400px) {
    .w3-content {
        max-width: 1400px !important;
    }
}

/* เรียงกึ่งกลางเสมอ และเต็มที่ 3 ใบต่อแถว (ความกว้างการ์ด + ระยะห่าง จำกัดไว้ในตัว) */
#game_product {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 26px;
    margin-top: 30px;
}

.ag-card-col {
    flex: 0 0 300px;
    max-width: 300px;
    padding: 0;
}

@media (max-width: 640px) {
    .ag-card-col {
        flex-basis: 100%;
        max-width: 320px;
    }
}

/* จอกว้าง (Full HD ขึ้นไป) ขยายพื้นที่และการ์ดให้เต็มตากว่าเดิม */
@media (min-width: 1400px) {
    #game_product {
        gap: 34px;
    }

    .ag-card-col {
        flex-basis: 360px;
        max-width: 360px;
    }

    .ag-card-media {
        height: 200px;
    }

    .ag-card-desc {
        height: 132px;
        font-size: 13.5px;
    }
}

.ag-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--ag-surface-2), var(--ag-surface));
    border: 1px solid var(--ag-line);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.ag-card:hover {
    transform: translateY(-6px);
    border-color: rgba(79, 140, 255, .45);
    box-shadow: 0 22px 46px rgba(0, 0, 0, .6);
}

.ag-card-media {
    position: relative;
    height: 168px;
    background: #0c1017;
}

.ag-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ag-status {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(6px);
    background: rgba(47, 191, 113, .16);
    border: 1px solid rgba(47, 191, 113, .4);
    color: #6ee7a8;
}

.ag-status.is-waiting {
    background: rgba(255, 90, 106, .16);
    border-color: rgba(255, 90, 106, .4);
    color: #ff97a2;
}

.ag-card-body {
    padding: 16px 16px 0;
    flex: 1;
}

.ag-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.ag-card-desc {
    height: 118px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--ag-line);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--ag-muted);
    text-align: left;
}

.ag-card-desc::-webkit-scrollbar {
    width: 6px;
}

.ag-card-desc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 6px;
}

.ag-card-foot {
    padding: 14px 16px 16px;
}

.ag-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--ag-muted);
    font-size: 13px;
}

.ag-price b {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.ag-btn {
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: transform .12s, box-shadow .2s, opacity .2s;
    font-family: inherit;
}

.ag-btn:active {
    transform: translateY(1px);
}

.ag-btn-buy {
    background: linear-gradient(90deg, var(--ag-accent), #6aa6ff);
    box-shadow: 0 10px 22px rgba(79, 140, 255, .28);
}

.ag-btn-buy:hover {
    box-shadow: 0 14px 28px rgba(79, 140, 255, .4);
}

.ag-btn-info {
    margin-top: 8px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--ag-line);
    color: #cfd7e3;
}

.ag-btn-info:hover {
    background: rgba(255, 255, 255, .12);
}

.ag-soon {
    padding: 11px 14px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .04);
    border: 1px dashed rgba(255, 255, 255, .16);
    color: var(--ag-muted);
    font-size: 14px;
    text-align: center;
}

.ag-hwid-wrap {
    max-width: 920px;
    margin: 0 auto 80px;
    padding: 8px 16px 40px;
}

.ag-flash {
    margin: 0 auto 18px;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.ag-flash-ok {
    background: rgba(46, 204, 113, .16);
    border: 1px solid rgba(46, 204, 113, .4);
    color: #8ff0b5;
}

.ag-flash-error {
    background: rgba(231, 76, 60, .16);
    border: 1px solid rgba(231, 76, 60, .4);
    color: #ffb4ab;
}

.ag-hwid-now {
    margin: 8px auto 22px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--ag-line);
    text-align: center;
}

.ag-hwid-now small {
    display: block;
    color: var(--ag-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.ag-hwid-now code {
    display: block;
    color: #fff;
    font-size: 15px;
    letter-spacing: .4px;
    word-break: break-all;
}

.ag-hwid-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 760px) {
    .ag-hwid-grid {
        grid-template-columns: 1fr;
    }
}

.ag-hwid-card {
    text-align: left;
    padding: 22px;
}

.card.bg-dark.ag-hwid-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
}

.ag-hwid-card p {
    color: var(--ag-muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 14px;
}

.ag-hwid-card .ag-point {
    margin: 0 0 16px;
}

.ag-hwid-card label {
    margin-bottom: 6px;
}

.ag-hwid-card .form-control {
    margin-bottom: 12px;
    text-align: left;
}

/* ============================================================
   หน้าอื่น + หลังบ้าน ให้โทนเดียวกับหน้าแรก
   ============================================================ */
body,
body[style] {
    background: var(--ag-bg) !important;
    color: var(--ag-text) !important;
}

.ag-page,
.container.mt-5,
.container[align="center"],
div[align="center"] > .col.d-flex {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.ag-page:has(.ag-pay-wrap),
.ag-page:has(.ag-pay-wrap) > .col.d-flex {
    max-width: 1100px;
}

.card.bg-dark,
.w3-container.card.bg-dark,
.ag-panel {
    background: linear-gradient(180deg, var(--ag-surface-2), var(--ag-surface)) !important;
    border: 1px solid var(--ag-line) !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
    color: var(--ag-text) !important;
}

.card.bg-dark .display-4,
.card.bg-dark .display-6,
.card.bg-dark h2,
.card.bg-dark h3,
.card.bg-dark h4,
.w3-wide.w3-center,
.w3-wide.text-white {
    font-size: clamp(22px, 3vw, 32px) !important;
    font-weight: 800;
    letter-spacing: .4px;
    background: linear-gradient(90deg, #fff 20%, var(--ag-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group,
.mb-3 {
    margin-bottom: 14px;
}

.form-group label,
.form-label,
label {
    display: block;
    text-align: left;
    color: var(--ag-muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-control,
.form-control-sm,
.form-select,
.form-select-sm,
.form-control-file,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select,
.w3-input {
    width: 100%;
    background: #0c1017 !important;
    color: var(--ag-text) !important;
    border: 1px solid var(--ag-line) !important;
    border-radius: 11px !important;
    padding: 10px 12px !important;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus,
.w3-input:focus {
    border-color: rgba(79, 140, 255, .55) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, .15) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #6d7788 !important;
}

.select {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    height: auto;
    border-radius: 11px;
    border: 1px solid var(--ag-line);
    background: #0c1017;
}

.select select,
select.form-select,
select[name="amount"],
select[name="status"] {
    width: 100%;
    background: #0c1017;
    color: #fff;
    border: 0;
    padding: 11px 14px;
}

.input-group {
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--ag-line);
}

.input-group-text {
    background: rgba(79, 140, 255, .16) !important;
    border: 0 !important;
    color: #cfe0ff !important;
}

.input-group .form-control,
.input-group .btn {
    border-radius: 0 !important;
}

.btn,
input[type="submit"] {
    border: 0;
    border-radius: 11px !important;
    font-weight: 700;
    padding: 10px 16px;
    font-family: inherit;
}

.btn-success,
.btn-primary,
input.btn-success,
button.btn-success {
    background: linear-gradient(90deg, var(--ag-accent), #6aa6ff) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(79, 140, 255, .28);
}

.btn-danger,
input.btn-danger {
    background: linear-gradient(90deg, #ff5a6a, #ff7b88) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(255, 90, 106, .22);
}

.btn-secondary {
    background: rgba(255, 255, 255, .08) !important;
    color: #cfd7e3 !important;
    border: 1px solid var(--ag-line) !important;
}

.table,
.table-striped,
.table-bordered,
.w3-table {
    width: 100%;
    color: var(--ag-text) !important;
    background: transparent !important;
    border-color: var(--ag-line) !important;
    font-size: 13px;
}

.table>:not(caption)>*>*,
.table th,
.table td,
.w3-table th,
.w3-table td {
    background: transparent !important;
    color: var(--ag-text) !important;
    border-color: var(--ag-line) !important;
    vertical-align: middle;
}

.table thead th,
.table tfoot th,
.w3-table th,
.w3-table tr.w3-gray th,
.w3-red th,
thead.w3-red th {
    background: rgba(255, 255, 255, .04) !important;
    color: #cfe0ff !important;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid var(--ag-line) !important;
}

.ag-license-card {
    width: 100%;
    max-width: 980px;
    padding: 28px;
}

.ag-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.ag-license-table th,
.ag-license-table td {
    text-align: center !important;
}

.ag-badge {
    display: inline-block;
    min-width: 92px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .2px;
}

.ag-badge.is-on {
    background: rgba(61, 190, 122, .22);
    color: #86e0ad;
}

.ag-badge.is-off {
    background: rgba(227, 93, 106, .22);
    color: #ffb0b7;
}

.ag-badge.is-wait {
    background: rgba(255, 176, 32, .22);
    color: #ffd479;
}

.ag-badge.is-muted {
    background: rgba(255, 255, 255, .1);
    color: #cfd6e0;
}

.ag-pay-wrap {
    width: 100%;
    max-width: 1100px;
    padding: 20px;
}

.ag-pay-table {
    font-size: 14px;
    min-width: 860px;
}

.ag-pay-table th,
.ag-pay-table td {
    text-align: center;
    vertical-align: middle !important;
    padding: 10px 8px !important;
}

.ag-nowrap {
    white-space: nowrap !important;
}

.table tbody tr,
.table tbody tr.w3-white,
.w3-table tr.w3-white,
tr.w3-hover-gray,
tr.w3-text-black {
    color: var(--ag-text) !important;
    background: rgba(255, 255, 255, .02) !important;
}

.table tbody tr:hover,
.w3-table tr:hover,
tr.w3-hover-gray:hover {
    background: rgba(79, 140, 255, .08) !important;
}

.table a,
.w3-table a,
a.button {
    color: var(--ag-accent-2) !important;
    text-decoration: none;
    font-weight: 700;
}

.table a:hover,
a.button:hover {
    color: #fff !important;
}

.w3-green,
.badge.bg-success {
    background: rgba(47, 191, 113, .18) !important;
    color: #6ee7a8 !important;
    border-radius: 999px;
}

.w3-red,
.badge.bg-danger {
    background: rgba(255, 90, 106, .16) !important;
    color: #ff97a2 !important;
    border-radius: 999px;
}

.badge.bg-warning {
    background: rgba(255, 176, 32, .16) !important;
    color: #ffd479 !important;
}

.badge.bg-secondary {
    background: rgba(255, 255, 255, .08) !important;
    color: var(--ag-muted) !important;
}

.w3-ul,
.w3-ul.w3-card-4 {
    border: 0 !important;
    background: transparent !important;
}

.w3-ul li,
.w3-bar.w3-white {
    background: rgba(255, 255, 255, .035) !important;
    color: var(--ag-text) !important;
    border: 1px solid var(--ag-line) !important;
    border-radius: 12px !important;
    margin-bottom: 10px;
    cursor: pointer;
}

.w3-ul li:hover,
.w3-bar.w3-white:hover,
.w3-hover-grey:hover {
    background: rgba(79, 140, 255, .1) !important;
    border-color: rgba(79, 140, 255, .4) !important;
}

.w3-text-blue {
    color: var(--ag-accent-2) !important;
}

.w3-text-red,
.w3-ul .w3-text-red {
    color: var(--ag-danger) !important;
}

.img-thumbnail,
.img-fluid {
    background: #0c1017 !important;
    border: 1px solid var(--ag-line) !important;
    border-radius: 12px !important;
}

.text-muted,
small.text-muted {
    color: var(--ag-muted) !important;
}

hr {
    border-color: var(--ag-line) !important;
    opacity: 1;
}

.w3-modal {
    padding-top: 80px;
    background: rgba(3, 6, 12, .72);
    backdrop-filter: blur(8px);
}

.w3-modal-content.card,
.w3-modal-content.bg-dark,
.ag-modal-card {
    background: linear-gradient(180deg, var(--ag-surface-2), var(--ag-surface)) !important;
    border: 1px solid var(--ag-line) !important;
    border-radius: 18px !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, .55);
    color: var(--ag-text);
}

.modal-content {
    background: var(--ag-surface) !important;
    border: 1px solid var(--ag-line);
    color: var(--ag-text);
}

.modal-header {
    background: transparent !important;
    border-bottom: 1px solid var(--ag-line);
}

footer.fixed-bottom {
    background: rgba(10, 13, 20, .82) !important;
    border-top: 1px solid var(--ag-line);
    backdrop-filter: blur(12px);
}

footer.fixed-bottom h4 {
    font-size: 14px;
    margin: 8px 0;
    color: var(--ag-muted);
    font-weight: 600;
}

body {
    padding-bottom: 56px;
}