
        :root {
            --font-family-sans-serif: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
            --brand-primary: #1d4ed8;
            --brand-primary-rgb: 29, 78, 216;
            --brand-dark: #1e40af;
            --brand-soft: #eff6ff;
            --surface: #ffffff;
            --surface-muted: #f8fafc;
            --page-background: #f1f5f9;
            --text-color: #0f172a;
            --text-muted: #64748b;
            --border-color: #e2e8f0;
            --input-border: #94a3b8;
            --disabled-bg: #e2e8f0;
            --disabled-text: #64748b;
            --bs-primary: var(--brand-primary);
            --bs-primary-rgb: var(--brand-primary-rgb);
            --bs-link-color: var(--brand-primary);
            --bs-link-hover-color: var(--brand-dark);
            --brand-accent: #f59e0b;
            --app-font-size: 16px;
            --app-small-font-size: 14px;
            --app-control-font-size: 15px;
            --app-title-font-size: 20px;
        }

        body {
            font-family: var(--font-family-sans-serif);
            background-color: var(--page-background);
            color: #0f172a;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding-bottom: 0;
        }

        body.has-bottom-nav {
            padding-bottom: 72px; /* space for mobile bottom nav only when logged in */
        }

        @media (min-width: 992px) {
            body, body.has-bottom-nav {
                padding-bottom: 0;
            }
        }

        .navbar-custom {
            background: #ffffff;
            border-bottom: 1px solid #e2e8f0;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        }

        .brand-logo-wrap {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            text-decoration: none;
        }

        .brand-title {
            font-weight: 800;
            font-size: 1.45rem;
            color: #0f172a;
            line-height: 1;
            letter-spacing: -0.5px;
        }

        .card-custom {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 18px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
            transition: all 0.2s ease;
        }

        .balance-chip {
            background: #ecfdf5;
            border: 1px solid #a7f3d0;
            color: #065f46;
            font-weight: 700;
            padding: 0.35rem 0.85rem;
            border-radius: 9999px;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.88rem;
            text-decoration: none;
            transition: all 0.2s ease;
        }

        .balance-chip:hover {
            background: #d1fae5;
            color: #047857;
            transform: scale(1.02);
        }

        .balance-chip .plus-btn {
            background: #10b981;
            color: #ffffff;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            margin-left: 2px;
        }

        /* Mobile Bottom App Navigation */
        .mobile-bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 64px;
            background: rgba(255, 255, 255, 0.96);
            backdrop-filter: blur(16px);
            border-top: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: space-around;
            z-index: 1040;
            box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        }

        .mobile-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #64748b;
            text-decoration: none;
            font-size: 0.72rem;
            font-weight: 600;
            transition: all 0.15s ease;
            position: relative;
            padding: 4px 12px;
            border-radius: 12px;
        }

        .mobile-nav-item i {
            font-size: 1.28rem;
            margin-bottom: 2px;
        }

        .mobile-nav-item.active {
            color: var(--brand-primary);
        }

        .mobile-nav-item.active i {
            transform: translateY(-2px);
            color: var(--brand-primary);
        }

        .mobile-nav-item:active {
            transform: scale(0.92);
        }

        .mobile-nav-badge {
            position: absolute;
            top: 2px;
            right: 14px;
            background: #ef4444;
            color: #fff;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 1px 5px;
            border-radius: 999px;
        }

        /* Lottery Balls Standard */
        .lottery-ball {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 1.05rem;
            color: #ffffff;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
            margin: 0 3px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
            user-select: none;
        }

        .ball-red { background: radial-gradient(circle at 35% 35%, #f87171, #dc2626 70%, #991b1b); }
        .ball-blue { background: radial-gradient(circle at 35% 35%, #60a5fa, var(--brand-primary) 70%, #1e40af); }
        .ball-yellow { background: radial-gradient(circle at 35% 35%, #fbbf24, #d97706 70%, #b45309); }
        .ball-purple { background: radial-gradient(circle at 35% 35%, #a78bfa, #7c3aed 70%, #5b21b6); }
        .ball-green { background: radial-gradient(circle at 35% 35%, #34d399, #059669 70%, #065f46); }

        /* Luxury Custom SweetAlert2 Styling */
        .swal2-popup.lotto-swal-popup {
            border-radius: 24px !important;
            font-family: var(--font-family-sans-serif) !important;
            padding: 2rem 1.75rem !important;
            box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25) !important;
            border: 1px solid rgba(226, 232, 240, 0.9) !important;
            background: #ffffff !important;
        }
        .swal2-title.lotto-swal-title {
            font-size: 1.35rem !important;
            font-weight: 800 !important;
            color: #0f172a !important;
            letter-spacing: -0.3px !important;
            margin-bottom: 0.5rem !important;
        }
        .swal2-html-container.lotto-swal-content {
            font-size: 0.95rem !important;
            color: #475569 !important;
            line-height: 1.6 !important;
        }
        .lotto-swal-confirm-btn {
            background: linear-gradient(135deg, var(--brand-primary) 0%, #1d4ed8 100%) !important;
            border: none !important;
            color: #ffffff !important;
            font-weight: 700 !important;
            font-size: 0.95rem !important;
            padding: 0.65rem 1.8rem !important;
            border-radius: 9999px !important;
            box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
            transition: all 0.2s ease !important;
            cursor: pointer !important;
        }
        .lotto-swal-confirm-btn:hover {
            transform: translateY(-2px) !important;
            box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45) !important;
        }
        .lotto-swal-cancel-btn {
            background: #f1f5f9 !important;
            border: none !important;
            color: #64748b !important;
            font-weight: 700 !important;
            font-size: 0.95rem !important;
            padding: 0.65rem 1.5rem !important;
            border-radius: 9999px !important;
            margin-left: 0.5rem !important;
            transition: all 0.2s ease !important;
            cursor: pointer !important;
        }
        .lotto-swal-cancel-btn:hover {
            background: #e2e8f0 !important;
            color: #334155 !important;
        }

        /* Enhanced Bootstrap In-Page Alerts */
        .alert-custom-success {
            background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
            border: 1.5px solid #a7f3d0;
            color: #065f46;
            border-radius: 16px;
            box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
        }
        .alert-custom-danger {
            background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
            border: 1.5px solid #fecaca;
            color: #991b1b;
            border-radius: 16px;
            box-shadow: 0 4px 16px rgba(239, 68, 68, 0.1);
        }

        footer {
            margin-top: auto;
            background: #0f172a;
            color: #94a3b8;
            padding: 2rem 0 1.5rem;
        }

.account-form-page { max-width: 560px; margin: 16px auto 32px; }
.account-page-heading { display:flex; align-items:center; gap:12px; margin-bottom:24px; }
.account-page-heading h1 { font-size:1.25rem; font-weight:700; margin:0; }
.account-back { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; color:var(--brand-primary); background:var(--brand-soft); text-decoration:none; }
.account-form-surface { padding:28px; background:#fff; border:1px solid var(--border-color); border-radius:24px; }
.account-modal .modal-content { border:0; border-radius:24px; box-shadow:0 24px 64px #153d3226; }
.account-modal .modal-header { padding:24px 28px 12px; border:0; }
.account-modal .modal-body { padding:12px 28px 28px; }
.material-description { color:var(--text-muted); font-size:14px; line-height:1.6; margin:0 0 28px; }
.material-field { position:relative; margin-top:24px; }
.material-field input { width:100%; min-height:56px; border:1px solid var(--input-border); border-radius:12px; background:#fff; padding:16px; color:var(--text-color); font-size:16px; outline:none; transition:border-color .15s,box-shadow .15s; }
.material-field label { position:absolute; top:18px; left:13px; padding:0 4px; color:var(--text-muted); background:#fff; pointer-events:none; transition:top .15s,font-size .15s,color .15s; }
.material-field input:focus + label, .material-field input:not(:placeholder-shown) + label { top:-9px; font-size:12px; }
.material-field input:focus { border-color:var(--brand-primary); box-shadow:0 0 0 1px var(--brand-primary); }
.material-field input:focus + label { color:var(--brand-primary); }
.material-field input[readonly] { background:var(--surface-muted); color:var(--text-muted); }
.material-field input[readonly] + label { background:var(--surface-muted); }
.material-hint { font-size:12px; color:var(--text-muted); margin:8px 4px 0; line-height:1.5; }
.material-password input { padding-right:56px; }
.password-toggle { position:absolute; right:6px; top:6px; height:44px; width:44px; border:0; border-radius:50%; background:transparent; color:var(--text-muted); }
.password-toggle:hover { background:var(--brand-soft); }
.password-toggle:focus-visible, .account-back:focus-visible { outline:2px solid var(--brand-primary); }
.material-notice { background:var(--surface-muted); border-radius:12px; padding:12px 16px; margin:24px 0 16px; font-size:13px; color:var(--text-muted); }
.material-submit { width:100%; min-height:48px; padding:12px 24px; border:0; border-radius:24px; background:var(--brand-primary); color:white; font-weight:600; }
.material-submit:disabled { background:var(--disabled-bg); color:var(--disabled-text); cursor:not-allowed; }
@media(max-width:991.98px) { .account-form-page { margin:8px auto 24px; } .account-form-surface { padding:20px 16px 24px; border-radius:20px; } }
@media(prefers-reduced-motion:reduce) { .material-field input,.material-field label { transition:none; } }

/* Shared application palette and component states. */
.btn-primary, .btn-outline-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand-primary);
    --bs-btn-disabled-border-color: var(--brand-primary);
    --bs-btn-focus-shadow-rgb: var(--brand-primary-rgb);
}
.btn-outline-primary { --bs-btn-color: var(--brand-primary); --bs-btn-bg: transparent; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-color: var(--brand-primary); --bs-btn-disabled-bg: transparent; }
.bg-primary-subtle { background-color: var(--brand-soft) !important; }
.border-primary-subtle { border-color: #bfdbfe !important; }
.text-primary-emphasis { color: var(--brand-dark) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 .2rem rgba(var(--brand-primary-rgb), .15); }
.filter-tab.active { background: var(--brand-primary); border-color: var(--brand-primary); box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb), .2); }
.balance-chip { background: var(--brand-soft); color: var(--brand-primary); border-color: #bfdbfe; }
.balance-chip:hover { background: #dbeafe; color: var(--brand-dark); }
.balance-chip .plus-btn { background: var(--brand-primary); }
.personal-hero, .wallet-account { background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary)); }
.personal-row { color: var(--text-color); }
.personal-row > i:first-child { background: var(--brand-soft); color: var(--brand-primary); }
.personal-row:focus-visible { outline-color: var(--brand-primary); }
@media (max-width: 991.98px) {
    .account-page-heading { background: var(--brand-primary); color: #fff; padding: 12px 16px; border-radius: 16px; gap: 8px; margin-bottom: 20px; }
    .account-page-heading h1 { color: #fff; }
    .account-page-heading .account-back { background: rgba(255,255,255,.15); color: #fff; flex-shrink: 0; }
    .account-page-heading .account-back:focus-visible { outline-color: #fff; }
    .navbar-custom { background: var(--brand-primary); border-color: transparent; }
    .navbar-custom .brand-title, .navbar-custom .brand-logo-wrap, .navbar-custom .nav-link, .navbar-custom .navbar-toggler { color: #fff; }
    .navbar-custom .btn-outline-primary { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255,255,255,.65); --bs-btn-hover-bg: var(--brand-dark); }
}


    .personal-page { max-width: 640px; margin: 0 auto; padding: 16px 0 24px; }
    .personal-hero { background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary)); border-radius: 24px; color: white; padding: 24px; }
    .personal-avatar { width: 52px; height: 52px; display: grid; place-items: center; background: #ffffff26; border-radius: 18px; font-size: 28px; }
    .personal-balance { font-size: clamp(26px, 7vw, 36px); font-weight: 800; margin: 4px 0 16px; }
    .personal-menu { background: white; border: 1px solid #e2e8f0; border-radius: 20px; overflow: hidden; margin-top: 18px; }
    .personal-row { display: flex; align-items: center; gap: 14px; padding: 18px; color: var(--text-color); text-decoration: none; min-height: 64px; }
    .personal-row > i:first-child { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--brand-soft); font-size: 20px; }
    .personal-row .bi-chevron-right { margin-left: auto; font-size: 14px; color: #94a3b8; }
    .personal-menu > * + * { border-top: 1px solid #edf0f3; }
    details > summary.personal-row { list-style: none; cursor: pointer; }
    details > summary::-webkit-details-marker { display: none; }
    details[open] .bi-chevron-right { transform: rotate(90deg); }
    .personal-content { padding: 0 18px 20px 70px; font-size: 14px; color: #64748b; overflow-wrap: anywhere; }
    .personal-info { margin: 0; }
    .personal-info dt { font-weight: 500; margin-top: 12px; }
    .personal-info dd { color: var(--text-color); margin: 4px 0 0; }
    .personal-row:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -3px; }


    .wallet-account { padding: 24px; border-radius: 24px; color: #fff; background: linear-gradient(125deg, var(--brand-dark), var(--brand-primary)); box-shadow: 0 8px 24px rgba(var(--brand-primary-rgb), .08); }
    .wallet-account-heading { display: flex; align-items: center; gap: 12px; }
    .wallet-account-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #ffffff22; font-size: 24px; }
    .wallet-account-balance { margin-top: 24px; padding-top: 20px; border-top: 1px solid #ffffff26; }
    .wallet-balance-value { font-size: clamp(28px, 7vw, 40px); font-weight: 800; margin-top: 4px; overflow-wrap: anywhere; }
    .wallet-balance-value span { font-size: 20px; font-weight: 500; }
    .wallet-amount-input .form-control { min-width: 0; padding: 14px; font-size: 18px; font-weight: 600; }
    .wallet-amount-input .input-group-text { background: #f8fafc; color: #64748b; }
    .wallet-confirm-button { width: 100%; min-height: 48px; padding: 12px 20px; border-radius: 14px; font-size: 1rem; white-space: normal; }
    .wallet-mobile-list { display: none; padding: 0; margin: 0; list-style: none; }
    .wallet-list-item { padding: 16px 0; }
    .wallet-list-item + .wallet-list-item { border-top: 1px solid #edf0f3; }
    .wallet-list-top, .wallet-list-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
    .wallet-list-meta { color: #64748b; font-size: 12px; margin-top: 8px; }
    .wallet-list-description { color: #475569; font-size: 13px; margin-top: 8px; overflow-wrap: anywhere; }
    .wallet-empty { padding: 24px 0; text-align: center; color: #64748b; font-size: 14px; }
    .wallet-empty i { display: block; font-size: 28px; margin-bottom: 8px; }
    .wallet-page .col-lg-6 { min-width: 0; }
    .wallet-page .font-monospace { overflow-wrap: anywhere; }
    .wallet-page .d-flex > div { min-width: 0; }
    .wallet-page button[onclick^="copy"] { flex-shrink: 0; min-width: 38px; min-height: 38px; }
    @media (max-width: 767.98px) {
        .wallet-page { --bs-gutter-y: 18px; }
        .wallet-page .card-custom { padding: 18px !important; border-radius: 20px; }
        .wallet-account { padding: 20px; border-radius: 20px; }
        .wallet-page .border-bottom.d-flex { flex-wrap: wrap; gap: 8px; align-items: flex-start !important; }
        .wallet-page h5 { font-size: 1rem; line-height: 1.5; }
        .wallet-desktop-table { display: none; }
        .wallet-mobile-list { display: block; }
        .wallet-confirm-button { font-size: .95rem; padding: 12px; }
    }


    .ticket-board-row { display: flex; align-items: flex-start; gap: 12px; }
    .ticket-board-row .board-tag { flex-shrink: 0; margin-top: 3px; }
    .ticket-board-balls { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
    @media (max-width: 575.98px) {
        .ticket-card { padding: 16px !important; }
        .ticket-board-row { gap: 10px; }
        .ticket-board-row .board-tag { min-width: 52px; padding-inline: 6px; }
    }
    .ticket-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 18px;
        padding: 1.25rem 1.5rem;
        margin-bottom: 1.25rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
        transition: all 0.2s ease;
        position: relative;
    }
    .ticket-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        border-color: #cbd5e1;
    }
    .ticket-ball-sm {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 0.8rem;
        color: #ffffff;
        background: radial-gradient(circle at 35% 35%, #ef4444 0%, #dc2626 70%, #991b1b 100%);
        box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
    }
    .board-tag {
        font-size: 0.72rem;
        font-weight: 800;
        padding: 0.25rem 0.6rem;
        border-radius: 6px;
        background: #f1f5f9;
        color: #334155;
        display: inline-block;
        min-width: 60px;
        text-align: center;
    }
    .filter-tab {
        border-radius: 9999px;
        padding: 0.5rem 1.25rem;
        font-weight: 700;
        font-size: 0.88rem;
        color: #64748b;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        text-decoration: none;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }
    .filter-tab:hover {
        background: #f8fafc;
        color: #1e293b;
        border-color: #cbd5e1;
    }
    .filter-tab.active {
        background: var(--brand-primary);
        color: #ffffff;
        border-color: var(--brand-primary);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    }

/* Mobile detail screens use one navigation header in place of the main navbar. */
.mobile-page-header { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 8px; padding: 8px 16px; min-height: 60px; color: #fff; background: var(--brand-primary); box-shadow: 0 2px 8px rgba(var(--brand-primary-rgb), .15); }
.mobile-page-header h1 { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.5; }
.mobile-page-back { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; color: #fff; text-decoration: none; font-size: 22px; }
.mobile-page-back:hover { color: #fff; background: rgba(255,255,255,.12); }
.mobile-page-back:focus-visible { outline: 2px solid #fff; }

/* Mobile action sizing shared by every screen, dialog and bottom sheet. */
@media (max-width: 991.98px) {
    body { --mobile-action-font-size: 14px; --mobile-action-height: 44px; }
    .has-mobile-page-header > .container { margin-top: 16px !important; }
    .btn:not(.btn-close), .material-submit, .wallet-confirm-button,
    .btn-order-confirm, .btn-add-ticket, .btn-lucky-pick, .btn-clear-pick,
    .btn-delete-all, .action-btn-pill, .swal2-confirm, .swal2-cancel {
        font-size: var(--mobile-action-font-size) !important;
        line-height: 1.4 !important;
        min-height: var(--mobile-action-height);
        padding: 10px 16px !important;
        font-weight: 600;
        white-space: normal;
    }
    .btn-sm:not(.btn-close) { font-size: 13px !important; padding: 8px 12px !important; }
    .btn-order-confirm, .btn-add-ticket { background: var(--brand-primary); }
    .btn:not(.btn-close) > i, .btn-order-confirm > i, .btn-add-ticket > i { font-size: 1em !important; }
    .btn-close { flex-shrink: 0; }
    .modal-title, .offcanvas-title { font-size: 16px !important; line-height: 1.5; }
    .modal-header { gap: 12px; }
    .modal-header > .d-flex { min-width: 0; }
    .modal-footer { gap: 8px; }
    .modal-footer > .btn { margin: 0; flex: 1 1 auto; }
    .swal2-actions { gap: 8px; }
    .swal2-confirm, .swal2-cancel { border-radius: 12px; }
    .mobile-sticky-bar .btn { padding-inline: 12px !important; }
    .account-form-page { margin-top: 0; }
}


    /* ========================================================
       1. Top Section: Compact Slide & Latest Results Sidebar
       ======================================================== */
    .top-showcase-row {
        margin-bottom: 2rem;
    }

    .banner-carousel-compact {
        height: 270px;
        border-radius: 18px;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
        background: #0f172a;
    }

    .banner-carousel-compact .carousel-item {
        height: 270px;
    }

    .banner-carousel-compact img {
        height: 270px;
        width: 100%;
        object-fit: cover;
        object-position: center;
    }

    .banner-carousel-compact .carousel-indicators {
        margin-bottom: 10px;
        gap: 6px;
    }

    .banner-carousel-compact .carousel-indicators [data-bs-target] {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin: 0;
        background-color: rgba(255, 255, 255, 0.6);
        border: none;
        transition: all 0.2s ease;
    }

    .banner-carousel-compact .carousel-indicators .active {
        background-color: #ffffff;
        transform: scale(1.3);
    }

    /* Latest Results Box - Reference Image Style */
    .results-compact-box {
        height: 270px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 18px;
        padding: 14px 16px;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
        display: flex;
        flex-direction: column;
    }

    .results-compact-header {
        font-weight: 800;
        font-size: 1.05rem;
        color: #0f172a;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .results-compact-scroll {
        flex: 1;
        overflow-y: auto;
        padding-right: 4px;
    }

    .results-compact-scroll::-webkit-scrollbar {
        width: 5px;
    }

    .results-compact-scroll::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .results-compact-scroll::-webkit-scrollbar-thumb {
        background-color: #cbd5e1;
        border-radius: 4px;
    }

    .results-compact-scroll::-webkit-scrollbar-thumb:hover {
        background-color: #94a3b8;
    }

    .result-date-header {
        font-size: 0.78rem;
        font-weight: 700;
        color: #64748b;
        margin-top: 8px;
        margin-bottom: 6px;
    }

    .result-game-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
    }

    .result-game-logo {
        width: 52px;
        height: 26px;
        object-fit: contain;
        flex-shrink: 0;
    }

    .result-capsule {
        background-color: #eff6ff;
        border-radius: 999px;
        padding: 3px 8px;
        display: flex;
        align-items: center;
        gap: 5px;
        flex-wrap: wrap;
        flex: 1;
    }

    .result-ball-blue {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background-color: #3b82f6;
        color: #ffffff;
        font-size: 0.72rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 1px 3px rgba(59, 130, 246, 0.35);
        user-select: none;
    }

    /* ========================================================
       2. Section Header & Game Filter Pills
       ======================================================== */
    .filter-pills-wrap {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .game-filter-btn {
        background: #ffffff;
        border: 1.5px solid #e2e8f0;
        color: #475569;
        font-weight: 700;
        font-size: 0.9rem;
        padding: 0.5rem 1.25rem;
        border-radius: 999px;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    }

    .game-filter-btn:hover {
        background: #f8fafc;
        border-color: #cbd5e1;
        color: #1e293b;
        transform: translateY(-1px);
    }

    .game-filter-btn.active {
        background: #2563eb;
        border-color: #2563eb;
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    }

    /* ========================================================
       3. Grid Danh Sách 9 Dòng Game Đặt Vé (Thiết kế cũ)
       ======================================================== */
    .lotto-card {
        background: #ffffff;
        border-radius: 22px;
        border: 1px solid #e2e8f0;
        overflow: hidden;
        transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        display: flex;
        flex-direction: column;
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    }

    .lotto-card:hover {
        transform: translateY(-7px);
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
        border-color: rgba(37, 99, 235, 0.3);
    }

    .card-top-banner {
        padding: 1.25rem 1.25rem 1rem;
        color: #ffffff;
        position: relative;
        overflow: hidden;
    }

    .card-top-banner::after {
        content: '';
        position: absolute;
        right: -20px;
        bottom: -20px;
        width: 90px;
        height: 90px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        pointer-events: none;
    }

    /* Gradient Backgrounds per Game Theme */
    .theme-ultra { background: linear-gradient(135deg, #d97706 0%, #b45309 60%, #78350f 100%); }
    .theme-grand { background: linear-gradient(135deg, #ef4444 0%, #dc2626 60%, #991b1b 100%); }
    .theme-super { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%); }
    .theme-mega  { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 60%, #9f1239 100%); }
    .theme-lotto { background: linear-gradient(135deg, #10b981 0%, #059669 60%, #047857 100%); }
    .theme-6d    { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 60%, #5b21b6 100%); }
    .theme-4d    { background: linear-gradient(135deg, #f97316 0%, #ea580c 60%, #9a3412 100%); }
    .theme-3d    { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 60%, #0e7490 100%); }
    .theme-2d    { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 60%, #115e59 100%); }

    /* Game Logo Box */
    .game-logo-badge {
        width: 88px;
        height: 64px;
        border-radius: 14px;
        background: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px 8px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
        user-select: none;
        flex-shrink: 0;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    }

    .game-logo-badge img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }

    .lotto-card:hover .game-logo-badge {
        transform: scale(1.06);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    }

    /* Prize Box within Card */
    .card-body-content {
        padding: 1.25rem;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .prize-label {
        font-size: 0.75rem;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        margin-bottom: 2px;
    }

    .prize-amount {
        font-size: 1.45rem;
        font-weight: 900;
        color: #0f172a;
        line-height: 1.15;
        margin-bottom: 0.65rem;
    }

    .draw-schedule-tag {
        font-size: 0.78rem;
        font-weight: 600;
        color: #475569;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        background: #f1f5f9;
        padding: 0.25rem 0.65rem;
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    /* Mini Ball Previews */
    .preview-ball-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        margin-bottom: 1.2rem;
        padding: 0.6rem 0.4rem;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px dashed #e2e8f0;
    }

    .card-ball {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 0.82rem;
        color: #ffffff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .ball-yellow { background: radial-gradient(circle at 35% 35%, #fbbf24 0%, #f59e0b 70%, #d97706 100%); color: #000; }
    .ball-red    { background: radial-gradient(circle at 35% 35%, #f87171 0%, #ef4444 70%, #b91c1c 100%); }
    .ball-blue   { background: radial-gradient(circle at 35% 35%, #60a5fa 0%, #3b82f6 70%, #1d4ed8 100%); }
    .ball-green  { background: radial-gradient(circle at 35% 35%, #4ade80 0%, #22c55e 70%, #15803d 100%); }
    .ball-purple { background: radial-gradient(circle at 35% 35%, #c084fc 0%, #a855f7 70%, #7e22ce 100%); }
    .ball-orange { background: radial-gradient(circle at 35% 35%, #fb923c 0%, #f97316 70%, #c2410c 100%); }

    .btn-buy-card {
        font-weight: 800;
        font-size: 0.95rem;
        padding: 0.65rem 1rem;
        border-radius: 12px;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        transition: all 0.2s ease;
        margin-top: auto;
    }

    .btn-buy-card:hover {
        transform: translateY(-2px);
    }

    /* Live Features Section */
    .feature-box {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 18px;
        padding: 1.5rem;
        box-shadow: 0 4px 16px rgba(0,0,0,0.03);
        height: 100%;
        transition: transform 0.2s;
    }
    .feature-box:hover {
        transform: translateY(-3px);
    }

    @media (max-width: 768px) {
        .prize-amount {
            font-size: 1.25rem;
        }
        .banner-carousel-compact,
        .banner-carousel-compact .carousel-item,
        .banner-carousel-compact img {
            height: 180px;
        }
        .results-compact-box {
            height: auto;
            max-height: 280px;
        }
    }

.mobile-home-header { position:sticky; top:0; z-index:1020; min-height:72px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; color:#fff; background:var(--brand-primary); }
.mobile-home-account { display:flex; align-items:center; gap:8px; color:#fff; text-decoration:none; font-size:13px; min-width:0; }
.mobile-home-account i { font-size:26px; }
.mobile-home-wallet { display:flex; flex-direction:column; align-items:flex-end; color:#fff; text-decoration:none; gap:3px; }
.mobile-home-balance-label { font-size:11px; opacity:.8; }
.mobile-home-balance-value { font-size:16px; font-weight:700; }
.mobile-home-wallet:hover,.mobile-home-account:hover { color:#fff; }
.mobile-home-welcome { font-weight:600; font-size:14px; }
.home-results-section { margin-top:24px; margin-bottom:24px; }
@media(max-width:991.98px) {
    body.has-bottom-nav { padding-bottom:calc(80px + env(safe-area-inset-bottom)); }
    .mobile-bottom-nav { height:calc(64px + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom); }
    .home-page .top-showcase-row { margin-bottom:18px; }
    .home-page .banner-carousel-compact, .home-page .banner-carousel-compact .carousel-item, .home-page .banner-carousel-compact img { height:160px; }
    .home-page .filter-pills-wrap { width:100%; flex-wrap:wrap; gap:8px; }
    .home-page .game-filter-btn { font-size:12px; padding:9px 12px; min-height:40px; }
    .home-page #gamesShowcaseGrid { --bs-gutter-x:12px; --bs-gutter-y:16px; margin-bottom:24px !important; }
    .home-page .lotto-card { border-radius:18px; box-shadow:0 3px 12px rgba(15,23,42,.04); }
    .home-page .card-top-banner { padding:14px 16px; }
    .home-page .game-logo-badge { width:76px; height:50px; border-radius:12px; }
    .home-page .card-top-banner .badge { font-size:10px; }
    .home-page .card-body-content { padding:16px; }
    .home-page .prize-amount { font-size:22px; overflow-wrap:anywhere; }
    .home-page .prize-label { font-size:10px; }
    .home-page .draw-schedule-tag { margin-bottom:12px; font-size:12px; }
    .home-page .preview-ball-row { gap:8px; flex-wrap:wrap; margin-bottom:14px; padding:10px; }
    .home-page .card-ball { flex-shrink:0; }
    .home-page .btn-buy-card { font-size:14px; min-height:44px; }
    .home-page .feature-box { padding:16px; border-radius:16px; }
    .home-page .feature-box h5 { font-size:15px; }
    .home-page .results-compact-box { height:auto; max-height:none; padding:16px; }
    .home-page .results-compact-scroll { overflow:visible; }
    .home-page .result-game-row { gap:10px; padding:10px 0; border-bottom:1px solid var(--border-color); }
    .home-page .result-capsule { gap:8px; min-width:0; border-radius:14px; padding:8px; }
    .home-page .result-ball-blue { flex-shrink:0; }
}

@media (max-width:991.98px) {
    .mobile-home-header { min-height:80px; padding:14px 16px; }
    .mobile-home-account span { font-size:12px; }
    .mobile-home-wallet { padding:8px 12px; border-radius:14px; background:rgba(255,255,255,.12); flex-shrink:0; }
    .mobile-home-balance-value { display:flex; align-items:center; gap:12px; font-size:18px; }
    .mobile-home-balance-value > i { font-size:20px; }
}

/* Compact home header with a greeting and balance. */
@media (max-width:991.98px) {
    .mobile-home-header { height:56px; min-height:56px; padding:6px 12px; gap:10px; }
    .mobile-home-account { flex:1; min-width:0; gap:8px; }
    .mobile-home-account > i { font-size:24px; flex-shrink:0; }
    .mobile-home-greeting { display:flex; flex-direction:column; min-width:0; gap:2px; line-height:1.25; }
    .mobile-home-greeting .mobile-home-greeting-label { font-size:10px; opacity:.8; }
    .mobile-home-greeting .mobile-home-user { font-size:12px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .mobile-home-wallet { padding:4px 8px; border-radius:10px; gap:1px; max-width:55%; }
    .mobile-home-balance-label { font-size:9px; }
    .mobile-home-balance-value { font-size:14px; line-height:1.3; gap:8px; }
    .mobile-home-balance-value > i { font-size:17px; }
}

/* Compact mobile product cards and a single-line account name. */
@media (max-width:991.98px) {
    .mobile-home-greeting .mobile-home-user { font-size:13px; line-height:1.4; }
    .home-page #gamesShowcaseGrid { --bs-gutter-y:12px; }
    .home-page .card-top-banner { padding:10px 12px; display:flex; align-items:center; gap:12px; }
    .home-page .card-top-banner > .d-flex { flex:1; align-items:center !important; gap:8px; }
    .home-page .game-logo-badge { width:60px; height:40px; border-radius:8px; padding:4px; }
    .home-page .card-top-banner > .mt-2 { margin-top:0 !important; font-size:10px; max-width:100px; }
    .home-page .card-top-banner .badge { font-size:9px; white-space:normal; line-height:1.4; }
    .home-page .card-body-content { padding:12px; }
    .home-page .prize-label { font-size:9px; margin-bottom:4px; }
    .home-page .prize-amount { font-size:20px; margin-bottom:8px; }
    .home-page .draw-schedule-tag { padding:4px 8px; font-size:11px; margin-bottom:10px; }
    .home-page .preview-ball-row { display:none; }
    .home-page .btn-buy-card { min-height:40px; padding:8px 12px !important; font-size:13px !important; border-radius:10px; }
}

/* Light product headings, clear rules and compact prize/schedule alignment. */
@media (max-width:991.98px) {
    .home-page .card-top-banner { background:var(--surface); color:var(--text-color); border-bottom:1px solid var(--border-color); padding:12px; }
    .home-page .card-top-banner::after { display:none; }
    .home-page .game-logo-badge { box-shadow:none; background:var(--surface-muted); border:1px solid var(--border-color); }
    .home-page .card-top-banner > .text-white-50 { color:#334155 !important; opacity:1; font-size:11px; font-weight:500 !important; line-height:1.45; max-width:120px; }
    .home-page .card-body-content { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; row-gap:4px; align-items:center; }
    .home-page .prize-label { grid-column:1; margin:0; font-size:9px; line-height:1.4; letter-spacing:0; }
    .home-page .prize-amount { grid-column:1; font-size:18px; line-height:1.3; margin:0; font-variant-numeric:tabular-nums; }
    .home-page .draw-schedule-tag { grid-column:2; grid-row:1 / 3; max-width:110px; margin:0; padding:6px 8px; font-size:10px; line-height:1.5; align-items:flex-start; background:var(--surface-muted); border-radius:8px; }
    .home-page .draw-schedule-tag i { flex-shrink:0; margin-top:1px; }
    .home-page .btn-buy-card { grid-column:1 / -1; margin-top:8px; background:var(--brand-primary); border-color:var(--brand-primary); color:#fff !important; box-shadow:none !important; }
    .home-page .btn-buy-card:hover, .home-page .btn-buy-card:active { background:var(--brand-dark); border-color:var(--brand-dark); }
}
@media(max-width:359.98px) {
    .home-page .card-body-content { grid-template-columns:1fr; }
    .home-page .draw-schedule-tag { grid-column:1; grid-row:auto; max-width:none; margin-top:4px; }
    .home-page .prize-amount { font-size:17px; }
}

/* Product cards following the supplied reference. */
.home-page .theme-ultra { --game-color:#c56b06; }
.home-page .theme-grand { --game-color:#e7272d; }
.home-page .theme-super { --game-color:#2563eb; }
.home-page .theme-mega { --game-color:#e11d48; }
.home-page .theme-lotto { --game-color:#059669; }
.home-page .theme-6d { --game-color:#7c3aed; }
.home-page .theme-4d { --game-color:#ea580c; }
.home-page .theme-3d { --game-color:#0891b2; }
.home-page .theme-2d { --game-color:#0d9488; }
.home-page .lotto-card { border:1px solid #e2e8f0; border-radius:16px; overflow:hidden; box-shadow:0 2px 5px rgba(15,23,42,.06); }
.home-page .card-top-banner { display:flex; align-items:center; gap:12px; padding:12px; background:var(--game-color); color:white; border:0; min-height:76px; }
.home-page .card-top-banner::after { display:none; }
.home-page .game-logo-badge { width:52px; height:52px; padding:6px; background:#fff; border:0; border-radius:12px; box-shadow:none; }
.home-page .product-heading { flex:1; min-width:0; }
.home-page .product-heading h3 { margin:0 0 3px; font-size:15px; line-height:1.3; font-weight:800; color:white; }
.home-page .product-rule { font-size:11px; line-height:1.4; color:#fff; font-weight:500; }
.home-page .card-top-banner > .badge { align-self:flex-start; font-size:10px; padding:4px 8px !important; background:rgba(255,255,255,.24) !important; color:#fff !important; box-shadow:none !important; white-space:nowrap; }
.home-page .card-top-banner > .badge i { display:none; }
.home-page .card-body-content { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px 8px; padding:14px 12px 12px; }
.home-page .prize-label { grid-column:1; grid-row:1; align-self:center; margin:0; font-size:11px; letter-spacing:0; text-transform:none; font-weight:400; color:#64748b; }
.home-page .prize-amount { grid-column:2; grid-row:1; margin:0; font-size:22px; line-height:1.3; font-weight:900; color:#ef233c !important; text-align:right; }
.home-page .preview-ball-row { display:flex; grid-column:1 / -1; grid-row:2; justify-content:flex-start; flex-wrap:wrap; gap:6px; padding:0; margin:0; background:transparent; border:0; }
.home-page .card-ball { width:26px; height:26px; flex:0 0 26px; font-size:11px; box-shadow:none; }
.home-page .draw-schedule-tag { grid-column:1 / -1; grid-row:3; display:flex; align-items:center; max-width:none; margin:0; padding:0; font-size:11px; line-height:1.4; font-weight:400; color:#64748b; background:transparent; }
.home-page .draw-schedule-tag i { color:#94a3b8; margin:0; }
.home-page .btn-buy-card { grid-column:1 / -1; grid-row:4; margin:0; min-height:40px; padding:8px 12px !important; background:#fff; border:1px solid var(--game-color); color:var(--game-color) !important; font-size:13px !important; font-weight:700; border-radius:10px; box-shadow:none !important; }
.home-page .btn-buy-card i { display:none; }
.home-page .btn-buy-card:hover { background:var(--game-color); border-color:var(--game-color); color:#fff !important; transform:none; }
.home-page .lotto-card { --game-color:var(--brand-primary); }
.home-page .lotto-card:has(.theme-ultra) { --game-color:#c56b06; }
.home-page .lotto-card:has(.theme-grand) { --game-color:#e7272d; }
.home-page .lotto-card:has(.theme-super) { --game-color:#2563eb; }
.home-page .lotto-card:has(.theme-mega) { --game-color:#e11d48; }
.home-page .lotto-card:has(.theme-lotto) { --game-color:#059669; }
.home-page .lotto-card:has(.theme-6d) { --game-color:#7c3aed; }
.home-page .lotto-card:has(.theme-4d) { --game-color:#ea580c; }
.home-page .lotto-card:has(.theme-3d) { --game-color:#0891b2; }
.home-page .lotto-card:has(.theme-2d) { --game-color:#0d9488; }
@media(min-width:992px) { .home-page .prize-amount { font-size:18px; } .home-page .card-top-banner { flex-wrap:wrap; } }
@media(max-width:399.98px) { .home-page .prize-amount { font-size:18px; } .home-page .product-heading h3 { font-size:13px; } .home-page .card-top-banner { gap:8px; } .home-page .card-top-banner > .badge { font-size:9px; padding:4px 6px !important; } }

@media (max-width:991.98px) {
    .ticket-card a[href*="/Lottery/Detail"].btn {
        font-size:12px !important;
        min-height:36px;
        padding:7px 12px !important;
        line-height:1.3 !important;
        gap:4px !important;
    }
}

/* Mobile game selection, controls and playing instructions. */
.how-to-play-link { border:0; background:transparent; }
@media(max-width:991.98px) {
    .mobile-page-header { min-height:56px; height:56px; padding:6px 12px; }
    .mobile-page-header h1 { font-size:14px; line-height:1.4; }
    .mobile-page-back { font-size:20px; }
    .mobile-game-tabs { display:flex; flex-wrap:nowrap; width:100%; max-width:100%; overflow-x:auto; overflow-y:hidden; gap:8px; padding:4px 0 10px; margin-bottom:12px; overscroll-behavior-x:contain; scroll-snap-type:x proximity; scrollbar-width:thin; scrollbar-color:#94a3b8 transparent; }
    .mobile-game-tabs::-webkit-scrollbar { height:3px; }
    .mobile-game-tabs::-webkit-scrollbar-thumb { background:#94a3b8; border-radius:3px; }
    .mobile-game-chip { flex:0 0 auto; white-space:nowrap; font-size:12px; min-height:40px; padding:8px 12px; scroll-snap-align:center; }
    .game-arena-card { min-width:0; width:100%; padding:16px 12px !important; }
    .game-arena-header { gap:8px; margin-bottom:14px; padding-bottom:12px; }
    .game-title-text { font-size:16px !important; line-height:1.4; }
    .how-to-play-link { flex-shrink:0; min-height:36px; font-size:12px; padding:6px 8px; border-radius:8px; background:var(--brand-soft); color:var(--brand-primary); }
    .game-control-bar { display:flex; flex-direction:column; align-items:stretch; gap:10px; margin-bottom:16px; }
    .game-control-bar > .d-flex:first-child { display:grid !important; grid-template-columns:minmax(0,1fr) auto; gap:10px !important; width:100%; }
    .mode-select { width:100%; min-width:0; min-height:40px; padding:8px 28px 8px 12px; font-size:13px; border-radius:10px; }
    .pick-counter-text { font-size:12px; white-space:nowrap; }
    .game-control-bar > .d-flex:last-child { display:grid !important; grid-template-columns:1fr 1fr; width:100%; gap:8px !important; }
    .game-control-bar .btn-clear-pick, .game-control-bar .btn-lucky-pick { width:100%; min-height:40px; padding:8px 12px !important; font-size:12px !important; border-radius:10px; }
    .btn-clear-pick { background:var(--surface-muted); border:1px solid var(--border-color); }
    .btn-lucky-pick { background:var(--brand-soft); color:var(--brand-primary); border:1px solid #bfdbfe; }
    #howToPlayModal .modal-dialog { margin:12px; max-height:calc(100dvh - 24px); }
    #howToPlayModal .modal-content { max-height:calc(100dvh - 24px); }
    #howToPlayModal .modal-header { padding:16px; align-items:flex-start; }
    #howToPlayModal .modal-title { font-size:14px !important; }
    #howToPlayModal .modal-body { padding:16px !important; overflow-y:auto; font-size:13px; line-height:1.6; }
    #howToPlayModal .row { --bs-gutter-y:10px; margin-bottom:16px !important; }
    #howToPlayModal .col-sm-4 { width:100%; }
    #howToPlayModal .col-sm-4 > div { text-align:left !important; display:grid; grid-template-columns:28px minmax(0,1fr); gap:2px 10px; padding:12px !important; }
    #howToPlayModal .col-sm-4 .fs-4 { grid-row:1 / 3; font-size:18px !important; }
    #howToPlayModal .col-sm-4 .text-muted { grid-column:2; font-size:12px; }
    #howToPlayModal h6 { font-size:13px; line-height:1.5; }
    #howToPlayModal table { width:100%; table-layout:fixed; font-size:11px; }
    #howToPlayModal th, #howToPlayModal td { padding:8px 5px; overflow-wrap:anywhere; vertical-align:top; }
}

.mobile-page-header-centered { justify-content:center; text-align:center; }

.personal-identity { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.personal-identity-text { min-width:0; }
.personal-name { font-size:15px; font-weight:700; overflow-wrap:anywhere; }
.personal-phone { font-size:12px; opacity:.8; margin-top:3px; }
.personal-wallet-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding-top:16px; border-top:1px solid #ffffff26; }
.personal-wallet-value { min-width:0; }
.personal-wallet-label { font-size:11px; opacity:.8; }
.personal-wallet-row .personal-balance { font-size:26px; line-height:1.3; margin:4px 0 0; }
.personal-topup { display:inline-flex; align-items:center; justify-content:center; gap:6px; flex-shrink:0; }
.personal-wallet-actions { display:flex; flex-wrap:wrap; gap:8px; }
.personal-wallet-actions .btn { flex:1 1 90px; border-radius:10px; white-space:nowrap; }
@media(max-width:991.98px) {
    .personal-hero { padding:18px; }
    .personal-avatar { width:40px; height:40px; font-size:22px; border-radius:12px; flex-shrink:0; }
    .personal-name { font-size:14px; }
    .personal-wallet-row .personal-balance { font-size:23px; }
    .personal-hero .personal-topup { min-height:36px; font-size:12px !important; padding:8px 12px !important; }
    .personal-content { padding:0 18px 18px; }
    .personal-wallet-actions .btn { min-height:38px; padding:8px 12px !important; font-size:12px !important; }
}

/* Centered navigation titles and compact wallet balance. */
.mobile-page-header { position:sticky; justify-content:center; }
.mobile-page-header h1 { width:100%; padding:0 48px; text-align:center; }
.mobile-page-header .mobile-page-back { position:absolute; left:12px; top:6px; }
.personal-wallet-actions .btn { display:flex; align-items:center; justify-content:center; text-align:center; }
.personal-topup { text-align:center; }
.wallet-mini-balance { display:flex; align-items:center; justify-content:flex-end; gap:8px; margin:0 0 12px; font-size:12px; color:var(--text-muted); }
.wallet-mini-balance strong { color:var(--brand-primary); font-size:14px; }
.account-page-heading { position:relative; justify-content:center; }
.account-page-heading h1 { text-align:center; padding:0 48px; }
.account-page-heading .account-back { position:absolute; left:0; }
.modal-header { position:relative; }
.modal-header .modal-title { flex:1; text-align:center; }
.modal-header > .d-flex { flex:1; justify-content:center; }
.modal-header .btn-close { margin-left:auto; }
@media(max-width:991.98px) {
    .wallet-mini-balance { margin-bottom:10px; font-size:11px; }
    .wallet-mini-balance strong { font-size:13px; }
}

/* Shared mobile typography scale. Keep input text at 16px for mobile browsers. */
@media(max-width:991.98px) {
    :root {
        --app-font-size:14px;
        --app-small-font-size:12px;
        --app-control-font-size:14px;
        --app-title-font-size:16px;
        --mobile-text:14px;
        --mobile-title:16px;
        --mobile-header:14px;
        --mobile-caption:12px;
        --mobile-label:11px;
        --mobile-input:16px;
        --mobile-button:13px;
        --mobile-action-font-size:var(--mobile-button);
    }
    html { font-size:14px; -webkit-text-size-adjust:100%; }
    body { font-size:var(--mobile-text); line-height:1.5; }
    input, select, textarea, button, .btn, .font-monospace { font-family:var(--font-family-sans-serif) !important; }
    h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6 { font-size:var(--mobile-title); line-height:1.4; font-weight:700; }
    .mobile-page-header h1 { font-size:var(--mobile-header) !important; }
    .modal-title,.offcanvas-title,.swal2-title { font-size:var(--mobile-title) !important; line-height:1.4; }
    .small,small,.form-text,.material-description,.material-hint,.personal-content,.wallet-list-description,.wallet-list-meta { font-size:var(--mobile-caption) !important; line-height:1.5; }
    .form-label,.material-field label,.personal-wallet-label,.mobile-home-balance-label { font-size:var(--mobile-caption) !important; }
    .material-field input:focus + label,.material-field input:not(:placeholder-shown) + label { font-size:var(--mobile-label) !important; }
    .form-control,.form-select,.material-field input,.wallet-amount-input .form-control { font-size:var(--mobile-input) !important; line-height:1.4; }
    .input-group-text { font-size:var(--mobile-caption); }
    .mode-select { font-size:var(--mobile-text) !important; }
    .btn:not(.btn-close),.btn-sm:not(.btn-close),.btn-lg:not(.btn-close),.material-submit,.btn-order-confirm,.btn-add-ticket,.btn-lucky-pick,.btn-clear-pick,.btn-buy-card,.swal2-confirm,.swal2-cancel { font-size:var(--mobile-button) !important; line-height:1.4 !important; }
    .badge { font-size:var(--mobile-label); line-height:1.3; }
    .filter-tab,.game-filter-btn,.mobile-game-chip,.how-to-play-link,.pick-counter-text,.personal-row,.dropdown-item { font-size:var(--mobile-caption); }
    .mobile-nav-item { font-size:var(--mobile-label); }
    .mobile-home-user,.personal-name,.game-title-text,.product-heading h3 { font-size:var(--mobile-text) !important; }
    .product-rule,.draw-schedule-tag,.prize-label { font-size:var(--mobile-label) !important; }
    .wallet-mini-balance strong,.mobile-home-balance-value { font-size:var(--mobile-text); font-variant-numeric:tabular-nums; }
    .personal-balance,.prize-amount { font-variant-numeric:tabular-nums; }
    .fs-4:not(.bi),.fs-5:not(.bi),.fs-6:not(.bi) { font-size:var(--mobile-title) !important; }
    .ticket-card a[href*="/Lottery/Detail"].btn { font-size:var(--mobile-caption) !important; }
}

@media(max-width:991.98px) {
    .personal-menu .personal-row { font-size:15px; font-weight:600; line-height:1.4; }
    .personal-menu .personal-row > i:first-child { font-size:21px; }
}

@media(max-width:991.98px) {
    .mobile-game-tabs { scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; }
    .mobile-game-tabs::-webkit-scrollbar { display:none; width:0; height:0; }
    .game-control-bar .btn-clear-pick,.game-control-bar .btn-lucky-pick { display:flex; align-items:center; justify-content:center; text-align:center; gap:6px; }
    .game-control-bar .mode-select {
        appearance:none; -webkit-appearance:none;
        border:1px solid var(--border-color); border-radius:12px;
        background-color:var(--surface); color:var(--text-color);
        min-height:44px; padding:10px 36px 10px 12px;
        font-family:var(--font-family-sans-serif); font-size:14px !important; font-weight:600;
        background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat:no-repeat; background-position:right 12px center; background-size:16px;
    }
    .game-control-bar .mode-select:focus-visible { outline:2px solid var(--brand-primary); outline-offset:2px; }
}

/* Selected tickets: scroll the boards while keeping checkout accessible. */
#mobileSlipOffcanvas { height:80dvh; max-height:calc(100dvh - 24px); }
#mobileSlipOffcanvas .offcanvas-header { padding:16px; flex-shrink:0; }
#mobileSlipOffcanvas .offcanvas-body { overflow:hidden; gap:12px; padding:16px !important; }
#mobileSlipOffcanvas .offcanvas-body > .d-flex { flex-shrink:0; margin:0 !important; }
#mobilePlacedBoardsList { min-height:0; overflow-y:auto; padding-right:2px; overscroll-behavior-y:contain; }
#mobileSlipOffcanvas .slip-delete-all { display:flex; align-items:center; justify-content:center; gap:6px; min-height:36px; padding:6px 10px !important; font-size:12px !important; border-radius:10px; }
.slip-summary { flex-shrink:0; padding:14px 0 max(4px, env(safe-area-inset-bottom)); border-top:1px solid var(--border-color); }
.slip-footer-actions { display:grid; grid-template-columns:1fr 1.5fr; gap:8px; }
.slip-footer-actions .btn { display:flex; align-items:center; justify-content:center; gap:6px; border-radius:12px; }
.board-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.board-card-heading { display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; }
.board-card-balls { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.board-card .mini-ball { flex-shrink:0; }
@media(max-width:991.98px) {
    #mobilePlacedBoardsList .board-card { padding:12px; border:1px solid var(--border-color); border-radius:14px; background:var(--surface); margin-bottom:10px; }
    #mobilePlacedBoardsList .board-delete { flex-shrink:0; width:36px; min-height:36px; display:grid; place-items:center; padding:6px !important; border-radius:10px; background:#fff1f2; }
    #mobilePlacedBoardsList .mini-ball { width:30px; height:30px; font-size:12px; }
    #mobileSlipOffcanvas .slip-summary #mobileModalTotalPrice { font-size:18px !important; }
}

/* Lottery board actions: keep quick-pick/delete controls perfectly circular on mobile. */
@media(max-width:991.98px) {
    .app-content #placedBoardsList .board-row-tools button,
    .app-content #mobilePlacedBoardsList .board-row-tools button,
    .app-content #placedBoardsList .board-row-tools .board-delete,
    .app-content #mobilePlacedBoardsList .board-row-tools .board-delete {
        width:38px !important;
        min-width:38px !important;
        height:38px !important;
        min-height:38px !important;
        flex:0 0 38px !important;
        aspect-ratio:1 / 1 !important;
        padding:0 !important;
        border:0 !important;
        border-radius:50% !important;
        display:inline-flex !important;
        align-items:center !important;
        justify-content:center !important;
        line-height:1 !important;
    }
    .app-content #placedBoardsList .board-delete,
    .app-content #mobilePlacedBoardsList .board-delete { background:#dc2626 !important; color:#fff !important; }
    .app-content #placedBoardsList .board-delete i,
    .app-content #mobilePlacedBoardsList .board-delete i { font-size:1.5rem !important; line-height:1 !important; }
}

/* Notification typography uses the same font and mobile scale as the app. */
.swal2-popup, .swal2-popup button, .swal2-html-container, .toast, .alert { font-family:var(--font-family-sans-serif) !important; }
@media(max-width:991.98px) {
    .swal2-popup:not(.swal2-toast) { width:calc(100% - 32px) !important; padding:20px 16px !important; border-radius:18px !important; font-size:var(--mobile-text) !important; }
    .swal2-title, .swal2-title.lotto-swal-title { font-size:var(--mobile-title) !important; font-weight:700; line-height:1.4 !important; padding:8px 0 0 !important; }
    .swal2-html-container, .swal2-html-container.lotto-swal-content { font-size:var(--mobile-text) !important; line-height:1.5 !important; margin:12px 0 0 !important; overflow-wrap:anywhere; }
    .swal2-html-container p, .swal2-html-container li, .swal2-html-container span, .swal2-html-container b, .swal2-html-container strong { font-size:inherit !important; }
    .swal2-actions { margin-top:18px !important; }
    .swal2-confirm, .swal2-cancel, .lotto-swal-confirm-btn, .lotto-swal-cancel-btn { font-size:var(--mobile-button) !important; line-height:1.4 !important; min-height:40px; padding:10px 18px !important; }
    .swal2-popup.swal2-toast { max-width:calc(100vw - 24px); padding:12px !important; font-size:var(--mobile-caption) !important; border-radius:12px !important; }
    .swal2-popup.swal2-toast .swal2-title { padding:0 !important; font-size:var(--mobile-caption) !important; font-weight:600; line-height:1.5 !important; }
    .swal2-popup.swal2-toast .swal2-html-container { font-size:var(--mobile-caption) !important; }
    .alert { font-size:var(--mobile-text); line-height:1.5; padding:12px 40px 12px 14px !important; border-radius:12px; overflow-wrap:anywhere; }
    .alert > .flex-grow-1 { font-weight:500 !important; }
    .alert > i { font-size:20px !important; margin-right:10px !important; }
    .toast, .toast-body { font-size:var(--mobile-caption) !important; line-height:1.5; }
    .toast-container { max-width:100%; }
    .toast-header { font-size:var(--mobile-caption); }
}

/* Center login without clipping the form on short screens. */
body.login-page { min-height:100vh; min-height:100dvh; }
body.login-page > .container { display:flex; flex-direction:column; justify-content:center; margin-top:0 !important; margin-bottom:0 !important; padding-top:24px; padding-bottom:24px; }
body.login-page > .container > .row { width:100%; margin-top:0 !important; margin-bottom:0 !important; align-self:center; }
body.login-page > .container > .row > .col-md-5 { width:100%; max-width:440px; }
@media(max-width:991.98px) {
    body.login-page > .container { padding-top:20px; padding-bottom:20px; }
}

.checkout-page { max-width:600px; margin:0 auto; }
.checkout-section { padding:18px; background:var(--surface); border:1px solid var(--border-color); border-radius:16px; margin-bottom:14px; }
.checkout-section h2 { font-size:16px; font-weight:700; margin-bottom:16px; }
.checkout-meta { display:flex; justify-content:space-between; gap:16px; margin-top:10px; font-size:13px; }
.checkout-meta > span { color:var(--text-muted); }
.checkout-meta strong { text-align:right; overflow-wrap:anywhere; min-width:0; }
.checkout-board { display:flex; align-items:flex-start; gap:12px; padding:12px 0; }
.checkout-board + .checkout-board { border-top:1px solid var(--border-color); }
.checkout-balls { display:flex; flex-wrap:wrap; gap:8px; }
.checkout-balls > span { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:var(--brand-primary); color:white; font-size:12px; font-weight:700; }
.checkout-total { border-top:1px solid var(--border-color); padding-top:14px; margin-top:14px; }
.checkout-total strong { font-size:18px; color:var(--brand-primary); }

.checkout-board { align-items:center; }
.checkout-board > .badge { display:flex; align-items:center; justify-content:center; text-align:center; flex:0 0 64px; min-height:30px; }
.checkout-board .checkout-balls { flex:1; justify-content:center; align-items:center; }

.detail-board-balls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:8px; flex:1; min-width:0; }
.e-ticket-card .board-line-box { gap:12px; }
.e-ticket-card .board-badge { flex-shrink:0; }
.e-ticket-card .ticket-ball-3d { background:var(--brand-primary); color:#fff; box-shadow:none; width:30px; height:30px; flex:0 0 30px; font-size:12px; }
.ticket-status-small { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; white-space:nowrap; }
.ticket-header-logo { flex-wrap:wrap; gap:8px; }

/* Desktop results panel and account dropdown. */
@media(min-width:992px) {
    .home-results-section { margin:32px 0; }
    .home-results-section .results-compact-box { height:auto; padding:24px; border-radius:20px; }
    .home-results-section .results-compact-header { padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid var(--border-color); font-size:18px; }
    .home-results-section .results-compact-scroll { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 20px; overflow:visible; padding:0; }
    .home-results-section .result-date-header { grid-column:1 / -1; margin:8px 0 0; font-size:13px; font-weight:600; }
    .home-results-section .result-game-row { min-width:0; margin:0; gap:16px; padding:14px; border:1px solid var(--border-color); border-radius:14px; background:var(--surface-muted); }
    .home-results-section .result-game-logo { width:72px; height:40px; }
    .home-results-section .result-capsule { min-width:0; padding:8px; border-radius:12px; gap:8px; background:transparent; }
    .home-results-section .result-ball-blue { width:28px; height:28px; flex:0 0 28px; font-size:12px; background:var(--brand-primary); box-shadow:none; }
    .navbar-custom .account-dropdown-menu { min-width:280px; padding:10px; margin-top:12px; border:1px solid var(--border-color); border-radius:18px; box-shadow:0 16px 40px rgba(15,23,42,.12); }
    .account-dropdown-heading { display:flex; flex-direction:column; gap:4px; padding:10px 12px 14px; margin-bottom:6px; border-bottom:1px solid var(--border-color); }
    .account-dropdown-heading span { color:var(--text-muted); font-size:12px; }
    .account-dropdown-heading strong { color:var(--text-color); font-size:14px; overflow-wrap:anywhere; }
    .account-dropdown-menu .dropdown-item { display:flex; align-items:center; gap:12px; min-height:46px; padding:10px 12px; border-radius:10px; font-size:14px; }
    .account-dropdown-menu .dropdown-item > i { width:30px; height:30px; display:grid; place-items:center; flex-shrink:0; margin:0 !important; background:var(--brand-soft); color:var(--brand-primary); border-radius:8px; font-size:17px; }
    .account-dropdown-menu .dropdown-item:hover { background:var(--brand-soft); }
    .account-dropdown-menu .dropdown-item.text-danger > i { color:#dc3545; background:#fff1f2; }
    .account-dropdown-menu .dropdown-divider { margin:8px 4px; }
}

/* Shared desktop typography, including large Bootstrap action buttons. */
@media(min-width:992px) {
    :root { --desktop-text:var(--app-font-size); --desktop-title:22px; --desktop-caption:var(--app-small-font-size); --desktop-input:var(--app-control-font-size); --desktop-button:var(--app-control-font-size); }
    html { font-size:16px; }
    body { font-size:var(--desktop-text); line-height:1.6; }
    input,select,textarea,button,.btn,.font-monospace { font-family:var(--font-family-sans-serif) !important; }
    h1,h2,h3,h4,.h1,.h2,.h3,.h4 { font-size:var(--desktop-title); line-height:1.4; }
    h5,h6,.h5,.h6,.modal-title,.offcanvas-title { font-size:16px; line-height:1.5; }
    .small,small,.form-text,.material-hint,.wallet-list-meta { font-size:var(--desktop-caption); line-height:1.5; }
    .form-label,.material-field label,.material-description,.personal-content,.dropdown-item { font-size:var(--desktop-text); }
    .material-field input:focus + label,.material-field input:not(:placeholder-shown) + label { font-size:var(--desktop-caption); }
    .form-control,.form-select,.mode-select,.material-field input,.wallet-amount-input .form-control { font-size:var(--desktop-input) !important; line-height:1.5; }
    .input-group-text { font-size:var(--desktop-text); }
    .btn:not(.btn-close),.btn-lg:not(.btn-close),.material-submit,.btn-order-confirm,.btn-add-ticket,.btn-lucky-pick,.btn-clear-pick,.action-btn-pill,.btn-buy-card,.swal2-confirm,.swal2-cancel { font-size:var(--desktop-button) !important; line-height:1.5 !important; }
    .btn-lg:not(.btn-close) { padding:12px 20px; }
    .btn-sm:not(.btn-close) { font-size:14px !important; }
    .filter-tab,.game-filter-btn,.how-to-play-link,.pick-counter-text,.personal-row { font-size:var(--desktop-text); }
    .badge { font-size:14px; line-height:1.4; }
    .fs-4:not(.bi),.fs-5:not(.bi),.fs-6:not(.bi) { font-size:18px !important; }
    .swal2-popup,.swal2-popup button,.swal2-html-container,.toast,.alert { font-family:var(--font-family-sans-serif) !important; }
    .swal2-title,.swal2-title.lotto-swal-title { font-size:var(--desktop-title) !important; line-height:1.4; }
    .swal2-html-container,.swal2-html-container.lotto-swal-content,.alert { font-size:var(--desktop-text) !important; line-height:1.6; }
    .swal2-popup.swal2-toast .swal2-title,.toast,.toast-body { font-size:13px !important; }
}

/* Regular-weight selected numbers and balanced board labels in dialogs. */
#mobileSlipOffcanvas .offcanvas-title { text-transform:none; font-weight:500 !important; }
#mobilePlacedBoardsList .mini-ball, #placedBoardsList .mini-ball,
#confirmBoardsContainer .ticket-ball-red, #ticketBoardsContainer .ticket-ball-red { font-weight:400; }
#confirmBoardsContainer .ticket-board-row, #ticketBoardsContainer .ticket-board-row { align-items:center; gap:12px; }
#confirmBoardsContainer .ticket-board-row > .badge, #ticketBoardsContainer .ticket-board-row > .badge { flex:0 0 60px; min-height:30px; display:flex; align-items:center; justify-content:center; font-weight:500; text-transform:none; }
#confirmBoardsContainer .ticket-board-row > .d-flex, #ticketBoardsContainer .ticket-board-row > .d-flex { flex:1; min-width:0; align-items:center; gap:8px; margin-left:0 !important; }
#mobilePlacedBoardsList .board-card-heading > .badge { min-width:60px; min-height:30px; display:flex; align-items:center; justify-content:center; font-weight:500; }
#mobilePlacedBoardsList .board-card-balls { align-items:center; gap:8px; }
