/* ==========================================================
   Online Lottery Platform — Vibrant Red & Gold Theme
   Inspired by reference: deep crimson background, orange-gold CTA
   Mobile-First | CSS3 | Bootstrap 5 Override
   ========================================================== */

/* ─── DESIGN TOKENS ─────────────────────────────────────── */
:root {
    /* ── Brand Warm Brown ── */
    --primary:        #8B5E1A;
    --primary-light:  #B8823A;
    --primary-dark:   #5C3A0A;
    --primary-deeper: #2E1A05;

    /* ── Gold (CTA) ── */
    --gold:           #D4AF37;
    --gold-light:     #F5D76E;
    --gold-dark:      #A07820;
    --gold-orange:    #C49020;

    /* ── Dark Surfaces (warm brown-blacks) ── */
    --dark:           #1A0F02;
    --surface:        #241506;
    --surface-2:      #2E1C08;
    --surface-3:      #3A230A;
    --border:         #6B440F;

    /* ── Text ── */
    --text:           #FFF5E0;
    --text-muted:     #E0C890;

    /* ── Semantic ── */
    --success:        #27AE60;
    --danger:         #E74C3C;
    --warning:        #F39C12;
    --info:           #2980B9;

    /* ── Geometry ── */
    --radius:         12px;
    --radius-lg:      20px;
    --radius-sm:      8px;
    --radius-pill:    50px;
    --shadow:         0 4px 24px rgba(0,0,0,0.5);
    --shadow-gold:    0 4px 24px rgba(212,175,55,0.35);
    --shadow-red:     0 4px 24px rgba(139,94,26,0.4);
    --transition:     all 0.28s cubic-bezier(0.4,0,0.2,1);
    --font-primary:   'Sarabun', 'Inter', sans-serif;
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    background-color: var(--dark);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--text); }
.text-gold    { color: var(--gold)         !important; }
.text-crimson { color: var(--primary-light)!important; }
.x-small      { font-size: 0.72rem; }
.fs-display   { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; }

/* ── Force Bootstrap text-muted to our visible color everywhere ── */
.text-muted { color: var(--text-muted) !important; }
p           { color: var(--text); }

/* ── Dark-background text overrides ───────────────────────── */
/* Hero section: text sits on warm brown gradient */
.hero-section p,
.hero-section .text-muted,
.hero-section .x-small {
    color: rgba(255, 230, 170, 0.9) !important;
}
/* Stats strip under hero numbers */
.hero-section .x-small.text-muted {
    color: rgba(255, 220, 140, 0.75) !important;
}
/* How-it-works cards: card is dark surface, description text */
.luxury-card p.text-muted,
.luxury-card .text-muted,
.luxury-card p.small,
.luxury-card .small { color: #D4B87A !important; }
/* Payout section: digit unit and per-unit labels */
.small.text-muted,
.x-small.text-muted { color: rgba(240, 200, 200, 0.82) !important; }
/* Bg-surface section (How-it-works background) */
.bg-surface p,
.bg-surface .text-muted { color: rgba(240, 200, 200, 0.8) !important; }

/* ─── UTILITY ────────────────────────────────────────────── */
.bg-surface   { background-color: var(--surface)   !important; }
.bg-surface-2 { background-color: var(--surface-2) !important; }
.border-gold  { border-color: var(--gold)          !important; }
.rounded-xl   { border-radius: var(--radius-lg)    !important; }

/* ─── GRADIENT BACKGROUNDS ───────────────────────────────── */
.bg-luxury {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 50%, var(--dark) 100%);
}
.bg-gold-gradient {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
}
.text-gradient-gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── GOLD SHIMMER ANIMATION ─────────────────────────────── */
@keyframes goldShimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}
.shimmer-gold {
    background: linear-gradient(90deg,
        var(--gold-dark)  0%,
        var(--gold-light) 40%,
        var(--gold)       50%,
        var(--gold-light) 60%,
        var(--gold-dark)  100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 3s linear infinite;
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,166,35,0.4); }
    50%       { box-shadow: 0 0 0 12px rgba(245,166,35,0); }
}
.pulse-gold { animation: pulse-gold 2s infinite; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease forwards; }

/* ─── NAVBAR ─────────────────────────────────────────────── */
.luxury-navbar {
    background: linear-gradient(90deg,
        #1A0A00 0%,
        #3B1F05 30%,
        #6B420E 60%,
        #3B1F05 100%);
    border-bottom: 2px solid var(--gold-dark);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.6), 0 1px 0 rgba(212,175,55,0.2);
    padding: 0.6rem 0;
}
.luxury-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.luxury-brand .brand-text {
    font-size: 1.1rem; font-weight: 800;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.luxury-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.luxury-navbar .nav-link:hover,
.luxury-navbar .nav-link.active {
    color: var(--gold) !important;
    background: rgba(245,166,35,0.12);
}

/* Dropdown */
.luxury-dropdown {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 200px;
}
.luxury-dropdown .dropdown-item {
    color: var(--text);
    padding: 0.6rem 1rem;
    transition: var(--transition);
}
.luxury-dropdown .dropdown-item:hover {
    background: rgba(245,166,35,0.1);
    color: var(--gold);
}

/* Balance Strip */
.balance-strip {
    background: linear-gradient(90deg, rgba(122,0,0,0.35) 0%, rgba(204,0,0,0.2) 100%);
    border-bottom: 1px solid rgba(245,166,35,0.2);
}
.balance-amount {
    color: var(--gold);
    font-weight: 700;
    font-size: 1rem;
}

/* ─── USER AVATAR ────────────────────────────────────────── */
.user-avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--gold-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: white;
    border: 1.5px solid var(--gold-dark);
}

/* ─── BUTTONS ─────────────────────────────────────────────── */

/* Primary: Orange-Gold (matching reference image CTA) */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-orange), var(--gold), var(--gold-light));
    color: #1A0000 !important;
    border: none;
    font-weight: 800;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    box-shadow: 0 3px 15px rgba(232,133,10,0.45);
    letter-spacing: 0.02em;
}
.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(232,133,10,0.6);
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-orange));
    color: #1A0000 !important;
}

/* Secondary: Crimson */
.btn-outline-gold {
    border: 1.5px solid var(--gold);
    color: var(--gold) !important;
    background: transparent;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-outline-gold:hover {
    background: var(--gold);
    color: #1A0000 !important;
    transform: translateY(-2px);
}

/* Crimson button (for register, secondary actions) */
.btn-crimson {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light));
    color: white !important;
    border: none;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    box-shadow: 0 3px 15px rgba(204,0,0,0.4);
}
.btn-crimson:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(204,0,0,0.6);
}

/* Pill variant (matching reference rounded pill button) */
.btn-pill { border-radius: var(--radius-pill) !important; }

.btn-xs { padding: 0.15rem 0.5rem; font-size: 0.75rem; }

/* ─── CARDS ──────────────────────────────────────────────── */
.luxury-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}
.luxury-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    border-color: rgba(245,166,35,0.35);
}
.luxury-card .card-header {
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

/* Glass Card */
.glass-card {
    background: rgba(26,5,5,0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245,166,35,0.18);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* KPI / Stat Cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
}
.stat-card.gold::before    { background: linear-gradient(180deg, var(--gold), var(--gold-dark)); }
.stat-card.crimson::before { background: linear-gradient(180deg, var(--primary-light), var(--primary-dark)); }
.stat-card.green::before   { background: linear-gradient(180deg, #27AE60, #1a7a42); }
.stat-card.blue::before    { background: linear-gradient(180deg, #2980B9, #1a5a82); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-icon  { font-size: 2.5rem; opacity: 0.12; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); }

/* ─── LOTTERY RESULT CARDS ───────────────────────────────── */
.result-container { position: relative; }
.result-hero-card {
    background: linear-gradient(135deg, var(--primary-deeper) 0%, #500000 50%, var(--primary-deeper) 100%);
    border: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(245,166,35,0.2), var(--shadow);
}
.result-hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(245,166,35,0.08) 0%, transparent 70%);
}
.result-number-main {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.15em;
    line-height: 1;
    display: block;
}
.result-date-badge {
    display: inline-block;
    background: rgba(245,166,35,0.15);
    border: 1px solid rgba(245,166,35,0.4);
    color: var(--gold-light);
    padding: 0.25rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.digit-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.digit-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
}
.digit-card.d5::after { background: var(--gold); }
.digit-card.d4::after { background: var(--primary-light); }
.digit-card.d3::after { background: #8E44AD; }
.digit-card.d2::after { background: #2980B9; }
.digit-card.d1::after { background: #27AE60; }
.digit-card:hover {
    border-color: var(--gold-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}
.digit-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.digit-number {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

/* ─── FORMS ──────────────────────────────────────────────── */
.luxury-input {
    background: var(--surface-2) !important;
    border: 1.5px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.7rem 1rem !important;
    transition: var(--transition) !important;
    font-family: var(--font-primary) !important;
}
.luxury-input:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(245,166,35,0.2) !important;
    background: var(--surface-3) !important;
    outline: none !important;
}
.luxury-input::placeholder { color: var(--text-muted) !important; }
.luxury-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    display: block;
}
.form-floating .luxury-input ~ label { color: var(--text-muted); }

/* ─── AUTH PAGES ─────────────────────────────────────────── */
/* Background matching the reference image */
.auth-bg {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 20%, #C49020 0%, #8B5E1A 20%, #5C3A0A 45%, #2E1A05 70%, #1A0F02 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

/* Decorative triangle pattern (matches reference bg triangles) */
.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpolygon points='60,5 115,110 5,110' fill='none' stroke='%23A07820' stroke-width='1.5' opacity='0.35'/%3E%3Cpolygon points='60,20 100,100 20,100' fill='none' stroke='%23C49020' stroke-width='0.8' opacity='0.2'/%3E%3C/svg%3E");
    background-size: 160px 160px;
    opacity: 0.5;
    pointer-events: none;
}

/* Left/right gold edge glow */
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 0%   50%, rgba(180,130,0,0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 50%, rgba(180,130,0,0.35) 0%, transparent 50%);
    pointer-events: none;
}

.auth-card {
    background: rgba(255,255,255,0.97);
    border: none;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(245,166,35,0.2);
    position: relative;
    z-index: 1;
    color: #1A0000;
}
.auth-card h2,
.auth-card h3,
.auth-card h4,
.auth-card label,
.auth-card .form-text { color: #1A0000 !important; }
.auth-card .text-muted { color: #884444 !important; }

/* Auth card inputs – white background on white card */
.auth-card .luxury-input,
.auth-card .form-control {
    background: #ffffff !important;
    border: 1.5px solid #DDBBBB !important;
    color: #1A0000 !important;
}
.auth-card .luxury-input:focus,
.auth-card .form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(204,0,0,0.15) !important;
}
.auth-card .luxury-input::placeholder,
.auth-card .form-control::placeholder { color: #AA7777 !important; }

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-logo img { max-height: 140px; filter: drop-shadow(0 4px 16px rgba(204,0,0,0.3)); }
.auth-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    margin-top: 0.5rem;
    color: var(--primary) !important;
}

/* Auth links */
.auth-link { color: var(--primary) !important; font-weight: 600; }
.auth-link:hover { color: var(--primary-light) !important; }

/* ─── BADGE OVERRIDES ────────────────────────────────────── */
.notif-badge {
    font-size: 0.6rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.badge-gold {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #1A0000;
}

/* ─── TABLES ─────────────────────────────────────────────── */
.luxury-table {
    color: var(--text);
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.luxury-table thead th {
    background: var(--surface-2);
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.9rem 1rem;
    border-bottom: 2px solid var(--gold-dark);
    white-space: nowrap;
}
.luxury-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.luxury-table tbody tr:hover { background: rgba(245,166,35,0.04); }
.luxury-table tbody td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
}
.luxury-table tbody tr:last-child { border-bottom: none; }

.table-responsive-luxury {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ─── STATUS BADGES ──────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}
.status-win       { background: rgba(39,174,96,0.15);  color: #27AE60; border: 1px solid rgba(39,174,96,0.3); }
.status-lose      { background: rgba(231,76,60,0.15);  color: #E74C3C; border: 1px solid rgba(231,76,60,0.3); }
.status-pending   { background: rgba(243,156,18,0.15); color: #F39C12; border: 1px solid rgba(243,156,18,0.3); }
.status-approved  { background: rgba(39,174,96,0.15);  color: #27AE60; border: 1px solid rgba(39,174,96,0.3); }
.status-rejected  { background: rgba(231,76,60,0.15);  color: #E74C3C; border: 1px solid rgba(231,76,60,0.3); }
.status-published { background: rgba(245,166,35,0.15); color: var(--gold); border: 1px solid rgba(245,166,35,0.3); }
.status-draft     { background: rgba(138,138,138,0.15);color: var(--text-muted); border: 1px solid var(--border); }
.status-active    { background: rgba(39,174,96,0.15);  color: #27AE60; border: 1px solid rgba(39,174,96,0.3); }
.status-suspended { background: rgba(231,76,60,0.15);  color: #E74C3C; border: 1px solid rgba(231,76,60,0.3); }

/* ─── MODALS ─────────────────────────────────────────────── */
.luxury-modal .modal-content {
    background: var(--surface);
    border: 1px solid rgba(245,166,35,0.2);
    border-radius: var(--radius-lg);
    color: var(--text);
}
.luxury-modal .modal-header {
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.luxury-modal .modal-title { color: var(--gold); font-weight: 700; }
.luxury-modal .modal-footer { border-top: 1px solid var(--border); }
.luxury-modal .btn-close { filter: invert(1); }

/* ─── HERO SECTION ──────────────────────────────────────── */
.hero-section {
    background:
        radial-gradient(ellipse at 50% 0%, #C49020 0%, #8B5E1A 25%, #5C3A0A 55%, #2E1A05 80%, #1A0F02 100%);
    position: relative;
    overflow: hidden;
    color: #FFF5E0;
    width: 100%;
}
/* Triangle decorative pattern (like reference image sides) */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpolygon points='50,3 97,97 3,97' fill='none' stroke='%23A07820' stroke-width='1' opacity='0.25'/%3E%3C/svg%3E");
    background-size: 130px 130px;
    opacity: 0.5;
    pointer-events: none;
}
/* Subtle gold glow at top */
.hero-section::after {
    content: '';
    position: absolute;
    top: -40px; left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 200px;
    background: radial-gradient(ellipse, rgba(245,166,35,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.2;
}
/* Full-screen lao-frame responsive scaling */
.lao-frame.w-100 .lao-digit-box {
    flex: 1;
    min-width: 0;
    max-width: 90px;
    height: auto;
    aspect-ratio: 1 / 1.1;
    font-size: clamp(1.6rem, 3.5vw, 3rem);
}
.lao-frame.w-100 .lao-digit-row {
    gap: clamp(4px, 1.5vw, 14px);
}
.lao-frame.w-100 .lao-body {
    padding: clamp(16px, 2.5vw, 30px) clamp(12px, 3vw, 28px);
}
.lao-frame.w-100 .lao-banner-title {
    font-size: clamp(18px, 2.5vw, 28px);
}

/* ─── WALLET / FINANCE ───────────────────────────────────── */
.wallet-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-deeper) 100%);
    border: 1px solid rgba(245,166,35,0.3);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.wallet-card::before {
    content: '฿';
    position: absolute;
    right: -10px; top: 50%;
    transform: translateY(-50%);
    font-size: 8rem;
    font-weight: 900;
    opacity: 0.05;
    color: var(--gold);
}
.wallet-balance {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(245,166,35,0.3);
}

/* ─── LOTTERY NUMBER PAD ─────────────────────────────────── */
.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 300px;
}
.num-btn {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.num-btn:hover  { border-color: var(--gold); color: var(--gold); background: rgba(245,166,35,0.1); }
.num-btn:active { transform: scale(0.92); }
.lottery-display {
    background: var(--surface-2);
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--gold);
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── DIGIT TYPE TABS ────────────────────────────────────── */
.digit-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.digit-tab {
    flex: 1; min-width: 70px;
    padding: 0.75rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}
.digit-tab.active {
    border-color: var(--gold);
    background: rgba(245,166,35,0.12);
    color: var(--gold);
}
.digit-tab:hover:not(.active) {
    border-color: var(--border);
    color: var(--text);
}

/* ─── NOTIFICATIONS ──────────────────────────────────────── */
.notif-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}
.notif-item:hover { border-color: rgba(245,166,35,0.3); }
.notif-item.unread { border-left: 3px solid var(--gold); }
.notif-type-win      { border-left-color: #27AE60 !important; }
.notif-type-lose     { border-left-color: #E74C3C !important; }
.notif-type-deposit  { border-left-color: #2980B9 !important; }
.notif-type-withdraw { border-left-color: #8E44AD !important; }
.notif-type-system   { border-left-color: var(--gold) !important; }

/* ─── TOASTS ─────────────────────────────────────────────── */
.luxury-toast {
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: var(--radius) !important;
    min-width: 280px;
}
.luxury-toast .toast-header {
    background: var(--surface-3) !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.luxury-toast .btn-close { filter: invert(1); }

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header {
    background: linear-gradient(135deg,
        var(--primary-deeper) 0%,
        var(--primary-dark) 50%,
        var(--primary-deeper) 100%);
    border-bottom: 2px solid var(--gold-dark);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(245,166,35,0.07) 0%, transparent 70%);
}
.page-header h1 { font-size: 1.5rem; margin: 0; }

/* ─── SECTION DIVIDER ────────────────────────────────────── */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(245,166,35,0.2);
    margin-bottom: 1.25rem;
}

/* ─── PAGINATION ─────────────────────────────────────────── */
.page-link {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
.page-link:hover { background: rgba(245,166,35,0.1) !important; color: var(--gold) !important; }
.page-item.active .page-link {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold)) !important;
    border-color: var(--gold) !important;
    color: #1A0000 !important;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    background: var(--primary-deeper);
    border-top: 2px solid var(--gold-dark);
    padding: 2rem 0;
    margin-top: 4rem;
    color: rgba(255,220,200,0.9);
}
.site-footer p,
.site-footer .text-muted { color: rgba(255,210,190,0.7) !important; font-size: 0.85rem; }

/* ─── BACK TO TOP ────────────────────────────────────────── */
#backToTop {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #1A0000;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(245,166,35,0.5);
    transition: var(--transition);
    font-size: 1.2rem;
}
#backToTop:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(245,166,35,0.6); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-card { padding: 1.75rem; }
    .result-hero-card { padding: 1.25rem; }
    .wallet-card { padding: 1.25rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.4rem; }
    .digit-number { font-size: 1.5rem; }
    .digit-tab { min-width: 55px; font-size: 0.8rem; }
}

@media (max-width: 576px) {
    .luxury-navbar .navbar-brand .brand-text { font-size: 0.95rem; }
    .number-pad { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .num-btn { font-size: 1rem; }
}

/* ─── OVERRIDE BOOTSTRAP ─────────────────────────────────── */
.form-control,
.form-select,
.input-group-text {
    background-color: var(--surface-2) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(245,166,35,0.2) !important;
}
.form-control::placeholder { color: var(--text-muted) !important; }
.form-select option { background: var(--surface-2); color: var(--text); }
.dropdown-menu { background: var(--surface-2); border-color: var(--border); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: rgba(245,166,35,0.1); color: var(--gold); }
.modal-backdrop { --bs-backdrop-opacity: 0.8; }
.alert-success { background: rgba(39,174,96,0.1);  border-color: rgba(39,174,96,0.3);  color: #27AE60; }
.alert-danger  { background: rgba(231,76,60,0.1);  border-color: rgba(231,76,60,0.3);  color: #E74C3C; }
.alert-warning { background: rgba(243,156,18,0.1); border-color: rgba(243,156,18,0.3); color: #F39C12; }
.alert-info    { background: rgba(41,128,185,0.1); border-color: rgba(41,128,185,0.3); color: #5DADE2; }
.nav-tabs .nav-link { color: var(--text-muted); border-color: var(--border); background: transparent; }
.nav-tabs .nav-link.active { background: var(--surface-2); color: var(--gold); border-color: var(--border); border-bottom-color: var(--surface-2); }
.nav-tabs { border-bottom-color: var(--border); }
.hr, hr { border-color: var(--border); }

/* ─── RANGE SLIDER ───────────────────────────────────────── */
input[type="range"] { accent-color: var(--gold); }

/* ─── BURGER SIDEBAR DRAWER (MOBILE FRONTEND) ───────────── */
@media (max-width: 992px) {
    /* Sliding sidebar drawer */
    .luxury-navbar .navbar-collapse {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%) !important;
        border-left: 2px solid var(--gold);
        padding: 2rem 1.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1050;
        box-shadow: -5px 0 25px rgba(0,0,0,0.8);
    }
    
    /* Show class added by Bootstrap toggles state */
    .luxury-navbar .navbar-collapse.show {
        transform: translateX(-280px);
    }
    
    /* Navigation inside off-canvas */
    .luxury-navbar .navbar-nav {
        width: 100%;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
        align-items: stretch !important;
    }
    
    .luxury-navbar .nav-link {
        width: 100% !important;
        padding: 0.8rem 1rem !important;
        border-radius: 12px !important;
        background: rgba(255,255,255,0.03) !important;
        border: 1px solid rgba(255,255,255,0.05) !important;
        text-align: left !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .luxury-navbar .nav-link:hover,
    .luxury-navbar .nav-link.active {
        background: rgba(245,166,35,0.15) !important;
        border-color: rgba(245,166,35,0.3) !important;
        color: var(--gold) !important;
    }
    
    /* Backdrop Overlay background */
    .navbar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.7);
        backdrop-filter: blur(4px);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .navbar-backdrop.show {
        display: block;
        opacity: 1;
    }
    
    /* Close button inside sidebar */
    .sidebar-close-btn {
        align-self: flex-end;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.6rem;
        margin-bottom: 1rem;
        cursor: pointer;
        transition: color 0.2s;
        padding: 0;
        line-height: 1;
    }
    .sidebar-close-btn:hover {
        color: var(--gold);
    }
}

/* ─── COUNTDOWN TIMER WIDGET ──────────────────────────────── */
.countdown-widget {
    background: linear-gradient(135deg, rgba(30,4,4,0.95) 0%, rgba(20,8,0,0.95) 100%);
    border: 2px solid rgba(245,166,35,0.5);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(245,166,35,0.15), 0 8px 32px rgba(0,0,0,0.6);
}
.countdown-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245,166,35,0.05) 0%, transparent 60%);
    animation: pulse-bg 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}
.countdown-header-label {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(245,166,35,0.85);
    margin-bottom: 0.35rem;
}
.countdown-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1.25rem;
    text-shadow: 0 0 15px rgba(245,166,35,0.4);
}
.countdown-timer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.countdown-num {
    width: 64px;
    height: 68px;
    background: linear-gradient(180deg, rgba(245,166,35,0.12) 0%, rgba(245,166,35,0.05) 100%);
    border: 1.5px solid rgba(245,166,35,0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    font-family: 'Inter', sans-serif;
    text-shadow: 0 0 20px rgba(245,166,35,0.6);
    box-shadow: 0 0 12px rgba(245,166,35,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
    transition: text-shadow 0.3s ease;
}
.countdown-num::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,166,35,0.5), transparent);
}
.countdown-num.flash {
    text-shadow: 0 0 30px rgba(245,166,35,0.9), 0 0 60px rgba(245,166,35,0.4);
}
.countdown-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
}
.countdown-colon {
    font-size: 2rem;
    font-weight: 900;
    color: rgba(245,166,35,0.5);
    line-height: 68px;
    margin-top: -16px;
    animation: blink-colon 1s step-start infinite;
}
@keyframes blink-colon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}
.countdown-footer-label {
    margin-top: 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(245,166,35,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.countdown-live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #27AE60;
    box-shadow: 0 0 6px #27AE60;
    animation: live-pulse 1.4s ease-in-out infinite;
    display: inline-block;
}
@keyframes live-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

/* ─── MOBILE BURGER SIDEBAR — USER CARD ───────────────────── */
@media (max-width: 992px) {
    /* Mobile User Card inside off-canvas */
    .mobile-user-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 1rem;
        background: rgba(245,166,35,0.08);
        border: 1px solid rgba(245,166,35,0.2);
        border-radius: 14px;
        margin-bottom: 1rem;
        width: 100%;
    }
    .mobile-user-avatar {
        width: 48px; height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary), var(--gold-dark));
        border: 2px solid rgba(245,166,35,0.6);
        box-shadow: 0 0 12px rgba(245,166,35,0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.3rem;
        font-weight: 900;
        color: #fff;
        flex-shrink: 0;
    }
    .mobile-user-info {
        flex: 1;
        min-width: 0;
    }
    .mobile-user-name {
        font-size: 0.88rem;
        font-weight: 800;
        background: linear-gradient(90deg, var(--gold), var(--gold-light));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-user-phone {
        font-size: 0.7rem;
        color: rgba(255,255,255,0.45);
        margin-top: 1px;
    }
    .mobile-user-balance {
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--gold);
        margin-top: 3px;
    }

    /* Guest welcome block */
    .mobile-guest-block {
        text-align: center;
        padding: 0.5rem 0 1rem;
        width: 100%;
    }
    .mobile-guest-logo {
        font-size: 2rem;
        margin-bottom: 0.4rem;
    }
    .mobile-guest-title {
        font-size: 0.85rem;
        font-weight: 800;
        color: rgba(255,255,255,0.75);
        margin-bottom: 0.75rem;
    }

    /* Nav links inside mobile sidebar */
    .luxury-navbar .mobile-nav-link {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        border-radius: 12px !important;
        background: rgba(255,255,255,0.03) !important;
        border: 1px solid rgba(255,255,255,0.05) !important;
        text-align: left !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        color: rgba(240,240,240,0.8) !important;
        text-decoration: none !important;
        font-size: 0.9rem;
        font-weight: 600;
        transition: all 0.2s ease;
        margin-bottom: 6px !important;
    }
    .luxury-navbar .mobile-nav-link:hover,
    .luxury-navbar .mobile-nav-link.active {
        background: rgba(245,166,35,0.12) !important;
        border-color: rgba(245,166,35,0.3) !important;
        color: var(--gold) !important;
    }
    .luxury-navbar .mobile-nav-link i {
        width: 20px;
        text-align: center;
        font-size: 1.05rem;
        flex-shrink: 0;
    }
    .luxury-navbar .mobile-nav-link.danger-link {
        color: rgba(231,76,60,0.8) !important;
        border-color: rgba(231,76,60,0.1) !important;
    }
    .luxury-navbar .mobile-nav-link.danger-link:hover {
        background: rgba(231,76,60,0.1) !important;
        border-color: rgba(231,76,60,0.3) !important;
        color: #E74C3C !important;
    }
    .luxury-navbar .mobile-nav-link.admin-link {
        color: rgba(243,156,18,0.9) !important;
        border-color: rgba(243,156,18,0.15) !important;
    }
    .luxury-navbar .mobile-nav-link.admin-link:hover {
        background: rgba(243,156,18,0.1) !important;
        border-color: rgba(243,156,18,0.35) !important;
        color: var(--warning) !important;
    }

    /* Mobile sidebar divider */
    .mobile-sidebar-divider {
        border-top: 1px solid rgba(255,255,255,0.07);
        margin: 0.75rem 0;
        width: 100%;
    }

    /* Mobile lang switcher in sidebar */
    .mobile-lang-bar {
        display: flex;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(245,166,35,0.2);
        border-radius: 14px;
        padding: 3px;
        gap: 3px;
        width: 100%;
        margin-top: 0.75rem;
    }
    .mobile-lang-btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 7px;
        font-size: 0.75rem;
        font-weight: 700;
        border-radius: 10px;
        color: rgba(255,255,255,0.5);
        text-decoration: none !important;
        transition: all 0.2s;
    }
    .mobile-lang-btn.active {
        background: var(--gold);
        color: #000 !important;
        box-shadow: 0 2px 8px rgba(245,166,35,0.4);
    }
    .mobile-lang-btn:hover:not(.active) {
        background: rgba(255,255,255,0.08);
        color: #fff !important;
    }
}
