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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px 80px;
    background: #f5f5f5;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.top-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.top-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Wallet Balance */
.wallet-balance {
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.25);
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.wallet-balance:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.wallet-balance i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.wallet-balance:hover i {
    transform: rotate(15deg);
}

.balance-amount {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-link {
    text-decoration: none;
    color: white;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    position: relative;
}

.profile-initial {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.profile-initial:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.15) rotate(5deg);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#profileLink {
    display: none;
}

#logoutLink {
    display: none;
}

/* Hidden utility class */
.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Banner Slider */
.slider-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    margin-top: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.promo-banners-slider {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.banner-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    border-radius: 20px;
    overflow: hidden;
}

.banner-card.active {
    opacity: 1;
    pointer-events: auto;
}

.banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: transform 0.8s ease;
}

.banner-card:hover img {
    transform: scale(1.05);
}

/* Quick Actions */
.actions-card {
    display: flex;
    justify-content: space-around;
    background: white;
    padding: 30px 25px;
    border-radius: 25px;
    margin: 30px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.actions-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex: 1;
    max-width: 110px;
    position: relative;
}

.action-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.action-item:hover::before {
    width: 80px;
    height: 80px;
}

.action-item:hover {
    transform: translateY(-8px);
    color: #667eea;
}

.action-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 2;
}

.action-icon i {
    font-size: 24px;
    color: white;
    transition: transform 0.3s ease;
}

.action-item:hover .action-icon {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

.action-item:hover .action-icon i {
    transform: scale(1.2);
}

.action-item p {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 2;
    letter-spacing: 0.5px;
}

/* Game Section */
.game-section {
    margin: 40px 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
    font-weight: 800;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.game-card {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: #333;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    display: block;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.game-card:hover::before {
    opacity: 1;
}

.game-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
    position: relative;
    z-index: 0;
}

.game-card:hover img {
    transform: scale(1.1);
}

.restocking-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    z-index: 2;
    letter-spacing: 0.5px;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-card-title {
    padding: 20px 15px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 2;
    background: white;
}

/* Why Choose Us */
.why-choose-us {
    background: white;
    padding: 50px 30px;
    border-radius: 25px;
    margin: 50px 0;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.why-choose-us::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.section-header p {
    color: #666;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 40px 25px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card i {
    font-size: 3.5rem;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    transition: all 0.4s ease;
}

.feature-card:hover i {
    transform: scale(1.2) rotate(10deg);
}

.feature-card h3 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 700;
    font-size: 1.4rem;
    position: relative;
}

.feature-card p {
    color: #666;
    line-height: 1.8;
    margin: 0;
    font-size: 1rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
}

.nav-links {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 0.8rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex: 1;
    max-width: 90px;
    padding: 8px 0;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.nav-link i {
    font-size: 1.4rem;
    margin-bottom: 6px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 2;
}

.nav-link span {
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

.nav-link.active {
    color: #667eea;
    transform: translateY(-5px);
}

.nav-link.active::before {
    width: 40px;
}

.nav-link.active i {
    transform: scale(1.2);
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link:hover {
    color: #667eea;
    transform: translateY(-3px);
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    padding: 60px 0 25px;
    margin-top: 60px;
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 50px;
}

.footer-section h3 {
    margin-bottom: 25px;
    color: #667eea;
    font-size: 1.8rem;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.footer-section h4 {
    margin-bottom: 25px;
    color: #cbd5e0;
    font-size: 1.3rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: #667eea;
    border-radius: 1px;
}

.footer-section p {
    color: #cbd5e0;
    margin-bottom: 25px;
    line-height: 1.8;
    font-size: 1rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.social-link i {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover i {
    transform: scale(1.2);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 0;
    transition: padding-left 0.3s ease;
}

.footer-links li:hover {
    padding-left: 10px;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-block;
    position: relative;
}

.footer-links a::before {
    content: '▸';
    position: absolute;
    left: -15px;
    opacity: 0;
    transition: all 0.3s ease;
    color: #667eea;
}

.footer-links li:hover a::before {
    opacity: 1;
    left: -10px;
}

.footer-links a:hover {
    color: #667eea;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #4a5568;
    color: #cbd5e0;
    font-size: 0.95rem;
    position: relative;
}

/* Animation for low balance */
@keyframes pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

.wallet-balance.low-balance {
    animation: pulse 2s infinite;
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
}

/* Utility classes for JavaScript state management */
.wallet-visible {
    display: flex !important;
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.login-hidden {
    display: none !important;
    animation: fadeOutDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.profile-visible {
    display: flex !important;
    animation: fadeInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ensure proper image rendering */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Loading animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 0 10px 70px;
    }
    
    .header-bar {
        padding: 0 15px;
    }
    
    .wallet-balance {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .profile-initial {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .slider-container {
        height: 180px;
        margin-top: 15px;
        border-radius: 15px;
    }
    
    .actions-card {
        padding: 25px 20px;
        margin: 25px 0;
        border-radius: 20px;
    }
    
    .action-icon {
        width: 60px;
        height: 60px;
    }
    
    .action-icon i {
        font-size: 20px;
    }
    
    .action-item p {
        font-size: 12px;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
    
    .game-card img {
        height: 120px;
    }
    
    .game-card-title {
        padding: 15px 12px;
        font-size: 0.85rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 15px;
    }
    
    .nav-link {
        font-size: 0.75rem;
        max-width: 70px;
    }
    
    .nav-link i {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .actions-card {
        padding: 20px 15px;
    }
    
    .action-item {
        max-width: 80px;
    }
    
    .action-item p {
        font-size: 0.7rem;
    }
    
    .profile-initial {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .slider-container {
        height: 160px;
        margin-top: 12px;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .feature-card i {
        font-size: 3rem;
    }
    
    .nav-links {
        padding: 12px 0;
    }
    
    .nav-link {
        padding: 6px 0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wallet-balance {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .profile-initial {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .action-icon {
        background: #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .main-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .actions-card,
    .game-card,
    .feature-card,
    .why-choose-us {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .section-title,
    .feature-card h3 {
        color: #e0e0e0;
    }
    
    .feature-card p {
        color: #b0b0b0;
    }
    
    .game-card-title {
        background: #2d2d2d;
        color: #e0e0e0;
    }
}