:root {
    --bg: #0b1220;
    --panel: #111a2e;
    --panel-2: #1b2540;
    --text: #e6edf7;
    --muted: #8b97ad;
    --primary: #f59e0b;
    --primary-2: #d97706;
    --success: #10b981;
    --danger: #ef4444;
    --border: #243049;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-weight: 400;
    background: linear-gradient(180deg, #0b1220 0%, #0a0f1c 100%);
    color: var(--text);
    line-height: 1.55;
}

/* บังคับใช้ Kanit กับ element ที่มี font ตัวเอง (input/button/select/textarea) */
input, button, select, textarea {
    font-family: inherit;
}

a { color: #93c5fd; text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(17, 26, 46, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.navbar .brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}
.nav-links a { color: var(--text); }
.nav-user {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.2;
    font-size: 13px;
}
.nav-user .balance {
    color: var(--success);
    font-weight: 700;
    font-size: 14px;
}
.nav-user .diamonds {
    color: #c4b5fd;
    font-weight: 600;
    font-size: 12px;
}
.logout-form { margin: 0; }
.btn-link {
    background: none;
    border: none;
    color: #93c5fd;
    cursor: pointer;
    padding: 0;
    font: inherit;
}
.btn-link:hover { text-decoration: underline; }

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform .05s, opacity .15s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #1a1a1a;
}
.btn-primary:hover { opacity: .92; text-decoration: none; }
.btn-secondary {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #243049; text-decoration: none; }
.btn-block { display: block; width: 100%; text-align: center; }

.landing { padding: 60px 24px; }
.hero {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 14px; }
.hero p { color: var(--muted); margin: 0 0 28px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.auth-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.auth-card h1 {
    margin: 0 0 18px;
    font-size: 22px;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}
.auth-form label span small { color: #5d6b85; font-weight: 400; }
.auth-form input {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .15);
}
.auth-form button { margin-top: 6px; padding: 12px; }

.auth-foot {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}
.alert-error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .35);
    color: #fecaca;
}

.admin-page, .lobby-page, .content-page {
    padding: 32px 24px;
    max-width: 1100px;
    margin: 0 auto;
}
.admin-card, .lobby-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
}
.muted { color: var(--muted); }

.alert-success {
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(16, 185, 129, .35);
    color: #a7f3d0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    margin: 0;
    font-size: 24px;
}

/* Wallet */
.wallet-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 800px) {
    .wallet-summary { grid-template-columns: 1fr; }
}

.wallet-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}
.wallet-card-main {
    background: linear-gradient(135deg, #1f2c4a 0%, #16213e 100%);
    border-color: var(--primary);
}
.wallet-card-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}
.wallet-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--success);
    letter-spacing: -0.5px;
}
.wallet-card-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 8px;
}
.wallet-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 480px) {
    .wallet-stats { grid-template-columns: 1fr; }
}
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
}
.stat-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}
.stat-value {
    font-size: 18px;
    font-weight: 700;
}

.wallet-info-banner {
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
}
.wallet-info-banner p { margin: 0; font-size: 14px; color: #fcd34d; }

/* Tables */
.history-section { margin-top: 8px; }
.history-section h2 { margin: 0 0 14px; font-size: 18px; }
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table th {
    background: var(--panel-2);
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.text-right { text-align: right !important; }
.text-success { color: var(--success); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
}
.badge-credit { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.35); color: #6ee7b7; }
.badge-debit  { background: rgba(239,68,68,.15);  border-color: rgba(239,68,68,.35);  color: #fca5a5; }
.badge-status { background: rgba(96,165,250,.15); border-color: rgba(96,165,250,.35); color: #93c5fd; }

/* Profile */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.profile-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}
.profile-card h2 {
    margin: 0 0 16px;
    font-size: 17px;
}
.profile-card-info { background: var(--panel-2); }
.info-list {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 12px;
    margin: 0;
    font-size: 14px;
}
.info-list dt {
    color: var(--muted);
}
.info-list dd { margin: 0; }

/* ============================
   Admin Layout
   ============================ */
.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 0px);
}
.admin-sidebar {
    background: #0a1020;
    border-right: 1px solid var(--border);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.admin-sidebar-close {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.admin-sidebar-close:hover { background: var(--panel-2); }
.admin-brand a {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: .04em;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: background-color .12s, color .12s;
}
.admin-nav a:hover { background: var(--panel-2); }
.admin-nav a.active { background: linear-gradient(90deg, rgba(245,158,11,.18), rgba(245,158,11,.02)); color: var(--primary); }
.admin-nav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
    background: rgba(96, 165, 250, .25);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, .4);
}
.admin-nav__badge--alert {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: rgba(248, 113, 113, .6);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .55);
    animation: admin-badge-pulse 1.6s ease-in-out infinite;
}
.admin-nav__badge--info {
    background: rgba(245, 158, 11, .25);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, .45);
}
@keyframes admin-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .admin-nav__badge--alert { animation: none; }
}
.admin-sidebar-foot {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

/* Mobile menu toggle (hamburger) + backdrop — hidden on desktop */
.admin-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 65;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.admin-menu-toggle:hover { background: var(--panel-2); }
.admin-menu-toggle__icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 14px;
}
.admin-menu-toggle__icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
}
.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 60;
    opacity: 0;
    transition: opacity .2s ease;
}
.admin-sidebar-backdrop.is-open { opacity: 1; }

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

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(280px, 84vw);
        z-index: 70;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 10px 40px rgba(0, 0, 0, .55);
    }
    .admin-sidebar.is-open { transform: translateX(0); }
    .admin-sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .admin-menu-toggle { display: inline-flex; }
    .admin-sidebar-backdrop { display: block; }
    .admin-main { padding: 64px 16px 24px; }
    body.admin-menu-open { overflow: hidden; }
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-header h1 { margin: 0; font-size: 22px; }

/* KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 14px 0 22px;
}
.kpi-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}
.kpi-card.kpi-success { border-color: rgba(16,185,129,.4); }
.kpi-card.kpi-danger  { border-color: rgba(239,68,68,.4); }
.kpi-card.kpi-highlight {
    background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(217,119,6,.06));
    border-color: rgba(245,158,11,.5);
}
.kpi-label { color: var(--muted); font-size: 12px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 22px; font-weight: 800; }
.kpi-sub   { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Panels */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.panel h3 { margin: 12px 0 8px; font-size: 14px; color: var(--muted); }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.filter-bar input, .filter-bar select {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    min-width: 120px;
}
.filter-bar input[type="text"] { flex: 1 1 200px; min-width: 200px; }

select {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0;
    padding: 6px;
    flex-wrap: wrap;
    gap: 10px;
}
.pagination-info { color: var(--muted); font-size: 13px; }
.pagination-buttons { display: flex; gap: 8px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* Detail grid (user detail page) */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 1100px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }

/* utility */
.mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    color: #cbd5e1;
    word-break: break-all;
}
.text-center { text-align: center !important; }

/* button variants ที่ใช้ในหน้า admin tables */
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: 1px solid rgba(16, 185, 129, .55);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: filter .12s ease, transform .05s ease;
}
.btn-success:hover { filter: brightness(1.08); }
.btn-success:active { transform: translateY(1px); }
.btn-success[disabled] { opacity: .5; cursor: not-allowed; }
.btn-small { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ────────────────── Responsive admin tables (mobile card mode) ──────────────────
   ใช้ data-label ใน <td> แต่ละช่อง — บนจอเล็กจะเปลี่ยนเป็นรูปแบบการ์ด มี label ซ้ายค่าขวา
   ต้องการ: <table class="data-table"> ที่อยู่ใน <div class="table-wrap">
*/
@media (max-width: 720px) {
    .data-table.responsive-cards,
    .data-table.withdraw-table,
    .data-table.deposit-table {
        display: block;
        font-size: 13px;
    }
    .data-table.responsive-cards thead,
    .data-table.withdraw-table thead,
    .data-table.deposit-table thead {
        display: none;
    }
    .data-table.responsive-cards tbody,
    .data-table.withdraw-table tbody,
    .data-table.deposit-table tbody { display: block; }
    .data-table.responsive-cards tbody tr,
    .data-table.withdraw-table tbody tr,
    .data-table.deposit-table tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--panel-2);
        padding: 4px 0;
    }
    .data-table.responsive-cards tbody tr:hover,
    .data-table.withdraw-table tbody tr:hover,
    .data-table.deposit-table tbody tr:hover {
        background: var(--panel-2);
    }
    .data-table.responsive-cards tbody td,
    .data-table.withdraw-table tbody td,
    .data-table.deposit-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 8px 14px;
        border-bottom: 1px dashed rgba(148, 163, 184, .12);
        white-space: normal;
        text-align: right;
    }
    .data-table.responsive-cards tbody td:last-child,
    .data-table.withdraw-table tbody td:last-child,
    .data-table.deposit-table tbody td:last-child {
        border-bottom: none;
    }
    .data-table.responsive-cards tbody td::before,
    .data-table.withdraw-table tbody td::before,
    .data-table.deposit-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        text-align: left;
        flex: 0 0 auto;
        min-width: 92px;
    }
    .data-table.responsive-cards tbody td.text-right,
    .data-table.withdraw-table tbody td.text-right,
    .data-table.deposit-table tbody td.text-right {
        text-align: right;
    }
}

.collapsible {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.collapsible summary {
    cursor: pointer;
    padding: 8px 0;
    font-weight: 600;
    user-select: none;
}
.collapsible[open] summary { color: var(--primary); }

.audit-details {
    background: var(--panel-2);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin: 4px 0 0;
    white-space: pre-wrap;
    max-width: 360px;
    max-height: 200px;
    overflow: auto;
}

/* Compact table variant */
.data-table.compact th, .data-table.compact td {
    padding: 8px 10px;
    font-size: 13px;
}

/* Status badges variants */
.badge-success-soft {
    background: rgba(16,185,129,.15);
    border-color: rgba(16,185,129,.35);
    color: #6ee7b7;
}
.badge-warning-soft {
    background: rgba(239,68,68,.12);
    border-color: rgba(239,68,68,.35);
    color: #fca5a5;
}
.badge-info-soft {
    background: rgba(59,130,246,.15);
    border-color: rgba(59,130,246,.35);
    color: #93c5fd;
}
.badge-danger-soft {
    background: rgba(220,38,38,.18);
    border-color: rgba(220,38,38,.45);
    color: #fca5a5;
}

.text-center { text-align: center; }
.link-arrow {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}
.link-arrow:hover { text-decoration: underline; }

/* Hide global navbar inside admin shell (admin sidebar has its own brand+logout) */
.admin-shell .navbar { display: none; }

/* ============================
   Game Lobby + Game Cards
   ============================ */
.lobby-section { margin-bottom: 28px; }
.section-title {
    font-size: 18px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.product-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    text-decoration: none;
    box-shadow: 0 12px 28px -8px rgba(245,158,11,.18);
}
.product-card-img {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #1a2540, #0f1830);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card-img img {
    max-width: 80%;
    max-height: 70%;
    object-fit: contain;
}
.product-placeholder {
    font-size: 36px;
    color: var(--muted);
}
.product-card-body {
    padding: 12px 14px;
}
.product-card-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-card-meta {
    font-size: 12px;
    color: var(--muted);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.game-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.game-card-img {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #1a2540, #0f1830);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.game-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.game-badge-new, .game-badge-type {
    position: absolute;
    top: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: .04em;
}
.game-badge-new {
    left: 8px;
    background: var(--primary);
    color: #1a1a1a;
}
.game-badge-type {
    right: 8px;
    background: rgba(0,0,0,.55);
    color: #fff;
    backdrop-filter: blur(6px);
}
.game-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.game-card-title {
    font-weight: 700;
    font-size: 14px;
}
.game-card-meta { font-size: 12px; }
.btn-launch { margin-top: auto; padding: 9px; font-size: 14px; }

/* ============================
   Lucky Spin
   ============================ */
.spin-page { max-width: 1100px; }

.spin-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 860px) {
    .spin-layout { grid-template-columns: 1fr; }
}

.spin-wheel-wrap {
    position: relative;
    background: linear-gradient(180deg, #0e1729, #0a1124);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 28px 18px;
    text-align: center;
}
.spin-wheel {
    position: relative;
    width: min(440px, 90vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    transform-origin: 50% 50%;
    transform: rotate(0deg);
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .4));
}
.spin-pointer {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid #fbbf24;
    z-index: 4;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,.4));
}
.spin-result {
    margin-top: 18px;
    min-height: 28px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .02em;
}
.spin-result.win  { color: #6ee7b7; text-shadow: 0 0 18px rgba(110,231,183,.45); }
.spin-result.lose { color: #fca5a5; }

.spin-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.spin-balance {
    background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.02));
    border: 1px solid rgba(245,158,11,.25);
    border-radius: 10px;
    padding: 12px 14px;
}
.spin-balance .balance-num {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    margin-top: 4px;
}
.bet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.bet-chip {
    background: #1a2540;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: transform .08s ease, border-color .15s, background .15s;
}
.bet-chip:hover { border-color: var(--primary); }
.bet-chip.active {
    background: var(--primary);
    color: #1a1a1a;
    border-color: var(--primary);
    transform: translateY(-1px);
}
.bet-chip--free {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: #10b981;
    letter-spacing: .12em;
}
.bet-chip--free:hover { border-color: #34d399; box-shadow: 0 4px 12px -4px rgba(16,185,129,.6); }
.bet-chip--free.active {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #fff;
    border-color: #fff;
}
.btn-spin {
    padding: 14px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .12em;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: #1b1300;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 12px 28px -8px rgba(245,158,11,.55);
}
.btn-spin:hover:not(:disabled) { transform: translateY(-1px); }
.btn-spin:disabled { opacity: .55; cursor: not-allowed; }

.spin-table { margin-top: 4px; }
.spin-table summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    padding: 6px 0;
}
.color-dot {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 1px solid #0006;
    vertical-align: middle;
}
.win { color: #6ee7b7; font-weight: 700; }
.lose { color: #fca5a5; font-weight: 700; }

/* highlight Lucky Spin link in navbar */
.nav-spin {
    background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(245,158,11,.04));
    border: 1px solid rgba(245,158,11,.35);
    padding: 4px 10px !important;
    border-radius: 6px;
}

/* =========================================
   HOMEPAGE — CASINO ARENA
   ========================================= */

:root {
    --home-bg: #0a0d2e;
    --home-bg-2: #110a3a;
    --home-card: #161b46;
    --home-card-2: #1c2356;
    --home-border: rgba(122, 132, 255, 0.18);
    --home-pink: #ec4899;
    --home-purple: #8b5cf6;
    --home-blue: #3b82f6;
    --home-cyan: #06b6d4;
    --home-gold: #fbbf24;
    --home-gold-2: #f59e0b;
}

.home {
    background:
        radial-gradient(1200px 700px at 0% 0%, rgba(139, 92, 246, .25), transparent 60%),
        radial-gradient(1100px 800px at 100% 10%, rgba(59, 130, 246, .25), transparent 60%),
        radial-gradient(900px 600px at 50% 100%, rgba(236, 72, 153, .12), transparent 60%),
        linear-gradient(180deg, #0a0d2e 0%, #07091f 100%);
    color: var(--text);
    padding: 0 0 40px;
    overflow: hidden;
}

/* =========================================
   HERO
   ========================================= */
.hero-section {
    position: relative;
    padding: 32px 24px 24px;
    max-width: 1280px;
    margin: 0 auto;
}
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    animation: float 14s ease-in-out infinite;
}
.hero-blob--purple { width: 380px; height: 380px; background: #7c3aed; top: -120px; left: -80px; }
.hero-blob--blue   { width: 420px; height: 420px; background: #2563eb; top: 60px;  right: -120px; animation-delay: -4s; }
.hero-blob--pink   { width: 320px; height: 320px; background: #ec4899; bottom: -120px; left: 30%; animation-delay: -8s; }
@keyframes float {
    0%, 100% { transform: translate(0,0) scale(1); }
    50%      { transform: translate(20px,-30px) scale(1.08); }
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
}

.hero-card {
    position: relative;
    border-radius: 24px;
    padding: 40px 36px;
    background:
        linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(59, 130, 246, .25) 50%, rgba(236, 72, 153, .25));
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 30px 60px -20px rgba(91, 33, 182, .4);
    overflow: hidden;
    min-height: 360px;
}
.hero-card::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 23px;
    background:
        radial-gradient(600px 240px at 80% 110%, rgba(236, 72, 153, .3), transparent 60%),
        radial-gradient(500px 240px at 10% -20%, rgba(59, 130, 246, .35), transparent 60%),
        linear-gradient(160deg, rgba(20, 16, 60, .85), rgba(15, 10, 50, .95));
    z-index: 0;
}
.hero-main > * { position: relative; z-index: 1; }

.hero-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .25em;
    color: #fde68a;
}
.hero-title {
    margin: 14px 0 12px;
    font-size: clamp(34px, 5.5vw, 56px);
    font-weight: 900;
    line-height: 1.05;
    background: linear-gradient(120deg, #fff, #fde68a 40%, #fbbf24 60%, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 60px rgba(251, 191, 36, .25);
    letter-spacing: -0.02em;
}
.hero-title span { display: block; }
.hero-sub {
    color: #d8def0;
    font-size: 17px;
    margin: 0 0 22px;
    line-height: 1.6;
}
.hero-sub strong { color: var(--home-gold); }

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.btn-glow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #ec4899 60%, #8b5cf6);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    border: none;
    cursor: pointer;
    letter-spacing: .03em;
    box-shadow: 0 12px 30px -8px rgba(236, 72, 153, .55), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px -8px rgba(236, 72, 153, .65), inset 0 1px 0 rgba(255,255,255,.3);
    text-decoration: none;
    filter: brightness(1.08);
}
.btn-glow--lg {
    padding: 16px 38px;
    font-size: 16px;
    margin-top: 14px;
}
.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 13px 26px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: background .15s ease, border-color .15s ease;
}
.btn-ghost:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); text-decoration: none; }

.hero-jackpot {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(251, 191, 36, .14), rgba(251, 191, 36, .04));
    border: 1px solid rgba(251, 191, 36, .35);
}
.hero-jackpot__label {
    font-size: 11px;
    letter-spacing: .25em;
    font-weight: 800;
    color: #fde68a;
}
.hero-jackpot__amount {
    font-size: 22px;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 16px rgba(251, 191, 36, .4);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* Hero side / live winners */
.hero-side {
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(28, 35, 86, .85), rgba(20, 25, 65, .9));
    border: 1px solid var(--home-border);
    overflow: hidden;
    backdrop-filter: blur(6px);
}
.live-card { display: flex; flex-direction: column; height: 100%; }
.live-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-size: 12px;
    letter-spacing: .22em;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid var(--home-border);
    background: rgba(0,0,0,.18);
}
.live-dot {
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .7);
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0   rgba(239, 68, 68, .7); }
    70%  { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0); }
}
.live-feed {
    list-style: none;
    margin: 0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow: hidden;
}
.live-feed li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.04);
    font-size: 13px;
    animation: slideIn .4s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}
.live-feed .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ec4899);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}
.live-feed .lf-name { font-weight: 700; }
.live-feed .lf-game { color: #94a3b8; font-size: 11px; }
.live-feed .lf-win  { margin-left: auto; color: #6ee7b7; font-weight: 800; font-variant-numeric: tabular-nums; }

/* =========================================
   CATEGORY CHIPS
   ========================================= */
.chips-section {
    max-width: 1280px;
    margin: 8px auto 0;
    padding: 6px 24px 18px;
}
.chips-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.chips-row::-webkit-scrollbar { height: 6px; }
.chips-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--home-border);
    color: #cbd5e1;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: all .15s ease;
}
.chip:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
.chip--active {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 22px -8px rgba(236, 72, 153, .55);
}
.chip-ico { font-size: 16px; }

/* =========================================
   ZONE / SECTION HEADERS
   ========================================= */
.zone {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px;
}
.zone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.zone-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.zone-bar {
    display: inline-block;
    width: 4px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(180deg, #fbbf24, #ec4899);
    box-shadow: 0 0 14px rgba(251, 191, 36, .5);
}
.zone-sub { color: #94a3b8; font-weight: 500; font-size: 13px; margin-left: 8px; }
.zone-link {
    color: #fde68a;
    background: rgba(251, 191, 36, .1);
    border: 1px solid rgba(251, 191, 36, .25);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .15s ease;
}
.zone-link:hover { background: rgba(251, 191, 36, .18); text-decoration: none; }

/* =========================================
   GAME ROW / TILE
   ========================================= */
.game-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
}
@media (max-width: 1200px) { .game-row { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 1024px) { .game-row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px)  { .game-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px)  { .game-row { grid-template-columns: repeat(2, 1fr); } }

.game-tile {
    --tile-c: #3b82f6;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--home-card);
    border: 1px solid var(--home-border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.game-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,.25);
    box-shadow: 0 18px 36px -16px var(--tile-c);
    text-decoration: none;
}
.game-tile__img {
    aspect-ratio: 3 / 4;
    background: linear-gradient(160deg, color-mix(in oklab, var(--tile-c) 95%, white 5%), color-mix(in oklab, var(--tile-c) 50%, black 50%));
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.game-tile__img::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,.25), transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(0,0,0,.35), transparent 60%);
    pointer-events: none;
}
.game-tile__emoji {
    position: relative;
    z-index: 1;
    font-size: 54px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
}
.game-tile__tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    border-radius: 999px;
    color: #fff;
    z-index: 2;
}
.tag-new  { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.tag-hot  { background: linear-gradient(135deg, #ef4444, #f97316); }
.tag-top  { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1a1a; }
.tag-live { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.game-tile__body { padding: 10px 12px 12px; }
.game-tile__name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-tile__meta { font-size: 12px; color: #94a3b8; }

/* =========================================
   JACKPOT BANNER
   ========================================= */
.jackpot-banner {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    padding: 32px;
    background:
        radial-gradient(800px 400px at 50% -10%, rgba(251, 191, 36, .35), transparent 60%),
        linear-gradient(135deg, #1e1b4b, #4c1d95 50%, #7c2d12);
    border: 1px solid rgba(251, 191, 36, .35);
    box-shadow: 0 30px 60px -20px rgba(124, 58, 237, .5);
}
.jackpot-banner__bg {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 12px, transparent 12px 24px);
    pointer-events: none;
}
.jackpot-banner__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
}
@media (max-width: 900px) {
    .jackpot-banner__inner { grid-template-columns: 1fr; text-align: center; }
}

.jackpot-banner__side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.jackpot-banner__side--right { align-items: flex-end; }
@media (max-width: 900px) {
    .jackpot-banner__side, .jackpot-banner__side--right { align-items: center; }
}
.mini-jackpot {
    background: rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    padding: 10px 16px;
    min-width: 200px;
}
.mini-jackpot__label {
    font-size: 11px;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #cbd5e1;
}
.mini-jackpot__amount {
    font-size: 20px;
    font-weight: 800;
    color: #fbbf24;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 14px rgba(251, 191, 36, .35);
}

.jackpot-banner__center {
    text-align: center;
    padding: 16px 28px;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(251, 191, 36, .45);
    border-radius: 18px;
}
.jackpot-banner__title {
    font-size: 13px;
    letter-spacing: .3em;
    font-weight: 800;
    color: #fde68a;
}
.jackpot-banner__amount {
    margin: 6px 0 4px;
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 900;
    background: linear-gradient(135deg, #fde68a, #fbbf24 30%, #fff 60%, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 40px rgba(251, 191, 36, .4);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* =========================================
   LIVE WINS TABLE
   ========================================= */
.wins-table {
    background: linear-gradient(180deg, var(--home-card), var(--home-card-2));
    border: 1px solid var(--home-border);
    border-radius: 16px;
    overflow: hidden;
}
.win-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    transition: background .15s ease;
}
.win-row:hover { background: rgba(255,255,255,.03); }
.win-row:last-child { border-bottom: none; }
@media (max-width: 768px) {
    .win-row {
        grid-template-columns: 1.4fr 1fr 1fr;
        gap: 10px;
    }
    .win-col--bet, .win-col--cta { display: none; }
}

.win-col { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.win-col strong { color: #fff; }
.win-icon {
    width: 38px; height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    font-size: 18px;
}
.win-game { color: #fff; font-weight: 700; }
.avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}
.win-col--bet, .win-col--win { flex-direction: column; align-items: flex-start; gap: 0; font-size: 12px; }
.win-col--bet .muted, .win-col--win .muted { font-size: 11px; }
.win-amount { color: #6ee7b7; font-variant-numeric: tabular-nums; }

.btn-mini {
    padding: 6px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    transition: filter .15s ease, transform .15s ease;
}
.btn-mini:hover { filter: brightness(1.1); transform: translateY(-1px); text-decoration: none; }

/* =========================================
   PROMOTIONS
   ========================================= */
.promo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 900px) { .promo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .promo-grid { grid-template-columns: 1fr; } }

.promo-card {
    position: relative;
    display: block;
    padding: 22px;
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    min-height: 160px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.promo-card:hover { transform: translateY(-3px); text-decoration: none; box-shadow: 0 18px 40px -16px rgba(0,0,0,.45); }
.promo-card--blue   { background: linear-gradient(135deg, #1e40af, #3b82f6, #06b6d4); }
.promo-card--purple { background: linear-gradient(135deg, #581c87, #7c3aed, #ec4899); }
.promo-card--pink   { background: linear-gradient(135deg, #831843, #ec4899, #f97316); }
.promo-card--gold   { background: linear-gradient(135deg, #78350f, #f59e0b, #fbbf24); color: #1a1a1a; }
.promo-card--gold .promo-card__sub { color: #1f2937; }

.promo-card__icon {
    font-size: 36px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.35));
}
.promo-card__title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}
.promo-card__sub {
    font-size: 13px;
    color: rgba(255,255,255,.85);
    line-height: 1.5;
}

/* =========================================
   PROVIDERS STRIP
   ========================================= */
.providers-zone { margin-top: 8px; }
.providers-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 22px;
    background: linear-gradient(180deg, rgba(28, 35, 86, .6), rgba(15, 18, 60, .8));
    border: 1px solid var(--home-border);
    border-radius: 16px;
}
.provider-pill {
    width: 110px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 8px;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.provider-pill:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,.25);
    background: rgba(255,255,255,.08);
}
.provider-pill img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: brightness(1.1);
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
    margin-top: 40px;
    background: linear-gradient(180deg, rgba(10, 13, 46, .8), #05071a);
    border-top: 1px solid var(--home-border);
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 28px;
}
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }

.footer-logo {
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, #fbbf24, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { margin: 0 0 8px; font-size: 14px; color: #fff; }
.footer-col a {
    color: #94a3b8;
    font-size: 13px;
    text-decoration: none;
    transition: color .15s ease;
}
.footer-col a:hover { color: #fde68a; text-decoration: none; }

.footer-base {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--home-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #64748b;
    font-size: 12px;
}
.footer-social { display: flex; gap: 8px; }
.footer-social a {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--home-border);
    border-radius: 50%;
    font-weight: 800;
    font-size: 12px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all .15s ease;
}
.footer-social a:hover {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    border-color: transparent;
    text-decoration: none;
}

/* Hide global navbar on home (we use a richer transparent variant inline) */
.home .navbar { /* keep but make it transparent on home */ }

/* =========================================
   NAVBAR — HOME VARIANT
   ========================================= */
.navbar--home {
    background: rgba(10, 13, 46, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--home-border);
}
.brand--home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: .04em;
}
.brand--home:hover { text-decoration: none; }
.brand-icon {
    display: inline-flex;
    width: 36px; height: 36px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fbbf24, #ec4899);
    border-radius: 10px;
    box-shadow: 0 8px 22px -8px rgba(236, 72, 153, .55);
    font-size: 18px;
}
.brand-text {
    background: linear-gradient(120deg, #fff 0%, #fde68a 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-text small {
    display: inline-block;
    font-size: 12px;
    margin-left: 4px;
    letter-spacing: .28em;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.nav-login {
    color: #cbd5e1 !important;
    font-weight: 600;
}
.nav-login:hover { color: #fff !important; text-decoration: none; }

.btn-glow--sm {
    padding: 9px 18px;
    font-size: 13px;
    border-radius: 999px;
}

/* =========================================
   ADMIN — HOMEPAGE MANAGEMENT
   ========================================= */

/* Sub-nav (tabs ใต้หัวข้อ) */
.home-subnav {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    flex-wrap: wrap;
    overflow-x: auto;
}
.home-subnav a {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.home-subnav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.home-subnav a.active {
    background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(217,119,6,.05));
    color: var(--primary);
}
.home-subnav-preview {
    margin-left: auto;
    background: rgba(16,185,129,.12) !important;
    border: 1px solid rgba(16,185,129,.3);
    color: #6ee7b7 !important;
}

/* Overview cards */
.home-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.home-overview-card {
    display: block;
    padding: 22px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: transform .12s, border-color .12s, box-shadow .12s;
    position: relative;
    overflow: hidden;
}
.home-overview-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    text-decoration: none;
    box-shadow: 0 14px 30px -12px rgba(0,0,0,.4);
}
.home-overview-card h3   { margin: 6px 0 4px; font-size: 16px; }
.home-overview-card p    { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.home-overview-card small{ display: block; font-size: 12px; color: #cbd5e1; }
.home-overview-icon { font-size: 32px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); }
.home-overview-card--hero      { background: linear-gradient(135deg, rgba(139,92,246,.18), var(--panel) 70%); }
.home-overview-card--jackpot   { background: linear-gradient(135deg, rgba(251,191,36,.18), var(--panel) 70%); }
.home-overview-card--games     { background: linear-gradient(135deg, rgba(59,130,246,.18), var(--panel) 70%); }
.home-overview-card--promo     { background: linear-gradient(135deg, rgba(236,72,153,.18), var(--panel) 70%); }
.home-overview-card--providers { background: linear-gradient(135deg, rgba(16,185,129,.18), var(--panel) 70%); }
.home-overview-card--footer    { background: linear-gradient(135deg, rgba(148,163,184,.18), var(--panel) 70%); }

/* Forms */
.home-form .panel { margin-bottom: 14px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.form-grid label, .home-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}
.form-grid-full { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea, .form-grid select,
.home-form input[type=text], .home-form input[type=number], .home-form textarea, .home-form select {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.home-form input:focus, .home-form textarea:focus, .home-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.home-form input[type=color] {
    height: 36px;
    width: 100%;
    padding: 2px;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
}
.inline-check { flex-direction: row !important; align-items: center; }
.inline-check input { width: auto; }
.form-actions {
    display: flex;
    gap: 10px;
    padding: 16px 0;
    flex-wrap: wrap;
}

/* Repeater (Jackpot minis, Footer links) */
.repeater { display: flex; flex-direction: column; gap: 8px; }
.repeater-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 8px;
    align-items: center;
}
.repeater-row input {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 14px;
}
.repeater-remove {
    background: rgba(239,68,68,.12) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239,68,68,.35);
    border-radius: 8px;
    padding: 6px 12px !important;
    font-weight: 700;
}

/* Featured Sections (games admin) */
.home-section-block { padding-bottom: 16px; }
.home-section-head { margin-bottom: 14px; }
.home-section-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.home-section-meta input[type=text] { flex: 1 1 200px; min-width: 160px; }

.home-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin: 8px 0 14px;
}
.home-game-card {
    --card-c: #3b82f6;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    border-left: 4px solid var(--card-c);
}
.home-game-preview {
    aspect-ratio: 16 / 8;
    background: linear-gradient(135deg, var(--card-c), color-mix(in oklab, var(--card-c) 40%, black 60%));
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.home-game-preview img {
    max-width: 60%;
    max-height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.3));
}
.home-game-preview-emoji {
    font-size: 42px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.35));
}
.home-game-preview-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .08em;
}
.home-game-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.home-game-fields label {
    font-size: 11px;
}
.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.home-game-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.home-add-game { margin-top: 8px; }
.home-add-game summary {
    cursor: pointer;
    padding: 10px 14px;
    background: var(--panel-2);
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    user-select: none;
}
.home-add-form { margin-top: 10px; padding: 14px; background: var(--panel-2); border-radius: 10px; }

/* Promotions admin */
.promo-rows { display: flex; flex-direction: column; gap: 10px; }
.promo-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    border-left: 4px solid var(--primary);
}
.promo-row--blue   { border-left-color: #3b82f6; background: linear-gradient(90deg, rgba(59,130,246,.06), var(--panel-2)); }
.promo-row--purple { border-left-color: #8b5cf6; background: linear-gradient(90deg, rgba(139,92,246,.06), var(--panel-2)); }
.promo-row--pink   { border-left-color: #ec4899; background: linear-gradient(90deg, rgba(236,72,153,.06), var(--panel-2)); }
.promo-row--gold   { border-left-color: #f59e0b; background: linear-gradient(90deg, rgba(245,158,11,.06), var(--panel-2)); }
.promo-row-icon input {
    width: 100%;
    height: 60px;
    text-align: center;
    font-size: 24px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
}
.promo-row-fields { display: flex; flex-direction: column; gap: 8px; }
.promo-remove { align-self: start; }

/* Providers admin */
.provider-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.provider-admin-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    align-items: center;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
}
.provider-admin-preview {
    width: 80px;
    height: 50px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}
.provider-admin-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.provider-admin-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}
.provider-admin-fields input[type=text],
.provider-admin-fields select {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text);
    font-size: 13px;
}
.provider-admin-fields .inline-check { font-size: 12px; }
.prov-remove { justify-self: end; }


/* ============================
   Register Wizard (3-step)
   ============================ */
.wizard-card {
    max-width: 460px;
}
.wizard-steps {
    list-style: none;
    padding: 0;
    margin: 4px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    counter-reset: step;
}
.wizard-steps .step {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    position: relative;
}
.wizard-steps .step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--panel-2);
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 14px;
    color: var(--muted);
    transition: background-color .15s, color .15s, border-color .15s;
}
.wizard-steps .step .step-label {
    font-size: 12px;
    letter-spacing: .02em;
}
.wizard-steps .step.active .step-num {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #1a1a1a;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(245,158,11,.18);
}
.wizard-steps .step.active .step-label {
    color: var(--text);
    font-weight: 600;
}
.wizard-steps .step.done .step-num {
    background: rgba(16,185,129,.18);
    border-color: rgba(16,185,129,.5);
    color: #6ee7b7;
}
.wizard-steps .step + .step::before {
    content: '';
    position: absolute;
    left: -50%;
    top: 16px;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: -1;
}
.wizard-steps .step.done + .step::before,
.wizard-steps .step.active::before {
    background: linear-gradient(90deg, rgba(16,185,129,.5), rgba(245,158,11,.55));
}

.wizard-step {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: wizardFade .2s ease;
}
@keyframes wizardFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.wizard-step[hidden] { display: none; }

.wizard-hint {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}
.wizard-hint strong { color: var(--text); letter-spacing: .04em; }

.wizard-actions {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wizard-actions.row {
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
}
.wizard-actions.row .btn-secondary,
.wizard-actions.row .btn-primary {
    flex: 1 1 0;
    padding: 12px;
}

.checkbox-row {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
    color: var(--text) !important;
    font-size: 14px !important;
    cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.checkbox-row span { line-height: 1.5; }
.checkbox-row a { color: var(--primary); text-decoration: underline; }

.auth-form select {
    width: 100%;
}

/* ============================
   Simple modal (terms)
   ============================ */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 16, .65);
    backdrop-filter: blur(4px);
}
.modal-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 30px 60px rgba(0,0,0,.5);
}
.modal-panel h2 { margin: 0 0 10px; font-size: 18px; }
.modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

/* =========================================================
   ===  HOMEPAGE PREMIUM UPGRADE  (2026-05) ================
   ========================================================= */

/* ---- Hero stars background ---- */
.hero-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 60%),
        radial-gradient(1px 1px at 25% 65%, #fde68a 50%, transparent 60%),
        radial-gradient(2px 2px at 48% 22%, #fff 50%, transparent 60%),
        radial-gradient(1px 1px at 67% 85%, #c4b5fd 50%, transparent 60%),
        radial-gradient(1.5px 1.5px at 82% 30%, #fff 50%, transparent 60%),
        radial-gradient(1px 1px at 90% 60%, #fde68a 50%, transparent 60%),
        radial-gradient(1px 1px at 35% 90%, #fff 50%, transparent 60%);
    opacity: .45;
    animation: starTwinkle 4s ease-in-out infinite alternate;
}
@keyframes starTwinkle {
    from { opacity: .25; }
    to   { opacity: .65; }
}

/* ---- Hero side: medal artwork + feed card stacked ---- */
.hero-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: transparent;
    border: none;
    backdrop-filter: none;
    overflow: visible;
}
.hero-medal {
    position: relative;
    height: 240px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 60%, rgba(251, 191, 36, .25), transparent 60%),
        linear-gradient(160deg, rgba(28, 35, 86, .7), rgba(15, 10, 50, .9));
    border: 1px solid rgba(251, 191, 36, .25);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px -20px rgba(251, 191, 36, .35);
}
.hero-medal__rays {
    position: absolute;
    inset: -50%;
    background: conic-gradient(
        from 0deg,
        rgba(251, 191, 36, 0) 0deg,
        rgba(251, 191, 36, .25) 30deg,
        rgba(251, 191, 36, 0) 60deg,
        rgba(251, 191, 36, .2) 120deg,
        rgba(251, 191, 36, 0) 180deg,
        rgba(251, 191, 36, .25) 240deg,
        rgba(251, 191, 36, 0) 300deg,
        rgba(251, 191, 36, 0) 360deg
    );
    animation: medalSpin 18s linear infinite;
    pointer-events: none;
}
@keyframes medalSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.hero-medal__coin {
    position: relative;
    width: 180px;
    height: 180px;
    animation: medalFloat 4.5s ease-in-out infinite;
    filter: drop-shadow(0 16px 30px rgba(251, 191, 36, .35));
}
@keyframes medalFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-10px) rotate(2deg); }
}
.hero-medal__svg { width: 100%; height: 100%; }

/* Floating coins */
.hero-coin {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fff7d6, #fbbf24 45%, #92400e 100%);
    border: 2px solid #b45309;
    box-shadow: 0 6px 14px rgba(0,0,0,.4), inset 0 2px 4px rgba(255,255,255,.4);
    animation: coinFloat 6s ease-in-out infinite;
}
.hero-coin::before {
    content: "₿";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    color: #7c2d12;
    text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.hero-coin--1 { top: 15%; left: 10%; animation-delay: -1s; }
.hero-coin--2 { top: 25%; right: 12%; width: 22px; height: 22px; animation-delay: -3s; }
.hero-coin--3 { bottom: 12%; left: 18%; width: 20px; height: 20px; animation-delay: -2s; }
.hero-coin--4 { bottom: 18%; right: 18%; animation-delay: -4s; }
@keyframes coinFloat {
    0%, 100% { transform: translateY(0) rotate(0); }
    50%      { transform: translateY(-12px) rotate(180deg); }
}

.hero-feed-card {
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(28, 35, 86, .85), rgba(20, 25, 65, .9));
    border: 1px solid var(--home-border);
    overflow: hidden;
    backdrop-filter: blur(6px);
}
.live-card__head {
    position: relative;
}
.live-card__badge {
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(16, 185, 129, .18);
    border: 1px solid rgba(16, 185, 129, .35);
    border-radius: 999px;
    color: #6ee7b7;
    font-size: 10px;
    letter-spacing: .15em;
}

/* ---- Hero marquee strip (rolling perks) ---- */
.hero-marquee {
    list-style: none;
    margin: 18px 0 0;
    padding: 12px 0;
    display: flex;
    gap: 28px;
    overflow: hidden;
    border-top: 1px dashed rgba(255,255,255,.12);
    color: #fde68a;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.hero-marquee li {
    animation: marquee 18s linear infinite;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

/* ---- XL CTA button ---- */
.btn-glow--xl {
    padding: 16px 36px;
    font-size: 16px;
    letter-spacing: .04em;
    background: linear-gradient(135deg, #f97316 0%, #fbbf24 50%, #f97316 100%);
    background-size: 200% 100%;
    color: #1a0f00;
    box-shadow:
        0 14px 36px -8px rgba(251, 146, 60, .65),
        inset 0 2px 0 rgba(255, 255, 255, .5),
        inset 0 -3px 0 rgba(0, 0, 0, .15);
    animation: btnGlowShine 3s ease-in-out infinite;
}
.btn-glow--xl:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}
.btn-glow__icon {
    font-size: 20px;
    filter: drop-shadow(0 1px 0 rgba(255,255,255,.4));
}
@keyframes btnGlowShine {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ---- Stats strip ---- */
.stats-strip {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(28, 35, 86, .65), rgba(15, 10, 50, .9));
    border: 1px solid var(--home-border);
    backdrop-filter: blur(8px);
}
@media (max-width: 720px) {
    .stats-strip { grid-template-columns: repeat(2, 1fr); }
}
.stat-pill {
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.06);
}
.stat-pill__num {
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 900;
    background: linear-gradient(135deg, #fde68a, #fbbf24 60%, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.stat-pill__unit {
    font-size: .55em;
    color: #d8def0;
    margin-left: 2px;
    -webkit-text-fill-color: #d8def0;
}
.stat-pill__lbl {
    margin-top: 2px;
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 600;
}

/* ---- TOP CATEGORIES (4 large cards) ---- */
.topcat-zone { padding-top: 6px; padding-bottom: 6px; }
.topcat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 1024px) { .topcat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .topcat-grid { grid-template-columns: 1fr; } }

.topcat {
    --tc: #8b5cf6;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, color-mix(in oklab, var(--tc) 35%, #1e1b4b 65%), color-mix(in oklab, var(--tc) 12%, #0f0a2a 88%));
    border: 1px solid color-mix(in oklab, var(--tc) 50%, rgba(255,255,255,.18));
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.topcat::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, transparent 40%, color-mix(in oklab, var(--tc) 70%, white) 50%, transparent 60%);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    border-radius: inherit;
}
.topcat:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 50px -16px var(--tc);
    border-color: color-mix(in oklab, var(--tc) 80%, white);
    text-decoration: none;
}
.topcat:hover::before { opacity: .25; }
.topcat--casino { --tc: #fbbf24; }
.topcat--live   { --tc: #ef4444; }
.topcat--sport  { --tc: #10b981; }
.topcat--esport { --tc: #a855f7; }

.topcat__art {
    flex: 0 0 88px;
    height: 88px;
    border-radius: 14px;
    background: rgba(0,0,0,.32);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.08);
}
.topcat__art svg { width: 76px; height: 76px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.topcat__body { flex: 1; min-width: 0; }
.topcat__name {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}
.topcat__sub {
    font-size: 12px;
    color: rgba(255,255,255,.7);
    line-height: 1.4;
}
.topcat__arrow {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    transition: transform .2s ease, background .2s ease;
}
.topcat:hover .topcat__arrow {
    background: var(--tc);
    transform: translateX(4px);
}

/* ---- Game tile glow & shimmer (premium upgrade) ---- */
.game-tile {
    box-shadow:
        0 4px 14px -8px rgba(0,0,0,.5),
        inset 0 1px 0 rgba(255,255,255,.06);
}
.game-tile::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent, color-mix(in oklab, var(--tile-c) 80%, white) 50%, transparent);
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.game-tile:hover::after { opacity: 1; }

.game-tile__img img {
    max-width: 84%;
    max-height: 84%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,.45));
    transition: transform .3s ease;
}
.game-tile:hover .game-tile__img img { transform: scale(1.05); }

.game-tile__shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .6s ease;
    z-index: 2;
}
.game-tile:hover .game-tile__shimmer { transform: translateX(100%); }

.game-tile__play {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #fde68a);
    color: #92400e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: 0 6px 14px rgba(0,0,0,.4);
    z-index: 3;
}
.game-tile:hover .game-tile__play { opacity: 1; transform: translateY(0); }

/* ---- TOP EVENTS / SPORTS ODDS ---- */
.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 1024px) { .events-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .events-grid { grid-template-columns: 1fr; } }

.event-card {
    background: linear-gradient(180deg, rgba(28, 35, 86, .8), rgba(15, 10, 50, .9));
    border: 1px solid var(--home-border);
    border-radius: 16px;
    padding: 14px 16px;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.event-card:hover {
    transform: translateY(-3px);
    border-color: rgba(16, 185, 129, .45);
    box-shadow: 0 16px 30px -16px rgba(16, 185, 129, .45);
}
.event-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 12px;
}
.event-card__league { color: #fde68a; font-weight: 700; }
.event-card__time {
    background: rgba(16, 185, 129, .14);
    border: 1px solid rgba(16, 185, 129, .3);
    color: #6ee7b7;
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .04em;
}
.event-card__teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
.event-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.event-team:nth-child(3) { justify-content: flex-end; flex-direction: row-reverse; }
.event-team__crest {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #475569);
    border: 2px solid rgba(255,255,255,.2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    flex-shrink: 0;
}
.event-team__name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-card__vs {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: .15em;
}
.event-odds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.odd-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    transition: all .15s ease;
}
.odd-btn:hover {
    background: linear-gradient(135deg, #f97316, #fbbf24);
    color: #1a0f00;
    border-color: transparent;
    transform: translateY(-2px);
}
.odd-btn small {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: .1em;
    font-weight: 700;
}
.odd-btn:hover small { color: #1a0f00; }
.odd-btn b {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.odd-btn--flash {
    animation: oddFlash .6s ease;
}
@keyframes oddFlash {
    0%   { background: rgba(0,0,0,.25); }
    35%  { background: rgba(251, 191, 36, .35); }
    100% { background: rgba(0,0,0,.25); }
}

/* ---- PROMO CARD upgrade (shine + cta) ---- */
.promo-card {
    display: flex;
    flex-direction: column;
}
.promo-card__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.18) 50%, transparent 65%);
    transform: translateX(-100%);
    transition: transform .7s ease;
    pointer-events: none;
}
.promo-card:hover .promo-card__shine { transform: translateX(100%); }
.promo-card__cta {
    margin-top: auto;
    padding-top: 12px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    align-self: flex-start;
    border-top: 1px solid rgba(255,255,255,.18);
    width: 100%;
    transition: padding .2s ease;
}
.promo-card:hover .promo-card__cta { padding-left: 4px; }
.promo-card--gold .promo-card__cta { color: #1f2937; border-color: rgba(0,0,0,.18); }

/* ---- TRUST STRIP ---- */
.trust-zone { padding-top: 28px; padding-bottom: 8px; }
.trust-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
@media (max-width: 900px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .trust-grid { grid-template-columns: 1fr; } }
.trust-card {
    text-align: center;
    padding: 18px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(28, 35, 86, .55), rgba(15, 10, 50, .8));
    border: 1px solid var(--home-border);
    transition: transform .2s ease, border-color .2s ease;
}
.trust-card:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, .35);
}
.trust-card__icon {
    font-size: 32px;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
.trust-card__title {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}
.trust-card__sub {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

/* ---- FAQ ---- */
.faq-zone { padding-top: 28px; padding-bottom: 8px; }
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.faq-item {
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(28, 35, 86, .6), rgba(15, 10, 50, .85));
    border: 1px solid var(--home-border);
    overflow: hidden;
    transition: border-color .2s ease;
}
.faq-item[open] { border-color: rgba(251, 191, 36, .35); }
.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(251, 191, 36, .15);
    border: 1px solid rgba(251, 191, 36, .35);
    color: #fde68a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    transition: transform .2s ease, background .2s ease;
    flex-shrink: 0;
}
.faq-item[open] summary::after {
    content: "−";
    transform: rotate(180deg);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a0f00;
    border-color: transparent;
}
.faq-body {
    padding: 0 20px 18px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.65;
    animation: faqOpen .25s ease;
}
@keyframes faqOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- SEO COPY block ---- */
.seo-zone { padding-top: 16px; padding-bottom: 28px; }
.seo-card {
    padding: 32px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(28, 35, 86, .55), rgba(15, 10, 50, .8));
    border: 1px solid var(--home-border);
}
.seo-card h2 {
    margin: 0 0 12px;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 900;
    background: linear-gradient(120deg, #fff, #fde68a 60%, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.seo-card h3 {
    margin: 18px 0 10px;
    font-size: 17px;
    color: #fff;
}
.seo-card p {
    color: #cbd5e1;
    line-height: 1.75;
    font-size: 15px;
    margin: 0 0 12px;
}
.seo-card strong { color: #fde68a; }
.seo-list {
    margin: 8px 0 14px;
    padding-left: 20px;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.85;
}
.seo-list li::marker { color: #fbbf24; }
.seo-foot {
    padding-top: 8px;
    border-top: 1px dashed rgba(255,255,255,.1);
    margin-top: 12px;
}

/* ---- Footer extras ---- */
.footer-badges {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.footer-badge {
    padding: 4px 10px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--home-border);
    border-radius: 999px;
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ---- Floating Live Chat button ---- */
.float-chat {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 12px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 16px 40px -10px rgba(16, 185, 129, .5);
    transition: transform .2s ease, box-shadow .2s ease;
}
.float-chat:hover {
    transform: translateY(-3px);
    text-decoration: none;
    box-shadow: 0 22px 50px -10px rgba(16, 185, 129, .65);
}
.float-chat__icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.float-chat__text { font-size: 14px; }
.float-chat__pulse {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 0 0 rgba(251, 191, 36, .8);
    animation: chatPulse 1.6s infinite;
}
@keyframes chatPulse {
    0%   { box-shadow: 0 0 0 0   rgba(251, 191, 36, .8); }
    70%  { box-shadow: 0 0 0 12px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0   rgba(251, 191, 36, 0); }
}
@media (max-width: 600px) {
    .float-chat__text { display: none; }
    .float-chat { padding: 10px; }
}

/* ---- Mobile tweak: hero medal smaller, marquee hide ---- */
@media (max-width: 1024px) {
    .hero-medal { height: 200px; }
    .hero-medal__coin { width: 150px; height: 150px; }
}
@media (max-width: 600px) {
    .hero-medal { height: 180px; }
    .hero-medal__coin { width: 130px; height: 130px; }
    .hero-marquee { font-size: 12px; gap: 18px; }
}

/* ---- Improved hero card CTAs spacing on mobile ---- */
@media (max-width: 480px) {
    .hero-card { padding: 28px 22px; }
    .btn-glow--xl { padding: 14px 24px; font-size: 14px; }
}

/* =========================================
   NAVBAR — MOBILE LAYOUT
   เก็บเฉพาะ: เลือกค่ายเกม / โปรไฟล์ / จำนวนเงิน / ออกจากระบบ
   ========================================= */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 12px;
        gap: 8px;
    }
    .navbar .brand,
    .brand--home {
        font-size: 15px;
        gap: 6px;
    }
    .brand-icon {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
    .brand-text small { display: none; }

    .nav-links {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
        flex: 1;
        min-width: 0;
    }
    .nav-links a {
        font-size: 12px;
        white-space: nowrap;
    }

    /* ซ่อนเมนูที่ไม่จำเป็นบนมือถือ */
    .nav-hide-mobile { display: none !important; }

    /* แสดงเฉพาะยอดเงินคงเหลือ ซ่อนชื่อผู้ใช้ */
    .nav-user { text-align: right; font-size: 11px; }
    .nav-user__name { display: none; }
    .nav-user .balance { font-size: 13px; }

    /* ปุ่มออกจากระบบ */
    .logout-form .btn-link { font-size: 12px; }
}

@media (max-width: 480px) {
    .navbar { padding: 8px 10px; }
    .nav-links { gap: 6px; }
    .nav-links a { font-size: 11px; }
    .brand-text { font-size: 13px; }
}

/* ====================================================================
   Admin Responsive Refinements (Mobile / Tablet)
   ──────────────────────────────────────────────────────────────────────
   - ทุก .data-table ใน .table-wrap เปลี่ยนเป็น card mode อัตโนมัติ <720px
     (data-label ถูก inject ด้วย JS auto-labeler ใน admin sidebar partial)
   - opt-out ใส่ class .no-cards บนตัว .data-table
   - ปรับ header, filter-bar, pagination, kpi, action-row, grid ต่าง ๆ
   ==================================================================== */

/* ── Dashboard / Detail grid: ปรับ breakpoint สำหรับ tablet ── */
@media (max-width: 960px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* ── Admin header: stack on mobile, smaller h1 ── */
@media (max-width: 720px) {
    .admin-header {
        gap: 8px;
    }
    .admin-header h1 { font-size: 18px; }
    .admin-header .btn-primary,
    .admin-header .btn-secondary,
    .admin-header .btn-link {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* ── KPI cards: ลด font บนจอเล็ก ── */
@media (max-width: 720px) {
    .kpi-card {
        padding: 14px 14px;
    }
    .kpi-value { font-size: 20px; }
    .kpi-label { font-size: 11px; }
    .kpi-sub { font-size: 11px; }
}

/* ── Filter bar: input ไม่ overflow บนจอจิ๋ว ── */
@media (max-width: 720px) {
    .filter-bar {
        padding: 10px;
        gap: 6px;
    }
    .filter-bar input,
    .filter-bar select,
    .filter-bar button,
    .filter-bar .btn-link,
    .filter-bar .btn-secondary,
    .filter-bar .btn-primary {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }
    .filter-bar input[type="text"] {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* ── Pagination: stack ── */
@media (max-width: 540px) {
    .pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .pagination-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ── Action row (ปุ่ม actions ในหน้า detail): wrap แต่ละปุ่มเต็มแถวบนมือถือ ── */
@media (max-width: 540px) {
    .action-row {
        flex-direction: column;
        align-items: stretch;
    }
    .action-row form,
    .action-row .btn-primary,
    .action-row .btn-secondary {
        width: 100%;
    }
    .action-row button {
        width: 100%;
    }
}

/* ── Audit details overflow ── */
@media (max-width: 720px) {
    .audit-details {
        max-width: 100%;
        font-size: 11px;
    }
}

/* ── Wallet card values ลดขนาดบนจอเล็ก ── */
@media (max-width: 480px) {
    .wallet-card-value { font-size: 24px; }
    .wallet-card { padding: 18px; }
}

/* =========================================
   WALLET QUICK CARD — แสดงยอดเงิน + ปุ่มฝาก/ถอนด่วน
   ใช้ที่หน้า lobby (และหน้าอื่น ๆ ที่ต้องการ)
   ========================================= */
.wallet-quick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #1f2c4a 0%, #16213e 100%);
    border: 1px solid var(--primary);
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.wallet-quick__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.wallet-quick__balances {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px 28px;
}
.wallet-quick__balance-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wallet-quick__value--diamonds {
    color: #c4b5fd;
    font-size: 22px;
}
.wallet-quick__label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.wallet-quick__value {
    font-size: 28px;
    font-weight: 800;
    color: var(--success);
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.wallet-quick__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.wallet-quick__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.wallet-quick__btn:hover {
    transform: translateY(-1px);
}
.wallet-quick__btn--withdraw {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid var(--border);
}
.wallet-quick__btn--withdraw:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}
.wallet-quick__btn-icon {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 600px) {
    .wallet-quick {
        padding: 14px 16px;
        gap: 12px;
    }
    .wallet-quick__value { font-size: 24px; }
    .wallet-quick__label { font-size: 12px; }
    .wallet-quick__actions {
        width: 100%;
    }
    .wallet-quick__btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* =========================================
   FLOATING LUCKY SPIN (FAB) + OVERLAY MODAL
   ========================================= */
.float-spin {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 12px 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #f59e0b, #ef4444 70%, #ec4899);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 18px 38px -10px rgba(239, 68, 68, .55), 0 0 0 1px rgba(255,255,255,.08) inset;
    transition: transform .2s ease, box-shadow .2s ease;
}
.float-spin:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px -10px rgba(239, 68, 68, .7), 0 0 0 1px rgba(255,255,255,.12) inset;
}
.float-spin:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.float-spin__wheel {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: spinIcon 6s linear infinite;
}
@keyframes spinIcon {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.float-spin__text { font-size: 14px; letter-spacing: .2px; }
.float-spin__pulse {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fde68a;
    box-shadow: 0 0 0 0 rgba(253, 230, 138, .8);
    animation: chatPulse 1.6s infinite;
}
@media (max-width: 600px) {
    .float-spin { padding: 10px; bottom: 16px; right: 16px; }
    .float-spin__text { display: none; }
    .float-spin__wheel { width: 32px; height: 32px; font-size: 18px; }
}

/* ---- Overlay (Backdrop + Panel) ---- */
.spin-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
.spin-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.spin-overlay[hidden] { display: none; }

.spin-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 12, 24, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.spin-overlay__panel {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
    transform: translateY(12px) scale(.98);
    transition: transform .22s ease;
}
.spin-overlay.is-open .spin-overlay__panel {
    transform: translateY(0) scale(1);
}

.spin-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(245, 158, 11, .08), transparent);
    border-radius: 16px 16px 0 0;
}
.spin-overlay__header h2 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}
.spin-overlay__close {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.spin-overlay__close:hover {
    background: rgba(239, 68, 68, .25);
    border-color: #ef4444;
}
.spin-overlay__close:active { transform: scale(.95); }

.spin-overlay__body {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
    padding: 22px;
}
@media (max-width: 760px) {
    .spin-overlay__body { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
    .spin-overlay__panel { max-height: calc(100vh - 24px); }
    .spin-overlay { padding: 12px; }
}

.spin-overlay__more {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    text-decoration: none;
}
.spin-overlay__more:hover { color: var(--primary); }

/* ── ทำให้ทุก .data-table auto-card บนมือถือ
       (ครอบคลุมทั้ง .table-wrap-wrapped และที่อยู่ตรง ๆ ใน .panel/.dashboard-grid)
       opt-out ด้วย .data-table.no-cards
       ── */
@media (max-width: 720px) {
    .table-wrap {
        overflow-x: visible;
        background: transparent;
        border: none;
        border-radius: 0;
    }
    .data-table:not(.no-cards) {
        display: block;
        font-size: 13px;
        width: 100%;
    }
    .data-table:not(.no-cards) thead {
        display: none;
    }
    .data-table:not(.no-cards) tbody { display: block; }
    .data-table:not(.no-cards) tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--panel);
        padding: 4px 0;
    }
    .data-table:not(.no-cards) tbody tr:hover {
        background: var(--panel);
    }
    .data-table:not(.no-cards) tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 8px 14px;
        border-bottom: 1px dashed rgba(148, 163, 184, .14);
        white-space: normal;
        text-align: right;
        word-break: break-word;
    }
    .data-table:not(.no-cards) tbody td:last-child {
        border-bottom: none;
    }
    .data-table:not(.no-cards) tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .04em;
        text-align: left;
        flex: 0 0 auto;
        min-width: 92px;
    }
    /* ถ้าไม่มี data-label (เช่น colspan=N สำหรับ empty state) ให้ซ่อน ::before */
    .data-table:not(.no-cards) tbody td:not([data-label])::before {
        content: '';
        min-width: 0;
    }
    .data-table:not(.no-cards) tbody td.text-right {
        text-align: right;
    }
    /* Empty state row (colspan) ให้แสดงข้อความตรงกลาง ไม่ใช่ flex layout */
    .data-table:not(.no-cards) tbody tr td[colspan] {
        display: block;
        text-align: center;
        padding: 16px;
        border-bottom: none;
    }
}

/* ── สำรอง: ถ้ามีตารางที่ตั้งใจให้ scroll แนวนอนแทน card (เช่นตารางตัวเลขล้วน)
       ใส่ class .no-cards บน <table> + คง overflow-x ของ .table-wrap ── */
@media (max-width: 720px) {
    .table-wrap:has(.data-table.no-cards) {
        overflow-x: auto;
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: 12px;
    }
}

/* ── Admin main: ลด padding ลงอีกบนจอจิ๋ว ── */
@media (max-width: 480px) {
    .admin-main { padding: 60px 12px 20px; }
    .panel { padding: 14px; }
    .panel h2 { font-size: 16px; }
}

/* ── auth-form inputs ใน detail: เต็มความกว้างเสมอ ── */
@media (max-width: 720px) {
    .panel .auth-form label {
        display: block;
    }
    .panel .auth-form input,
    .panel .auth-form select,
    .panel .auth-form textarea {
        width: 100%;
        box-sizing: border-box;
    }
    .panel .auth-form button[type="submit"] {
        width: 100%;
    }
}

/* ── Login page (admin) ── */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
    }
}
