/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --bg-primary: #0a0a0a;
    --bg-secondary: #101010;
    --bg-tertiary: #1a1a1a;
    --bg-hover: #242424;
    --bg-active: #2a2a2a;
    
    /* Macau Green Metallic Gradient */
    --macau-green-start: #00A86B;
    --macau-green-mid: #00C87E;
    --macau-green-end: #00E691;
    --macau-green-dark: #008050;
    --macau-green-light: #33FFAA;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #606060;
    
    /* Borders */
    --border-color: #1f1f1f;
    --border-hover: #2a2a2a;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* Metallic Green Gradient */
    --gradient-metallic: linear-gradient(135deg, 
        #00A86B 0%, 
        #00C87E 25%, 
        #00E691 50%, 
        #00C87E 75%, 
        #00A86B 100%
    );
    
    --gradient-metallic-hover: linear-gradient(135deg, 
        #00C87E 0%, 
        #00E691 25%, 
        #33FFAA 50%, 
        #00E691 75%, 
        #00C87E 100%
    );
}

/* Smooth fade-in reveal for content as it enters the viewport */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    font-size: 14px;
}

/* Sidebar Header (logo + toggle, inside the sidebar) */
.sidebar-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 1rem;
    margin-bottom: 0.5rem;
}

.sidebar-header-logo {
    height: 52px;
    width: auto;
    display: block;
}

/* Show full logo expanded, icon when collapsed */
.sidebar-header-logo.logo-icon {
    display: none;
}

body.sidebar-collapsed .sidebar-header-logo.logo-full {
    display: none;
}

body.sidebar-collapsed .sidebar-header-logo.logo-icon {
    display: block;
}

/* Sidebar (stuck to the left edge, top to bottom) */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    z-index: 1002;
    overflow: hidden;
    border: none;
    transition: width 0.3s ease;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

/* Sidebar Banner */
.sidebar-banner {
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* Sidebar Separator (partial width, not full left-to-right) */
.sidebar-separator {
    height: 1px;
    background-color: #1f1f1f;
    margin: 0.625rem 0.25rem;
    flex-shrink: 0;
}

/* Sidebar Support (pinned to bottom) */
.sidebar-support {
    margin-top: auto;
    flex-shrink: 0;
}

.support-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    color: #b0b0b0;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.support-btn:hover {
    background-color: #1a1a1a;
    color: #ffffff;
}

.support-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0b0b0;
    flex-shrink: 0;
}

.support-btn:hover .support-icon {
    color: #ffffff;
}

.support-label {
    flex: 1;
    text-align: left;
}

.support-badge {
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #00A86B 0%, #00C87E 100%);
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #04150d;
    flex-shrink: 0;
}

/* Sidebar Logo */
.sidebar-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem 1rem;
    margin-bottom: 0.5rem;
}

.sidebar-logo img {
    height: 56px;
    width: auto;
    display: block;
}

/* Navigation Items (flat list) */
.nav-card {
    background-color: transparent;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.nav-card:hover {
    background-color: var(--bg-hover);
}

.nav-card-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-card:hover .nav-card-header {
    color: var(--text-primary);
}

.nav-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.nav-card-title svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.nav-card:hover .nav-card-title svg {
    color: var(--macau-green-end);
}

.nav-card-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-card-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

.nav-card:hover .nav-card-arrow {
    color: var(--text-secondary);
}

/* Expandable nav sections (Casino / Sports) */
.nav-section-toggle {
    width: 100%;
}

.nav-section-chev {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.3s ease, color 0.2s ease;
}

.nav-section.open .nav-section-chev {
    transform: rotate(180deg);
}

.nav-sub {
    display: none;
    flex-direction: column;
    gap: 0.0625rem;
    padding: 0.125rem 0 0.25rem 0.5rem;
}

.nav-section.open .nav-sub {
    display: flex;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-sub-item svg {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.nav-sub-item:hover {
    background-color: #1a1a1a;
    color: var(--text-primary);
}

.nav-sub-item:hover svg {
    color: var(--text-primary);
}

.nav-sub-item.active {
    color: var(--accent-green);
}

.nav-sub-item.active svg {
    color: var(--accent-green);
}

.nav-badge {
    padding: 0.125rem 0.375rem;
    background: var(--gradient-metallic);
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
    margin-left: auto;
}

.lang-flag {
    display: inline-flex;
    flex-shrink: 0;
    width: 22px;
    height: 16px;
    border-radius: 3px;
    overflow: hidden;
}

.lang-flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

.lang-chev {
    color: #606060;
    flex-shrink: 0;
}

.vip-text {
    background: var(--gradient-metallic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.info-icon {
    margin-left: auto;
    opacity: 0.5;
}

/* Collapsed sidebar state */
body.sidebar-collapsed .sidebar {
    width: 76px;
}

/* Header: stack the small icon above the toggle, centered */
body.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0 1rem;
}

body.sidebar-collapsed .sidebar-header-logo {
    height: 34px;
    width: auto;
}

body.sidebar-collapsed .topbar {
    left: 76px;
}

body.sidebar-collapsed .sidebar-banner {
    display: none;
}

/* Icon-only rail: hide labels, badges, chevrons and sub-menus */
body.sidebar-collapsed .nav-card-title span,
body.sidebar-collapsed .nav-card-arrow,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .nav-section-chev,
body.sidebar-collapsed .nav-sub {
    display: none;
}

body.sidebar-collapsed .nav-card-header {
    justify-content: center;
    padding: 0.625rem 0;
}

body.sidebar-collapsed .nav-card-title {
    justify-content: center;
    gap: 0;
}

/* Support area: icons only, centered */
body.sidebar-collapsed .support-btn {
    justify-content: center;
    padding: 0.625rem 0;
}

body.sidebar-collapsed .support-label,
body.sidebar-collapsed .support-badge,
body.sidebar-collapsed .lang-chev {
    display: none;
}

/* Collapsed hover flyouts: labels + Casino sub-menu popup */
body.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar-nav {
    overflow: visible;
}

body.sidebar-collapsed .nav-card-header,
body.sidebar-collapsed .support-btn {
    position: relative;
}

/* Label tooltip that appears to the right of each collapsed icon */
body.sidebar-collapsed .nav-card-header::after,
body.sidebar-collapsed .support-btn::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1300;
}

body.sidebar-collapsed .nav-card:hover .nav-card-header::after,
body.sidebar-collapsed .support-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Casino: replace the label tooltip with a full sub-menu flyout */
body.sidebar-collapsed .nav-card.nav-section {
    position: relative;
}

body.sidebar-collapsed .nav-card.nav-section .nav-card-header::after {
    display: none;
}

body.sidebar-collapsed .nav-card.nav-section::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 10px;
    z-index: 1299;
}

body.sidebar-collapsed .nav-card.nav-section .nav-sub {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    min-width: 190px;
    background: #161616;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem;
    gap: 0.125rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1300;
}

body.sidebar-collapsed .nav-card.nav-section:hover .nav-sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.sidebar-collapsed .nav-card.nav-section .nav-sub::before {
    content: attr(data-label);
    display: block;
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem 0.375rem;
}

body.sidebar-collapsed .nav-card.nav-section .nav-sub-item {
    padding: 0.5rem 0.625rem;
    white-space: nowrap;
}

body.sidebar-collapsed .main-wrapper {
    margin-left: calc(76px + 0.75rem);
}

/* Main Wrapper */
.main-wrapper {
    margin-left: calc(260px + 0.75rem);
    margin-top: calc(80px + 0.75rem);
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    min-height: calc(100vh - 80px - 1.5rem);
    background-color: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    transition: margin-left 0.3s ease;
}

/* Sportsbook (DB) and Cock Fight (AOG) span full width edge-to-edge */
body.sports-active .main-wrapper,
body.cockfight-active .main-wrapper {
    margin-left: 260px;
    margin-right: 0;
    border-radius: 0;
}

body.sports-active.sidebar-collapsed .main-wrapper,
body.cockfight-active.sidebar-collapsed .main-wrapper {
    margin-left: 76px;
}

/* Content Container - Centered with max width */
.content-container {
    max-width: none;
    margin: 0 auto;
    padding: 1.5rem 0.75rem;
}

/* Sportsbook embedded view */
.sportsbook-view {
    height: calc(100vh - 80px - 1.5rem);
    margin: 0;
    padding: 0;
    position: relative;
}

.sportsbook-view[hidden] { display: none; }

/* Cock Fight embedded view (AOG full-width iframe) */
.cockfight-view {
    height: calc(100vh - 80px - 1.5rem);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background-color: #0A0A0B;
    position: relative;
}

.cockfight-view[hidden] { display: none; }

.cockfight-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.cockfight-tab {
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cockfight-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.cockfight-tab.active {
    background: var(--gradient-metallic);
    color: #04140c;
    border-color: transparent;
}

.cockfight-view iframe {
    flex: 1;
    width: 100%;
    border: none;
    display: block;
    background-color: #0A0A0B;
}

/* Loading overlay shown over the sports/cockfight iframe until the game loads */
.frame-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    background: radial-gradient(circle at 50% 42%, #131316 0%, #0A0A0B 68%);
    z-index: 5;
}

.frame-loading-logo-wrap {
    position: relative;
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-loading-logo {
    width: 96px;
    height: auto;
    object-fit: contain;
    animation: frame-logo-pulse 1.6s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(51, 255, 170, 0.35));
}

.frame-loading-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--macau-green-light, #33FFAA);
    border-right-color: var(--macau-green-light, #33FFAA);
    animation: frame-spin 1.1s linear infinite;
}

.frame-loading-text {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #8b8b93 0%, #f2f2f4 50%, #8b8b93 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: frame-text-shimmer 1.8s linear infinite;
}

@keyframes frame-spin {
    to { transform: rotate(360deg); }
}

@keyframes frame-logo-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.07); opacity: 0.85; }
}

@keyframes frame-text-shimmer {
    to { background-position: -200% 0; }
}

/* Lottery view */
.lottery-view[hidden] { display: none; }

.lottery-header {
    margin-bottom: 1.5rem;
}

.lottery-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}

.lottery-subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.lottery-filters {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary, #16213a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.lottery-filter {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 200px;
}

.lottery-filter label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.lottery-filter select {
    background: var(--bg-primary, #0f1729);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

.lottery-filter select:focus {
    border-color: var(--macau-green-start);
}

.lottery-filter-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    padding-bottom: 0.55rem;
}

.lottery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.lottery-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    transition: transform 0.25s ease;
}

.lottery-card:hover {
    transform: translateY(-3px);
}

.lottery-card-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.2rem;
}

.lottery-card-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.lottery-card-country {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lottery-card-logo {
    aspect-ratio: 2 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #ffffff;
}

.lottery-card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}

.lottery-card:hover .lottery-card-logo img {
    transform: scale(1.04);
}

.lottery-card-jackpot {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.2rem 0.3rem;
}

.lottery-card-jackpot-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.lottery-card-jackpot-value {
    font-size: 1.05rem;
    font-weight: 800;
    white-space: nowrap;
    background: linear-gradient(180deg, #fff6c8 0%, #ffd700 30%, #e6a817 55%, #b8860b 75%, #ffd700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

@media (max-width: 800px) {
    .lottery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 540px) {
    .lottery-grid { grid-template-columns: repeat(2, 1fr); }
    .lottery-filter { min-width: 0; flex: 1 1 140px; }
    .lottery-filter-count { margin-left: 0; width: 100%; padding-bottom: 0; }
}

/* Lottery detail / betslip */
.lottery-detail[hidden] { display: none; }

.lottery-card { cursor: pointer; }

.lottery-detail-head {
    margin-bottom: 1.25rem;
}

.lottery-back-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.lottery-back-btn:hover {
    color: var(--text-primary);
    border-color: var(--macau-green-start);
}

.lottery-detail-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.lottery-detail-flag {
    width: 40px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.lottery-detail-country {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.lottery-detail-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.lottery-detail-meta {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.lottery-detail-jackpot-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.lottery-detail-jackpot {
    font-size: 1.6rem;
}

.lottery-detail-draw {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.lottery-detail-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.lottery-tool-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.lottery-tool-btn:hover {
    border-color: var(--macau-green-start);
}

.lottery-lines {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lottery-line {
    background: var(--bg-secondary, #16213a);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.lottery-line-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}

.lottery-line-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.lottery-line-state {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.lottery-line-tools {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
}

.lottery-icon-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
}

.lottery-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--macau-green-start);
}

.lottery-grid-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin: 0.4rem 0 0.45rem;
}

.lottery-grid-label.bonus {
    color: #f0b35e;
}

.lottery-number-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 0.4rem;
}

.lottery-ball {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
    padding: 0;
}

.lottery-ball:hover {
    border-color: var(--macau-green-start);
    transform: scale(1.08);
}

.lottery-ball.selected {
    background: linear-gradient(160deg, #00c97e, #008f5a);
    border-color: #00c97e;
    color: #04160e;
    font-weight: 800;
}

.lottery-number-grid.bonus .lottery-ball.selected,
.lottery-ball.bonus.selected {
    background: linear-gradient(160deg, #ffd700, #c98a00);
    border-color: #ffd700;
    color: #241a00;
}

.lottery-ball.small {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    cursor: default;
}

.lottery-summary {
    position: sticky;
    bottom: 0.75rem;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(13, 20, 36, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0.8rem 1rem;
}

.lottery-summary-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
}

.lottery-summary-total {
    margin-left: auto;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.lottery-play-btn {
    background: linear-gradient(160deg, #00c97e, #00a86b);
    border: none;
    border-radius: 10px;
    color: #04160e;
    font-size: 1rem;
    font-weight: 800;
    padding: 0.7rem 1.6rem;
    cursor: pointer;
}

.lottery-play-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.lottery-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.9rem;
}

.lottery-confirm-card {
    margin-top: 1.25rem;
    background: var(--bg-secondary, #16213a);
    border: 1px solid rgba(0, 201, 126, 0.45);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.lottery-confirm-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #00c97e;
    margin-bottom: 0.2rem;
}

.lottery-confirm-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
}

.lottery-confirm-line {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.lottery-confirm-balance {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 540px) {
    .lottery-summary { flex-wrap: wrap; }
    .lottery-summary-total { margin-left: 0; }
    .lottery-play-btn { width: 100%; }
}

/* Providers popup */
.providers-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.providers-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.providers-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.providers-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.providers-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.providers-modal-close:hover {
    color: var(--text-primary);
}

.providers-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 1.25rem;
    overflow-y: auto;
}

.provider-select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 1rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.provider-select-card:hover {
    border-color: var(--macau-green-light);
    transform: translateY(-2px);
}

.provider-select-card .provider-count {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.provider-select-card .provider-logo {
    height: 32px;
    max-width: 100%;
    object-fit: contain;
}

/* Deposit popup */
.deposit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.deposit-modal {
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.deposit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.deposit-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.deposit-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.deposit-modal-close:hover {
    color: var(--text-primary);
}

.deposit-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.75rem 1.25rem 0;
    padding: 0.6rem 1rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
}

.deposit-balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.deposit-balance-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--macau-green-light);
}

.deposit-section-label {
    margin: 0.9rem 1.25rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.deposit-methods {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    padding: 0 1.25rem;
}

.deposit-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0.45rem 0.3rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.deposit-method img {
    height: 20px;
    max-width: 100%;
    object-fit: contain;
}

.deposit-method:hover {
    background: rgba(255, 255, 255, 0.06);
}

.deposit-method.active {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px var(--macau-green-light);
}

.deposit-amount-display {
    margin: 0 1.25rem 0.35rem;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
}

.deposit-amount-slider {
    width: calc(100% - 2.5rem);
    margin: 0 1.25rem;
    accent-color: var(--macau-green-light);
    cursor: pointer;
}

.deposit-quick-amounts {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4rem;
    margin: 0.75rem 1.25rem 0;
}

.quick-amount {
    padding: 0.4rem 0;
    background: var(--bg-primary);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.quick-amount:hover {
    background: rgba(255, 255, 255, 0.06);
}

.quick-amount.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--macau-green-light);
}

.deposit-submit {
    display: block;
    width: calc(100% - 2.5rem);
    margin: 0.9rem 1.25rem 0;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--macau-green-light), var(--macau-green-dark));
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.deposit-submit:hover {
    opacity: 0.9;
}

/* Crypto Wallet Popup */
.wallet-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wallet-modal {
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.wallet-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.wallet-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.wallet-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.wallet-modal-close:hover {
    color: var(--text-primary);
}

.wallet-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.9rem 1.25rem 0.5rem;
}

.wallet-tab {
    padding: 0.6rem 0;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.wallet-tab.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--macau-green-light);
    box-shadow: inset 0 0 0 1px var(--macau-green-light);
}

.wallet-pane {
    padding: 0 1.25rem;
}

.wallet-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0 0.9rem;
    padding: 0.6rem 1rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
}

.wallet-balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.wallet-balance-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--macau-green-light);
}

.wallet-field-label {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.wallet-select,
.wallet-text-input,
.wallet-address-input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

.wallet-select {
    appearance: none;
    cursor: pointer;
}

.wallet-text-input::placeholder,
.wallet-address-input::placeholder {
    color: var(--text-secondary);
}

.wallet-address-box {
    margin-top: 0.9rem;
    padding: 0.9rem;
    background: var(--bg-primary);
    border-radius: 12px;
}

.wallet-address-box .wallet-field-label {
    margin-top: 0;
}

.wallet-address-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.wallet-address-input {
    flex: 1;
    font-size: 0.78rem;
    word-break: break-all;
}

.wallet-copy {
    padding: 0.6rem 0.8rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    color: var(--macau-green-light);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.wallet-memo {
    margin-top: 0.6rem;
}

.wallet-note {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.wallet-primary {
    display: block;
    width: 100%;
    margin-top: 0.9rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--macau-green-light), var(--macau-green-dark));
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.wallet-primary:hover {
    opacity: 0.9;
}

.wallet-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* XEPay fiat deposit/withdraw */
.deposit-method-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    min-width: 24px;
    padding: 0 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--macau-green-light);
}

.deposit-fiat-usd {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.wallet-withdraw-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin: 0.5rem 0 0.9rem;
}

#deposit-fiat-result {
    margin-top: 0.9rem;
    padding: 0.9rem;
    background: var(--bg-primary);
    border-radius: 10px;
    text-align: center;
}

#deposit-fiat-result img {
    max-width: 220px;
    margin: 0 auto 0.5rem;
    display: block;
    border-radius: 8px;
}

.fiat-result-note {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0;
}

.fiat-result-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.6rem 1.1rem;
    background: linear-gradient(135deg, var(--macau-green-light), var(--macau-green-dark));
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.sportsbook-view iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background-color: #0A0A0B;
}

/* Top Bar */
.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    background-color: var(--bg-primary);
    padding: 0.75rem;
    z-index: 1001;
    height: 80px;
    transition: left 0.3s ease;
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Sidebar toggle button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-logo img {
    display: block;
    height: 68px;
    width: auto;
    object-fit: contain;
}

/* Mobile-only topbar logo (hidden on desktop) */
.topbar-logo-mobile {
    display: none;
}

/* Top Bar Menu */
.topbar-menu {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.25rem;
    margin-left: 1rem;
}

.topbar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background-color: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.topbar-menu-item svg {
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.topbar-menu-item:hover {
    color: var(--text-primary);
}

.topbar-menu-item.active {
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 168, 107, 0.35);
}

.topbar-menu-item.active svg {
    color: var(--bg-primary);
}

.search-toggle {
    padding: 0.375rem;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle:hover {
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Balance chip (green gradient) + top-up button */
.balance-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.375rem 0.375rem 0.875rem;
    background: linear-gradient(135deg, #00A86B 0%, #00C87E 50%, #00A86B 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(0, 168, 107, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.balance-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 168, 107, 0.5);
}

.balance-amount {
    font-size: 0.875rem;
    font-weight: 700;
    color: #04150d;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.balance-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: rgba(4, 21, 13, 0.25);
    border-radius: 6px;
    color: #04150d;
    flex-shrink: 0;
}

.icon-btn {
    position: relative;
    padding: 0.375rem;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background-color: #ff4444;
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-primary {
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--gradient-metallic-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
}

/* Wins Carousel Section */
.wins-carousel-section {
    margin: 1rem 0;
}

.wins-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.wins-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--gradient-metallic);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.wins-tabs {
    display: flex;
    gap: 0.5rem;
}

.wins-tab {
    padding: 0.375rem 0.75rem;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.wins-tab:hover {
    color: var(--text-primary);
}

.wins-tab.active {
    color: var(--macau-green-light);
    border-bottom-color: var(--macau-green-start);
}

.wins-carousel {
    display: flex;
    gap: 0.5rem;
    overflow: hidden;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
    position: relative;
}

.wins-carousel::-webkit-scrollbar {
    display: none;
}

.wins-carousel-track {
    display: flex;
    gap: 0.5rem;
    animation: scrollWins 30s linear infinite;
}

@keyframes scrollWins {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.win-card {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 150px;
    padding: 0.375rem;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.win-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 168, 107, 0.2);
}

.win-game-image {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    overflow: hidden;
    border-radius: 6px;
}

.win-game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.win-info {
    flex: 1;
    min-width: 0;
    padding: 0;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.win-username {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.win-amount {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--macau-green-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* USDT icon (wins + rounds) */
.usdt-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
}

/* Promotional Carousel */
.promo-carousel {
    position: relative;
    background-color: transparent;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

/* Right-side shadow gradient (same as game rows) */
.promo-carousel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to right, transparent, var(--bg-primary));
    pointer-events: none;
    z-index: 1;
}

.carousel-container {
    display: flex;
    width: 100%;
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Image-only banner slide (no text overlay) — continuously scrolling marquee */
/* Higher specificity so mobile .carousel-slide padding never shrinks the banner */
.carousel-slide.carousel-slide-image {
    padding: 0;
    min-width: 0;
    flex: 0 0 auto;
    margin-right: 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    aspect-ratio: 2263 / 1160;
    background: var(--bg-tertiary);
}

.promo-banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.promo-card {
    flex: 1;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.promo-card:hover {
    border-color: var(--macau-green-start);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 168, 107, 0.2);
}

.promo-content {
    flex: 1;
}

.promo-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient-metallic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promo-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.promo-stats {
    display: flex;
    gap: 2rem;
}

.promo-stat {
    display: flex;
    flex-direction: column;
}

.promo-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.promo-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--macau-green-light);
}

.promo-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--macau-green-light);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Search Section */
.search-section {
    padding: 2.5rem 3rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--macau-green-start);
    box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.1);
}

.search-bar svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 2rem 3rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-tab:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    border-color: transparent;
    font-weight: 600;
}

/* Filters Section */
.filters-section {
    display: flex;
    gap: 0.5rem;
    padding: 2rem 3rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.filters-section::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.filter-btn.active {
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    border-color: transparent;
}

/* Games Header Section */
.games-header-section {
    margin-bottom: 1.25rem;
}

/* Games menu row: tabs left, search right */
.games-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.games-menu-row .games-category-tabs {
    flex: 0 1 auto;
    min-width: 0;
    padding-bottom: 0;
}

.games-menu-row .games-search-bar {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.games-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.games-search-bar:focus-within {
    border-color: var(--macau-green-start);
    box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.1);
}

.games-search-bar svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.games-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.games-search-input::placeholder {
    color: var(--text-tertiary);
}

/* Games Category Tabs */
.games-category-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}

.games-category-tabs::-webkit-scrollbar {
    display: none;
}

.game-category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-category-tab:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.game-category-tab.active {
    background-color: var(--bg-active);
    border-color: var(--macau-green-start);
    color: var(--macau-green-light);
}

.game-category-tab svg {
    flex-shrink: 0;
}

/* Games Section */
.games-section {
    padding: 0;
}

/* Game Providers Row */
.providers-section {
    margin-bottom: 1.5rem;
}

.providers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.providers-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.providers-row {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}

.providers-row::-webkit-scrollbar {
    display: none;
}

.provider-card {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 56px;
    padding: 0.5rem;
    background-color: #101010;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.provider-card:hover {
    background-color: #1a1a1a;
    transform: translateY(-2px);
}

.provider-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Game Category Sections */
.game-category-section {
    margin-bottom: 1.5rem;
    position: relative;
}

.game-category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.category-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.see-all-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.see-all-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--macau-green-start);
    color: var(--macau-green-light);
}

.see-all-btn svg {
    transition: transform 0.3s ease;
}

.see-all-btn:hover svg {
    transform: translateX(2px);
}

/* Games Carousel Container */
.games-carousel-wrapper {
    position: relative;
    overflow: hidden;
}

.games-carousel-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to right, transparent, var(--bg-primary));
    pointer-events: none;
    z-index: 1;
}

.games-grid {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.games-grid::-webkit-scrollbar {
    display: none;
}

.games-load-more {
    display: block;
    width: max-content;
    margin: 0.75rem auto;
    position: relative;
    z-index: 2;
    padding: 0.875rem 1.75rem;
    min-height: 48px;
    background-color: transparent;
    border: 1px solid var(--macau-green-start);
    color: var(--macau-green-light);
    font-weight: 700;
}

.games-load-more:hover {
    background-color: rgba(0, 168, 107, 0.12);
    border-color: var(--macau-green-light);
    color: #ffffff;
}

.games-grid .game-card {
    flex-shrink: 0;
    width: 152px;
}

/* Vertical (wrapping) grid for selected category views — replaces the carousel row */
.games-grid.games-grid--wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    overflow: visible;
    padding-bottom: 0;
}

.games-grid.games-grid--wrap .game-card {
    width: 100%;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .games-grid.games-grid--wrap {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

.game-card-fallback {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    text-align: center;
    border-radius: 8px;
    box-sizing: border-box;
}

.game-card-fallback .fallback-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.game-card-fallback .fallback-provider {
    font-size: 0.6875rem;
    color: var(--macau-green-start);
    font-weight: 500;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-count {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.game-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    aspect-ratio: 1;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--macau-green-start);
    box-shadow: 0 8px 24px rgba(0, 168, 107, 0.2);
}

.game-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-image img {
    transform: scale(1.05);
}

.game-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 2;
}

/* Latest Round & Race Widget */
.latest-rounds-section {
    margin-top: 2.5rem;
}

.latest-rounds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.latest-rounds-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.latest-rounds-tabs {
    display: flex;
    gap: 0.25rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem;
}

.latest-rounds-tab {
    padding: 0.375rem 0.875rem;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.latest-rounds-tab:hover {
    color: var(--text-primary);
}

.latest-rounds-tab.active {
    background-color: var(--bg-active);
    color: var(--text-primary);
}

.latest-rounds-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.round-row {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 1.2fr 0.8fr 1.2fr;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.round-row:hover {
    background-color: var(--bg-hover);
}

.round-cell {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    align-items: center;
    text-align: center;
}

.round-label {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.round-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    max-width: 100%;
}

.round-game {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.round-game-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
}

.round-game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.round-game-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.round-amount,
.round-profit {
    font-variant-numeric: tabular-nums;
}

.round-profit.positive {
    color: var(--macau-green-light);
}

.round-profit.negative {
    color: var(--text-secondary);
}

.currency-badge {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #0a0a0a;
}

.currency-badge.usdt { background: #26A17B; color: #fff; }
.currency-badge.btc { background: #F7931A; color: #fff; }
.currency-badge.eth { background: #627EEA; color: #fff; }
.currency-badge.idr { background: #E11D48; color: #fff; }
.currency-badge.inr { background: #F97316; color: #fff; }
.currency-badge.mxn { background: #10B981; color: #fff; }
.currency-badge.brl { background: #16A34A; color: #fff; }
.currency-badge.trx { background: #EF0027; color: #fff; }

/* Responsive Design */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .carousel-slide {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .nav-item span,
    .sidebar .nav-section-title {
        display: none;
    }
    
    .main-wrapper {
        margin-left: calc(60px + 0.5rem);
        margin-top: calc(80px + 0.5rem);
        margin-right: 0.5rem;
        margin-bottom: 0.5rem;
        min-height: calc(100vh - 80px - 1rem);
    }
    
    .content-container {
        padding: 1rem;
    }
    
    .games-grid .game-card {
        width: 100px;
    }
    
    .games-grid {
        gap: 0.75rem;
    }
    
    .win-card {
        width: 140px;
    }
    
    .carousel-slide {
        padding: 1.5rem;
    }
    
    .promo-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .content-container {
        padding: 0.75rem;
    }
    
    .games-grid .game-card {
        width: 80px;
    }
    
    .games-grid {
        gap: 0.5rem;
    }
    
    .win-card {
        width: 132px;
    }
    
    .carousel-slide {
        padding: 1rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--macau-green-dark);
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-top {
    display: grid;
    grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 2rem;
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    height: 40px;
    width: auto;
    display: block;
    margin-bottom: 1rem;
}

.footer-desc {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
}

.footer-license {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 10px;
}

.footer-license-badge {
    height: 34px;
    width: auto;
    display: block;
}

.footer-license-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-heading {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-link {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.625rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-green);
}

.footer-payments {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-payments img {
    height: 28px;
    width: auto;
    display: block;
    padding: 0.375rem 0.625rem;
    background-color: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    object-fit: contain;
    filter: grayscale(20%);
    opacity: 0.85;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.footer-payments img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.footer-bottom {
    padding: 1.5rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-disclaimer {
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-tertiary);
    margin: 0 0 0.75rem;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-brand {
        grid-column: 1 / -1;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .footer-top {
        grid-template-columns: 1fr;
    }
}

/* ============================================================ */
/* ===== Mobile Bottom Navigation (hidden on desktop) ===== */
.bottom-nav {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* ============================================================ */
/* ===== MOBILE STYLES (<= 900px) ===== */
@media (max-width: 900px) {

    /* ---------- Layout: remove sidebar offset ---------- */
    .main-wrapper {
        margin-left: 0 !important;
        margin-top: calc(60px + 0.5rem);
    }

    .topbar {
        left: 0 !important;
        height: 60px;
        padding: 0.5rem 0.75rem;
    }

    /* ---------- Sidebar becomes a bottom sheet ---------- */
    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 86vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 1200;
        border-radius: 18px 18px 0 0;
    }

    body.mobile-nav-open .sidebar {
        transform: translateY(0);
    }

    /* Hide the logo header inside the sheet; the banner leads the menu */
    .sidebar .sidebar-header {
        display: none;
    }

    /* hide the in-sidebar collapse toggle on mobile (use overlay/Menu) */
    .sidebar .sidebar-toggle {
        display: none;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1100;
    }

    body.mobile-nav-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    /* ---------- Topbar condense ---------- */
    .topbar-inner {
        padding: 0;
        gap: 0.5rem;
    }

    .topbar-left {
        min-width: 0;
    }

    /* show the logo top-left on mobile */
    .topbar-logo-mobile {
        display: flex;
    }

    .topbar-logo-mobile img {
        height: 40px;
    }

    /* hide the Casino/Sports/Lottery/Cock Fight pill (bottom nav handles it) */
    .topbar-menu {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
        gap: 0.5rem;
    }

    .topbar-actions .btn-secondary {
        display: none;
    }

    .topbar-actions .btn-primary {
        padding: 0.4rem 0.9rem;
        font-size: 0.8125rem;
    }

    .balance-chip {
        padding: 0.35rem 0.6rem;
        font-size: 0.8125rem;
    }

    /* ---------- Content spacing + room for bottom nav ---------- */
    .content-container {
        padding: 0.75rem 0.75rem calc(76px + env(safe-area-inset-bottom));
        max-width: 100%;
    }

    .sportsbook-view,
    .cockfight-view {
        max-width: 100%;
        padding: 0;
        height: calc(100vh - 60px - 64px - env(safe-area-inset-bottom));
    }

    /* ---------- Bottom nav ---------- */
    .bottom-nav {
        display: grid;
        grid-template-columns: 1fr auto 1fr; /* side | center deposit | side */
        align-items: stretch;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(64px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        z-index: 1150;
    }

    /* left/right groups flanking the center deposit button */
    .bottom-nav-side {
        display: flex;
        align-items: stretch;
        min-width: 0;
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 0.625rem;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: color 0.2s ease;
        position: relative;
        min-width: 0;
    }

    .bottom-nav-item svg {
        display: block;
    }

    .bottom-nav-item.active {
        color: var(--macau-green-light);
    }

    /* center deposit button: sits in the middle grid track, always dead-center */
    .bottom-nav-deposit {
        flex: 0 0 auto;
        width: 64px;
    }

    .bottom-nav-deposit-circle {
        width: 48px;
        height: 48px;
        margin-top: -22px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        background: linear-gradient(135deg, var(--macau-green-light), var(--macau-green-dark));
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 0 5px var(--bg-secondary);
    }

    /* ---------- Casino area responsive ---------- */
    .promo-carousel {
        border-radius: 12px;
    }

    .promo-carousel::after {
        width: 40px;
    }

    .games-grid .game-card {
        width: 128px;
    }

    .provider-card {
        width: 92px;
        height: 48px;
    }

    .game-category-tab span {
        font-size: 0.8125rem;
    }

    /* stack search bar above the category tabs */
    .games-menu-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }

    .games-menu-row .games-search-bar {
        order: -1;
        width: 100%;
        flex: none;
        margin-bottom: 0;
    }

    .games-menu-row .games-category-tabs {
        width: 100%;
    }

    /* Latest round rows: allow horizontal scroll */
    .latest-rounds-list {
        overflow-x: auto;
    }

    /* footer already handled above */
}

/* smaller phones */
@media (max-width: 480px) {
    .games-grid .game-card {
        width: 116px;
    }

    .topbar-actions .btn-primary {
        padding: 0.35rem 0.7rem;
    }
}

/* ============================================================
   Game Launch Modal (Games API Launcher)
   ============================================================ */
.game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.game-modal-container {
    width: 100%;
    max-width: 1100px;
    height: 85vh;
    background: #10131d;
    border: 1px solid #22293a;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-modal-header {
    height: 52px;
    background: #181d2a;
    border-bottom: 1px solid #262e40;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-modal-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-modal-badge {
    background: linear-gradient(135deg, var(--macau-green-start), var(--macau-green-end));
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.game-modal-provider {
    font-size: 13px;
    color: var(--text-secondary);
}

.game-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-modal-btn {
    background: #222a3d;
    border: 1px solid #313c54;
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.game-modal-btn:hover {
    background: #2d3854;
    color: var(--macau-green-end);
}

.game-modal-btn.close-btn:hover {
    background: #e53935;
    border-color: #e53935;
    color: #fff;
}

.game-modal-body {
    flex: 1;
    position: relative;
    background: #090b12;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-modal-loader {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    z-index: 10;
}

.game-modal-loader .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 230, 145, 0.2);
    border-top-color: var(--macau-green-end);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.game-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    z-index: 20;
    background: transparent;
}

/* ===== Auth (Sign in / Join) ===== */
.auth-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3200;
    padding: 1rem;
}

.auth-modal {
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    display: flex;
    overflow: hidden;
}

.auth-side {
    width: 46%;
    flex-shrink: 0;
}

.auth-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-main {
    flex: 1;
    min-width: 0;
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
}

.auth-modal-close,
.feature-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
}

.auth-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    padding: 0.4rem;
    z-index: 2;
}

.auth-body {
    padding: 1.6rem 1.6rem 1.2rem;
}

.auth-logo {
    height: 32px;
    display: block;
    margin: 0 auto 0.4rem;
}

.auth-heading {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.05rem;
    margin: 0 0 1rem;
}

.auth-method-tabs {
    display: flex;
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 0.9rem;
}

.auth-method-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.auth-method-tab.active {
    background: var(--text-primary);
    color: #0a0a0a;
    font-weight: 600;
}

.auth-phone-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: -0.4rem 0 0.8rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0;
}

.auth-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 0 0.9rem;
    color: var(--text-secondary);
}

.auth-field:focus-within {
    box-shadow: inset 0 0 0 1px var(--macau-green-light);
}

.auth-field svg {
    flex-shrink: 0;
}

.auth-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.8rem 0;
    outline: none;
}

.auth-eye-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    padding: 0.2rem;
}

.auth-eye-btn:hover {
    color: var(--text-primary);
}

.auth-bonus-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, var(--macau-green-start), var(--macau-green-end));
    color: #04150d;
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    user-select: none;
}

.auth-switch {
    margin-left: auto;
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}

.auth-switch::after {
    content: '';
    position: absolute;
    top: 2.5px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.15s;
}

.auth-switch.on {
    background: #04150d;
}

.auth-switch.on::after {
    left: 17px;
    background: var(--macau-green-light);
}

.auth-promo-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.2rem 0.1rem;
    cursor: pointer;
}

.auth-terms {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-terms input {
    margin-top: 2px;
    width: 15px;
    height: 15px;
    accent-color: var(--macau-green-mid);
    flex-shrink: 0;
}

.auth-link {
    color: var(--macau-green-light);
    background: none;
    border: none;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.auth-captcha {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    padding: 0.8rem 0.9rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.auth-captcha-box {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.auth-captcha-box.verified {
    background: var(--macau-green-mid);
    border-color: var(--macau-green-mid);
}

.auth-captcha-box.verified::after {
    content: '✓';
    color: #04150d;
    font-size: 13px;
    font-weight: 800;
}

.auth-error {
    color: #ff6b6b;
    font-size: 0.82rem;
}

.auth-submit {
    margin-top: 0.2rem;
    background: #3a3a44;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.8rem;
    cursor: not-allowed;
    transition: background 0.15s;
}

.auth-submit:not(:disabled) {
    background: linear-gradient(135deg, var(--macau-green-start), var(--macau-green-end));
    color: #04150d;
    cursor: pointer;
}

.auth-switch-mode {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* User chip (logged-in state) */
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 999px;
    padding: 0.3rem 0.6rem 0.3rem 0.3rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-chip:hover {
    background: var(--bg-hover);
}

.user-chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--macau-green-start), var(--macau-green-end));
    color: #04150d;
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.user-chip-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-logout-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    padding: 0.15rem;
}

.user-logout-btn:hover {
    color: #ff6b6b;
}

/* Notifications dropdown */
.topbar-actions {
    position: relative;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    z-index: 3100;
    overflow: hidden;
}

.notif-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-item-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ===== Feature modal (Promotions / VIP / Referral / Support / Info) ===== */
.feature-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3200;
    padding: 1rem;
}

.feature-modal {
    background: var(--bg-secondary);
    border: none;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.feature-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
}

.feature-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.feature-modal-body {
    padding: 0 1.25rem 1.25rem;
    overflow-y: auto;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.feature-modal-body p {
    margin: 0 0 0.75rem;
}

.promo-card {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.9rem;
    background: var(--bg-primary);
}

.promo-card img {
    width: 100%;
    display: block;
}

.promo-card-body {
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.promo-card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.promo-claim-btn {
    background: linear-gradient(135deg, var(--macau-green-start), var(--macau-green-end));
    border: none;
    border-radius: 8px;
    color: #04150d;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.45rem 1rem;
    cursor: pointer;
    white-space: nowrap;
}

.promo-claim-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.vip-tier {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.9rem;
    background: var(--bg-primary);
    border-radius: 10px;
    margin-bottom: 0.6rem;
}

.vip-tier-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #04150d;
    flex-shrink: 0;
}

.vip-tier-name {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.vip-tier-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.referral-link-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.referral-link-input {
    flex: 1;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.82rem;
    padding: 0.65rem 0.9rem;
    outline: none;
    min-width: 0;
}

.referral-copy-btn {
    background: linear-gradient(135deg, var(--macau-green-start), var(--macau-green-end));
    border: none;
    border-radius: 10px;
    color: #04150d;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0 1rem;
    cursor: pointer;
    white-space: nowrap;
}

/* Language dropdown */
.lang-wrap {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    z-index: 3100;
}

.lang-option {
    display: flex;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    text-align: left;
}

.lang-option:hover {
    background: var(--bg-hover);
}

.lang-option .lang-soon {
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.lang-option.active-lang {
    color: var(--macau-green-light);
}

@media (max-width: 768px) {
    .notif-dropdown {
        position: fixed;
        top: 60px;
        right: 1rem;
        left: 1rem;
        width: auto;
    }

    .user-chip-name {
        max-width: 70px;
    }

    .auth-side {
        display: none;
    }

    .auth-modal {
        max-width: 400px;
    }
}

/* ===== Account View (player account area) ===== */
.account-view {
    min-height: calc(100vh - 80px);
    background-color: var(--bg-primary);
}

.account-view[hidden] { display: none; }

.account-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 14px;
    padding: 1.5rem;
    flex-wrap: wrap;
}

.account-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 700;
    color: #04150d;
    background: var(--gradient-metallic);
    flex-shrink: 0;
}

.account-identity {
    flex: 1;
    min-width: 180px;
}

.account-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.account-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.2rem;
    word-break: break-all;
}

.account-balance-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.account-balance-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.account-balance {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--macau-green-light);
}

.account-balance-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.account-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.account-action:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.account-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
    align-items: start;
}

.account-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.account-card:last-child {
    margin-bottom: 0;
}

.account-card-title {
    margin: 0 0 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.account-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.account-detail-row:last-child {
    border-bottom: none;
}

.account-detail-value {
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
}

.account-security {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.account-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.88rem;
    padding: 0.65rem 0.85rem;
    outline: none;
}

.account-input:focus {
    border-color: var(--border-hover);
}

.account-pw-msg {
    font-size: 0.82rem;
    min-height: 1.2em;
}

.account-pw-msg.ok { color: var(--macau-green-light); }
.account-pw-msg.err { color: #ff5c5c; }

.account-txn {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-empty {
    color: var(--text-tertiary);
    font-size: 0.88rem;
    margin: 0;
}

.txn-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.txn-item:last-child {
    border-bottom: none;
}

.txn-item .txn-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.txn-item .txn-kind {
    color: var(--text-primary);
    font-weight: 600;
}

.txn-item .txn-meta {
    color: var(--text-tertiary);
    font-size: 0.74rem;
}

.txn-item .txn-amount {
    font-weight: 700;
    white-space: nowrap;
}

.txn-item .txn-amount.in { color: var(--macau-green-light); }
.txn-item .txn-amount.out { color: #ff5c5c; }

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .account-columns {
        grid-template-columns: 1fr;
    }

    .account-balance-box {
        align-items: flex-start;
        width: 100%;
    }
}

/* ============ Live Support Chat Widget ============ */
.chat-launcher {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    border: none;
    border-radius: 999px;
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 168, 107, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 168, 107, 0.45);
}

.chat-launcher-label { white-space: nowrap; }

.chat-launcher-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4d4f;
    border: 2px solid var(--bg-primary);
}

.chat-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 5.5rem;
    z-index: 901;
    width: 360px;
    max-width: calc(100vw - 2.5rem);
    height: 480px;
    max-height: calc(100vh - 8rem);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.chat-panel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.chat-panel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-panel-name { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); }
.chat-panel-status { font-size: 0.6875rem; color: var(--text-tertiary); }

.chat-panel-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.chat-panel-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    background: var(--bg-primary);
}

.chat-welcome {
    align-self: center;
    font-size: 0.7188rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.25rem;
}

.chat-msg {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
}

.chat-msg.agent { align-self: flex-start; }
.chat-msg.player { align-self: flex-end; align-items: flex-end; }

.chat-msg-meta {
    font-size: 0.625rem;
    color: var(--text-tertiary);
}

.chat-bubble {
    padding: 0.5625rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-msg.agent .chat-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-msg.player .chat-bubble {
    background: var(--macau-green-dark);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-panel-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chat-panel-composer textarea {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    padding: 0.5625rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.chat-panel-composer textarea:focus {
    outline: none;
    border-color: var(--macau-green-dark);
}

.chat-panel-send {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: var(--gradient-metallic);
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}

.chat-panel-send:hover { opacity: 0.9; }
.chat-panel-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
    .chat-panel { right: 0.75rem; bottom: 4.75rem; width: calc(100vw - 1.5rem); }
    .chat-launcher { right: 0.75rem; bottom: 0.75rem; }
}
