/* ===== GameHub theme =====
   Dark aurora + glassmorphism. ปรับสีแบรนด์ได้ที่ตัวแปร --brand1/2/3 ด้านล่างจุดเดียว */

:root {
    --bg1: #070A12;
    --bg2: #0B1224;

    --card: rgba(255, 255, 255, 0.06);
    --card-hover: rgba(255, 255, 255, 0.09);
    --stroke: rgba(255, 255, 255, 0.10);
    --stroke-strong: rgba(255, 255, 255, 0.18);

    --text: #EAF0FF;
    --muted: rgba(234, 240, 255, 0.70);
    --faint: rgba(234, 240, 255, 0.45);

    --brand1: #8B5CF6;
    --brand2: #22D3EE;
    --brand3: #F59E0B;
    --gold: #FCD34D;
    --danger: #FB7185;
    --success: #34D399;

    --grad-brand: linear-gradient(135deg, var(--brand1), var(--brand2));
    --grad-text: linear-gradient(120deg, var(--brand1), var(--brand2) 55%, var(--brand3));
    --grad-gold: linear-gradient(135deg, var(--brand3), var(--gold));

    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.35);

    --radius: 18px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Kanit, "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    line-height: 1.65;
    /* aurora glows ซ้อนบน gradient พื้นหลัง */
    background:
        radial-gradient(1200px 600px at 15% 8%, rgba(139, 92, 246, 0.14), transparent 58%),
        radial-gradient(900px 500px at 85% 14%, rgba(34, 211, 238, 0.11), transparent 58%),
        radial-gradient(900px 600px at 50% 98%, rgba(245, 158, 11, 0.07), transparent 62%),
        linear-gradient(150deg, var(--bg1), var(--bg2));
    background-attachment: fixed;
}

a { color: var(--brand2); text-decoration: none; transition: color .18s ease; }
a:hover { color: #67e8f9; }

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.25; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 10, 18, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--stroke);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
    flex-wrap: wrap;
}

.brand {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand:hover { opacity: .85; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-links > a {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 10px;
    transition: background .18s ease, color .18s ease;
}
.nav-links > a:hover { color: var(--text); background: var(--card); }
.nav-links > a.btn { color: #fff; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    background: var(--grad-brand);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(139, 92, 246, 0.35);
}
.btn:active { transform: translateY(0); }

.btn-vip {
    background: var(--grad-gold);
    color: #1a1206;
}
.btn-vip:hover { color: #1a1206; box-shadow: 0 14px 34px rgba(245, 158, 11, 0.35); }

.btn-outline {
    background: var(--card);
    border: 1px solid var(--stroke-strong);
    color: var(--text);
    box-shadow: none;
}
.btn-outline:hover { background: var(--card-hover); color: var(--text); box-shadow: var(--shadow-sm); }

.btn-danger { background: linear-gradient(135deg, #f43f5e, var(--danger)); }
.btn-danger:hover { box-shadow: 0 14px 34px rgba(244, 63, 94, 0.35); }

/* ปุ่มลิงก์ VIP ที่คนยังไม่ใช่ VIP เห็น: เห็นว่ามีอยู่ แต่สื่อชัดว่ายังกดใช้งานไม่ได้ */
.btn-locked {
    background: rgba(245, 158, 11, 0.10);
    border: 1px dashed rgba(245, 158, 11, 0.55);
    color: var(--gold);
    box-shadow: none;
}
.btn-locked:hover {
    background: rgba(245, 158, 11, 0.18);
    border-style: solid;
    color: var(--gold);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.22);
}

.download-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 22px;
}

/* ===== Badges ===== */
.badge-vip {
    display: inline-block;
    background: var(--grad-gold);
    color: #1a1206;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    vertical-align: middle;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

/* ===== Flash messages ===== */
.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin: 20px 0;
    font-size: 0.94rem;
    backdrop-filter: blur(10px);
}
.flash-error {
    background: rgba(251, 113, 133, 0.12);
    border: 1px solid rgba(251, 113, 133, 0.4);
    color: #fecdd3;
}
.flash-success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #a7f3d0;
}

/* ===== Hero ===== */
.hero {
    padding: 72px 0 32px;
    text-align: center;
}

.hero .eyebrow {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 30px;
    background: var(--card);
    border: 1px solid var(--stroke);
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.9rem);
    font-weight: 800;
    margin: 0 0 16px;
}

.hero h1 .grad {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--muted);
    font-size: 1.06rem;
    max-width: 620px;
    margin: 0 auto;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
}

/* ===== Stats ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 40px 0;
}

.stat-box {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 24px 18px;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, border-color .2s ease;
}
.stat-box:hover { transform: translateY(-3px); border-color: var(--stroke-strong); }

.stat-box .num {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-box .label { color: var(--muted); font-size: 0.88rem; }

/* ===== Section heading ===== */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 48px 0 4px;
    flex-wrap: wrap;
}
.section-head h2 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.section-head .sub { color: var(--muted); font-size: 0.92rem; }

/* ===== Tags ===== */
.tag-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 22px 0 8px;
}

.tag {
    background: var(--card);
    border: 1px solid var(--stroke);
    padding: 7px 16px;
    border-radius: 30px;
    font-size: 0.87rem;
    color: var(--muted);
    backdrop-filter: blur(10px);
    transition: all .18s ease;
}
.tag:hover {
    color: var(--text);
    border-color: var(--stroke-strong);
    background: var(--card-hover);
    transform: translateY(-1px);
}
.tag.active {
    background: var(--grad-brand);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.32);
}

/* ===== Top games ranking ===== */
.top-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px 12px 12px;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    color: var(--text);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.top-item:hover {
    transform: translateX(4px);
    border-color: var(--stroke-strong);
    background: var(--card-hover);
    color: var(--text);
}

.top-rank {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    background: var(--card-hover);
    border: 1px solid var(--stroke);
    color: var(--muted);
}
.top-rank.rank-1 { background: linear-gradient(135deg, #F59E0B, #FCD34D); color: #1a1206; border-color: transparent; box-shadow: 0 6px 18px rgba(245,158,11,.35); }
.top-rank.rank-2 { background: linear-gradient(135deg, #94A3B8, #E2E8F0); color: #1a1a1a; border-color: transparent; }
.top-rank.rank-3 { background: linear-gradient(135deg, #B45309, #F59E0B); color: #fff; border-color: transparent; }

.top-cover {
    flex-shrink: 0;
    width: 60px;
    height: 42px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(34, 211, 238, 0.18));
}
.top-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.top-info { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.top-title {
    font-size: 0.94rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-meta { font-size: 0.8rem; color: var(--muted); }

/* ===== Game grid ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    margin: 26px 0;
}

.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.game-card:hover {
    transform: translateY(-6px);
    border-color: var(--stroke-strong);
    box-shadow: var(--shadow);
    color: var(--text);
}

.game-card .cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(34, 211, 238, 0.14));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--faint);
    font-size: 0.85rem;
    overflow: hidden;
}
.game-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.game-card:hover .cover img { transform: scale(1.05); }

.game-card .body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.game-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-card .meta { color: var(--muted); font-size: 0.82rem; }

/* ===== Generic card ===== */
.card {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}
.card h1 { margin-top: 0; font-size: 1.7rem; }

/* ===== Forms ===== */
form .field { margin-bottom: 18px; }
form label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.88rem;
    color: var(--muted);
}

form input[type=text], form input[type=email], form input[type=password],
form input[type=number], form input[type=file], form textarea, form select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}
form input:focus, form textarea:focus, form select:focus {
    outline: none;
    border-color: var(--brand1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
form textarea { min-height: 130px; resize: vertical; }
form input::placeholder { color: var(--faint); }

/* ===== Divider ("หรือ") ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--faint);
    font-size: 0.85rem;
}
.divider::before, .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--stroke);
}

/* ===== Tables ===== */
table { width: 100%; border-collapse: collapse; }
table th, table td {
    text-align: left;
    padding: 13px 14px;
    border-bottom: 1px solid var(--stroke);
    font-size: 0.9rem;
}
table th { color: var(--muted); font-weight: 600; }
table tbody tr { transition: background .15s ease; }
table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* ===== VIP plans ===== */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.plan-card {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 30px 24px;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.plan-card:hover {
    transform: translateY(-5px);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: var(--shadow);
}
.plan-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.plan-card p { color: var(--muted); font-size: 0.9rem; }

.price {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 12px 0 4px;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 36px 0;
}
.pagination a, .pagination span {
    min-width: 42px;
    text-align: center;
    padding: 9px 14px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 0.9rem;
    transition: all .18s ease;
}
.pagination a:hover { border-color: var(--stroke-strong); background: var(--card-hover); color: var(--text); }
.pagination .current {
    background: var(--grad-brand);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--stroke);
    margin-top: 80px;
    padding: 32px 0;
    color: var(--faint);
    font-size: 0.86rem;
    text-align: center;
}

.footer-social {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.footer-social a {
    padding: 7px 16px;
    border-radius: 30px;
    background: var(--card);
    border: 1px solid var(--stroke);
    color: var(--muted);
    font-size: 0.85rem;
    transition: all .18s ease;
}
.footer-social a:hover {
    color: var(--text);
    border-color: var(--stroke-strong);
    transform: translateY(-2px);
}

/* ===== Admin shell ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: rgba(7, 10, 18, 0.6);
    border-right: 1px solid var(--stroke);
    backdrop-filter: blur(14px);
    padding: 24px 16px;
}
.admin-sidebar a {
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.93rem;
    margin-bottom: 4px;
    transition: all .18s ease;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--card); color: var(--text); }

.admin-brand {
    padding: 0 14px 18px;
    font-weight: 800;
    font-size: 1.05rem;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-main { flex: 1; padding: 28px 32px; min-width: 0; }

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--stroke);
    color: var(--muted);
    font-size: 0.9rem;
}
.admin-main h1 { font-size: 1.65rem; margin: 0 0 20px; }

@media (max-width: 720px) {
    .hero { padding: 48px 0 24px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--stroke); }
    .admin-main { padding: 20px; }
}
