/* ------------------------------
  ฟ้อนต์ + รีเซ็ตพื้นฐาน
-------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Prompt", sans-serif;
}

body {
    background: #111119;
    color: #e0e0e0;
    line-height: 1.5;
}

/* ------------------------------
  NAVBARS
-------------------------------- */

/* --- 1. Navbar สำหรับ Index Page (top-nav) --- */
.top-nav {
    width: 100%;
    background: linear-gradient(90deg, #111129, #1a1a3f);
    padding: 12px 18px;
    border-bottom: 2px solid #00c8ff;
    display: flex;
    justify-content: center;
}

.top-nav .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    width: 100%;
}

/* โลโก้ชิดซ้ายสุด */
.top-nav .logo-text {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 5px #00d4ff;
    flex-shrink: 0;
    margin-right: auto;
}

.top-nav .right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- 2. Navbar สำหรับ Home Page (navbar, balance, menu-btn) --- */
.navbar {
    width: 100%;
    background: linear-gradient(90deg, #111129, #1a1a3f);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00c8ff;
    position: relative;
    z-index: 100;
}

.navbar .brand {
    font-size: 22px;
    font-weight: 600;
    color: #00d4ff;
    text-shadow: 0 0 5px #00d4ff;
}

.navbar .balance {
    color: #ffd166;
    font-weight: 500;
}

.menu-btn {
    font-size: 28px;
    cursor: pointer;
    color: #ffd166;
    transition: .2s;
}

.menu-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 100%;
    background: #1a1a2e;
    display: none;
    flex-direction: column;
    border-bottom: 2px solid #00c8ff;
    z-index: 50;
}

.menu-panel.show {
    display: flex;
}

.menu-panel a {
    padding: 15px;
    border-bottom: 1px solid #0d1c29;
    font-size: 17px;
    text-decoration: none;
    color: #cce7ff;
    transition: .2s;
}

.menu-panel a:hover {
    background: #0e1823;
    color: #00d4ff;
}

/* ------------------------------
  MAIN CONTAINER & HEADINGS
-------------------------------- */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 20px auto;
}

/* ---------- H2 Style ใหม่ ---------- */
h2 {
    margin: 25px 0 15px 0;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 8px #1957ff, 0 0 15px rgba(0, 212, 255, 0.4);
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 50px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099ff);
}

/* ------------------------------
  GAME GRID — ตารางแสดงเกม
-------------------------------- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px 0;
}

.game-card {
    background: #252538;
    padding: 10px;
    border-radius: 12px;
    text-align: center;
    transition: transform .25s, box-shadow .25s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

.game-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.game-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: none;
    transition: transform .3s;
}

.game-card:hover .game-img {
    transform: scale(1.03);
}

.game-card h3 {
    margin-top: 10px;
    font-size: 18px;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.2;
}

.game-card p {
    display: none;
}

/* ------------------------------
  BUTTONS — ปุ่ม "เติมเกม" ฟ้านีออนอมเขียว
-------------------------------- */
.btn:not(.btn-nav) {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #00c8d4, #009688);
    /* ฟ้านีออนอมเขียว */
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 12px rgba(0, 200, 212, 0.5);
    /* เงาอมเขียว */
    border: none;
    cursor: pointer;
}

.btn:not(.btn-nav):hover:not(:disabled) {
    background: linear-gradient(180deg, #00e0ff, #00bfa0);
    /* ไล่โทนฟ้า-เขียวเวลาชี้ */
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 224, 255, 0.7);
    /* Glow เขียวฟ้าเวลาชี้ */
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.top-nav .btn-nav {
    display: inline-block;
    padding: 5px 12px;
    background: #00d4ff;
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.top-nav .btn-nav:hover {
    background: #0099ff;
}

/* ------------------------------
  FOOTER
-------------------------------- */
footer {
    margin-top: 50px;
    text-align: center;
    padding: 20px;
    color: #cce7ff;
    background: #101024;
    border-top: 2px solid #00d4ff;
}

/* ------------------------------
  Responsive Mobile
-------------------------------- */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .game-card {
        padding: 8px;
    }

    .game-card h3 {
        font-size: 16px;
    }

    h2 {
        font-size: 24px;
    }

    h2::after {
        width: 40px;
        height: 3px;
        bottom: -5px;
    }
}

@media (max-width: 480px) {
    .top-nav .nav-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .top-nav .logo-text {
        font-size: 18px;
        margin-right: auto;
    }

    .top-nav .right {
        gap: 6px;
    }

    .menu-btn {
        font-size: 26px;
    }

    h2 {
        font-size: 20px;
    }

    h2::after {
        width: 30px;
        height: 2px;
        bottom: -4px;
    }
}