/* ==========================================================================
   Theme-E Lottery & All Games Stylesheet
   Matches Photo 2 (theme-e.anotechsolutions.shop/all-games/Popular)
   Enhanced with JANTAWIN Luxury Styling
   Strictly isolated to Lottery page (body.lottery-page-active)
   ========================================================================== */

/* Body Overrides */
body.lottery-page-active {
    background-color: #021447 !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Responsive Container Sizing */
@media screen and (min-width: 501px) {
    body.lottery-page-active #app,
    body.lottery-page-active .allgame-wrapper,
    #theme-e-lottery-root {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
    }
}

@media screen and (max-width: 500px) {
    body.lottery-page-active #app,
    body.lottery-page-active .allgame-wrapper,
    #theme-e-lottery-root {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* Hide native elements when lottery is active, preserving Theme-E containers */
body.lottery-page-active #app > *:not(#theme-e-games-root):not(#theme-e-lottery-root):not(.allgame-wrapper) {
    display: none !important;
}

body.lottery-page-active .allgame-wrapper > *:not(#theme-e-games-root):not(#theme-e-lottery-root) {
    display: none !important;
}

#theme-e-games-root,
#theme-e-lottery-root {
    display: block !important;
    visibility: visible !important;
}

body.lottery-page-active .allgame-wrapper {
    background: #021447 !important;
    background-color: #021447 !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 100vh !important;
}

body.lottery-page-active .search-bar,
body.lottery-page-active .category-tabs,
body.lottery-page-active .category-panel,
body.lottery-page-active .game-menu,
body.lottery-page-active .gameListGrid__container,
body.lottery-page-active .game-grid,
body.lottery-page-active .slots-page,
body.lottery-page-active .empty-state,
body.lottery-page-active .tabbar-container,
body.lottery-page-active .app-tabber,
body.lottery-page-active header.nav-header {
    display: none !important;
}

/* Root Container for Theme-E Lottery */
#theme-e-lottery-root {
    width: 100% !important;
    min-height: 100vh !important;
    background: #021447 !important;
    position: relative !important;
    z-index: 99999 !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    padding-bottom: 40px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Top App Header with absolute pinned buttons */
.lottery-header {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 48px !important;
    background: #00287a !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 100 !important;
    box-sizing: border-box !important;
    padding: 0 46px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.lottery-back-btn {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #ffffff !important;
    transition: opacity 0.2s ease !important;
}

.lottery-back-btn:active {
    opacity: 0.7 !important;
}

.lottery-back-btn svg {
    width: 22px !important;
    height: 22px !important;
    stroke: #ffffff !important;
    stroke-width: 2.8 !important;
    fill: none !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

.lottery-header-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: 0.2px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Horizontal Category Tabs Bar */
.lottery-categories-wrap {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px 6px 12px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}

.lottery-categories-wrap::-webkit-scrollbar {
    display: none !important;
}

.lottery-categories-row {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    width: max-content !important;
}

.lottery-category-tab {
    min-width: 76px !important;
    height: 52px !important;
    border-radius: 8px !important;
    background: #041a54 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    padding: 4px 8px !important;
}

.lottery-category-tab.active {
    background: linear-gradient(180deg, #3d5bf5 0%, #1c36b8 100%) !important;
    box-shadow: 0 4px 14px rgba(45, 90, 245, 0.45) !important;
    border: 1px solid #5a75fa !important;
}

.lottery-tab-icon {
    font-size: 18px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lottery-tab-label {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    color: #8fa6d9 !important;
    letter-spacing: 0.1px !important;
}

.lottery-category-tab.active .lottery-tab-label {
    color: #ffd24d !important;
    font-weight: 700 !important;
}

/* Section Header (| Lottery) */
.lottery-section-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 14px 8px 14px !important;
    box-sizing: border-box !important;
}

.lottery-section-bar {
    width: 3.5px !important;
    height: 16px !important;
    border-radius: 2px !important;
    background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%) !important;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5) !important;
}

.lottery-section-text {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: 0.1px !important;
}

/* 4 Lottery Game Cards */
.lottery-cards-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 2px 12px 20px 12px !important;
    box-sizing: border-box !important;
}

.lottery-game-card {
    width: 100% !important;
    height: 74px !important;
    border-radius: 12px !important;
    background: linear-gradient(90deg, #1b4bcf 0%, #153896 60%, #0a1b52 100%) !important;
    border: 1.5px solid rgba(59, 130, 246, 0.4) !important;
    box-shadow: 0 4px 16px rgba(0, 15, 60, 0.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    overflow: hidden !important;
    position: relative !important;
    user-select: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.lottery-game-card:hover {
    border-color: rgba(96, 165, 250, 0.7) !important;
    box-shadow: 0 6px 20px rgba(27, 75, 207, 0.5) !important;
}

.lottery-game-card:active {
    transform: scale(0.985) !important;
}

.lottery-card-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding-left: 14px !important;
    box-sizing: border-box !important;
    z-index: 2 !important;
}

.lottery-card-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 4px !important;
    letter-spacing: 0.15px !important;
}

.lottery-card-desc {
    font-size: 11px !important;
    line-height: 1.35 !important;
    color: #9bb6eb !important;
    font-weight: 400 !important;
}

.lottery-card-badge {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    line-height: 0 !important;
    position: relative !important;
    z-index: 2 !important;
}

.lottery-badge-img {
    height: 100% !important;
    width: auto !important;
    display: block !important;
    object-fit: contain !important;
}

