/* public/css/app.css */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --bg-main: #14151f;
    --bg-sidebar: #1e202e;
    --bg-card: #242731;
    --bg-card-hover: #2a2e39;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent-green: #00e57c;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --border-color: #2a2e39;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.sidebar-brand i {
    color: var(--accent-green);
}

.sidebar-brand-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.brand-admin-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 229, 124, 0.1);
    border: 1px solid rgba(0, 229, 124, 0.2);
    color: var(--accent-green);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 1.5rem;
}

.brand-admin-edit:hover {
    background: var(--accent-green);
    color: #000;
    box-shadow: 0 0 12px rgba(0, 229, 124, 0.4);
    transform: translateY(-1px);
}

.brand-admin-edit i {
    font-size: 1rem;
    transition: transform 0.5s ease;
}

.brand-admin-edit:hover i {
    transform: rotate(90deg);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: var(--accent-green);
    border-left-color: var(--accent-green);
    background-color: rgba(0, 229, 124, 0.05);
}

.sidebar-link.active i {
    color: var(--accent-green);
}

.badge-new {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: 70px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;

}

.top-widget {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.top-widget:hover {
    border-color: var(--border-color);
}

.widget-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-icon-box.jackpot {
    background: conic-gradient(from 180deg at 50% 50%, #f97316 0deg, #ec4899 120deg, #3b82f6 240deg, #10b981 360deg);
}

.widget-icon-box.refer {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.widget-text {
    display: flex;
    flex-direction: column;
}

.widget-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.widget-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-balance {
    background-color: rgba(0, 229, 124, 0.1);
    color: var(--accent-green);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-card);
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
    border-radius: 20px;
    cursor: pointer;
}

.avatar {
    width: 32px;
    height: 32px;
    background-color: #f97316;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.icon-btn {
    color: var(--text-secondary);
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
    text-decoration: none;
}

.icon-btn:hover {
    color: white;
}

/* Ticker Bar */
.ticker-bar {
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    display: flex;
    gap: 1rem;
    overflow-x: hidden;
    align-items: center;
}

.ticker-item {
    background-color: var(--bg-sidebar);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

.ticker-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.section-title i {
    color: var(--accent-green);
}

.btn-view-all {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

/* Featured Offers Grid */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.offer-card {
    background-color: var(--bg-sidebar);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    border: 1px solid transparent;
}

.offer-card:hover {
    transform: translateY(-4px);
    background-color: var(--bg-card-hover);
    border-color: var(--border-color);
}

.offer-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.offer-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.os-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 6px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.os-badges i {
    font-size: 0.75rem;
}

.offer-title {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offer-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.offer-price {
    font-weight: 800;
    font-size: 1.125rem;
}

.offer-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

/* Partners Grid */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.partner-card {
    background-color: var(--bg-sidebar);
    border-radius: 12px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.partner-card:hover {
    background-color: var(--bg-card-hover);
}

.partner-card img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.partner-bonus {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 229, 124, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 229, 124, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Auth Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
}

.auth-card {
    background-color: var(--bg-sidebar);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--accent-green);
}

.btn-primary {
    background-color: var(--accent-green);
    color: #000;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background-color: #00c46a;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Offerwall Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 11, 18, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    background: linear-gradient(145deg, #1e202e 0%, #151622 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    margin-top: 2px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #fff;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.modal-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.modal-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.modal-tab.active {
    color: #000;
    background: var(--accent-green);
}

/* Modal Body / Offers Grid */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-offers-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-offer-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.modal-offer-card:hover {
    border-color: rgba(0, 229, 124, 0.3);
    background: rgba(255, 255, 255, 0.03);
}

.modal-offer-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 1rem;
    flex-shrink: 0;
}

.modal-offer-details {
    flex: 1;
    min-width: 0;
}

.modal-offer-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.modal-offer-os {
    display: inline-flex;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.modal-offer-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-offer-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    margin-left: 1.5rem;
}

.modal-offer-payout {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent-green);
    white-space: nowrap;
}

.modal-offer-btn {
    padding: 0.35rem 1rem !important;
    font-size: 0.8rem !important;
    width: auto !important;
    border-radius: 6px !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================ */
.mobile-bottom-nav {
    display: none;
    /* Hidden by default, shown via media query */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 65px;
    background: #1a1b28;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9999;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.25rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* iPhone notch support */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.65rem;
    font-weight: 600;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease;
    position: relative;
    padding-top: 6px;
}

.mob-nav-item:hover,
.mob-nav-item.mob-active {
    color: var(--accent-green);
}

.mob-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.mob-nav-item:hover .mob-nav-icon,
.mob-nav-item.mob-active .mob-nav-icon {
    transform: translateY(-1px);
}

/* Center raised Earn button */
.mob-nav-center {
    flex: 1.2;
    padding-top: 0;
    position: relative;
    overflow: visible;
}

.mob-nav-center-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #000;
    box-shadow: 0 4px 16px rgba(0, 229, 124, 0.5), 0 0 0 4px rgba(0, 229, 124, 0.15);
    position: relative;
    margin-bottom: 2px;
    margin-top: -18px;
    /* Raise above the bar */
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.mob-nav-center:hover .mob-nav-center-btn,
.mob-nav-center.mob-active .mob-nav-center-btn {
    box-shadow: 0 6px 22px rgba(0, 229, 124, 0.7), 0 0 0 5px rgba(0, 229, 124, 0.2);
    transform: scale(1.05);
}

.mob-nav-center span {
    color: var(--accent-green);
    font-size: 0.65rem;
    font-weight: 700;
}

/* MOBILE LOGO & CHAT CLOSE BUTTON DEFAULT STYLES */
.mobile-logo {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.mobile-logo i {
    color: var(--accent-green);
}

.chat-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
}

.chat-close-btn:hover {
    color: #fff;
}

#hamburgerBtn {
    display: none;
    /* Hide redundant hamburger button */
}

/* RESPONSIVE DESIGN - MEDIA QUERIES */
@media (max-width: 1024px) {

    /* Chat sidebar on tablet: slide in from right */
    .chat-sidebar {
        position: fixed;
        right: 0;
        top: 70px;
        height: calc(100vh - 70px);
        box-shadow: -10px 0 20px rgba(0, 0, 0, 0.5);
    }

    /* Collapsed on tablet: slide off to the right, zero width */
    .chat-sidebar.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        border-left: none !important;
    }

    .chat-close-btn {
        display: block;
    }

    .support-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* ============================================
   MOBILE CHAT - SLIDE UP BOTTOM SHEET
   ============================================ */
/* Backdrop overlay */
.chat-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9990;
    animation: fadeIn 0.25s ease;
}

.chat-backdrop.active {
    display: block;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    /* Navigation Sidebar styling on mobile */
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        width: 250px;
        transition: left 0.3s ease;
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.6);
    }

    .sidebar.show-mobile {
        left: 0;
    }

    #mobileSidebarToggleBtn {
        display: block !important;
        margin-right: 0.5rem;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.25rem;
    }

    .mobile-logo {
        display: flex;
        /* Show branding on mobile topbar */
    }

    .topbar {
        padding: 0 1rem;
    }

    .top-widget {
        display: none;
        /* Hide daily race race widget inside topbar on small screens */
    }

    .main-content {
        padding: 1.25rem 1rem;
        padding-bottom: 80px;
        /* Space for the fixed mobile bottom nav */
    }

    /* Show the mobile bottom nav on mobile */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Make grids adjust nicely */
    .offers-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .offer-card {
        padding: 0.75rem;
    }

    .offer-title {
        font-size: 0.875rem;
    }

    .offer-desc {
        font-size: 0.7rem;
    }

    .offer-price {
        font-size: 0.95rem;
    }

    .partners-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.75rem;
    }

    /* Modal Responsive adjustments */
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-offer-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .modal-offer-action {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 0.75rem;
    }

    .modal-offer-desc {
        white-space: normal;
    }

    /* Table responsive wrapper */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        width: 100%;
        min-width: 600px;
        /* Force minimum width to enable horizontal scroll and prevent columns from squishing */
    }

    /* Fallback table scrollability */
    .main-content table,
    table.admin-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Force promo/claim card flex to column on mobile */
    div.offer-card[style*="flex-direction: row"] {
        flex-direction: column !important;
        align-items: stretch !important;
        height: auto !important;
        min-height: auto !important;
        gap: 1rem !important;
    }

    div.offer-card[style*="flex-direction: row"]>div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    div.offer-card[style*="flex-direction: row"] form {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    div.offer-card[style*="flex-direction: row"] form input {
        width: 100% !important;
    }

    div.offer-card[style*="flex-direction: row"] form button {
        width: 100% !important;
    }

    /* Header Banner Component Responsiveness */
    .header-banner {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 1.5rem !important;
        gap: 1.25rem !important;
        margin-bottom: 2rem !important;
    }

    .header-banner-stats {
        width: 100% !important;
        justify-content: flex-start !important;
        text-align: left !important;
        border-top: 1px solid var(--border-color);
        padding-top: 1.25rem !important;
        gap: 1.5rem !important;
    }

    .header-banner-stats>div {
        text-align: left !important;
    }

    .banner-divider {
        display: none !important;
    }

    /* Leaderboard Winner Spotlight Responsiveness */
    .winner-spotlight {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1.5rem !important;
        gap: 1.5rem !important;
    }

    .winner-spotlight .spotlight-stats {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px solid var(--border-color);
        padding-top: 1.5rem !important;
        width: 100% !important;
        justify-content: space-around !important;
    }

    /* Landing / Home Page Responsiveness */
    .hero-title {
        font-size: clamp(2.2rem, 8vw, 3.5rem) !important;
        line-height: 1.2 !important;
    }

    .hero-actions {
        flex-direction: column !important;
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
        gap: 0.75rem !important;
    }

    .hero-actions a {
        width: 100% !important;
        text-align: center;
    }

    .trust-stats {
        gap: 2rem !important;
        margin-top: 3rem !important;
        padding-top: 2rem !important;
    }

    .testimonials-section {
        padding: 2rem 1.5rem !important;
    }

    .testimonials-grid {
        grid-template-columns: 1fr !important;
    }

    /* ──────────────────────────────────────────────
       Community Chat: bottom sheet on mobile phones
       Always hidden; slides up only when opened
    ────────────────────────────────────────────── */

    /* Default collapsed = completely hidden */
    .chat-sidebar,
    .chat-sidebar.collapsed {
        display: none !important;
    }

    /* Open state: full-width bottom sheet */
    .chat-sidebar:not(.collapsed) {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 85vh !important;
        border-radius: 20px 20px 0 0 !important;
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.75) !important;
        z-index: 9995 !important;
        animation: chatSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    /* Drag handle pill */
    .chat-sidebar:not(.collapsed)::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.18);
        border-radius: 4px;
        margin: 10px auto 4px;
        flex-shrink: 0;
    }
}

@keyframes chatSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .topbar-right {
        gap: 0.5rem;
    }

    .user-balance {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .user-profile span {
        display: none;
        /* Hide username on super small screens, show avatar only */
    }

    .user-profile {
        padding: 0.25rem;
    }

    /* Ticker bar mobile optimizations */
    .ticker-bar {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        overflow-x: auto;
        white-space: nowrap;
    }

    .ticker-item {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Community Chat full-width on small phones */
    .chat-sidebar:not(.collapsed) {
        height: 92vh !important;
        border-radius: 16px 16px 0 0 !important;
    }
}