* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

@media screen and (max-width: 500px) {
    .app-container {
        width: 100%;
    }
    
    .game-grid {
        padding: 0.5rem;
        gap: 0.5rem;
    }
}

@media screen and (min-width: 501px) {
    .app-container {
        border: 1px solid #eee;
    }
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #e03933; 
    position: relative;
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.menu-btn {
    flex-shrink: 0;
}

.register-btn {
    background-color: #e03933; 
    color: white;
    padding: 10px 20px;
    border: 2px solid rgb(255, 255, 255);
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    transition: transform 0.3s ease-in-out;
    animation: shrink 0.5s infinite alternate;
}

.register-btn:hover,
.register-btn:active {
    animation: none;
    transform: scale(1);
}

@keyframes shrink {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0.9);
    }
}

.logo img {
    max-width: 120px; 
    height: auto;
    display: block;
}

.currency {
    color: white;
}

.promotion-carousel {
    position: relative;
    height: 140px;
    overflow: hidden;
    padding: 0.5rem 1rem;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
}

.carousel-container img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out;
    opacity: 0; 
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all 0.5s ease-out;
    opacity: 0;
}

.carousel-container img:first-child {
    opacity: 1; 
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    z-index: 10;
}

.indicator {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    width: 0.75rem;
    background-color: white;
}

/* Balance Section */
.balance-section {
    padding: 0.0rem ;
}

.balance-container {
    background-color: white;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
}

.qr-section {
    padding: 0.5rem;
}

.qr-code {
    background-color: #3b82f6;
    padding: 0.375rem;
    border-radius: 0.5rem;
    color: white;
}

.divider {
    height: 2rem;
    width: 1px;
    background-color: #f3f4f6;
}

.balance-info {
    flex: 1;
    padding: 0 1rem;
    text-align: center;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
}

.balance-row {
    font-size: 0.875rem;
    color: #6b7280;
}

.balance-actions {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
}

.notification-dot {
    width: 1.25rem;
    height: 1.25rem;
    background-color: #fbbf24;
    border-radius: 9999px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 180px); 
}

.side-nav {
    width: 70px;
    flex-shrink: 0;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #fff;
    height: 100%; 
    max-height: 450px; 
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.side-nav::-webkit-scrollbar {
    width: 3px;
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

@supports (scrollbar-width: thin) {
    .side-nav {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
    }
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
    .side-nav {
        width: 4rem;
        padding: 0.25rem;
        gap: 0.5rem;
    }
}

.game-image:hover {
    transform: scale(1.02);
}

@media (hover: none) {
    .game-image:hover {
        transform: none;
    }
}

@media screen and (max-width: 480px) {
    .side-nav {
        width: 4rem;
        padding: 0.25rem;
        gap: 0.5rem;
    }
    
    .nav-button {
        padding: 0.375rem;
        font-size: 0.7rem;
    }
}

@media screen and (max-width: 320px) {
    .game-grid {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .game-card {
        height: 80px;
        font-size: 0.8rem;
    }
}

.game-card.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    font-size: 0.75rem;
    gap: 0.25rem;
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .game-image {
        padding-bottom: 100%;
    }
}

@media screen and (min-width: 481px) and (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }
    
    .game-image {
        padding-bottom: 100%;
    }
}

@media screen and (min-width: 769px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .game-image {
        padding-bottom: 100%;
    }
}

.app-container {
    width: 100%;
    max-width: 500px; 
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

.nav-button.active {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.game-grid {
    flex: 1;
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    overflow-y: auto; 
    align-items: start;
    align-content: start;
    width: 100%;
    max-height: calc(100vh - 240px);
    padding-bottom: 8rem;
}

@media screen and (min-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .game-card {
        height: 120px;
    }
}

@media screen and (min-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    .game-card {
        height: 120px;
    }
}

.game-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease;
    text-align: left;
}

.game-button:hover {
    transform: scale(1.02);
}

.game-card {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    width: 100%;
    height: 100px;
    background-color: transparent;
}

.game-image {
    position: relative;
    width: 100%;
    padding-bottom: 70%; 
    border-radius: 0.75rem;
    background-color: transparent;
    overflow: hidden;
}

.game-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

.game-card:hover .game-image {
    transform: scale(1.05);
}

.header-section {
    flex-shrink: 0;
    width: 100%;
}

.bottom-nav {
    height: 60px;
    width: 100%;
    max-width: 500px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    position: fixed;
    bottom: 0;
    padding: 0.5rem 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #4b5563;
}

.nav-item:last-child {
    border-right: none;
}

.nav-icon {
    margin-bottom: 0.125rem;
}

.nav-item svg {
    width: 1.5rem;
    height: 1.5rem;
}

.game-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.game-link:hover .game-image {
    transform: scale(1.02);
}

.game-image {
    transition: transform 0.2s ease;
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.game-grid img {
    pointer-events: auto !important;
}

.btn:hover {
    background-color: #0056b3;
}

.game-grid img {
    pointer-events: auto !important;
}

