/* Mobile-specific styles */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }
    
    .site-logo {
        max-width: 180px;
    }
    
    .tagline {
        font-size: 1.1rem;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .game-image {
        height: 180px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .mobile-apps h2 {
        font-size: 1.7rem;
    }
    
    .app-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.7rem;
    }
    
    .site-logo {
        max-width: 150px;
    }
    
    .tagline, .instruction {
        font-size: 0.95rem;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .mobile-apps h2 {
        font-size: 1.5rem;
    }
    
    .app-icon {
        font-size: 2rem;
    }
    
    .app-text strong {
        font-size: 1.1rem;
    }
    
    .game-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .game-container {
        padding: 1rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) {
    .game-card:hover {
        transform: none;
    }
    
    .play-button:hover {
        transform: none;
    }
    
    .app-link:hover {
        transform: none;
    }
    
    .back-button:hover {
        transform: none;
    }
    
    .itch-link:hover {
        transform: none;
    }
}

/* Accessibility improvements */
.play-button:focus,
.app-link:focus,
.back-button:focus,
.itch-link:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    }
    
    .game-card {
        border: 2px solid var(--dark-color);
    }
}

/* New Mobile Modal Styles */
.mobile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none; /* Hidden by default, JS shows it */
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.mobile-modal {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease-out;
}

.mobile-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mobile-modal h3 {
    color: var(--dark-color, #333);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.mobile-modal p {
    color: var(--text-light, #666);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.mobile-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Matches your theme */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: transform 0.2s;
}

.mobile-btn:active {
    transform: scale(0.98);
}

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