/* Bottom Navigation Bar for Mobile PWA */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 9998;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 4px;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active {
    color: #667eea;
}

.bottom-nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.2);
}

.bottom-nav-label {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* Ripple effect on tap */
.bottom-nav-item {
    position: relative;
    overflow: hidden;
}

.bottom-nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.bottom-nav-item:active::after {
    width: 100px;
    height: 100px;
}

/* Add padding to body to prevent content being hidden behind nav */
body.has-bottom-nav {
    padding-bottom: 70px;
}

/* Hide on desktop */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    
    body.has-bottom-nav {
        padding-bottom: 0;
    }
}

/* Smooth show/hide animation */
.bottom-nav {
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.bottom-nav.hidden {
    transform: translateY(100%);
}

/* Badge for notifications */
.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 16px);
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Games Menu Modal */
.games-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.games-menu-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.games-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.games-menu-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #4c1d95;
    margin: 0;
}

.games-menu-close {
    background: #f3f4f6;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.games-menu-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.games-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.game-menu-item {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 3px solid #e5e7eb;
    border-radius: 15px;
    padding: 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.game-menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.game-menu-icon {
    font-size: 48px;
}

.game-menu-name {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

@media (max-width: 480px) {
    .games-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-menu-item {
        padding: 15px;
    }
    
    .game-menu-icon {
        font-size: 40px;
    }
}
