/* ==========================================================================
   Theme-E Games & Categories Stylesheet
   Matches Photo 2 (Slots), Photo 3 (Mini games), Photo 4 (Casino), Photo 5 (PVC)
   Complete support for Lottery, Popular, Slots, Mini games, Fishing, Casino, PVC, Sports
   ========================================================================== */

/* Body Overrides */
body.theme-e-games-active,
body.lottery-page-active {
    background-color: #001b58 !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Responsive Container Sizing */
@media screen and (min-width: 501px) {
    body.theme-e-games-active #app,
    body.lottery-page-active #app,
    #theme-e-games-root,
    #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.theme-e-games-active #app,
    body.lottery-page-active #app,
    #theme-e-games-root,
    #theme-e-lottery-root {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* Hide all other children inside #app except our Theme-E Games container */
body.theme-e-games-active #app > *:not(#theme-e-games-root):not(#theme-e-lottery-root),
body.lottery-page-active #app > *:not(#theme-e-games-root):not(#theme-e-lottery-root) {
    display: none !important;
}

/* Hide bottom tabbar, app header, and native wrappers */
body.theme-e-games-active .tabbar-container,
body.theme-e-games-active .app-tabber,
body.theme-e-games-active header.nav-header,
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 Games */
#theme-e-games-root,
#theme-e-lottery-root {
    width: 100% !important;
    min-height: 100vh !important;
    background: #001b58 !important;
    position: relative !important;
    z-index: 100 !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: 50px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

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

.games-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: #f5f3f0 !important;
    transition: opacity 0.2s ease !important;
    z-index: 2 !important;
}

.games-back-btn:active {
    opacity: 0.6 !important;
}

.games-back-btn svg {
    width: 24px !important;
    height: 24px !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    fill: none !important;
}

.games-header-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #f5f3f0 !important;
    letter-spacing: 0.3px !important;
    text-align: center !important;
}

/* Horizontal Categories Scroll Row */
.games-categories-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    background: #001b58 !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

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

.games-categories-row {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.games-category-tab {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 80px !important;
    padding: 5px 12px !important;
    margin: 3px 2px !important;
    border-radius: 5px !important;
    background: #001b58 !important;
    color: #a8a5a1 !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    border: 1px solid transparent !important;
}

.games-category-tab.active {
    background: linear-gradient(180deg, #3250d4 0%, #07157c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(50, 80, 212, 0.45) !important;
}

.games-category-tab:active {
    transform: scale(0.96) !important;
}

.games-tab-icon {
    width: 25px !important;
    height: 25px !important;
    object-fit: contain !important;
    margin-bottom: 2px !important;
    display: block !important;
}

.games-tab-label {
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.games-category-tab.active .games-tab-label {
    font-weight: 600 !important;
}

/* Section Title (| JILI Slots, | Mini games, | Casino, etc.) */
.games-section-title {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    margin: 16px 14px 10px 14px !important;
    display: flex !important;
    align-items: center !important;
    letter-spacing: 0.2px !important;
}

.games-section-title .blue-pipe {
    color: #3250d4 !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    margin-right: 8px !important;
    display: inline-block !important;
}

/* 3-Column Games Grid */
.games-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
}

.game-item-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    background: #091338 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.game-item-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(50, 80, 212, 0.3) !important;
}

.game-item-card:active {
    transform: scale(0.96) !important;
}

/* Aspect Ratios: Square for Slots/Fishing, 3:4 for others */
.game-item-card.aspect-square {
    aspect-ratio: 1 / 1 !important;
}

.game-item-card.aspect-tall {
    aspect-ratio: 3 / 4 !important;
}

.game-item-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 8px !important;
}

/* Centered Pill Button: "All Games" */
.all-games-btn-wrap {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 12px 0 16px 0 !important;
}

.all-games-pill-btn {
    background: linear-gradient(180deg, #3250d4 0%, #07157c 100%) !important;
    color: #ffffff !important;
    text-transform: none !important;
    border-radius: 40px !important;
    padding: 7px 34px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.2s ease !important;
}

.all-games-pill-btn:hover {
    box-shadow: 0 4px 12px rgba(50, 80, 212, 0.45) !important;
    filter: brightness(1.08) !important;
}

.all-games-pill-btn:active {
    transform: scale(0.96) !important;
}

/* Provider View (when All Games is clicked) */
.provider-view-header {
    display: flex !important;
    align-items: center !important;
    padding: 10px 14px !important;
    gap: 10px !important;
}

.provider-search-box {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    background: #001b58 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 50px !important;
    padding: 4px 14px !important;
}

.provider-search-box input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    font-size: 13px !important;
    width: 100% !important;
    margin-left: 8px !important;
}

.provider-search-box input::placeholder {
    color: #8c9ba5 !important;
}

.provider-subtabs-row {
    display: flex !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding: 8px 14px 14px 14px !important;
    scrollbar-width: none !important;
}

.provider-subtabs-row::-webkit-scrollbar {
    display: none !important;
}

.provider-subtab {
    padding: 6px 18px !important;
    border-radius: 8px !important;
    background: #001b58 !important;
    color: #a8a5a1 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
}

.provider-subtab.active {
    background: linear-gradient(180deg, #3250d4 0%, #07157c 100%) !important;
    color: #ffffff !important;
}

.provider-back-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: #4371ee !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin: 8px 14px 12px 14px !important;
}

/* ==========================================================================
   Lottery View Cards (Preserved 1:1 from previously approved implementation)
   ========================================================================== */
.lottery-cards-container {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.theme-e-lottery-card {
    width: 100% !important;
    height: 96px !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #3250d4 0%, #07157c 100%) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 14px 0 20px !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    text-decoration: none !important;
}

.theme-e-lottery-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(50, 80, 212, 0.45) !important;
}

.theme-e-lottery-card:active {
    transform: scale(0.98) !important;
}

.lottery-card-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    z-index: 2 !important;
    max-width: 65% !important;
}

.lottery-card-title {
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 0 6px 0 !important;
    letter-spacing: 0.3px !important;
    line-height: 1.1 !important;
}

.lottery-card-desc1,
.lottery-card-desc2 {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
}

.lottery-card-image-wrap {
    width: 95px !important;
    height: 95px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 2 !important;
}

.lottery-card-image {
    max-width: 90px !important;
    max-height: 90px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)) !important;
    display: block !important;
}
